diff --git a/Autogenerated/Bindings/C/lib3mf.h b/Autogenerated/Bindings/C/lib3mf.h index 80ba9cd19..30d8be84d 100644 --- a/Autogenerated/Bindings/C/lib3mf.h +++ b/Autogenerated/Bindings/C/lib3mf.h @@ -66,6 +66,78 @@ extern "C" { */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_base_classtypeid(Lib3MF_Base pBase, Lib3MF_uint64 * pClassTypeId); +/************************************************************************************************************************* + Class definition for BinaryStream +**************************************************************************************************************************/ + +/** +* Retrieves an binary streams package path for the binary data. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of binary streams package binary path., may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_binarystream_getbinarypath(Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Retrieves an binary streams package path for the index data. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of binary streams package index path., may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_binarystream_getindexpath(Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Retrieves an binary streams uuid. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of binary streams uuid, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_binarystream_getuuid(Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); + +/** +* Sets the float compression mode to raw. All subsequent writes will adhere to this mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_binarystream_disablediscretizedarraycompression(Lib3MF_BinaryStream pBinaryStream); + +/** +* Sets the compression mode to a quantized array. All subsequent writes will adhere to this mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] dUnits - Unit factor to use for quantization. +* @param[in] ePredictionType - Prediction type to use for arrays. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_binarystream_enablediscretizedarraycompression(Lib3MF_BinaryStream pBinaryStream, Lib3MF_double dUnits, eLib3MFBinaryStreamPredictionType ePredictionType); + +/** +* Enables LZMA mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nLZMALevel - LZMA Level (0-9) +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_binarystream_enablelzma(Lib3MF_BinaryStream pBinaryStream, Lib3MF_uint32 nLZMALevel); + +/** +* Disables LZMA mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_binarystream_disablelzma(Lib3MF_BinaryStream pBinaryStream); + /************************************************************************************************************************* Class definition for Writer **************************************************************************************************************************/ @@ -199,10 +271,80 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_writer_addkeywrappingcallback(Lib3MF_Writer */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_writer_setcontentencryptioncallback(Lib3MF_Writer pWriter, Lib3MFContentEncryptionCallback pTheCallback, Lib3MF_pvoid pUserData); +/** +* Creates a binary stream object. Only applicable for 3MF Writers. +* +* @param[in] pWriter - Writer instance. +* @param[in] pIndexPath - Package path to write the index into +* @param[in] pBinaryPath - Package path to write raw binary data into +* @param[out] pBinaryStream - Returns a package path. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_writer_createbinarystream(Lib3MF_Writer pWriter, const char * pIndexPath, const char * pBinaryPath, Lib3MF_BinaryStream * pBinaryStream); + +/** +* Sets a binary stream for an object. Currently supported objects are Meshes and Toolpath layers. +* +* @param[in] pWriter - Writer instance. +* @param[in] pInstance - Object instance to assign Binary stream to. +* @param[in] pBinaryStream - Binary stream object to use for this layer. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_writer_assignbinarystream(Lib3MF_Writer pWriter, Lib3MF_Base pInstance, Lib3MF_BinaryStream pBinaryStream); + +/** +* Registers a custom 3MF Namespace. Fails if Prefix is already registered. +* +* @param[in] pWriter - Writer instance. +* @param[in] pPrefix - Prefix to be used. MUST NOT be empty. MUST be alphanumeric, not starting with a number +* @param[in] pNameSpace - Namespace to be used. MUST NOT be empty. MUST be alphanumeric, not starting with a number +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_writer_registercustomnamespace(Lib3MF_Writer pWriter, const char * pPrefix, const char * pNameSpace); + +/************************************************************************************************************************* + Class definition for PersistentReaderSource +**************************************************************************************************************************/ + +/** +* Retrieves the type of source data. +* +* @param[in] pPersistentReaderSource - PersistentReaderSource instance. +* @param[out] pSourceType - Reader Source Type +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_persistentreadersource_getsourcetype(Lib3MF_PersistentReaderSource pPersistentReaderSource, eLib3MFPersistentReaderSourceType * pSourceType); + +/** +* Invalidates the reader source. Every subsequent read on this data will fail. +* +* @param[in] pPersistentReaderSource - PersistentReaderSource instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_persistentreadersource_invalidatesourcedata(Lib3MF_PersistentReaderSource pPersistentReaderSource); + +/** +* Checks if the source data is valid. Any read on an invalid source object will fail. +* +* @param[in] pPersistentReaderSource - PersistentReaderSource instance. +* @param[out] pDataIsValid - The source data is valid. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_persistentreadersource_sourcedataisvalid(Lib3MF_PersistentReaderSource pPersistentReaderSource, bool * pDataIsValid); + /************************************************************************************************************************* Class definition for Reader **************************************************************************************************************************/ +/** +* Reads a model from a persistent source object. The object will be referenced until the Model is destroyed or cleared. +* +* @param[in] pReader - Reader instance. +* @param[in] pSource - Source object to read from +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_reader_readfrompersistentsource(Lib3MF_Reader pReader, Lib3MF_PersistentReaderSource pSource); + /** * Reads a model from a file. The file type is specified by the Model Reader class * @@ -446,1987 +588,3252 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_resourceiterator_clone(Lib3MF_ResourceIterat LIB3MF_DECLSPEC Lib3MFResult lib3mf_resourceiterator_count(Lib3MF_ResourceIterator pResourceIterator, Lib3MF_uint64 * pCount); /************************************************************************************************************************* - Class definition for SliceStackIterator + Class definition for CustomXMLAttribute **************************************************************************************************************************/ /** -* Returns the SliceStack the iterator points at. +* Retrieves name of the attribute. * -* @param[in] pSliceStackIterator - SliceStackIterator instance. -* @param[out] pResource - returns the SliceStack instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the attribute., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slicestackiterator_getcurrentslicestack(Lib3MF_SliceStackIterator pSliceStackIterator, Lib3MF_SliceStack * pResource); - -/************************************************************************************************************************* - Class definition for ObjectIterator -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_getname(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Returns the Object the iterator points at. +* Retrieves value of the attribute as string. * -* @param[in] pObjectIterator - ObjectIterator instance. -* @param[out] pResource - returns the Object instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of returns the value of the attribute., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_objectiterator_getcurrentobject(Lib3MF_ObjectIterator pObjectIterator, Lib3MF_Object * pResource); - -/************************************************************************************************************************* - Class definition for MeshObjectIterator -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_getvalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* Returns the MeshObject the iterator points at. +* Checks if the value is a valid integer in the given range. * -* @param[in] pMeshObjectIterator - MeshObjectIterator instance. -* @param[out] pResource - returns the MeshObject instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nMinValue - Minimum allowed value +* @param[in] nMaxValue - Maximum allowed value +* @param[out] pIsValid - returns if the value is a valid integer. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobjectiterator_getcurrentmeshobject(Lib3MF_MeshObjectIterator pMeshObjectIterator, Lib3MF_MeshObject * pResource); - -/************************************************************************************************************************* - Class definition for ComponentsObjectIterator -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_isvalidinteger(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nMinValue, Lib3MF_int64 nMaxValue, bool * pIsValid); /** -* Returns the ComponentsObject the iterator points at. +* Returns the value as integer. Fails if the value is not a valid integer in the given range. * -* @param[in] pComponentsObjectIterator - ComponentsObjectIterator instance. -* @param[out] pResource - returns the ComponentsObject instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nMinValue - Minimum allowed value +* @param[in] nMaxValue - Maximum allowed value +* @param[out] pValue - returns the value. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobjectiterator_getcurrentcomponentsobject(Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource); - -/************************************************************************************************************************* - Class definition for Texture2DIterator -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_getintegervalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nMinValue, Lib3MF_int64 nMaxValue, Lib3MF_int64 * pValue); /** -* Returns the Texture2D the iterator points at. +* Checks if the value is a valid double in the given range. * -* @param[in] pTexture2DIterator - Texture2DIterator instance. -* @param[out] pResource - returns the Texture2D instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dMinValue - Minimum allowed value +* @param[in] dMaxValue - Maximum allowed value +* @param[out] pIsValid - returns if the value is a valid double. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2diterator_getcurrenttexture2d(Lib3MF_Texture2DIterator pTexture2DIterator, Lib3MF_Texture2D * pResource); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_isvaliddouble(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, bool * pIsValid); -/************************************************************************************************************************* - Class definition for BaseMaterialGroupIterator -**************************************************************************************************************************/ +/** +* Returns the value as double. Fails if the value is not a valid double in the given range. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dMinValue - Minimum allowed value +* @param[in] dMaxValue - Maximum allowed value +* @param[out] pValue - returns the value . +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_getdoublevalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, Lib3MF_double * pValue); /** -* Returns the MaterialGroup the iterator points at. +* Checks if the value is a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. * -* @param[in] pBaseMaterialGroupIterator - BaseMaterialGroupIterator instance. -* @param[out] pResource - returns the BaseMaterialGroup instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[out] pIsValid - returns if the value is a valid bool. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup(Lib3MF_BaseMaterialGroupIterator pBaseMaterialGroupIterator, Lib3MF_BaseMaterialGroup * pResource); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_isvalidbool(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, bool * pIsValid); -/************************************************************************************************************************* - Class definition for ColorGroupIterator -**************************************************************************************************************************/ +/** +* Returns the value as bool. Fails if the value is not a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dMinValue - Minimum allowed value +* @param[in] dMaxValue - Maximum allowed value +* @param[out] pValue - returns the value . +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_getboolvalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, bool * pValue); /** -* Returns the ColorGroup the iterator points at. +* Sets the value of the attribute as string. * -* @param[in] pColorGroupIterator - ColorGroupIterator instance. -* @param[out] pResource - returns the ColorGroup instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] pValue - new value of the attribute. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroupiterator_getcurrentcolorgroup(Lib3MF_ColorGroupIterator pColorGroupIterator, Lib3MF_ColorGroup * pResource); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_setvalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const char * pValue); -/************************************************************************************************************************* - Class definition for Texture2DGroupIterator -**************************************************************************************************************************/ +/** +* Sets the value of the attribute as integer. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nValue - new value of the attribute. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_setintegervalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nValue); /** -* Returns the Texture2DGroup the iterator points at. +* Sets the value of the attribute as double. * -* @param[in] pTexture2DGroupIterator - Texture2DGroupIterator instance. -* @param[out] pResource - returns the Texture2DGroup instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dValue - new value of the attribute. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup(Lib3MF_Texture2DGroupIterator pTexture2DGroupIterator, Lib3MF_Texture2DGroup * pResource); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_setdoublevalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dValue); -/************************************************************************************************************************* - Class definition for CompositeMaterialsIterator -**************************************************************************************************************************/ +/** +* Sets the value of the attribute as bool. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] bValue - new value of the attribute. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_setboolvalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, bool bValue); /** -* Returns the CompositeMaterials the iterator points at. +* Removes the attribute from its parent node. All subsequent calls to the class will fail. * -* @param[in] pCompositeMaterialsIterator - CompositeMaterialsIterator instance. -* @param[out] pResource - returns the CompositeMaterials instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerialsiterator_getcurrentcompositematerials(Lib3MF_CompositeMaterialsIterator pCompositeMaterialsIterator, Lib3MF_CompositeMaterials * pResource); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_remove(Lib3MF_CustomXMLAttribute pCustomXMLAttribute); /************************************************************************************************************************* - Class definition for MultiPropertyGroupIterator + Class definition for CustomXMLNode **************************************************************************************************************************/ /** -* Returns the MultiPropertyGroup the iterator points at. +* Retrieves name of the node. * -* @param[in] pMultiPropertyGroupIterator - MultiPropertyGroupIterator instance. -* @param[out] pResource - returns the MultiPropertyGroup instance. +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the node., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup(Lib3MF_MultiPropertyGroupIterator pMultiPropertyGroupIterator, Lib3MF_MultiPropertyGroup * pResource); - -/************************************************************************************************************************* - Class definition for MetaData -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_getname(Lib3MF_CustomXMLNode pCustomXMLNode, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* returns the namespace URL of the metadata +* Retrieves namespace of the node. * -* @param[in] pMetaData - MetaData instance. +* @param[in] pCustomXMLNode - CustomXMLNode instance. * @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) * @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameSpaceBuffer - buffer of the namespace URL of the metadata, may be NULL +* @param[out] pNameSpaceBuffer - buffer of returns the namespace of the node., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getnamespace(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_getnamespace(Lib3MF_CustomXMLNode pCustomXMLNode, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* sets a new namespace URL of the metadata +* Returns number of attributes. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pNameSpace - the new namespace URL of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[out] pCount - returns the number of attributes. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_setnamespace(Lib3MF_MetaData pMetaData, const char * pNameSpace); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_getattributecount(Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 * pCount); /** -* returns the name of a metadata +* Returns attribute instance. Fails if Index is out of range. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of the name of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] nIndex - Index of the attribute to return (0-based). +* @param[out] pAttributeInstance - XML Document attribute. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getname(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_getattribute(Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 nIndex, Lib3MF_CustomXMLAttribute * pAttributeInstance); /** -* sets a new name of a metadata +* Returns if attribute of a specific name exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pName - the new name of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[out] pAttributeExists - Returns if the attribute exists. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_setname(Lib3MF_MetaData pMetaData, const char * pName); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_hasattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pAttributeExists); /** -* returns the (namespace+name) of a metadata +* Returns attribute instance of a specific name. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nKeyBufferSize - size of the buffer (including trailing 0) -* @param[out] pKeyNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pKeyBuffer - buffer of the key (namespace+name) of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] bMustExist - If true, the call fails if attribute does not exist. If falls, the call will return null if the attribute does not exist. +* @param[out] pAttributeInstance - XML Document attribute. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getkey(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nKeyBufferSize, Lib3MF_uint32* pKeyNeededChars, char * pKeyBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_findattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bMustExist, Lib3MF_CustomXMLAttribute * pAttributeInstance); /** -* returns, whether a metadata must be preserved +* Removes the attribute with a specific name. Does nothing if attribute does not exist. * -* @param[in] pMetaData - MetaData instance. -* @param[out] pMustPreserve - returns, whether a metadata must be preserved +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[out] pAttributeRemoved - Returns true if an attribute was removed. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getmustpreserve(Lib3MF_MetaData pMetaData, bool * pMustPreserve); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_removeattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pAttributeRemoved); /** -* sets whether a metadata must be preserved +* Removes the attribute with a specific index. Fails if index is invalid * -* @param[in] pMetaData - MetaData instance. -* @param[in] bMustPreserve - a new value whether a metadata must be preserved +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] nIndex - Index of the attribute to remove (0-based). +* @param[out] pAttributeRemoved - Returns true if an attribute was removed. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_setmustpreserve(Lib3MF_MetaData pMetaData, bool bMustPreserve); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_removeattributebyindex(Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 nIndex, bool * pAttributeRemoved); /** -* returns the type of a metadata +* Adds an attribute with a specific name and string value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nTypeBufferSize - size of the buffer (including trailing 0) -* @param[out] pTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pTypeBuffer - buffer of the type of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] pValue - Value of the attribute. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_gettype(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nTypeBufferSize, Lib3MF_uint32* pTypeNeededChars, char * pTypeBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_addattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, const char * pValue); /** -* sets a new type of a metadata. This must be a simple XML type +* Adds an attribute with a specific name and integer value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pType - a new type of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] nValue - Value of the attribute. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_settype(Lib3MF_MetaData pMetaData, const char * pType); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_addintegerattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_int64 nValue); /** -* returns the value of the metadata +* Adds an attribute with a specific name and double value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nValueBufferSize - size of the buffer (including trailing 0) -* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pValueBuffer - buffer of the value of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] dValue - Value of the attribute. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getvalue(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_adddoubleattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_double dValue); /** -* sets a new value of the metadata +* Adds an attribute with a specific name and bool value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pValue - a new value of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] bValue - Value of the attribute. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_setvalue(Lib3MF_MetaData pMetaData, const char * pValue); - -/************************************************************************************************************************* - Class definition for MetaDataGroup -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_addboolattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bValue); /** -* returns the number of metadata in this metadatagroup +* Returns all the child nodes of the XML Node. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[out] pCount - returns the number metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[out] pChildNodes - returns the list of child nodes. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_getmetadatacount(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_getchildren(Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_CustomXMLNodes * pChildNodes); /** -* returns a metadata value within this metadatagroup +* Returns how many children of the XML Node have a specific name. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] nIndex - Index of the Metadata. -* @param[out] pMetaData - an instance of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the node. +* @param[out] pCount - returns the number children with the specified name. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_getmetadata(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex, Lib3MF_MetaData * pMetaData); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_countchildrenbyname(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_uint64 * pCount); /** -* returns a metadata value within this metadatagroup +* Returns all the child nodes of the XML Node with a specific name. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] pNameSpace - the namespace of the metadata -* @param[in] pName - the name of the Metadata -* @param[out] pMetaData - an instance of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildNodes - returns the list of child nodes. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_getmetadatabykey(Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, Lib3MF_MetaData * pMetaData); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_getchildrenbyname(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_CustomXMLNodes * pChildNodes); /** -* removes metadata by index from the model. +* Returns if a child with a specific name exist. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] nIndex - Index of the metadata to remove +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildExists - returns if a child with a specific name exists. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_removemetadatabyindex(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_haschild(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pChildExists); /** -* removes metadata from the model. +* Returns if a child with a specific name exist once and only once. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] pTheMetaData - The metadata to remove +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildExists - returns if a child with a specific name exists once and only once. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_removemetadata(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_MetaData pTheMetaData); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_hasuniquechild(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pChildExists); /** -* adds a new metadata to this metadatagroup +* Returns child with a specific name. Throws an error if name does not exist once and only once. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] pNameSpace - the namespace of the metadata -* @param[in] pName - the name of the metadata -* @param[in] pValue - the value of the metadata -* @param[in] pType - the type of the metadata -* @param[in] bMustPreserve - shuold the metadata be preserved -* @param[out] pMetaData - a new instance of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[in] bMustExist - If true, the call fails if child does not exist. If falls, the call will return null if the child does not exist. +* @param[out] pChildInstance - returns child instance or null. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_addmetadata(Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, const char * pValue, const char * pType, bool bMustPreserve, Lib3MF_MetaData * pMetaData); - -/************************************************************************************************************************* - Class definition for Object -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_findchild(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bMustExist, Lib3MF_CustomXMLNode * pChildInstance); /** -* Retrieves an object's type +* Adds a new child with a specific name. * -* @param[in] pObject - Object instance. -* @param[out] pObjectType - returns object type enum. +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildInstance - returns child instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_gettype(Lib3MF_Object pObject, eLib3MFObjectType * pObjectType); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_addchild(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_CustomXMLNode * pChildInstance); /** -* Sets an object's type +* Removes a specific child. All subsequent calls to the child will fail after the call. * -* @param[in] pObject - Object instance. -* @param[in] eObjectType - object type enum. +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pChildInstance - child instance to remove. Fails if given instance is not a child of the node. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_settype(Lib3MF_Object pObject, eLib3MFObjectType eObjectType); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_removechild(Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_CustomXMLNode pChildInstance); /** -* Retrieves an object's name +* Removes all children with a specific name. Does nothing if no child with the name exists. All subsequent calls to the deleted children will fail after the call. * -* @param[in] pObject - Object instance. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of returns object name., may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the children. +* @param[out] pNumberOfDeletedChildren - Returns how many children have been deleted. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getname(Lib3MF_Object pObject, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_removechildrenwithname(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_uint64 * pNumberOfDeletedChildren); /** -* Sets an object's name string +* Removes the node from its parent. The root node of the document can not be removed. Any subsequent call to the node fails after this. * -* @param[in] pObject - Object instance. -* @param[in] pName - new object name. +* @param[in] pCustomXMLNode - CustomXMLNode instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setname(Lib3MF_Object pObject, const char * pName); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_remove(Lib3MF_CustomXMLNode pCustomXMLNode); + +/************************************************************************************************************************* + Class definition for CustomXMLNodes +**************************************************************************************************************************/ /** -* Retrieves an object's part number +* Returns number of nodes. * -* @param[in] pObject - Object instance. -* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) -* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPartNumberBuffer - buffer of returns object part number., may be NULL +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[out] pCount - returns the number of nodes in the list. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getpartnumber(Lib3MF_Object pObject, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnodes_getnodecount(Lib3MF_CustomXMLNodes pCustomXMLNodes, Lib3MF_uint64 * pCount); /** -* Sets an objects partnumber string +* Returns node instance. Fails if Index is out of range. * -* @param[in] pObject - Object instance. -* @param[in] pPartNumber - new object part number. +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] nIndex - Index of the node to return (0-based). +* @param[out] pNodeInstance - XML Node node. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setpartnumber(Lib3MF_Object pObject, const char * pPartNumber); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnodes_getnode(Lib3MF_CustomXMLNodes pCustomXMLNodes, Lib3MF_uint64 nIndex, Lib3MF_CustomXMLNode * pNodeInstance); /** -* Retrieves, if an object is a mesh object +* Returns how many nodes of the XML Node have a specific name. * -* @param[in] pObject - Object instance. -* @param[out] pIsMeshObject - returns, whether the object is a mesh object +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pCount - returns the number of nodes with the specified name. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_ismeshobject(Lib3MF_Object pObject, bool * pIsMeshObject); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnodes_countnodesbyname(Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, Lib3MF_uint64 * pCount); /** -* Retrieves, if an object is a components object +* Returns all the nodes nodes of the XML Node with a specific name. * -* @param[in] pObject - Object instance. -* @param[out] pIsComponentsObject - returns, whether the object is a components object +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pNodes - returns the list of node nodes. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_iscomponentsobject(Lib3MF_Object pObject, bool * pIsComponentsObject); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnodes_getnodesbyname(Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, Lib3MF_CustomXMLNodes * pNodes); /** -* Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. +* Returns if a node with a specific name exist. * -* @param[in] pObject - Object instance. -* @param[out] pIsValid - returns whether the object is a valid object description +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pNodeExists - returns if a node with a specific name exists. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_isvalid(Lib3MF_Object pObject, bool * pIsValid); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnodes_hasnode(Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool * pNodeExists); /** -* Use an existing attachment as thumbnail for this object +* Returns if a node with a specific name exist once and only once. * -* @param[in] pObject - Object instance. -* @param[in] pAttachment - Instance of a new or the existing thumbnailattachment object. +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pNodeExists - returns if a node with a specific name exists once and only once. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setattachmentasthumbnail(Lib3MF_Object pObject, Lib3MF_Attachment pAttachment); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnodes_hasuniquenode(Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool * pNodeExists); /** -* Get the attachment containing the object thumbnail. +* Returns node with a specific name. Throws an error if name does not exist once and only once. * -* @param[in] pObject - Object instance. -* @param[out] pAttachment - Instance of the thumbnailattachment object or NULL. +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[in] bMustExist - If true, the call fails if node does not exist. If falls, the call will return null if the node does not exist. +* @param[out] pNodeInstance - returns node instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getthumbnailattachment(Lib3MF_Object pObject, Lib3MF_Attachment * pAttachment); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnodes_findnode(Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool bMustExist, Lib3MF_CustomXMLNode * pNodeInstance); + +/************************************************************************************************************************* + Class definition for CustomDOMTree +**************************************************************************************************************************/ /** -* Clears the attachment. The attachment instance is not removed from the package. +* Returns the namespace identifier for the DOM Tree. * -* @param[in] pObject - Object instance. +* @param[in] pCustomDOMTree - CustomDOMTree instance. +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of returns the namespace of the DOM Tree., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_clearthumbnailattachment(Lib3MF_Object pObject); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customdomtree_getnamespace(Lib3MF_CustomDOMTree pCustomDOMTree, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* Returns the outbox of a build item +* Returns root node of the tree. * -* @param[in] pObject - Object instance. -* @param[out] pOutbox - Outbox of this build item +* @param[in] pCustomDOMTree - CustomDOMTree instance. +* @param[out] pRootNode - Root node of the document. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getoutbox(Lib3MF_Object pObject, sLib3MFBox * pOutbox); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customdomtree_getrootnode(Lib3MF_CustomDOMTree pCustomDOMTree, Lib3MF_CustomXMLNode * pRootNode); /** -* Retrieves an object's uuid string (see production extension specification) +* Saves the XML tree into a string. * -* @param[in] pObject - Object instance. -* @param[out] pHasUUID - flag whether the build item has a UUID -* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pUUIDBuffer - buffer of returns object uuid., may be NULL +* @param[in] pCustomDOMTree - CustomDOMTree instance. +* @param[in] nXMLStringBufferSize - size of the buffer (including trailing 0) +* @param[out] pXMLStringNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pXMLStringBuffer - buffer of String with the XML Content., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getuuid(Lib3MF_Object pObject, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customdomtree_savetostring(Lib3MF_CustomDOMTree pCustomDOMTree, const Lib3MF_uint32 nXMLStringBufferSize, Lib3MF_uint32* pXMLStringNeededChars, char * pXMLStringBuffer); + +/************************************************************************************************************************* + Class definition for SliceStackIterator +**************************************************************************************************************************/ /** -* Sets a build object's uuid string (see production extension specification) +* Returns the SliceStack the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] pUUID - new object uuid string. +* @param[in] pSliceStackIterator - SliceStackIterator instance. +* @param[out] pResource - returns the SliceStack instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setuuid(Lib3MF_Object pObject, const char * pUUID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slicestackiterator_getcurrentslicestack(Lib3MF_SliceStackIterator pSliceStackIterator, Lib3MF_SliceStack * pResource); + +/************************************************************************************************************************* + Class definition for ObjectIterator +**************************************************************************************************************************/ /** -* Returns the metadatagroup of this object +* Returns the Object the iterator points at. * -* @param[in] pObject - Object instance. -* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this object +* @param[in] pObjectIterator - ObjectIterator instance. +* @param[out] pResource - returns the Object instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getmetadatagroup(Lib3MF_Object pObject, Lib3MF_MetaDataGroup * pMetaDataGroup); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_objectiterator_getcurrentobject(Lib3MF_ObjectIterator pObjectIterator, Lib3MF_Object * pResource); + +/************************************************************************************************************************* + Class definition for MeshObjectIterator +**************************************************************************************************************************/ /** -* set the meshresolution of the mesh object +* Returns the MeshObject the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] eMeshResolution - meshresolution of this object +* @param[in] pMeshObjectIterator - MeshObjectIterator instance. +* @param[out] pResource - returns the MeshObject instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setslicesmeshresolution(Lib3MF_Object pObject, eLib3MFSlicesMeshResolution eMeshResolution); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobjectiterator_getcurrentmeshobject(Lib3MF_MeshObjectIterator pMeshObjectIterator, Lib3MF_MeshObject * pResource); + +/************************************************************************************************************************* + Class definition for ComponentsObjectIterator +**************************************************************************************************************************/ /** -* get the meshresolution of the mesh object +* Returns the ComponentsObject the iterator points at. * -* @param[in] pObject - Object instance. -* @param[out] pMeshResolution - meshresolution of this object +* @param[in] pComponentsObjectIterator - ComponentsObjectIterator instance. +* @param[out] pResource - returns the ComponentsObject instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getslicesmeshresolution(Lib3MF_Object pObject, eLib3MFSlicesMeshResolution * pMeshResolution); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobjectiterator_getcurrentcomponentsobject(Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource); + +/************************************************************************************************************************* + Class definition for Texture2DIterator +**************************************************************************************************************************/ /** -* returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack +* Returns the Texture2D the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] bRecursive - check also all referenced objects? -* @param[out] pHasSlices - does the object have a slice stack? +* @param[in] pTexture2DIterator - Texture2DIterator instance. +* @param[out] pResource - returns the Texture2D instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_hasslices(Lib3MF_Object pObject, bool bRecursive, bool * pHasSlices); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2diterator_getcurrenttexture2d(Lib3MF_Texture2DIterator pTexture2DIterator, Lib3MF_Texture2D * pResource); + +/************************************************************************************************************************* + Class definition for BaseMaterialGroupIterator +**************************************************************************************************************************/ /** -* unlinks the attached slicestack from this object. If no slice stack is attached, do noting. +* Returns the MaterialGroup the iterator points at. * -* @param[in] pObject - Object instance. +* @param[in] pBaseMaterialGroupIterator - BaseMaterialGroupIterator instance. +* @param[out] pResource - returns the BaseMaterialGroup instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_clearslicestack(Lib3MF_Object pObject); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup(Lib3MF_BaseMaterialGroupIterator pBaseMaterialGroupIterator, Lib3MF_BaseMaterialGroup * pResource); + +/************************************************************************************************************************* + Class definition for ColorGroupIterator +**************************************************************************************************************************/ /** -* get the Slicestack attached to the object +* Returns the ColorGroup the iterator points at. * -* @param[in] pObject - Object instance. -* @param[out] pSliceStackInstance - returns the slicestack instance +* @param[in] pColorGroupIterator - ColorGroupIterator instance. +* @param[out] pResource - returns the ColorGroup instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getslicestack(Lib3MF_Object pObject, Lib3MF_SliceStack * pSliceStackInstance); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroupiterator_getcurrentcolorgroup(Lib3MF_ColorGroupIterator pColorGroupIterator, Lib3MF_ColorGroup * pResource); + +/************************************************************************************************************************* + Class definition for Texture2DGroupIterator +**************************************************************************************************************************/ /** -* assigns a slicestack to the object +* Returns the Texture2DGroup the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] pSliceStackInstance - the new slice stack of this Object +* @param[in] pTexture2DGroupIterator - Texture2DGroupIterator instance. +* @param[out] pResource - returns the Texture2DGroup instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_assignslicestack(Lib3MF_Object pObject, Lib3MF_SliceStack pSliceStackInstance); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup(Lib3MF_Texture2DGroupIterator pTexture2DGroupIterator, Lib3MF_Texture2DGroup * pResource); /************************************************************************************************************************* - Class definition for MeshObject + Class definition for CompositeMaterialsIterator **************************************************************************************************************************/ /** -* Returns the vertex count of a mesh object. +* Returns the CompositeMaterials the iterator points at. * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pVertexCount - filled with the vertex count. +* @param[in] pCompositeMaterialsIterator - CompositeMaterialsIterator instance. +* @param[out] pResource - returns the CompositeMaterials instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getvertexcount(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerialsiterator_getcurrentcompositematerials(Lib3MF_CompositeMaterialsIterator pCompositeMaterialsIterator, Lib3MF_CompositeMaterials * pResource); + +/************************************************************************************************************************* + Class definition for MultiPropertyGroupIterator +**************************************************************************************************************************/ /** -* Returns the triangle count of a mesh object. +* Returns the MultiPropertyGroup the iterator points at. * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pVertexCount - filled with the triangle count. +* @param[in] pMultiPropertyGroupIterator - MultiPropertyGroupIterator instance. +* @param[out] pResource - returns the MultiPropertyGroup instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettrianglecount(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup(Lib3MF_MultiPropertyGroupIterator pMultiPropertyGroupIterator, Lib3MF_MultiPropertyGroup * pResource); + +/************************************************************************************************************************* + Class definition for MetaData +**************************************************************************************************************************/ /** -* Returns the vertex count of a mesh object. +* returns the namespace URL of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) -* @param[out] pCoordinates - filled with the vertex coordinates. +* @param[in] pMetaData - MetaData instance. +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of the namespace URL of the metadata, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getvertex(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFPosition * pCoordinates); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getnamespace(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* Sets the coordinates of a single vertex of a mesh object +* sets a new namespace URL of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) -* @param[in] pCoordinates - contains the vertex coordinates. +* @param[in] pMetaData - MetaData instance. +* @param[in] pNameSpace - the new namespace URL of the metadata * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_setvertex(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFPosition * pCoordinates); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_setnamespace(Lib3MF_MetaData pMetaData, const char * pNameSpace); /** -* Adds a single vertex to a mesh object +* returns the name of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] pCoordinates - contains the vertex coordinates. -* @param[out] pNewIndex - Index of the new vertex +* @param[in] pMetaData - MetaData instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of the name of the metadata, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_addvertex(Lib3MF_MeshObject pMeshObject, const sLib3MFPosition * pCoordinates, Lib3MF_uint32 * pNewIndex); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getname(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Obtains all vertex positions of a mesh object +* sets a new name of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pVerticesBuffer - Position buffer of contains the vertex coordinates. +* @param[in] pMetaData - MetaData instance. +* @param[in] pName - the new name of the metadata * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getvertices(Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, sLib3MFPosition * pVerticesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_setname(Lib3MF_MetaData pMetaData, const char * pName); /** -* Returns indices of a single triangle of a mesh object. +* returns the (namespace+name) of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[out] pIndices - filled with the triangle indices. +* @param[in] pMetaData - MetaData instance. +* @param[in] nKeyBufferSize - size of the buffer (including trailing 0) +* @param[out] pKeyNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pKeyBuffer - buffer of the key (namespace+name) of the metadata, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettriangle(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFTriangle * pIndices); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getkey(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nKeyBufferSize, Lib3MF_uint32* pKeyNeededChars, char * pKeyBuffer); /** -* Sets the indices of a single triangle of a mesh object. +* returns, whether a metadata must be preserved * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[in] pIndices - contains the triangle indices. +* @param[in] pMetaData - MetaData instance. +* @param[out] pMustPreserve - returns, whether a metadata must be preserved * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_settriangle(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFTriangle * pIndices); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getmustpreserve(Lib3MF_MetaData pMetaData, bool * pMustPreserve); /** -* Adds a single triangle to a mesh object +* sets whether a metadata must be preserved * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] pIndices - contains the triangle indices. -* @param[out] pNewIndex - Index of the new triangle +* @param[in] pMetaData - MetaData instance. +* @param[in] bMustPreserve - a new value whether a metadata must be preserved * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_addtriangle(Lib3MF_MeshObject pMeshObject, const sLib3MFTriangle * pIndices, Lib3MF_uint32 * pNewIndex); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_setmustpreserve(Lib3MF_MetaData pMetaData, bool bMustPreserve); /** -* Get all triangles of a mesh object +* returns the type of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @param[in] pMetaData - MetaData instance. +* @param[in] nTypeBufferSize - size of the buffer (including trailing 0) +* @param[out] pTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pTypeBuffer - buffer of the type of the metadata, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettriangleindices(Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, sLib3MFTriangle * pIndicesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_gettype(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nTypeBufferSize, Lib3MF_uint32* pTypeNeededChars, char * pTypeBuffer); /** -* Sets the property at the object-level of the mesh object. +* sets a new type of a metadata. This must be a simple XML type * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nUniqueResourceID - the object-level Property UniqueResourceID. -* @param[in] nPropertyID - the object-level PropertyID. +* @param[in] pMetaData - MetaData instance. +* @param[in] pType - a new type of the metadata * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_setobjectlevelproperty(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nUniqueResourceID, Lib3MF_uint32 nPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_settype(Lib3MF_MetaData pMetaData, const char * pType); /** -* Gets the property at the object-level of the mesh object. +* returns the value of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pUniqueResourceID - the object-level Property UniqueResourceID. -* @param[out] pPropertyID - the object-level PropertyID. -* @param[out] pHasObjectLevelProperty - Has an object-level property been specified? +* @param[in] pMetaData - MetaData instance. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of the value of the metadata, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getobjectlevelproperty(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pUniqueResourceID, Lib3MF_uint32 * pPropertyID, bool * pHasObjectLevelProperty); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getvalue(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* Sets the properties of a single triangle of a mesh object. +* sets a new value of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[in] pProperties - contains the triangle properties. +* @param[in] pMetaData - MetaData instance. +* @param[in] pValue - a new value of the metadata * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_settriangleproperties(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFTriangleProperties * pProperties); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_setvalue(Lib3MF_MetaData pMetaData, const char * pValue); -/** -* Gets the properties of a single triangle of a mesh object. -* -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[out] pProperty - returns the triangle properties. -* @return error code or 0 (success) -*/ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettriangleproperties(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFTriangleProperties * pProperty); +/************************************************************************************************************************* + Class definition for MetaDataGroup +**************************************************************************************************************************/ /** -* Sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. +* returns the number of metadata in this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer -* @param[in] pPropertiesArrayBuffer - TriangleProperties buffer of contains the triangle properties array. Must have trianglecount elements. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[out] pCount - returns the number metadata * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_setalltriangleproperties(Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nPropertiesArrayBufferSize, const sLib3MFTriangleProperties * pPropertiesArrayBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_getmetadatacount(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 * pCount); /** -* Gets the properties of all triangles of a mesh object. +* returns a metadata value within this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer -* @param[out] pPropertiesArrayNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertiesArrayBuffer - TriangleProperties buffer of returns the triangle properties array. Must have trianglecount elements. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] nIndex - Index of the Metadata. +* @param[out] pMetaData - an instance of the metadata * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getalltriangleproperties(Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nPropertiesArrayBufferSize, Lib3MF_uint64* pPropertiesArrayNeededCount, sLib3MFTriangleProperties * pPropertiesArrayBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_getmetadata(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex, Lib3MF_MetaData * pMetaData); /** -* Clears all properties of this mesh object (triangle and object-level). +* returns a metadata value within this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] pNameSpace - the namespace of the metadata +* @param[in] pName - the name of the Metadata +* @param[out] pMetaData - an instance of the metadata * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_clearallproperties(Lib3MF_MeshObject pMeshObject); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_getmetadatabykey(Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, Lib3MF_MetaData * pMetaData); /** -* Set all triangles of a mesh object +* removes metadata by index from the model. * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[in] pVerticesBuffer - Position buffer of contains the positions. -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[in] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] nIndex - Index of the metadata to remove * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_setgeometry(Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nVerticesBufferSize, const sLib3MFPosition * pVerticesBuffer, Lib3MF_uint64 nIndicesBufferSize, const sLib3MFTriangle * pIndicesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_removemetadatabyindex(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex); /** -* Retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. +* removes metadata from the model. * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pIsManifoldAndOriented - returns, if the object is oriented and manifold. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] pTheMetaData - The metadata to remove * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_ismanifoldandoriented(Lib3MF_MeshObject pMeshObject, bool * pIsManifoldAndOriented); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_removemetadata(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_MetaData pTheMetaData); /** -* Retrieves the BeamLattice within this MeshObject. +* adds a new metadata to this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pTheBeamLattice - the BeamLattice within this MeshObject +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] pNameSpace - the namespace of the metadata +* @param[in] pName - the name of the metadata +* @param[in] pValue - the value of the metadata +* @param[in] pType - the type of the metadata +* @param[in] bMustPreserve - shuold the metadata be preserved +* @param[out] pMetaData - a new instance of the metadata * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_beamlattice(Lib3MF_MeshObject pMeshObject, Lib3MF_BeamLattice * pTheBeamLattice); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_addmetadata(Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, const char * pValue, const char * pType, bool bMustPreserve, Lib3MF_MetaData * pMetaData); /************************************************************************************************************************* - Class definition for BeamLattice + Class definition for Object **************************************************************************************************************************/ /** -* Returns the minimal length of beams for the beamlattice. +* Retrieves an object's type * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pMinLength - minimal length of beams for the beamlattice +* @param[in] pObject - Object instance. +* @param[out] pObjectType - returns object type enum. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getminlength(Lib3MF_BeamLattice pBeamLattice, Lib3MF_double * pMinLength); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_gettype(Lib3MF_Object pObject, eLib3MFObjectType * pObjectType); /** -* Sets the minimal length of beams for the beamlattice. +* Sets an object's type * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] dMinLength - minimal length of beams for the beamlattice +* @param[in] pObject - Object instance. +* @param[in] eObjectType - object type enum. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setminlength(Lib3MF_BeamLattice pBeamLattice, Lib3MF_double dMinLength); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_settype(Lib3MF_Object pObject, eLib3MFObjectType eObjectType); /** -* Returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* Retrieves an object's name * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pClipMode - contains the clip mode of this mesh -* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object or an undefined value if pClipMode is MODELBEAMLATTICECLIPMODE_NONE +* @param[in] pObject - Object instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns object name., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getclipping(Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode * pClipMode, Lib3MF_uint32 * pUniqueResourceID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getname(Lib3MF_Object pObject, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* Sets an object's name string * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] eClipMode - contains the clip mode of this mesh -* @param[in] nUniqueResourceID - the UniqueResourceID of the clipping mesh-object. This mesh-object has to be defined before setting the Clipping. +* @param[in] pObject - Object instance. +* @param[in] pName - new object name. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setclipping(Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode eClipMode, Lib3MF_uint32 nUniqueResourceID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setname(Lib3MF_Object pObject, const char * pName); /** -* Returns the representation-mesh for the beamlattice of this mesh. +* Retrieves an object's part number * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pHasRepresentation - flag whether the beamlattice has a representation mesh. -* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object. +* @param[in] pObject - Object instance. +* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartNumberBuffer - buffer of returns object part number., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getrepresentation(Lib3MF_BeamLattice pBeamLattice, bool * pHasRepresentation, Lib3MF_uint32 * pUniqueResourceID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getpartnumber(Lib3MF_Object pObject, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); /** -* Sets the representation-mesh for the beamlattice of this mesh. +* Sets an objects partnumber string * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nUniqueResourceID - the UniqueResourceID of the representation mesh-object. This mesh-object has to be defined before setting the representation. +* @param[in] pObject - Object instance. +* @param[in] pPartNumber - new object part number. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setrepresentation(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nUniqueResourceID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setpartnumber(Lib3MF_Object pObject, const char * pPartNumber); /** -* Returns the ball mode and the default ball radius for the beamlattice of this mesh. +* Retrieves, if an object is a mesh object * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pBallMode - contains the ball mode of this mesh -* @param[out] pBallRadius - default ball radius of balls for the beamlattice +* @param[in] pObject - Object instance. +* @param[out] pIsMeshObject - returns, whether the object is a mesh object * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getballoptions(Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode * pBallMode, Lib3MF_double * pBallRadius); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_ismeshobject(Lib3MF_Object pObject, bool * pIsMeshObject); /** -* Sets the ball mode and thedefault ball radius for the beamlattice. +* Retrieves, if an object is a components object * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] eBallMode - contains the ball mode of this mesh -* @param[in] dBallRadius - default ball radius of balls for the beamlattice +* @param[in] pObject - Object instance. +* @param[out] pIsComponentsObject - returns, whether the object is a components object * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setballoptions(Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode eBallMode, Lib3MF_double dBallRadius); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_iscomponentsobject(Lib3MF_Object pObject, bool * pIsComponentsObject); /** -* Returns the beam count of a mesh object. +* Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pCount - filled with the beam count. +* @param[in] pObject - Object instance. +* @param[out] pIsValid - returns whether the object is a valid object description * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeamcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_isvalid(Lib3MF_Object pObject, bool * pIsValid); /** -* Returns indices, radii and capmodes of a single beam of a mesh object. +* Use an existing attachment as thumbnail for this object * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the beam (0 to beamcount - 1). -* @param[out] pBeamInfo - filled with the beam indices, radii and capmodes. +* @param[in] pObject - Object instance. +* @param[in] pAttachment - Instance of a new or the existing thumbnailattachment object. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeam(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBeam * pBeamInfo); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setattachmentasthumbnail(Lib3MF_Object pObject, Lib3MF_Attachment pAttachment); /** -* Adds a single beam to a mesh object. +* Get the attachment containing the object thumbnail. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] pBeamInfo - contains the node indices, radii and capmodes. -* @param[out] pIndex - filled with the new Index of the beam. +* @param[in] pObject - Object instance. +* @param[out] pAttachment - Instance of the thumbnailattachment object or NULL. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_addbeam(Lib3MF_BeamLattice pBeamLattice, const sLib3MFBeam * pBeamInfo, Lib3MF_uint32 * pIndex); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getthumbnailattachment(Lib3MF_Object pObject, Lib3MF_Attachment * pAttachment); /** -* Sets the indices, radii and capmodes of a single beam of a mesh object. +* Clears the attachment. The attachment instance is not removed from the package. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the beam (0 to beamcount - 1). -* @param[in] pBeamInfo - filled with the beam indices, radii and capmodes. +* @param[in] pObject - Object instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setbeam(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBeam * pBeamInfo); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_clearthumbnailattachment(Lib3MF_Object pObject); /** -* Sets all beam indices, radii and capmodes of a mesh object. +* Returns the outbox of a build item * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBeamInfoBufferSize - Number of elements in buffer -* @param[in] pBeamInfoBuffer - Beam buffer of contains information of a number of beams +* @param[in] pObject - Object instance. +* @param[out] pOutbox - Outbox of this build item * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setbeams(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBeamInfoBufferSize, const sLib3MFBeam * pBeamInfoBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getoutbox(Lib3MF_Object pObject, sLib3MFBox * pOutbox); + +/** +* Retrieves an object's uuid string (see production extension specification) +* +* @param[in] pObject - Object instance. +* @param[out] pHasUUID - flag whether the build item has a UUID +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of returns object uuid., may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getuuid(Lib3MF_Object pObject, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); + +/** +* Sets a build object's uuid string (see production extension specification) +* +* @param[in] pObject - Object instance. +* @param[in] pUUID - new object uuid string. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setuuid(Lib3MF_Object pObject, const char * pUUID); + +/** +* Returns the metadatagroup of this object +* +* @param[in] pObject - Object instance. +* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getmetadatagroup(Lib3MF_Object pObject, Lib3MF_MetaDataGroup * pMetaDataGroup); + +/** +* set the meshresolution of the mesh object +* +* @param[in] pObject - Object instance. +* @param[in] eMeshResolution - meshresolution of this object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setslicesmeshresolution(Lib3MF_Object pObject, eLib3MFSlicesMeshResolution eMeshResolution); + +/** +* get the meshresolution of the mesh object +* +* @param[in] pObject - Object instance. +* @param[out] pMeshResolution - meshresolution of this object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getslicesmeshresolution(Lib3MF_Object pObject, eLib3MFSlicesMeshResolution * pMeshResolution); + +/** +* returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack +* +* @param[in] pObject - Object instance. +* @param[in] bRecursive - check also all referenced objects? +* @param[out] pHasSlices - does the object have a slice stack? +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_hasslices(Lib3MF_Object pObject, bool bRecursive, bool * pHasSlices); + +/** +* unlinks the attached slicestack from this object. If no slice stack is attached, do noting. +* +* @param[in] pObject - Object instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_clearslicestack(Lib3MF_Object pObject); + +/** +* get the Slicestack attached to the object +* +* @param[in] pObject - Object instance. +* @param[out] pSliceStackInstance - returns the slicestack instance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getslicestack(Lib3MF_Object pObject, Lib3MF_SliceStack * pSliceStackInstance); + +/** +* assigns a slicestack to the object +* +* @param[in] pObject - Object instance. +* @param[in] pSliceStackInstance - the new slice stack of this Object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_assignslicestack(Lib3MF_Object pObject, Lib3MF_SliceStack pSliceStackInstance); + +/************************************************************************************************************************* + Class definition for MeshObject +**************************************************************************************************************************/ + +/** +* Returns the vertex count of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pVertexCount - filled with the vertex count. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getvertexcount(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); + +/** +* Returns the triangle count of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pVertexCount - filled with the triangle count. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettrianglecount(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); + +/** +* Returns the vertex count of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) +* @param[out] pCoordinates - filled with the vertex coordinates. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getvertex(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFPosition * pCoordinates); + +/** +* Sets the coordinates of a single vertex of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) +* @param[in] pCoordinates - contains the vertex coordinates. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_setvertex(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFPosition * pCoordinates); + +/** +* Adds a single vertex to a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] pCoordinates - contains the vertex coordinates. +* @param[out] pNewIndex - Index of the new vertex +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_addvertex(Lib3MF_MeshObject pMeshObject, const sLib3MFPosition * pCoordinates, Lib3MF_uint32 * pNewIndex); + +/** +* Obtains all vertex positions of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pVerticesBuffer - Position buffer of contains the vertex coordinates. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getvertices(Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, sLib3MFPosition * pVerticesBuffer); + +/** +* Returns indices of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[out] pIndices - filled with the triangle indices. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettriangle(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFTriangle * pIndices); + +/** +* Sets the indices of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[in] pIndices - contains the triangle indices. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_settriangle(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFTriangle * pIndices); + +/** +* Adds a single triangle to a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] pIndices - contains the triangle indices. +* @param[out] pNewIndex - Index of the new triangle +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_addtriangle(Lib3MF_MeshObject pMeshObject, const sLib3MFTriangle * pIndices, Lib3MF_uint32 * pNewIndex); + +/** +* Get all triangles of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettriangleindices(Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, sLib3MFTriangle * pIndicesBuffer); + +/** +* Sets the property at the object-level of the mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nUniqueResourceID - the object-level Property UniqueResourceID. +* @param[in] nPropertyID - the object-level PropertyID. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_setobjectlevelproperty(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nUniqueResourceID, Lib3MF_uint32 nPropertyID); + +/** +* Gets the property at the object-level of the mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pUniqueResourceID - the object-level Property UniqueResourceID. +* @param[out] pPropertyID - the object-level PropertyID. +* @param[out] pHasObjectLevelProperty - Has an object-level property been specified? +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getobjectlevelproperty(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pUniqueResourceID, Lib3MF_uint32 * pPropertyID, bool * pHasObjectLevelProperty); + +/** +* Sets the properties of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[in] pProperties - contains the triangle properties. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_settriangleproperties(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFTriangleProperties * pProperties); + +/** +* Gets the properties of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[out] pProperty - returns the triangle properties. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettriangleproperties(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFTriangleProperties * pProperty); + +/** +* Sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer +* @param[in] pPropertiesArrayBuffer - TriangleProperties buffer of contains the triangle properties array. Must have trianglecount elements. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_setalltriangleproperties(Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nPropertiesArrayBufferSize, const sLib3MFTriangleProperties * pPropertiesArrayBuffer); + +/** +* Gets the properties of all triangles of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer +* @param[out] pPropertiesArrayNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertiesArrayBuffer - TriangleProperties buffer of returns the triangle properties array. Must have trianglecount elements. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getalltriangleproperties(Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nPropertiesArrayBufferSize, Lib3MF_uint64* pPropertiesArrayNeededCount, sLib3MFTriangleProperties * pPropertiesArrayBuffer); + +/** +* Clears all properties of this mesh object (triangle and object-level). +* +* @param[in] pMeshObject - MeshObject instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_clearallproperties(Lib3MF_MeshObject pMeshObject); + +/** +* Set all triangles of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[in] pVerticesBuffer - Position buffer of contains the positions. +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[in] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_setgeometry(Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nVerticesBufferSize, const sLib3MFPosition * pVerticesBuffer, Lib3MF_uint64 nIndicesBufferSize, const sLib3MFTriangle * pIndicesBuffer); + +/** +* Retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pIsManifoldAndOriented - returns, if the object is oriented and manifold. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_ismanifoldandoriented(Lib3MF_MeshObject pMeshObject, bool * pIsManifoldAndOriented); + +/** +* Retrieves the BeamLattice within this MeshObject. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pTheBeamLattice - the BeamLattice within this MeshObject +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_beamlattice(Lib3MF_MeshObject pMeshObject, Lib3MF_BeamLattice * pTheBeamLattice); + +/************************************************************************************************************************* + Class definition for BeamLattice +**************************************************************************************************************************/ + +/** +* Returns the minimal length of beams for the beamlattice. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pMinLength - minimal length of beams for the beamlattice +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getminlength(Lib3MF_BeamLattice pBeamLattice, Lib3MF_double * pMinLength); + +/** +* Sets the minimal length of beams for the beamlattice. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] dMinLength - minimal length of beams for the beamlattice +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setminlength(Lib3MF_BeamLattice pBeamLattice, Lib3MF_double dMinLength); + +/** +* Returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pClipMode - contains the clip mode of this mesh +* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object or an undefined value if pClipMode is MODELBEAMLATTICECLIPMODE_NONE +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getclipping(Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode * pClipMode, Lib3MF_uint32 * pUniqueResourceID); + +/** +* Sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] eClipMode - contains the clip mode of this mesh +* @param[in] nUniqueResourceID - the UniqueResourceID of the clipping mesh-object. This mesh-object has to be defined before setting the Clipping. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setclipping(Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode eClipMode, Lib3MF_uint32 nUniqueResourceID); + +/** +* Returns the representation-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pHasRepresentation - flag whether the beamlattice has a representation mesh. +* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getrepresentation(Lib3MF_BeamLattice pBeamLattice, bool * pHasRepresentation, Lib3MF_uint32 * pUniqueResourceID); + +/** +* Sets the representation-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nUniqueResourceID - the UniqueResourceID of the representation mesh-object. This mesh-object has to be defined before setting the representation. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setrepresentation(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nUniqueResourceID); + +/** +* Returns the ball mode and the default ball radius for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pBallMode - contains the ball mode of this mesh +* @param[out] pBallRadius - default ball radius of balls for the beamlattice +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getballoptions(Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode * pBallMode, Lib3MF_double * pBallRadius); + +/** +* Sets the ball mode and thedefault ball radius for the beamlattice. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] eBallMode - contains the ball mode of this mesh +* @param[in] dBallRadius - default ball radius of balls for the beamlattice +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setballoptions(Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode eBallMode, Lib3MF_double dBallRadius); + +/** +* Returns the beam count of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pCount - filled with the beam count. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeamcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); + +/** +* Returns indices, radii and capmodes of a single beam of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the beam (0 to beamcount - 1). +* @param[out] pBeamInfo - filled with the beam indices, radii and capmodes. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeam(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBeam * pBeamInfo); + +/** +* Adds a single beam to a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] pBeamInfo - contains the node indices, radii and capmodes. +* @param[out] pIndex - filled with the new Index of the beam. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_addbeam(Lib3MF_BeamLattice pBeamLattice, const sLib3MFBeam * pBeamInfo, Lib3MF_uint32 * pIndex); + +/** +* Sets the indices, radii and capmodes of a single beam of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the beam (0 to beamcount - 1). +* @param[in] pBeamInfo - filled with the beam indices, radii and capmodes. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setbeam(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBeam * pBeamInfo); + +/** +* Sets all beam indices, radii and capmodes of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBeamInfoBufferSize - Number of elements in buffer +* @param[in] pBeamInfoBuffer - Beam buffer of contains information of a number of beams +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setbeams(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBeamInfoBufferSize, const sLib3MFBeam * pBeamInfoBuffer); + +/** +* obtains all beam indices, radii and capmodes of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBeamInfoBufferSize - Number of elements in buffer +* @param[out] pBeamInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBeamInfoBuffer - Beam buffer of contains information of all beams +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeams(Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBeamInfoBufferSize, Lib3MF_uint64* pBeamInfoNeededCount, sLib3MFBeam * pBeamInfoBuffer); + +/** +* Returns the ball count of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pCount - filled with the ball count. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getballcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); + +/** +* Returns index and radius of a single ball of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the ball (0 to ballcount - 1). +* @param[out] pBallInfo - filled with the ball node index and radius. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getball(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBall * pBallInfo); + +/** +* Adds a single ball to a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] pBallInfo - contains the node index and radius. +* @param[out] pIndex - filled with the new Index of the ball. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_addball(Lib3MF_BeamLattice pBeamLattice, const sLib3MFBall * pBallInfo, Lib3MF_uint32 * pIndex); + +/** +* Sets the index and radius of a single ball of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the ball (0 to ballcount - 1). +* @param[in] pBallInfo - filled with the ball node index and radius. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setball(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBall * pBallInfo); + +/** +* Sets all ball indices and radii of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBallInfoBufferSize - Number of elements in buffer +* @param[in] pBallInfoBuffer - Ball buffer of contains information of a number of balls +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setballs(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBallInfoBufferSize, const sLib3MFBall * pBallInfoBuffer); + +/** +* obtains all ball indices and radii of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBallInfoBufferSize - Number of elements in buffer +* @param[out] pBallInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBallInfoBuffer - Ball buffer of contains information of all balls +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getballs(Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBallInfoBufferSize, Lib3MF_uint64* pBallInfoNeededCount, sLib3MFBall * pBallInfoBuffer); + +/** +* Returns the number of beamsets of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pCount - filled with the beamset count. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeamsetcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); + +/** +* Adds an empty beamset to a mesh object +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pBeamSet - the new beamset +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_addbeamset(Lib3MF_BeamLattice pBeamLattice, Lib3MF_BeamSet * pBeamSet); + +/** +* Returns a beamset of a mesh object +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - index of the requested beamset (0 ... beamsetcount-1). +* @param[out] pBeamSet - the requested beamset +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeamset(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF_BeamSet * pBeamSet); + +/************************************************************************************************************************* + Class definition for Component +**************************************************************************************************************************/ + +/** +* Returns the Resource Instance of the component. +* +* @param[in] pComponent - Component instance. +* @param[out] pObjectResource - filled with the Resource Instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_getobjectresource(Lib3MF_Component pComponent, Lib3MF_Object * pObjectResource); + +/** +* Returns the UniqueResourceID of the component. +* +* @param[in] pComponent - Component instance. +* @param[out] pUniqueResourceID - returns the UniqueResourceID. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_getobjectresourceid(Lib3MF_Component pComponent, Lib3MF_uint32 * pUniqueResourceID); + +/** +* returns, whether a component has a UUID and, if true, the component's UUID +* +* @param[in] pComponent - Component instance. +* @param[out] pHasUUID - flag whether the component has a UUID +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_getuuid(Lib3MF_Component pComponent, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); + +/** +* sets the component's UUID +* +* @param[in] pComponent - Component instance. +* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_setuuid(Lib3MF_Component pComponent, const char * pUUID); + +/** +* Returns, if the component has a different transformation than the identity matrix +* +* @param[in] pComponent - Component instance. +* @param[out] pHasTransform - if true is returned, the transformation is not equal than the identity +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_hastransform(Lib3MF_Component pComponent, bool * pHasTransform); + +/** +* Returns the transformation matrix of the component. +* +* @param[in] pComponent - Component instance. +* @param[out] pTransform - filled with the component transformation matrix +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_gettransform(Lib3MF_Component pComponent, sLib3MFTransform * pTransform); + +/** +* Sets the transformation matrix of the component. +* +* @param[in] pComponent - Component instance. +* @param[in] pTransform - new transformation matrix +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_settransform(Lib3MF_Component pComponent, const sLib3MFTransform * pTransform); + +/************************************************************************************************************************* + Class definition for ComponentsObject +**************************************************************************************************************************/ + +/** +* Adds a new component to a components object. +* +* @param[in] pComponentsObject - ComponentsObject instance. +* @param[in] pObjectResource - object to add as component. Must not lead to circular references! +* @param[in] pTransform - optional transform matrix for the component. +* @param[out] pComponentInstance - new component instance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobject_addcomponent(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_Object pObjectResource, const sLib3MFTransform * pTransform, Lib3MF_Component * pComponentInstance); + +/** +* Retrieves a component from a component object. +* +* @param[in] pComponentsObject - ComponentsObject instance. +* @param[in] nIndex - index of the component to retrieve (0 to componentcount - 1) +* @param[out] pComponentInstance - component instance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobject_getcomponent(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 nIndex, Lib3MF_Component * pComponentInstance); + +/** +* Retrieves a component count of a component object. +* +* @param[in] pComponentsObject - ComponentsObject instance. +* @param[out] pCount - returns the component count +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobject_getcomponentcount(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 * pCount); + +/************************************************************************************************************************* + Class definition for BeamSet +**************************************************************************************************************************/ + +/** +* Sets a beamset's name string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] pName - new name of the beamset. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_setname(Lib3MF_BeamSet pBeamSet, const char * pName); + +/** +* Retrieves a beamset's name string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the beamset., may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getname(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); + +/** +* Sets a beamset's identifier string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] pIdentifier - new name of the beamset. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_setidentifier(Lib3MF_BeamSet pBeamSet, const char * pIdentifier); + +/** +* Retrieves a beamset's identifier string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nIdentifierBufferSize - size of the buffer (including trailing 0) +* @param[out] pIdentifierNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pIdentifierBuffer - buffer of returns the identifier of the beamset., may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getidentifier(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer); + +/** +* Retrieves the reference count of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[out] pCount - returns the reference count +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getreferencecount(Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); + +/** +* Sets the references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nReferencesBufferSize - Number of elements in buffer +* @param[in] pReferencesBuffer - uint32 buffer of the new indices of all beams in this beamset +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_setreferences(Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nReferencesBufferSize, const Lib3MF_uint32 * pReferencesBuffer); + +/** +* Retrieves the references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nReferencesBufferSize - Number of elements in buffer +* @param[out] pReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pReferencesBuffer - uint32 buffer of retrieves the indices of all beams in this beamset +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getreferences(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nReferencesBufferSize, Lib3MF_uint64* pReferencesNeededCount, Lib3MF_uint32 * pReferencesBuffer); + +/** +* Retrieves the ball reference count of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[out] pCount - returns the ball reference count +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getballreferencecount(Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); + +/** +* Sets the ball references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nBallReferencesBufferSize - Number of elements in buffer +* @param[in] pBallReferencesBuffer - uint32 buffer of the new indices of all balls in this beamset +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_setballreferences(Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nBallReferencesBufferSize, const Lib3MF_uint32 * pBallReferencesBuffer); + +/** +* Retrieves the ball references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nBallReferencesBufferSize - Number of elements in buffer +* @param[out] pBallReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBallReferencesBuffer - uint32 buffer of retrieves the indices of all balls in this beamset +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getballreferences(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nBallReferencesBufferSize, Lib3MF_uint64* pBallReferencesNeededCount, Lib3MF_uint32 * pBallReferencesBuffer); + +/************************************************************************************************************************* + Class definition for BaseMaterialGroup +**************************************************************************************************************************/ + +/** +* Retrieves the count of base materials in the material group. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[out] pCount - returns the count of base materials. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_getcount(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all materials in this group +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the material in the material group. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_getallpropertyids(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Adds a new material to the material group +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] pName - new name of the base material. +* @param[in] pDisplayColor - Display color of the material +* @param[out] pPropertyID - returns new PropertyID of the new material in the material group. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_addmaterial(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const char * pName, const sLib3MFColor * pDisplayColor, Lib3MF_uint32 * pPropertyID); + +/** +* Removes a material from the material group. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_removematerial(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID); + +/** +* Returns the base material's name +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the base material., may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_getname(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); + +/** +* Sets a base material's name +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] pName - new name of the base material. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_setname(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const char * pName); + +/** +* Sets a base material's display color. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] pTheColor - The base material's display color +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_setdisplaycolor(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor); + +/** +* Returns a base material's display color. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[out] pTheColor - The base material's display color +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_getdisplaycolor(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor); + +/************************************************************************************************************************* + Class definition for ColorGroup +**************************************************************************************************************************/ + +/** +* Retrieves the count of base materials in this Color Group. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[out] pCount - returns the count of colors within this color group. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_getcount(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all colors within this group +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the color in the color group. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_getallpropertyids(Lib3MF_ColorGroup pColorGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Adds a new value. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] pTheColor - The new color +* @param[out] pPropertyID - PropertyID of the new color within this color group. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_addcolor(Lib3MF_ColorGroup pColorGroup, const sLib3MFColor * pTheColor, Lib3MF_uint32 * pPropertyID); + +/** +* Removes a color from the color group. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyID - PropertyID of the color to be removed from the color group. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_removecolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID); + +/** +* Sets a color value. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyID - PropertyID of a color within this color group. +* @param[in] pTheColor - The color +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_setcolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor); + +/** +* Sets a color value. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyID - PropertyID of a color within this color group. +* @param[out] pTheColor - The color +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_getcolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor); + +/************************************************************************************************************************* + Class definition for Texture2DGroup +**************************************************************************************************************************/ + +/** +* Retrieves the count of tex2coords in the Texture2DGroup. +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[out] pCount - returns the count of tex2coords. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_getcount(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all tex2coords in this Texture2DGroup +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the tex2coords in the Texture2DGroup. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_getallpropertyids(Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Adds a new tex2coord to the Texture2DGroup +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. +* @param[out] pPropertyID - returns new PropertyID of the new tex2coord in the Texture2DGroup. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_addtex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, const sLib3MFTex2Coord * pUVCoordinate, Lib3MF_uint32 * pPropertyID); + +/** +* Obtains a tex2coord to the Texture2DGroup +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] nPropertyID - the PropertyID of the tex2coord in the Texture2DGroup. +* @param[out] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_gettex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID, sLib3MFTex2Coord * pUVCoordinate); + +/** +* Removes a tex2coords from the Texture2DGroup. +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] nPropertyID - PropertyID of the tex2coords in the Texture2DGroup. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_removetex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID); + +/** +* Obtains the texture2D instance of this group. +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[out] pTexture2DInstance - the texture2D instance of this group. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_gettexture2d(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_Texture2D * pTexture2DInstance); + +/************************************************************************************************************************* + Class definition for CompositeMaterials +**************************************************************************************************************************/ + +/** +* Retrieves the count of Composite-s in the CompositeMaterials. +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[out] pCount - returns the count of Composite-s +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_getcount(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the Composite-Mixing Values in the CompositeMaterials. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_getallpropertyids(Lib3MF_CompositeMaterials pCompositeMaterials, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Obtains the BaseMaterialGroup instance of this CompositeMaterials. +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[out] pBaseMaterialGroupInstance - returns the BaseMaterialGroup instance of this CompositeMaterials +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_getbasematerialgroup(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance); + +/** +* Adds a new Composite-Mixing Values to the CompositeMaterials. +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nCompositeBufferSize - Number of elements in buffer +* @param[in] pCompositeBuffer - CompositeConstituent buffer of The Composite Constituents to be added as composite +* @param[out] pPropertyID - returns new PropertyID of the new Composite in the CompositeMaterials. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_addcomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint64 nCompositeBufferSize, const sLib3MFCompositeConstituent * pCompositeBuffer, Lib3MF_uint32 * pPropertyID); /** -* obtains all beam indices, radii and capmodes of a mesh object. +* Removes a Composite-Maxing Ratio from the CompositeMaterials. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBeamInfoBufferSize - Number of elements in buffer -* @param[out] pBeamInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBeamInfoBuffer - Beam buffer of contains information of all beams +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nPropertyID - PropertyID of the Composite-Mixing Values in the CompositeMaterials to be removed. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeams(Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBeamInfoBufferSize, Lib3MF_uint64* pBeamInfoNeededCount, sLib3MFBeam * pBeamInfoBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_removecomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID); /** -* Returns the ball count of a mesh object. +* Obtains a Composite-Maxing Ratio of this CompositeMaterials. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pCount - filled with the ball count. +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nPropertyID - the PropertyID of the Composite-Maxing Ratio in the CompositeMaterials. +* @param[in] nCompositeBufferSize - Number of elements in buffer +* @param[out] pCompositeNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pCompositeBuffer - CompositeConstituent buffer of The Composite-Mixing Values with the given PropertyID * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getballcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_getcomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nCompositeBufferSize, Lib3MF_uint64* pCompositeNeededCount, sLib3MFCompositeConstituent * pCompositeBuffer); + +/************************************************************************************************************************* + Class definition for MultiPropertyGroup +**************************************************************************************************************************/ /** -* Returns index and radius of a single ball of a mesh object. +* Retrieves the count of MultiProperty-s in the MultiPropertyGroup. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the ball (0 to ballcount - 1). -* @param[out] pBallInfo - filled with the ball node index and radius. +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[out] pCount - returns the count of MultiProperty-s * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getball(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBall * pBallInfo); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getcount(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); /** -* Adds a single ball to a mesh object. +* returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] pBallInfo - contains the node index and radius. -* @param[out] pIndex - filled with the new Index of the ball. +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the MultiProperty-s in the MultiPropertyGroup. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_addball(Lib3MF_BeamLattice pBeamLattice, const sLib3MFBall * pBallInfo, Lib3MF_uint32 * pIndex); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getallpropertyids(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); /** -* Sets the index and radius of a single ball of a mesh object. +* Adds a new MultiProperty to the MultiPropertyGroup. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the ball (0 to ballcount - 1). -* @param[in] pBallInfo - filled with the ball node index and radius. +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[in] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the new MultiProperty. +* @param[out] pPropertyID - returns the PropertyID of the new MultiProperty in the MultiPropertyGroup. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setball(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBall * pBallInfo); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_addmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer, Lib3MF_uint32 * pPropertyID); /** -* Sets all ball indices and radii of a mesh object. +* Sets the PropertyIDs of a MultiProperty. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBallInfoBufferSize - Number of elements in buffer -* @param[in] pBallInfoBuffer - Ball buffer of contains information of a number of balls +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyID - the PropertyID of the MultiProperty to be changed. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[in] pPropertyIDsBuffer - uint32 buffer of The new PropertyIDs of the MultiProperty * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setballs(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBallInfoBufferSize, const sLib3MFBall * pBallInfoBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_setmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer); /** -* obtains all ball indices and radii of a mesh object. +* Obtains the PropertyIDs of a MultiProperty. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBallInfoBufferSize - Number of elements in buffer -* @param[out] pBallInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBallInfoBuffer - Ball buffer of contains information of all balls +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyID - the PropertyID of the MultiProperty to be queried. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the MultiProperty +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Removes a MultiProperty from this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyID - the PropertyID of the MultiProperty to be removed. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_removemultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID); + +/** +* Retrieves the number of layers of this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[out] pCount - returns the number of layers +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getlayercount(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); + +/** +* Adds a MultiPropertyLayer to this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] pTheLayer - The MultiPropertyLayer to add to this MultiPropertyGroup +* @param[out] pLayerIndex - returns the index of this MultiPropertyLayer +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_addlayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const sLib3MFMultiPropertyLayer * pTheLayer, Lib3MF_uint32 * pLayerIndex); + +/** +* Obtains a MultiPropertyLayer of this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nLayerIndex - The Index of the MultiPropertyLayer queried +* @param[out] pTheLayer - The MultiPropertyLayer with index LayerIndex within MultiPropertyGroup +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getlayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex, sLib3MFMultiPropertyLayer * pTheLayer); + +/** +* Removes a MultiPropertyLayer from this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nLayerIndex - The Index of the MultiPropertyLayer to be removed +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_removelayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex); + +/************************************************************************************************************************* + Class definition for Attachment +**************************************************************************************************************************/ + +/** +* Retrieves an attachment's package path. This function will be removed in a later release. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of returns the attachment's package path string, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_getpath(Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Sets an attachment's package path. This function will be removed in a later release. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pPath - new path of the attachment. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_setpath(Lib3MF_Attachment pAttachment, const char * pPath); + +/** +* Returns the PackagePart that is this attachment. +* +* @param[in] pAttachment - Attachment instance. +* @param[out] pPackagePart - The PackagePart of this attachment. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_packagepart(Lib3MF_Attachment pAttachment, Lib3MF_PackagePart * pPackagePart); + +/** +* Retrieves an attachment's relationship type +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of returns the attachment's package relationship type string, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_getrelationshiptype(Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Sets an attachment's relationship type. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pPath - new relationship type string. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_setrelationshiptype(Lib3MF_Attachment pAttachment, const char * pPath); + +/** +* Writes out the attachment as file. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pFileName - file to write into. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_writetofile(Lib3MF_Attachment pAttachment, const char * pFileName); + +/** +* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pFileName - file to read from. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_readfromfile(Lib3MF_Attachment pAttachment, const char * pFileName); + +/** +* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pTheReadCallback - Callback to call for reading a data chunk +* @param[in] nStreamSize - number of bytes the callback returns +* @param[in] pTheSeekCallback - Callback to call for seeking in the stream. +* @param[in] pUserData - Userdata that is passed to the callback function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_readfromcallback(Lib3MF_Attachment pAttachment, Lib3MFReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MFSeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData); + +/** +* Retrieves the size of the attachment stream +* +* @param[in] pAttachment - Attachment instance. +* @param[out] pStreamSize - the stream size +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_getstreamsize(Lib3MF_Attachment pAttachment, Lib3MF_uint64 * pStreamSize); + +/** +* Writes out the attachment into a buffer +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nBufferBufferSize - Number of elements in buffer +* @param[out] pBufferNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBufferBuffer - uint8 buffer of Buffer to write into +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_writetobuffer(Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer); + +/** +* Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nBufferBufferSize - Number of elements in buffer +* @param[in] pBufferBuffer - uint8 buffer of Buffer to read from +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_readfrombuffer(Lib3MF_Attachment pAttachment, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer); + +/************************************************************************************************************************* + Class definition for Texture2D +**************************************************************************************************************************/ + +/** +* Retrieves the attachment located at the path of the texture. +* +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pAttachment - attachment that holds the texture's image information. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getballs(Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBallInfoBufferSize, Lib3MF_uint64* pBallInfoNeededCount, sLib3MFBall * pBallInfoBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_getattachment(Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment * pAttachment); /** -* Returns the number of beamsets of a mesh object. +* Sets the texture's package path to the path of the attachment. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pCount - filled with the beamset count. +* @param[in] pTexture2D - Texture2D instance. +* @param[in] pAttachment - attachment that holds the texture's image information. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeamsetcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_setattachment(Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment pAttachment); /** -* Adds an empty beamset to a mesh object +* Retrieves a texture's content type. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pBeamSet - the new beamset +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pContentType - returns content type enum. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_addbeamset(Lib3MF_BeamLattice pBeamLattice, Lib3MF_BeamSet * pBeamSet); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_getcontenttype(Lib3MF_Texture2D pTexture2D, eLib3MFTextureType * pContentType); /** -* Returns a beamset of a mesh object +* Retrieves a texture's content type. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - index of the requested beamset (0 ... beamsetcount-1). -* @param[out] pBeamSet - the requested beamset +* @param[in] pTexture2D - Texture2D instance. +* @param[in] eContentType - new Content Type * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeamset(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF_BeamSet * pBeamSet); - -/************************************************************************************************************************* - Class definition for Component -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_setcontenttype(Lib3MF_Texture2D pTexture2D, eLib3MFTextureType eContentType); /** -* Returns the Resource Instance of the component. +* Retrieves a texture's tilestyle type. * -* @param[in] pComponent - Component instance. -* @param[out] pObjectResource - filled with the Resource Instance. +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pTileStyleU - returns tilestyle type enum. +* @param[out] pTileStyleV - returns tilestyle type enum. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_getobjectresource(Lib3MF_Component pComponent, Lib3MF_Object * pObjectResource); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_gettilestyleuv(Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle * pTileStyleU, eLib3MFTextureTileStyle * pTileStyleV); /** -* Returns the UniqueResourceID of the component. +* Sets a texture's tilestyle type. * -* @param[in] pComponent - Component instance. -* @param[out] pUniqueResourceID - returns the UniqueResourceID. +* @param[in] pTexture2D - Texture2D instance. +* @param[in] eTileStyleU - new tilestyle type enum. +* @param[in] eTileStyleV - new tilestyle type enum. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_getobjectresourceid(Lib3MF_Component pComponent, Lib3MF_uint32 * pUniqueResourceID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_settilestyleuv(Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle eTileStyleU, eLib3MFTextureTileStyle eTileStyleV); /** -* returns, whether a component has a UUID and, if true, the component's UUID +* Retrieves a texture's filter type. * -* @param[in] pComponent - Component instance. -* @param[out] pHasUUID - flag whether the component has a UUID -* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pFilter - returns filter type enum. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_getuuid(Lib3MF_Component pComponent, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_getfilter(Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter * pFilter); /** -* sets the component's UUID +* Sets a texture's filter type. * -* @param[in] pComponent - Component instance. -* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' +* @param[in] pTexture2D - Texture2D instance. +* @param[in] eFilter - sets new filter type enum. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_setuuid(Lib3MF_Component pComponent, const char * pUUID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_setfilter(Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter eFilter); + +/************************************************************************************************************************* + Class definition for BuildItem +**************************************************************************************************************************/ /** -* Returns, if the component has a different transformation than the identity matrix +* Retrieves the object resource associated to a build item * -* @param[in] pComponent - Component instance. -* @param[out] pHasTransform - if true is returned, the transformation is not equal than the identity +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pObjectResource - returns the associated resource instance * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_hastransform(Lib3MF_Component pComponent, bool * pHasTransform); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getobjectresource(Lib3MF_BuildItem pBuildItem, Lib3MF_Object * pObjectResource); /** -* Returns the transformation matrix of the component. +* returns, whether a build item has a UUID and, if true, the build item's UUID * -* @param[in] pComponent - Component instance. -* @param[out] pTransform - filled with the component transformation matrix +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pHasUUID - flag whether the build item has a UUID +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_gettransform(Lib3MF_Component pComponent, sLib3MFTransform * pTransform); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getuuid(Lib3MF_BuildItem pBuildItem, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* Sets the transformation matrix of the component. +* sets the build item's UUID * -* @param[in] pComponent - Component instance. -* @param[in] pTransform - new transformation matrix +* @param[in] pBuildItem - BuildItem instance. +* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_settransform(Lib3MF_Component pComponent, const sLib3MFTransform * pTransform); - -/************************************************************************************************************************* - Class definition for ComponentsObject -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_setuuid(Lib3MF_BuildItem pBuildItem, const char * pUUID); /** -* Adds a new component to a components object. +* Retrieves the object UniqueResourceID associated to a build item * -* @param[in] pComponentsObject - ComponentsObject instance. -* @param[in] pObjectResource - object to add as component. Must not lead to circular references! -* @param[in] pTransform - optional transform matrix for the component. -* @param[out] pComponentInstance - new component instance +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pUniqueResourceID - returns the UniqueResourceID of the object * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobject_addcomponent(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_Object pObjectResource, const sLib3MFTransform * pTransform, Lib3MF_Component * pComponentInstance); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getobjectresourceid(Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pUniqueResourceID); /** -* Retrieves a component from a component object. +* Checks, if a build item has a non-identity transformation matrix * -* @param[in] pComponentsObject - ComponentsObject instance. -* @param[in] nIndex - index of the component to retrieve (0 to componentcount - 1) -* @param[out] pComponentInstance - component instance +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pHasTransform - returns true, if the transformation matrix is not the identity * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobject_getcomponent(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 nIndex, Lib3MF_Component * pComponentInstance); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_hasobjecttransform(Lib3MF_BuildItem pBuildItem, bool * pHasTransform); /** -* Retrieves a component count of a component object. +* Retrieves a build item's transformation matrix. * -* @param[in] pComponentsObject - ComponentsObject instance. -* @param[out] pCount - returns the component count +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pTransform - returns the transformation matrix * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobject_getcomponentcount(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 * pCount); - -/************************************************************************************************************************* - Class definition for BeamSet -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getobjecttransform(Lib3MF_BuildItem pBuildItem, sLib3MFTransform * pTransform); /** -* Sets a beamset's name string +* Sets a build item's transformation matrix. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] pName - new name of the beamset. +* @param[in] pBuildItem - BuildItem instance. +* @param[in] pTransform - new transformation matrix * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_setname(Lib3MF_BeamSet pBeamSet, const char * pName); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_setobjecttransform(Lib3MF_BuildItem pBuildItem, const sLib3MFTransform * pTransform); /** -* Retrieves a beamset's name string +* Retrieves a build item's part number string * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of returns the name of the beamset., may be NULL +* @param[in] pBuildItem - BuildItem instance. +* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartNumberBuffer - buffer of Returns a build item's part number string, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getname(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getpartnumber(Lib3MF_BuildItem pBuildItem, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); /** -* Sets a beamset's identifier string +* Sets a build item's part number string * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] pIdentifier - new name of the beamset. +* @param[in] pBuildItem - BuildItem instance. +* @param[in] pSetPartnumber - new part number string for referencing parts from the outside world * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_setidentifier(Lib3MF_BeamSet pBeamSet, const char * pIdentifier); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_setpartnumber(Lib3MF_BuildItem pBuildItem, const char * pSetPartnumber); /** -* Retrieves a beamset's identifier string +* Returns the metadatagroup of this build item * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nIdentifierBufferSize - size of the buffer (including trailing 0) -* @param[out] pIdentifierNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pIdentifierBuffer - buffer of returns the identifier of the beamset., may be NULL +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this build item * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getidentifier(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getmetadatagroup(Lib3MF_BuildItem pBuildItem, Lib3MF_MetaDataGroup * pMetaDataGroup); /** -* Retrieves the reference count of a beamset +* Returns the outbox of a build item * -* @param[in] pBeamSet - BeamSet instance. -* @param[out] pCount - returns the reference count +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pOutbox - Outbox of this build item * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getreferencecount(Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getoutbox(Lib3MF_BuildItem pBuildItem, sLib3MFBox * pOutbox); + +/************************************************************************************************************************* + Class definition for BuildItemIterator +**************************************************************************************************************************/ /** -* Sets the references of a beamset +* Iterates to the next build item in the list. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nReferencesBufferSize - Number of elements in buffer -* @param[in] pReferencesBuffer - uint32 buffer of the new indices of all beams in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pHasNext - Iterates to the next build item in the list. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_setreferences(Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nReferencesBufferSize, const Lib3MF_uint32 * pReferencesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_movenext(Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasNext); /** -* Retrieves the references of a beamset +* Iterates to the previous build item in the list. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nReferencesBufferSize - Number of elements in buffer -* @param[out] pReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pReferencesBuffer - uint32 buffer of retrieves the indices of all beams in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pHasPrevious - Iterates to the previous build item in the list. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getreferences(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nReferencesBufferSize, Lib3MF_uint64* pReferencesNeededCount, Lib3MF_uint32 * pReferencesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_moveprevious(Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasPrevious); /** -* Retrieves the ball reference count of a beamset +* Returns the build item the iterator points at. * -* @param[in] pBeamSet - BeamSet instance. -* @param[out] pCount - returns the ball reference count +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pBuildItem - returns the build item instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getballreferencecount(Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_getcurrent(Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItem * pBuildItem); /** -* Sets the ball references of a beamset +* Creates a new build item iterator with the same build item list. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nBallReferencesBufferSize - Number of elements in buffer -* @param[in] pBallReferencesBuffer - uint32 buffer of the new indices of all balls in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pOutBuildItemIterator - returns the cloned Iterator instance * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_setballreferences(Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nBallReferencesBufferSize, const Lib3MF_uint32 * pBallReferencesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_clone(Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItemIterator * pOutBuildItemIterator); /** -* Retrieves the ball references of a beamset +* Returns the number of build items the iterator captures. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nBallReferencesBufferSize - Number of elements in buffer -* @param[out] pBallReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBallReferencesBuffer - uint32 buffer of retrieves the indices of all balls in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pCount - returns the number of build items the iterator captures. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getballreferences(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nBallReferencesBufferSize, Lib3MF_uint64* pBallReferencesNeededCount, Lib3MF_uint32 * pBallReferencesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_count(Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_uint64 * pCount); /************************************************************************************************************************* - Class definition for BaseMaterialGroup + Class definition for Slice **************************************************************************************************************************/ /** -* Retrieves the count of base materials in the material group. +* Set all vertices of a slice. All polygons will be cleared. * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[out] pCount - returns the count of base materials. +* @param[in] pSlice - Slice instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[in] pVerticesBuffer - Position2D buffer of contains the positions. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_getcount(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_setvertices(Lib3MF_Slice pSlice, Lib3MF_uint64 nVerticesBufferSize, const sLib3MFPosition2D * pVerticesBuffer); /** -* returns all the PropertyIDs of all materials in this group +* Get all vertices of a slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the material in the material group. +* @param[in] pSlice - Slice instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pVerticesBuffer - Position2D buffer of contains the positions. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getvertices(Lib3MF_Slice pSlice, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, sLib3MFPosition2D * pVerticesBuffer); + +/** +* Get the number of vertices in a slice +* +* @param[in] pSlice - Slice instance. +* @param[out] pCount - the number of vertices in the slice * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_getallpropertyids(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getvertexcount(Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); /** -* Adds a new material to the material group +* Add a new polygon to this slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] pName - new name of the base material. -* @param[in] pDisplayColor - Display color of the material -* @param[out] pPropertyID - returns new PropertyID of the new material in the material group. +* @param[in] pSlice - Slice instance. +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the new polygon +* @param[out] pIndex - the index of the new polygon * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_addmaterial(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const char * pName, const sLib3MFColor * pDisplayColor, Lib3MF_uint32 * pPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_addpolygon(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer, Lib3MF_uint64 * pIndex); /** -* Removes a material from the material group. +* Get the number of polygons in the slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] pSlice - Slice instance. +* @param[out] pCount - the number of polygons in the slice * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_removematerial(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getpolygoncount(Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); /** -* Returns the base material's name +* Set all indices of a polygon * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of returns the name of the base material., may be NULL +* @param[in] pSlice - Slice instance. +* @param[in] nIndex - the index of the polygon to manipulate +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the index-th polygon * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_getname(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_setpolygonindices(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer); /** -* Sets a base material's name +* Get all vertices of a slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[in] pName - new name of the base material. +* @param[in] pSlice - Slice instance. +* @param[in] nIndex - the index of the polygon to manipulate +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pIndicesBuffer - uint32 buffer of the indices of the index-th polygon * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_setname(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const char * pName); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getpolygonindices(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF_uint32 * pIndicesBuffer); /** -* Sets a base material's display color. +* Get the number of vertices in a slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[in] pTheColor - The base material's display color +* @param[in] pSlice - Slice instance. +* @param[in] nIndex - the index of the polygon to manipulate +* @param[out] pCount - the number of indices of the index-th polygon * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_setdisplaycolor(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getpolygonindexcount(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 * pCount); /** -* Returns a base material's display color. +* Get the upper Z-Coordinate of this slice. * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[out] pTheColor - The base material's display color +* @param[in] pSlice - Slice instance. +* @param[out] pZTop - the upper Z-Coordinate of this slice * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_getdisplaycolor(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getztop(Lib3MF_Slice pSlice, Lib3MF_double * pZTop); /************************************************************************************************************************* - Class definition for ColorGroup + Class definition for ToolpathProfile **************************************************************************************************************************/ /** -* Retrieves the count of base materials in this Color Group. +* Retrieves the profile's uuid * -* @param[in] pColorGroup - ColorGroup instance. -* @param[out] pCount - returns the count of colors within this color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_getcount(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getuuid(Lib3MF_ToolpathProfile pToolpathProfile, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* returns all the PropertyIDs of all colors within this group +* Retrieves the profile's name * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the color in the color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of Returns the name., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_getallpropertyids(Lib3MF_ColorGroup pColorGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getname(Lib3MF_ToolpathProfile pToolpathProfile, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Adds a new value. +* Returns the number of parameters. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] pTheColor - The new color -* @param[out] pPropertyID - PropertyID of the new color within this color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[out] pCount - Returns the number of parameters. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_addcolor(Lib3MF_ColorGroup pColorGroup, const sLib3MFColor * pTheColor, Lib3MF_uint32 * pPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparametercount(Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 * pCount); /** -* Removes a color from the color group. +* Returns the Name of a parameter. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyID - PropertyID of the color to be removed from the color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nIndex - Index of Parameter (0-based). Call will fail if an invalid index is given. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of Returns the name of the parameter., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_removecolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparametername(Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Sets a color value. +* Returns the NameSpace of a parameter. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyID - PropertyID of a color within this color group. -* @param[in] pTheColor - The color +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nIndex - Index of Parameter (0-based). Call will fail if an invalid index is given. +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of Returns the namespace of the parameter., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_setcolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparameternamespace(Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* Sets a color value. +* Checks if a parameter value exists. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyID - PropertyID of a color within this color group. -* @param[out] pTheColor - The color +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValueExists - Returns if a value exists. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_getcolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor); - -/************************************************************************************************************************* - Class definition for Texture2DGroup -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_hasparametervalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool * pValueExists); /** -* Retrieves the count of tex2coords in the Texture2DGroup. +* Retrieves a profile's parameter value. Fails if value does not exist. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[out] pCount - returns the count of tex2coords. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of Returns the value of the field., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_getcount(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparametervalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* returns all the PropertyIDs of all tex2coords in this Texture2DGroup +* Retrieves a profile's parameter value * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the tex2coords in the Texture2DGroup. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] pDefaultValue - Default value if value does not exist. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of Returns the value of the field., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_getallpropertyids(Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparametervaluedef(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const char * pDefaultValue, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* Adds a new tex2coord to the Texture2DGroup +* Retrieves a profile's parameter value as double. Fails if value does not exist or is not a double value. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. -* @param[out] pPropertyID - returns new PropertyID of the new tex2coord in the Texture2DGroup. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_addtex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, const sLib3MFTex2Coord * pUVCoordinate, Lib3MF_uint32 * pPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparameterdoublevalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double * pValue); /** -* Obtains a tex2coord to the Texture2DGroup +* Retrieves a profile's parameter value as double. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] nPropertyID - the PropertyID of the tex2coord in the Texture2DGroup. -* @param[out] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] dDefaultValue - Default value if value does not exist or is not a double value. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_gettex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID, sLib3MFTex2Coord * pUVCoordinate); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparameterdoublevaluedef(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double dDefaultValue, Lib3MF_double * pValue); /** -* Removes a tex2coords from the Texture2DGroup. +* Retrieves a profile's parameter value as integer. Fails if value does not exist or is not a integer value. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] nPropertyID - PropertyID of the tex2coords in the Texture2DGroup. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_removetex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparameterintegervalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 * pValue); /** -* Obtains the texture2D instance of this group. +* Retrieves a profile's parameter value as integer. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[out] pTexture2DInstance - the texture2D instance of this group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] nDefaultValue - Default value if value does not exist or is not a integer value. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_gettexture2d(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_Texture2D * pTexture2DInstance); - -/************************************************************************************************************************* - Class definition for CompositeMaterials -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparameterintegervaluedef(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 nDefaultValue, Lib3MF_int64 * pValue); /** -* Retrieves the count of Composite-s in the CompositeMaterials. +* Retrieves a profile's parameter value as boolean. Fails if value does not exist or is not a boolean value. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[out] pCount - returns the count of Composite-s +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_getcount(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparameterboolvalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool * pValue); /** -* returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials +* Retrieves a profile's parameter value as boolean. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the Composite-Mixing Values in the CompositeMaterials. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] bDefaultValue - Default value if value does not exist or is not a boolean value. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_getallpropertyids(Lib3MF_CompositeMaterials pCompositeMaterials, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparameterboolvaluedef(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool bDefaultValue, bool * pValue); /** -* Obtains the BaseMaterialGroup instance of this CompositeMaterials. +* Sets the profile's name * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[out] pBaseMaterialGroupInstance - returns the BaseMaterialGroup instance of this CompositeMaterials +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pName - Returns the name. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_getbasematerialgroup(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_setname(Lib3MF_ToolpathProfile pToolpathProfile, const char * pName); /** -* Adds a new Composite-Mixing Values to the CompositeMaterials. +* Sets a profile's parameter value. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nCompositeBufferSize - Number of elements in buffer -* @param[in] pCompositeBuffer - CompositeConstituent buffer of The Composite Constituents to be added as composite -* @param[out] pPropertyID - returns new PropertyID of the new Composite in the CompositeMaterials. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] pValue - String value of the parameter. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_addcomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint64 nCompositeBufferSize, const sLib3MFCompositeConstituent * pCompositeBuffer, Lib3MF_uint32 * pPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_setparametervalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const char * pValue); /** -* Removes a Composite-Maxing Ratio from the CompositeMaterials. +* Sets a profile's parameter value as double. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nPropertyID - PropertyID of the Composite-Mixing Values in the CompositeMaterials to be removed. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] dValue - Double value of the parameter. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_removecomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_setparameterdoublevalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double dValue); /** -* Obtains a Composite-Maxing Ratio of this CompositeMaterials. +* Sets a profile's parameter value as integer. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nPropertyID - the PropertyID of the Composite-Maxing Ratio in the CompositeMaterials. -* @param[in] nCompositeBufferSize - Number of elements in buffer -* @param[out] pCompositeNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pCompositeBuffer - CompositeConstituent buffer of The Composite-Mixing Values with the given PropertyID +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] nValue - Integer value of the parameter. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_getcomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nCompositeBufferSize, Lib3MF_uint64* pCompositeNeededCount, sLib3MFCompositeConstituent * pCompositeBuffer); - -/************************************************************************************************************************* - Class definition for MultiPropertyGroup -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_setparameterintegervalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 nValue); /** -* Retrieves the count of MultiProperty-s in the MultiPropertyGroup. +* Sets a profile's parameter value as boolean. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[out] pCount - returns the count of MultiProperty-s +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] bValue - Boolean value of the parameter. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getcount(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_setparameterboolvalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool bValue); + +/************************************************************************************************************************* + Class definition for ToolpathLayerReader +**************************************************************************************************************************/ /** -* returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup +* Retrieves the layerdata's uuid * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the MultiProperty-s in the MultiPropertyGroup. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getallpropertyids(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getlayerdatauuid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* Adds a new MultiProperty to the MultiPropertyGroup. +* Retrieves the count of segments. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[in] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the new MultiProperty. -* @param[out] pPropertyID - returns the PropertyID of the new MultiProperty in the MultiPropertyGroup. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[out] pCount - Count * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_addmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer, Lib3MF_uint32 * pPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentcount(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 * pCount); /** -* Sets the PropertyIDs of a MultiProperty. +* Retrieves the segment type information . * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyID - the PropertyID of the MultiProperty to be changed. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[in] pPropertyIDsBuffer - uint32 buffer of The new PropertyIDs of the MultiProperty +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pType - Segment Type +* @param[out] pPointCount - Point count of segment. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_setmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentinfo(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, eLib3MFToolpathSegmentType * pType, Lib3MF_uint32 * pPointCount); /** -* Obtains the PropertyIDs of a MultiProperty. +* Retrieves the assigned segment profile. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyID - the PropertyID of the MultiProperty to be queried. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the MultiProperty +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pProfile - Segment Profile * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentprofile(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_ToolpathProfile * pProfile); /** -* Removes a MultiProperty from this MultiPropertyGroup. +* Retrieves the assigned segment profile uuid. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyID - the PropertyID of the MultiProperty to be removed. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[in] nProfileUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pProfileUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pProfileUUIDBuffer - buffer of Segment Profile UUID, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_removemultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentprofileuuid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nProfileUUIDBufferSize, Lib3MF_uint32* pProfileUUIDNeededChars, char * pProfileUUIDBuffer); /** -* Retrieves the number of layers of this MultiPropertyGroup. +* Retrieves the assigned segment profile. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[out] pCount - returns the number of layers +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pBuildItem - Segment Build Item * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getlayercount(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentpart(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_BuildItem * pBuildItem); /** -* Adds a MultiPropertyLayer to this MultiPropertyGroup. +* Retrieves the assigned segment part uuid. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] pTheLayer - The MultiPropertyLayer to add to this MultiPropertyGroup -* @param[out] pLayerIndex - returns the index of this MultiPropertyLayer +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[in] nPartUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartUUIDBuffer - buffer of Segment Part UUID, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_addlayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const sLib3MFMultiPropertyLayer * pTheLayer, Lib3MF_uint32 * pLayerIndex); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentpartuuid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nPartUUIDBufferSize, Lib3MF_uint32* pPartUUIDNeededChars, char * pPartUUIDBuffer); /** -* Obtains a MultiPropertyLayer of this MultiPropertyGroup. +* Retrieves the assigned segment part id. ATTENTION: This ID is only unique within the layer and there is no guarantee to be globally unique or consistent across layers. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nLayerIndex - The Index of the MultiPropertyLayer queried -* @param[out] pTheLayer - The MultiPropertyLayer with index LayerIndex within MultiPropertyGroup +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pLocalPartID - Local Segment Part ID * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getlayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex, sLib3MFMultiPropertyLayer * pTheLayer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentlocalpartid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 * pLocalPartID); /** -* Removes a MultiPropertyLayer from this MultiPropertyGroup. +* Retrieves the global part UUID by the local part ID. Fails if part ID does not exist in this layer. ATTENTION: This ID is only unique within the layer and there is no guarantee to be globally unique or consistent across layers. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nLayerIndex - The Index of the MultiPropertyLayer to be removed +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nLocalPartID - Local Segment Part ID +* @param[in] nPartUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartUUIDBuffer - buffer of Segment Part UUID, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_removelayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex); - -/************************************************************************************************************************* - Class definition for Attachment -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getpartuuidbylocalpartid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nLocalPartID, const Lib3MF_uint32 nPartUUIDBufferSize, Lib3MF_uint32* pPartUUIDNeededChars, char * pPartUUIDBuffer); /** -* Retrieves an attachment's package path. This function will be removed in a later release. +* Retrieves the assigned segment point list. For type hatch, the points are taken pairwise. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nPathBufferSize - size of the buffer (including trailing 0) -* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPathBuffer - buffer of returns the attachment's package path string, may be NULL +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[out] pPointDataNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPointDataBuffer - Position2D buffer of The point data array * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_getpath(Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentpointdata(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint64 nPointDataBufferSize, Lib3MF_uint64* pPointDataNeededCount, sLib3MFPosition2D * pPointDataBuffer); /** -* Sets an attachment's package path. This function will be removed in a later release. +* Retrieves a segment attribute Information by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pPath - new path of the attachment. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pID - Attribute ID. +* @param[out] pAttributeType - Attribute Type. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_setpath(Lib3MF_Attachment pAttachment, const char * pPath); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_findattributeinfobyname(Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, Lib3MF_uint32 * pID, eLib3MFToolpathAttributeType * pAttributeType); /** -* Returns the PackagePart that is this attachment. +* Retrieves a segment attribute ID by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[out] pPackagePart - The PackagePart of this attachment. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pID - Attribute ID. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_packagepart(Lib3MF_Attachment pAttachment, Lib3MF_PackagePart * pPackagePart); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_findattributeidbyname(Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, Lib3MF_uint32 * pID); /** -* Retrieves an attachment's relationship type +* Retrieves a segment attribute Type by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nPathBufferSize - size of the buffer (including trailing 0) -* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPathBuffer - buffer of returns the attachment's package relationship type string, may be NULL +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pAttributeType - Attribute Type. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_getrelationshiptype(Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_findattributevaluebyname(Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, eLib3MFToolpathAttributeType * pAttributeType); /** -* Sets an attachment's relationship type. +* Retrieves a segment Uint32 attribute by Attribute ID. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pPath - new relationship type string. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] nID - Attribute ID. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_setrelationshiptype(Lib3MF_Attachment pAttachment, const char * pPath); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentintegerattributebyid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 nID, Lib3MF_int64 * pValue); /** -* Writes out the attachment as file. +* Retrieves a segment integer attribute by Attribute Name. Will fail if Attribute does not exist or is of different type. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pFileName - file to write into. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_writetofile(Lib3MF_Attachment pAttachment, const char * pFileName); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentintegerattributebyname(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const char * pNameSpace, const char * pAttributeName, Lib3MF_int64 * pValue); /** -* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Retrieves a segment Double attribute by Attribute ID. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pFileName - file to read from. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] nID - Attribute ID. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_readfromfile(Lib3MF_Attachment pAttachment, const char * pFileName); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 nID, Lib3MF_double * pValue); /** -* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Retrieves a segment Double attribute by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pTheReadCallback - Callback to call for reading a data chunk -* @param[in] nStreamSize - number of bytes the callback returns -* @param[in] pTheSeekCallback - Callback to call for seeking in the stream. -* @param[in] pUserData - Userdata that is passed to the callback function +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_readfromcallback(Lib3MF_Attachment pAttachment, Lib3MFReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MFSeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const char * pNameSpace, const char * pAttributeName, Lib3MF_double * pValue); /** -* Retrieves the size of the attachment stream +* Retrieves the count of custom data elements. * -* @param[in] pAttachment - Attachment instance. -* @param[out] pStreamSize - the stream size +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[out] pCount - Count * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_getstreamsize(Lib3MF_Attachment pAttachment, Lib3MF_uint64 * pStreamSize); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getcustomdatacount(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 * pCount); /** -* Writes out the attachment into a buffer +* Retrieves the custom data. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nBufferBufferSize - Number of elements in buffer -* @param[out] pBufferNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBufferBuffer - uint8 buffer of Buffer to write into +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_writetobuffer(Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getcustomdata(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_CustomDOMTree * pData); /** -* Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). +* Retrieves the node name of the custom data. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nBufferBufferSize - Number of elements in buffer -* @param[in] pBufferBuffer - uint8 buffer of Buffer to read from +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of Namespace of the custom data tree., may be NULL +* @param[in] nDataNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pDataNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pDataNameBuffer - buffer of Root name of the data tree., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_readfrombuffer(Lib3MF_Attachment pAttachment, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getcustomdataname(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer, const Lib3MF_uint32 nDataNameBufferSize, Lib3MF_uint32* pDataNameNeededChars, char * pDataNameBuffer); /************************************************************************************************************************* - Class definition for Texture2D + Class definition for ToolpathLayerData **************************************************************************************************************************/ /** -* Retrieves the attachment located at the path of the texture. +* Retrieves the layerdata's uuid * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pAttachment - attachment that holds the texture's image information. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_getattachment(Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment * pAttachment); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_getlayerdatauuid(Lib3MF_ToolpathLayerData pToolpathLayerData, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* Sets the texture's package path to the path of the attachment. +* Registers a toolpath profile * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] pAttachment - attachment that holds the texture's image information. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pProfile - The toolpath profile to register. +* @param[out] pProfileID - returns the local profile ID for the layer. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_setattachment(Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment pAttachment); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_registerprofile(Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_ToolpathProfile pProfile, Lib3MF_uint32 * pProfileID); /** -* Retrieves a texture's content type. +* Registers a Model Build Item * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pContentType - returns content type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pBuildItem - The model build item to use. +* @param[out] pPartID - returns the local part ID for the layer. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_getcontenttype(Lib3MF_Texture2D pTexture2D, eLib3MFTextureType * pContentType); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_registerbuilditem(Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pPartID); /** -* Retrieves a texture's content type. +* Sets Segment Attribute for all following segments that are added. Overrides previously set attribute. * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] eContentType - new Content Type +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pNameSpace - The namespace of the attribute to register. +* @param[in] pAttributeName - The name of the attribute to register. +* @param[in] pValue - The value of the attribute to register. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_setcontenttype(Lib3MF_Texture2D pTexture2D, eLib3MFTextureType eContentType); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_setsegmentattribute(Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pAttributeName, const char * pValue); /** -* Retrieves a texture's tilestyle type. +* Clears current segment attributes. * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pTileStyleU - returns tilestyle type enum. -* @param[out] pTileStyleV - returns tilestyle type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_gettilestyleuv(Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle * pTileStyleU, eLib3MFTextureTileStyle * pTileStyleV); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_clearsegmentattributes(Lib3MF_ToolpathLayerData pToolpathLayerData); /** -* Sets a texture's tilestyle type. +* writes hatch data to the layer. * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] eTileStyleU - new tilestyle type enum. -* @param[in] eTileStyleV - new tilestyle type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nProfileID - The toolpath profile to use +* @param[in] nPartID - The toolpath part to use +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[in] pPointDataBuffer - Position2D buffer of The point data * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_settilestyleuv(Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle eTileStyleU, eLib3MFTextureTileStyle eTileStyleV); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_writehatchdata(Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const sLib3MFPosition2D * pPointDataBuffer); /** -* Retrieves a texture's filter type. +* writes loop data to the layer. * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pFilter - returns filter type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nProfileID - The toolpath profile to use +* @param[in] nPartID - The toolpath part to use +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[in] pPointDataBuffer - Position2D buffer of The point data * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_getfilter(Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter * pFilter); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_writeloop(Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const sLib3MFPosition2D * pPointDataBuffer); /** -* Sets a texture's filter type. +* writes polyline data to the layer. * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] eFilter - sets new filter type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nProfileID - The toolpath profile to use +* @param[in] nPartID - The toolpath part to use +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[in] pPointDataBuffer - Position2D buffer of The point data * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_setfilter(Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter eFilter); - -/************************************************************************************************************************* - Class definition for BuildItem -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_writepolyline(Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const sLib3MFPosition2D * pPointDataBuffer); /** -* Retrieves the object resource associated to a build item +* Adds a custom data DOM tree to the layer. Layer MUST not be finished when changing the DOM tree. * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pObjectResource - returns the associated resource instance +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pDataName - Root name of the data tree. MUST not be empty. MUST be a valid XML name string. +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getobjectresource(Lib3MF_BuildItem pBuildItem, Lib3MF_Object * pObjectResource); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_addcustomdata(Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData); /** -* returns, whether a build item has a UUID and, if true, the build item's UUID +* finishes all writing of the layer and compresses toolpath data. * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pHasUUID - flag whether the build item has a UUID -* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL +* @param[in] pToolpathLayerData - ToolpathLayerData instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getuuid(Lib3MF_BuildItem pBuildItem, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_finish(Lib3MF_ToolpathLayerData pToolpathLayerData); + +/************************************************************************************************************************* + Class definition for Toolpath +**************************************************************************************************************************/ /** -* sets the build item's UUID +* Retrieves the unit factor * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' +* @param[in] pToolpath - Toolpath instance. +* @param[out] pUnits - Returns the unit factor. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_setuuid(Lib3MF_BuildItem pBuildItem, const char * pUUID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getunits(Lib3MF_Toolpath pToolpath, Lib3MF_double * pUnits); /** -* Retrieves the object UniqueResourceID associated to a build item +* Retrieves the count of layers * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pUniqueResourceID - returns the UniqueResourceID of the object +* @param[in] pToolpath - Toolpath instance. +* @param[out] pCount - Returns the layer count * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getobjectresourceid(Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pUniqueResourceID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getlayercount(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount); /** -* Checks, if a build item has a non-identity transformation matrix +* Retrieves the count of profiles * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pHasTransform - returns true, if the transformation matrix is not the identity +* @param[in] pToolpath - Toolpath instance. +* @param[out] pCount - Returns the profile count * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_hasobjecttransform(Lib3MF_BuildItem pBuildItem, bool * pHasTransform); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getprofilecount(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount); /** -* Retrieves a build item's transformation matrix. +* Adds a new toolpath layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pTransform - returns the transformation matrix +* @param[in] pToolpath - Toolpath instance. +* @param[in] nZMax - ZMax value +* @param[in] pPath - Package Path +* @param[in] pModelWriter - The model writer that writes out the 3MF. +* @param[out] pLayerData - Returns the layerdata object to write the layer content into. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getobjecttransform(Lib3MF_BuildItem pBuildItem, sLib3MFTransform * pTransform); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_addlayer(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nZMax, const char * pPath, Lib3MF_Writer pModelWriter, Lib3MF_ToolpathLayerData * pLayerData); /** -* Sets a build item's transformation matrix. +* Retrieves the Attachment of a layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] pTransform - new transformation matrix +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[out] pAttachment - Attachment * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_setobjecttransform(Lib3MF_BuildItem pBuildItem, const sLib3MFTransform * pTransform); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getlayerattachment(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_Attachment * pAttachment); /** -* Retrieves a build item's part number string +* Reads the toolpath of a layer. * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) -* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPartNumberBuffer - buffer of Returns a build item's part number string, may be NULL +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[out] pToolpathReader - Toolpath Reader Instance * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getpartnumber(Lib3MF_BuildItem pBuildItem, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_readlayerdata(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_ToolpathLayerReader * pToolpathReader); /** -* Sets a build item's part number string +* Retrieves the Path of a layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] pSetPartnumber - new part number string for referencing parts from the outside world +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of Package Path, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_setpartnumber(Lib3MF_BuildItem pBuildItem, const char * pSetPartnumber); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getlayerpath(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); /** -* Returns the metadatagroup of this build item +* Retrieves the ZMax of a layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this build item +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[out] pZMax - ZMax value * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getmetadatagroup(Lib3MF_BuildItem pBuildItem, Lib3MF_MetaDataGroup * pMetaDataGroup); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getlayerzmax(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_uint32 * pZMax); /** -* Returns the outbox of a build item +* Return the z value of a layer in units. * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pOutbox - Outbox of this build item +* @param[in] pToolpath - Toolpath instance. +* @param[in] nLayerIndex - Layer Index. +* @param[out] pZValue - Z Value in Units. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getoutbox(Lib3MF_BuildItem pBuildItem, sLib3MFBox * pOutbox); - -/************************************************************************************************************************* - Class definition for BuildItemIterator -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getlayerz(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nLayerIndex, Lib3MF_uint32 * pZValue); /** -* Iterates to the next build item in the list. +* Adds a new profile to the toolpath. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pHasNext - Iterates to the next build item in the list. +* @param[in] pToolpath - Toolpath instance. +* @param[in] pName - the name. +* @param[out] pProfile - Returns the profile. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_movenext(Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasNext); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_addprofile(Lib3MF_Toolpath pToolpath, const char * pName, Lib3MF_ToolpathProfile * pProfile); /** -* Iterates to the previous build item in the list. +* Returns a profile of the toolpath. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pHasPrevious - Iterates to the previous build item in the list. +* @param[in] pToolpath - Toolpath instance. +* @param[in] nProfileIndex - Layer Index. +* @param[out] pProfile - Returns the profile. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_moveprevious(Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasPrevious); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getprofile(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nProfileIndex, Lib3MF_ToolpathProfile * pProfile); /** -* Returns the build item the iterator points at. +* Returns a profile of the toolpath by UUID. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pBuildItem - returns the build item instance. +* @param[in] pToolpath - Toolpath instance. +* @param[in] pProfileUUID - UUID string. +* @param[out] pProfile - Returns the profile. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_getcurrent(Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItem * pBuildItem); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getprofileuuid(Lib3MF_Toolpath pToolpath, const char * pProfileUUID, Lib3MF_ToolpathProfile * pProfile); /** -* Creates a new build item iterator with the same build item list. +* Retrieves the count of custom data elements. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pOutBuildItemIterator - returns the cloned Iterator instance +* @param[in] pToolpath - Toolpath instance. +* @param[out] pCount - Count * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_clone(Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItemIterator * pOutBuildItemIterator); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getcustomdatacount(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount); /** -* Returns the number of build items the iterator captures. +* Retrieves the custom data. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pCount - returns the number of build items the iterator captures. +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_count(Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_uint64 * pCount); - -/************************************************************************************************************************* - Class definition for Slice -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getcustomdata(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_CustomDOMTree * pData); /** -* Set all vertices of a slice. All polygons will be cleared. +* Retrieves the node name of the custom data. * -* @param[in] pSlice - Slice instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[in] pVerticesBuffer - Position2D buffer of contains the positions. +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of Namespace of the custom data tree., may be NULL +* @param[in] nDataNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pDataNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pDataNameBuffer - buffer of Root name of the data tree., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_setvertices(Lib3MF_Slice pSlice, Lib3MF_uint64 nVerticesBufferSize, const sLib3MFPosition2D * pVerticesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getcustomdataname(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer, const Lib3MF_uint32 nDataNameBufferSize, Lib3MF_uint32* pDataNameNeededChars, char * pDataNameBuffer); /** -* Get all vertices of a slice +* Retrieves if custom data with a specific namespace and name combination exists. * -* @param[in] pSlice - Slice instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pVerticesBuffer - Position2D buffer of contains the positions. +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. +* @param[in] pDataName - Root name of the data tree. +* @param[out] pCustomDataExists - Returns true if DOM Tree Exists. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getvertices(Lib3MF_Slice pSlice, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, sLib3MFPosition2D * pVerticesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_hasuniquecustomdata(Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, bool * pCustomDataExists); /** -* Get the number of vertices in a slice +* Retrieves the custom data with a specific namespace and name combination. Fails if combination is not unique. * -* @param[in] pSlice - Slice instance. -* @param[out] pCount - the number of vertices in the slice +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. +* @param[in] pDataName - Root name of the data tree. +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getvertexcount(Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_finduniquecustomdata(Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData); /** -* Add a new polygon to this slice +* Adds a custom data DOM tree to the toolpath. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the new polygon -* @param[out] pIndex - the index of the new polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pDataName - Root name of the data tree. MUST not be empty. MUST be a valid XML name string. +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_addpolygon(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer, Lib3MF_uint64 * pIndex); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_addcustomdata(Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData); /** -* Get the number of polygons in the slice +* Deletes all custom data. * -* @param[in] pSlice - Slice instance. -* @param[out] pCount - the number of polygons in the slice +* @param[in] pToolpath - Toolpath instance. +* @param[out] pNumberOfDeletedItems - Returns number of deleted items. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getpolygoncount(Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_clearcustomdata(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pNumberOfDeletedItems); /** -* Set all indices of a polygon +* Deletes a custom data instance from the list. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndex - the index of the polygon to manipulate -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the index-th polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pData - DOM Tree of the data. +* @param[out] pSuccess - Returns if deletion was successful. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_setpolygonindices(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_deletecustomdata(Lib3MF_Toolpath pToolpath, Lib3MF_CustomDOMTree pData, bool * pSuccess); /** -* Get all vertices of a slice +* Registers an Integer Attribute that each segment holds. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndex - the index of the polygon to manipulate -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pIndicesBuffer - uint32 buffer of the indices of the index-th polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pAttributeName - Attribute name. MUST not be empty. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getpolygonindices(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF_uint32 * pIndicesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_registercustomintegerattribute(Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pAttributeName); /** -* Get the number of vertices in a slice +* Registers a Double Attribute that each segment holds. Registering only applies to reader or writer objects created after the call. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndex - the index of the polygon to manipulate -* @param[out] pCount - the number of indices of the index-th polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pAttributeName - Attribute name. MUST not be empty. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getpolygonindexcount(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_registercustomdoubleattribute(Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pAttributeName); + +/************************************************************************************************************************* + Class definition for ToolpathIterator +**************************************************************************************************************************/ /** -* Get the upper Z-Coordinate of this slice. +* Returns the Toolpath the iterator points at. * -* @param[in] pSlice - Slice instance. -* @param[out] pZTop - the upper Z-Coordinate of this slice +* @param[in] pToolpathIterator - ToolpathIterator instance. +* @param[out] pResource - returns the Toolpath instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getztop(Lib3MF_Slice pSlice, Lib3MF_double * pZTop); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathiterator_getcurrenttoolpath(Lib3MF_ToolpathIterator pToolpathIterator, Lib3MF_Toolpath * pResource); /************************************************************************************************************************* Class definition for SliceStack @@ -3274,6 +4681,15 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getcompositematerials(Lib3MF_Model pMo */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getmultipropertygroups(Lib3MF_Model pModel, Lib3MF_MultiPropertyGroupIterator * pResourceIterator); +/** +* creates a Toolpath instance with all toolpath resources. +* +* @param[in] pModel - Model instance. +* @param[out] pResourceIterator - returns the iterator instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_gettoolpaths(Lib3MF_Model pModel, Lib3MF_ToolpathIterator * pResourceIterator); + /** * creates a resource iterator instance with all slice stack resources. * @@ -3397,6 +4813,16 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_addbuilditem(Lib3MF_Model pModel, Lib3 */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_removebuilditem(Lib3MF_Model pModel, Lib3MF_BuildItem pBuildItemInstance); +/** +* adds an empty Toolpath resource to the model. +* +* @param[in] pModel - Model instance. +* @param[in] dUnitFactor - The toolpath instance of the created Toolpath. +* @param[out] pToolpathInstance - The toolpath instance of the created Toolpath. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_addtoolpath(Lib3MF_Model pModel, Lib3MF_double dUnitFactor, Lib3MF_Toolpath * pToolpathInstance); + /** * Returns the metadata of the model as MetaDataGroup * @@ -3528,6 +4954,40 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_setrandomnumbercallback(Lib3MF_Model p */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getkeystore(Lib3MF_Model pModel, Lib3MF_KeyStore * pKeyStore); +/** +* Creates an OPC Reader Source from a file. +* +* @param[in] pModel - Model instance. +* @param[in] pFilename - Filename to read from +* @param[out] pInstance - The instance of the created reader source +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_createpersistentsourcefromfile(Lib3MF_Model pModel, const char * pFilename, Lib3MF_PersistentReaderSource * pInstance); + +/** +* Creates an OPC Reader Source from a memory buffer. The memory buffer MUST exist as long as the Source object exists. +* +* @param[in] pModel - Model instance. +* @param[in] nBufferBufferSize - Number of elements in buffer +* @param[in] pBufferBuffer - uint8 buffer of Buffer to read from +* @param[out] pInstance - The instance of the created reader source +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_createpersistentsourcefrombuffer(Lib3MF_Model pModel, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer, Lib3MF_PersistentReaderSource * pInstance); + +/** +* Creates an OPC Reader Source from a data provided by a callback function. The callbacks MUST exist as long as the source object exists. +* +* @param[in] pModel - Model instance. +* @param[in] pTheReadCallback - Callback to call for reading a data chunk +* @param[in] nStreamSize - number of bytes the callback returns +* @param[in] pTheSeekCallback - Callback to call for seeking in the stream. +* @param[in] pUserData - Userdata that is passed to the callback function +* @param[out] pInstance - The instance of the created reader source +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_createpersistentsourcefromcallback(Lib3MF_Model pModel, Lib3MFReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MFSeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData, Lib3MF_PersistentReaderSource * pInstance); + /************************************************************************************************************************* Global functions **************************************************************************************************************************/ diff --git a/Autogenerated/Bindings/C/lib3mf_types.h b/Autogenerated/Bindings/C/lib3mf_types.h index 6f2dcf6a4..ed4941824 100644 --- a/Autogenerated/Bindings/C/lib3mf_types.h +++ b/Autogenerated/Bindings/C/lib3mf_types.h @@ -130,13 +130,27 @@ typedef void * Lib3MF_pvoid; #define LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER 140 /** A progress identifier is unknown */ #define LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT 141 /** An element buffer exceeds its spec limit */ #define LIB3MF_ERROR_INVALIDRESOURCE 142 /** A resource is invalid */ +#define LIB3MF_ERROR_INVALIDNODEINDEX 143 /** Invalid node index */ +#define LIB3MF_ERROR_INVALIDATTRIBUTEINDEX 144 /** Invalid attribute index */ +#define LIB3MF_ERROR_DUPLICATECUSTOMDATA 145 /** Duplicate custom data */ +#define LIB3MF_ERROR_CUSTOMDATANOTFOUND 146 /** Custom data not found */ #define LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE 2000 /** This object type is not valid for beamlattices */ #define LIB3MF_ERROR_INVALIDKEYSTORE 3000 /** The keystore object is invalid */ #define LIB3MF_ERROR_INVALIDKEYSTORECONSUMER 3001 /** The consumer keystore object is invalid */ #define LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND 3002 /** A consumer has not been found */ #define LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND 3003 /** A resource data has not been found */ #define LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED 3004 /** A Key or Conentent encryption callback has not been registered */ -#define LIB3MF_ERROR_INVALIDKEYSIZE 3005 /** The key siue is invalid */ +#define LIB3MF_ERROR_INVALIDKEYSIZE 3005 /** The key size is invalid */ +#define LIB3MF_ERROR_TOOLPATH_NOTWRITINGHEADER 4000 /** Not in toolpath header writing mode */ +#define LIB3MF_ERROR_TOOLPATH_NOTWRITINGDATA 4001 /** Not in toolpath data writing mode */ +#define LIB3MF_ERROR_TOOLPATH_DATAHASBEENWRITTEN 4002 /** Toolpath has already been written out */ +#define LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT 4003 /** Toolpath has an invalid number of points */ +#define LIB3MF_ERROR_TOOLPATH_ATTRIBUTEALREADYDEFINED 4004 /** Toolpath attribute already defined */ +#define LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE 4005 /** Toolpath attribute is of invalid type */ +#define LIB3MF_ERROR_EMPTYNAMESPACEPREFIX 4006 /** Empty namespace prefix. */ +#define LIB3MF_ERROR_EMPTYNAMESPACE 4007 /** Empty namespace. */ +#define LIB3MF_ERROR_INVALIDNAMESPACEPREFIX 4008 /** Invalid namespace prefix. */ +#define LIB3MF_ERROR_WRITERDOESNOTSUPPORTNAMESPACES 4009 /** Writer does not support namespaces. */ /************************************************************************************************************************* Error strings for Lib3MF @@ -181,13 +195,27 @@ inline const char * LIB3MF_GETERRORSTRING (Lib3MFResult nErrorCode) { case LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER: return "A progress identifier is unknown"; case LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT: return "An element buffer exceeds its spec limit"; case LIB3MF_ERROR_INVALIDRESOURCE: return "A resource is invalid"; + case LIB3MF_ERROR_INVALIDNODEINDEX: return "Invalid node index"; + case LIB3MF_ERROR_INVALIDATTRIBUTEINDEX: return "Invalid attribute index"; + case LIB3MF_ERROR_DUPLICATECUSTOMDATA: return "Duplicate custom data"; + case LIB3MF_ERROR_CUSTOMDATANOTFOUND: return "Custom data not found"; case LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE: return "This object type is not valid for beamlattices"; case LIB3MF_ERROR_INVALIDKEYSTORE: return "The keystore object is invalid"; case LIB3MF_ERROR_INVALIDKEYSTORECONSUMER: return "The consumer keystore object is invalid"; case LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND: return "A consumer has not been found"; case LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND: return "A resource data has not been found"; case LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED: return "A Key or Conentent encryption callback has not been registered"; - case LIB3MF_ERROR_INVALIDKEYSIZE: return "The key siue is invalid"; + case LIB3MF_ERROR_INVALIDKEYSIZE: return "The key size is invalid"; + case LIB3MF_ERROR_TOOLPATH_NOTWRITINGHEADER: return "Not in toolpath header writing mode"; + case LIB3MF_ERROR_TOOLPATH_NOTWRITINGDATA: return "Not in toolpath data writing mode"; + case LIB3MF_ERROR_TOOLPATH_DATAHASBEENWRITTEN: return "Toolpath has already been written out"; + case LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT: return "Toolpath has an invalid number of points"; + case LIB3MF_ERROR_TOOLPATH_ATTRIBUTEALREADYDEFINED: return "Toolpath attribute already defined"; + case LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE: return "Toolpath attribute is of invalid type"; + case LIB3MF_ERROR_EMPTYNAMESPACEPREFIX: return "Empty namespace prefix."; + case LIB3MF_ERROR_EMPTYNAMESPACE: return "Empty namespace."; + case LIB3MF_ERROR_INVALIDNAMESPACEPREFIX: return "Invalid namespace prefix."; + case LIB3MF_ERROR_WRITERDOESNOTSUPPORTNAMESPACES: return "Writer does not support namespaces."; default: return "unknown error"; } } @@ -197,11 +225,17 @@ inline const char * LIB3MF_GETERRORSTRING (Lib3MFResult nErrorCode) { **************************************************************************************************************************/ typedef Lib3MFHandle Lib3MF_Base; +typedef Lib3MFHandle Lib3MF_BinaryStream; typedef Lib3MFHandle Lib3MF_Writer; +typedef Lib3MFHandle Lib3MF_PersistentReaderSource; typedef Lib3MFHandle Lib3MF_Reader; typedef Lib3MFHandle Lib3MF_PackagePart; typedef Lib3MFHandle Lib3MF_Resource; typedef Lib3MFHandle Lib3MF_ResourceIterator; +typedef Lib3MFHandle Lib3MF_CustomXMLAttribute; +typedef Lib3MFHandle Lib3MF_CustomXMLNode; +typedef Lib3MFHandle Lib3MF_CustomXMLNodes; +typedef Lib3MFHandle Lib3MF_CustomDOMTree; typedef Lib3MFHandle Lib3MF_SliceStackIterator; typedef Lib3MFHandle Lib3MF_ObjectIterator; typedef Lib3MFHandle Lib3MF_MeshObjectIterator; @@ -230,6 +264,11 @@ typedef Lib3MFHandle Lib3MF_Texture2D; typedef Lib3MFHandle Lib3MF_BuildItem; typedef Lib3MFHandle Lib3MF_BuildItemIterator; typedef Lib3MFHandle Lib3MF_Slice; +typedef Lib3MFHandle Lib3MF_ToolpathProfile; +typedef Lib3MFHandle Lib3MF_ToolpathLayerReader; +typedef Lib3MFHandle Lib3MF_ToolpathLayerData; +typedef Lib3MFHandle Lib3MF_Toolpath; +typedef Lib3MFHandle Lib3MF_ToolpathIterator; typedef Lib3MFHandle Lib3MF_SliceStack; typedef Lib3MFHandle Lib3MF_Consumer; typedef Lib3MFHandle Lib3MF_AccessRight; @@ -257,6 +296,13 @@ typedef enum eLib3MFSlicesMeshResolution { eSlicesMeshResolutionLowres = 1 } eLib3MFSlicesMeshResolution; +typedef enum eLib3MFPersistentReaderSourceType { + ePersistentReaderSourceTypeUnknown = 0, + ePersistentReaderSourceTypeFileOnDisk = 1, + ePersistentReaderSourceTypeMemoryBuffer = 2, + ePersistentReaderSourceTypeCallback = 3 +} eLib3MFPersistentReaderSourceType; + typedef enum eLib3MFModelUnit { eModelUnitMicroMeter = 0, eModelUnitMilliMeter = 1, @@ -310,6 +356,11 @@ typedef enum eLib3MFBeamLatticeBallMode { eBeamLatticeBallModeAll = 2 } eLib3MFBeamLatticeBallMode; +typedef enum eLib3MFBinaryStreamPredictionType { + eBinaryStreamPredictionTypeNoPrediction = 0, + eBinaryStreamPredictionTypeDeltaPrediction = 1 +} eLib3MFBinaryStreamPredictionType; + typedef enum eLib3MFProgressIdentifier { eProgressIdentifierQUERYCANCELED = 0, eProgressIdentifierDONE = 1, @@ -343,6 +394,19 @@ typedef enum eLib3MFBlendMethod { eBlendMethodMultiply = 2 } eLib3MFBlendMethod; +typedef enum eLib3MFToolpathSegmentType { + eToolpathSegmentTypeUnknown = 0, + eToolpathSegmentTypeHatch = 1, + eToolpathSegmentTypeLoop = 2, + eToolpathSegmentTypePolyline = 3 +} eLib3MFToolpathSegmentType; + +typedef enum eLib3MFToolpathAttributeType { + eToolpathAttributeTypeUnknown = 0, + eToolpathAttributeTypeInteger = 1, + eToolpathAttributeTypeDouble = 2 +} eLib3MFToolpathAttributeType; + typedef enum eLib3MFEncryptionAlgorithm { eEncryptionAlgorithmAES256_GCM = 1 /** http://www.w3.org/2009/xmlenc11#aes256-gcm */ } eLib3MFEncryptionAlgorithm; @@ -383,6 +447,11 @@ typedef union { int m_code; } structEnumLib3MFSlicesMeshResolution; +typedef union { + eLib3MFPersistentReaderSourceType m_enum; + int m_code; +} structEnumLib3MFPersistentReaderSourceType; + typedef union { eLib3MFModelUnit m_enum; int m_code; @@ -423,6 +492,11 @@ typedef union { int m_code; } structEnumLib3MFBeamLatticeBallMode; +typedef union { + eLib3MFBinaryStreamPredictionType m_enum; + int m_code; +} structEnumLib3MFBinaryStreamPredictionType; + typedef union { eLib3MFProgressIdentifier m_enum; int m_code; @@ -433,6 +507,16 @@ typedef union { int m_code; } structEnumLib3MFBlendMethod; +typedef union { + eLib3MFToolpathSegmentType m_enum; + int m_code; +} structEnumLib3MFToolpathSegmentType; + +typedef union { + eLib3MFToolpathAttributeType m_enum; + int m_code; +} structEnumLib3MFToolpathAttributeType; + typedef union { eLib3MFEncryptionAlgorithm m_enum; int m_code; diff --git a/Autogenerated/Bindings/CDynamic/lib3mf_dynamic.cc b/Autogenerated/Bindings/CDynamic/lib3mf_dynamic.cc index e1cec341d..c561fda7f 100644 --- a/Autogenerated/Bindings/CDynamic/lib3mf_dynamic.cc +++ b/Autogenerated/Bindings/CDynamic/lib3mf_dynamic.cc @@ -49,6 +49,13 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_LibraryHandle = NULL; pWrapperTable->m_Base_ClassTypeId = NULL; + pWrapperTable->m_BinaryStream_GetBinaryPath = NULL; + pWrapperTable->m_BinaryStream_GetIndexPath = NULL; + pWrapperTable->m_BinaryStream_GetUUID = NULL; + pWrapperTable->m_BinaryStream_DisableDiscretizedArrayCompression = NULL; + pWrapperTable->m_BinaryStream_EnableDiscretizedArrayCompression = NULL; + pWrapperTable->m_BinaryStream_EnableLZMA = NULL; + pWrapperTable->m_BinaryStream_DisableLZMA = NULL; pWrapperTable->m_Writer_WriteToFile = NULL; pWrapperTable->m_Writer_GetStreamSize = NULL; pWrapperTable->m_Writer_WriteToBuffer = NULL; @@ -62,6 +69,13 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Writer_GetWarningCount = NULL; pWrapperTable->m_Writer_AddKeyWrappingCallback = NULL; pWrapperTable->m_Writer_SetContentEncryptionCallback = NULL; + pWrapperTable->m_Writer_CreateBinaryStream = NULL; + pWrapperTable->m_Writer_AssignBinaryStream = NULL; + pWrapperTable->m_Writer_RegisterCustomNamespace = NULL; + pWrapperTable->m_PersistentReaderSource_GetSourceType = NULL; + pWrapperTable->m_PersistentReaderSource_InvalidateSourceData = NULL; + pWrapperTable->m_PersistentReaderSource_SourceDataIsValid = NULL; + pWrapperTable->m_Reader_ReadFromPersistentSource = NULL; pWrapperTable->m_Reader_ReadFromFile = NULL; pWrapperTable->m_Reader_ReadFromBuffer = NULL; pWrapperTable->m_Reader_ReadFromCallback = NULL; @@ -86,6 +100,51 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_ResourceIterator_GetCurrent = NULL; pWrapperTable->m_ResourceIterator_Clone = NULL; pWrapperTable->m_ResourceIterator_Count = NULL; + pWrapperTable->m_CustomXMLAttribute_GetName = NULL; + pWrapperTable->m_CustomXMLAttribute_GetValue = NULL; + pWrapperTable->m_CustomXMLAttribute_IsValidInteger = NULL; + pWrapperTable->m_CustomXMLAttribute_GetIntegerValue = NULL; + pWrapperTable->m_CustomXMLAttribute_IsValidDouble = NULL; + pWrapperTable->m_CustomXMLAttribute_GetDoubleValue = NULL; + pWrapperTable->m_CustomXMLAttribute_IsValidBool = NULL; + pWrapperTable->m_CustomXMLAttribute_GetBoolValue = NULL; + pWrapperTable->m_CustomXMLAttribute_SetValue = NULL; + pWrapperTable->m_CustomXMLAttribute_SetIntegerValue = NULL; + pWrapperTable->m_CustomXMLAttribute_SetDoubleValue = NULL; + pWrapperTable->m_CustomXMLAttribute_SetBoolValue = NULL; + pWrapperTable->m_CustomXMLAttribute_Remove = NULL; + pWrapperTable->m_CustomXMLNode_GetName = NULL; + pWrapperTable->m_CustomXMLNode_GetNameSpace = NULL; + pWrapperTable->m_CustomXMLNode_GetAttributeCount = NULL; + pWrapperTable->m_CustomXMLNode_GetAttribute = NULL; + pWrapperTable->m_CustomXMLNode_HasAttribute = NULL; + pWrapperTable->m_CustomXMLNode_FindAttribute = NULL; + pWrapperTable->m_CustomXMLNode_RemoveAttribute = NULL; + pWrapperTable->m_CustomXMLNode_RemoveAttributeByIndex = NULL; + pWrapperTable->m_CustomXMLNode_AddAttribute = NULL; + pWrapperTable->m_CustomXMLNode_AddIntegerAttribute = NULL; + pWrapperTable->m_CustomXMLNode_AddDoubleAttribute = NULL; + pWrapperTable->m_CustomXMLNode_AddBoolAttribute = NULL; + pWrapperTable->m_CustomXMLNode_GetChildren = NULL; + pWrapperTable->m_CustomXMLNode_CountChildrenByName = NULL; + pWrapperTable->m_CustomXMLNode_GetChildrenByName = NULL; + pWrapperTable->m_CustomXMLNode_HasChild = NULL; + pWrapperTable->m_CustomXMLNode_HasUniqueChild = NULL; + pWrapperTable->m_CustomXMLNode_FindChild = NULL; + pWrapperTable->m_CustomXMLNode_AddChild = NULL; + pWrapperTable->m_CustomXMLNode_RemoveChild = NULL; + pWrapperTable->m_CustomXMLNode_RemoveChildrenWithName = NULL; + pWrapperTable->m_CustomXMLNode_Remove = NULL; + pWrapperTable->m_CustomXMLNodes_GetNodeCount = NULL; + pWrapperTable->m_CustomXMLNodes_GetNode = NULL; + pWrapperTable->m_CustomXMLNodes_CountNodesByName = NULL; + pWrapperTable->m_CustomXMLNodes_GetNodesByName = NULL; + pWrapperTable->m_CustomXMLNodes_HasNode = NULL; + pWrapperTable->m_CustomXMLNodes_HasUniqueNode = NULL; + pWrapperTable->m_CustomXMLNodes_FindNode = NULL; + pWrapperTable->m_CustomDOMTree_GetNameSpace = NULL; + pWrapperTable->m_CustomDOMTree_GetRootNode = NULL; + pWrapperTable->m_CustomDOMTree_SaveToString = NULL; pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack = NULL; pWrapperTable->m_ObjectIterator_GetCurrentObject = NULL; pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject = NULL; @@ -278,6 +337,78 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Slice_GetPolygonIndices = NULL; pWrapperTable->m_Slice_GetPolygonIndexCount = NULL; pWrapperTable->m_Slice_GetZTop = NULL; + pWrapperTable->m_ToolpathProfile_GetUUID = NULL; + pWrapperTable->m_ToolpathProfile_GetName = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterCount = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterName = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterNameSpace = NULL; + pWrapperTable->m_ToolpathProfile_HasParameterValue = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterValue = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterValueDef = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterDoubleValue = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterDoubleValueDef = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterIntegerValue = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterIntegerValueDef = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterBoolValue = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterBoolValueDef = NULL; + pWrapperTable->m_ToolpathProfile_SetName = NULL; + pWrapperTable->m_ToolpathProfile_SetParameterValue = NULL; + pWrapperTable->m_ToolpathProfile_SetParameterDoubleValue = NULL; + pWrapperTable->m_ToolpathProfile_SetParameterIntegerValue = NULL; + pWrapperTable->m_ToolpathProfile_SetParameterBoolValue = NULL; + pWrapperTable->m_ToolpathLayerReader_GetLayerDataUUID = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentCount = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentInfo = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentProfile = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentProfileUUID = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentPart = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentPartUUID = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentLocalPartID = NULL; + pWrapperTable->m_ToolpathLayerReader_GetPartUUIDByLocalPartID = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentPointData = NULL; + pWrapperTable->m_ToolpathLayerReader_FindAttributeInfoByName = NULL; + pWrapperTable->m_ToolpathLayerReader_FindAttributeIDByName = NULL; + pWrapperTable->m_ToolpathLayerReader_FindAttributeValueByName = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByID = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByName = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByID = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByName = NULL; + pWrapperTable->m_ToolpathLayerReader_GetCustomDataCount = NULL; + pWrapperTable->m_ToolpathLayerReader_GetCustomData = NULL; + pWrapperTable->m_ToolpathLayerReader_GetCustomDataName = NULL; + pWrapperTable->m_ToolpathLayerData_GetLayerDataUUID = NULL; + pWrapperTable->m_ToolpathLayerData_RegisterProfile = NULL; + pWrapperTable->m_ToolpathLayerData_RegisterBuildItem = NULL; + pWrapperTable->m_ToolpathLayerData_SetSegmentAttribute = NULL; + pWrapperTable->m_ToolpathLayerData_ClearSegmentAttributes = NULL; + pWrapperTable->m_ToolpathLayerData_WriteHatchData = NULL; + pWrapperTable->m_ToolpathLayerData_WriteLoop = NULL; + pWrapperTable->m_ToolpathLayerData_WritePolyline = NULL; + pWrapperTable->m_ToolpathLayerData_AddCustomData = NULL; + pWrapperTable->m_ToolpathLayerData_Finish = NULL; + pWrapperTable->m_Toolpath_GetUnits = NULL; + pWrapperTable->m_Toolpath_GetLayerCount = NULL; + pWrapperTable->m_Toolpath_GetProfileCount = NULL; + pWrapperTable->m_Toolpath_AddLayer = NULL; + pWrapperTable->m_Toolpath_GetLayerAttachment = NULL; + pWrapperTable->m_Toolpath_ReadLayerData = NULL; + pWrapperTable->m_Toolpath_GetLayerPath = NULL; + pWrapperTable->m_Toolpath_GetLayerZMax = NULL; + pWrapperTable->m_Toolpath_GetLayerZ = NULL; + pWrapperTable->m_Toolpath_AddProfile = NULL; + pWrapperTable->m_Toolpath_GetProfile = NULL; + pWrapperTable->m_Toolpath_GetProfileUUID = NULL; + pWrapperTable->m_Toolpath_GetCustomDataCount = NULL; + pWrapperTable->m_Toolpath_GetCustomData = NULL; + pWrapperTable->m_Toolpath_GetCustomDataName = NULL; + pWrapperTable->m_Toolpath_HasUniqueCustomData = NULL; + pWrapperTable->m_Toolpath_FindUniqueCustomData = NULL; + pWrapperTable->m_Toolpath_AddCustomData = NULL; + pWrapperTable->m_Toolpath_ClearCustomData = NULL; + pWrapperTable->m_Toolpath_DeleteCustomData = NULL; + pWrapperTable->m_Toolpath_RegisterCustomIntegerAttribute = NULL; + pWrapperTable->m_Toolpath_RegisterCustomDoubleAttribute = NULL; + pWrapperTable->m_ToolpathIterator_GetCurrentToolpath = NULL; pWrapperTable->m_SliceStack_GetBottomZ = NULL; pWrapperTable->m_SliceStack_GetSliceCount = NULL; pWrapperTable->m_SliceStack_GetSlice = NULL; @@ -361,6 +492,7 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Model_GetTexture2DGroups = NULL; pWrapperTable->m_Model_GetCompositeMaterials = NULL; pWrapperTable->m_Model_GetMultiPropertyGroups = NULL; + pWrapperTable->m_Model_GetToolpaths = NULL; pWrapperTable->m_Model_GetSliceStacks = NULL; pWrapperTable->m_Model_MergeToModel = NULL; pWrapperTable->m_Model_AddMeshObject = NULL; @@ -374,6 +506,7 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Model_AddMultiPropertyGroup = NULL; pWrapperTable->m_Model_AddBuildItem = NULL; pWrapperTable->m_Model_RemoveBuildItem = NULL; + pWrapperTable->m_Model_AddToolpath = NULL; pWrapperTable->m_Model_GetMetaDataGroup = NULL; pWrapperTable->m_Model_AddAttachment = NULL; pWrapperTable->m_Model_RemoveAttachment = NULL; @@ -388,6 +521,9 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Model_RemoveCustomContentType = NULL; pWrapperTable->m_Model_SetRandomNumberCallback = NULL; pWrapperTable->m_Model_GetKeyStore = NULL; + pWrapperTable->m_Model_CreatePersistentSourceFromFile = NULL; + pWrapperTable->m_Model_CreatePersistentSourceFromBuffer = NULL; + pWrapperTable->m_Model_CreatePersistentSourceFromCallback = NULL; pWrapperTable->m_GetLibraryVersion = NULL; pWrapperTable->m_GetPrereleaseInformation = NULL; pWrapperTable->m_GetBuildInformation = NULL; @@ -470,6 +606,69 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Base_ClassTypeId == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_GetBinaryPath = (PLib3MFBinaryStream_GetBinaryPathPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_getbinarypath"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_GetBinaryPath = (PLib3MFBinaryStream_GetBinaryPathPtr) dlsym(hLibrary, "lib3mf_binarystream_getbinarypath"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_GetBinaryPath == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_GetIndexPath = (PLib3MFBinaryStream_GetIndexPathPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_getindexpath"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_GetIndexPath = (PLib3MFBinaryStream_GetIndexPathPtr) dlsym(hLibrary, "lib3mf_binarystream_getindexpath"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_GetIndexPath == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_GetUUID = (PLib3MFBinaryStream_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_getuuid"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_GetUUID = (PLib3MFBinaryStream_GetUUIDPtr) dlsym(hLibrary, "lib3mf_binarystream_getuuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_GetUUID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_DisableDiscretizedArrayCompression = (PLib3MFBinaryStream_DisableDiscretizedArrayCompressionPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_disablediscretizedarraycompression"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_DisableDiscretizedArrayCompression = (PLib3MFBinaryStream_DisableDiscretizedArrayCompressionPtr) dlsym(hLibrary, "lib3mf_binarystream_disablediscretizedarraycompression"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_DisableDiscretizedArrayCompression == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_EnableDiscretizedArrayCompression = (PLib3MFBinaryStream_EnableDiscretizedArrayCompressionPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_enablediscretizedarraycompression"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_EnableDiscretizedArrayCompression = (PLib3MFBinaryStream_EnableDiscretizedArrayCompressionPtr) dlsym(hLibrary, "lib3mf_binarystream_enablediscretizedarraycompression"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_EnableDiscretizedArrayCompression == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_EnableLZMA = (PLib3MFBinaryStream_EnableLZMAPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_enablelzma"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_EnableLZMA = (PLib3MFBinaryStream_EnableLZMAPtr) dlsym(hLibrary, "lib3mf_binarystream_enablelzma"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_EnableLZMA == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_DisableLZMA = (PLib3MFBinaryStream_DisableLZMAPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_disablelzma"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_DisableLZMA = (PLib3MFBinaryStream_DisableLZMAPtr) dlsym(hLibrary, "lib3mf_binarystream_disablelzma"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_DisableLZMA == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Writer_WriteToFile = (PLib3MFWriter_WriteToFilePtr) GetProcAddress(hLibrary, "lib3mf_writer_writetofile"); #else // _WIN32 @@ -587,6 +786,69 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Writer_SetContentEncryptionCallback == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Writer_CreateBinaryStream = (PLib3MFWriter_CreateBinaryStreamPtr) GetProcAddress(hLibrary, "lib3mf_writer_createbinarystream"); + #else // _WIN32 + pWrapperTable->m_Writer_CreateBinaryStream = (PLib3MFWriter_CreateBinaryStreamPtr) dlsym(hLibrary, "lib3mf_writer_createbinarystream"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Writer_CreateBinaryStream == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Writer_AssignBinaryStream = (PLib3MFWriter_AssignBinaryStreamPtr) GetProcAddress(hLibrary, "lib3mf_writer_assignbinarystream"); + #else // _WIN32 + pWrapperTable->m_Writer_AssignBinaryStream = (PLib3MFWriter_AssignBinaryStreamPtr) dlsym(hLibrary, "lib3mf_writer_assignbinarystream"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Writer_AssignBinaryStream == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Writer_RegisterCustomNamespace = (PLib3MFWriter_RegisterCustomNamespacePtr) GetProcAddress(hLibrary, "lib3mf_writer_registercustomnamespace"); + #else // _WIN32 + pWrapperTable->m_Writer_RegisterCustomNamespace = (PLib3MFWriter_RegisterCustomNamespacePtr) dlsym(hLibrary, "lib3mf_writer_registercustomnamespace"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Writer_RegisterCustomNamespace == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_PersistentReaderSource_GetSourceType = (PLib3MFPersistentReaderSource_GetSourceTypePtr) GetProcAddress(hLibrary, "lib3mf_persistentreadersource_getsourcetype"); + #else // _WIN32 + pWrapperTable->m_PersistentReaderSource_GetSourceType = (PLib3MFPersistentReaderSource_GetSourceTypePtr) dlsym(hLibrary, "lib3mf_persistentreadersource_getsourcetype"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_PersistentReaderSource_GetSourceType == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_PersistentReaderSource_InvalidateSourceData = (PLib3MFPersistentReaderSource_InvalidateSourceDataPtr) GetProcAddress(hLibrary, "lib3mf_persistentreadersource_invalidatesourcedata"); + #else // _WIN32 + pWrapperTable->m_PersistentReaderSource_InvalidateSourceData = (PLib3MFPersistentReaderSource_InvalidateSourceDataPtr) dlsym(hLibrary, "lib3mf_persistentreadersource_invalidatesourcedata"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_PersistentReaderSource_InvalidateSourceData == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_PersistentReaderSource_SourceDataIsValid = (PLib3MFPersistentReaderSource_SourceDataIsValidPtr) GetProcAddress(hLibrary, "lib3mf_persistentreadersource_sourcedataisvalid"); + #else // _WIN32 + pWrapperTable->m_PersistentReaderSource_SourceDataIsValid = (PLib3MFPersistentReaderSource_SourceDataIsValidPtr) dlsym(hLibrary, "lib3mf_persistentreadersource_sourcedataisvalid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_PersistentReaderSource_SourceDataIsValid == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Reader_ReadFromPersistentSource = (PLib3MFReader_ReadFromPersistentSourcePtr) GetProcAddress(hLibrary, "lib3mf_reader_readfrompersistentsource"); + #else // _WIN32 + pWrapperTable->m_Reader_ReadFromPersistentSource = (PLib3MFReader_ReadFromPersistentSourcePtr) dlsym(hLibrary, "lib3mf_reader_readfrompersistentsource"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Reader_ReadFromPersistentSource == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Reader_ReadFromFile = (PLib3MFReader_ReadFromFilePtr) GetProcAddress(hLibrary, "lib3mf_reader_readfromfile"); #else // _WIN32 @@ -804,1731 +1066,2784 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack = (PLib3MFSliceStackIterator_GetCurrentSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_slicestackiterator_getcurrentslicestack"); + pWrapperTable->m_CustomXMLAttribute_GetName = (PLib3MFCustomXMLAttribute_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_getname"); #else // _WIN32 - pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack = (PLib3MFSliceStackIterator_GetCurrentSliceStackPtr) dlsym(hLibrary, "lib3mf_slicestackiterator_getcurrentslicestack"); + pWrapperTable->m_CustomXMLAttribute_GetName = (PLib3MFCustomXMLAttribute_GetNamePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_getname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack == NULL) + if (pWrapperTable->m_CustomXMLAttribute_GetName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ObjectIterator_GetCurrentObject = (PLib3MFObjectIterator_GetCurrentObjectPtr) GetProcAddress(hLibrary, "lib3mf_objectiterator_getcurrentobject"); + pWrapperTable->m_CustomXMLAttribute_GetValue = (PLib3MFCustomXMLAttribute_GetValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_getvalue"); #else // _WIN32 - pWrapperTable->m_ObjectIterator_GetCurrentObject = (PLib3MFObjectIterator_GetCurrentObjectPtr) dlsym(hLibrary, "lib3mf_objectiterator_getcurrentobject"); + pWrapperTable->m_CustomXMLAttribute_GetValue = (PLib3MFCustomXMLAttribute_GetValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_getvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ObjectIterator_GetCurrentObject == NULL) + if (pWrapperTable->m_CustomXMLAttribute_GetValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject = (PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) GetProcAddress(hLibrary, "lib3mf_meshobjectiterator_getcurrentmeshobject"); + pWrapperTable->m_CustomXMLAttribute_IsValidInteger = (PLib3MFCustomXMLAttribute_IsValidIntegerPtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_isvalidinteger"); #else // _WIN32 - pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject = (PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) dlsym(hLibrary, "lib3mf_meshobjectiterator_getcurrentmeshobject"); + pWrapperTable->m_CustomXMLAttribute_IsValidInteger = (PLib3MFCustomXMLAttribute_IsValidIntegerPtr) dlsym(hLibrary, "lib3mf_customxmlattribute_isvalidinteger"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject == NULL) + if (pWrapperTable->m_CustomXMLAttribute_IsValidInteger == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject = (PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) GetProcAddress(hLibrary, "lib3mf_componentsobjectiterator_getcurrentcomponentsobject"); + pWrapperTable->m_CustomXMLAttribute_GetIntegerValue = (PLib3MFCustomXMLAttribute_GetIntegerValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_getintegervalue"); #else // _WIN32 - pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject = (PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) dlsym(hLibrary, "lib3mf_componentsobjectiterator_getcurrentcomponentsobject"); + pWrapperTable->m_CustomXMLAttribute_GetIntegerValue = (PLib3MFCustomXMLAttribute_GetIntegerValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_getintegervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject == NULL) + if (pWrapperTable->m_CustomXMLAttribute_GetIntegerValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D = (PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) GetProcAddress(hLibrary, "lib3mf_texture2diterator_getcurrenttexture2d"); + pWrapperTable->m_CustomXMLAttribute_IsValidDouble = (PLib3MFCustomXMLAttribute_IsValidDoublePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_isvaliddouble"); #else // _WIN32 - pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D = (PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) dlsym(hLibrary, "lib3mf_texture2diterator_getcurrenttexture2d"); + pWrapperTable->m_CustomXMLAttribute_IsValidDouble = (PLib3MFCustomXMLAttribute_IsValidDoublePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_isvaliddouble"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D == NULL) + if (pWrapperTable->m_CustomXMLAttribute_IsValidDouble == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup = (PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup"); + pWrapperTable->m_CustomXMLAttribute_GetDoubleValue = (PLib3MFCustomXMLAttribute_GetDoubleValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_getdoublevalue"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup = (PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr) dlsym(hLibrary, "lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup"); + pWrapperTable->m_CustomXMLAttribute_GetDoubleValue = (PLib3MFCustomXMLAttribute_GetDoubleValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_getdoublevalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup == NULL) + if (pWrapperTable->m_CustomXMLAttribute_GetDoubleValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup = (PLib3MFColorGroupIterator_GetCurrentColorGroupPtr) GetProcAddress(hLibrary, "lib3mf_colorgroupiterator_getcurrentcolorgroup"); + pWrapperTable->m_CustomXMLAttribute_IsValidBool = (PLib3MFCustomXMLAttribute_IsValidBoolPtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_isvalidbool"); #else // _WIN32 - pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup = (PLib3MFColorGroupIterator_GetCurrentColorGroupPtr) dlsym(hLibrary, "lib3mf_colorgroupiterator_getcurrentcolorgroup"); + pWrapperTable->m_CustomXMLAttribute_IsValidBool = (PLib3MFCustomXMLAttribute_IsValidBoolPtr) dlsym(hLibrary, "lib3mf_customxmlattribute_isvalidbool"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup == NULL) + if (pWrapperTable->m_CustomXMLAttribute_IsValidBool == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup = (PLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup"); + pWrapperTable->m_CustomXMLAttribute_GetBoolValue = (PLib3MFCustomXMLAttribute_GetBoolValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_getboolvalue"); #else // _WIN32 - pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup = (PLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupPtr) dlsym(hLibrary, "lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup"); + pWrapperTable->m_CustomXMLAttribute_GetBoolValue = (PLib3MFCustomXMLAttribute_GetBoolValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_getboolvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup == NULL) + if (pWrapperTable->m_CustomXMLAttribute_GetBoolValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials = (PLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsPtr) GetProcAddress(hLibrary, "lib3mf_compositematerialsiterator_getcurrentcompositematerials"); + pWrapperTable->m_CustomXMLAttribute_SetValue = (PLib3MFCustomXMLAttribute_SetValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_setvalue"); #else // _WIN32 - pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials = (PLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsPtr) dlsym(hLibrary, "lib3mf_compositematerialsiterator_getcurrentcompositematerials"); + pWrapperTable->m_CustomXMLAttribute_SetValue = (PLib3MFCustomXMLAttribute_SetValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_setvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials == NULL) + if (pWrapperTable->m_CustomXMLAttribute_SetValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup = (PLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup"); + pWrapperTable->m_CustomXMLAttribute_SetIntegerValue = (PLib3MFCustomXMLAttribute_SetIntegerValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_setintegervalue"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup = (PLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupPtr) dlsym(hLibrary, "lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup"); + pWrapperTable->m_CustomXMLAttribute_SetIntegerValue = (PLib3MFCustomXMLAttribute_SetIntegerValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_setintegervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup == NULL) + if (pWrapperTable->m_CustomXMLAttribute_SetIntegerValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_GetNameSpace = (PLib3MFMetaData_GetNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getnamespace"); + pWrapperTable->m_CustomXMLAttribute_SetDoubleValue = (PLib3MFCustomXMLAttribute_SetDoubleValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_setdoublevalue"); #else // _WIN32 - pWrapperTable->m_MetaData_GetNameSpace = (PLib3MFMetaData_GetNameSpacePtr) dlsym(hLibrary, "lib3mf_metadata_getnamespace"); + pWrapperTable->m_CustomXMLAttribute_SetDoubleValue = (PLib3MFCustomXMLAttribute_SetDoubleValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_setdoublevalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_GetNameSpace == NULL) + if (pWrapperTable->m_CustomXMLAttribute_SetDoubleValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_SetNameSpace = (PLib3MFMetaData_SetNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setnamespace"); + pWrapperTable->m_CustomXMLAttribute_SetBoolValue = (PLib3MFCustomXMLAttribute_SetBoolValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_setboolvalue"); #else // _WIN32 - pWrapperTable->m_MetaData_SetNameSpace = (PLib3MFMetaData_SetNameSpacePtr) dlsym(hLibrary, "lib3mf_metadata_setnamespace"); + pWrapperTable->m_CustomXMLAttribute_SetBoolValue = (PLib3MFCustomXMLAttribute_SetBoolValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_setboolvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_SetNameSpace == NULL) + if (pWrapperTable->m_CustomXMLAttribute_SetBoolValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_GetName = (PLib3MFMetaData_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getname"); + pWrapperTable->m_CustomXMLAttribute_Remove = (PLib3MFCustomXMLAttribute_RemovePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_remove"); #else // _WIN32 - pWrapperTable->m_MetaData_GetName = (PLib3MFMetaData_GetNamePtr) dlsym(hLibrary, "lib3mf_metadata_getname"); + pWrapperTable->m_CustomXMLAttribute_Remove = (PLib3MFCustomXMLAttribute_RemovePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_remove"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_GetName == NULL) + if (pWrapperTable->m_CustomXMLAttribute_Remove == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_SetName = (PLib3MFMetaData_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setname"); + pWrapperTable->m_CustomXMLNode_GetName = (PLib3MFCustomXMLNode_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_getname"); #else // _WIN32 - pWrapperTable->m_MetaData_SetName = (PLib3MFMetaData_SetNamePtr) dlsym(hLibrary, "lib3mf_metadata_setname"); + pWrapperTable->m_CustomXMLNode_GetName = (PLib3MFCustomXMLNode_GetNamePtr) dlsym(hLibrary, "lib3mf_customxmlnode_getname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_SetName == NULL) + if (pWrapperTable->m_CustomXMLNode_GetName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_GetKey = (PLib3MFMetaData_GetKeyPtr) GetProcAddress(hLibrary, "lib3mf_metadata_getkey"); + pWrapperTable->m_CustomXMLNode_GetNameSpace = (PLib3MFCustomXMLNode_GetNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_getnamespace"); #else // _WIN32 - pWrapperTable->m_MetaData_GetKey = (PLib3MFMetaData_GetKeyPtr) dlsym(hLibrary, "lib3mf_metadata_getkey"); + pWrapperTable->m_CustomXMLNode_GetNameSpace = (PLib3MFCustomXMLNode_GetNameSpacePtr) dlsym(hLibrary, "lib3mf_customxmlnode_getnamespace"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_GetKey == NULL) + if (pWrapperTable->m_CustomXMLNode_GetNameSpace == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_GetMustPreserve = (PLib3MFMetaData_GetMustPreservePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getmustpreserve"); + pWrapperTable->m_CustomXMLNode_GetAttributeCount = (PLib3MFCustomXMLNode_GetAttributeCountPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_getattributecount"); #else // _WIN32 - pWrapperTable->m_MetaData_GetMustPreserve = (PLib3MFMetaData_GetMustPreservePtr) dlsym(hLibrary, "lib3mf_metadata_getmustpreserve"); + pWrapperTable->m_CustomXMLNode_GetAttributeCount = (PLib3MFCustomXMLNode_GetAttributeCountPtr) dlsym(hLibrary, "lib3mf_customxmlnode_getattributecount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_GetMustPreserve == NULL) + if (pWrapperTable->m_CustomXMLNode_GetAttributeCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_SetMustPreserve = (PLib3MFMetaData_SetMustPreservePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setmustpreserve"); + pWrapperTable->m_CustomXMLNode_GetAttribute = (PLib3MFCustomXMLNode_GetAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_getattribute"); #else // _WIN32 - pWrapperTable->m_MetaData_SetMustPreserve = (PLib3MFMetaData_SetMustPreservePtr) dlsym(hLibrary, "lib3mf_metadata_setmustpreserve"); + pWrapperTable->m_CustomXMLNode_GetAttribute = (PLib3MFCustomXMLNode_GetAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_getattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_SetMustPreserve == NULL) + if (pWrapperTable->m_CustomXMLNode_GetAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_GetType = (PLib3MFMetaData_GetTypePtr) GetProcAddress(hLibrary, "lib3mf_metadata_gettype"); + pWrapperTable->m_CustomXMLNode_HasAttribute = (PLib3MFCustomXMLNode_HasAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_hasattribute"); #else // _WIN32 - pWrapperTable->m_MetaData_GetType = (PLib3MFMetaData_GetTypePtr) dlsym(hLibrary, "lib3mf_metadata_gettype"); + pWrapperTable->m_CustomXMLNode_HasAttribute = (PLib3MFCustomXMLNode_HasAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_hasattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_GetType == NULL) + if (pWrapperTable->m_CustomXMLNode_HasAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_SetType = (PLib3MFMetaData_SetTypePtr) GetProcAddress(hLibrary, "lib3mf_metadata_settype"); + pWrapperTable->m_CustomXMLNode_FindAttribute = (PLib3MFCustomXMLNode_FindAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_findattribute"); #else // _WIN32 - pWrapperTable->m_MetaData_SetType = (PLib3MFMetaData_SetTypePtr) dlsym(hLibrary, "lib3mf_metadata_settype"); + pWrapperTable->m_CustomXMLNode_FindAttribute = (PLib3MFCustomXMLNode_FindAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_findattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_SetType == NULL) + if (pWrapperTable->m_CustomXMLNode_FindAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_GetValue = (PLib3MFMetaData_GetValuePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getvalue"); + pWrapperTable->m_CustomXMLNode_RemoveAttribute = (PLib3MFCustomXMLNode_RemoveAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_removeattribute"); #else // _WIN32 - pWrapperTable->m_MetaData_GetValue = (PLib3MFMetaData_GetValuePtr) dlsym(hLibrary, "lib3mf_metadata_getvalue"); + pWrapperTable->m_CustomXMLNode_RemoveAttribute = (PLib3MFCustomXMLNode_RemoveAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_removeattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_GetValue == NULL) + if (pWrapperTable->m_CustomXMLNode_RemoveAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_SetValue = (PLib3MFMetaData_SetValuePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setvalue"); + pWrapperTable->m_CustomXMLNode_RemoveAttributeByIndex = (PLib3MFCustomXMLNode_RemoveAttributeByIndexPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_removeattributebyindex"); #else // _WIN32 - pWrapperTable->m_MetaData_SetValue = (PLib3MFMetaData_SetValuePtr) dlsym(hLibrary, "lib3mf_metadata_setvalue"); + pWrapperTable->m_CustomXMLNode_RemoveAttributeByIndex = (PLib3MFCustomXMLNode_RemoveAttributeByIndexPtr) dlsym(hLibrary, "lib3mf_customxmlnode_removeattributebyindex"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_SetValue == NULL) + if (pWrapperTable->m_CustomXMLNode_RemoveAttributeByIndex == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaDataGroup_GetMetaDataCount = (PLib3MFMetaDataGroup_GetMetaDataCountPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_getmetadatacount"); + pWrapperTable->m_CustomXMLNode_AddAttribute = (PLib3MFCustomXMLNode_AddAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_addattribute"); #else // _WIN32 - pWrapperTable->m_MetaDataGroup_GetMetaDataCount = (PLib3MFMetaDataGroup_GetMetaDataCountPtr) dlsym(hLibrary, "lib3mf_metadatagroup_getmetadatacount"); + pWrapperTable->m_CustomXMLNode_AddAttribute = (PLib3MFCustomXMLNode_AddAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_addattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaDataGroup_GetMetaDataCount == NULL) + if (pWrapperTable->m_CustomXMLNode_AddAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaDataGroup_GetMetaData = (PLib3MFMetaDataGroup_GetMetaDataPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_getmetadata"); + pWrapperTable->m_CustomXMLNode_AddIntegerAttribute = (PLib3MFCustomXMLNode_AddIntegerAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_addintegerattribute"); #else // _WIN32 - pWrapperTable->m_MetaDataGroup_GetMetaData = (PLib3MFMetaDataGroup_GetMetaDataPtr) dlsym(hLibrary, "lib3mf_metadatagroup_getmetadata"); + pWrapperTable->m_CustomXMLNode_AddIntegerAttribute = (PLib3MFCustomXMLNode_AddIntegerAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_addintegerattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaDataGroup_GetMetaData == NULL) + if (pWrapperTable->m_CustomXMLNode_AddIntegerAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaDataGroup_GetMetaDataByKey = (PLib3MFMetaDataGroup_GetMetaDataByKeyPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_getmetadatabykey"); + pWrapperTable->m_CustomXMLNode_AddDoubleAttribute = (PLib3MFCustomXMLNode_AddDoubleAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_adddoubleattribute"); #else // _WIN32 - pWrapperTable->m_MetaDataGroup_GetMetaDataByKey = (PLib3MFMetaDataGroup_GetMetaDataByKeyPtr) dlsym(hLibrary, "lib3mf_metadatagroup_getmetadatabykey"); + pWrapperTable->m_CustomXMLNode_AddDoubleAttribute = (PLib3MFCustomXMLNode_AddDoubleAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_adddoubleattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaDataGroup_GetMetaDataByKey == NULL) + if (pWrapperTable->m_CustomXMLNode_AddDoubleAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex = (PLib3MFMetaDataGroup_RemoveMetaDataByIndexPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_removemetadatabyindex"); + pWrapperTable->m_CustomXMLNode_AddBoolAttribute = (PLib3MFCustomXMLNode_AddBoolAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_addboolattribute"); #else // _WIN32 - pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex = (PLib3MFMetaDataGroup_RemoveMetaDataByIndexPtr) dlsym(hLibrary, "lib3mf_metadatagroup_removemetadatabyindex"); + pWrapperTable->m_CustomXMLNode_AddBoolAttribute = (PLib3MFCustomXMLNode_AddBoolAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_addboolattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex == NULL) + if (pWrapperTable->m_CustomXMLNode_AddBoolAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaDataGroup_RemoveMetaData = (PLib3MFMetaDataGroup_RemoveMetaDataPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_removemetadata"); + pWrapperTable->m_CustomXMLNode_GetChildren = (PLib3MFCustomXMLNode_GetChildrenPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_getchildren"); #else // _WIN32 - pWrapperTable->m_MetaDataGroup_RemoveMetaData = (PLib3MFMetaDataGroup_RemoveMetaDataPtr) dlsym(hLibrary, "lib3mf_metadatagroup_removemetadata"); + pWrapperTable->m_CustomXMLNode_GetChildren = (PLib3MFCustomXMLNode_GetChildrenPtr) dlsym(hLibrary, "lib3mf_customxmlnode_getchildren"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaDataGroup_RemoveMetaData == NULL) + if (pWrapperTable->m_CustomXMLNode_GetChildren == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaDataGroup_AddMetaData = (PLib3MFMetaDataGroup_AddMetaDataPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_addmetadata"); + pWrapperTable->m_CustomXMLNode_CountChildrenByName = (PLib3MFCustomXMLNode_CountChildrenByNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_countchildrenbyname"); #else // _WIN32 - pWrapperTable->m_MetaDataGroup_AddMetaData = (PLib3MFMetaDataGroup_AddMetaDataPtr) dlsym(hLibrary, "lib3mf_metadatagroup_addmetadata"); + pWrapperTable->m_CustomXMLNode_CountChildrenByName = (PLib3MFCustomXMLNode_CountChildrenByNamePtr) dlsym(hLibrary, "lib3mf_customxmlnode_countchildrenbyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaDataGroup_AddMetaData == NULL) + if (pWrapperTable->m_CustomXMLNode_CountChildrenByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetType = (PLib3MFObject_GetTypePtr) GetProcAddress(hLibrary, "lib3mf_object_gettype"); + pWrapperTable->m_CustomXMLNode_GetChildrenByName = (PLib3MFCustomXMLNode_GetChildrenByNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_getchildrenbyname"); #else // _WIN32 - pWrapperTable->m_Object_GetType = (PLib3MFObject_GetTypePtr) dlsym(hLibrary, "lib3mf_object_gettype"); + pWrapperTable->m_CustomXMLNode_GetChildrenByName = (PLib3MFCustomXMLNode_GetChildrenByNamePtr) dlsym(hLibrary, "lib3mf_customxmlnode_getchildrenbyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetType == NULL) + if (pWrapperTable->m_CustomXMLNode_GetChildrenByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_SetType = (PLib3MFObject_SetTypePtr) GetProcAddress(hLibrary, "lib3mf_object_settype"); + pWrapperTable->m_CustomXMLNode_HasChild = (PLib3MFCustomXMLNode_HasChildPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_haschild"); #else // _WIN32 - pWrapperTable->m_Object_SetType = (PLib3MFObject_SetTypePtr) dlsym(hLibrary, "lib3mf_object_settype"); + pWrapperTable->m_CustomXMLNode_HasChild = (PLib3MFCustomXMLNode_HasChildPtr) dlsym(hLibrary, "lib3mf_customxmlnode_haschild"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_SetType == NULL) + if (pWrapperTable->m_CustomXMLNode_HasChild == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetName = (PLib3MFObject_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_object_getname"); + pWrapperTable->m_CustomXMLNode_HasUniqueChild = (PLib3MFCustomXMLNode_HasUniqueChildPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_hasuniquechild"); #else // _WIN32 - pWrapperTable->m_Object_GetName = (PLib3MFObject_GetNamePtr) dlsym(hLibrary, "lib3mf_object_getname"); + pWrapperTable->m_CustomXMLNode_HasUniqueChild = (PLib3MFCustomXMLNode_HasUniqueChildPtr) dlsym(hLibrary, "lib3mf_customxmlnode_hasuniquechild"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetName == NULL) + if (pWrapperTable->m_CustomXMLNode_HasUniqueChild == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_SetName = (PLib3MFObject_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_object_setname"); + pWrapperTable->m_CustomXMLNode_FindChild = (PLib3MFCustomXMLNode_FindChildPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_findchild"); #else // _WIN32 - pWrapperTable->m_Object_SetName = (PLib3MFObject_SetNamePtr) dlsym(hLibrary, "lib3mf_object_setname"); + pWrapperTable->m_CustomXMLNode_FindChild = (PLib3MFCustomXMLNode_FindChildPtr) dlsym(hLibrary, "lib3mf_customxmlnode_findchild"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_SetName == NULL) + if (pWrapperTable->m_CustomXMLNode_FindChild == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetPartNumber = (PLib3MFObject_GetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_object_getpartnumber"); + pWrapperTable->m_CustomXMLNode_AddChild = (PLib3MFCustomXMLNode_AddChildPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_addchild"); #else // _WIN32 - pWrapperTable->m_Object_GetPartNumber = (PLib3MFObject_GetPartNumberPtr) dlsym(hLibrary, "lib3mf_object_getpartnumber"); + pWrapperTable->m_CustomXMLNode_AddChild = (PLib3MFCustomXMLNode_AddChildPtr) dlsym(hLibrary, "lib3mf_customxmlnode_addchild"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetPartNumber == NULL) + if (pWrapperTable->m_CustomXMLNode_AddChild == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_SetPartNumber = (PLib3MFObject_SetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_object_setpartnumber"); + pWrapperTable->m_CustomXMLNode_RemoveChild = (PLib3MFCustomXMLNode_RemoveChildPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_removechild"); #else // _WIN32 - pWrapperTable->m_Object_SetPartNumber = (PLib3MFObject_SetPartNumberPtr) dlsym(hLibrary, "lib3mf_object_setpartnumber"); + pWrapperTable->m_CustomXMLNode_RemoveChild = (PLib3MFCustomXMLNode_RemoveChildPtr) dlsym(hLibrary, "lib3mf_customxmlnode_removechild"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_SetPartNumber == NULL) + if (pWrapperTable->m_CustomXMLNode_RemoveChild == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_IsMeshObject = (PLib3MFObject_IsMeshObjectPtr) GetProcAddress(hLibrary, "lib3mf_object_ismeshobject"); + pWrapperTable->m_CustomXMLNode_RemoveChildrenWithName = (PLib3MFCustomXMLNode_RemoveChildrenWithNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_removechildrenwithname"); #else // _WIN32 - pWrapperTable->m_Object_IsMeshObject = (PLib3MFObject_IsMeshObjectPtr) dlsym(hLibrary, "lib3mf_object_ismeshobject"); + pWrapperTable->m_CustomXMLNode_RemoveChildrenWithName = (PLib3MFCustomXMLNode_RemoveChildrenWithNamePtr) dlsym(hLibrary, "lib3mf_customxmlnode_removechildrenwithname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_IsMeshObject == NULL) + if (pWrapperTable->m_CustomXMLNode_RemoveChildrenWithName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_IsComponentsObject = (PLib3MFObject_IsComponentsObjectPtr) GetProcAddress(hLibrary, "lib3mf_object_iscomponentsobject"); + pWrapperTable->m_CustomXMLNode_Remove = (PLib3MFCustomXMLNode_RemovePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_remove"); #else // _WIN32 - pWrapperTable->m_Object_IsComponentsObject = (PLib3MFObject_IsComponentsObjectPtr) dlsym(hLibrary, "lib3mf_object_iscomponentsobject"); + pWrapperTable->m_CustomXMLNode_Remove = (PLib3MFCustomXMLNode_RemovePtr) dlsym(hLibrary, "lib3mf_customxmlnode_remove"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_IsComponentsObject == NULL) + if (pWrapperTable->m_CustomXMLNode_Remove == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_IsValid = (PLib3MFObject_IsValidPtr) GetProcAddress(hLibrary, "lib3mf_object_isvalid"); + pWrapperTable->m_CustomXMLNodes_GetNodeCount = (PLib3MFCustomXMLNodes_GetNodeCountPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_getnodecount"); #else // _WIN32 - pWrapperTable->m_Object_IsValid = (PLib3MFObject_IsValidPtr) dlsym(hLibrary, "lib3mf_object_isvalid"); + pWrapperTable->m_CustomXMLNodes_GetNodeCount = (PLib3MFCustomXMLNodes_GetNodeCountPtr) dlsym(hLibrary, "lib3mf_customxmlnodes_getnodecount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_IsValid == NULL) + if (pWrapperTable->m_CustomXMLNodes_GetNodeCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_SetAttachmentAsThumbnail = (PLib3MFObject_SetAttachmentAsThumbnailPtr) GetProcAddress(hLibrary, "lib3mf_object_setattachmentasthumbnail"); + pWrapperTable->m_CustomXMLNodes_GetNode = (PLib3MFCustomXMLNodes_GetNodePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_getnode"); #else // _WIN32 - pWrapperTable->m_Object_SetAttachmentAsThumbnail = (PLib3MFObject_SetAttachmentAsThumbnailPtr) dlsym(hLibrary, "lib3mf_object_setattachmentasthumbnail"); + pWrapperTable->m_CustomXMLNodes_GetNode = (PLib3MFCustomXMLNodes_GetNodePtr) dlsym(hLibrary, "lib3mf_customxmlnodes_getnode"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_SetAttachmentAsThumbnail == NULL) + if (pWrapperTable->m_CustomXMLNodes_GetNode == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetThumbnailAttachment = (PLib3MFObject_GetThumbnailAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_object_getthumbnailattachment"); + pWrapperTable->m_CustomXMLNodes_CountNodesByName = (PLib3MFCustomXMLNodes_CountNodesByNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_countnodesbyname"); #else // _WIN32 - pWrapperTable->m_Object_GetThumbnailAttachment = (PLib3MFObject_GetThumbnailAttachmentPtr) dlsym(hLibrary, "lib3mf_object_getthumbnailattachment"); + pWrapperTable->m_CustomXMLNodes_CountNodesByName = (PLib3MFCustomXMLNodes_CountNodesByNamePtr) dlsym(hLibrary, "lib3mf_customxmlnodes_countnodesbyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetThumbnailAttachment == NULL) + if (pWrapperTable->m_CustomXMLNodes_CountNodesByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_ClearThumbnailAttachment = (PLib3MFObject_ClearThumbnailAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_object_clearthumbnailattachment"); + pWrapperTable->m_CustomXMLNodes_GetNodesByName = (PLib3MFCustomXMLNodes_GetNodesByNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_getnodesbyname"); #else // _WIN32 - pWrapperTable->m_Object_ClearThumbnailAttachment = (PLib3MFObject_ClearThumbnailAttachmentPtr) dlsym(hLibrary, "lib3mf_object_clearthumbnailattachment"); + pWrapperTable->m_CustomXMLNodes_GetNodesByName = (PLib3MFCustomXMLNodes_GetNodesByNamePtr) dlsym(hLibrary, "lib3mf_customxmlnodes_getnodesbyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_ClearThumbnailAttachment == NULL) + if (pWrapperTable->m_CustomXMLNodes_GetNodesByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetOutbox = (PLib3MFObject_GetOutboxPtr) GetProcAddress(hLibrary, "lib3mf_object_getoutbox"); + pWrapperTable->m_CustomXMLNodes_HasNode = (PLib3MFCustomXMLNodes_HasNodePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_hasnode"); #else // _WIN32 - pWrapperTable->m_Object_GetOutbox = (PLib3MFObject_GetOutboxPtr) dlsym(hLibrary, "lib3mf_object_getoutbox"); + pWrapperTable->m_CustomXMLNodes_HasNode = (PLib3MFCustomXMLNodes_HasNodePtr) dlsym(hLibrary, "lib3mf_customxmlnodes_hasnode"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetOutbox == NULL) + if (pWrapperTable->m_CustomXMLNodes_HasNode == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetUUID = (PLib3MFObject_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_object_getuuid"); + pWrapperTable->m_CustomXMLNodes_HasUniqueNode = (PLib3MFCustomXMLNodes_HasUniqueNodePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_hasuniquenode"); #else // _WIN32 - pWrapperTable->m_Object_GetUUID = (PLib3MFObject_GetUUIDPtr) dlsym(hLibrary, "lib3mf_object_getuuid"); + pWrapperTable->m_CustomXMLNodes_HasUniqueNode = (PLib3MFCustomXMLNodes_HasUniqueNodePtr) dlsym(hLibrary, "lib3mf_customxmlnodes_hasuniquenode"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetUUID == NULL) + if (pWrapperTable->m_CustomXMLNodes_HasUniqueNode == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_SetUUID = (PLib3MFObject_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_object_setuuid"); + pWrapperTable->m_CustomXMLNodes_FindNode = (PLib3MFCustomXMLNodes_FindNodePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_findnode"); #else // _WIN32 - pWrapperTable->m_Object_SetUUID = (PLib3MFObject_SetUUIDPtr) dlsym(hLibrary, "lib3mf_object_setuuid"); + pWrapperTable->m_CustomXMLNodes_FindNode = (PLib3MFCustomXMLNodes_FindNodePtr) dlsym(hLibrary, "lib3mf_customxmlnodes_findnode"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_SetUUID == NULL) + if (pWrapperTable->m_CustomXMLNodes_FindNode == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetMetaDataGroup = (PLib3MFObject_GetMetaDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_object_getmetadatagroup"); + pWrapperTable->m_CustomDOMTree_GetNameSpace = (PLib3MFCustomDOMTree_GetNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_customdomtree_getnamespace"); #else // _WIN32 - pWrapperTable->m_Object_GetMetaDataGroup = (PLib3MFObject_GetMetaDataGroupPtr) dlsym(hLibrary, "lib3mf_object_getmetadatagroup"); + pWrapperTable->m_CustomDOMTree_GetNameSpace = (PLib3MFCustomDOMTree_GetNameSpacePtr) dlsym(hLibrary, "lib3mf_customdomtree_getnamespace"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetMetaDataGroup == NULL) + if (pWrapperTable->m_CustomDOMTree_GetNameSpace == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_SetSlicesMeshResolution = (PLib3MFObject_SetSlicesMeshResolutionPtr) GetProcAddress(hLibrary, "lib3mf_object_setslicesmeshresolution"); + pWrapperTable->m_CustomDOMTree_GetRootNode = (PLib3MFCustomDOMTree_GetRootNodePtr) GetProcAddress(hLibrary, "lib3mf_customdomtree_getrootnode"); #else // _WIN32 - pWrapperTable->m_Object_SetSlicesMeshResolution = (PLib3MFObject_SetSlicesMeshResolutionPtr) dlsym(hLibrary, "lib3mf_object_setslicesmeshresolution"); + pWrapperTable->m_CustomDOMTree_GetRootNode = (PLib3MFCustomDOMTree_GetRootNodePtr) dlsym(hLibrary, "lib3mf_customdomtree_getrootnode"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_SetSlicesMeshResolution == NULL) + if (pWrapperTable->m_CustomDOMTree_GetRootNode == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetSlicesMeshResolution = (PLib3MFObject_GetSlicesMeshResolutionPtr) GetProcAddress(hLibrary, "lib3mf_object_getslicesmeshresolution"); + pWrapperTable->m_CustomDOMTree_SaveToString = (PLib3MFCustomDOMTree_SaveToStringPtr) GetProcAddress(hLibrary, "lib3mf_customdomtree_savetostring"); #else // _WIN32 - pWrapperTable->m_Object_GetSlicesMeshResolution = (PLib3MFObject_GetSlicesMeshResolutionPtr) dlsym(hLibrary, "lib3mf_object_getslicesmeshresolution"); + pWrapperTable->m_CustomDOMTree_SaveToString = (PLib3MFCustomDOMTree_SaveToStringPtr) dlsym(hLibrary, "lib3mf_customdomtree_savetostring"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetSlicesMeshResolution == NULL) + if (pWrapperTable->m_CustomDOMTree_SaveToString == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_HasSlices = (PLib3MFObject_HasSlicesPtr) GetProcAddress(hLibrary, "lib3mf_object_hasslices"); + pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack = (PLib3MFSliceStackIterator_GetCurrentSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_slicestackiterator_getcurrentslicestack"); #else // _WIN32 - pWrapperTable->m_Object_HasSlices = (PLib3MFObject_HasSlicesPtr) dlsym(hLibrary, "lib3mf_object_hasslices"); + pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack = (PLib3MFSliceStackIterator_GetCurrentSliceStackPtr) dlsym(hLibrary, "lib3mf_slicestackiterator_getcurrentslicestack"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_HasSlices == NULL) + if (pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_ClearSliceStack = (PLib3MFObject_ClearSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_object_clearslicestack"); + pWrapperTable->m_ObjectIterator_GetCurrentObject = (PLib3MFObjectIterator_GetCurrentObjectPtr) GetProcAddress(hLibrary, "lib3mf_objectiterator_getcurrentobject"); #else // _WIN32 - pWrapperTable->m_Object_ClearSliceStack = (PLib3MFObject_ClearSliceStackPtr) dlsym(hLibrary, "lib3mf_object_clearslicestack"); + pWrapperTable->m_ObjectIterator_GetCurrentObject = (PLib3MFObjectIterator_GetCurrentObjectPtr) dlsym(hLibrary, "lib3mf_objectiterator_getcurrentobject"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_ClearSliceStack == NULL) + if (pWrapperTable->m_ObjectIterator_GetCurrentObject == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetSliceStack = (PLib3MFObject_GetSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_object_getslicestack"); + pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject = (PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) GetProcAddress(hLibrary, "lib3mf_meshobjectiterator_getcurrentmeshobject"); #else // _WIN32 - pWrapperTable->m_Object_GetSliceStack = (PLib3MFObject_GetSliceStackPtr) dlsym(hLibrary, "lib3mf_object_getslicestack"); + pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject = (PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) dlsym(hLibrary, "lib3mf_meshobjectiterator_getcurrentmeshobject"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetSliceStack == NULL) + if (pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_AssignSliceStack = (PLib3MFObject_AssignSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_object_assignslicestack"); + pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject = (PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) GetProcAddress(hLibrary, "lib3mf_componentsobjectiterator_getcurrentcomponentsobject"); #else // _WIN32 - pWrapperTable->m_Object_AssignSliceStack = (PLib3MFObject_AssignSliceStackPtr) dlsym(hLibrary, "lib3mf_object_assignslicestack"); + pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject = (PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) dlsym(hLibrary, "lib3mf_componentsobjectiterator_getcurrentcomponentsobject"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_AssignSliceStack == NULL) + if (pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetVertexCount = (PLib3MFMeshObject_GetVertexCountPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getvertexcount"); + pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D = (PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) GetProcAddress(hLibrary, "lib3mf_texture2diterator_getcurrenttexture2d"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetVertexCount = (PLib3MFMeshObject_GetVertexCountPtr) dlsym(hLibrary, "lib3mf_meshobject_getvertexcount"); + pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D = (PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) dlsym(hLibrary, "lib3mf_texture2diterator_getcurrenttexture2d"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetVertexCount == NULL) + if (pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetTriangleCount = (PLib3MFMeshObject_GetTriangleCountPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettrianglecount"); + pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup = (PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetTriangleCount = (PLib3MFMeshObject_GetTriangleCountPtr) dlsym(hLibrary, "lib3mf_meshobject_gettrianglecount"); + pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup = (PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr) dlsym(hLibrary, "lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetTriangleCount == NULL) + if (pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetVertex = (PLib3MFMeshObject_GetVertexPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getvertex"); + pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup = (PLib3MFColorGroupIterator_GetCurrentColorGroupPtr) GetProcAddress(hLibrary, "lib3mf_colorgroupiterator_getcurrentcolorgroup"); + #else // _WIN32 + pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup = (PLib3MFColorGroupIterator_GetCurrentColorGroupPtr) dlsym(hLibrary, "lib3mf_colorgroupiterator_getcurrentcolorgroup"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup = (PLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup"); + #else // _WIN32 + pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup = (PLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupPtr) dlsym(hLibrary, "lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials = (PLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsPtr) GetProcAddress(hLibrary, "lib3mf_compositematerialsiterator_getcurrentcompositematerials"); + #else // _WIN32 + pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials = (PLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsPtr) dlsym(hLibrary, "lib3mf_compositematerialsiterator_getcurrentcompositematerials"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup = (PLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup = (PLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupPtr) dlsym(hLibrary, "lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_GetNameSpace = (PLib3MFMetaData_GetNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getnamespace"); + #else // _WIN32 + pWrapperTable->m_MetaData_GetNameSpace = (PLib3MFMetaData_GetNameSpacePtr) dlsym(hLibrary, "lib3mf_metadata_getnamespace"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_GetNameSpace == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_SetNameSpace = (PLib3MFMetaData_SetNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setnamespace"); + #else // _WIN32 + pWrapperTable->m_MetaData_SetNameSpace = (PLib3MFMetaData_SetNameSpacePtr) dlsym(hLibrary, "lib3mf_metadata_setnamespace"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_SetNameSpace == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_GetName = (PLib3MFMetaData_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getname"); + #else // _WIN32 + pWrapperTable->m_MetaData_GetName = (PLib3MFMetaData_GetNamePtr) dlsym(hLibrary, "lib3mf_metadata_getname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_GetName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_SetName = (PLib3MFMetaData_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setname"); + #else // _WIN32 + pWrapperTable->m_MetaData_SetName = (PLib3MFMetaData_SetNamePtr) dlsym(hLibrary, "lib3mf_metadata_setname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_SetName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_GetKey = (PLib3MFMetaData_GetKeyPtr) GetProcAddress(hLibrary, "lib3mf_metadata_getkey"); + #else // _WIN32 + pWrapperTable->m_MetaData_GetKey = (PLib3MFMetaData_GetKeyPtr) dlsym(hLibrary, "lib3mf_metadata_getkey"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_GetKey == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_GetMustPreserve = (PLib3MFMetaData_GetMustPreservePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getmustpreserve"); + #else // _WIN32 + pWrapperTable->m_MetaData_GetMustPreserve = (PLib3MFMetaData_GetMustPreservePtr) dlsym(hLibrary, "lib3mf_metadata_getmustpreserve"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_GetMustPreserve == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_SetMustPreserve = (PLib3MFMetaData_SetMustPreservePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setmustpreserve"); + #else // _WIN32 + pWrapperTable->m_MetaData_SetMustPreserve = (PLib3MFMetaData_SetMustPreservePtr) dlsym(hLibrary, "lib3mf_metadata_setmustpreserve"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_SetMustPreserve == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_GetType = (PLib3MFMetaData_GetTypePtr) GetProcAddress(hLibrary, "lib3mf_metadata_gettype"); + #else // _WIN32 + pWrapperTable->m_MetaData_GetType = (PLib3MFMetaData_GetTypePtr) dlsym(hLibrary, "lib3mf_metadata_gettype"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_GetType == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_SetType = (PLib3MFMetaData_SetTypePtr) GetProcAddress(hLibrary, "lib3mf_metadata_settype"); + #else // _WIN32 + pWrapperTable->m_MetaData_SetType = (PLib3MFMetaData_SetTypePtr) dlsym(hLibrary, "lib3mf_metadata_settype"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_SetType == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_GetValue = (PLib3MFMetaData_GetValuePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getvalue"); + #else // _WIN32 + pWrapperTable->m_MetaData_GetValue = (PLib3MFMetaData_GetValuePtr) dlsym(hLibrary, "lib3mf_metadata_getvalue"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_GetValue == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_SetValue = (PLib3MFMetaData_SetValuePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setvalue"); + #else // _WIN32 + pWrapperTable->m_MetaData_SetValue = (PLib3MFMetaData_SetValuePtr) dlsym(hLibrary, "lib3mf_metadata_setvalue"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_SetValue == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaDataGroup_GetMetaDataCount = (PLib3MFMetaDataGroup_GetMetaDataCountPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_getmetadatacount"); + #else // _WIN32 + pWrapperTable->m_MetaDataGroup_GetMetaDataCount = (PLib3MFMetaDataGroup_GetMetaDataCountPtr) dlsym(hLibrary, "lib3mf_metadatagroup_getmetadatacount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaDataGroup_GetMetaDataCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaDataGroup_GetMetaData = (PLib3MFMetaDataGroup_GetMetaDataPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_getmetadata"); + #else // _WIN32 + pWrapperTable->m_MetaDataGroup_GetMetaData = (PLib3MFMetaDataGroup_GetMetaDataPtr) dlsym(hLibrary, "lib3mf_metadatagroup_getmetadata"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaDataGroup_GetMetaData == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaDataGroup_GetMetaDataByKey = (PLib3MFMetaDataGroup_GetMetaDataByKeyPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_getmetadatabykey"); + #else // _WIN32 + pWrapperTable->m_MetaDataGroup_GetMetaDataByKey = (PLib3MFMetaDataGroup_GetMetaDataByKeyPtr) dlsym(hLibrary, "lib3mf_metadatagroup_getmetadatabykey"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaDataGroup_GetMetaDataByKey == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex = (PLib3MFMetaDataGroup_RemoveMetaDataByIndexPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_removemetadatabyindex"); + #else // _WIN32 + pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex = (PLib3MFMetaDataGroup_RemoveMetaDataByIndexPtr) dlsym(hLibrary, "lib3mf_metadatagroup_removemetadatabyindex"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaDataGroup_RemoveMetaData = (PLib3MFMetaDataGroup_RemoveMetaDataPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_removemetadata"); + #else // _WIN32 + pWrapperTable->m_MetaDataGroup_RemoveMetaData = (PLib3MFMetaDataGroup_RemoveMetaDataPtr) dlsym(hLibrary, "lib3mf_metadatagroup_removemetadata"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaDataGroup_RemoveMetaData == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaDataGroup_AddMetaData = (PLib3MFMetaDataGroup_AddMetaDataPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_addmetadata"); + #else // _WIN32 + pWrapperTable->m_MetaDataGroup_AddMetaData = (PLib3MFMetaDataGroup_AddMetaDataPtr) dlsym(hLibrary, "lib3mf_metadatagroup_addmetadata"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaDataGroup_AddMetaData == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetType = (PLib3MFObject_GetTypePtr) GetProcAddress(hLibrary, "lib3mf_object_gettype"); + #else // _WIN32 + pWrapperTable->m_Object_GetType = (PLib3MFObject_GetTypePtr) dlsym(hLibrary, "lib3mf_object_gettype"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetType == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_SetType = (PLib3MFObject_SetTypePtr) GetProcAddress(hLibrary, "lib3mf_object_settype"); + #else // _WIN32 + pWrapperTable->m_Object_SetType = (PLib3MFObject_SetTypePtr) dlsym(hLibrary, "lib3mf_object_settype"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_SetType == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetName = (PLib3MFObject_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_object_getname"); + #else // _WIN32 + pWrapperTable->m_Object_GetName = (PLib3MFObject_GetNamePtr) dlsym(hLibrary, "lib3mf_object_getname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_SetName = (PLib3MFObject_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_object_setname"); + #else // _WIN32 + pWrapperTable->m_Object_SetName = (PLib3MFObject_SetNamePtr) dlsym(hLibrary, "lib3mf_object_setname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_SetName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetPartNumber = (PLib3MFObject_GetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_object_getpartnumber"); + #else // _WIN32 + pWrapperTable->m_Object_GetPartNumber = (PLib3MFObject_GetPartNumberPtr) dlsym(hLibrary, "lib3mf_object_getpartnumber"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetPartNumber == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_SetPartNumber = (PLib3MFObject_SetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_object_setpartnumber"); + #else // _WIN32 + pWrapperTable->m_Object_SetPartNumber = (PLib3MFObject_SetPartNumberPtr) dlsym(hLibrary, "lib3mf_object_setpartnumber"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_SetPartNumber == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_IsMeshObject = (PLib3MFObject_IsMeshObjectPtr) GetProcAddress(hLibrary, "lib3mf_object_ismeshobject"); + #else // _WIN32 + pWrapperTable->m_Object_IsMeshObject = (PLib3MFObject_IsMeshObjectPtr) dlsym(hLibrary, "lib3mf_object_ismeshobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_IsMeshObject == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_IsComponentsObject = (PLib3MFObject_IsComponentsObjectPtr) GetProcAddress(hLibrary, "lib3mf_object_iscomponentsobject"); + #else // _WIN32 + pWrapperTable->m_Object_IsComponentsObject = (PLib3MFObject_IsComponentsObjectPtr) dlsym(hLibrary, "lib3mf_object_iscomponentsobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_IsComponentsObject == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_IsValid = (PLib3MFObject_IsValidPtr) GetProcAddress(hLibrary, "lib3mf_object_isvalid"); + #else // _WIN32 + pWrapperTable->m_Object_IsValid = (PLib3MFObject_IsValidPtr) dlsym(hLibrary, "lib3mf_object_isvalid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_IsValid == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_SetAttachmentAsThumbnail = (PLib3MFObject_SetAttachmentAsThumbnailPtr) GetProcAddress(hLibrary, "lib3mf_object_setattachmentasthumbnail"); + #else // _WIN32 + pWrapperTable->m_Object_SetAttachmentAsThumbnail = (PLib3MFObject_SetAttachmentAsThumbnailPtr) dlsym(hLibrary, "lib3mf_object_setattachmentasthumbnail"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_SetAttachmentAsThumbnail == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetThumbnailAttachment = (PLib3MFObject_GetThumbnailAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_object_getthumbnailattachment"); + #else // _WIN32 + pWrapperTable->m_Object_GetThumbnailAttachment = (PLib3MFObject_GetThumbnailAttachmentPtr) dlsym(hLibrary, "lib3mf_object_getthumbnailattachment"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetThumbnailAttachment == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_ClearThumbnailAttachment = (PLib3MFObject_ClearThumbnailAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_object_clearthumbnailattachment"); + #else // _WIN32 + pWrapperTable->m_Object_ClearThumbnailAttachment = (PLib3MFObject_ClearThumbnailAttachmentPtr) dlsym(hLibrary, "lib3mf_object_clearthumbnailattachment"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_ClearThumbnailAttachment == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetOutbox = (PLib3MFObject_GetOutboxPtr) GetProcAddress(hLibrary, "lib3mf_object_getoutbox"); + #else // _WIN32 + pWrapperTable->m_Object_GetOutbox = (PLib3MFObject_GetOutboxPtr) dlsym(hLibrary, "lib3mf_object_getoutbox"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetOutbox == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetUUID = (PLib3MFObject_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_object_getuuid"); + #else // _WIN32 + pWrapperTable->m_Object_GetUUID = (PLib3MFObject_GetUUIDPtr) dlsym(hLibrary, "lib3mf_object_getuuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetUUID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_SetUUID = (PLib3MFObject_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_object_setuuid"); + #else // _WIN32 + pWrapperTable->m_Object_SetUUID = (PLib3MFObject_SetUUIDPtr) dlsym(hLibrary, "lib3mf_object_setuuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_SetUUID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetMetaDataGroup = (PLib3MFObject_GetMetaDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_object_getmetadatagroup"); + #else // _WIN32 + pWrapperTable->m_Object_GetMetaDataGroup = (PLib3MFObject_GetMetaDataGroupPtr) dlsym(hLibrary, "lib3mf_object_getmetadatagroup"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetMetaDataGroup == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_SetSlicesMeshResolution = (PLib3MFObject_SetSlicesMeshResolutionPtr) GetProcAddress(hLibrary, "lib3mf_object_setslicesmeshresolution"); + #else // _WIN32 + pWrapperTable->m_Object_SetSlicesMeshResolution = (PLib3MFObject_SetSlicesMeshResolutionPtr) dlsym(hLibrary, "lib3mf_object_setslicesmeshresolution"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_SetSlicesMeshResolution == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetSlicesMeshResolution = (PLib3MFObject_GetSlicesMeshResolutionPtr) GetProcAddress(hLibrary, "lib3mf_object_getslicesmeshresolution"); + #else // _WIN32 + pWrapperTable->m_Object_GetSlicesMeshResolution = (PLib3MFObject_GetSlicesMeshResolutionPtr) dlsym(hLibrary, "lib3mf_object_getslicesmeshresolution"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetSlicesMeshResolution == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_HasSlices = (PLib3MFObject_HasSlicesPtr) GetProcAddress(hLibrary, "lib3mf_object_hasslices"); + #else // _WIN32 + pWrapperTable->m_Object_HasSlices = (PLib3MFObject_HasSlicesPtr) dlsym(hLibrary, "lib3mf_object_hasslices"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_HasSlices == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_ClearSliceStack = (PLib3MFObject_ClearSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_object_clearslicestack"); + #else // _WIN32 + pWrapperTable->m_Object_ClearSliceStack = (PLib3MFObject_ClearSliceStackPtr) dlsym(hLibrary, "lib3mf_object_clearslicestack"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_ClearSliceStack == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetSliceStack = (PLib3MFObject_GetSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_object_getslicestack"); + #else // _WIN32 + pWrapperTable->m_Object_GetSliceStack = (PLib3MFObject_GetSliceStackPtr) dlsym(hLibrary, "lib3mf_object_getslicestack"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetSliceStack == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_AssignSliceStack = (PLib3MFObject_AssignSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_object_assignslicestack"); + #else // _WIN32 + pWrapperTable->m_Object_AssignSliceStack = (PLib3MFObject_AssignSliceStackPtr) dlsym(hLibrary, "lib3mf_object_assignslicestack"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_AssignSliceStack == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetVertexCount = (PLib3MFMeshObject_GetVertexCountPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getvertexcount"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetVertexCount = (PLib3MFMeshObject_GetVertexCountPtr) dlsym(hLibrary, "lib3mf_meshobject_getvertexcount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetVertexCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetTriangleCount = (PLib3MFMeshObject_GetTriangleCountPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettrianglecount"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetTriangleCount = (PLib3MFMeshObject_GetTriangleCountPtr) dlsym(hLibrary, "lib3mf_meshobject_gettrianglecount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetTriangleCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetVertex = (PLib3MFMeshObject_GetVertexPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getvertex"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetVertex = (PLib3MFMeshObject_GetVertexPtr) dlsym(hLibrary, "lib3mf_meshobject_getvertex"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetVertex == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_SetVertex = (PLib3MFMeshObject_SetVertexPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setvertex"); + #else // _WIN32 + pWrapperTable->m_MeshObject_SetVertex = (PLib3MFMeshObject_SetVertexPtr) dlsym(hLibrary, "lib3mf_meshobject_setvertex"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_SetVertex == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_AddVertex = (PLib3MFMeshObject_AddVertexPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_addvertex"); + #else // _WIN32 + pWrapperTable->m_MeshObject_AddVertex = (PLib3MFMeshObject_AddVertexPtr) dlsym(hLibrary, "lib3mf_meshobject_addvertex"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_AddVertex == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetVertices = (PLib3MFMeshObject_GetVerticesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getvertices"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetVertices = (PLib3MFMeshObject_GetVerticesPtr) dlsym(hLibrary, "lib3mf_meshobject_getvertices"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetVertices == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetTriangle = (PLib3MFMeshObject_GetTrianglePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettriangle"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetTriangle = (PLib3MFMeshObject_GetTrianglePtr) dlsym(hLibrary, "lib3mf_meshobject_gettriangle"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetTriangle == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_SetTriangle = (PLib3MFMeshObject_SetTrianglePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_settriangle"); + #else // _WIN32 + pWrapperTable->m_MeshObject_SetTriangle = (PLib3MFMeshObject_SetTrianglePtr) dlsym(hLibrary, "lib3mf_meshobject_settriangle"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_SetTriangle == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_AddTriangle = (PLib3MFMeshObject_AddTrianglePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_addtriangle"); + #else // _WIN32 + pWrapperTable->m_MeshObject_AddTriangle = (PLib3MFMeshObject_AddTrianglePtr) dlsym(hLibrary, "lib3mf_meshobject_addtriangle"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_AddTriangle == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetTriangleIndices = (PLib3MFMeshObject_GetTriangleIndicesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettriangleindices"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetTriangleIndices = (PLib3MFMeshObject_GetTriangleIndicesPtr) dlsym(hLibrary, "lib3mf_meshobject_gettriangleindices"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetTriangleIndices == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_SetObjectLevelProperty = (PLib3MFMeshObject_SetObjectLevelPropertyPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setobjectlevelproperty"); + #else // _WIN32 + pWrapperTable->m_MeshObject_SetObjectLevelProperty = (PLib3MFMeshObject_SetObjectLevelPropertyPtr) dlsym(hLibrary, "lib3mf_meshobject_setobjectlevelproperty"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_SetObjectLevelProperty == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetObjectLevelProperty = (PLib3MFMeshObject_GetObjectLevelPropertyPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getobjectlevelproperty"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetObjectLevelProperty = (PLib3MFMeshObject_GetObjectLevelPropertyPtr) dlsym(hLibrary, "lib3mf_meshobject_getobjectlevelproperty"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetObjectLevelProperty == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_SetTriangleProperties = (PLib3MFMeshObject_SetTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_settriangleproperties"); + #else // _WIN32 + pWrapperTable->m_MeshObject_SetTriangleProperties = (PLib3MFMeshObject_SetTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_settriangleproperties"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_SetTriangleProperties == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetTriangleProperties = (PLib3MFMeshObject_GetTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettriangleproperties"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetTriangleProperties = (PLib3MFMeshObject_GetTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_gettriangleproperties"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetTriangleProperties == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_SetAllTriangleProperties = (PLib3MFMeshObject_SetAllTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setalltriangleproperties"); + #else // _WIN32 + pWrapperTable->m_MeshObject_SetAllTriangleProperties = (PLib3MFMeshObject_SetAllTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_setalltriangleproperties"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_SetAllTriangleProperties == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetAllTriangleProperties = (PLib3MFMeshObject_GetAllTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getalltriangleproperties"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetAllTriangleProperties = (PLib3MFMeshObject_GetAllTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_getalltriangleproperties"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetAllTriangleProperties == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_ClearAllProperties = (PLib3MFMeshObject_ClearAllPropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_clearallproperties"); + #else // _WIN32 + pWrapperTable->m_MeshObject_ClearAllProperties = (PLib3MFMeshObject_ClearAllPropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_clearallproperties"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_ClearAllProperties == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_SetGeometry = (PLib3MFMeshObject_SetGeometryPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setgeometry"); + #else // _WIN32 + pWrapperTable->m_MeshObject_SetGeometry = (PLib3MFMeshObject_SetGeometryPtr) dlsym(hLibrary, "lib3mf_meshobject_setgeometry"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_SetGeometry == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_IsManifoldAndOriented = (PLib3MFMeshObject_IsManifoldAndOrientedPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_ismanifoldandoriented"); + #else // _WIN32 + pWrapperTable->m_MeshObject_IsManifoldAndOriented = (PLib3MFMeshObject_IsManifoldAndOrientedPtr) dlsym(hLibrary, "lib3mf_meshobject_ismanifoldandoriented"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_IsManifoldAndOriented == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_BeamLattice = (PLib3MFMeshObject_BeamLatticePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_beamlattice"); + #else // _WIN32 + pWrapperTable->m_MeshObject_BeamLattice = (PLib3MFMeshObject_BeamLatticePtr) dlsym(hLibrary, "lib3mf_meshobject_beamlattice"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_BeamLattice == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetMinLength = (PLib3MFBeamLattice_GetMinLengthPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getminlength"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetMinLength = (PLib3MFBeamLattice_GetMinLengthPtr) dlsym(hLibrary, "lib3mf_beamlattice_getminlength"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetMinLength == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_SetMinLength = (PLib3MFBeamLattice_SetMinLengthPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setminlength"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_SetMinLength = (PLib3MFBeamLattice_SetMinLengthPtr) dlsym(hLibrary, "lib3mf_beamlattice_setminlength"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_SetMinLength == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetClipping = (PLib3MFBeamLattice_GetClippingPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getclipping"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetClipping = (PLib3MFBeamLattice_GetClippingPtr) dlsym(hLibrary, "lib3mf_beamlattice_getclipping"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetClipping == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_SetClipping = (PLib3MFBeamLattice_SetClippingPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setclipping"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_SetClipping = (PLib3MFBeamLattice_SetClippingPtr) dlsym(hLibrary, "lib3mf_beamlattice_setclipping"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_SetClipping == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetRepresentation = (PLib3MFBeamLattice_GetRepresentationPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getrepresentation"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetRepresentation = (PLib3MFBeamLattice_GetRepresentationPtr) dlsym(hLibrary, "lib3mf_beamlattice_getrepresentation"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetRepresentation == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_SetRepresentation = (PLib3MFBeamLattice_SetRepresentationPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setrepresentation"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_SetRepresentation = (PLib3MFBeamLattice_SetRepresentationPtr) dlsym(hLibrary, "lib3mf_beamlattice_setrepresentation"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_SetRepresentation == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBallOptions = (PLib3MFBeamLattice_GetBallOptionsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getballoptions"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBallOptions = (PLib3MFBeamLattice_GetBallOptionsPtr) dlsym(hLibrary, "lib3mf_beamlattice_getballoptions"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBallOptions == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_SetBallOptions = (PLib3MFBeamLattice_SetBallOptionsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setballoptions"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_SetBallOptions = (PLib3MFBeamLattice_SetBallOptionsPtr) dlsym(hLibrary, "lib3mf_beamlattice_setballoptions"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_SetBallOptions == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBeamCount = (PLib3MFBeamLattice_GetBeamCountPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeamcount"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBeamCount = (PLib3MFBeamLattice_GetBeamCountPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeamcount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBeamCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBeam = (PLib3MFBeamLattice_GetBeamPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeam"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBeam = (PLib3MFBeamLattice_GetBeamPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeam"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBeam == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_AddBeam = (PLib3MFBeamLattice_AddBeamPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_addbeam"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_AddBeam = (PLib3MFBeamLattice_AddBeamPtr) dlsym(hLibrary, "lib3mf_beamlattice_addbeam"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_AddBeam == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_SetBeam = (PLib3MFBeamLattice_SetBeamPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setbeam"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_SetBeam = (PLib3MFBeamLattice_SetBeamPtr) dlsym(hLibrary, "lib3mf_beamlattice_setbeam"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_SetBeam == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_SetBeams = (PLib3MFBeamLattice_SetBeamsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setbeams"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_SetBeams = (PLib3MFBeamLattice_SetBeamsPtr) dlsym(hLibrary, "lib3mf_beamlattice_setbeams"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_SetBeams == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBeams = (PLib3MFBeamLattice_GetBeamsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeams"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBeams = (PLib3MFBeamLattice_GetBeamsPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeams"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBeams == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBallCount = (PLib3MFBeamLattice_GetBallCountPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getballcount"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBallCount = (PLib3MFBeamLattice_GetBallCountPtr) dlsym(hLibrary, "lib3mf_beamlattice_getballcount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBallCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBall = (PLib3MFBeamLattice_GetBallPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getball"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBall = (PLib3MFBeamLattice_GetBallPtr) dlsym(hLibrary, "lib3mf_beamlattice_getball"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBall == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_AddBall = (PLib3MFBeamLattice_AddBallPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_addball"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_AddBall = (PLib3MFBeamLattice_AddBallPtr) dlsym(hLibrary, "lib3mf_beamlattice_addball"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_AddBall == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_SetBall = (PLib3MFBeamLattice_SetBallPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setball"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_SetBall = (PLib3MFBeamLattice_SetBallPtr) dlsym(hLibrary, "lib3mf_beamlattice_setball"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_SetBall == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_SetBalls = (PLib3MFBeamLattice_SetBallsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setballs"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_SetBalls = (PLib3MFBeamLattice_SetBallsPtr) dlsym(hLibrary, "lib3mf_beamlattice_setballs"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_SetBalls == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBalls = (PLib3MFBeamLattice_GetBallsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getballs"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBalls = (PLib3MFBeamLattice_GetBallsPtr) dlsym(hLibrary, "lib3mf_beamlattice_getballs"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBalls == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBeamSetCount = (PLib3MFBeamLattice_GetBeamSetCountPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeamsetcount"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBeamSetCount = (PLib3MFBeamLattice_GetBeamSetCountPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeamsetcount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBeamSetCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_AddBeamSet = (PLib3MFBeamLattice_AddBeamSetPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_addbeamset"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_AddBeamSet = (PLib3MFBeamLattice_AddBeamSetPtr) dlsym(hLibrary, "lib3mf_beamlattice_addbeamset"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_AddBeamSet == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBeamSet = (PLib3MFBeamLattice_GetBeamSetPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeamset"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBeamSet = (PLib3MFBeamLattice_GetBeamSetPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeamset"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBeamSet == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Component_GetObjectResource = (PLib3MFComponent_GetObjectResourcePtr) GetProcAddress(hLibrary, "lib3mf_component_getobjectresource"); + #else // _WIN32 + pWrapperTable->m_Component_GetObjectResource = (PLib3MFComponent_GetObjectResourcePtr) dlsym(hLibrary, "lib3mf_component_getobjectresource"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Component_GetObjectResource == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Component_GetObjectResourceID = (PLib3MFComponent_GetObjectResourceIDPtr) GetProcAddress(hLibrary, "lib3mf_component_getobjectresourceid"); + #else // _WIN32 + pWrapperTable->m_Component_GetObjectResourceID = (PLib3MFComponent_GetObjectResourceIDPtr) dlsym(hLibrary, "lib3mf_component_getobjectresourceid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Component_GetObjectResourceID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Component_GetUUID = (PLib3MFComponent_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_component_getuuid"); + #else // _WIN32 + pWrapperTable->m_Component_GetUUID = (PLib3MFComponent_GetUUIDPtr) dlsym(hLibrary, "lib3mf_component_getuuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Component_GetUUID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Component_SetUUID = (PLib3MFComponent_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_component_setuuid"); + #else // _WIN32 + pWrapperTable->m_Component_SetUUID = (PLib3MFComponent_SetUUIDPtr) dlsym(hLibrary, "lib3mf_component_setuuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Component_SetUUID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Component_HasTransform = (PLib3MFComponent_HasTransformPtr) GetProcAddress(hLibrary, "lib3mf_component_hastransform"); + #else // _WIN32 + pWrapperTable->m_Component_HasTransform = (PLib3MFComponent_HasTransformPtr) dlsym(hLibrary, "lib3mf_component_hastransform"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Component_HasTransform == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Component_GetTransform = (PLib3MFComponent_GetTransformPtr) GetProcAddress(hLibrary, "lib3mf_component_gettransform"); + #else // _WIN32 + pWrapperTable->m_Component_GetTransform = (PLib3MFComponent_GetTransformPtr) dlsym(hLibrary, "lib3mf_component_gettransform"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Component_GetTransform == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Component_SetTransform = (PLib3MFComponent_SetTransformPtr) GetProcAddress(hLibrary, "lib3mf_component_settransform"); + #else // _WIN32 + pWrapperTable->m_Component_SetTransform = (PLib3MFComponent_SetTransformPtr) dlsym(hLibrary, "lib3mf_component_settransform"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Component_SetTransform == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ComponentsObject_AddComponent = (PLib3MFComponentsObject_AddComponentPtr) GetProcAddress(hLibrary, "lib3mf_componentsobject_addcomponent"); + #else // _WIN32 + pWrapperTable->m_ComponentsObject_AddComponent = (PLib3MFComponentsObject_AddComponentPtr) dlsym(hLibrary, "lib3mf_componentsobject_addcomponent"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ComponentsObject_AddComponent == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ComponentsObject_GetComponent = (PLib3MFComponentsObject_GetComponentPtr) GetProcAddress(hLibrary, "lib3mf_componentsobject_getcomponent"); + #else // _WIN32 + pWrapperTable->m_ComponentsObject_GetComponent = (PLib3MFComponentsObject_GetComponentPtr) dlsym(hLibrary, "lib3mf_componentsobject_getcomponent"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ComponentsObject_GetComponent == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ComponentsObject_GetComponentCount = (PLib3MFComponentsObject_GetComponentCountPtr) GetProcAddress(hLibrary, "lib3mf_componentsobject_getcomponentcount"); + #else // _WIN32 + pWrapperTable->m_ComponentsObject_GetComponentCount = (PLib3MFComponentsObject_GetComponentCountPtr) dlsym(hLibrary, "lib3mf_componentsobject_getcomponentcount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ComponentsObject_GetComponentCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_SetName = (PLib3MFBeamSet_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_beamset_setname"); + #else // _WIN32 + pWrapperTable->m_BeamSet_SetName = (PLib3MFBeamSet_SetNamePtr) dlsym(hLibrary, "lib3mf_beamset_setname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_SetName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_GetName = (PLib3MFBeamSet_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_beamset_getname"); + #else // _WIN32 + pWrapperTable->m_BeamSet_GetName = (PLib3MFBeamSet_GetNamePtr) dlsym(hLibrary, "lib3mf_beamset_getname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_GetName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_SetIdentifier = (PLib3MFBeamSet_SetIdentifierPtr) GetProcAddress(hLibrary, "lib3mf_beamset_setidentifier"); + #else // _WIN32 + pWrapperTable->m_BeamSet_SetIdentifier = (PLib3MFBeamSet_SetIdentifierPtr) dlsym(hLibrary, "lib3mf_beamset_setidentifier"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_SetIdentifier == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_GetIdentifier = (PLib3MFBeamSet_GetIdentifierPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getidentifier"); + #else // _WIN32 + pWrapperTable->m_BeamSet_GetIdentifier = (PLib3MFBeamSet_GetIdentifierPtr) dlsym(hLibrary, "lib3mf_beamset_getidentifier"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_GetIdentifier == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_GetReferenceCount = (PLib3MFBeamSet_GetReferenceCountPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getreferencecount"); + #else // _WIN32 + pWrapperTable->m_BeamSet_GetReferenceCount = (PLib3MFBeamSet_GetReferenceCountPtr) dlsym(hLibrary, "lib3mf_beamset_getreferencecount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_GetReferenceCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_SetReferences = (PLib3MFBeamSet_SetReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_setreferences"); + #else // _WIN32 + pWrapperTable->m_BeamSet_SetReferences = (PLib3MFBeamSet_SetReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_setreferences"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_SetReferences == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_GetReferences = (PLib3MFBeamSet_GetReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getreferences"); + #else // _WIN32 + pWrapperTable->m_BeamSet_GetReferences = (PLib3MFBeamSet_GetReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_getreferences"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_GetReferences == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_GetBallReferenceCount = (PLib3MFBeamSet_GetBallReferenceCountPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getballreferencecount"); + #else // _WIN32 + pWrapperTable->m_BeamSet_GetBallReferenceCount = (PLib3MFBeamSet_GetBallReferenceCountPtr) dlsym(hLibrary, "lib3mf_beamset_getballreferencecount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_GetBallReferenceCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_SetBallReferences = (PLib3MFBeamSet_SetBallReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_setballreferences"); + #else // _WIN32 + pWrapperTable->m_BeamSet_SetBallReferences = (PLib3MFBeamSet_SetBallReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_setballreferences"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_SetBallReferences == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_GetBallReferences = (PLib3MFBeamSet_GetBallReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getballreferences"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetVertex = (PLib3MFMeshObject_GetVertexPtr) dlsym(hLibrary, "lib3mf_meshobject_getvertex"); + pWrapperTable->m_BeamSet_GetBallReferences = (PLib3MFBeamSet_GetBallReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_getballreferences"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetVertex == NULL) + if (pWrapperTable->m_BeamSet_GetBallReferences == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_SetVertex = (PLib3MFMeshObject_SetVertexPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setvertex"); + pWrapperTable->m_BaseMaterialGroup_GetCount = (PLib3MFBaseMaterialGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getcount"); #else // _WIN32 - pWrapperTable->m_MeshObject_SetVertex = (PLib3MFMeshObject_SetVertexPtr) dlsym(hLibrary, "lib3mf_meshobject_setvertex"); + pWrapperTable->m_BaseMaterialGroup_GetCount = (PLib3MFBaseMaterialGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_SetVertex == NULL) + if (pWrapperTable->m_BaseMaterialGroup_GetCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_AddVertex = (PLib3MFMeshObject_AddVertexPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_addvertex"); + pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs = (PLib3MFBaseMaterialGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getallpropertyids"); #else // _WIN32 - pWrapperTable->m_MeshObject_AddVertex = (PLib3MFMeshObject_AddVertexPtr) dlsym(hLibrary, "lib3mf_meshobject_addvertex"); + pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs = (PLib3MFBaseMaterialGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getallpropertyids"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_AddVertex == NULL) + if (pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetVertices = (PLib3MFMeshObject_GetVerticesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getvertices"); + pWrapperTable->m_BaseMaterialGroup_AddMaterial = (PLib3MFBaseMaterialGroup_AddMaterialPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_addmaterial"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetVertices = (PLib3MFMeshObject_GetVerticesPtr) dlsym(hLibrary, "lib3mf_meshobject_getvertices"); + pWrapperTable->m_BaseMaterialGroup_AddMaterial = (PLib3MFBaseMaterialGroup_AddMaterialPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_addmaterial"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetVertices == NULL) + if (pWrapperTable->m_BaseMaterialGroup_AddMaterial == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetTriangle = (PLib3MFMeshObject_GetTrianglePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettriangle"); + pWrapperTable->m_BaseMaterialGroup_RemoveMaterial = (PLib3MFBaseMaterialGroup_RemoveMaterialPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_removematerial"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetTriangle = (PLib3MFMeshObject_GetTrianglePtr) dlsym(hLibrary, "lib3mf_meshobject_gettriangle"); + pWrapperTable->m_BaseMaterialGroup_RemoveMaterial = (PLib3MFBaseMaterialGroup_RemoveMaterialPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_removematerial"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetTriangle == NULL) + if (pWrapperTable->m_BaseMaterialGroup_RemoveMaterial == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_SetTriangle = (PLib3MFMeshObject_SetTrianglePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_settriangle"); + pWrapperTable->m_BaseMaterialGroup_GetName = (PLib3MFBaseMaterialGroup_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getname"); #else // _WIN32 - pWrapperTable->m_MeshObject_SetTriangle = (PLib3MFMeshObject_SetTrianglePtr) dlsym(hLibrary, "lib3mf_meshobject_settriangle"); + pWrapperTable->m_BaseMaterialGroup_GetName = (PLib3MFBaseMaterialGroup_GetNamePtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_SetTriangle == NULL) + if (pWrapperTable->m_BaseMaterialGroup_GetName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_AddTriangle = (PLib3MFMeshObject_AddTrianglePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_addtriangle"); + pWrapperTable->m_BaseMaterialGroup_SetName = (PLib3MFBaseMaterialGroup_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_setname"); #else // _WIN32 - pWrapperTable->m_MeshObject_AddTriangle = (PLib3MFMeshObject_AddTrianglePtr) dlsym(hLibrary, "lib3mf_meshobject_addtriangle"); + pWrapperTable->m_BaseMaterialGroup_SetName = (PLib3MFBaseMaterialGroup_SetNamePtr) dlsym(hLibrary, "lib3mf_basematerialgroup_setname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_AddTriangle == NULL) + if (pWrapperTable->m_BaseMaterialGroup_SetName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetTriangleIndices = (PLib3MFMeshObject_GetTriangleIndicesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettriangleindices"); + pWrapperTable->m_BaseMaterialGroup_SetDisplayColor = (PLib3MFBaseMaterialGroup_SetDisplayColorPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_setdisplaycolor"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetTriangleIndices = (PLib3MFMeshObject_GetTriangleIndicesPtr) dlsym(hLibrary, "lib3mf_meshobject_gettriangleindices"); + pWrapperTable->m_BaseMaterialGroup_SetDisplayColor = (PLib3MFBaseMaterialGroup_SetDisplayColorPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_setdisplaycolor"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetTriangleIndices == NULL) + if (pWrapperTable->m_BaseMaterialGroup_SetDisplayColor == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_SetObjectLevelProperty = (PLib3MFMeshObject_SetObjectLevelPropertyPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setobjectlevelproperty"); + pWrapperTable->m_BaseMaterialGroup_GetDisplayColor = (PLib3MFBaseMaterialGroup_GetDisplayColorPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getdisplaycolor"); #else // _WIN32 - pWrapperTable->m_MeshObject_SetObjectLevelProperty = (PLib3MFMeshObject_SetObjectLevelPropertyPtr) dlsym(hLibrary, "lib3mf_meshobject_setobjectlevelproperty"); + pWrapperTable->m_BaseMaterialGroup_GetDisplayColor = (PLib3MFBaseMaterialGroup_GetDisplayColorPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getdisplaycolor"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_SetObjectLevelProperty == NULL) + if (pWrapperTable->m_BaseMaterialGroup_GetDisplayColor == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetObjectLevelProperty = (PLib3MFMeshObject_GetObjectLevelPropertyPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getobjectlevelproperty"); + pWrapperTable->m_ColorGroup_GetCount = (PLib3MFColorGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_getcount"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetObjectLevelProperty = (PLib3MFMeshObject_GetObjectLevelPropertyPtr) dlsym(hLibrary, "lib3mf_meshobject_getobjectlevelproperty"); + pWrapperTable->m_ColorGroup_GetCount = (PLib3MFColorGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_colorgroup_getcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetObjectLevelProperty == NULL) + if (pWrapperTable->m_ColorGroup_GetCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_SetTriangleProperties = (PLib3MFMeshObject_SetTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_settriangleproperties"); + pWrapperTable->m_ColorGroup_GetAllPropertyIDs = (PLib3MFColorGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_getallpropertyids"); #else // _WIN32 - pWrapperTable->m_MeshObject_SetTriangleProperties = (PLib3MFMeshObject_SetTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_settriangleproperties"); + pWrapperTable->m_ColorGroup_GetAllPropertyIDs = (PLib3MFColorGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_colorgroup_getallpropertyids"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_SetTriangleProperties == NULL) + if (pWrapperTable->m_ColorGroup_GetAllPropertyIDs == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetTriangleProperties = (PLib3MFMeshObject_GetTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettriangleproperties"); + pWrapperTable->m_ColorGroup_AddColor = (PLib3MFColorGroup_AddColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_addcolor"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetTriangleProperties = (PLib3MFMeshObject_GetTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_gettriangleproperties"); + pWrapperTable->m_ColorGroup_AddColor = (PLib3MFColorGroup_AddColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_addcolor"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetTriangleProperties == NULL) + if (pWrapperTable->m_ColorGroup_AddColor == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_SetAllTriangleProperties = (PLib3MFMeshObject_SetAllTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setalltriangleproperties"); + pWrapperTable->m_ColorGroup_RemoveColor = (PLib3MFColorGroup_RemoveColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_removecolor"); #else // _WIN32 - pWrapperTable->m_MeshObject_SetAllTriangleProperties = (PLib3MFMeshObject_SetAllTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_setalltriangleproperties"); + pWrapperTable->m_ColorGroup_RemoveColor = (PLib3MFColorGroup_RemoveColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_removecolor"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_SetAllTriangleProperties == NULL) + if (pWrapperTable->m_ColorGroup_RemoveColor == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetAllTriangleProperties = (PLib3MFMeshObject_GetAllTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getalltriangleproperties"); + pWrapperTable->m_ColorGroup_SetColor = (PLib3MFColorGroup_SetColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_setcolor"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetAllTriangleProperties = (PLib3MFMeshObject_GetAllTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_getalltriangleproperties"); + pWrapperTable->m_ColorGroup_SetColor = (PLib3MFColorGroup_SetColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_setcolor"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetAllTriangleProperties == NULL) + if (pWrapperTable->m_ColorGroup_SetColor == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_ClearAllProperties = (PLib3MFMeshObject_ClearAllPropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_clearallproperties"); + pWrapperTable->m_ColorGroup_GetColor = (PLib3MFColorGroup_GetColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_getcolor"); #else // _WIN32 - pWrapperTable->m_MeshObject_ClearAllProperties = (PLib3MFMeshObject_ClearAllPropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_clearallproperties"); + pWrapperTable->m_ColorGroup_GetColor = (PLib3MFColorGroup_GetColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_getcolor"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_ClearAllProperties == NULL) + if (pWrapperTable->m_ColorGroup_GetColor == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_SetGeometry = (PLib3MFMeshObject_SetGeometryPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setgeometry"); + pWrapperTable->m_Texture2DGroup_GetCount = (PLib3MFTexture2DGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_getcount"); #else // _WIN32 - pWrapperTable->m_MeshObject_SetGeometry = (PLib3MFMeshObject_SetGeometryPtr) dlsym(hLibrary, "lib3mf_meshobject_setgeometry"); + pWrapperTable->m_Texture2DGroup_GetCount = (PLib3MFTexture2DGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_getcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_SetGeometry == NULL) + if (pWrapperTable->m_Texture2DGroup_GetCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_IsManifoldAndOriented = (PLib3MFMeshObject_IsManifoldAndOrientedPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_ismanifoldandoriented"); + pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs = (PLib3MFTexture2DGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_getallpropertyids"); #else // _WIN32 - pWrapperTable->m_MeshObject_IsManifoldAndOriented = (PLib3MFMeshObject_IsManifoldAndOrientedPtr) dlsym(hLibrary, "lib3mf_meshobject_ismanifoldandoriented"); + pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs = (PLib3MFTexture2DGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_getallpropertyids"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_IsManifoldAndOriented == NULL) + if (pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_BeamLattice = (PLib3MFMeshObject_BeamLatticePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_beamlattice"); + pWrapperTable->m_Texture2DGroup_AddTex2Coord = (PLib3MFTexture2DGroup_AddTex2CoordPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_addtex2coord"); #else // _WIN32 - pWrapperTable->m_MeshObject_BeamLattice = (PLib3MFMeshObject_BeamLatticePtr) dlsym(hLibrary, "lib3mf_meshobject_beamlattice"); + pWrapperTable->m_Texture2DGroup_AddTex2Coord = (PLib3MFTexture2DGroup_AddTex2CoordPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_addtex2coord"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_BeamLattice == NULL) + if (pWrapperTable->m_Texture2DGroup_AddTex2Coord == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetMinLength = (PLib3MFBeamLattice_GetMinLengthPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getminlength"); + pWrapperTable->m_Texture2DGroup_GetTex2Coord = (PLib3MFTexture2DGroup_GetTex2CoordPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_gettex2coord"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetMinLength = (PLib3MFBeamLattice_GetMinLengthPtr) dlsym(hLibrary, "lib3mf_beamlattice_getminlength"); + pWrapperTable->m_Texture2DGroup_GetTex2Coord = (PLib3MFTexture2DGroup_GetTex2CoordPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_gettex2coord"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetMinLength == NULL) + if (pWrapperTable->m_Texture2DGroup_GetTex2Coord == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetMinLength = (PLib3MFBeamLattice_SetMinLengthPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setminlength"); + pWrapperTable->m_Texture2DGroup_RemoveTex2Coord = (PLib3MFTexture2DGroup_RemoveTex2CoordPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_removetex2coord"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetMinLength = (PLib3MFBeamLattice_SetMinLengthPtr) dlsym(hLibrary, "lib3mf_beamlattice_setminlength"); + pWrapperTable->m_Texture2DGroup_RemoveTex2Coord = (PLib3MFTexture2DGroup_RemoveTex2CoordPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_removetex2coord"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetMinLength == NULL) + if (pWrapperTable->m_Texture2DGroup_RemoveTex2Coord == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetClipping = (PLib3MFBeamLattice_GetClippingPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getclipping"); + pWrapperTable->m_Texture2DGroup_GetTexture2D = (PLib3MFTexture2DGroup_GetTexture2DPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_gettexture2d"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetClipping = (PLib3MFBeamLattice_GetClippingPtr) dlsym(hLibrary, "lib3mf_beamlattice_getclipping"); + pWrapperTable->m_Texture2DGroup_GetTexture2D = (PLib3MFTexture2DGroup_GetTexture2DPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_gettexture2d"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetClipping == NULL) + if (pWrapperTable->m_Texture2DGroup_GetTexture2D == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetClipping = (PLib3MFBeamLattice_SetClippingPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setclipping"); + pWrapperTable->m_CompositeMaterials_GetCount = (PLib3MFCompositeMaterials_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getcount"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetClipping = (PLib3MFBeamLattice_SetClippingPtr) dlsym(hLibrary, "lib3mf_beamlattice_setclipping"); + pWrapperTable->m_CompositeMaterials_GetCount = (PLib3MFCompositeMaterials_GetCountPtr) dlsym(hLibrary, "lib3mf_compositematerials_getcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetClipping == NULL) + if (pWrapperTable->m_CompositeMaterials_GetCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetRepresentation = (PLib3MFBeamLattice_GetRepresentationPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getrepresentation"); + pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs = (PLib3MFCompositeMaterials_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getallpropertyids"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetRepresentation = (PLib3MFBeamLattice_GetRepresentationPtr) dlsym(hLibrary, "lib3mf_beamlattice_getrepresentation"); + pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs = (PLib3MFCompositeMaterials_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_compositematerials_getallpropertyids"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetRepresentation == NULL) + if (pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetRepresentation = (PLib3MFBeamLattice_SetRepresentationPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setrepresentation"); + pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup = (PLib3MFCompositeMaterials_GetBaseMaterialGroupPtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getbasematerialgroup"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetRepresentation = (PLib3MFBeamLattice_SetRepresentationPtr) dlsym(hLibrary, "lib3mf_beamlattice_setrepresentation"); + pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup = (PLib3MFCompositeMaterials_GetBaseMaterialGroupPtr) dlsym(hLibrary, "lib3mf_compositematerials_getbasematerialgroup"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetRepresentation == NULL) + if (pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBallOptions = (PLib3MFBeamLattice_GetBallOptionsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getballoptions"); + pWrapperTable->m_CompositeMaterials_AddComposite = (PLib3MFCompositeMaterials_AddCompositePtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_addcomposite"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBallOptions = (PLib3MFBeamLattice_GetBallOptionsPtr) dlsym(hLibrary, "lib3mf_beamlattice_getballoptions"); + pWrapperTable->m_CompositeMaterials_AddComposite = (PLib3MFCompositeMaterials_AddCompositePtr) dlsym(hLibrary, "lib3mf_compositematerials_addcomposite"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_CompositeMaterials_AddComposite == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_CompositeMaterials_RemoveComposite = (PLib3MFCompositeMaterials_RemoveCompositePtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_removecomposite"); + #else // _WIN32 + pWrapperTable->m_CompositeMaterials_RemoveComposite = (PLib3MFCompositeMaterials_RemoveCompositePtr) dlsym(hLibrary, "lib3mf_compositematerials_removecomposite"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_CompositeMaterials_RemoveComposite == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_CompositeMaterials_GetComposite = (PLib3MFCompositeMaterials_GetCompositePtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getcomposite"); + #else // _WIN32 + pWrapperTable->m_CompositeMaterials_GetComposite = (PLib3MFCompositeMaterials_GetCompositePtr) dlsym(hLibrary, "lib3mf_compositematerials_getcomposite"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_CompositeMaterials_GetComposite == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetCount = (PLib3MFMultiPropertyGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getcount"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetCount = (PLib3MFMultiPropertyGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getcount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_GetCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs = (PLib3MFMultiPropertyGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getallpropertyids"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs = (PLib3MFMultiPropertyGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getallpropertyids"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_AddMultiProperty = (PLib3MFMultiPropertyGroup_AddMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_addmultiproperty"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_AddMultiProperty = (PLib3MFMultiPropertyGroup_AddMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_addmultiproperty"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_AddMultiProperty == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_SetMultiProperty = (PLib3MFMultiPropertyGroup_SetMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_setmultiproperty"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_SetMultiProperty = (PLib3MFMultiPropertyGroup_SetMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_setmultiproperty"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_SetMultiProperty == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetMultiProperty = (PLib3MFMultiPropertyGroup_GetMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getmultiproperty"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetMultiProperty = (PLib3MFMultiPropertyGroup_GetMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getmultiproperty"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_GetMultiProperty == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty = (PLib3MFMultiPropertyGroup_RemoveMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_removemultiproperty"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty = (PLib3MFMultiPropertyGroup_RemoveMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_removemultiproperty"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetLayerCount = (PLib3MFMultiPropertyGroup_GetLayerCountPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getlayercount"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetLayerCount = (PLib3MFMultiPropertyGroup_GetLayerCountPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getlayercount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_GetLayerCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_AddLayer = (PLib3MFMultiPropertyGroup_AddLayerPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_addlayer"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_AddLayer = (PLib3MFMultiPropertyGroup_AddLayerPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_addlayer"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_AddLayer == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetLayer = (PLib3MFMultiPropertyGroup_GetLayerPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getlayer"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetLayer = (PLib3MFMultiPropertyGroup_GetLayerPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getlayer"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_GetLayer == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_RemoveLayer = (PLib3MFMultiPropertyGroup_RemoveLayerPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_removelayer"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_RemoveLayer = (PLib3MFMultiPropertyGroup_RemoveLayerPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_removelayer"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBallOptions == NULL) + if (pWrapperTable->m_MultiPropertyGroup_RemoveLayer == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetBallOptions = (PLib3MFBeamLattice_SetBallOptionsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setballoptions"); + pWrapperTable->m_Attachment_GetPath = (PLib3MFAttachment_GetPathPtr) GetProcAddress(hLibrary, "lib3mf_attachment_getpath"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetBallOptions = (PLib3MFBeamLattice_SetBallOptionsPtr) dlsym(hLibrary, "lib3mf_beamlattice_setballoptions"); + pWrapperTable->m_Attachment_GetPath = (PLib3MFAttachment_GetPathPtr) dlsym(hLibrary, "lib3mf_attachment_getpath"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetBallOptions == NULL) + if (pWrapperTable->m_Attachment_GetPath == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBeamCount = (PLib3MFBeamLattice_GetBeamCountPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeamcount"); + pWrapperTable->m_Attachment_SetPath = (PLib3MFAttachment_SetPathPtr) GetProcAddress(hLibrary, "lib3mf_attachment_setpath"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBeamCount = (PLib3MFBeamLattice_GetBeamCountPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeamcount"); + pWrapperTable->m_Attachment_SetPath = (PLib3MFAttachment_SetPathPtr) dlsym(hLibrary, "lib3mf_attachment_setpath"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBeamCount == NULL) + if (pWrapperTable->m_Attachment_SetPath == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBeam = (PLib3MFBeamLattice_GetBeamPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeam"); + pWrapperTable->m_Attachment_PackagePart = (PLib3MFAttachment_PackagePartPtr) GetProcAddress(hLibrary, "lib3mf_attachment_packagepart"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBeam = (PLib3MFBeamLattice_GetBeamPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeam"); + pWrapperTable->m_Attachment_PackagePart = (PLib3MFAttachment_PackagePartPtr) dlsym(hLibrary, "lib3mf_attachment_packagepart"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBeam == NULL) + if (pWrapperTable->m_Attachment_PackagePart == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_AddBeam = (PLib3MFBeamLattice_AddBeamPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_addbeam"); + pWrapperTable->m_Attachment_GetRelationShipType = (PLib3MFAttachment_GetRelationShipTypePtr) GetProcAddress(hLibrary, "lib3mf_attachment_getrelationshiptype"); #else // _WIN32 - pWrapperTable->m_BeamLattice_AddBeam = (PLib3MFBeamLattice_AddBeamPtr) dlsym(hLibrary, "lib3mf_beamlattice_addbeam"); + pWrapperTable->m_Attachment_GetRelationShipType = (PLib3MFAttachment_GetRelationShipTypePtr) dlsym(hLibrary, "lib3mf_attachment_getrelationshiptype"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_AddBeam == NULL) + if (pWrapperTable->m_Attachment_GetRelationShipType == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetBeam = (PLib3MFBeamLattice_SetBeamPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setbeam"); + pWrapperTable->m_Attachment_SetRelationShipType = (PLib3MFAttachment_SetRelationShipTypePtr) GetProcAddress(hLibrary, "lib3mf_attachment_setrelationshiptype"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetBeam = (PLib3MFBeamLattice_SetBeamPtr) dlsym(hLibrary, "lib3mf_beamlattice_setbeam"); + pWrapperTable->m_Attachment_SetRelationShipType = (PLib3MFAttachment_SetRelationShipTypePtr) dlsym(hLibrary, "lib3mf_attachment_setrelationshiptype"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetBeam == NULL) + if (pWrapperTable->m_Attachment_SetRelationShipType == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetBeams = (PLib3MFBeamLattice_SetBeamsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setbeams"); + pWrapperTable->m_Attachment_WriteToFile = (PLib3MFAttachment_WriteToFilePtr) GetProcAddress(hLibrary, "lib3mf_attachment_writetofile"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetBeams = (PLib3MFBeamLattice_SetBeamsPtr) dlsym(hLibrary, "lib3mf_beamlattice_setbeams"); + pWrapperTable->m_Attachment_WriteToFile = (PLib3MFAttachment_WriteToFilePtr) dlsym(hLibrary, "lib3mf_attachment_writetofile"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetBeams == NULL) + if (pWrapperTable->m_Attachment_WriteToFile == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBeams = (PLib3MFBeamLattice_GetBeamsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeams"); + pWrapperTable->m_Attachment_ReadFromFile = (PLib3MFAttachment_ReadFromFilePtr) GetProcAddress(hLibrary, "lib3mf_attachment_readfromfile"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBeams = (PLib3MFBeamLattice_GetBeamsPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeams"); + pWrapperTable->m_Attachment_ReadFromFile = (PLib3MFAttachment_ReadFromFilePtr) dlsym(hLibrary, "lib3mf_attachment_readfromfile"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBeams == NULL) + if (pWrapperTable->m_Attachment_ReadFromFile == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBallCount = (PLib3MFBeamLattice_GetBallCountPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getballcount"); + pWrapperTable->m_Attachment_ReadFromCallback = (PLib3MFAttachment_ReadFromCallbackPtr) GetProcAddress(hLibrary, "lib3mf_attachment_readfromcallback"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBallCount = (PLib3MFBeamLattice_GetBallCountPtr) dlsym(hLibrary, "lib3mf_beamlattice_getballcount"); + pWrapperTable->m_Attachment_ReadFromCallback = (PLib3MFAttachment_ReadFromCallbackPtr) dlsym(hLibrary, "lib3mf_attachment_readfromcallback"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBallCount == NULL) + if (pWrapperTable->m_Attachment_ReadFromCallback == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBall = (PLib3MFBeamLattice_GetBallPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getball"); + pWrapperTable->m_Attachment_GetStreamSize = (PLib3MFAttachment_GetStreamSizePtr) GetProcAddress(hLibrary, "lib3mf_attachment_getstreamsize"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBall = (PLib3MFBeamLattice_GetBallPtr) dlsym(hLibrary, "lib3mf_beamlattice_getball"); + pWrapperTable->m_Attachment_GetStreamSize = (PLib3MFAttachment_GetStreamSizePtr) dlsym(hLibrary, "lib3mf_attachment_getstreamsize"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBall == NULL) + if (pWrapperTable->m_Attachment_GetStreamSize == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_AddBall = (PLib3MFBeamLattice_AddBallPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_addball"); + pWrapperTable->m_Attachment_WriteToBuffer = (PLib3MFAttachment_WriteToBufferPtr) GetProcAddress(hLibrary, "lib3mf_attachment_writetobuffer"); #else // _WIN32 - pWrapperTable->m_BeamLattice_AddBall = (PLib3MFBeamLattice_AddBallPtr) dlsym(hLibrary, "lib3mf_beamlattice_addball"); + pWrapperTable->m_Attachment_WriteToBuffer = (PLib3MFAttachment_WriteToBufferPtr) dlsym(hLibrary, "lib3mf_attachment_writetobuffer"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_AddBall == NULL) + if (pWrapperTable->m_Attachment_WriteToBuffer == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetBall = (PLib3MFBeamLattice_SetBallPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setball"); + pWrapperTable->m_Attachment_ReadFromBuffer = (PLib3MFAttachment_ReadFromBufferPtr) GetProcAddress(hLibrary, "lib3mf_attachment_readfrombuffer"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetBall = (PLib3MFBeamLattice_SetBallPtr) dlsym(hLibrary, "lib3mf_beamlattice_setball"); + pWrapperTable->m_Attachment_ReadFromBuffer = (PLib3MFAttachment_ReadFromBufferPtr) dlsym(hLibrary, "lib3mf_attachment_readfrombuffer"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetBall == NULL) + if (pWrapperTable->m_Attachment_ReadFromBuffer == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetBalls = (PLib3MFBeamLattice_SetBallsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setballs"); + pWrapperTable->m_Texture2D_GetAttachment = (PLib3MFTexture2D_GetAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_getattachment"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetBalls = (PLib3MFBeamLattice_SetBallsPtr) dlsym(hLibrary, "lib3mf_beamlattice_setballs"); + pWrapperTable->m_Texture2D_GetAttachment = (PLib3MFTexture2D_GetAttachmentPtr) dlsym(hLibrary, "lib3mf_texture2d_getattachment"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetBalls == NULL) + if (pWrapperTable->m_Texture2D_GetAttachment == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBalls = (PLib3MFBeamLattice_GetBallsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getballs"); + pWrapperTable->m_Texture2D_SetAttachment = (PLib3MFTexture2D_SetAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_setattachment"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBalls = (PLib3MFBeamLattice_GetBallsPtr) dlsym(hLibrary, "lib3mf_beamlattice_getballs"); + pWrapperTable->m_Texture2D_SetAttachment = (PLib3MFTexture2D_SetAttachmentPtr) dlsym(hLibrary, "lib3mf_texture2d_setattachment"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBalls == NULL) + if (pWrapperTable->m_Texture2D_SetAttachment == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBeamSetCount = (PLib3MFBeamLattice_GetBeamSetCountPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeamsetcount"); + pWrapperTable->m_Texture2D_GetContentType = (PLib3MFTexture2D_GetContentTypePtr) GetProcAddress(hLibrary, "lib3mf_texture2d_getcontenttype"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBeamSetCount = (PLib3MFBeamLattice_GetBeamSetCountPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeamsetcount"); + pWrapperTable->m_Texture2D_GetContentType = (PLib3MFTexture2D_GetContentTypePtr) dlsym(hLibrary, "lib3mf_texture2d_getcontenttype"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBeamSetCount == NULL) + if (pWrapperTable->m_Texture2D_GetContentType == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_AddBeamSet = (PLib3MFBeamLattice_AddBeamSetPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_addbeamset"); + pWrapperTable->m_Texture2D_SetContentType = (PLib3MFTexture2D_SetContentTypePtr) GetProcAddress(hLibrary, "lib3mf_texture2d_setcontenttype"); #else // _WIN32 - pWrapperTable->m_BeamLattice_AddBeamSet = (PLib3MFBeamLattice_AddBeamSetPtr) dlsym(hLibrary, "lib3mf_beamlattice_addbeamset"); + pWrapperTable->m_Texture2D_SetContentType = (PLib3MFTexture2D_SetContentTypePtr) dlsym(hLibrary, "lib3mf_texture2d_setcontenttype"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_AddBeamSet == NULL) + if (pWrapperTable->m_Texture2D_SetContentType == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBeamSet = (PLib3MFBeamLattice_GetBeamSetPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeamset"); + pWrapperTable->m_Texture2D_GetTileStyleUV = (PLib3MFTexture2D_GetTileStyleUVPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_gettilestyleuv"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBeamSet = (PLib3MFBeamLattice_GetBeamSetPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeamset"); + pWrapperTable->m_Texture2D_GetTileStyleUV = (PLib3MFTexture2D_GetTileStyleUVPtr) dlsym(hLibrary, "lib3mf_texture2d_gettilestyleuv"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBeamSet == NULL) + if (pWrapperTable->m_Texture2D_GetTileStyleUV == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_GetObjectResource = (PLib3MFComponent_GetObjectResourcePtr) GetProcAddress(hLibrary, "lib3mf_component_getobjectresource"); + pWrapperTable->m_Texture2D_SetTileStyleUV = (PLib3MFTexture2D_SetTileStyleUVPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_settilestyleuv"); #else // _WIN32 - pWrapperTable->m_Component_GetObjectResource = (PLib3MFComponent_GetObjectResourcePtr) dlsym(hLibrary, "lib3mf_component_getobjectresource"); + pWrapperTable->m_Texture2D_SetTileStyleUV = (PLib3MFTexture2D_SetTileStyleUVPtr) dlsym(hLibrary, "lib3mf_texture2d_settilestyleuv"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_GetObjectResource == NULL) + if (pWrapperTable->m_Texture2D_SetTileStyleUV == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_GetObjectResourceID = (PLib3MFComponent_GetObjectResourceIDPtr) GetProcAddress(hLibrary, "lib3mf_component_getobjectresourceid"); + pWrapperTable->m_Texture2D_GetFilter = (PLib3MFTexture2D_GetFilterPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_getfilter"); #else // _WIN32 - pWrapperTable->m_Component_GetObjectResourceID = (PLib3MFComponent_GetObjectResourceIDPtr) dlsym(hLibrary, "lib3mf_component_getobjectresourceid"); + pWrapperTable->m_Texture2D_GetFilter = (PLib3MFTexture2D_GetFilterPtr) dlsym(hLibrary, "lib3mf_texture2d_getfilter"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_GetObjectResourceID == NULL) + if (pWrapperTable->m_Texture2D_GetFilter == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_GetUUID = (PLib3MFComponent_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_component_getuuid"); + pWrapperTable->m_Texture2D_SetFilter = (PLib3MFTexture2D_SetFilterPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_setfilter"); #else // _WIN32 - pWrapperTable->m_Component_GetUUID = (PLib3MFComponent_GetUUIDPtr) dlsym(hLibrary, "lib3mf_component_getuuid"); + pWrapperTable->m_Texture2D_SetFilter = (PLib3MFTexture2D_SetFilterPtr) dlsym(hLibrary, "lib3mf_texture2d_setfilter"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_GetUUID == NULL) + if (pWrapperTable->m_Texture2D_SetFilter == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_SetUUID = (PLib3MFComponent_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_component_setuuid"); + pWrapperTable->m_BuildItem_GetObjectResource = (PLib3MFBuildItem_GetObjectResourcePtr) GetProcAddress(hLibrary, "lib3mf_builditem_getobjectresource"); #else // _WIN32 - pWrapperTable->m_Component_SetUUID = (PLib3MFComponent_SetUUIDPtr) dlsym(hLibrary, "lib3mf_component_setuuid"); + pWrapperTable->m_BuildItem_GetObjectResource = (PLib3MFBuildItem_GetObjectResourcePtr) dlsym(hLibrary, "lib3mf_builditem_getobjectresource"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_SetUUID == NULL) + if (pWrapperTable->m_BuildItem_GetObjectResource == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_HasTransform = (PLib3MFComponent_HasTransformPtr) GetProcAddress(hLibrary, "lib3mf_component_hastransform"); + pWrapperTable->m_BuildItem_GetUUID = (PLib3MFBuildItem_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getuuid"); #else // _WIN32 - pWrapperTable->m_Component_HasTransform = (PLib3MFComponent_HasTransformPtr) dlsym(hLibrary, "lib3mf_component_hastransform"); + pWrapperTable->m_BuildItem_GetUUID = (PLib3MFBuildItem_GetUUIDPtr) dlsym(hLibrary, "lib3mf_builditem_getuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_HasTransform == NULL) + if (pWrapperTable->m_BuildItem_GetUUID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_GetTransform = (PLib3MFComponent_GetTransformPtr) GetProcAddress(hLibrary, "lib3mf_component_gettransform"); + pWrapperTable->m_BuildItem_SetUUID = (PLib3MFBuildItem_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_builditem_setuuid"); #else // _WIN32 - pWrapperTable->m_Component_GetTransform = (PLib3MFComponent_GetTransformPtr) dlsym(hLibrary, "lib3mf_component_gettransform"); + pWrapperTable->m_BuildItem_SetUUID = (PLib3MFBuildItem_SetUUIDPtr) dlsym(hLibrary, "lib3mf_builditem_setuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_GetTransform == NULL) + if (pWrapperTable->m_BuildItem_SetUUID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_SetTransform = (PLib3MFComponent_SetTransformPtr) GetProcAddress(hLibrary, "lib3mf_component_settransform"); + pWrapperTable->m_BuildItem_GetObjectResourceID = (PLib3MFBuildItem_GetObjectResourceIDPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getobjectresourceid"); #else // _WIN32 - pWrapperTable->m_Component_SetTransform = (PLib3MFComponent_SetTransformPtr) dlsym(hLibrary, "lib3mf_component_settransform"); + pWrapperTable->m_BuildItem_GetObjectResourceID = (PLib3MFBuildItem_GetObjectResourceIDPtr) dlsym(hLibrary, "lib3mf_builditem_getobjectresourceid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_SetTransform == NULL) + if (pWrapperTable->m_BuildItem_GetObjectResourceID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ComponentsObject_AddComponent = (PLib3MFComponentsObject_AddComponentPtr) GetProcAddress(hLibrary, "lib3mf_componentsobject_addcomponent"); + pWrapperTable->m_BuildItem_HasObjectTransform = (PLib3MFBuildItem_HasObjectTransformPtr) GetProcAddress(hLibrary, "lib3mf_builditem_hasobjecttransform"); #else // _WIN32 - pWrapperTable->m_ComponentsObject_AddComponent = (PLib3MFComponentsObject_AddComponentPtr) dlsym(hLibrary, "lib3mf_componentsobject_addcomponent"); + pWrapperTable->m_BuildItem_HasObjectTransform = (PLib3MFBuildItem_HasObjectTransformPtr) dlsym(hLibrary, "lib3mf_builditem_hasobjecttransform"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ComponentsObject_AddComponent == NULL) + if (pWrapperTable->m_BuildItem_HasObjectTransform == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ComponentsObject_GetComponent = (PLib3MFComponentsObject_GetComponentPtr) GetProcAddress(hLibrary, "lib3mf_componentsobject_getcomponent"); + pWrapperTable->m_BuildItem_GetObjectTransform = (PLib3MFBuildItem_GetObjectTransformPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getobjecttransform"); #else // _WIN32 - pWrapperTable->m_ComponentsObject_GetComponent = (PLib3MFComponentsObject_GetComponentPtr) dlsym(hLibrary, "lib3mf_componentsobject_getcomponent"); + pWrapperTable->m_BuildItem_GetObjectTransform = (PLib3MFBuildItem_GetObjectTransformPtr) dlsym(hLibrary, "lib3mf_builditem_getobjecttransform"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ComponentsObject_GetComponent == NULL) + if (pWrapperTable->m_BuildItem_GetObjectTransform == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ComponentsObject_GetComponentCount = (PLib3MFComponentsObject_GetComponentCountPtr) GetProcAddress(hLibrary, "lib3mf_componentsobject_getcomponentcount"); + pWrapperTable->m_BuildItem_SetObjectTransform = (PLib3MFBuildItem_SetObjectTransformPtr) GetProcAddress(hLibrary, "lib3mf_builditem_setobjecttransform"); #else // _WIN32 - pWrapperTable->m_ComponentsObject_GetComponentCount = (PLib3MFComponentsObject_GetComponentCountPtr) dlsym(hLibrary, "lib3mf_componentsobject_getcomponentcount"); + pWrapperTable->m_BuildItem_SetObjectTransform = (PLib3MFBuildItem_SetObjectTransformPtr) dlsym(hLibrary, "lib3mf_builditem_setobjecttransform"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ComponentsObject_GetComponentCount == NULL) + if (pWrapperTable->m_BuildItem_SetObjectTransform == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_SetName = (PLib3MFBeamSet_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_beamset_setname"); + pWrapperTable->m_BuildItem_GetPartNumber = (PLib3MFBuildItem_GetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getpartnumber"); #else // _WIN32 - pWrapperTable->m_BeamSet_SetName = (PLib3MFBeamSet_SetNamePtr) dlsym(hLibrary, "lib3mf_beamset_setname"); + pWrapperTable->m_BuildItem_GetPartNumber = (PLib3MFBuildItem_GetPartNumberPtr) dlsym(hLibrary, "lib3mf_builditem_getpartnumber"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_SetName == NULL) + if (pWrapperTable->m_BuildItem_GetPartNumber == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_GetName = (PLib3MFBeamSet_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_beamset_getname"); + pWrapperTable->m_BuildItem_SetPartNumber = (PLib3MFBuildItem_SetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_builditem_setpartnumber"); #else // _WIN32 - pWrapperTable->m_BeamSet_GetName = (PLib3MFBeamSet_GetNamePtr) dlsym(hLibrary, "lib3mf_beamset_getname"); + pWrapperTable->m_BuildItem_SetPartNumber = (PLib3MFBuildItem_SetPartNumberPtr) dlsym(hLibrary, "lib3mf_builditem_setpartnumber"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_GetName == NULL) + if (pWrapperTable->m_BuildItem_SetPartNumber == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_SetIdentifier = (PLib3MFBeamSet_SetIdentifierPtr) GetProcAddress(hLibrary, "lib3mf_beamset_setidentifier"); + pWrapperTable->m_BuildItem_GetMetaDataGroup = (PLib3MFBuildItem_GetMetaDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getmetadatagroup"); #else // _WIN32 - pWrapperTable->m_BeamSet_SetIdentifier = (PLib3MFBeamSet_SetIdentifierPtr) dlsym(hLibrary, "lib3mf_beamset_setidentifier"); + pWrapperTable->m_BuildItem_GetMetaDataGroup = (PLib3MFBuildItem_GetMetaDataGroupPtr) dlsym(hLibrary, "lib3mf_builditem_getmetadatagroup"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_SetIdentifier == NULL) + if (pWrapperTable->m_BuildItem_GetMetaDataGroup == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_GetIdentifier = (PLib3MFBeamSet_GetIdentifierPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getidentifier"); + pWrapperTable->m_BuildItem_GetOutbox = (PLib3MFBuildItem_GetOutboxPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getoutbox"); #else // _WIN32 - pWrapperTable->m_BeamSet_GetIdentifier = (PLib3MFBeamSet_GetIdentifierPtr) dlsym(hLibrary, "lib3mf_beamset_getidentifier"); + pWrapperTable->m_BuildItem_GetOutbox = (PLib3MFBuildItem_GetOutboxPtr) dlsym(hLibrary, "lib3mf_builditem_getoutbox"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_GetIdentifier == NULL) + if (pWrapperTable->m_BuildItem_GetOutbox == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_GetReferenceCount = (PLib3MFBeamSet_GetReferenceCountPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getreferencecount"); + pWrapperTable->m_BuildItemIterator_MoveNext = (PLib3MFBuildItemIterator_MoveNextPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_movenext"); #else // _WIN32 - pWrapperTable->m_BeamSet_GetReferenceCount = (PLib3MFBeamSet_GetReferenceCountPtr) dlsym(hLibrary, "lib3mf_beamset_getreferencecount"); + pWrapperTable->m_BuildItemIterator_MoveNext = (PLib3MFBuildItemIterator_MoveNextPtr) dlsym(hLibrary, "lib3mf_builditemiterator_movenext"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_GetReferenceCount == NULL) + if (pWrapperTable->m_BuildItemIterator_MoveNext == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_SetReferences = (PLib3MFBeamSet_SetReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_setreferences"); + pWrapperTable->m_BuildItemIterator_MovePrevious = (PLib3MFBuildItemIterator_MovePreviousPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_moveprevious"); #else // _WIN32 - pWrapperTable->m_BeamSet_SetReferences = (PLib3MFBeamSet_SetReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_setreferences"); + pWrapperTable->m_BuildItemIterator_MovePrevious = (PLib3MFBuildItemIterator_MovePreviousPtr) dlsym(hLibrary, "lib3mf_builditemiterator_moveprevious"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_SetReferences == NULL) + if (pWrapperTable->m_BuildItemIterator_MovePrevious == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_GetReferences = (PLib3MFBeamSet_GetReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getreferences"); + pWrapperTable->m_BuildItemIterator_GetCurrent = (PLib3MFBuildItemIterator_GetCurrentPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_getcurrent"); #else // _WIN32 - pWrapperTable->m_BeamSet_GetReferences = (PLib3MFBeamSet_GetReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_getreferences"); + pWrapperTable->m_BuildItemIterator_GetCurrent = (PLib3MFBuildItemIterator_GetCurrentPtr) dlsym(hLibrary, "lib3mf_builditemiterator_getcurrent"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_GetReferences == NULL) + if (pWrapperTable->m_BuildItemIterator_GetCurrent == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_GetBallReferenceCount = (PLib3MFBeamSet_GetBallReferenceCountPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getballreferencecount"); + pWrapperTable->m_BuildItemIterator_Clone = (PLib3MFBuildItemIterator_ClonePtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_clone"); #else // _WIN32 - pWrapperTable->m_BeamSet_GetBallReferenceCount = (PLib3MFBeamSet_GetBallReferenceCountPtr) dlsym(hLibrary, "lib3mf_beamset_getballreferencecount"); + pWrapperTable->m_BuildItemIterator_Clone = (PLib3MFBuildItemIterator_ClonePtr) dlsym(hLibrary, "lib3mf_builditemiterator_clone"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_GetBallReferenceCount == NULL) + if (pWrapperTable->m_BuildItemIterator_Clone == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_SetBallReferences = (PLib3MFBeamSet_SetBallReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_setballreferences"); + pWrapperTable->m_BuildItemIterator_Count = (PLib3MFBuildItemIterator_CountPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_count"); #else // _WIN32 - pWrapperTable->m_BeamSet_SetBallReferences = (PLib3MFBeamSet_SetBallReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_setballreferences"); + pWrapperTable->m_BuildItemIterator_Count = (PLib3MFBuildItemIterator_CountPtr) dlsym(hLibrary, "lib3mf_builditemiterator_count"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_SetBallReferences == NULL) + if (pWrapperTable->m_BuildItemIterator_Count == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_GetBallReferences = (PLib3MFBeamSet_GetBallReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getballreferences"); + pWrapperTable->m_Slice_SetVertices = (PLib3MFSlice_SetVerticesPtr) GetProcAddress(hLibrary, "lib3mf_slice_setvertices"); #else // _WIN32 - pWrapperTable->m_BeamSet_GetBallReferences = (PLib3MFBeamSet_GetBallReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_getballreferences"); + pWrapperTable->m_Slice_SetVertices = (PLib3MFSlice_SetVerticesPtr) dlsym(hLibrary, "lib3mf_slice_setvertices"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_GetBallReferences == NULL) + if (pWrapperTable->m_Slice_SetVertices == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetCount = (PLib3MFBaseMaterialGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getcount"); + pWrapperTable->m_Slice_GetVertices = (PLib3MFSlice_GetVerticesPtr) GetProcAddress(hLibrary, "lib3mf_slice_getvertices"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetCount = (PLib3MFBaseMaterialGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getcount"); + pWrapperTable->m_Slice_GetVertices = (PLib3MFSlice_GetVerticesPtr) dlsym(hLibrary, "lib3mf_slice_getvertices"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_GetCount == NULL) + if (pWrapperTable->m_Slice_GetVertices == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs = (PLib3MFBaseMaterialGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getallpropertyids"); + pWrapperTable->m_Slice_GetVertexCount = (PLib3MFSlice_GetVertexCountPtr) GetProcAddress(hLibrary, "lib3mf_slice_getvertexcount"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs = (PLib3MFBaseMaterialGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getallpropertyids"); + pWrapperTable->m_Slice_GetVertexCount = (PLib3MFSlice_GetVertexCountPtr) dlsym(hLibrary, "lib3mf_slice_getvertexcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs == NULL) + if (pWrapperTable->m_Slice_GetVertexCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_AddMaterial = (PLib3MFBaseMaterialGroup_AddMaterialPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_addmaterial"); + pWrapperTable->m_Slice_AddPolygon = (PLib3MFSlice_AddPolygonPtr) GetProcAddress(hLibrary, "lib3mf_slice_addpolygon"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_AddMaterial = (PLib3MFBaseMaterialGroup_AddMaterialPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_addmaterial"); + pWrapperTable->m_Slice_AddPolygon = (PLib3MFSlice_AddPolygonPtr) dlsym(hLibrary, "lib3mf_slice_addpolygon"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_AddMaterial == NULL) + if (pWrapperTable->m_Slice_AddPolygon == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_RemoveMaterial = (PLib3MFBaseMaterialGroup_RemoveMaterialPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_removematerial"); + pWrapperTable->m_Slice_GetPolygonCount = (PLib3MFSlice_GetPolygonCountPtr) GetProcAddress(hLibrary, "lib3mf_slice_getpolygoncount"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_RemoveMaterial = (PLib3MFBaseMaterialGroup_RemoveMaterialPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_removematerial"); + pWrapperTable->m_Slice_GetPolygonCount = (PLib3MFSlice_GetPolygonCountPtr) dlsym(hLibrary, "lib3mf_slice_getpolygoncount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_RemoveMaterial == NULL) + if (pWrapperTable->m_Slice_GetPolygonCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetName = (PLib3MFBaseMaterialGroup_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getname"); + pWrapperTable->m_Slice_SetPolygonIndices = (PLib3MFSlice_SetPolygonIndicesPtr) GetProcAddress(hLibrary, "lib3mf_slice_setpolygonindices"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetName = (PLib3MFBaseMaterialGroup_GetNamePtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getname"); + pWrapperTable->m_Slice_SetPolygonIndices = (PLib3MFSlice_SetPolygonIndicesPtr) dlsym(hLibrary, "lib3mf_slice_setpolygonindices"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_GetName == NULL) + if (pWrapperTable->m_Slice_SetPolygonIndices == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_SetName = (PLib3MFBaseMaterialGroup_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_setname"); + pWrapperTable->m_Slice_GetPolygonIndices = (PLib3MFSlice_GetPolygonIndicesPtr) GetProcAddress(hLibrary, "lib3mf_slice_getpolygonindices"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_SetName = (PLib3MFBaseMaterialGroup_SetNamePtr) dlsym(hLibrary, "lib3mf_basematerialgroup_setname"); + pWrapperTable->m_Slice_GetPolygonIndices = (PLib3MFSlice_GetPolygonIndicesPtr) dlsym(hLibrary, "lib3mf_slice_getpolygonindices"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_SetName == NULL) + if (pWrapperTable->m_Slice_GetPolygonIndices == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_SetDisplayColor = (PLib3MFBaseMaterialGroup_SetDisplayColorPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_setdisplaycolor"); + pWrapperTable->m_Slice_GetPolygonIndexCount = (PLib3MFSlice_GetPolygonIndexCountPtr) GetProcAddress(hLibrary, "lib3mf_slice_getpolygonindexcount"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_SetDisplayColor = (PLib3MFBaseMaterialGroup_SetDisplayColorPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_setdisplaycolor"); + pWrapperTable->m_Slice_GetPolygonIndexCount = (PLib3MFSlice_GetPolygonIndexCountPtr) dlsym(hLibrary, "lib3mf_slice_getpolygonindexcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_SetDisplayColor == NULL) + if (pWrapperTable->m_Slice_GetPolygonIndexCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetDisplayColor = (PLib3MFBaseMaterialGroup_GetDisplayColorPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getdisplaycolor"); + pWrapperTable->m_Slice_GetZTop = (PLib3MFSlice_GetZTopPtr) GetProcAddress(hLibrary, "lib3mf_slice_getztop"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetDisplayColor = (PLib3MFBaseMaterialGroup_GetDisplayColorPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getdisplaycolor"); + pWrapperTable->m_Slice_GetZTop = (PLib3MFSlice_GetZTopPtr) dlsym(hLibrary, "lib3mf_slice_getztop"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_GetDisplayColor == NULL) + if (pWrapperTable->m_Slice_GetZTop == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroup_GetCount = (PLib3MFColorGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_getcount"); + pWrapperTable->m_ToolpathProfile_GetUUID = (PLib3MFToolpathProfile_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getuuid"); #else // _WIN32 - pWrapperTable->m_ColorGroup_GetCount = (PLib3MFColorGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_colorgroup_getcount"); + pWrapperTable->m_ToolpathProfile_GetUUID = (PLib3MFToolpathProfile_GetUUIDPtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroup_GetCount == NULL) + if (pWrapperTable->m_ToolpathProfile_GetUUID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroup_GetAllPropertyIDs = (PLib3MFColorGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_getallpropertyids"); + pWrapperTable->m_ToolpathProfile_GetName = (PLib3MFToolpathProfile_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getname"); #else // _WIN32 - pWrapperTable->m_ColorGroup_GetAllPropertyIDs = (PLib3MFColorGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_colorgroup_getallpropertyids"); + pWrapperTable->m_ToolpathProfile_GetName = (PLib3MFToolpathProfile_GetNamePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroup_GetAllPropertyIDs == NULL) + if (pWrapperTable->m_ToolpathProfile_GetName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroup_AddColor = (PLib3MFColorGroup_AddColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_addcolor"); + pWrapperTable->m_ToolpathProfile_GetParameterCount = (PLib3MFToolpathProfile_GetParameterCountPtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparametercount"); #else // _WIN32 - pWrapperTable->m_ColorGroup_AddColor = (PLib3MFColorGroup_AddColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_addcolor"); + pWrapperTable->m_ToolpathProfile_GetParameterCount = (PLib3MFToolpathProfile_GetParameterCountPtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparametercount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroup_AddColor == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroup_RemoveColor = (PLib3MFColorGroup_RemoveColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_removecolor"); + pWrapperTable->m_ToolpathProfile_GetParameterName = (PLib3MFToolpathProfile_GetParameterNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparametername"); #else // _WIN32 - pWrapperTable->m_ColorGroup_RemoveColor = (PLib3MFColorGroup_RemoveColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_removecolor"); + pWrapperTable->m_ToolpathProfile_GetParameterName = (PLib3MFToolpathProfile_GetParameterNamePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparametername"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroup_RemoveColor == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroup_SetColor = (PLib3MFColorGroup_SetColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_setcolor"); + pWrapperTable->m_ToolpathProfile_GetParameterNameSpace = (PLib3MFToolpathProfile_GetParameterNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameternamespace"); #else // _WIN32 - pWrapperTable->m_ColorGroup_SetColor = (PLib3MFColorGroup_SetColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_setcolor"); + pWrapperTable->m_ToolpathProfile_GetParameterNameSpace = (PLib3MFToolpathProfile_GetParameterNameSpacePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameternamespace"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroup_SetColor == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterNameSpace == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroup_GetColor = (PLib3MFColorGroup_GetColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_getcolor"); + pWrapperTable->m_ToolpathProfile_HasParameterValue = (PLib3MFToolpathProfile_HasParameterValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_hasparametervalue"); #else // _WIN32 - pWrapperTable->m_ColorGroup_GetColor = (PLib3MFColorGroup_GetColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_getcolor"); + pWrapperTable->m_ToolpathProfile_HasParameterValue = (PLib3MFToolpathProfile_HasParameterValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_hasparametervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroup_GetColor == NULL) + if (pWrapperTable->m_ToolpathProfile_HasParameterValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroup_GetCount = (PLib3MFTexture2DGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_getcount"); + pWrapperTable->m_ToolpathProfile_GetParameterValue = (PLib3MFToolpathProfile_GetParameterValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparametervalue"); #else // _WIN32 - pWrapperTable->m_Texture2DGroup_GetCount = (PLib3MFTexture2DGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_getcount"); + pWrapperTable->m_ToolpathProfile_GetParameterValue = (PLib3MFToolpathProfile_GetParameterValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparametervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroup_GetCount == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs = (PLib3MFTexture2DGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_getallpropertyids"); + pWrapperTable->m_ToolpathProfile_GetParameterValueDef = (PLib3MFToolpathProfile_GetParameterValueDefPtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparametervaluedef"); #else // _WIN32 - pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs = (PLib3MFTexture2DGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_getallpropertyids"); + pWrapperTable->m_ToolpathProfile_GetParameterValueDef = (PLib3MFToolpathProfile_GetParameterValueDefPtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparametervaluedef"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterValueDef == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroup_AddTex2Coord = (PLib3MFTexture2DGroup_AddTex2CoordPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_addtex2coord"); + pWrapperTable->m_ToolpathProfile_GetParameterDoubleValue = (PLib3MFToolpathProfile_GetParameterDoubleValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameterdoublevalue"); #else // _WIN32 - pWrapperTable->m_Texture2DGroup_AddTex2Coord = (PLib3MFTexture2DGroup_AddTex2CoordPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_addtex2coord"); + pWrapperTable->m_ToolpathProfile_GetParameterDoubleValue = (PLib3MFToolpathProfile_GetParameterDoubleValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameterdoublevalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroup_AddTex2Coord == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterDoubleValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroup_GetTex2Coord = (PLib3MFTexture2DGroup_GetTex2CoordPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_gettex2coord"); + pWrapperTable->m_ToolpathProfile_GetParameterDoubleValueDef = (PLib3MFToolpathProfile_GetParameterDoubleValueDefPtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameterdoublevaluedef"); #else // _WIN32 - pWrapperTable->m_Texture2DGroup_GetTex2Coord = (PLib3MFTexture2DGroup_GetTex2CoordPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_gettex2coord"); + pWrapperTable->m_ToolpathProfile_GetParameterDoubleValueDef = (PLib3MFToolpathProfile_GetParameterDoubleValueDefPtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameterdoublevaluedef"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroup_GetTex2Coord == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterDoubleValueDef == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroup_RemoveTex2Coord = (PLib3MFTexture2DGroup_RemoveTex2CoordPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_removetex2coord"); + pWrapperTable->m_ToolpathProfile_GetParameterIntegerValue = (PLib3MFToolpathProfile_GetParameterIntegerValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameterintegervalue"); #else // _WIN32 - pWrapperTable->m_Texture2DGroup_RemoveTex2Coord = (PLib3MFTexture2DGroup_RemoveTex2CoordPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_removetex2coord"); + pWrapperTable->m_ToolpathProfile_GetParameterIntegerValue = (PLib3MFToolpathProfile_GetParameterIntegerValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameterintegervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroup_RemoveTex2Coord == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterIntegerValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroup_GetTexture2D = (PLib3MFTexture2DGroup_GetTexture2DPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_gettexture2d"); + pWrapperTable->m_ToolpathProfile_GetParameterIntegerValueDef = (PLib3MFToolpathProfile_GetParameterIntegerValueDefPtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameterintegervaluedef"); #else // _WIN32 - pWrapperTable->m_Texture2DGroup_GetTexture2D = (PLib3MFTexture2DGroup_GetTexture2DPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_gettexture2d"); + pWrapperTable->m_ToolpathProfile_GetParameterIntegerValueDef = (PLib3MFToolpathProfile_GetParameterIntegerValueDefPtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameterintegervaluedef"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroup_GetTexture2D == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterIntegerValueDef == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterials_GetCount = (PLib3MFCompositeMaterials_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getcount"); + pWrapperTable->m_ToolpathProfile_GetParameterBoolValue = (PLib3MFToolpathProfile_GetParameterBoolValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameterboolvalue"); #else // _WIN32 - pWrapperTable->m_CompositeMaterials_GetCount = (PLib3MFCompositeMaterials_GetCountPtr) dlsym(hLibrary, "lib3mf_compositematerials_getcount"); + pWrapperTable->m_ToolpathProfile_GetParameterBoolValue = (PLib3MFToolpathProfile_GetParameterBoolValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameterboolvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterials_GetCount == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterBoolValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs = (PLib3MFCompositeMaterials_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getallpropertyids"); + pWrapperTable->m_ToolpathProfile_GetParameterBoolValueDef = (PLib3MFToolpathProfile_GetParameterBoolValueDefPtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameterboolvaluedef"); #else // _WIN32 - pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs = (PLib3MFCompositeMaterials_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_compositematerials_getallpropertyids"); + pWrapperTable->m_ToolpathProfile_GetParameterBoolValueDef = (PLib3MFToolpathProfile_GetParameterBoolValueDefPtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameterboolvaluedef"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterBoolValueDef == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup = (PLib3MFCompositeMaterials_GetBaseMaterialGroupPtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getbasematerialgroup"); + pWrapperTable->m_ToolpathProfile_SetName = (PLib3MFToolpathProfile_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_setname"); #else // _WIN32 - pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup = (PLib3MFCompositeMaterials_GetBaseMaterialGroupPtr) dlsym(hLibrary, "lib3mf_compositematerials_getbasematerialgroup"); + pWrapperTable->m_ToolpathProfile_SetName = (PLib3MFToolpathProfile_SetNamePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_setname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup == NULL) + if (pWrapperTable->m_ToolpathProfile_SetName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterials_AddComposite = (PLib3MFCompositeMaterials_AddCompositePtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_addcomposite"); + pWrapperTable->m_ToolpathProfile_SetParameterValue = (PLib3MFToolpathProfile_SetParameterValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_setparametervalue"); #else // _WIN32 - pWrapperTable->m_CompositeMaterials_AddComposite = (PLib3MFCompositeMaterials_AddCompositePtr) dlsym(hLibrary, "lib3mf_compositematerials_addcomposite"); + pWrapperTable->m_ToolpathProfile_SetParameterValue = (PLib3MFToolpathProfile_SetParameterValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_setparametervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterials_AddComposite == NULL) + if (pWrapperTable->m_ToolpathProfile_SetParameterValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterials_RemoveComposite = (PLib3MFCompositeMaterials_RemoveCompositePtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_removecomposite"); + pWrapperTable->m_ToolpathProfile_SetParameterDoubleValue = (PLib3MFToolpathProfile_SetParameterDoubleValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_setparameterdoublevalue"); #else // _WIN32 - pWrapperTable->m_CompositeMaterials_RemoveComposite = (PLib3MFCompositeMaterials_RemoveCompositePtr) dlsym(hLibrary, "lib3mf_compositematerials_removecomposite"); + pWrapperTable->m_ToolpathProfile_SetParameterDoubleValue = (PLib3MFToolpathProfile_SetParameterDoubleValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_setparameterdoublevalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterials_RemoveComposite == NULL) + if (pWrapperTable->m_ToolpathProfile_SetParameterDoubleValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterials_GetComposite = (PLib3MFCompositeMaterials_GetCompositePtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getcomposite"); + pWrapperTable->m_ToolpathProfile_SetParameterIntegerValue = (PLib3MFToolpathProfile_SetParameterIntegerValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_setparameterintegervalue"); #else // _WIN32 - pWrapperTable->m_CompositeMaterials_GetComposite = (PLib3MFCompositeMaterials_GetCompositePtr) dlsym(hLibrary, "lib3mf_compositematerials_getcomposite"); + pWrapperTable->m_ToolpathProfile_SetParameterIntegerValue = (PLib3MFToolpathProfile_SetParameterIntegerValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_setparameterintegervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterials_GetComposite == NULL) + if (pWrapperTable->m_ToolpathProfile_SetParameterIntegerValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetCount = (PLib3MFMultiPropertyGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getcount"); + pWrapperTable->m_ToolpathProfile_SetParameterBoolValue = (PLib3MFToolpathProfile_SetParameterBoolValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_setparameterboolvalue"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetCount = (PLib3MFMultiPropertyGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getcount"); + pWrapperTable->m_ToolpathProfile_SetParameterBoolValue = (PLib3MFToolpathProfile_SetParameterBoolValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_setparameterboolvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_GetCount == NULL) + if (pWrapperTable->m_ToolpathProfile_SetParameterBoolValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs = (PLib3MFMultiPropertyGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getallpropertyids"); + pWrapperTable->m_ToolpathLayerReader_GetLayerDataUUID = (PLib3MFToolpathLayerReader_GetLayerDataUUIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getlayerdatauuid"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs = (PLib3MFMultiPropertyGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getallpropertyids"); + pWrapperTable->m_ToolpathLayerReader_GetLayerDataUUID = (PLib3MFToolpathLayerReader_GetLayerDataUUIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getlayerdatauuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetLayerDataUUID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_AddMultiProperty = (PLib3MFMultiPropertyGroup_AddMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_addmultiproperty"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentCount = (PLib3MFToolpathLayerReader_GetSegmentCountPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentcount"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_AddMultiProperty = (PLib3MFMultiPropertyGroup_AddMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_addmultiproperty"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentCount = (PLib3MFToolpathLayerReader_GetSegmentCountPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_AddMultiProperty == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_SetMultiProperty = (PLib3MFMultiPropertyGroup_SetMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_setmultiproperty"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentInfo = (PLib3MFToolpathLayerReader_GetSegmentInfoPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentinfo"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_SetMultiProperty = (PLib3MFMultiPropertyGroup_SetMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_setmultiproperty"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentInfo = (PLib3MFToolpathLayerReader_GetSegmentInfoPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentinfo"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_SetMultiProperty == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentInfo == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetMultiProperty = (PLib3MFMultiPropertyGroup_GetMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getmultiproperty"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentProfile = (PLib3MFToolpathLayerReader_GetSegmentProfilePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentprofile"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetMultiProperty = (PLib3MFMultiPropertyGroup_GetMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getmultiproperty"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentProfile = (PLib3MFToolpathLayerReader_GetSegmentProfilePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentprofile"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_GetMultiProperty == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentProfile == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty = (PLib3MFMultiPropertyGroup_RemoveMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_removemultiproperty"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentProfileUUID = (PLib3MFToolpathLayerReader_GetSegmentProfileUUIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentprofileuuid"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty = (PLib3MFMultiPropertyGroup_RemoveMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_removemultiproperty"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentProfileUUID = (PLib3MFToolpathLayerReader_GetSegmentProfileUUIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentprofileuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentProfileUUID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetLayerCount = (PLib3MFMultiPropertyGroup_GetLayerCountPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getlayercount"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentPart = (PLib3MFToolpathLayerReader_GetSegmentPartPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpart"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetLayerCount = (PLib3MFMultiPropertyGroup_GetLayerCountPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getlayercount"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentPart = (PLib3MFToolpathLayerReader_GetSegmentPartPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpart"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_GetLayerCount == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentPart == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_AddLayer = (PLib3MFMultiPropertyGroup_AddLayerPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_addlayer"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentPartUUID = (PLib3MFToolpathLayerReader_GetSegmentPartUUIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpartuuid"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_AddLayer = (PLib3MFMultiPropertyGroup_AddLayerPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_addlayer"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentPartUUID = (PLib3MFToolpathLayerReader_GetSegmentPartUUIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpartuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_AddLayer == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentPartUUID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetLayer = (PLib3MFMultiPropertyGroup_GetLayerPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getlayer"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentLocalPartID = (PLib3MFToolpathLayerReader_GetSegmentLocalPartIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentlocalpartid"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetLayer = (PLib3MFMultiPropertyGroup_GetLayerPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getlayer"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentLocalPartID = (PLib3MFToolpathLayerReader_GetSegmentLocalPartIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentlocalpartid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_GetLayer == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentLocalPartID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_RemoveLayer = (PLib3MFMultiPropertyGroup_RemoveLayerPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_removelayer"); + pWrapperTable->m_ToolpathLayerReader_GetPartUUIDByLocalPartID = (PLib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getpartuuidbylocalpartid"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_RemoveLayer = (PLib3MFMultiPropertyGroup_RemoveLayerPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_removelayer"); + pWrapperTable->m_ToolpathLayerReader_GetPartUUIDByLocalPartID = (PLib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getpartuuidbylocalpartid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_RemoveLayer == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetPartUUIDByLocalPartID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_GetPath = (PLib3MFAttachment_GetPathPtr) GetProcAddress(hLibrary, "lib3mf_attachment_getpath"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentPointData = (PLib3MFToolpathLayerReader_GetSegmentPointDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpointdata"); #else // _WIN32 - pWrapperTable->m_Attachment_GetPath = (PLib3MFAttachment_GetPathPtr) dlsym(hLibrary, "lib3mf_attachment_getpath"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentPointData = (PLib3MFToolpathLayerReader_GetSegmentPointDataPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpointdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_GetPath == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentPointData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_SetPath = (PLib3MFAttachment_SetPathPtr) GetProcAddress(hLibrary, "lib3mf_attachment_setpath"); + pWrapperTable->m_ToolpathLayerReader_FindAttributeInfoByName = (PLib3MFToolpathLayerReader_FindAttributeInfoByNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_findattributeinfobyname"); #else // _WIN32 - pWrapperTable->m_Attachment_SetPath = (PLib3MFAttachment_SetPathPtr) dlsym(hLibrary, "lib3mf_attachment_setpath"); + pWrapperTable->m_ToolpathLayerReader_FindAttributeInfoByName = (PLib3MFToolpathLayerReader_FindAttributeInfoByNamePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_findattributeinfobyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_SetPath == NULL) + if (pWrapperTable->m_ToolpathLayerReader_FindAttributeInfoByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_PackagePart = (PLib3MFAttachment_PackagePartPtr) GetProcAddress(hLibrary, "lib3mf_attachment_packagepart"); + pWrapperTable->m_ToolpathLayerReader_FindAttributeIDByName = (PLib3MFToolpathLayerReader_FindAttributeIDByNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_findattributeidbyname"); #else // _WIN32 - pWrapperTable->m_Attachment_PackagePart = (PLib3MFAttachment_PackagePartPtr) dlsym(hLibrary, "lib3mf_attachment_packagepart"); + pWrapperTable->m_ToolpathLayerReader_FindAttributeIDByName = (PLib3MFToolpathLayerReader_FindAttributeIDByNamePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_findattributeidbyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_PackagePart == NULL) + if (pWrapperTable->m_ToolpathLayerReader_FindAttributeIDByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_GetRelationShipType = (PLib3MFAttachment_GetRelationShipTypePtr) GetProcAddress(hLibrary, "lib3mf_attachment_getrelationshiptype"); + pWrapperTable->m_ToolpathLayerReader_FindAttributeValueByName = (PLib3MFToolpathLayerReader_FindAttributeValueByNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_findattributevaluebyname"); #else // _WIN32 - pWrapperTable->m_Attachment_GetRelationShipType = (PLib3MFAttachment_GetRelationShipTypePtr) dlsym(hLibrary, "lib3mf_attachment_getrelationshiptype"); + pWrapperTable->m_ToolpathLayerReader_FindAttributeValueByName = (PLib3MFToolpathLayerReader_FindAttributeValueByNamePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_findattributevaluebyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_GetRelationShipType == NULL) + if (pWrapperTable->m_ToolpathLayerReader_FindAttributeValueByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_SetRelationShipType = (PLib3MFAttachment_SetRelationShipTypePtr) GetProcAddress(hLibrary, "lib3mf_attachment_setrelationshiptype"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByID = (PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentintegerattributebyid"); #else // _WIN32 - pWrapperTable->m_Attachment_SetRelationShipType = (PLib3MFAttachment_SetRelationShipTypePtr) dlsym(hLibrary, "lib3mf_attachment_setrelationshiptype"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByID = (PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentintegerattributebyid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_SetRelationShipType == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_WriteToFile = (PLib3MFAttachment_WriteToFilePtr) GetProcAddress(hLibrary, "lib3mf_attachment_writetofile"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByName = (PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentintegerattributebyname"); #else // _WIN32 - pWrapperTable->m_Attachment_WriteToFile = (PLib3MFAttachment_WriteToFilePtr) dlsym(hLibrary, "lib3mf_attachment_writetofile"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByName = (PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByNamePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentintegerattributebyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_WriteToFile == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_ReadFromFile = (PLib3MFAttachment_ReadFromFilePtr) GetProcAddress(hLibrary, "lib3mf_attachment_readfromfile"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByID = (PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid"); #else // _WIN32 - pWrapperTable->m_Attachment_ReadFromFile = (PLib3MFAttachment_ReadFromFilePtr) dlsym(hLibrary, "lib3mf_attachment_readfromfile"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByID = (PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_ReadFromFile == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_ReadFromCallback = (PLib3MFAttachment_ReadFromCallbackPtr) GetProcAddress(hLibrary, "lib3mf_attachment_readfromcallback"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByName = (PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname"); #else // _WIN32 - pWrapperTable->m_Attachment_ReadFromCallback = (PLib3MFAttachment_ReadFromCallbackPtr) dlsym(hLibrary, "lib3mf_attachment_readfromcallback"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByName = (PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByNamePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_ReadFromCallback == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_GetStreamSize = (PLib3MFAttachment_GetStreamSizePtr) GetProcAddress(hLibrary, "lib3mf_attachment_getstreamsize"); + pWrapperTable->m_ToolpathLayerReader_GetCustomDataCount = (PLib3MFToolpathLayerReader_GetCustomDataCountPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getcustomdatacount"); #else // _WIN32 - pWrapperTable->m_Attachment_GetStreamSize = (PLib3MFAttachment_GetStreamSizePtr) dlsym(hLibrary, "lib3mf_attachment_getstreamsize"); + pWrapperTable->m_ToolpathLayerReader_GetCustomDataCount = (PLib3MFToolpathLayerReader_GetCustomDataCountPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getcustomdatacount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_GetStreamSize == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetCustomDataCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_WriteToBuffer = (PLib3MFAttachment_WriteToBufferPtr) GetProcAddress(hLibrary, "lib3mf_attachment_writetobuffer"); + pWrapperTable->m_ToolpathLayerReader_GetCustomData = (PLib3MFToolpathLayerReader_GetCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getcustomdata"); #else // _WIN32 - pWrapperTable->m_Attachment_WriteToBuffer = (PLib3MFAttachment_WriteToBufferPtr) dlsym(hLibrary, "lib3mf_attachment_writetobuffer"); + pWrapperTable->m_ToolpathLayerReader_GetCustomData = (PLib3MFToolpathLayerReader_GetCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getcustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_WriteToBuffer == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetCustomData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_ReadFromBuffer = (PLib3MFAttachment_ReadFromBufferPtr) GetProcAddress(hLibrary, "lib3mf_attachment_readfrombuffer"); + pWrapperTable->m_ToolpathLayerReader_GetCustomDataName = (PLib3MFToolpathLayerReader_GetCustomDataNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getcustomdataname"); #else // _WIN32 - pWrapperTable->m_Attachment_ReadFromBuffer = (PLib3MFAttachment_ReadFromBufferPtr) dlsym(hLibrary, "lib3mf_attachment_readfrombuffer"); + pWrapperTable->m_ToolpathLayerReader_GetCustomDataName = (PLib3MFToolpathLayerReader_GetCustomDataNamePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getcustomdataname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_ReadFromBuffer == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetCustomDataName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_GetAttachment = (PLib3MFTexture2D_GetAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_getattachment"); + pWrapperTable->m_ToolpathLayerData_GetLayerDataUUID = (PLib3MFToolpathLayerData_GetLayerDataUUIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_getlayerdatauuid"); #else // _WIN32 - pWrapperTable->m_Texture2D_GetAttachment = (PLib3MFTexture2D_GetAttachmentPtr) dlsym(hLibrary, "lib3mf_texture2d_getattachment"); + pWrapperTable->m_ToolpathLayerData_GetLayerDataUUID = (PLib3MFToolpathLayerData_GetLayerDataUUIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_getlayerdatauuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_GetAttachment == NULL) + if (pWrapperTable->m_ToolpathLayerData_GetLayerDataUUID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_SetAttachment = (PLib3MFTexture2D_SetAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_setattachment"); + pWrapperTable->m_ToolpathLayerData_RegisterProfile = (PLib3MFToolpathLayerData_RegisterProfilePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_registerprofile"); #else // _WIN32 - pWrapperTable->m_Texture2D_SetAttachment = (PLib3MFTexture2D_SetAttachmentPtr) dlsym(hLibrary, "lib3mf_texture2d_setattachment"); + pWrapperTable->m_ToolpathLayerData_RegisterProfile = (PLib3MFToolpathLayerData_RegisterProfilePtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_registerprofile"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_SetAttachment == NULL) + if (pWrapperTable->m_ToolpathLayerData_RegisterProfile == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_GetContentType = (PLib3MFTexture2D_GetContentTypePtr) GetProcAddress(hLibrary, "lib3mf_texture2d_getcontenttype"); + pWrapperTable->m_ToolpathLayerData_RegisterBuildItem = (PLib3MFToolpathLayerData_RegisterBuildItemPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_registerbuilditem"); #else // _WIN32 - pWrapperTable->m_Texture2D_GetContentType = (PLib3MFTexture2D_GetContentTypePtr) dlsym(hLibrary, "lib3mf_texture2d_getcontenttype"); + pWrapperTable->m_ToolpathLayerData_RegisterBuildItem = (PLib3MFToolpathLayerData_RegisterBuildItemPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_registerbuilditem"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_GetContentType == NULL) + if (pWrapperTable->m_ToolpathLayerData_RegisterBuildItem == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_SetContentType = (PLib3MFTexture2D_SetContentTypePtr) GetProcAddress(hLibrary, "lib3mf_texture2d_setcontenttype"); + pWrapperTable->m_ToolpathLayerData_SetSegmentAttribute = (PLib3MFToolpathLayerData_SetSegmentAttributePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_setsegmentattribute"); #else // _WIN32 - pWrapperTable->m_Texture2D_SetContentType = (PLib3MFTexture2D_SetContentTypePtr) dlsym(hLibrary, "lib3mf_texture2d_setcontenttype"); + pWrapperTable->m_ToolpathLayerData_SetSegmentAttribute = (PLib3MFToolpathLayerData_SetSegmentAttributePtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_setsegmentattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_SetContentType == NULL) + if (pWrapperTable->m_ToolpathLayerData_SetSegmentAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_GetTileStyleUV = (PLib3MFTexture2D_GetTileStyleUVPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_gettilestyleuv"); + pWrapperTable->m_ToolpathLayerData_ClearSegmentAttributes = (PLib3MFToolpathLayerData_ClearSegmentAttributesPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_clearsegmentattributes"); #else // _WIN32 - pWrapperTable->m_Texture2D_GetTileStyleUV = (PLib3MFTexture2D_GetTileStyleUVPtr) dlsym(hLibrary, "lib3mf_texture2d_gettilestyleuv"); + pWrapperTable->m_ToolpathLayerData_ClearSegmentAttributes = (PLib3MFToolpathLayerData_ClearSegmentAttributesPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_clearsegmentattributes"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_GetTileStyleUV == NULL) + if (pWrapperTable->m_ToolpathLayerData_ClearSegmentAttributes == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_SetTileStyleUV = (PLib3MFTexture2D_SetTileStyleUVPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_settilestyleuv"); + pWrapperTable->m_ToolpathLayerData_WriteHatchData = (PLib3MFToolpathLayerData_WriteHatchDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_writehatchdata"); #else // _WIN32 - pWrapperTable->m_Texture2D_SetTileStyleUV = (PLib3MFTexture2D_SetTileStyleUVPtr) dlsym(hLibrary, "lib3mf_texture2d_settilestyleuv"); + pWrapperTable->m_ToolpathLayerData_WriteHatchData = (PLib3MFToolpathLayerData_WriteHatchDataPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_writehatchdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_SetTileStyleUV == NULL) + if (pWrapperTable->m_ToolpathLayerData_WriteHatchData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_GetFilter = (PLib3MFTexture2D_GetFilterPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_getfilter"); + pWrapperTable->m_ToolpathLayerData_WriteLoop = (PLib3MFToolpathLayerData_WriteLoopPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_writeloop"); #else // _WIN32 - pWrapperTable->m_Texture2D_GetFilter = (PLib3MFTexture2D_GetFilterPtr) dlsym(hLibrary, "lib3mf_texture2d_getfilter"); + pWrapperTable->m_ToolpathLayerData_WriteLoop = (PLib3MFToolpathLayerData_WriteLoopPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_writeloop"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_GetFilter == NULL) + if (pWrapperTable->m_ToolpathLayerData_WriteLoop == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_SetFilter = (PLib3MFTexture2D_SetFilterPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_setfilter"); + pWrapperTable->m_ToolpathLayerData_WritePolyline = (PLib3MFToolpathLayerData_WritePolylinePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_writepolyline"); #else // _WIN32 - pWrapperTable->m_Texture2D_SetFilter = (PLib3MFTexture2D_SetFilterPtr) dlsym(hLibrary, "lib3mf_texture2d_setfilter"); + pWrapperTable->m_ToolpathLayerData_WritePolyline = (PLib3MFToolpathLayerData_WritePolylinePtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_writepolyline"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_SetFilter == NULL) + if (pWrapperTable->m_ToolpathLayerData_WritePolyline == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetObjectResource = (PLib3MFBuildItem_GetObjectResourcePtr) GetProcAddress(hLibrary, "lib3mf_builditem_getobjectresource"); + pWrapperTable->m_ToolpathLayerData_AddCustomData = (PLib3MFToolpathLayerData_AddCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_addcustomdata"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetObjectResource = (PLib3MFBuildItem_GetObjectResourcePtr) dlsym(hLibrary, "lib3mf_builditem_getobjectresource"); + pWrapperTable->m_ToolpathLayerData_AddCustomData = (PLib3MFToolpathLayerData_AddCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_addcustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetObjectResource == NULL) + if (pWrapperTable->m_ToolpathLayerData_AddCustomData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetUUID = (PLib3MFBuildItem_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getuuid"); + pWrapperTable->m_ToolpathLayerData_Finish = (PLib3MFToolpathLayerData_FinishPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_finish"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetUUID = (PLib3MFBuildItem_GetUUIDPtr) dlsym(hLibrary, "lib3mf_builditem_getuuid"); + pWrapperTable->m_ToolpathLayerData_Finish = (PLib3MFToolpathLayerData_FinishPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_finish"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetUUID == NULL) + if (pWrapperTable->m_ToolpathLayerData_Finish == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_SetUUID = (PLib3MFBuildItem_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_builditem_setuuid"); + pWrapperTable->m_Toolpath_GetUnits = (PLib3MFToolpath_GetUnitsPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getunits"); #else // _WIN32 - pWrapperTable->m_BuildItem_SetUUID = (PLib3MFBuildItem_SetUUIDPtr) dlsym(hLibrary, "lib3mf_builditem_setuuid"); + pWrapperTable->m_Toolpath_GetUnits = (PLib3MFToolpath_GetUnitsPtr) dlsym(hLibrary, "lib3mf_toolpath_getunits"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_SetUUID == NULL) + if (pWrapperTable->m_Toolpath_GetUnits == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetObjectResourceID = (PLib3MFBuildItem_GetObjectResourceIDPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getobjectresourceid"); + pWrapperTable->m_Toolpath_GetLayerCount = (PLib3MFToolpath_GetLayerCountPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getlayercount"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetObjectResourceID = (PLib3MFBuildItem_GetObjectResourceIDPtr) dlsym(hLibrary, "lib3mf_builditem_getobjectresourceid"); + pWrapperTable->m_Toolpath_GetLayerCount = (PLib3MFToolpath_GetLayerCountPtr) dlsym(hLibrary, "lib3mf_toolpath_getlayercount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetObjectResourceID == NULL) + if (pWrapperTable->m_Toolpath_GetLayerCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_HasObjectTransform = (PLib3MFBuildItem_HasObjectTransformPtr) GetProcAddress(hLibrary, "lib3mf_builditem_hasobjecttransform"); + pWrapperTable->m_Toolpath_GetProfileCount = (PLib3MFToolpath_GetProfileCountPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getprofilecount"); #else // _WIN32 - pWrapperTable->m_BuildItem_HasObjectTransform = (PLib3MFBuildItem_HasObjectTransformPtr) dlsym(hLibrary, "lib3mf_builditem_hasobjecttransform"); + pWrapperTable->m_Toolpath_GetProfileCount = (PLib3MFToolpath_GetProfileCountPtr) dlsym(hLibrary, "lib3mf_toolpath_getprofilecount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_HasObjectTransform == NULL) + if (pWrapperTable->m_Toolpath_GetProfileCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetObjectTransform = (PLib3MFBuildItem_GetObjectTransformPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getobjecttransform"); + pWrapperTable->m_Toolpath_AddLayer = (PLib3MFToolpath_AddLayerPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_addlayer"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetObjectTransform = (PLib3MFBuildItem_GetObjectTransformPtr) dlsym(hLibrary, "lib3mf_builditem_getobjecttransform"); + pWrapperTable->m_Toolpath_AddLayer = (PLib3MFToolpath_AddLayerPtr) dlsym(hLibrary, "lib3mf_toolpath_addlayer"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetObjectTransform == NULL) + if (pWrapperTable->m_Toolpath_AddLayer == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_SetObjectTransform = (PLib3MFBuildItem_SetObjectTransformPtr) GetProcAddress(hLibrary, "lib3mf_builditem_setobjecttransform"); + pWrapperTable->m_Toolpath_GetLayerAttachment = (PLib3MFToolpath_GetLayerAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getlayerattachment"); #else // _WIN32 - pWrapperTable->m_BuildItem_SetObjectTransform = (PLib3MFBuildItem_SetObjectTransformPtr) dlsym(hLibrary, "lib3mf_builditem_setobjecttransform"); + pWrapperTable->m_Toolpath_GetLayerAttachment = (PLib3MFToolpath_GetLayerAttachmentPtr) dlsym(hLibrary, "lib3mf_toolpath_getlayerattachment"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_SetObjectTransform == NULL) + if (pWrapperTable->m_Toolpath_GetLayerAttachment == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetPartNumber = (PLib3MFBuildItem_GetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getpartnumber"); + pWrapperTable->m_Toolpath_ReadLayerData = (PLib3MFToolpath_ReadLayerDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_readlayerdata"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetPartNumber = (PLib3MFBuildItem_GetPartNumberPtr) dlsym(hLibrary, "lib3mf_builditem_getpartnumber"); + pWrapperTable->m_Toolpath_ReadLayerData = (PLib3MFToolpath_ReadLayerDataPtr) dlsym(hLibrary, "lib3mf_toolpath_readlayerdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetPartNumber == NULL) + if (pWrapperTable->m_Toolpath_ReadLayerData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_SetPartNumber = (PLib3MFBuildItem_SetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_builditem_setpartnumber"); + pWrapperTable->m_Toolpath_GetLayerPath = (PLib3MFToolpath_GetLayerPathPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getlayerpath"); #else // _WIN32 - pWrapperTable->m_BuildItem_SetPartNumber = (PLib3MFBuildItem_SetPartNumberPtr) dlsym(hLibrary, "lib3mf_builditem_setpartnumber"); + pWrapperTable->m_Toolpath_GetLayerPath = (PLib3MFToolpath_GetLayerPathPtr) dlsym(hLibrary, "lib3mf_toolpath_getlayerpath"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_SetPartNumber == NULL) + if (pWrapperTable->m_Toolpath_GetLayerPath == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetMetaDataGroup = (PLib3MFBuildItem_GetMetaDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getmetadatagroup"); + pWrapperTable->m_Toolpath_GetLayerZMax = (PLib3MFToolpath_GetLayerZMaxPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getlayerzmax"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetMetaDataGroup = (PLib3MFBuildItem_GetMetaDataGroupPtr) dlsym(hLibrary, "lib3mf_builditem_getmetadatagroup"); + pWrapperTable->m_Toolpath_GetLayerZMax = (PLib3MFToolpath_GetLayerZMaxPtr) dlsym(hLibrary, "lib3mf_toolpath_getlayerzmax"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetMetaDataGroup == NULL) + if (pWrapperTable->m_Toolpath_GetLayerZMax == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetOutbox = (PLib3MFBuildItem_GetOutboxPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getoutbox"); + pWrapperTable->m_Toolpath_GetLayerZ = (PLib3MFToolpath_GetLayerZPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getlayerz"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetOutbox = (PLib3MFBuildItem_GetOutboxPtr) dlsym(hLibrary, "lib3mf_builditem_getoutbox"); + pWrapperTable->m_Toolpath_GetLayerZ = (PLib3MFToolpath_GetLayerZPtr) dlsym(hLibrary, "lib3mf_toolpath_getlayerz"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetOutbox == NULL) + if (pWrapperTable->m_Toolpath_GetLayerZ == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItemIterator_MoveNext = (PLib3MFBuildItemIterator_MoveNextPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_movenext"); + pWrapperTable->m_Toolpath_AddProfile = (PLib3MFToolpath_AddProfilePtr) GetProcAddress(hLibrary, "lib3mf_toolpath_addprofile"); #else // _WIN32 - pWrapperTable->m_BuildItemIterator_MoveNext = (PLib3MFBuildItemIterator_MoveNextPtr) dlsym(hLibrary, "lib3mf_builditemiterator_movenext"); + pWrapperTable->m_Toolpath_AddProfile = (PLib3MFToolpath_AddProfilePtr) dlsym(hLibrary, "lib3mf_toolpath_addprofile"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItemIterator_MoveNext == NULL) + if (pWrapperTable->m_Toolpath_AddProfile == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItemIterator_MovePrevious = (PLib3MFBuildItemIterator_MovePreviousPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_moveprevious"); + pWrapperTable->m_Toolpath_GetProfile = (PLib3MFToolpath_GetProfilePtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getprofile"); #else // _WIN32 - pWrapperTable->m_BuildItemIterator_MovePrevious = (PLib3MFBuildItemIterator_MovePreviousPtr) dlsym(hLibrary, "lib3mf_builditemiterator_moveprevious"); + pWrapperTable->m_Toolpath_GetProfile = (PLib3MFToolpath_GetProfilePtr) dlsym(hLibrary, "lib3mf_toolpath_getprofile"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItemIterator_MovePrevious == NULL) + if (pWrapperTable->m_Toolpath_GetProfile == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItemIterator_GetCurrent = (PLib3MFBuildItemIterator_GetCurrentPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_getcurrent"); + pWrapperTable->m_Toolpath_GetProfileUUID = (PLib3MFToolpath_GetProfileUUIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getprofileuuid"); #else // _WIN32 - pWrapperTable->m_BuildItemIterator_GetCurrent = (PLib3MFBuildItemIterator_GetCurrentPtr) dlsym(hLibrary, "lib3mf_builditemiterator_getcurrent"); + pWrapperTable->m_Toolpath_GetProfileUUID = (PLib3MFToolpath_GetProfileUUIDPtr) dlsym(hLibrary, "lib3mf_toolpath_getprofileuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItemIterator_GetCurrent == NULL) + if (pWrapperTable->m_Toolpath_GetProfileUUID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItemIterator_Clone = (PLib3MFBuildItemIterator_ClonePtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_clone"); + pWrapperTable->m_Toolpath_GetCustomDataCount = (PLib3MFToolpath_GetCustomDataCountPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getcustomdatacount"); #else // _WIN32 - pWrapperTable->m_BuildItemIterator_Clone = (PLib3MFBuildItemIterator_ClonePtr) dlsym(hLibrary, "lib3mf_builditemiterator_clone"); + pWrapperTable->m_Toolpath_GetCustomDataCount = (PLib3MFToolpath_GetCustomDataCountPtr) dlsym(hLibrary, "lib3mf_toolpath_getcustomdatacount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItemIterator_Clone == NULL) + if (pWrapperTable->m_Toolpath_GetCustomDataCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItemIterator_Count = (PLib3MFBuildItemIterator_CountPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_count"); + pWrapperTable->m_Toolpath_GetCustomData = (PLib3MFToolpath_GetCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getcustomdata"); #else // _WIN32 - pWrapperTable->m_BuildItemIterator_Count = (PLib3MFBuildItemIterator_CountPtr) dlsym(hLibrary, "lib3mf_builditemiterator_count"); + pWrapperTable->m_Toolpath_GetCustomData = (PLib3MFToolpath_GetCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpath_getcustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItemIterator_Count == NULL) + if (pWrapperTable->m_Toolpath_GetCustomData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_SetVertices = (PLib3MFSlice_SetVerticesPtr) GetProcAddress(hLibrary, "lib3mf_slice_setvertices"); + pWrapperTable->m_Toolpath_GetCustomDataName = (PLib3MFToolpath_GetCustomDataNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getcustomdataname"); #else // _WIN32 - pWrapperTable->m_Slice_SetVertices = (PLib3MFSlice_SetVerticesPtr) dlsym(hLibrary, "lib3mf_slice_setvertices"); + pWrapperTable->m_Toolpath_GetCustomDataName = (PLib3MFToolpath_GetCustomDataNamePtr) dlsym(hLibrary, "lib3mf_toolpath_getcustomdataname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_SetVertices == NULL) + if (pWrapperTable->m_Toolpath_GetCustomDataName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_GetVertices = (PLib3MFSlice_GetVerticesPtr) GetProcAddress(hLibrary, "lib3mf_slice_getvertices"); + pWrapperTable->m_Toolpath_HasUniqueCustomData = (PLib3MFToolpath_HasUniqueCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_hasuniquecustomdata"); #else // _WIN32 - pWrapperTable->m_Slice_GetVertices = (PLib3MFSlice_GetVerticesPtr) dlsym(hLibrary, "lib3mf_slice_getvertices"); + pWrapperTable->m_Toolpath_HasUniqueCustomData = (PLib3MFToolpath_HasUniqueCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpath_hasuniquecustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_GetVertices == NULL) + if (pWrapperTable->m_Toolpath_HasUniqueCustomData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_GetVertexCount = (PLib3MFSlice_GetVertexCountPtr) GetProcAddress(hLibrary, "lib3mf_slice_getvertexcount"); + pWrapperTable->m_Toolpath_FindUniqueCustomData = (PLib3MFToolpath_FindUniqueCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_finduniquecustomdata"); #else // _WIN32 - pWrapperTable->m_Slice_GetVertexCount = (PLib3MFSlice_GetVertexCountPtr) dlsym(hLibrary, "lib3mf_slice_getvertexcount"); + pWrapperTable->m_Toolpath_FindUniqueCustomData = (PLib3MFToolpath_FindUniqueCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpath_finduniquecustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_GetVertexCount == NULL) + if (pWrapperTable->m_Toolpath_FindUniqueCustomData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_AddPolygon = (PLib3MFSlice_AddPolygonPtr) GetProcAddress(hLibrary, "lib3mf_slice_addpolygon"); + pWrapperTable->m_Toolpath_AddCustomData = (PLib3MFToolpath_AddCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_addcustomdata"); #else // _WIN32 - pWrapperTable->m_Slice_AddPolygon = (PLib3MFSlice_AddPolygonPtr) dlsym(hLibrary, "lib3mf_slice_addpolygon"); + pWrapperTable->m_Toolpath_AddCustomData = (PLib3MFToolpath_AddCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpath_addcustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_AddPolygon == NULL) + if (pWrapperTable->m_Toolpath_AddCustomData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_GetPolygonCount = (PLib3MFSlice_GetPolygonCountPtr) GetProcAddress(hLibrary, "lib3mf_slice_getpolygoncount"); + pWrapperTable->m_Toolpath_ClearCustomData = (PLib3MFToolpath_ClearCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_clearcustomdata"); #else // _WIN32 - pWrapperTable->m_Slice_GetPolygonCount = (PLib3MFSlice_GetPolygonCountPtr) dlsym(hLibrary, "lib3mf_slice_getpolygoncount"); + pWrapperTable->m_Toolpath_ClearCustomData = (PLib3MFToolpath_ClearCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpath_clearcustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_GetPolygonCount == NULL) + if (pWrapperTable->m_Toolpath_ClearCustomData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_SetPolygonIndices = (PLib3MFSlice_SetPolygonIndicesPtr) GetProcAddress(hLibrary, "lib3mf_slice_setpolygonindices"); + pWrapperTable->m_Toolpath_DeleteCustomData = (PLib3MFToolpath_DeleteCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_deletecustomdata"); #else // _WIN32 - pWrapperTable->m_Slice_SetPolygonIndices = (PLib3MFSlice_SetPolygonIndicesPtr) dlsym(hLibrary, "lib3mf_slice_setpolygonindices"); + pWrapperTable->m_Toolpath_DeleteCustomData = (PLib3MFToolpath_DeleteCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpath_deletecustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_SetPolygonIndices == NULL) + if (pWrapperTable->m_Toolpath_DeleteCustomData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_GetPolygonIndices = (PLib3MFSlice_GetPolygonIndicesPtr) GetProcAddress(hLibrary, "lib3mf_slice_getpolygonindices"); + pWrapperTable->m_Toolpath_RegisterCustomIntegerAttribute = (PLib3MFToolpath_RegisterCustomIntegerAttributePtr) GetProcAddress(hLibrary, "lib3mf_toolpath_registercustomintegerattribute"); #else // _WIN32 - pWrapperTable->m_Slice_GetPolygonIndices = (PLib3MFSlice_GetPolygonIndicesPtr) dlsym(hLibrary, "lib3mf_slice_getpolygonindices"); + pWrapperTable->m_Toolpath_RegisterCustomIntegerAttribute = (PLib3MFToolpath_RegisterCustomIntegerAttributePtr) dlsym(hLibrary, "lib3mf_toolpath_registercustomintegerattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_GetPolygonIndices == NULL) + if (pWrapperTable->m_Toolpath_RegisterCustomIntegerAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_GetPolygonIndexCount = (PLib3MFSlice_GetPolygonIndexCountPtr) GetProcAddress(hLibrary, "lib3mf_slice_getpolygonindexcount"); + pWrapperTable->m_Toolpath_RegisterCustomDoubleAttribute = (PLib3MFToolpath_RegisterCustomDoubleAttributePtr) GetProcAddress(hLibrary, "lib3mf_toolpath_registercustomdoubleattribute"); #else // _WIN32 - pWrapperTable->m_Slice_GetPolygonIndexCount = (PLib3MFSlice_GetPolygonIndexCountPtr) dlsym(hLibrary, "lib3mf_slice_getpolygonindexcount"); + pWrapperTable->m_Toolpath_RegisterCustomDoubleAttribute = (PLib3MFToolpath_RegisterCustomDoubleAttributePtr) dlsym(hLibrary, "lib3mf_toolpath_registercustomdoubleattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_GetPolygonIndexCount == NULL) + if (pWrapperTable->m_Toolpath_RegisterCustomDoubleAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_GetZTop = (PLib3MFSlice_GetZTopPtr) GetProcAddress(hLibrary, "lib3mf_slice_getztop"); + pWrapperTable->m_ToolpathIterator_GetCurrentToolpath = (PLib3MFToolpathIterator_GetCurrentToolpathPtr) GetProcAddress(hLibrary, "lib3mf_toolpathiterator_getcurrenttoolpath"); #else // _WIN32 - pWrapperTable->m_Slice_GetZTop = (PLib3MFSlice_GetZTopPtr) dlsym(hLibrary, "lib3mf_slice_getztop"); + pWrapperTable->m_ToolpathIterator_GetCurrentToolpath = (PLib3MFToolpathIterator_GetCurrentToolpathPtr) dlsym(hLibrary, "lib3mf_toolpathiterator_getcurrenttoolpath"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_GetZTop == NULL) + if (pWrapperTable->m_ToolpathIterator_GetCurrentToolpath == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 @@ -3278,6 +4593,15 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Model_GetMultiPropertyGroups == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Model_GetToolpaths = (PLib3MFModel_GetToolpathsPtr) GetProcAddress(hLibrary, "lib3mf_model_gettoolpaths"); + #else // _WIN32 + pWrapperTable->m_Model_GetToolpaths = (PLib3MFModel_GetToolpathsPtr) dlsym(hLibrary, "lib3mf_model_gettoolpaths"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetToolpaths == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Model_GetSliceStacks = (PLib3MFModel_GetSliceStacksPtr) GetProcAddress(hLibrary, "lib3mf_model_getslicestacks"); #else // _WIN32 @@ -3395,6 +4719,15 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Model_RemoveBuildItem == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Model_AddToolpath = (PLib3MFModel_AddToolpathPtr) GetProcAddress(hLibrary, "lib3mf_model_addtoolpath"); + #else // _WIN32 + pWrapperTable->m_Model_AddToolpath = (PLib3MFModel_AddToolpathPtr) dlsym(hLibrary, "lib3mf_model_addtoolpath"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_AddToolpath == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Model_GetMetaDataGroup = (PLib3MFModel_GetMetaDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_model_getmetadatagroup"); #else // _WIN32 @@ -3521,6 +4854,33 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Model_GetKeyStore == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Model_CreatePersistentSourceFromFile = (PLib3MFModel_CreatePersistentSourceFromFilePtr) GetProcAddress(hLibrary, "lib3mf_model_createpersistentsourcefromfile"); + #else // _WIN32 + pWrapperTable->m_Model_CreatePersistentSourceFromFile = (PLib3MFModel_CreatePersistentSourceFromFilePtr) dlsym(hLibrary, "lib3mf_model_createpersistentsourcefromfile"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_CreatePersistentSourceFromFile == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Model_CreatePersistentSourceFromBuffer = (PLib3MFModel_CreatePersistentSourceFromBufferPtr) GetProcAddress(hLibrary, "lib3mf_model_createpersistentsourcefrombuffer"); + #else // _WIN32 + pWrapperTable->m_Model_CreatePersistentSourceFromBuffer = (PLib3MFModel_CreatePersistentSourceFromBufferPtr) dlsym(hLibrary, "lib3mf_model_createpersistentsourcefrombuffer"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_CreatePersistentSourceFromBuffer == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Model_CreatePersistentSourceFromCallback = (PLib3MFModel_CreatePersistentSourceFromCallbackPtr) GetProcAddress(hLibrary, "lib3mf_model_createpersistentsourcefromcallback"); + #else // _WIN32 + pWrapperTable->m_Model_CreatePersistentSourceFromCallback = (PLib3MFModel_CreatePersistentSourceFromCallbackPtr) dlsym(hLibrary, "lib3mf_model_createpersistentsourcefromcallback"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_CreatePersistentSourceFromCallback == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_GetLibraryVersion = (PLib3MFGetLibraryVersionPtr) GetProcAddress(hLibrary, "lib3mf_getlibraryversion"); #else // _WIN32 diff --git a/Autogenerated/Bindings/CDynamic/lib3mf_dynamic.h b/Autogenerated/Bindings/CDynamic/lib3mf_dynamic.h index 044c754bb..6d35afa19 100644 --- a/Autogenerated/Bindings/CDynamic/lib3mf_dynamic.h +++ b/Autogenerated/Bindings/CDynamic/lib3mf_dynamic.h @@ -53,6 +53,78 @@ Interface version: 2.3.2 */ typedef Lib3MFResult (*PLib3MFBase_ClassTypeIdPtr) (Lib3MF_Base pBase, Lib3MF_uint64 * pClassTypeId); +/************************************************************************************************************************* + Class definition for BinaryStream +**************************************************************************************************************************/ + +/** +* Retrieves an binary streams package path for the binary data. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of binary streams package binary path., may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_GetBinaryPathPtr) (Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Retrieves an binary streams package path for the index data. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of binary streams package index path., may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_GetIndexPathPtr) (Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Retrieves an binary streams uuid. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of binary streams uuid, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_GetUUIDPtr) (Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); + +/** +* Sets the float compression mode to raw. All subsequent writes will adhere to this mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_DisableDiscretizedArrayCompressionPtr) (Lib3MF_BinaryStream pBinaryStream); + +/** +* Sets the compression mode to a quantized array. All subsequent writes will adhere to this mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] dUnits - Unit factor to use for quantization. +* @param[in] ePredictionType - Prediction type to use for arrays. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_EnableDiscretizedArrayCompressionPtr) (Lib3MF_BinaryStream pBinaryStream, Lib3MF_double dUnits, eLib3MFBinaryStreamPredictionType ePredictionType); + +/** +* Enables LZMA mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nLZMALevel - LZMA Level (0-9) +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_EnableLZMAPtr) (Lib3MF_BinaryStream pBinaryStream, Lib3MF_uint32 nLZMALevel); + +/** +* Disables LZMA mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_DisableLZMAPtr) (Lib3MF_BinaryStream pBinaryStream); + /************************************************************************************************************************* Class definition for Writer **************************************************************************************************************************/ @@ -186,10 +258,80 @@ typedef Lib3MFResult (*PLib3MFWriter_AddKeyWrappingCallbackPtr) (Lib3MF_Writer p */ typedef Lib3MFResult (*PLib3MFWriter_SetContentEncryptionCallbackPtr) (Lib3MF_Writer pWriter, Lib3MFContentEncryptionCallback pTheCallback, Lib3MF_pvoid pUserData); +/** +* Creates a binary stream object. Only applicable for 3MF Writers. +* +* @param[in] pWriter - Writer instance. +* @param[in] pIndexPath - Package path to write the index into +* @param[in] pBinaryPath - Package path to write raw binary data into +* @param[out] pBinaryStream - Returns a package path. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFWriter_CreateBinaryStreamPtr) (Lib3MF_Writer pWriter, const char * pIndexPath, const char * pBinaryPath, Lib3MF_BinaryStream * pBinaryStream); + +/** +* Sets a binary stream for an object. Currently supported objects are Meshes and Toolpath layers. +* +* @param[in] pWriter - Writer instance. +* @param[in] pInstance - Object instance to assign Binary stream to. +* @param[in] pBinaryStream - Binary stream object to use for this layer. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFWriter_AssignBinaryStreamPtr) (Lib3MF_Writer pWriter, Lib3MF_Base pInstance, Lib3MF_BinaryStream pBinaryStream); + +/** +* Registers a custom 3MF Namespace. Fails if Prefix is already registered. +* +* @param[in] pWriter - Writer instance. +* @param[in] pPrefix - Prefix to be used. MUST NOT be empty. MUST be alphanumeric, not starting with a number +* @param[in] pNameSpace - Namespace to be used. MUST NOT be empty. MUST be alphanumeric, not starting with a number +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFWriter_RegisterCustomNamespacePtr) (Lib3MF_Writer pWriter, const char * pPrefix, const char * pNameSpace); + +/************************************************************************************************************************* + Class definition for PersistentReaderSource +**************************************************************************************************************************/ + +/** +* Retrieves the type of source data. +* +* @param[in] pPersistentReaderSource - PersistentReaderSource instance. +* @param[out] pSourceType - Reader Source Type +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFPersistentReaderSource_GetSourceTypePtr) (Lib3MF_PersistentReaderSource pPersistentReaderSource, eLib3MFPersistentReaderSourceType * pSourceType); + +/** +* Invalidates the reader source. Every subsequent read on this data will fail. +* +* @param[in] pPersistentReaderSource - PersistentReaderSource instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFPersistentReaderSource_InvalidateSourceDataPtr) (Lib3MF_PersistentReaderSource pPersistentReaderSource); + +/** +* Checks if the source data is valid. Any read on an invalid source object will fail. +* +* @param[in] pPersistentReaderSource - PersistentReaderSource instance. +* @param[out] pDataIsValid - The source data is valid. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFPersistentReaderSource_SourceDataIsValidPtr) (Lib3MF_PersistentReaderSource pPersistentReaderSource, bool * pDataIsValid); + /************************************************************************************************************************* Class definition for Reader **************************************************************************************************************************/ +/** +* Reads a model from a persistent source object. The object will be referenced until the Model is destroyed or cleared. +* +* @param[in] pReader - Reader instance. +* @param[in] pSource - Source object to read from +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFReader_ReadFromPersistentSourcePtr) (Lib3MF_Reader pReader, Lib3MF_PersistentReaderSource pSource); + /** * Reads a model from a file. The file type is specified by the Model Reader class * @@ -433,1987 +575,3252 @@ typedef Lib3MFResult (*PLib3MFResourceIterator_ClonePtr) (Lib3MF_ResourceIterato typedef Lib3MFResult (*PLib3MFResourceIterator_CountPtr) (Lib3MF_ResourceIterator pResourceIterator, Lib3MF_uint64 * pCount); /************************************************************************************************************************* - Class definition for SliceStackIterator + Class definition for CustomXMLAttribute **************************************************************************************************************************/ /** -* Returns the SliceStack the iterator points at. +* Retrieves name of the attribute. * -* @param[in] pSliceStackIterator - SliceStackIterator instance. -* @param[out] pResource - returns the SliceStack instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the attribute., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSliceStackIterator_GetCurrentSliceStackPtr) (Lib3MF_SliceStackIterator pSliceStackIterator, Lib3MF_SliceStack * pResource); - -/************************************************************************************************************************* - Class definition for ObjectIterator -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_GetNamePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Returns the Object the iterator points at. +* Retrieves value of the attribute as string. * -* @param[in] pObjectIterator - ObjectIterator instance. -* @param[out] pResource - returns the Object instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of returns the value of the attribute., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObjectIterator_GetCurrentObjectPtr) (Lib3MF_ObjectIterator pObjectIterator, Lib3MF_Object * pResource); - -/************************************************************************************************************************* - Class definition for MeshObjectIterator -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_GetValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* Returns the MeshObject the iterator points at. +* Checks if the value is a valid integer in the given range. * -* @param[in] pMeshObjectIterator - MeshObjectIterator instance. -* @param[out] pResource - returns the MeshObject instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nMinValue - Minimum allowed value +* @param[in] nMaxValue - Maximum allowed value +* @param[out] pIsValid - returns if the value is a valid integer. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) (Lib3MF_MeshObjectIterator pMeshObjectIterator, Lib3MF_MeshObject * pResource); - -/************************************************************************************************************************* - Class definition for ComponentsObjectIterator -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_IsValidIntegerPtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nMinValue, Lib3MF_int64 nMaxValue, bool * pIsValid); /** -* Returns the ComponentsObject the iterator points at. +* Returns the value as integer. Fails if the value is not a valid integer in the given range. * -* @param[in] pComponentsObjectIterator - ComponentsObjectIterator instance. -* @param[out] pResource - returns the ComponentsObject instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nMinValue - Minimum allowed value +* @param[in] nMaxValue - Maximum allowed value +* @param[out] pValue - returns the value. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) (Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource); - -/************************************************************************************************************************* - Class definition for Texture2DIterator -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_GetIntegerValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nMinValue, Lib3MF_int64 nMaxValue, Lib3MF_int64 * pValue); /** -* Returns the Texture2D the iterator points at. +* Checks if the value is a valid double in the given range. * -* @param[in] pTexture2DIterator - Texture2DIterator instance. -* @param[out] pResource - returns the Texture2D instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dMinValue - Minimum allowed value +* @param[in] dMaxValue - Maximum allowed value +* @param[out] pIsValid - returns if the value is a valid double. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) (Lib3MF_Texture2DIterator pTexture2DIterator, Lib3MF_Texture2D * pResource); +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_IsValidDoublePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, bool * pIsValid); -/************************************************************************************************************************* - Class definition for BaseMaterialGroupIterator -**************************************************************************************************************************/ +/** +* Returns the value as double. Fails if the value is not a valid double in the given range. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dMinValue - Minimum allowed value +* @param[in] dMaxValue - Maximum allowed value +* @param[out] pValue - returns the value . +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_GetDoubleValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, Lib3MF_double * pValue); /** -* Returns the MaterialGroup the iterator points at. +* Checks if the value is a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. * -* @param[in] pBaseMaterialGroupIterator - BaseMaterialGroupIterator instance. -* @param[out] pResource - returns the BaseMaterialGroup instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[out] pIsValid - returns if the value is a valid bool. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr) (Lib3MF_BaseMaterialGroupIterator pBaseMaterialGroupIterator, Lib3MF_BaseMaterialGroup * pResource); +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_IsValidBoolPtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, bool * pIsValid); -/************************************************************************************************************************* - Class definition for ColorGroupIterator -**************************************************************************************************************************/ +/** +* Returns the value as bool. Fails if the value is not a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dMinValue - Minimum allowed value +* @param[in] dMaxValue - Maximum allowed value +* @param[out] pValue - returns the value . +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_GetBoolValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, bool * pValue); /** -* Returns the ColorGroup the iterator points at. +* Sets the value of the attribute as string. * -* @param[in] pColorGroupIterator - ColorGroupIterator instance. -* @param[out] pResource - returns the ColorGroup instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] pValue - new value of the attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroupIterator_GetCurrentColorGroupPtr) (Lib3MF_ColorGroupIterator pColorGroupIterator, Lib3MF_ColorGroup * pResource); +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_SetValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const char * pValue); -/************************************************************************************************************************* - Class definition for Texture2DGroupIterator -**************************************************************************************************************************/ +/** +* Sets the value of the attribute as integer. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nValue - new value of the attribute. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_SetIntegerValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nValue); /** -* Returns the Texture2DGroup the iterator points at. +* Sets the value of the attribute as double. * -* @param[in] pTexture2DGroupIterator - Texture2DGroupIterator instance. -* @param[out] pResource - returns the Texture2DGroup instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dValue - new value of the attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupPtr) (Lib3MF_Texture2DGroupIterator pTexture2DGroupIterator, Lib3MF_Texture2DGroup * pResource); +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_SetDoubleValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dValue); -/************************************************************************************************************************* - Class definition for CompositeMaterialsIterator -**************************************************************************************************************************/ +/** +* Sets the value of the attribute as bool. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] bValue - new value of the attribute. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_SetBoolValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, bool bValue); /** -* Returns the CompositeMaterials the iterator points at. +* Removes the attribute from its parent node. All subsequent calls to the class will fail. * -* @param[in] pCompositeMaterialsIterator - CompositeMaterialsIterator instance. -* @param[out] pResource - returns the CompositeMaterials instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsPtr) (Lib3MF_CompositeMaterialsIterator pCompositeMaterialsIterator, Lib3MF_CompositeMaterials * pResource); +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_RemovePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute); /************************************************************************************************************************* - Class definition for MultiPropertyGroupIterator + Class definition for CustomXMLNode **************************************************************************************************************************/ /** -* Returns the MultiPropertyGroup the iterator points at. +* Retrieves name of the node. * -* @param[in] pMultiPropertyGroupIterator - MultiPropertyGroupIterator instance. -* @param[out] pResource - returns the MultiPropertyGroup instance. +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the node., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupPtr) (Lib3MF_MultiPropertyGroupIterator pMultiPropertyGroupIterator, Lib3MF_MultiPropertyGroup * pResource); - -/************************************************************************************************************************* - Class definition for MetaData -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLNode_GetNamePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* returns the namespace URL of the metadata +* Retrieves namespace of the node. * -* @param[in] pMetaData - MetaData instance. +* @param[in] pCustomXMLNode - CustomXMLNode instance. * @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) * @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameSpaceBuffer - buffer of the namespace URL of the metadata, may be NULL +* @param[out] pNameSpaceBuffer - buffer of returns the namespace of the node., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_GetNameSpacePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_GetNameSpacePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* sets a new namespace URL of the metadata +* Returns number of attributes. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pNameSpace - the new namespace URL of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[out] pCount - returns the number of attributes. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_SetNameSpacePtr) (Lib3MF_MetaData pMetaData, const char * pNameSpace); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_GetAttributeCountPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 * pCount); /** -* returns the name of a metadata +* Returns attribute instance. Fails if Index is out of range. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of the name of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] nIndex - Index of the attribute to return (0-based). +* @param[out] pAttributeInstance - XML Document attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_GetNamePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_GetAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 nIndex, Lib3MF_CustomXMLAttribute * pAttributeInstance); /** -* sets a new name of a metadata +* Returns if attribute of a specific name exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pName - the new name of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[out] pAttributeExists - Returns if the attribute exists. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_SetNamePtr) (Lib3MF_MetaData pMetaData, const char * pName); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_HasAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pAttributeExists); /** -* returns the (namespace+name) of a metadata +* Returns attribute instance of a specific name. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nKeyBufferSize - size of the buffer (including trailing 0) -* @param[out] pKeyNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pKeyBuffer - buffer of the key (namespace+name) of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] bMustExist - If true, the call fails if attribute does not exist. If falls, the call will return null if the attribute does not exist. +* @param[out] pAttributeInstance - XML Document attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_GetKeyPtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nKeyBufferSize, Lib3MF_uint32* pKeyNeededChars, char * pKeyBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_FindAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bMustExist, Lib3MF_CustomXMLAttribute * pAttributeInstance); /** -* returns, whether a metadata must be preserved +* Removes the attribute with a specific name. Does nothing if attribute does not exist. * -* @param[in] pMetaData - MetaData instance. -* @param[out] pMustPreserve - returns, whether a metadata must be preserved +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[out] pAttributeRemoved - Returns true if an attribute was removed. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_GetMustPreservePtr) (Lib3MF_MetaData pMetaData, bool * pMustPreserve); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_RemoveAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pAttributeRemoved); /** -* sets whether a metadata must be preserved +* Removes the attribute with a specific index. Fails if index is invalid * -* @param[in] pMetaData - MetaData instance. -* @param[in] bMustPreserve - a new value whether a metadata must be preserved +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] nIndex - Index of the attribute to remove (0-based). +* @param[out] pAttributeRemoved - Returns true if an attribute was removed. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_SetMustPreservePtr) (Lib3MF_MetaData pMetaData, bool bMustPreserve); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_RemoveAttributeByIndexPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 nIndex, bool * pAttributeRemoved); /** -* returns the type of a metadata +* Adds an attribute with a specific name and string value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nTypeBufferSize - size of the buffer (including trailing 0) -* @param[out] pTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pTypeBuffer - buffer of the type of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] pValue - Value of the attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_GetTypePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nTypeBufferSize, Lib3MF_uint32* pTypeNeededChars, char * pTypeBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_AddAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, const char * pValue); /** -* sets a new type of a metadata. This must be a simple XML type +* Adds an attribute with a specific name and integer value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pType - a new type of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] nValue - Value of the attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_SetTypePtr) (Lib3MF_MetaData pMetaData, const char * pType); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_AddIntegerAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_int64 nValue); /** -* returns the value of the metadata +* Adds an attribute with a specific name and double value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nValueBufferSize - size of the buffer (including trailing 0) -* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pValueBuffer - buffer of the value of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] dValue - Value of the attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_GetValuePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_AddDoubleAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_double dValue); /** -* sets a new value of the metadata +* Adds an attribute with a specific name and bool value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pValue - a new value of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] bValue - Value of the attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_SetValuePtr) (Lib3MF_MetaData pMetaData, const char * pValue); - -/************************************************************************************************************************* - Class definition for MetaDataGroup -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLNode_AddBoolAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bValue); /** -* returns the number of metadata in this metadatagroup +* Returns all the child nodes of the XML Node. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[out] pCount - returns the number metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[out] pChildNodes - returns the list of child nodes. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaDataGroup_GetMetaDataCountPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_GetChildrenPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_CustomXMLNodes * pChildNodes); /** -* returns a metadata value within this metadatagroup +* Returns how many children of the XML Node have a specific name. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] nIndex - Index of the Metadata. -* @param[out] pMetaData - an instance of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the node. +* @param[out] pCount - returns the number children with the specified name. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaDataGroup_GetMetaDataPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex, Lib3MF_MetaData * pMetaData); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_CountChildrenByNamePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_uint64 * pCount); /** -* returns a metadata value within this metadatagroup +* Returns all the child nodes of the XML Node with a specific name. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] pNameSpace - the namespace of the metadata -* @param[in] pName - the name of the Metadata -* @param[out] pMetaData - an instance of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildNodes - returns the list of child nodes. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaDataGroup_GetMetaDataByKeyPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, Lib3MF_MetaData * pMetaData); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_GetChildrenByNamePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_CustomXMLNodes * pChildNodes); /** -* removes metadata by index from the model. +* Returns if a child with a specific name exist. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] nIndex - Index of the metadata to remove +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildExists - returns if a child with a specific name exists. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaDataGroup_RemoveMetaDataByIndexPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_HasChildPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pChildExists); /** -* removes metadata from the model. +* Returns if a child with a specific name exist once and only once. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] pTheMetaData - The metadata to remove +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildExists - returns if a child with a specific name exists once and only once. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaDataGroup_RemoveMetaDataPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_MetaData pTheMetaData); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_HasUniqueChildPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pChildExists); /** -* adds a new metadata to this metadatagroup +* Returns child with a specific name. Throws an error if name does not exist once and only once. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] pNameSpace - the namespace of the metadata -* @param[in] pName - the name of the metadata -* @param[in] pValue - the value of the metadata -* @param[in] pType - the type of the metadata -* @param[in] bMustPreserve - shuold the metadata be preserved -* @param[out] pMetaData - a new instance of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[in] bMustExist - If true, the call fails if child does not exist. If falls, the call will return null if the child does not exist. +* @param[out] pChildInstance - returns child instance or null. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaDataGroup_AddMetaDataPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, const char * pValue, const char * pType, bool bMustPreserve, Lib3MF_MetaData * pMetaData); - -/************************************************************************************************************************* - Class definition for Object -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLNode_FindChildPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bMustExist, Lib3MF_CustomXMLNode * pChildInstance); /** -* Retrieves an object's type +* Adds a new child with a specific name. * -* @param[in] pObject - Object instance. -* @param[out] pObjectType - returns object type enum. +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildInstance - returns child instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetTypePtr) (Lib3MF_Object pObject, eLib3MFObjectType * pObjectType); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_AddChildPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_CustomXMLNode * pChildInstance); /** -* Sets an object's type +* Removes a specific child. All subsequent calls to the child will fail after the call. * -* @param[in] pObject - Object instance. -* @param[in] eObjectType - object type enum. +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pChildInstance - child instance to remove. Fails if given instance is not a child of the node. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_SetTypePtr) (Lib3MF_Object pObject, eLib3MFObjectType eObjectType); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_RemoveChildPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_CustomXMLNode pChildInstance); /** -* Retrieves an object's name +* Removes all children with a specific name. Does nothing if no child with the name exists. All subsequent calls to the deleted children will fail after the call. * -* @param[in] pObject - Object instance. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of returns object name., may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the children. +* @param[out] pNumberOfDeletedChildren - Returns how many children have been deleted. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetNamePtr) (Lib3MF_Object pObject, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_RemoveChildrenWithNamePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_uint64 * pNumberOfDeletedChildren); /** -* Sets an object's name string +* Removes the node from its parent. The root node of the document can not be removed. Any subsequent call to the node fails after this. * -* @param[in] pObject - Object instance. -* @param[in] pName - new object name. +* @param[in] pCustomXMLNode - CustomXMLNode instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_SetNamePtr) (Lib3MF_Object pObject, const char * pName); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_RemovePtr) (Lib3MF_CustomXMLNode pCustomXMLNode); + +/************************************************************************************************************************* + Class definition for CustomXMLNodes +**************************************************************************************************************************/ /** -* Retrieves an object's part number +* Returns number of nodes. * -* @param[in] pObject - Object instance. -* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) -* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPartNumberBuffer - buffer of returns object part number., may be NULL +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[out] pCount - returns the number of nodes in the list. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetPartNumberPtr) (Lib3MF_Object pObject, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_GetNodeCountPtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, Lib3MF_uint64 * pCount); /** -* Sets an objects partnumber string +* Returns node instance. Fails if Index is out of range. * -* @param[in] pObject - Object instance. -* @param[in] pPartNumber - new object part number. +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] nIndex - Index of the node to return (0-based). +* @param[out] pNodeInstance - XML Node node. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_SetPartNumberPtr) (Lib3MF_Object pObject, const char * pPartNumber); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_GetNodePtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, Lib3MF_uint64 nIndex, Lib3MF_CustomXMLNode * pNodeInstance); /** -* Retrieves, if an object is a mesh object +* Returns how many nodes of the XML Node have a specific name. * -* @param[in] pObject - Object instance. -* @param[out] pIsMeshObject - returns, whether the object is a mesh object +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pCount - returns the number of nodes with the specified name. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_IsMeshObjectPtr) (Lib3MF_Object pObject, bool * pIsMeshObject); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_CountNodesByNamePtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, Lib3MF_uint64 * pCount); /** -* Retrieves, if an object is a components object +* Returns all the nodes nodes of the XML Node with a specific name. * -* @param[in] pObject - Object instance. -* @param[out] pIsComponentsObject - returns, whether the object is a components object +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pNodes - returns the list of node nodes. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_IsComponentsObjectPtr) (Lib3MF_Object pObject, bool * pIsComponentsObject); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_GetNodesByNamePtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, Lib3MF_CustomXMLNodes * pNodes); /** -* Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. +* Returns if a node with a specific name exist. * -* @param[in] pObject - Object instance. -* @param[out] pIsValid - returns whether the object is a valid object description +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pNodeExists - returns if a node with a specific name exists. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_IsValidPtr) (Lib3MF_Object pObject, bool * pIsValid); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_HasNodePtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool * pNodeExists); /** -* Use an existing attachment as thumbnail for this object +* Returns if a node with a specific name exist once and only once. * -* @param[in] pObject - Object instance. -* @param[in] pAttachment - Instance of a new or the existing thumbnailattachment object. +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pNodeExists - returns if a node with a specific name exists once and only once. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_SetAttachmentAsThumbnailPtr) (Lib3MF_Object pObject, Lib3MF_Attachment pAttachment); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_HasUniqueNodePtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool * pNodeExists); /** -* Get the attachment containing the object thumbnail. +* Returns node with a specific name. Throws an error if name does not exist once and only once. * -* @param[in] pObject - Object instance. -* @param[out] pAttachment - Instance of the thumbnailattachment object or NULL. +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[in] bMustExist - If true, the call fails if node does not exist. If falls, the call will return null if the node does not exist. +* @param[out] pNodeInstance - returns node instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetThumbnailAttachmentPtr) (Lib3MF_Object pObject, Lib3MF_Attachment * pAttachment); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_FindNodePtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool bMustExist, Lib3MF_CustomXMLNode * pNodeInstance); + +/************************************************************************************************************************* + Class definition for CustomDOMTree +**************************************************************************************************************************/ /** -* Clears the attachment. The attachment instance is not removed from the package. +* Returns the namespace identifier for the DOM Tree. * -* @param[in] pObject - Object instance. +* @param[in] pCustomDOMTree - CustomDOMTree instance. +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of returns the namespace of the DOM Tree., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_ClearThumbnailAttachmentPtr) (Lib3MF_Object pObject); +typedef Lib3MFResult (*PLib3MFCustomDOMTree_GetNameSpacePtr) (Lib3MF_CustomDOMTree pCustomDOMTree, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* Returns the outbox of a build item +* Returns root node of the tree. * -* @param[in] pObject - Object instance. -* @param[out] pOutbox - Outbox of this build item +* @param[in] pCustomDOMTree - CustomDOMTree instance. +* @param[out] pRootNode - Root node of the document. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetOutboxPtr) (Lib3MF_Object pObject, sLib3MFBox * pOutbox); +typedef Lib3MFResult (*PLib3MFCustomDOMTree_GetRootNodePtr) (Lib3MF_CustomDOMTree pCustomDOMTree, Lib3MF_CustomXMLNode * pRootNode); /** -* Retrieves an object's uuid string (see production extension specification) +* Saves the XML tree into a string. * -* @param[in] pObject - Object instance. -* @param[out] pHasUUID - flag whether the build item has a UUID -* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pUUIDBuffer - buffer of returns object uuid., may be NULL +* @param[in] pCustomDOMTree - CustomDOMTree instance. +* @param[in] nXMLStringBufferSize - size of the buffer (including trailing 0) +* @param[out] pXMLStringNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pXMLStringBuffer - buffer of String with the XML Content., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetUUIDPtr) (Lib3MF_Object pObject, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); +typedef Lib3MFResult (*PLib3MFCustomDOMTree_SaveToStringPtr) (Lib3MF_CustomDOMTree pCustomDOMTree, const Lib3MF_uint32 nXMLStringBufferSize, Lib3MF_uint32* pXMLStringNeededChars, char * pXMLStringBuffer); + +/************************************************************************************************************************* + Class definition for SliceStackIterator +**************************************************************************************************************************/ /** -* Sets a build object's uuid string (see production extension specification) +* Returns the SliceStack the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] pUUID - new object uuid string. +* @param[in] pSliceStackIterator - SliceStackIterator instance. +* @param[out] pResource - returns the SliceStack instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_SetUUIDPtr) (Lib3MF_Object pObject, const char * pUUID); +typedef Lib3MFResult (*PLib3MFSliceStackIterator_GetCurrentSliceStackPtr) (Lib3MF_SliceStackIterator pSliceStackIterator, Lib3MF_SliceStack * pResource); + +/************************************************************************************************************************* + Class definition for ObjectIterator +**************************************************************************************************************************/ /** -* Returns the metadatagroup of this object +* Returns the Object the iterator points at. * -* @param[in] pObject - Object instance. -* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this object +* @param[in] pObjectIterator - ObjectIterator instance. +* @param[out] pResource - returns the Object instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetMetaDataGroupPtr) (Lib3MF_Object pObject, Lib3MF_MetaDataGroup * pMetaDataGroup); +typedef Lib3MFResult (*PLib3MFObjectIterator_GetCurrentObjectPtr) (Lib3MF_ObjectIterator pObjectIterator, Lib3MF_Object * pResource); + +/************************************************************************************************************************* + Class definition for MeshObjectIterator +**************************************************************************************************************************/ /** -* set the meshresolution of the mesh object +* Returns the MeshObject the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] eMeshResolution - meshresolution of this object +* @param[in] pMeshObjectIterator - MeshObjectIterator instance. +* @param[out] pResource - returns the MeshObject instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_SetSlicesMeshResolutionPtr) (Lib3MF_Object pObject, eLib3MFSlicesMeshResolution eMeshResolution); +typedef Lib3MFResult (*PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) (Lib3MF_MeshObjectIterator pMeshObjectIterator, Lib3MF_MeshObject * pResource); + +/************************************************************************************************************************* + Class definition for ComponentsObjectIterator +**************************************************************************************************************************/ /** -* get the meshresolution of the mesh object +* Returns the ComponentsObject the iterator points at. * -* @param[in] pObject - Object instance. -* @param[out] pMeshResolution - meshresolution of this object +* @param[in] pComponentsObjectIterator - ComponentsObjectIterator instance. +* @param[out] pResource - returns the ComponentsObject instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetSlicesMeshResolutionPtr) (Lib3MF_Object pObject, eLib3MFSlicesMeshResolution * pMeshResolution); +typedef Lib3MFResult (*PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) (Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource); + +/************************************************************************************************************************* + Class definition for Texture2DIterator +**************************************************************************************************************************/ /** -* returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack +* Returns the Texture2D the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] bRecursive - check also all referenced objects? -* @param[out] pHasSlices - does the object have a slice stack? +* @param[in] pTexture2DIterator - Texture2DIterator instance. +* @param[out] pResource - returns the Texture2D instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_HasSlicesPtr) (Lib3MF_Object pObject, bool bRecursive, bool * pHasSlices); +typedef Lib3MFResult (*PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) (Lib3MF_Texture2DIterator pTexture2DIterator, Lib3MF_Texture2D * pResource); + +/************************************************************************************************************************* + Class definition for BaseMaterialGroupIterator +**************************************************************************************************************************/ /** -* unlinks the attached slicestack from this object. If no slice stack is attached, do noting. +* Returns the MaterialGroup the iterator points at. * -* @param[in] pObject - Object instance. +* @param[in] pBaseMaterialGroupIterator - BaseMaterialGroupIterator instance. +* @param[out] pResource - returns the BaseMaterialGroup instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_ClearSliceStackPtr) (Lib3MF_Object pObject); +typedef Lib3MFResult (*PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr) (Lib3MF_BaseMaterialGroupIterator pBaseMaterialGroupIterator, Lib3MF_BaseMaterialGroup * pResource); + +/************************************************************************************************************************* + Class definition for ColorGroupIterator +**************************************************************************************************************************/ /** -* get the Slicestack attached to the object +* Returns the ColorGroup the iterator points at. * -* @param[in] pObject - Object instance. -* @param[out] pSliceStackInstance - returns the slicestack instance +* @param[in] pColorGroupIterator - ColorGroupIterator instance. +* @param[out] pResource - returns the ColorGroup instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetSliceStackPtr) (Lib3MF_Object pObject, Lib3MF_SliceStack * pSliceStackInstance); +typedef Lib3MFResult (*PLib3MFColorGroupIterator_GetCurrentColorGroupPtr) (Lib3MF_ColorGroupIterator pColorGroupIterator, Lib3MF_ColorGroup * pResource); + +/************************************************************************************************************************* + Class definition for Texture2DGroupIterator +**************************************************************************************************************************/ /** -* assigns a slicestack to the object +* Returns the Texture2DGroup the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] pSliceStackInstance - the new slice stack of this Object +* @param[in] pTexture2DGroupIterator - Texture2DGroupIterator instance. +* @param[out] pResource - returns the Texture2DGroup instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_AssignSliceStackPtr) (Lib3MF_Object pObject, Lib3MF_SliceStack pSliceStackInstance); +typedef Lib3MFResult (*PLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupPtr) (Lib3MF_Texture2DGroupIterator pTexture2DGroupIterator, Lib3MF_Texture2DGroup * pResource); /************************************************************************************************************************* - Class definition for MeshObject + Class definition for CompositeMaterialsIterator **************************************************************************************************************************/ /** -* Returns the vertex count of a mesh object. +* Returns the CompositeMaterials the iterator points at. * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pVertexCount - filled with the vertex count. +* @param[in] pCompositeMaterialsIterator - CompositeMaterialsIterator instance. +* @param[out] pResource - returns the CompositeMaterials instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetVertexCountPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); +typedef Lib3MFResult (*PLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsPtr) (Lib3MF_CompositeMaterialsIterator pCompositeMaterialsIterator, Lib3MF_CompositeMaterials * pResource); + +/************************************************************************************************************************* + Class definition for MultiPropertyGroupIterator +**************************************************************************************************************************/ /** -* Returns the triangle count of a mesh object. +* Returns the MultiPropertyGroup the iterator points at. * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pVertexCount - filled with the triangle count. +* @param[in] pMultiPropertyGroupIterator - MultiPropertyGroupIterator instance. +* @param[out] pResource - returns the MultiPropertyGroup instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetTriangleCountPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); +typedef Lib3MFResult (*PLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupPtr) (Lib3MF_MultiPropertyGroupIterator pMultiPropertyGroupIterator, Lib3MF_MultiPropertyGroup * pResource); + +/************************************************************************************************************************* + Class definition for MetaData +**************************************************************************************************************************/ /** -* Returns the vertex count of a mesh object. +* returns the namespace URL of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) -* @param[out] pCoordinates - filled with the vertex coordinates. +* @param[in] pMetaData - MetaData instance. +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of the namespace URL of the metadata, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetVertexPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFPosition * pCoordinates); +typedef Lib3MFResult (*PLib3MFMetaData_GetNameSpacePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* Sets the coordinates of a single vertex of a mesh object +* sets a new namespace URL of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) -* @param[in] pCoordinates - contains the vertex coordinates. +* @param[in] pMetaData - MetaData instance. +* @param[in] pNameSpace - the new namespace URL of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_SetVertexPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFPosition * pCoordinates); +typedef Lib3MFResult (*PLib3MFMetaData_SetNameSpacePtr) (Lib3MF_MetaData pMetaData, const char * pNameSpace); /** -* Adds a single vertex to a mesh object +* returns the name of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] pCoordinates - contains the vertex coordinates. -* @param[out] pNewIndex - Index of the new vertex +* @param[in] pMetaData - MetaData instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of the name of the metadata, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_AddVertexPtr) (Lib3MF_MeshObject pMeshObject, const sLib3MFPosition * pCoordinates, Lib3MF_uint32 * pNewIndex); +typedef Lib3MFResult (*PLib3MFMetaData_GetNamePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Obtains all vertex positions of a mesh object +* sets a new name of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pVerticesBuffer - Position buffer of contains the vertex coordinates. +* @param[in] pMetaData - MetaData instance. +* @param[in] pName - the new name of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetVerticesPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, sLib3MFPosition * pVerticesBuffer); +typedef Lib3MFResult (*PLib3MFMetaData_SetNamePtr) (Lib3MF_MetaData pMetaData, const char * pName); /** -* Returns indices of a single triangle of a mesh object. +* returns the (namespace+name) of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[out] pIndices - filled with the triangle indices. +* @param[in] pMetaData - MetaData instance. +* @param[in] nKeyBufferSize - size of the buffer (including trailing 0) +* @param[out] pKeyNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pKeyBuffer - buffer of the key (namespace+name) of the metadata, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetTrianglePtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFTriangle * pIndices); +typedef Lib3MFResult (*PLib3MFMetaData_GetKeyPtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nKeyBufferSize, Lib3MF_uint32* pKeyNeededChars, char * pKeyBuffer); /** -* Sets the indices of a single triangle of a mesh object. +* returns, whether a metadata must be preserved * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[in] pIndices - contains the triangle indices. +* @param[in] pMetaData - MetaData instance. +* @param[out] pMustPreserve - returns, whether a metadata must be preserved * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_SetTrianglePtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFTriangle * pIndices); +typedef Lib3MFResult (*PLib3MFMetaData_GetMustPreservePtr) (Lib3MF_MetaData pMetaData, bool * pMustPreserve); /** -* Adds a single triangle to a mesh object +* sets whether a metadata must be preserved * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] pIndices - contains the triangle indices. -* @param[out] pNewIndex - Index of the new triangle +* @param[in] pMetaData - MetaData instance. +* @param[in] bMustPreserve - a new value whether a metadata must be preserved * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_AddTrianglePtr) (Lib3MF_MeshObject pMeshObject, const sLib3MFTriangle * pIndices, Lib3MF_uint32 * pNewIndex); +typedef Lib3MFResult (*PLib3MFMetaData_SetMustPreservePtr) (Lib3MF_MetaData pMetaData, bool bMustPreserve); /** -* Get all triangles of a mesh object +* returns the type of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @param[in] pMetaData - MetaData instance. +* @param[in] nTypeBufferSize - size of the buffer (including trailing 0) +* @param[out] pTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pTypeBuffer - buffer of the type of the metadata, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetTriangleIndicesPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, sLib3MFTriangle * pIndicesBuffer); +typedef Lib3MFResult (*PLib3MFMetaData_GetTypePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nTypeBufferSize, Lib3MF_uint32* pTypeNeededChars, char * pTypeBuffer); /** -* Sets the property at the object-level of the mesh object. +* sets a new type of a metadata. This must be a simple XML type * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nUniqueResourceID - the object-level Property UniqueResourceID. -* @param[in] nPropertyID - the object-level PropertyID. +* @param[in] pMetaData - MetaData instance. +* @param[in] pType - a new type of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_SetObjectLevelPropertyPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nUniqueResourceID, Lib3MF_uint32 nPropertyID); +typedef Lib3MFResult (*PLib3MFMetaData_SetTypePtr) (Lib3MF_MetaData pMetaData, const char * pType); /** -* Gets the property at the object-level of the mesh object. +* returns the value of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pUniqueResourceID - the object-level Property UniqueResourceID. -* @param[out] pPropertyID - the object-level PropertyID. -* @param[out] pHasObjectLevelProperty - Has an object-level property been specified? +* @param[in] pMetaData - MetaData instance. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of the value of the metadata, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetObjectLevelPropertyPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pUniqueResourceID, Lib3MF_uint32 * pPropertyID, bool * pHasObjectLevelProperty); +typedef Lib3MFResult (*PLib3MFMetaData_GetValuePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* Sets the properties of a single triangle of a mesh object. +* sets a new value of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[in] pProperties - contains the triangle properties. +* @param[in] pMetaData - MetaData instance. +* @param[in] pValue - a new value of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_SetTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFTriangleProperties * pProperties); +typedef Lib3MFResult (*PLib3MFMetaData_SetValuePtr) (Lib3MF_MetaData pMetaData, const char * pValue); -/** -* Gets the properties of a single triangle of a mesh object. -* -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[out] pProperty - returns the triangle properties. -* @return error code or 0 (success) -*/ -typedef Lib3MFResult (*PLib3MFMeshObject_GetTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFTriangleProperties * pProperty); +/************************************************************************************************************************* + Class definition for MetaDataGroup +**************************************************************************************************************************/ /** -* Sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. +* returns the number of metadata in this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer -* @param[in] pPropertiesArrayBuffer - TriangleProperties buffer of contains the triangle properties array. Must have trianglecount elements. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[out] pCount - returns the number metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_SetAllTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nPropertiesArrayBufferSize, const sLib3MFTriangleProperties * pPropertiesArrayBuffer); +typedef Lib3MFResult (*PLib3MFMetaDataGroup_GetMetaDataCountPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 * pCount); /** -* Gets the properties of all triangles of a mesh object. +* returns a metadata value within this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer -* @param[out] pPropertiesArrayNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertiesArrayBuffer - TriangleProperties buffer of returns the triangle properties array. Must have trianglecount elements. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] nIndex - Index of the Metadata. +* @param[out] pMetaData - an instance of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetAllTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nPropertiesArrayBufferSize, Lib3MF_uint64* pPropertiesArrayNeededCount, sLib3MFTriangleProperties * pPropertiesArrayBuffer); +typedef Lib3MFResult (*PLib3MFMetaDataGroup_GetMetaDataPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex, Lib3MF_MetaData * pMetaData); /** -* Clears all properties of this mesh object (triangle and object-level). +* returns a metadata value within this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] pNameSpace - the namespace of the metadata +* @param[in] pName - the name of the Metadata +* @param[out] pMetaData - an instance of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_ClearAllPropertiesPtr) (Lib3MF_MeshObject pMeshObject); +typedef Lib3MFResult (*PLib3MFMetaDataGroup_GetMetaDataByKeyPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, Lib3MF_MetaData * pMetaData); /** -* Set all triangles of a mesh object +* removes metadata by index from the model. * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[in] pVerticesBuffer - Position buffer of contains the positions. -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[in] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] nIndex - Index of the metadata to remove * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_SetGeometryPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nVerticesBufferSize, const sLib3MFPosition * pVerticesBuffer, Lib3MF_uint64 nIndicesBufferSize, const sLib3MFTriangle * pIndicesBuffer); +typedef Lib3MFResult (*PLib3MFMetaDataGroup_RemoveMetaDataByIndexPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex); /** -* Retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. +* removes metadata from the model. * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pIsManifoldAndOriented - returns, if the object is oriented and manifold. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] pTheMetaData - The metadata to remove * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_IsManifoldAndOrientedPtr) (Lib3MF_MeshObject pMeshObject, bool * pIsManifoldAndOriented); +typedef Lib3MFResult (*PLib3MFMetaDataGroup_RemoveMetaDataPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_MetaData pTheMetaData); /** -* Retrieves the BeamLattice within this MeshObject. +* adds a new metadata to this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pTheBeamLattice - the BeamLattice within this MeshObject +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] pNameSpace - the namespace of the metadata +* @param[in] pName - the name of the metadata +* @param[in] pValue - the value of the metadata +* @param[in] pType - the type of the metadata +* @param[in] bMustPreserve - shuold the metadata be preserved +* @param[out] pMetaData - a new instance of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_BeamLatticePtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_BeamLattice * pTheBeamLattice); +typedef Lib3MFResult (*PLib3MFMetaDataGroup_AddMetaDataPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, const char * pValue, const char * pType, bool bMustPreserve, Lib3MF_MetaData * pMetaData); /************************************************************************************************************************* - Class definition for BeamLattice + Class definition for Object **************************************************************************************************************************/ /** -* Returns the minimal length of beams for the beamlattice. +* Retrieves an object's type * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pMinLength - minimal length of beams for the beamlattice +* @param[in] pObject - Object instance. +* @param[out] pObjectType - returns object type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetMinLengthPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_double * pMinLength); +typedef Lib3MFResult (*PLib3MFObject_GetTypePtr) (Lib3MF_Object pObject, eLib3MFObjectType * pObjectType); /** -* Sets the minimal length of beams for the beamlattice. +* Sets an object's type * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] dMinLength - minimal length of beams for the beamlattice +* @param[in] pObject - Object instance. +* @param[in] eObjectType - object type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetMinLengthPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_double dMinLength); +typedef Lib3MFResult (*PLib3MFObject_SetTypePtr) (Lib3MF_Object pObject, eLib3MFObjectType eObjectType); /** -* Returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* Retrieves an object's name * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pClipMode - contains the clip mode of this mesh -* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object or an undefined value if pClipMode is MODELBEAMLATTICECLIPMODE_NONE +* @param[in] pObject - Object instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns object name., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetClippingPtr) (Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode * pClipMode, Lib3MF_uint32 * pUniqueResourceID); +typedef Lib3MFResult (*PLib3MFObject_GetNamePtr) (Lib3MF_Object pObject, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* Sets an object's name string * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] eClipMode - contains the clip mode of this mesh -* @param[in] nUniqueResourceID - the UniqueResourceID of the clipping mesh-object. This mesh-object has to be defined before setting the Clipping. +* @param[in] pObject - Object instance. +* @param[in] pName - new object name. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetClippingPtr) (Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode eClipMode, Lib3MF_uint32 nUniqueResourceID); +typedef Lib3MFResult (*PLib3MFObject_SetNamePtr) (Lib3MF_Object pObject, const char * pName); /** -* Returns the representation-mesh for the beamlattice of this mesh. +* Retrieves an object's part number * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pHasRepresentation - flag whether the beamlattice has a representation mesh. -* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object. +* @param[in] pObject - Object instance. +* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartNumberBuffer - buffer of returns object part number., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetRepresentationPtr) (Lib3MF_BeamLattice pBeamLattice, bool * pHasRepresentation, Lib3MF_uint32 * pUniqueResourceID); +typedef Lib3MFResult (*PLib3MFObject_GetPartNumberPtr) (Lib3MF_Object pObject, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); /** -* Sets the representation-mesh for the beamlattice of this mesh. +* Sets an objects partnumber string * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nUniqueResourceID - the UniqueResourceID of the representation mesh-object. This mesh-object has to be defined before setting the representation. +* @param[in] pObject - Object instance. +* @param[in] pPartNumber - new object part number. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetRepresentationPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nUniqueResourceID); +typedef Lib3MFResult (*PLib3MFObject_SetPartNumberPtr) (Lib3MF_Object pObject, const char * pPartNumber); /** -* Returns the ball mode and the default ball radius for the beamlattice of this mesh. +* Retrieves, if an object is a mesh object * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pBallMode - contains the ball mode of this mesh -* @param[out] pBallRadius - default ball radius of balls for the beamlattice +* @param[in] pObject - Object instance. +* @param[out] pIsMeshObject - returns, whether the object is a mesh object * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallOptionsPtr) (Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode * pBallMode, Lib3MF_double * pBallRadius); +typedef Lib3MFResult (*PLib3MFObject_IsMeshObjectPtr) (Lib3MF_Object pObject, bool * pIsMeshObject); /** -* Sets the ball mode and thedefault ball radius for the beamlattice. +* Retrieves, if an object is a components object * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] eBallMode - contains the ball mode of this mesh -* @param[in] dBallRadius - default ball radius of balls for the beamlattice +* @param[in] pObject - Object instance. +* @param[out] pIsComponentsObject - returns, whether the object is a components object * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetBallOptionsPtr) (Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode eBallMode, Lib3MF_double dBallRadius); +typedef Lib3MFResult (*PLib3MFObject_IsComponentsObjectPtr) (Lib3MF_Object pObject, bool * pIsComponentsObject); /** -* Returns the beam count of a mesh object. +* Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pCount - filled with the beam count. +* @param[in] pObject - Object instance. +* @param[out] pIsValid - returns whether the object is a valid object description * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamCountPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFObject_IsValidPtr) (Lib3MF_Object pObject, bool * pIsValid); /** -* Returns indices, radii and capmodes of a single beam of a mesh object. +* Use an existing attachment as thumbnail for this object * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the beam (0 to beamcount - 1). -* @param[out] pBeamInfo - filled with the beam indices, radii and capmodes. +* @param[in] pObject - Object instance. +* @param[in] pAttachment - Instance of a new or the existing thumbnailattachment object. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBeam * pBeamInfo); +typedef Lib3MFResult (*PLib3MFObject_SetAttachmentAsThumbnailPtr) (Lib3MF_Object pObject, Lib3MF_Attachment pAttachment); /** -* Adds a single beam to a mesh object. +* Get the attachment containing the object thumbnail. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] pBeamInfo - contains the node indices, radii and capmodes. -* @param[out] pIndex - filled with the new Index of the beam. +* @param[in] pObject - Object instance. +* @param[out] pAttachment - Instance of the thumbnailattachment object or NULL. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_AddBeamPtr) (Lib3MF_BeamLattice pBeamLattice, const sLib3MFBeam * pBeamInfo, Lib3MF_uint32 * pIndex); +typedef Lib3MFResult (*PLib3MFObject_GetThumbnailAttachmentPtr) (Lib3MF_Object pObject, Lib3MF_Attachment * pAttachment); /** -* Sets the indices, radii and capmodes of a single beam of a mesh object. +* Clears the attachment. The attachment instance is not removed from the package. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the beam (0 to beamcount - 1). -* @param[in] pBeamInfo - filled with the beam indices, radii and capmodes. +* @param[in] pObject - Object instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetBeamPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBeam * pBeamInfo); +typedef Lib3MFResult (*PLib3MFObject_ClearThumbnailAttachmentPtr) (Lib3MF_Object pObject); /** -* Sets all beam indices, radii and capmodes of a mesh object. +* Returns the outbox of a build item * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBeamInfoBufferSize - Number of elements in buffer -* @param[in] pBeamInfoBuffer - Beam buffer of contains information of a number of beams +* @param[in] pObject - Object instance. +* @param[out] pOutbox - Outbox of this build item * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetBeamsPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBeamInfoBufferSize, const sLib3MFBeam * pBeamInfoBuffer); +typedef Lib3MFResult (*PLib3MFObject_GetOutboxPtr) (Lib3MF_Object pObject, sLib3MFBox * pOutbox); + +/** +* Retrieves an object's uuid string (see production extension specification) +* +* @param[in] pObject - Object instance. +* @param[out] pHasUUID - flag whether the build item has a UUID +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of returns object uuid., may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_GetUUIDPtr) (Lib3MF_Object pObject, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); + +/** +* Sets a build object's uuid string (see production extension specification) +* +* @param[in] pObject - Object instance. +* @param[in] pUUID - new object uuid string. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_SetUUIDPtr) (Lib3MF_Object pObject, const char * pUUID); + +/** +* Returns the metadatagroup of this object +* +* @param[in] pObject - Object instance. +* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_GetMetaDataGroupPtr) (Lib3MF_Object pObject, Lib3MF_MetaDataGroup * pMetaDataGroup); + +/** +* set the meshresolution of the mesh object +* +* @param[in] pObject - Object instance. +* @param[in] eMeshResolution - meshresolution of this object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_SetSlicesMeshResolutionPtr) (Lib3MF_Object pObject, eLib3MFSlicesMeshResolution eMeshResolution); + +/** +* get the meshresolution of the mesh object +* +* @param[in] pObject - Object instance. +* @param[out] pMeshResolution - meshresolution of this object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_GetSlicesMeshResolutionPtr) (Lib3MF_Object pObject, eLib3MFSlicesMeshResolution * pMeshResolution); + +/** +* returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack +* +* @param[in] pObject - Object instance. +* @param[in] bRecursive - check also all referenced objects? +* @param[out] pHasSlices - does the object have a slice stack? +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_HasSlicesPtr) (Lib3MF_Object pObject, bool bRecursive, bool * pHasSlices); + +/** +* unlinks the attached slicestack from this object. If no slice stack is attached, do noting. +* +* @param[in] pObject - Object instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_ClearSliceStackPtr) (Lib3MF_Object pObject); + +/** +* get the Slicestack attached to the object +* +* @param[in] pObject - Object instance. +* @param[out] pSliceStackInstance - returns the slicestack instance +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_GetSliceStackPtr) (Lib3MF_Object pObject, Lib3MF_SliceStack * pSliceStackInstance); + +/** +* assigns a slicestack to the object +* +* @param[in] pObject - Object instance. +* @param[in] pSliceStackInstance - the new slice stack of this Object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_AssignSliceStackPtr) (Lib3MF_Object pObject, Lib3MF_SliceStack pSliceStackInstance); + +/************************************************************************************************************************* + Class definition for MeshObject +**************************************************************************************************************************/ + +/** +* Returns the vertex count of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pVertexCount - filled with the vertex count. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetVertexCountPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); + +/** +* Returns the triangle count of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pVertexCount - filled with the triangle count. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetTriangleCountPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); + +/** +* Returns the vertex count of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) +* @param[out] pCoordinates - filled with the vertex coordinates. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetVertexPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFPosition * pCoordinates); + +/** +* Sets the coordinates of a single vertex of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) +* @param[in] pCoordinates - contains the vertex coordinates. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_SetVertexPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFPosition * pCoordinates); + +/** +* Adds a single vertex to a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] pCoordinates - contains the vertex coordinates. +* @param[out] pNewIndex - Index of the new vertex +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_AddVertexPtr) (Lib3MF_MeshObject pMeshObject, const sLib3MFPosition * pCoordinates, Lib3MF_uint32 * pNewIndex); + +/** +* Obtains all vertex positions of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pVerticesBuffer - Position buffer of contains the vertex coordinates. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetVerticesPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, sLib3MFPosition * pVerticesBuffer); + +/** +* Returns indices of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[out] pIndices - filled with the triangle indices. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetTrianglePtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFTriangle * pIndices); + +/** +* Sets the indices of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[in] pIndices - contains the triangle indices. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_SetTrianglePtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFTriangle * pIndices); + +/** +* Adds a single triangle to a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] pIndices - contains the triangle indices. +* @param[out] pNewIndex - Index of the new triangle +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_AddTrianglePtr) (Lib3MF_MeshObject pMeshObject, const sLib3MFTriangle * pIndices, Lib3MF_uint32 * pNewIndex); + +/** +* Get all triangles of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetTriangleIndicesPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, sLib3MFTriangle * pIndicesBuffer); + +/** +* Sets the property at the object-level of the mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nUniqueResourceID - the object-level Property UniqueResourceID. +* @param[in] nPropertyID - the object-level PropertyID. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_SetObjectLevelPropertyPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nUniqueResourceID, Lib3MF_uint32 nPropertyID); + +/** +* Gets the property at the object-level of the mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pUniqueResourceID - the object-level Property UniqueResourceID. +* @param[out] pPropertyID - the object-level PropertyID. +* @param[out] pHasObjectLevelProperty - Has an object-level property been specified? +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetObjectLevelPropertyPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pUniqueResourceID, Lib3MF_uint32 * pPropertyID, bool * pHasObjectLevelProperty); + +/** +* Sets the properties of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[in] pProperties - contains the triangle properties. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_SetTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFTriangleProperties * pProperties); + +/** +* Gets the properties of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[out] pProperty - returns the triangle properties. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFTriangleProperties * pProperty); + +/** +* Sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer +* @param[in] pPropertiesArrayBuffer - TriangleProperties buffer of contains the triangle properties array. Must have trianglecount elements. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_SetAllTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nPropertiesArrayBufferSize, const sLib3MFTriangleProperties * pPropertiesArrayBuffer); + +/** +* Gets the properties of all triangles of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer +* @param[out] pPropertiesArrayNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertiesArrayBuffer - TriangleProperties buffer of returns the triangle properties array. Must have trianglecount elements. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetAllTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nPropertiesArrayBufferSize, Lib3MF_uint64* pPropertiesArrayNeededCount, sLib3MFTriangleProperties * pPropertiesArrayBuffer); + +/** +* Clears all properties of this mesh object (triangle and object-level). +* +* @param[in] pMeshObject - MeshObject instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_ClearAllPropertiesPtr) (Lib3MF_MeshObject pMeshObject); + +/** +* Set all triangles of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[in] pVerticesBuffer - Position buffer of contains the positions. +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[in] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_SetGeometryPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nVerticesBufferSize, const sLib3MFPosition * pVerticesBuffer, Lib3MF_uint64 nIndicesBufferSize, const sLib3MFTriangle * pIndicesBuffer); + +/** +* Retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pIsManifoldAndOriented - returns, if the object is oriented and manifold. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_IsManifoldAndOrientedPtr) (Lib3MF_MeshObject pMeshObject, bool * pIsManifoldAndOriented); + +/** +* Retrieves the BeamLattice within this MeshObject. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pTheBeamLattice - the BeamLattice within this MeshObject +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_BeamLatticePtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_BeamLattice * pTheBeamLattice); + +/************************************************************************************************************************* + Class definition for BeamLattice +**************************************************************************************************************************/ + +/** +* Returns the minimal length of beams for the beamlattice. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pMinLength - minimal length of beams for the beamlattice +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetMinLengthPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_double * pMinLength); + +/** +* Sets the minimal length of beams for the beamlattice. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] dMinLength - minimal length of beams for the beamlattice +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetMinLengthPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_double dMinLength); + +/** +* Returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pClipMode - contains the clip mode of this mesh +* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object or an undefined value if pClipMode is MODELBEAMLATTICECLIPMODE_NONE +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetClippingPtr) (Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode * pClipMode, Lib3MF_uint32 * pUniqueResourceID); + +/** +* Sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] eClipMode - contains the clip mode of this mesh +* @param[in] nUniqueResourceID - the UniqueResourceID of the clipping mesh-object. This mesh-object has to be defined before setting the Clipping. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetClippingPtr) (Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode eClipMode, Lib3MF_uint32 nUniqueResourceID); + +/** +* Returns the representation-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pHasRepresentation - flag whether the beamlattice has a representation mesh. +* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetRepresentationPtr) (Lib3MF_BeamLattice pBeamLattice, bool * pHasRepresentation, Lib3MF_uint32 * pUniqueResourceID); + +/** +* Sets the representation-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nUniqueResourceID - the UniqueResourceID of the representation mesh-object. This mesh-object has to be defined before setting the representation. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetRepresentationPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nUniqueResourceID); + +/** +* Returns the ball mode and the default ball radius for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pBallMode - contains the ball mode of this mesh +* @param[out] pBallRadius - default ball radius of balls for the beamlattice +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallOptionsPtr) (Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode * pBallMode, Lib3MF_double * pBallRadius); + +/** +* Sets the ball mode and thedefault ball radius for the beamlattice. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] eBallMode - contains the ball mode of this mesh +* @param[in] dBallRadius - default ball radius of balls for the beamlattice +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetBallOptionsPtr) (Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode eBallMode, Lib3MF_double dBallRadius); + +/** +* Returns the beam count of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pCount - filled with the beam count. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamCountPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); + +/** +* Returns indices, radii and capmodes of a single beam of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the beam (0 to beamcount - 1). +* @param[out] pBeamInfo - filled with the beam indices, radii and capmodes. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBeam * pBeamInfo); + +/** +* Adds a single beam to a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] pBeamInfo - contains the node indices, radii and capmodes. +* @param[out] pIndex - filled with the new Index of the beam. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_AddBeamPtr) (Lib3MF_BeamLattice pBeamLattice, const sLib3MFBeam * pBeamInfo, Lib3MF_uint32 * pIndex); + +/** +* Sets the indices, radii and capmodes of a single beam of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the beam (0 to beamcount - 1). +* @param[in] pBeamInfo - filled with the beam indices, radii and capmodes. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetBeamPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBeam * pBeamInfo); + +/** +* Sets all beam indices, radii and capmodes of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBeamInfoBufferSize - Number of elements in buffer +* @param[in] pBeamInfoBuffer - Beam buffer of contains information of a number of beams +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetBeamsPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBeamInfoBufferSize, const sLib3MFBeam * pBeamInfoBuffer); + +/** +* obtains all beam indices, radii and capmodes of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBeamInfoBufferSize - Number of elements in buffer +* @param[out] pBeamInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBeamInfoBuffer - Beam buffer of contains information of all beams +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamsPtr) (Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBeamInfoBufferSize, Lib3MF_uint64* pBeamInfoNeededCount, sLib3MFBeam * pBeamInfoBuffer); + +/** +* Returns the ball count of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pCount - filled with the ball count. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallCountPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); + +/** +* Returns index and radius of a single ball of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the ball (0 to ballcount - 1). +* @param[out] pBallInfo - filled with the ball node index and radius. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBall * pBallInfo); + +/** +* Adds a single ball to a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] pBallInfo - contains the node index and radius. +* @param[out] pIndex - filled with the new Index of the ball. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_AddBallPtr) (Lib3MF_BeamLattice pBeamLattice, const sLib3MFBall * pBallInfo, Lib3MF_uint32 * pIndex); + +/** +* Sets the index and radius of a single ball of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the ball (0 to ballcount - 1). +* @param[in] pBallInfo - filled with the ball node index and radius. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetBallPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBall * pBallInfo); + +/** +* Sets all ball indices and radii of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBallInfoBufferSize - Number of elements in buffer +* @param[in] pBallInfoBuffer - Ball buffer of contains information of a number of balls +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetBallsPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBallInfoBufferSize, const sLib3MFBall * pBallInfoBuffer); + +/** +* obtains all ball indices and radii of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBallInfoBufferSize - Number of elements in buffer +* @param[out] pBallInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBallInfoBuffer - Ball buffer of contains information of all balls +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallsPtr) (Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBallInfoBufferSize, Lib3MF_uint64* pBallInfoNeededCount, sLib3MFBall * pBallInfoBuffer); + +/** +* Returns the number of beamsets of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pCount - filled with the beamset count. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamSetCountPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); + +/** +* Adds an empty beamset to a mesh object +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pBeamSet - the new beamset +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_AddBeamSetPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_BeamSet * pBeamSet); + +/** +* Returns a beamset of a mesh object +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - index of the requested beamset (0 ... beamsetcount-1). +* @param[out] pBeamSet - the requested beamset +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamSetPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF_BeamSet * pBeamSet); + +/************************************************************************************************************************* + Class definition for Component +**************************************************************************************************************************/ + +/** +* Returns the Resource Instance of the component. +* +* @param[in] pComponent - Component instance. +* @param[out] pObjectResource - filled with the Resource Instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_GetObjectResourcePtr) (Lib3MF_Component pComponent, Lib3MF_Object * pObjectResource); + +/** +* Returns the UniqueResourceID of the component. +* +* @param[in] pComponent - Component instance. +* @param[out] pUniqueResourceID - returns the UniqueResourceID. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_GetObjectResourceIDPtr) (Lib3MF_Component pComponent, Lib3MF_uint32 * pUniqueResourceID); + +/** +* returns, whether a component has a UUID and, if true, the component's UUID +* +* @param[in] pComponent - Component instance. +* @param[out] pHasUUID - flag whether the component has a UUID +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_GetUUIDPtr) (Lib3MF_Component pComponent, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); + +/** +* sets the component's UUID +* +* @param[in] pComponent - Component instance. +* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_SetUUIDPtr) (Lib3MF_Component pComponent, const char * pUUID); + +/** +* Returns, if the component has a different transformation than the identity matrix +* +* @param[in] pComponent - Component instance. +* @param[out] pHasTransform - if true is returned, the transformation is not equal than the identity +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_HasTransformPtr) (Lib3MF_Component pComponent, bool * pHasTransform); + +/** +* Returns the transformation matrix of the component. +* +* @param[in] pComponent - Component instance. +* @param[out] pTransform - filled with the component transformation matrix +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_GetTransformPtr) (Lib3MF_Component pComponent, sLib3MFTransform * pTransform); + +/** +* Sets the transformation matrix of the component. +* +* @param[in] pComponent - Component instance. +* @param[in] pTransform - new transformation matrix +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_SetTransformPtr) (Lib3MF_Component pComponent, const sLib3MFTransform * pTransform); + +/************************************************************************************************************************* + Class definition for ComponentsObject +**************************************************************************************************************************/ + +/** +* Adds a new component to a components object. +* +* @param[in] pComponentsObject - ComponentsObject instance. +* @param[in] pObjectResource - object to add as component. Must not lead to circular references! +* @param[in] pTransform - optional transform matrix for the component. +* @param[out] pComponentInstance - new component instance +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponentsObject_AddComponentPtr) (Lib3MF_ComponentsObject pComponentsObject, Lib3MF_Object pObjectResource, const sLib3MFTransform * pTransform, Lib3MF_Component * pComponentInstance); + +/** +* Retrieves a component from a component object. +* +* @param[in] pComponentsObject - ComponentsObject instance. +* @param[in] nIndex - index of the component to retrieve (0 to componentcount - 1) +* @param[out] pComponentInstance - component instance +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponentsObject_GetComponentPtr) (Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 nIndex, Lib3MF_Component * pComponentInstance); + +/** +* Retrieves a component count of a component object. +* +* @param[in] pComponentsObject - ComponentsObject instance. +* @param[out] pCount - returns the component count +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponentsObject_GetComponentCountPtr) (Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 * pCount); + +/************************************************************************************************************************* + Class definition for BeamSet +**************************************************************************************************************************/ + +/** +* Sets a beamset's name string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] pName - new name of the beamset. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_SetNamePtr) (Lib3MF_BeamSet pBeamSet, const char * pName); + +/** +* Retrieves a beamset's name string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the beamset., may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_GetNamePtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); + +/** +* Sets a beamset's identifier string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] pIdentifier - new name of the beamset. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_SetIdentifierPtr) (Lib3MF_BeamSet pBeamSet, const char * pIdentifier); + +/** +* Retrieves a beamset's identifier string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nIdentifierBufferSize - size of the buffer (including trailing 0) +* @param[out] pIdentifierNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pIdentifierBuffer - buffer of returns the identifier of the beamset., may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_GetIdentifierPtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer); + +/** +* Retrieves the reference count of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[out] pCount - returns the reference count +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_GetReferenceCountPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); + +/** +* Sets the references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nReferencesBufferSize - Number of elements in buffer +* @param[in] pReferencesBuffer - uint32 buffer of the new indices of all beams in this beamset +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_SetReferencesPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nReferencesBufferSize, const Lib3MF_uint32 * pReferencesBuffer); + +/** +* Retrieves the references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nReferencesBufferSize - Number of elements in buffer +* @param[out] pReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pReferencesBuffer - uint32 buffer of retrieves the indices of all beams in this beamset +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_GetReferencesPtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nReferencesBufferSize, Lib3MF_uint64* pReferencesNeededCount, Lib3MF_uint32 * pReferencesBuffer); + +/** +* Retrieves the ball reference count of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[out] pCount - returns the ball reference count +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_GetBallReferenceCountPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); + +/** +* Sets the ball references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nBallReferencesBufferSize - Number of elements in buffer +* @param[in] pBallReferencesBuffer - uint32 buffer of the new indices of all balls in this beamset +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_SetBallReferencesPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nBallReferencesBufferSize, const Lib3MF_uint32 * pBallReferencesBuffer); + +/** +* Retrieves the ball references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nBallReferencesBufferSize - Number of elements in buffer +* @param[out] pBallReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBallReferencesBuffer - uint32 buffer of retrieves the indices of all balls in this beamset +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_GetBallReferencesPtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nBallReferencesBufferSize, Lib3MF_uint64* pBallReferencesNeededCount, Lib3MF_uint32 * pBallReferencesBuffer); + +/************************************************************************************************************************* + Class definition for BaseMaterialGroup +**************************************************************************************************************************/ + +/** +* Retrieves the count of base materials in the material group. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[out] pCount - returns the count of base materials. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetCountPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all materials in this group +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the material in the material group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetAllPropertyIDsPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Adds a new material to the material group +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] pName - new name of the base material. +* @param[in] pDisplayColor - Display color of the material +* @param[out] pPropertyID - returns new PropertyID of the new material in the material group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_AddMaterialPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const char * pName, const sLib3MFColor * pDisplayColor, Lib3MF_uint32 * pPropertyID); + +/** +* Removes a material from the material group. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_RemoveMaterialPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID); + +/** +* Returns the base material's name +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the base material., may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetNamePtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); + +/** +* Sets a base material's name +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] pName - new name of the base material. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_SetNamePtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const char * pName); + +/** +* Sets a base material's display color. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] pTheColor - The base material's display color +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_SetDisplayColorPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor); + +/** +* Returns a base material's display color. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[out] pTheColor - The base material's display color +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetDisplayColorPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor); + +/************************************************************************************************************************* + Class definition for ColorGroup +**************************************************************************************************************************/ + +/** +* Retrieves the count of base materials in this Color Group. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[out] pCount - returns the count of colors within this color group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFColorGroup_GetCountPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all colors within this group +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the color in the color group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFColorGroup_GetAllPropertyIDsPtr) (Lib3MF_ColorGroup pColorGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Adds a new value. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] pTheColor - The new color +* @param[out] pPropertyID - PropertyID of the new color within this color group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFColorGroup_AddColorPtr) (Lib3MF_ColorGroup pColorGroup, const sLib3MFColor * pTheColor, Lib3MF_uint32 * pPropertyID); + +/** +* Removes a color from the color group. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyID - PropertyID of the color to be removed from the color group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFColorGroup_RemoveColorPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID); + +/** +* Sets a color value. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyID - PropertyID of a color within this color group. +* @param[in] pTheColor - The color +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFColorGroup_SetColorPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor); + +/** +* Sets a color value. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyID - PropertyID of a color within this color group. +* @param[out] pTheColor - The color +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFColorGroup_GetColorPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor); + +/************************************************************************************************************************* + Class definition for Texture2DGroup +**************************************************************************************************************************/ + +/** +* Retrieves the count of tex2coords in the Texture2DGroup. +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[out] pCount - returns the count of tex2coords. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetCountPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all tex2coords in this Texture2DGroup +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the tex2coords in the Texture2DGroup. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetAllPropertyIDsPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Adds a new tex2coord to the Texture2DGroup +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. +* @param[out] pPropertyID - returns new PropertyID of the new tex2coord in the Texture2DGroup. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFTexture2DGroup_AddTex2CoordPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, const sLib3MFTex2Coord * pUVCoordinate, Lib3MF_uint32 * pPropertyID); + +/** +* Obtains a tex2coord to the Texture2DGroup +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] nPropertyID - the PropertyID of the tex2coord in the Texture2DGroup. +* @param[out] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetTex2CoordPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID, sLib3MFTex2Coord * pUVCoordinate); + +/** +* Removes a tex2coords from the Texture2DGroup. +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] nPropertyID - PropertyID of the tex2coords in the Texture2DGroup. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFTexture2DGroup_RemoveTex2CoordPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID); + +/** +* Obtains the texture2D instance of this group. +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[out] pTexture2DInstance - the texture2D instance of this group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetTexture2DPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_Texture2D * pTexture2DInstance); + +/************************************************************************************************************************* + Class definition for CompositeMaterials +**************************************************************************************************************************/ + +/** +* Retrieves the count of Composite-s in the CompositeMaterials. +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[out] pCount - returns the count of Composite-s +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetCountPtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the Composite-Mixing Values in the CompositeMaterials. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetAllPropertyIDsPtr) (Lib3MF_CompositeMaterials pCompositeMaterials, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Obtains the BaseMaterialGroup instance of this CompositeMaterials. +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[out] pBaseMaterialGroupInstance - returns the BaseMaterialGroup instance of this CompositeMaterials +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetBaseMaterialGroupPtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance); + +/** +* Adds a new Composite-Mixing Values to the CompositeMaterials. +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nCompositeBufferSize - Number of elements in buffer +* @param[in] pCompositeBuffer - CompositeConstituent buffer of The Composite Constituents to be added as composite +* @param[out] pPropertyID - returns new PropertyID of the new Composite in the CompositeMaterials. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCompositeMaterials_AddCompositePtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint64 nCompositeBufferSize, const sLib3MFCompositeConstituent * pCompositeBuffer, Lib3MF_uint32 * pPropertyID); /** -* obtains all beam indices, radii and capmodes of a mesh object. +* Removes a Composite-Maxing Ratio from the CompositeMaterials. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBeamInfoBufferSize - Number of elements in buffer -* @param[out] pBeamInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBeamInfoBuffer - Beam buffer of contains information of all beams +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nPropertyID - PropertyID of the Composite-Mixing Values in the CompositeMaterials to be removed. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamsPtr) (Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBeamInfoBufferSize, Lib3MF_uint64* pBeamInfoNeededCount, sLib3MFBeam * pBeamInfoBuffer); +typedef Lib3MFResult (*PLib3MFCompositeMaterials_RemoveCompositePtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID); /** -* Returns the ball count of a mesh object. +* Obtains a Composite-Maxing Ratio of this CompositeMaterials. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pCount - filled with the ball count. +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nPropertyID - the PropertyID of the Composite-Maxing Ratio in the CompositeMaterials. +* @param[in] nCompositeBufferSize - Number of elements in buffer +* @param[out] pCompositeNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pCompositeBuffer - CompositeConstituent buffer of The Composite-Mixing Values with the given PropertyID * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallCountPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetCompositePtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nCompositeBufferSize, Lib3MF_uint64* pCompositeNeededCount, sLib3MFCompositeConstituent * pCompositeBuffer); + +/************************************************************************************************************************* + Class definition for MultiPropertyGroup +**************************************************************************************************************************/ /** -* Returns index and radius of a single ball of a mesh object. +* Retrieves the count of MultiProperty-s in the MultiPropertyGroup. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the ball (0 to ballcount - 1). -* @param[out] pBallInfo - filled with the ball node index and radius. +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[out] pCount - returns the count of MultiProperty-s * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBall * pBallInfo); +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetCountPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); /** -* Adds a single ball to a mesh object. +* returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] pBallInfo - contains the node index and radius. -* @param[out] pIndex - filled with the new Index of the ball. +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the MultiProperty-s in the MultiPropertyGroup. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_AddBallPtr) (Lib3MF_BeamLattice pBeamLattice, const sLib3MFBall * pBallInfo, Lib3MF_uint32 * pIndex); +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetAllPropertyIDsPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); /** -* Sets the index and radius of a single ball of a mesh object. +* Adds a new MultiProperty to the MultiPropertyGroup. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the ball (0 to ballcount - 1). -* @param[in] pBallInfo - filled with the ball node index and radius. +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[in] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the new MultiProperty. +* @param[out] pPropertyID - returns the PropertyID of the new MultiProperty in the MultiPropertyGroup. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetBallPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBall * pBallInfo); +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_AddMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer, Lib3MF_uint32 * pPropertyID); /** -* Sets all ball indices and radii of a mesh object. +* Sets the PropertyIDs of a MultiProperty. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBallInfoBufferSize - Number of elements in buffer -* @param[in] pBallInfoBuffer - Ball buffer of contains information of a number of balls +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyID - the PropertyID of the MultiProperty to be changed. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[in] pPropertyIDsBuffer - uint32 buffer of The new PropertyIDs of the MultiProperty * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetBallsPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBallInfoBufferSize, const sLib3MFBall * pBallInfoBuffer); +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_SetMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer); /** -* obtains all ball indices and radii of a mesh object. +* Obtains the PropertyIDs of a MultiProperty. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBallInfoBufferSize - Number of elements in buffer -* @param[out] pBallInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBallInfoBuffer - Ball buffer of contains information of all balls +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyID - the PropertyID of the MultiProperty to be queried. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the MultiProperty +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Removes a MultiProperty from this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyID - the PropertyID of the MultiProperty to be removed. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_RemoveMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID); + +/** +* Retrieves the number of layers of this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[out] pCount - returns the number of layers +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetLayerCountPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); + +/** +* Adds a MultiPropertyLayer to this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] pTheLayer - The MultiPropertyLayer to add to this MultiPropertyGroup +* @param[out] pLayerIndex - returns the index of this MultiPropertyLayer +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_AddLayerPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const sLib3MFMultiPropertyLayer * pTheLayer, Lib3MF_uint32 * pLayerIndex); + +/** +* Obtains a MultiPropertyLayer of this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nLayerIndex - The Index of the MultiPropertyLayer queried +* @param[out] pTheLayer - The MultiPropertyLayer with index LayerIndex within MultiPropertyGroup +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetLayerPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex, sLib3MFMultiPropertyLayer * pTheLayer); + +/** +* Removes a MultiPropertyLayer from this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nLayerIndex - The Index of the MultiPropertyLayer to be removed +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_RemoveLayerPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex); + +/************************************************************************************************************************* + Class definition for Attachment +**************************************************************************************************************************/ + +/** +* Retrieves an attachment's package path. This function will be removed in a later release. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of returns the attachment's package path string, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_GetPathPtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Sets an attachment's package path. This function will be removed in a later release. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pPath - new path of the attachment. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_SetPathPtr) (Lib3MF_Attachment pAttachment, const char * pPath); + +/** +* Returns the PackagePart that is this attachment. +* +* @param[in] pAttachment - Attachment instance. +* @param[out] pPackagePart - The PackagePart of this attachment. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_PackagePartPtr) (Lib3MF_Attachment pAttachment, Lib3MF_PackagePart * pPackagePart); + +/** +* Retrieves an attachment's relationship type +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of returns the attachment's package relationship type string, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_GetRelationShipTypePtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Sets an attachment's relationship type. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pPath - new relationship type string. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_SetRelationShipTypePtr) (Lib3MF_Attachment pAttachment, const char * pPath); + +/** +* Writes out the attachment as file. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pFileName - file to write into. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_WriteToFilePtr) (Lib3MF_Attachment pAttachment, const char * pFileName); + +/** +* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pFileName - file to read from. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_ReadFromFilePtr) (Lib3MF_Attachment pAttachment, const char * pFileName); + +/** +* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pTheReadCallback - Callback to call for reading a data chunk +* @param[in] nStreamSize - number of bytes the callback returns +* @param[in] pTheSeekCallback - Callback to call for seeking in the stream. +* @param[in] pUserData - Userdata that is passed to the callback function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_ReadFromCallbackPtr) (Lib3MF_Attachment pAttachment, Lib3MFReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MFSeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData); + +/** +* Retrieves the size of the attachment stream +* +* @param[in] pAttachment - Attachment instance. +* @param[out] pStreamSize - the stream size +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_GetStreamSizePtr) (Lib3MF_Attachment pAttachment, Lib3MF_uint64 * pStreamSize); + +/** +* Writes out the attachment into a buffer +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nBufferBufferSize - Number of elements in buffer +* @param[out] pBufferNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBufferBuffer - uint8 buffer of Buffer to write into +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_WriteToBufferPtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer); + +/** +* Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nBufferBufferSize - Number of elements in buffer +* @param[in] pBufferBuffer - uint8 buffer of Buffer to read from +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_ReadFromBufferPtr) (Lib3MF_Attachment pAttachment, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer); + +/************************************************************************************************************************* + Class definition for Texture2D +**************************************************************************************************************************/ + +/** +* Retrieves the attachment located at the path of the texture. +* +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pAttachment - attachment that holds the texture's image information. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallsPtr) (Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBallInfoBufferSize, Lib3MF_uint64* pBallInfoNeededCount, sLib3MFBall * pBallInfoBuffer); +typedef Lib3MFResult (*PLib3MFTexture2D_GetAttachmentPtr) (Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment * pAttachment); /** -* Returns the number of beamsets of a mesh object. +* Sets the texture's package path to the path of the attachment. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pCount - filled with the beamset count. +* @param[in] pTexture2D - Texture2D instance. +* @param[in] pAttachment - attachment that holds the texture's image information. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamSetCountPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFTexture2D_SetAttachmentPtr) (Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment pAttachment); /** -* Adds an empty beamset to a mesh object +* Retrieves a texture's content type. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pBeamSet - the new beamset +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pContentType - returns content type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_AddBeamSetPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_BeamSet * pBeamSet); +typedef Lib3MFResult (*PLib3MFTexture2D_GetContentTypePtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureType * pContentType); /** -* Returns a beamset of a mesh object +* Retrieves a texture's content type. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - index of the requested beamset (0 ... beamsetcount-1). -* @param[out] pBeamSet - the requested beamset +* @param[in] pTexture2D - Texture2D instance. +* @param[in] eContentType - new Content Type * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamSetPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF_BeamSet * pBeamSet); - -/************************************************************************************************************************* - Class definition for Component -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFTexture2D_SetContentTypePtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureType eContentType); /** -* Returns the Resource Instance of the component. +* Retrieves a texture's tilestyle type. * -* @param[in] pComponent - Component instance. -* @param[out] pObjectResource - filled with the Resource Instance. +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pTileStyleU - returns tilestyle type enum. +* @param[out] pTileStyleV - returns tilestyle type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_GetObjectResourcePtr) (Lib3MF_Component pComponent, Lib3MF_Object * pObjectResource); +typedef Lib3MFResult (*PLib3MFTexture2D_GetTileStyleUVPtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle * pTileStyleU, eLib3MFTextureTileStyle * pTileStyleV); /** -* Returns the UniqueResourceID of the component. +* Sets a texture's tilestyle type. * -* @param[in] pComponent - Component instance. -* @param[out] pUniqueResourceID - returns the UniqueResourceID. +* @param[in] pTexture2D - Texture2D instance. +* @param[in] eTileStyleU - new tilestyle type enum. +* @param[in] eTileStyleV - new tilestyle type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_GetObjectResourceIDPtr) (Lib3MF_Component pComponent, Lib3MF_uint32 * pUniqueResourceID); +typedef Lib3MFResult (*PLib3MFTexture2D_SetTileStyleUVPtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle eTileStyleU, eLib3MFTextureTileStyle eTileStyleV); /** -* returns, whether a component has a UUID and, if true, the component's UUID +* Retrieves a texture's filter type. * -* @param[in] pComponent - Component instance. -* @param[out] pHasUUID - flag whether the component has a UUID -* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pFilter - returns filter type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_GetUUIDPtr) (Lib3MF_Component pComponent, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); +typedef Lib3MFResult (*PLib3MFTexture2D_GetFilterPtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter * pFilter); /** -* sets the component's UUID +* Sets a texture's filter type. * -* @param[in] pComponent - Component instance. -* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' +* @param[in] pTexture2D - Texture2D instance. +* @param[in] eFilter - sets new filter type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_SetUUIDPtr) (Lib3MF_Component pComponent, const char * pUUID); +typedef Lib3MFResult (*PLib3MFTexture2D_SetFilterPtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter eFilter); + +/************************************************************************************************************************* + Class definition for BuildItem +**************************************************************************************************************************/ /** -* Returns, if the component has a different transformation than the identity matrix +* Retrieves the object resource associated to a build item * -* @param[in] pComponent - Component instance. -* @param[out] pHasTransform - if true is returned, the transformation is not equal than the identity +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pObjectResource - returns the associated resource instance * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_HasTransformPtr) (Lib3MF_Component pComponent, bool * pHasTransform); +typedef Lib3MFResult (*PLib3MFBuildItem_GetObjectResourcePtr) (Lib3MF_BuildItem pBuildItem, Lib3MF_Object * pObjectResource); /** -* Returns the transformation matrix of the component. +* returns, whether a build item has a UUID and, if true, the build item's UUID * -* @param[in] pComponent - Component instance. -* @param[out] pTransform - filled with the component transformation matrix +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pHasUUID - flag whether the build item has a UUID +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_GetTransformPtr) (Lib3MF_Component pComponent, sLib3MFTransform * pTransform); +typedef Lib3MFResult (*PLib3MFBuildItem_GetUUIDPtr) (Lib3MF_BuildItem pBuildItem, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* Sets the transformation matrix of the component. +* sets the build item's UUID * -* @param[in] pComponent - Component instance. -* @param[in] pTransform - new transformation matrix +* @param[in] pBuildItem - BuildItem instance. +* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_SetTransformPtr) (Lib3MF_Component pComponent, const sLib3MFTransform * pTransform); - -/************************************************************************************************************************* - Class definition for ComponentsObject -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFBuildItem_SetUUIDPtr) (Lib3MF_BuildItem pBuildItem, const char * pUUID); /** -* Adds a new component to a components object. +* Retrieves the object UniqueResourceID associated to a build item * -* @param[in] pComponentsObject - ComponentsObject instance. -* @param[in] pObjectResource - object to add as component. Must not lead to circular references! -* @param[in] pTransform - optional transform matrix for the component. -* @param[out] pComponentInstance - new component instance +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pUniqueResourceID - returns the UniqueResourceID of the object * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponentsObject_AddComponentPtr) (Lib3MF_ComponentsObject pComponentsObject, Lib3MF_Object pObjectResource, const sLib3MFTransform * pTransform, Lib3MF_Component * pComponentInstance); +typedef Lib3MFResult (*PLib3MFBuildItem_GetObjectResourceIDPtr) (Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pUniqueResourceID); /** -* Retrieves a component from a component object. +* Checks, if a build item has a non-identity transformation matrix * -* @param[in] pComponentsObject - ComponentsObject instance. -* @param[in] nIndex - index of the component to retrieve (0 to componentcount - 1) -* @param[out] pComponentInstance - component instance +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pHasTransform - returns true, if the transformation matrix is not the identity * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponentsObject_GetComponentPtr) (Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 nIndex, Lib3MF_Component * pComponentInstance); +typedef Lib3MFResult (*PLib3MFBuildItem_HasObjectTransformPtr) (Lib3MF_BuildItem pBuildItem, bool * pHasTransform); /** -* Retrieves a component count of a component object. +* Retrieves a build item's transformation matrix. * -* @param[in] pComponentsObject - ComponentsObject instance. -* @param[out] pCount - returns the component count +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pTransform - returns the transformation matrix * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponentsObject_GetComponentCountPtr) (Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 * pCount); - -/************************************************************************************************************************* - Class definition for BeamSet -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFBuildItem_GetObjectTransformPtr) (Lib3MF_BuildItem pBuildItem, sLib3MFTransform * pTransform); /** -* Sets a beamset's name string +* Sets a build item's transformation matrix. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] pName - new name of the beamset. +* @param[in] pBuildItem - BuildItem instance. +* @param[in] pTransform - new transformation matrix * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_SetNamePtr) (Lib3MF_BeamSet pBeamSet, const char * pName); +typedef Lib3MFResult (*PLib3MFBuildItem_SetObjectTransformPtr) (Lib3MF_BuildItem pBuildItem, const sLib3MFTransform * pTransform); /** -* Retrieves a beamset's name string +* Retrieves a build item's part number string * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of returns the name of the beamset., may be NULL +* @param[in] pBuildItem - BuildItem instance. +* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartNumberBuffer - buffer of Returns a build item's part number string, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_GetNamePtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +typedef Lib3MFResult (*PLib3MFBuildItem_GetPartNumberPtr) (Lib3MF_BuildItem pBuildItem, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); /** -* Sets a beamset's identifier string +* Sets a build item's part number string * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] pIdentifier - new name of the beamset. +* @param[in] pBuildItem - BuildItem instance. +* @param[in] pSetPartnumber - new part number string for referencing parts from the outside world * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_SetIdentifierPtr) (Lib3MF_BeamSet pBeamSet, const char * pIdentifier); +typedef Lib3MFResult (*PLib3MFBuildItem_SetPartNumberPtr) (Lib3MF_BuildItem pBuildItem, const char * pSetPartnumber); /** -* Retrieves a beamset's identifier string +* Returns the metadatagroup of this build item * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nIdentifierBufferSize - size of the buffer (including trailing 0) -* @param[out] pIdentifierNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pIdentifierBuffer - buffer of returns the identifier of the beamset., may be NULL +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this build item * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_GetIdentifierPtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer); +typedef Lib3MFResult (*PLib3MFBuildItem_GetMetaDataGroupPtr) (Lib3MF_BuildItem pBuildItem, Lib3MF_MetaDataGroup * pMetaDataGroup); /** -* Retrieves the reference count of a beamset +* Returns the outbox of a build item * -* @param[in] pBeamSet - BeamSet instance. -* @param[out] pCount - returns the reference count +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pOutbox - Outbox of this build item * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_GetReferenceCountPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFBuildItem_GetOutboxPtr) (Lib3MF_BuildItem pBuildItem, sLib3MFBox * pOutbox); + +/************************************************************************************************************************* + Class definition for BuildItemIterator +**************************************************************************************************************************/ /** -* Sets the references of a beamset +* Iterates to the next build item in the list. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nReferencesBufferSize - Number of elements in buffer -* @param[in] pReferencesBuffer - uint32 buffer of the new indices of all beams in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pHasNext - Iterates to the next build item in the list. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_SetReferencesPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nReferencesBufferSize, const Lib3MF_uint32 * pReferencesBuffer); +typedef Lib3MFResult (*PLib3MFBuildItemIterator_MoveNextPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasNext); /** -* Retrieves the references of a beamset +* Iterates to the previous build item in the list. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nReferencesBufferSize - Number of elements in buffer -* @param[out] pReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pReferencesBuffer - uint32 buffer of retrieves the indices of all beams in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pHasPrevious - Iterates to the previous build item in the list. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_GetReferencesPtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nReferencesBufferSize, Lib3MF_uint64* pReferencesNeededCount, Lib3MF_uint32 * pReferencesBuffer); +typedef Lib3MFResult (*PLib3MFBuildItemIterator_MovePreviousPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasPrevious); /** -* Retrieves the ball reference count of a beamset +* Returns the build item the iterator points at. * -* @param[in] pBeamSet - BeamSet instance. -* @param[out] pCount - returns the ball reference count +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pBuildItem - returns the build item instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_GetBallReferenceCountPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFBuildItemIterator_GetCurrentPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItem * pBuildItem); /** -* Sets the ball references of a beamset +* Creates a new build item iterator with the same build item list. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nBallReferencesBufferSize - Number of elements in buffer -* @param[in] pBallReferencesBuffer - uint32 buffer of the new indices of all balls in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pOutBuildItemIterator - returns the cloned Iterator instance * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_SetBallReferencesPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nBallReferencesBufferSize, const Lib3MF_uint32 * pBallReferencesBuffer); +typedef Lib3MFResult (*PLib3MFBuildItemIterator_ClonePtr) (Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItemIterator * pOutBuildItemIterator); /** -* Retrieves the ball references of a beamset +* Returns the number of build items the iterator captures. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nBallReferencesBufferSize - Number of elements in buffer -* @param[out] pBallReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBallReferencesBuffer - uint32 buffer of retrieves the indices of all balls in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pCount - returns the number of build items the iterator captures. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_GetBallReferencesPtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nBallReferencesBufferSize, Lib3MF_uint64* pBallReferencesNeededCount, Lib3MF_uint32 * pBallReferencesBuffer); +typedef Lib3MFResult (*PLib3MFBuildItemIterator_CountPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_uint64 * pCount); /************************************************************************************************************************* - Class definition for BaseMaterialGroup + Class definition for Slice **************************************************************************************************************************/ /** -* Retrieves the count of base materials in the material group. +* Set all vertices of a slice. All polygons will be cleared. * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[out] pCount - returns the count of base materials. +* @param[in] pSlice - Slice instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[in] pVerticesBuffer - Position2D buffer of contains the positions. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetCountPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFSlice_SetVerticesPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nVerticesBufferSize, const sLib3MFPosition2D * pVerticesBuffer); /** -* returns all the PropertyIDs of all materials in this group +* Get all vertices of a slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the material in the material group. +* @param[in] pSlice - Slice instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pVerticesBuffer - Position2D buffer of contains the positions. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFSlice_GetVerticesPtr) (Lib3MF_Slice pSlice, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, sLib3MFPosition2D * pVerticesBuffer); + +/** +* Get the number of vertices in a slice +* +* @param[in] pSlice - Slice instance. +* @param[out] pCount - the number of vertices in the slice * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetAllPropertyIDsPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFSlice_GetVertexCountPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); /** -* Adds a new material to the material group +* Add a new polygon to this slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] pName - new name of the base material. -* @param[in] pDisplayColor - Display color of the material -* @param[out] pPropertyID - returns new PropertyID of the new material in the material group. +* @param[in] pSlice - Slice instance. +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the new polygon +* @param[out] pIndex - the index of the new polygon * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_AddMaterialPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const char * pName, const sLib3MFColor * pDisplayColor, Lib3MF_uint32 * pPropertyID); +typedef Lib3MFResult (*PLib3MFSlice_AddPolygonPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer, Lib3MF_uint64 * pIndex); /** -* Removes a material from the material group. +* Get the number of polygons in the slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] pSlice - Slice instance. +* @param[out] pCount - the number of polygons in the slice * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_RemoveMaterialPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID); +typedef Lib3MFResult (*PLib3MFSlice_GetPolygonCountPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); /** -* Returns the base material's name +* Set all indices of a polygon * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of returns the name of the base material., may be NULL +* @param[in] pSlice - Slice instance. +* @param[in] nIndex - the index of the polygon to manipulate +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the index-th polygon * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetNamePtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +typedef Lib3MFResult (*PLib3MFSlice_SetPolygonIndicesPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer); /** -* Sets a base material's name +* Get all vertices of a slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[in] pName - new name of the base material. +* @param[in] pSlice - Slice instance. +* @param[in] nIndex - the index of the polygon to manipulate +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pIndicesBuffer - uint32 buffer of the indices of the index-th polygon * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_SetNamePtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const char * pName); +typedef Lib3MFResult (*PLib3MFSlice_GetPolygonIndicesPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF_uint32 * pIndicesBuffer); /** -* Sets a base material's display color. +* Get the number of vertices in a slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[in] pTheColor - The base material's display color +* @param[in] pSlice - Slice instance. +* @param[in] nIndex - the index of the polygon to manipulate +* @param[out] pCount - the number of indices of the index-th polygon * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_SetDisplayColorPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor); +typedef Lib3MFResult (*PLib3MFSlice_GetPolygonIndexCountPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 * pCount); /** -* Returns a base material's display color. +* Get the upper Z-Coordinate of this slice. * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[out] pTheColor - The base material's display color +* @param[in] pSlice - Slice instance. +* @param[out] pZTop - the upper Z-Coordinate of this slice * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetDisplayColorPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor); +typedef Lib3MFResult (*PLib3MFSlice_GetZTopPtr) (Lib3MF_Slice pSlice, Lib3MF_double * pZTop); /************************************************************************************************************************* - Class definition for ColorGroup + Class definition for ToolpathProfile **************************************************************************************************************************/ /** -* Retrieves the count of base materials in this Color Group. +* Retrieves the profile's uuid * -* @param[in] pColorGroup - ColorGroup instance. -* @param[out] pCount - returns the count of colors within this color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroup_GetCountPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetUUIDPtr) (Lib3MF_ToolpathProfile pToolpathProfile, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* returns all the PropertyIDs of all colors within this group +* Retrieves the profile's name * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the color in the color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of Returns the name., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroup_GetAllPropertyIDsPtr) (Lib3MF_ColorGroup pColorGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetNamePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Adds a new value. +* Returns the number of parameters. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] pTheColor - The new color -* @param[out] pPropertyID - PropertyID of the new color within this color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[out] pCount - Returns the number of parameters. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroup_AddColorPtr) (Lib3MF_ColorGroup pColorGroup, const sLib3MFColor * pTheColor, Lib3MF_uint32 * pPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterCountPtr) (Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 * pCount); /** -* Removes a color from the color group. +* Returns the Name of a parameter. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyID - PropertyID of the color to be removed from the color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nIndex - Index of Parameter (0-based). Call will fail if an invalid index is given. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of Returns the name of the parameter., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroup_RemoveColorPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterNamePtr) (Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Sets a color value. +* Returns the NameSpace of a parameter. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyID - PropertyID of a color within this color group. -* @param[in] pTheColor - The color +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nIndex - Index of Parameter (0-based). Call will fail if an invalid index is given. +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of Returns the namespace of the parameter., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroup_SetColorPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterNameSpacePtr) (Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* Sets a color value. +* Checks if a parameter value exists. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyID - PropertyID of a color within this color group. -* @param[out] pTheColor - The color +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValueExists - Returns if a value exists. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroup_GetColorPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor); - -/************************************************************************************************************************* - Class definition for Texture2DGroup -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpathProfile_HasParameterValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool * pValueExists); /** -* Retrieves the count of tex2coords in the Texture2DGroup. +* Retrieves a profile's parameter value. Fails if value does not exist. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[out] pCount - returns the count of tex2coords. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of Returns the value of the field., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetCountPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* returns all the PropertyIDs of all tex2coords in this Texture2DGroup +* Retrieves a profile's parameter value * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the tex2coords in the Texture2DGroup. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] pDefaultValue - Default value if value does not exist. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of Returns the value of the field., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetAllPropertyIDsPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterValueDefPtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const char * pDefaultValue, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* Adds a new tex2coord to the Texture2DGroup +* Retrieves a profile's parameter value as double. Fails if value does not exist or is not a double value. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. -* @param[out] pPropertyID - returns new PropertyID of the new tex2coord in the Texture2DGroup. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroup_AddTex2CoordPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, const sLib3MFTex2Coord * pUVCoordinate, Lib3MF_uint32 * pPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterDoubleValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double * pValue); /** -* Obtains a tex2coord to the Texture2DGroup +* Retrieves a profile's parameter value as double. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] nPropertyID - the PropertyID of the tex2coord in the Texture2DGroup. -* @param[out] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] dDefaultValue - Default value if value does not exist or is not a double value. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetTex2CoordPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID, sLib3MFTex2Coord * pUVCoordinate); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterDoubleValueDefPtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double dDefaultValue, Lib3MF_double * pValue); /** -* Removes a tex2coords from the Texture2DGroup. +* Retrieves a profile's parameter value as integer. Fails if value does not exist or is not a integer value. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] nPropertyID - PropertyID of the tex2coords in the Texture2DGroup. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroup_RemoveTex2CoordPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterIntegerValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 * pValue); /** -* Obtains the texture2D instance of this group. +* Retrieves a profile's parameter value as integer. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[out] pTexture2DInstance - the texture2D instance of this group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] nDefaultValue - Default value if value does not exist or is not a integer value. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetTexture2DPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_Texture2D * pTexture2DInstance); - -/************************************************************************************************************************* - Class definition for CompositeMaterials -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterIntegerValueDefPtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 nDefaultValue, Lib3MF_int64 * pValue); /** -* Retrieves the count of Composite-s in the CompositeMaterials. +* Retrieves a profile's parameter value as boolean. Fails if value does not exist or is not a boolean value. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[out] pCount - returns the count of Composite-s +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetCountPtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterBoolValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool * pValue); /** -* returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials +* Retrieves a profile's parameter value as boolean. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the Composite-Mixing Values in the CompositeMaterials. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] bDefaultValue - Default value if value does not exist or is not a boolean value. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetAllPropertyIDsPtr) (Lib3MF_CompositeMaterials pCompositeMaterials, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterBoolValueDefPtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool bDefaultValue, bool * pValue); /** -* Obtains the BaseMaterialGroup instance of this CompositeMaterials. +* Sets the profile's name * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[out] pBaseMaterialGroupInstance - returns the BaseMaterialGroup instance of this CompositeMaterials +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pName - Returns the name. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetBaseMaterialGroupPtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance); +typedef Lib3MFResult (*PLib3MFToolpathProfile_SetNamePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pName); /** -* Adds a new Composite-Mixing Values to the CompositeMaterials. +* Sets a profile's parameter value. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nCompositeBufferSize - Number of elements in buffer -* @param[in] pCompositeBuffer - CompositeConstituent buffer of The Composite Constituents to be added as composite -* @param[out] pPropertyID - returns new PropertyID of the new Composite in the CompositeMaterials. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] pValue - String value of the parameter. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterials_AddCompositePtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint64 nCompositeBufferSize, const sLib3MFCompositeConstituent * pCompositeBuffer, Lib3MF_uint32 * pPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathProfile_SetParameterValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const char * pValue); /** -* Removes a Composite-Maxing Ratio from the CompositeMaterials. +* Sets a profile's parameter value as double. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nPropertyID - PropertyID of the Composite-Mixing Values in the CompositeMaterials to be removed. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] dValue - Double value of the parameter. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterials_RemoveCompositePtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathProfile_SetParameterDoubleValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double dValue); /** -* Obtains a Composite-Maxing Ratio of this CompositeMaterials. +* Sets a profile's parameter value as integer. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nPropertyID - the PropertyID of the Composite-Maxing Ratio in the CompositeMaterials. -* @param[in] nCompositeBufferSize - Number of elements in buffer -* @param[out] pCompositeNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pCompositeBuffer - CompositeConstituent buffer of The Composite-Mixing Values with the given PropertyID +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] nValue - Integer value of the parameter. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetCompositePtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nCompositeBufferSize, Lib3MF_uint64* pCompositeNeededCount, sLib3MFCompositeConstituent * pCompositeBuffer); - -/************************************************************************************************************************* - Class definition for MultiPropertyGroup -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpathProfile_SetParameterIntegerValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 nValue); /** -* Retrieves the count of MultiProperty-s in the MultiPropertyGroup. +* Sets a profile's parameter value as boolean. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[out] pCount - returns the count of MultiProperty-s +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] bValue - Boolean value of the parameter. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetCountPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFToolpathProfile_SetParameterBoolValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool bValue); + +/************************************************************************************************************************* + Class definition for ToolpathLayerReader +**************************************************************************************************************************/ /** -* returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup +* Retrieves the layerdata's uuid * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the MultiProperty-s in the MultiPropertyGroup. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetAllPropertyIDsPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetLayerDataUUIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* Adds a new MultiProperty to the MultiPropertyGroup. +* Retrieves the count of segments. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[in] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the new MultiProperty. -* @param[out] pPropertyID - returns the PropertyID of the new MultiProperty in the MultiPropertyGroup. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[out] pCount - Count * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_AddMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer, Lib3MF_uint32 * pPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentCountPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 * pCount); /** -* Sets the PropertyIDs of a MultiProperty. +* Retrieves the segment type information . * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyID - the PropertyID of the MultiProperty to be changed. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[in] pPropertyIDsBuffer - uint32 buffer of The new PropertyIDs of the MultiProperty +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pType - Segment Type +* @param[out] pPointCount - Point count of segment. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_SetMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentInfoPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, eLib3MFToolpathSegmentType * pType, Lib3MF_uint32 * pPointCount); /** -* Obtains the PropertyIDs of a MultiProperty. +* Retrieves the assigned segment profile. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyID - the PropertyID of the MultiProperty to be queried. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the MultiProperty +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pProfile - Segment Profile * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentProfilePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_ToolpathProfile * pProfile); /** -* Removes a MultiProperty from this MultiPropertyGroup. +* Retrieves the assigned segment profile uuid. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyID - the PropertyID of the MultiProperty to be removed. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[in] nProfileUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pProfileUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pProfileUUIDBuffer - buffer of Segment Profile UUID, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_RemoveMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentProfileUUIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nProfileUUIDBufferSize, Lib3MF_uint32* pProfileUUIDNeededChars, char * pProfileUUIDBuffer); /** -* Retrieves the number of layers of this MultiPropertyGroup. +* Retrieves the assigned segment profile. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[out] pCount - returns the number of layers +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pBuildItem - Segment Build Item * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetLayerCountPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentPartPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_BuildItem * pBuildItem); /** -* Adds a MultiPropertyLayer to this MultiPropertyGroup. +* Retrieves the assigned segment part uuid. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] pTheLayer - The MultiPropertyLayer to add to this MultiPropertyGroup -* @param[out] pLayerIndex - returns the index of this MultiPropertyLayer +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[in] nPartUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartUUIDBuffer - buffer of Segment Part UUID, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_AddLayerPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const sLib3MFMultiPropertyLayer * pTheLayer, Lib3MF_uint32 * pLayerIndex); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentPartUUIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nPartUUIDBufferSize, Lib3MF_uint32* pPartUUIDNeededChars, char * pPartUUIDBuffer); /** -* Obtains a MultiPropertyLayer of this MultiPropertyGroup. +* Retrieves the assigned segment part id. ATTENTION: This ID is only unique within the layer and there is no guarantee to be globally unique or consistent across layers. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nLayerIndex - The Index of the MultiPropertyLayer queried -* @param[out] pTheLayer - The MultiPropertyLayer with index LayerIndex within MultiPropertyGroup +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pLocalPartID - Local Segment Part ID * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetLayerPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex, sLib3MFMultiPropertyLayer * pTheLayer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentLocalPartIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 * pLocalPartID); /** -* Removes a MultiPropertyLayer from this MultiPropertyGroup. +* Retrieves the global part UUID by the local part ID. Fails if part ID does not exist in this layer. ATTENTION: This ID is only unique within the layer and there is no guarantee to be globally unique or consistent across layers. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nLayerIndex - The Index of the MultiPropertyLayer to be removed +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nLocalPartID - Local Segment Part ID +* @param[in] nPartUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartUUIDBuffer - buffer of Segment Part UUID, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_RemoveLayerPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex); - -/************************************************************************************************************************* - Class definition for Attachment -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nLocalPartID, const Lib3MF_uint32 nPartUUIDBufferSize, Lib3MF_uint32* pPartUUIDNeededChars, char * pPartUUIDBuffer); /** -* Retrieves an attachment's package path. This function will be removed in a later release. +* Retrieves the assigned segment point list. For type hatch, the points are taken pairwise. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nPathBufferSize - size of the buffer (including trailing 0) -* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPathBuffer - buffer of returns the attachment's package path string, may be NULL +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[out] pPointDataNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPointDataBuffer - Position2D buffer of The point data array * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_GetPathPtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentPointDataPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint64 nPointDataBufferSize, Lib3MF_uint64* pPointDataNeededCount, sLib3MFPosition2D * pPointDataBuffer); /** -* Sets an attachment's package path. This function will be removed in a later release. +* Retrieves a segment attribute Information by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pPath - new path of the attachment. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pID - Attribute ID. +* @param[out] pAttributeType - Attribute Type. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_SetPathPtr) (Lib3MF_Attachment pAttachment, const char * pPath); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_FindAttributeInfoByNamePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, Lib3MF_uint32 * pID, eLib3MFToolpathAttributeType * pAttributeType); /** -* Returns the PackagePart that is this attachment. +* Retrieves a segment attribute ID by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[out] pPackagePart - The PackagePart of this attachment. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pID - Attribute ID. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_PackagePartPtr) (Lib3MF_Attachment pAttachment, Lib3MF_PackagePart * pPackagePart); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_FindAttributeIDByNamePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, Lib3MF_uint32 * pID); /** -* Retrieves an attachment's relationship type +* Retrieves a segment attribute Type by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nPathBufferSize - size of the buffer (including trailing 0) -* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPathBuffer - buffer of returns the attachment's package relationship type string, may be NULL +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pAttributeType - Attribute Type. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_GetRelationShipTypePtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_FindAttributeValueByNamePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, eLib3MFToolpathAttributeType * pAttributeType); /** -* Sets an attachment's relationship type. +* Retrieves a segment Uint32 attribute by Attribute ID. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pPath - new relationship type string. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] nID - Attribute ID. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_SetRelationShipTypePtr) (Lib3MF_Attachment pAttachment, const char * pPath); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 nID, Lib3MF_int64 * pValue); /** -* Writes out the attachment as file. +* Retrieves a segment integer attribute by Attribute Name. Will fail if Attribute does not exist or is of different type. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pFileName - file to write into. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_WriteToFilePtr) (Lib3MF_Attachment pAttachment, const char * pFileName); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByNamePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const char * pNameSpace, const char * pAttributeName, Lib3MF_int64 * pValue); /** -* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Retrieves a segment Double attribute by Attribute ID. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pFileName - file to read from. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] nID - Attribute ID. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_ReadFromFilePtr) (Lib3MF_Attachment pAttachment, const char * pFileName); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 nID, Lib3MF_double * pValue); /** -* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Retrieves a segment Double attribute by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pTheReadCallback - Callback to call for reading a data chunk -* @param[in] nStreamSize - number of bytes the callback returns -* @param[in] pTheSeekCallback - Callback to call for seeking in the stream. -* @param[in] pUserData - Userdata that is passed to the callback function +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_ReadFromCallbackPtr) (Lib3MF_Attachment pAttachment, Lib3MFReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MFSeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByNamePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const char * pNameSpace, const char * pAttributeName, Lib3MF_double * pValue); /** -* Retrieves the size of the attachment stream +* Retrieves the count of custom data elements. * -* @param[in] pAttachment - Attachment instance. -* @param[out] pStreamSize - the stream size +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[out] pCount - Count * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_GetStreamSizePtr) (Lib3MF_Attachment pAttachment, Lib3MF_uint64 * pStreamSize); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetCustomDataCountPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 * pCount); /** -* Writes out the attachment into a buffer +* Retrieves the custom data. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nBufferBufferSize - Number of elements in buffer -* @param[out] pBufferNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBufferBuffer - uint8 buffer of Buffer to write into +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_WriteToBufferPtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetCustomDataPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_CustomDOMTree * pData); /** -* Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). +* Retrieves the node name of the custom data. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nBufferBufferSize - Number of elements in buffer -* @param[in] pBufferBuffer - uint8 buffer of Buffer to read from +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of Namespace of the custom data tree., may be NULL +* @param[in] nDataNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pDataNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pDataNameBuffer - buffer of Root name of the data tree., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_ReadFromBufferPtr) (Lib3MF_Attachment pAttachment, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetCustomDataNamePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer, const Lib3MF_uint32 nDataNameBufferSize, Lib3MF_uint32* pDataNameNeededChars, char * pDataNameBuffer); /************************************************************************************************************************* - Class definition for Texture2D + Class definition for ToolpathLayerData **************************************************************************************************************************/ /** -* Retrieves the attachment located at the path of the texture. +* Retrieves the layerdata's uuid * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pAttachment - attachment that holds the texture's image information. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_GetAttachmentPtr) (Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment * pAttachment); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_GetLayerDataUUIDPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* Sets the texture's package path to the path of the attachment. +* Registers a toolpath profile * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] pAttachment - attachment that holds the texture's image information. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pProfile - The toolpath profile to register. +* @param[out] pProfileID - returns the local profile ID for the layer. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_SetAttachmentPtr) (Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment pAttachment); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_RegisterProfilePtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_ToolpathProfile pProfile, Lib3MF_uint32 * pProfileID); /** -* Retrieves a texture's content type. +* Registers a Model Build Item * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pContentType - returns content type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pBuildItem - The model build item to use. +* @param[out] pPartID - returns the local part ID for the layer. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_GetContentTypePtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureType * pContentType); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_RegisterBuildItemPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pPartID); /** -* Retrieves a texture's content type. +* Sets Segment Attribute for all following segments that are added. Overrides previously set attribute. * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] eContentType - new Content Type +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pNameSpace - The namespace of the attribute to register. +* @param[in] pAttributeName - The name of the attribute to register. +* @param[in] pValue - The value of the attribute to register. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_SetContentTypePtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureType eContentType); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_SetSegmentAttributePtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pAttributeName, const char * pValue); /** -* Retrieves a texture's tilestyle type. +* Clears current segment attributes. * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pTileStyleU - returns tilestyle type enum. -* @param[out] pTileStyleV - returns tilestyle type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_GetTileStyleUVPtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle * pTileStyleU, eLib3MFTextureTileStyle * pTileStyleV); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_ClearSegmentAttributesPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData); /** -* Sets a texture's tilestyle type. +* writes hatch data to the layer. * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] eTileStyleU - new tilestyle type enum. -* @param[in] eTileStyleV - new tilestyle type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nProfileID - The toolpath profile to use +* @param[in] nPartID - The toolpath part to use +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[in] pPointDataBuffer - Position2D buffer of The point data * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_SetTileStyleUVPtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle eTileStyleU, eLib3MFTextureTileStyle eTileStyleV); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_WriteHatchDataPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const sLib3MFPosition2D * pPointDataBuffer); /** -* Retrieves a texture's filter type. +* writes loop data to the layer. * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pFilter - returns filter type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nProfileID - The toolpath profile to use +* @param[in] nPartID - The toolpath part to use +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[in] pPointDataBuffer - Position2D buffer of The point data * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_GetFilterPtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter * pFilter); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_WriteLoopPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const sLib3MFPosition2D * pPointDataBuffer); /** -* Sets a texture's filter type. +* writes polyline data to the layer. * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] eFilter - sets new filter type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nProfileID - The toolpath profile to use +* @param[in] nPartID - The toolpath part to use +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[in] pPointDataBuffer - Position2D buffer of The point data * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_SetFilterPtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter eFilter); - -/************************************************************************************************************************* - Class definition for BuildItem -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpathLayerData_WritePolylinePtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const sLib3MFPosition2D * pPointDataBuffer); /** -* Retrieves the object resource associated to a build item +* Adds a custom data DOM tree to the layer. Layer MUST not be finished when changing the DOM tree. * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pObjectResource - returns the associated resource instance +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pDataName - Root name of the data tree. MUST not be empty. MUST be a valid XML name string. +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetObjectResourcePtr) (Lib3MF_BuildItem pBuildItem, Lib3MF_Object * pObjectResource); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_AddCustomDataPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData); /** -* returns, whether a build item has a UUID and, if true, the build item's UUID +* finishes all writing of the layer and compresses toolpath data. * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pHasUUID - flag whether the build item has a UUID -* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL +* @param[in] pToolpathLayerData - ToolpathLayerData instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetUUIDPtr) (Lib3MF_BuildItem pBuildItem, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_FinishPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData); + +/************************************************************************************************************************* + Class definition for Toolpath +**************************************************************************************************************************/ /** -* sets the build item's UUID +* Retrieves the unit factor * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' +* @param[in] pToolpath - Toolpath instance. +* @param[out] pUnits - Returns the unit factor. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_SetUUIDPtr) (Lib3MF_BuildItem pBuildItem, const char * pUUID); +typedef Lib3MFResult (*PLib3MFToolpath_GetUnitsPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_double * pUnits); /** -* Retrieves the object UniqueResourceID associated to a build item +* Retrieves the count of layers * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pUniqueResourceID - returns the UniqueResourceID of the object +* @param[in] pToolpath - Toolpath instance. +* @param[out] pCount - Returns the layer count * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetObjectResourceIDPtr) (Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pUniqueResourceID); +typedef Lib3MFResult (*PLib3MFToolpath_GetLayerCountPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount); /** -* Checks, if a build item has a non-identity transformation matrix +* Retrieves the count of profiles * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pHasTransform - returns true, if the transformation matrix is not the identity +* @param[in] pToolpath - Toolpath instance. +* @param[out] pCount - Returns the profile count * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_HasObjectTransformPtr) (Lib3MF_BuildItem pBuildItem, bool * pHasTransform); +typedef Lib3MFResult (*PLib3MFToolpath_GetProfileCountPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount); /** -* Retrieves a build item's transformation matrix. +* Adds a new toolpath layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pTransform - returns the transformation matrix +* @param[in] pToolpath - Toolpath instance. +* @param[in] nZMax - ZMax value +* @param[in] pPath - Package Path +* @param[in] pModelWriter - The model writer that writes out the 3MF. +* @param[out] pLayerData - Returns the layerdata object to write the layer content into. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetObjectTransformPtr) (Lib3MF_BuildItem pBuildItem, sLib3MFTransform * pTransform); +typedef Lib3MFResult (*PLib3MFToolpath_AddLayerPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nZMax, const char * pPath, Lib3MF_Writer pModelWriter, Lib3MF_ToolpathLayerData * pLayerData); /** -* Sets a build item's transformation matrix. +* Retrieves the Attachment of a layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] pTransform - new transformation matrix +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[out] pAttachment - Attachment * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_SetObjectTransformPtr) (Lib3MF_BuildItem pBuildItem, const sLib3MFTransform * pTransform); +typedef Lib3MFResult (*PLib3MFToolpath_GetLayerAttachmentPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_Attachment * pAttachment); /** -* Retrieves a build item's part number string +* Reads the toolpath of a layer. * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) -* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPartNumberBuffer - buffer of Returns a build item's part number string, may be NULL +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[out] pToolpathReader - Toolpath Reader Instance * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetPartNumberPtr) (Lib3MF_BuildItem pBuildItem, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); +typedef Lib3MFResult (*PLib3MFToolpath_ReadLayerDataPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_ToolpathLayerReader * pToolpathReader); /** -* Sets a build item's part number string +* Retrieves the Path of a layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] pSetPartnumber - new part number string for referencing parts from the outside world +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of Package Path, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_SetPartNumberPtr) (Lib3MF_BuildItem pBuildItem, const char * pSetPartnumber); +typedef Lib3MFResult (*PLib3MFToolpath_GetLayerPathPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); /** -* Returns the metadatagroup of this build item +* Retrieves the ZMax of a layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this build item +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[out] pZMax - ZMax value * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetMetaDataGroupPtr) (Lib3MF_BuildItem pBuildItem, Lib3MF_MetaDataGroup * pMetaDataGroup); +typedef Lib3MFResult (*PLib3MFToolpath_GetLayerZMaxPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_uint32 * pZMax); /** -* Returns the outbox of a build item +* Return the z value of a layer in units. * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pOutbox - Outbox of this build item +* @param[in] pToolpath - Toolpath instance. +* @param[in] nLayerIndex - Layer Index. +* @param[out] pZValue - Z Value in Units. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetOutboxPtr) (Lib3MF_BuildItem pBuildItem, sLib3MFBox * pOutbox); - -/************************************************************************************************************************* - Class definition for BuildItemIterator -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpath_GetLayerZPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nLayerIndex, Lib3MF_uint32 * pZValue); /** -* Iterates to the next build item in the list. +* Adds a new profile to the toolpath. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pHasNext - Iterates to the next build item in the list. +* @param[in] pToolpath - Toolpath instance. +* @param[in] pName - the name. +* @param[out] pProfile - Returns the profile. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItemIterator_MoveNextPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasNext); +typedef Lib3MFResult (*PLib3MFToolpath_AddProfilePtr) (Lib3MF_Toolpath pToolpath, const char * pName, Lib3MF_ToolpathProfile * pProfile); /** -* Iterates to the previous build item in the list. +* Returns a profile of the toolpath. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pHasPrevious - Iterates to the previous build item in the list. +* @param[in] pToolpath - Toolpath instance. +* @param[in] nProfileIndex - Layer Index. +* @param[out] pProfile - Returns the profile. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItemIterator_MovePreviousPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasPrevious); +typedef Lib3MFResult (*PLib3MFToolpath_GetProfilePtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nProfileIndex, Lib3MF_ToolpathProfile * pProfile); /** -* Returns the build item the iterator points at. +* Returns a profile of the toolpath by UUID. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pBuildItem - returns the build item instance. +* @param[in] pToolpath - Toolpath instance. +* @param[in] pProfileUUID - UUID string. +* @param[out] pProfile - Returns the profile. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItemIterator_GetCurrentPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItem * pBuildItem); +typedef Lib3MFResult (*PLib3MFToolpath_GetProfileUUIDPtr) (Lib3MF_Toolpath pToolpath, const char * pProfileUUID, Lib3MF_ToolpathProfile * pProfile); /** -* Creates a new build item iterator with the same build item list. +* Retrieves the count of custom data elements. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pOutBuildItemIterator - returns the cloned Iterator instance +* @param[in] pToolpath - Toolpath instance. +* @param[out] pCount - Count * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItemIterator_ClonePtr) (Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItemIterator * pOutBuildItemIterator); +typedef Lib3MFResult (*PLib3MFToolpath_GetCustomDataCountPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount); /** -* Returns the number of build items the iterator captures. +* Retrieves the custom data. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pCount - returns the number of build items the iterator captures. +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItemIterator_CountPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_uint64 * pCount); - -/************************************************************************************************************************* - Class definition for Slice -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpath_GetCustomDataPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_CustomDOMTree * pData); /** -* Set all vertices of a slice. All polygons will be cleared. +* Retrieves the node name of the custom data. * -* @param[in] pSlice - Slice instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[in] pVerticesBuffer - Position2D buffer of contains the positions. +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of Namespace of the custom data tree., may be NULL +* @param[in] nDataNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pDataNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pDataNameBuffer - buffer of Root name of the data tree., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_SetVerticesPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nVerticesBufferSize, const sLib3MFPosition2D * pVerticesBuffer); +typedef Lib3MFResult (*PLib3MFToolpath_GetCustomDataNamePtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer, const Lib3MF_uint32 nDataNameBufferSize, Lib3MF_uint32* pDataNameNeededChars, char * pDataNameBuffer); /** -* Get all vertices of a slice +* Retrieves if custom data with a specific namespace and name combination exists. * -* @param[in] pSlice - Slice instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pVerticesBuffer - Position2D buffer of contains the positions. +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. +* @param[in] pDataName - Root name of the data tree. +* @param[out] pCustomDataExists - Returns true if DOM Tree Exists. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_GetVerticesPtr) (Lib3MF_Slice pSlice, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, sLib3MFPosition2D * pVerticesBuffer); +typedef Lib3MFResult (*PLib3MFToolpath_HasUniqueCustomDataPtr) (Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, bool * pCustomDataExists); /** -* Get the number of vertices in a slice +* Retrieves the custom data with a specific namespace and name combination. Fails if combination is not unique. * -* @param[in] pSlice - Slice instance. -* @param[out] pCount - the number of vertices in the slice +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. +* @param[in] pDataName - Root name of the data tree. +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_GetVertexCountPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); +typedef Lib3MFResult (*PLib3MFToolpath_FindUniqueCustomDataPtr) (Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData); /** -* Add a new polygon to this slice +* Adds a custom data DOM tree to the toolpath. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the new polygon -* @param[out] pIndex - the index of the new polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pDataName - Root name of the data tree. MUST not be empty. MUST be a valid XML name string. +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_AddPolygonPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer, Lib3MF_uint64 * pIndex); +typedef Lib3MFResult (*PLib3MFToolpath_AddCustomDataPtr) (Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData); /** -* Get the number of polygons in the slice +* Deletes all custom data. * -* @param[in] pSlice - Slice instance. -* @param[out] pCount - the number of polygons in the slice +* @param[in] pToolpath - Toolpath instance. +* @param[out] pNumberOfDeletedItems - Returns number of deleted items. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_GetPolygonCountPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); +typedef Lib3MFResult (*PLib3MFToolpath_ClearCustomDataPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pNumberOfDeletedItems); /** -* Set all indices of a polygon +* Deletes a custom data instance from the list. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndex - the index of the polygon to manipulate -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the index-th polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pData - DOM Tree of the data. +* @param[out] pSuccess - Returns if deletion was successful. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_SetPolygonIndicesPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer); +typedef Lib3MFResult (*PLib3MFToolpath_DeleteCustomDataPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_CustomDOMTree pData, bool * pSuccess); /** -* Get all vertices of a slice +* Registers an Integer Attribute that each segment holds. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndex - the index of the polygon to manipulate -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pIndicesBuffer - uint32 buffer of the indices of the index-th polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pAttributeName - Attribute name. MUST not be empty. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_GetPolygonIndicesPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF_uint32 * pIndicesBuffer); +typedef Lib3MFResult (*PLib3MFToolpath_RegisterCustomIntegerAttributePtr) (Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pAttributeName); /** -* Get the number of vertices in a slice +* Registers a Double Attribute that each segment holds. Registering only applies to reader or writer objects created after the call. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndex - the index of the polygon to manipulate -* @param[out] pCount - the number of indices of the index-th polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pAttributeName - Attribute name. MUST not be empty. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_GetPolygonIndexCountPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 * pCount); +typedef Lib3MFResult (*PLib3MFToolpath_RegisterCustomDoubleAttributePtr) (Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pAttributeName); + +/************************************************************************************************************************* + Class definition for ToolpathIterator +**************************************************************************************************************************/ /** -* Get the upper Z-Coordinate of this slice. +* Returns the Toolpath the iterator points at. * -* @param[in] pSlice - Slice instance. -* @param[out] pZTop - the upper Z-Coordinate of this slice +* @param[in] pToolpathIterator - ToolpathIterator instance. +* @param[out] pResource - returns the Toolpath instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_GetZTopPtr) (Lib3MF_Slice pSlice, Lib3MF_double * pZTop); +typedef Lib3MFResult (*PLib3MFToolpathIterator_GetCurrentToolpathPtr) (Lib3MF_ToolpathIterator pToolpathIterator, Lib3MF_Toolpath * pResource); /************************************************************************************************************************* Class definition for SliceStack @@ -3261,6 +4668,15 @@ typedef Lib3MFResult (*PLib3MFModel_GetCompositeMaterialsPtr) (Lib3MF_Model pMod */ typedef Lib3MFResult (*PLib3MFModel_GetMultiPropertyGroupsPtr) (Lib3MF_Model pModel, Lib3MF_MultiPropertyGroupIterator * pResourceIterator); +/** +* creates a Toolpath instance with all toolpath resources. +* +* @param[in] pModel - Model instance. +* @param[out] pResourceIterator - returns the iterator instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_GetToolpathsPtr) (Lib3MF_Model pModel, Lib3MF_ToolpathIterator * pResourceIterator); + /** * creates a resource iterator instance with all slice stack resources. * @@ -3384,6 +4800,16 @@ typedef Lib3MFResult (*PLib3MFModel_AddBuildItemPtr) (Lib3MF_Model pModel, Lib3M */ typedef Lib3MFResult (*PLib3MFModel_RemoveBuildItemPtr) (Lib3MF_Model pModel, Lib3MF_BuildItem pBuildItemInstance); +/** +* adds an empty Toolpath resource to the model. +* +* @param[in] pModel - Model instance. +* @param[in] dUnitFactor - The toolpath instance of the created Toolpath. +* @param[out] pToolpathInstance - The toolpath instance of the created Toolpath. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_AddToolpathPtr) (Lib3MF_Model pModel, Lib3MF_double dUnitFactor, Lib3MF_Toolpath * pToolpathInstance); + /** * Returns the metadata of the model as MetaDataGroup * @@ -3515,6 +4941,40 @@ typedef Lib3MFResult (*PLib3MFModel_SetRandomNumberCallbackPtr) (Lib3MF_Model pM */ typedef Lib3MFResult (*PLib3MFModel_GetKeyStorePtr) (Lib3MF_Model pModel, Lib3MF_KeyStore * pKeyStore); +/** +* Creates an OPC Reader Source from a file. +* +* @param[in] pModel - Model instance. +* @param[in] pFilename - Filename to read from +* @param[out] pInstance - The instance of the created reader source +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_CreatePersistentSourceFromFilePtr) (Lib3MF_Model pModel, const char * pFilename, Lib3MF_PersistentReaderSource * pInstance); + +/** +* Creates an OPC Reader Source from a memory buffer. The memory buffer MUST exist as long as the Source object exists. +* +* @param[in] pModel - Model instance. +* @param[in] nBufferBufferSize - Number of elements in buffer +* @param[in] pBufferBuffer - uint8 buffer of Buffer to read from +* @param[out] pInstance - The instance of the created reader source +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_CreatePersistentSourceFromBufferPtr) (Lib3MF_Model pModel, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer, Lib3MF_PersistentReaderSource * pInstance); + +/** +* Creates an OPC Reader Source from a data provided by a callback function. The callbacks MUST exist as long as the source object exists. +* +* @param[in] pModel - Model instance. +* @param[in] pTheReadCallback - Callback to call for reading a data chunk +* @param[in] nStreamSize - number of bytes the callback returns +* @param[in] pTheSeekCallback - Callback to call for seeking in the stream. +* @param[in] pUserData - Userdata that is passed to the callback function +* @param[out] pInstance - The instance of the created reader source +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_CreatePersistentSourceFromCallbackPtr) (Lib3MF_Model pModel, Lib3MFReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MFSeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData, Lib3MF_PersistentReaderSource * pInstance); + /************************************************************************************************************************* Global functions **************************************************************************************************************************/ @@ -3720,6 +5180,13 @@ typedef Lib3MFResult (*PLib3MFGetTranslationTransformPtr) (Lib3MF_single fVector typedef struct { void * m_LibraryHandle; PLib3MFBase_ClassTypeIdPtr m_Base_ClassTypeId; + PLib3MFBinaryStream_GetBinaryPathPtr m_BinaryStream_GetBinaryPath; + PLib3MFBinaryStream_GetIndexPathPtr m_BinaryStream_GetIndexPath; + PLib3MFBinaryStream_GetUUIDPtr m_BinaryStream_GetUUID; + PLib3MFBinaryStream_DisableDiscretizedArrayCompressionPtr m_BinaryStream_DisableDiscretizedArrayCompression; + PLib3MFBinaryStream_EnableDiscretizedArrayCompressionPtr m_BinaryStream_EnableDiscretizedArrayCompression; + PLib3MFBinaryStream_EnableLZMAPtr m_BinaryStream_EnableLZMA; + PLib3MFBinaryStream_DisableLZMAPtr m_BinaryStream_DisableLZMA; PLib3MFWriter_WriteToFilePtr m_Writer_WriteToFile; PLib3MFWriter_GetStreamSizePtr m_Writer_GetStreamSize; PLib3MFWriter_WriteToBufferPtr m_Writer_WriteToBuffer; @@ -3733,6 +5200,13 @@ typedef struct { PLib3MFWriter_GetWarningCountPtr m_Writer_GetWarningCount; PLib3MFWriter_AddKeyWrappingCallbackPtr m_Writer_AddKeyWrappingCallback; PLib3MFWriter_SetContentEncryptionCallbackPtr m_Writer_SetContentEncryptionCallback; + PLib3MFWriter_CreateBinaryStreamPtr m_Writer_CreateBinaryStream; + PLib3MFWriter_AssignBinaryStreamPtr m_Writer_AssignBinaryStream; + PLib3MFWriter_RegisterCustomNamespacePtr m_Writer_RegisterCustomNamespace; + PLib3MFPersistentReaderSource_GetSourceTypePtr m_PersistentReaderSource_GetSourceType; + PLib3MFPersistentReaderSource_InvalidateSourceDataPtr m_PersistentReaderSource_InvalidateSourceData; + PLib3MFPersistentReaderSource_SourceDataIsValidPtr m_PersistentReaderSource_SourceDataIsValid; + PLib3MFReader_ReadFromPersistentSourcePtr m_Reader_ReadFromPersistentSource; PLib3MFReader_ReadFromFilePtr m_Reader_ReadFromFile; PLib3MFReader_ReadFromBufferPtr m_Reader_ReadFromBuffer; PLib3MFReader_ReadFromCallbackPtr m_Reader_ReadFromCallback; @@ -3757,6 +5231,51 @@ typedef struct { PLib3MFResourceIterator_GetCurrentPtr m_ResourceIterator_GetCurrent; PLib3MFResourceIterator_ClonePtr m_ResourceIterator_Clone; PLib3MFResourceIterator_CountPtr m_ResourceIterator_Count; + PLib3MFCustomXMLAttribute_GetNamePtr m_CustomXMLAttribute_GetName; + PLib3MFCustomXMLAttribute_GetValuePtr m_CustomXMLAttribute_GetValue; + PLib3MFCustomXMLAttribute_IsValidIntegerPtr m_CustomXMLAttribute_IsValidInteger; + PLib3MFCustomXMLAttribute_GetIntegerValuePtr m_CustomXMLAttribute_GetIntegerValue; + PLib3MFCustomXMLAttribute_IsValidDoublePtr m_CustomXMLAttribute_IsValidDouble; + PLib3MFCustomXMLAttribute_GetDoubleValuePtr m_CustomXMLAttribute_GetDoubleValue; + PLib3MFCustomXMLAttribute_IsValidBoolPtr m_CustomXMLAttribute_IsValidBool; + PLib3MFCustomXMLAttribute_GetBoolValuePtr m_CustomXMLAttribute_GetBoolValue; + PLib3MFCustomXMLAttribute_SetValuePtr m_CustomXMLAttribute_SetValue; + PLib3MFCustomXMLAttribute_SetIntegerValuePtr m_CustomXMLAttribute_SetIntegerValue; + PLib3MFCustomXMLAttribute_SetDoubleValuePtr m_CustomXMLAttribute_SetDoubleValue; + PLib3MFCustomXMLAttribute_SetBoolValuePtr m_CustomXMLAttribute_SetBoolValue; + PLib3MFCustomXMLAttribute_RemovePtr m_CustomXMLAttribute_Remove; + PLib3MFCustomXMLNode_GetNamePtr m_CustomXMLNode_GetName; + PLib3MFCustomXMLNode_GetNameSpacePtr m_CustomXMLNode_GetNameSpace; + PLib3MFCustomXMLNode_GetAttributeCountPtr m_CustomXMLNode_GetAttributeCount; + PLib3MFCustomXMLNode_GetAttributePtr m_CustomXMLNode_GetAttribute; + PLib3MFCustomXMLNode_HasAttributePtr m_CustomXMLNode_HasAttribute; + PLib3MFCustomXMLNode_FindAttributePtr m_CustomXMLNode_FindAttribute; + PLib3MFCustomXMLNode_RemoveAttributePtr m_CustomXMLNode_RemoveAttribute; + PLib3MFCustomXMLNode_RemoveAttributeByIndexPtr m_CustomXMLNode_RemoveAttributeByIndex; + PLib3MFCustomXMLNode_AddAttributePtr m_CustomXMLNode_AddAttribute; + PLib3MFCustomXMLNode_AddIntegerAttributePtr m_CustomXMLNode_AddIntegerAttribute; + PLib3MFCustomXMLNode_AddDoubleAttributePtr m_CustomXMLNode_AddDoubleAttribute; + PLib3MFCustomXMLNode_AddBoolAttributePtr m_CustomXMLNode_AddBoolAttribute; + PLib3MFCustomXMLNode_GetChildrenPtr m_CustomXMLNode_GetChildren; + PLib3MFCustomXMLNode_CountChildrenByNamePtr m_CustomXMLNode_CountChildrenByName; + PLib3MFCustomXMLNode_GetChildrenByNamePtr m_CustomXMLNode_GetChildrenByName; + PLib3MFCustomXMLNode_HasChildPtr m_CustomXMLNode_HasChild; + PLib3MFCustomXMLNode_HasUniqueChildPtr m_CustomXMLNode_HasUniqueChild; + PLib3MFCustomXMLNode_FindChildPtr m_CustomXMLNode_FindChild; + PLib3MFCustomXMLNode_AddChildPtr m_CustomXMLNode_AddChild; + PLib3MFCustomXMLNode_RemoveChildPtr m_CustomXMLNode_RemoveChild; + PLib3MFCustomXMLNode_RemoveChildrenWithNamePtr m_CustomXMLNode_RemoveChildrenWithName; + PLib3MFCustomXMLNode_RemovePtr m_CustomXMLNode_Remove; + PLib3MFCustomXMLNodes_GetNodeCountPtr m_CustomXMLNodes_GetNodeCount; + PLib3MFCustomXMLNodes_GetNodePtr m_CustomXMLNodes_GetNode; + PLib3MFCustomXMLNodes_CountNodesByNamePtr m_CustomXMLNodes_CountNodesByName; + PLib3MFCustomXMLNodes_GetNodesByNamePtr m_CustomXMLNodes_GetNodesByName; + PLib3MFCustomXMLNodes_HasNodePtr m_CustomXMLNodes_HasNode; + PLib3MFCustomXMLNodes_HasUniqueNodePtr m_CustomXMLNodes_HasUniqueNode; + PLib3MFCustomXMLNodes_FindNodePtr m_CustomXMLNodes_FindNode; + PLib3MFCustomDOMTree_GetNameSpacePtr m_CustomDOMTree_GetNameSpace; + PLib3MFCustomDOMTree_GetRootNodePtr m_CustomDOMTree_GetRootNode; + PLib3MFCustomDOMTree_SaveToStringPtr m_CustomDOMTree_SaveToString; PLib3MFSliceStackIterator_GetCurrentSliceStackPtr m_SliceStackIterator_GetCurrentSliceStack; PLib3MFObjectIterator_GetCurrentObjectPtr m_ObjectIterator_GetCurrentObject; PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr m_MeshObjectIterator_GetCurrentMeshObject; @@ -3949,6 +5468,78 @@ typedef struct { PLib3MFSlice_GetPolygonIndicesPtr m_Slice_GetPolygonIndices; PLib3MFSlice_GetPolygonIndexCountPtr m_Slice_GetPolygonIndexCount; PLib3MFSlice_GetZTopPtr m_Slice_GetZTop; + PLib3MFToolpathProfile_GetUUIDPtr m_ToolpathProfile_GetUUID; + PLib3MFToolpathProfile_GetNamePtr m_ToolpathProfile_GetName; + PLib3MFToolpathProfile_GetParameterCountPtr m_ToolpathProfile_GetParameterCount; + PLib3MFToolpathProfile_GetParameterNamePtr m_ToolpathProfile_GetParameterName; + PLib3MFToolpathProfile_GetParameterNameSpacePtr m_ToolpathProfile_GetParameterNameSpace; + PLib3MFToolpathProfile_HasParameterValuePtr m_ToolpathProfile_HasParameterValue; + PLib3MFToolpathProfile_GetParameterValuePtr m_ToolpathProfile_GetParameterValue; + PLib3MFToolpathProfile_GetParameterValueDefPtr m_ToolpathProfile_GetParameterValueDef; + PLib3MFToolpathProfile_GetParameterDoubleValuePtr m_ToolpathProfile_GetParameterDoubleValue; + PLib3MFToolpathProfile_GetParameterDoubleValueDefPtr m_ToolpathProfile_GetParameterDoubleValueDef; + PLib3MFToolpathProfile_GetParameterIntegerValuePtr m_ToolpathProfile_GetParameterIntegerValue; + PLib3MFToolpathProfile_GetParameterIntegerValueDefPtr m_ToolpathProfile_GetParameterIntegerValueDef; + PLib3MFToolpathProfile_GetParameterBoolValuePtr m_ToolpathProfile_GetParameterBoolValue; + PLib3MFToolpathProfile_GetParameterBoolValueDefPtr m_ToolpathProfile_GetParameterBoolValueDef; + PLib3MFToolpathProfile_SetNamePtr m_ToolpathProfile_SetName; + PLib3MFToolpathProfile_SetParameterValuePtr m_ToolpathProfile_SetParameterValue; + PLib3MFToolpathProfile_SetParameterDoubleValuePtr m_ToolpathProfile_SetParameterDoubleValue; + PLib3MFToolpathProfile_SetParameterIntegerValuePtr m_ToolpathProfile_SetParameterIntegerValue; + PLib3MFToolpathProfile_SetParameterBoolValuePtr m_ToolpathProfile_SetParameterBoolValue; + PLib3MFToolpathLayerReader_GetLayerDataUUIDPtr m_ToolpathLayerReader_GetLayerDataUUID; + PLib3MFToolpathLayerReader_GetSegmentCountPtr m_ToolpathLayerReader_GetSegmentCount; + PLib3MFToolpathLayerReader_GetSegmentInfoPtr m_ToolpathLayerReader_GetSegmentInfo; + PLib3MFToolpathLayerReader_GetSegmentProfilePtr m_ToolpathLayerReader_GetSegmentProfile; + PLib3MFToolpathLayerReader_GetSegmentProfileUUIDPtr m_ToolpathLayerReader_GetSegmentProfileUUID; + PLib3MFToolpathLayerReader_GetSegmentPartPtr m_ToolpathLayerReader_GetSegmentPart; + PLib3MFToolpathLayerReader_GetSegmentPartUUIDPtr m_ToolpathLayerReader_GetSegmentPartUUID; + PLib3MFToolpathLayerReader_GetSegmentLocalPartIDPtr m_ToolpathLayerReader_GetSegmentLocalPartID; + PLib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDPtr m_ToolpathLayerReader_GetPartUUIDByLocalPartID; + PLib3MFToolpathLayerReader_GetSegmentPointDataPtr m_ToolpathLayerReader_GetSegmentPointData; + PLib3MFToolpathLayerReader_FindAttributeInfoByNamePtr m_ToolpathLayerReader_FindAttributeInfoByName; + PLib3MFToolpathLayerReader_FindAttributeIDByNamePtr m_ToolpathLayerReader_FindAttributeIDByName; + PLib3MFToolpathLayerReader_FindAttributeValueByNamePtr m_ToolpathLayerReader_FindAttributeValueByName; + PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByIDPtr m_ToolpathLayerReader_GetSegmentIntegerAttributeByID; + PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByNamePtr m_ToolpathLayerReader_GetSegmentIntegerAttributeByName; + PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByIDPtr m_ToolpathLayerReader_GetSegmentDoubleAttributeByID; + PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByNamePtr m_ToolpathLayerReader_GetSegmentDoubleAttributeByName; + PLib3MFToolpathLayerReader_GetCustomDataCountPtr m_ToolpathLayerReader_GetCustomDataCount; + PLib3MFToolpathLayerReader_GetCustomDataPtr m_ToolpathLayerReader_GetCustomData; + PLib3MFToolpathLayerReader_GetCustomDataNamePtr m_ToolpathLayerReader_GetCustomDataName; + PLib3MFToolpathLayerData_GetLayerDataUUIDPtr m_ToolpathLayerData_GetLayerDataUUID; + PLib3MFToolpathLayerData_RegisterProfilePtr m_ToolpathLayerData_RegisterProfile; + PLib3MFToolpathLayerData_RegisterBuildItemPtr m_ToolpathLayerData_RegisterBuildItem; + PLib3MFToolpathLayerData_SetSegmentAttributePtr m_ToolpathLayerData_SetSegmentAttribute; + PLib3MFToolpathLayerData_ClearSegmentAttributesPtr m_ToolpathLayerData_ClearSegmentAttributes; + PLib3MFToolpathLayerData_WriteHatchDataPtr m_ToolpathLayerData_WriteHatchData; + PLib3MFToolpathLayerData_WriteLoopPtr m_ToolpathLayerData_WriteLoop; + PLib3MFToolpathLayerData_WritePolylinePtr m_ToolpathLayerData_WritePolyline; + PLib3MFToolpathLayerData_AddCustomDataPtr m_ToolpathLayerData_AddCustomData; + PLib3MFToolpathLayerData_FinishPtr m_ToolpathLayerData_Finish; + PLib3MFToolpath_GetUnitsPtr m_Toolpath_GetUnits; + PLib3MFToolpath_GetLayerCountPtr m_Toolpath_GetLayerCount; + PLib3MFToolpath_GetProfileCountPtr m_Toolpath_GetProfileCount; + PLib3MFToolpath_AddLayerPtr m_Toolpath_AddLayer; + PLib3MFToolpath_GetLayerAttachmentPtr m_Toolpath_GetLayerAttachment; + PLib3MFToolpath_ReadLayerDataPtr m_Toolpath_ReadLayerData; + PLib3MFToolpath_GetLayerPathPtr m_Toolpath_GetLayerPath; + PLib3MFToolpath_GetLayerZMaxPtr m_Toolpath_GetLayerZMax; + PLib3MFToolpath_GetLayerZPtr m_Toolpath_GetLayerZ; + PLib3MFToolpath_AddProfilePtr m_Toolpath_AddProfile; + PLib3MFToolpath_GetProfilePtr m_Toolpath_GetProfile; + PLib3MFToolpath_GetProfileUUIDPtr m_Toolpath_GetProfileUUID; + PLib3MFToolpath_GetCustomDataCountPtr m_Toolpath_GetCustomDataCount; + PLib3MFToolpath_GetCustomDataPtr m_Toolpath_GetCustomData; + PLib3MFToolpath_GetCustomDataNamePtr m_Toolpath_GetCustomDataName; + PLib3MFToolpath_HasUniqueCustomDataPtr m_Toolpath_HasUniqueCustomData; + PLib3MFToolpath_FindUniqueCustomDataPtr m_Toolpath_FindUniqueCustomData; + PLib3MFToolpath_AddCustomDataPtr m_Toolpath_AddCustomData; + PLib3MFToolpath_ClearCustomDataPtr m_Toolpath_ClearCustomData; + PLib3MFToolpath_DeleteCustomDataPtr m_Toolpath_DeleteCustomData; + PLib3MFToolpath_RegisterCustomIntegerAttributePtr m_Toolpath_RegisterCustomIntegerAttribute; + PLib3MFToolpath_RegisterCustomDoubleAttributePtr m_Toolpath_RegisterCustomDoubleAttribute; + PLib3MFToolpathIterator_GetCurrentToolpathPtr m_ToolpathIterator_GetCurrentToolpath; PLib3MFSliceStack_GetBottomZPtr m_SliceStack_GetBottomZ; PLib3MFSliceStack_GetSliceCountPtr m_SliceStack_GetSliceCount; PLib3MFSliceStack_GetSlicePtr m_SliceStack_GetSlice; @@ -4032,6 +5623,7 @@ typedef struct { PLib3MFModel_GetTexture2DGroupsPtr m_Model_GetTexture2DGroups; PLib3MFModel_GetCompositeMaterialsPtr m_Model_GetCompositeMaterials; PLib3MFModel_GetMultiPropertyGroupsPtr m_Model_GetMultiPropertyGroups; + PLib3MFModel_GetToolpathsPtr m_Model_GetToolpaths; PLib3MFModel_GetSliceStacksPtr m_Model_GetSliceStacks; PLib3MFModel_MergeToModelPtr m_Model_MergeToModel; PLib3MFModel_AddMeshObjectPtr m_Model_AddMeshObject; @@ -4045,6 +5637,7 @@ typedef struct { PLib3MFModel_AddMultiPropertyGroupPtr m_Model_AddMultiPropertyGroup; PLib3MFModel_AddBuildItemPtr m_Model_AddBuildItem; PLib3MFModel_RemoveBuildItemPtr m_Model_RemoveBuildItem; + PLib3MFModel_AddToolpathPtr m_Model_AddToolpath; PLib3MFModel_GetMetaDataGroupPtr m_Model_GetMetaDataGroup; PLib3MFModel_AddAttachmentPtr m_Model_AddAttachment; PLib3MFModel_RemoveAttachmentPtr m_Model_RemoveAttachment; @@ -4059,6 +5652,9 @@ typedef struct { PLib3MFModel_RemoveCustomContentTypePtr m_Model_RemoveCustomContentType; PLib3MFModel_SetRandomNumberCallbackPtr m_Model_SetRandomNumberCallback; PLib3MFModel_GetKeyStorePtr m_Model_GetKeyStore; + PLib3MFModel_CreatePersistentSourceFromFilePtr m_Model_CreatePersistentSourceFromFile; + PLib3MFModel_CreatePersistentSourceFromBufferPtr m_Model_CreatePersistentSourceFromBuffer; + PLib3MFModel_CreatePersistentSourceFromCallbackPtr m_Model_CreatePersistentSourceFromCallback; PLib3MFGetLibraryVersionPtr m_GetLibraryVersion; PLib3MFGetPrereleaseInformationPtr m_GetPrereleaseInformation; PLib3MFGetBuildInformationPtr m_GetBuildInformation; diff --git a/Autogenerated/Bindings/CDynamic/lib3mf_types.h b/Autogenerated/Bindings/CDynamic/lib3mf_types.h index 6f2dcf6a4..ed4941824 100644 --- a/Autogenerated/Bindings/CDynamic/lib3mf_types.h +++ b/Autogenerated/Bindings/CDynamic/lib3mf_types.h @@ -130,13 +130,27 @@ typedef void * Lib3MF_pvoid; #define LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER 140 /** A progress identifier is unknown */ #define LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT 141 /** An element buffer exceeds its spec limit */ #define LIB3MF_ERROR_INVALIDRESOURCE 142 /** A resource is invalid */ +#define LIB3MF_ERROR_INVALIDNODEINDEX 143 /** Invalid node index */ +#define LIB3MF_ERROR_INVALIDATTRIBUTEINDEX 144 /** Invalid attribute index */ +#define LIB3MF_ERROR_DUPLICATECUSTOMDATA 145 /** Duplicate custom data */ +#define LIB3MF_ERROR_CUSTOMDATANOTFOUND 146 /** Custom data not found */ #define LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE 2000 /** This object type is not valid for beamlattices */ #define LIB3MF_ERROR_INVALIDKEYSTORE 3000 /** The keystore object is invalid */ #define LIB3MF_ERROR_INVALIDKEYSTORECONSUMER 3001 /** The consumer keystore object is invalid */ #define LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND 3002 /** A consumer has not been found */ #define LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND 3003 /** A resource data has not been found */ #define LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED 3004 /** A Key or Conentent encryption callback has not been registered */ -#define LIB3MF_ERROR_INVALIDKEYSIZE 3005 /** The key siue is invalid */ +#define LIB3MF_ERROR_INVALIDKEYSIZE 3005 /** The key size is invalid */ +#define LIB3MF_ERROR_TOOLPATH_NOTWRITINGHEADER 4000 /** Not in toolpath header writing mode */ +#define LIB3MF_ERROR_TOOLPATH_NOTWRITINGDATA 4001 /** Not in toolpath data writing mode */ +#define LIB3MF_ERROR_TOOLPATH_DATAHASBEENWRITTEN 4002 /** Toolpath has already been written out */ +#define LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT 4003 /** Toolpath has an invalid number of points */ +#define LIB3MF_ERROR_TOOLPATH_ATTRIBUTEALREADYDEFINED 4004 /** Toolpath attribute already defined */ +#define LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE 4005 /** Toolpath attribute is of invalid type */ +#define LIB3MF_ERROR_EMPTYNAMESPACEPREFIX 4006 /** Empty namespace prefix. */ +#define LIB3MF_ERROR_EMPTYNAMESPACE 4007 /** Empty namespace. */ +#define LIB3MF_ERROR_INVALIDNAMESPACEPREFIX 4008 /** Invalid namespace prefix. */ +#define LIB3MF_ERROR_WRITERDOESNOTSUPPORTNAMESPACES 4009 /** Writer does not support namespaces. */ /************************************************************************************************************************* Error strings for Lib3MF @@ -181,13 +195,27 @@ inline const char * LIB3MF_GETERRORSTRING (Lib3MFResult nErrorCode) { case LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER: return "A progress identifier is unknown"; case LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT: return "An element buffer exceeds its spec limit"; case LIB3MF_ERROR_INVALIDRESOURCE: return "A resource is invalid"; + case LIB3MF_ERROR_INVALIDNODEINDEX: return "Invalid node index"; + case LIB3MF_ERROR_INVALIDATTRIBUTEINDEX: return "Invalid attribute index"; + case LIB3MF_ERROR_DUPLICATECUSTOMDATA: return "Duplicate custom data"; + case LIB3MF_ERROR_CUSTOMDATANOTFOUND: return "Custom data not found"; case LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE: return "This object type is not valid for beamlattices"; case LIB3MF_ERROR_INVALIDKEYSTORE: return "The keystore object is invalid"; case LIB3MF_ERROR_INVALIDKEYSTORECONSUMER: return "The consumer keystore object is invalid"; case LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND: return "A consumer has not been found"; case LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND: return "A resource data has not been found"; case LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED: return "A Key or Conentent encryption callback has not been registered"; - case LIB3MF_ERROR_INVALIDKEYSIZE: return "The key siue is invalid"; + case LIB3MF_ERROR_INVALIDKEYSIZE: return "The key size is invalid"; + case LIB3MF_ERROR_TOOLPATH_NOTWRITINGHEADER: return "Not in toolpath header writing mode"; + case LIB3MF_ERROR_TOOLPATH_NOTWRITINGDATA: return "Not in toolpath data writing mode"; + case LIB3MF_ERROR_TOOLPATH_DATAHASBEENWRITTEN: return "Toolpath has already been written out"; + case LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT: return "Toolpath has an invalid number of points"; + case LIB3MF_ERROR_TOOLPATH_ATTRIBUTEALREADYDEFINED: return "Toolpath attribute already defined"; + case LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE: return "Toolpath attribute is of invalid type"; + case LIB3MF_ERROR_EMPTYNAMESPACEPREFIX: return "Empty namespace prefix."; + case LIB3MF_ERROR_EMPTYNAMESPACE: return "Empty namespace."; + case LIB3MF_ERROR_INVALIDNAMESPACEPREFIX: return "Invalid namespace prefix."; + case LIB3MF_ERROR_WRITERDOESNOTSUPPORTNAMESPACES: return "Writer does not support namespaces."; default: return "unknown error"; } } @@ -197,11 +225,17 @@ inline const char * LIB3MF_GETERRORSTRING (Lib3MFResult nErrorCode) { **************************************************************************************************************************/ typedef Lib3MFHandle Lib3MF_Base; +typedef Lib3MFHandle Lib3MF_BinaryStream; typedef Lib3MFHandle Lib3MF_Writer; +typedef Lib3MFHandle Lib3MF_PersistentReaderSource; typedef Lib3MFHandle Lib3MF_Reader; typedef Lib3MFHandle Lib3MF_PackagePart; typedef Lib3MFHandle Lib3MF_Resource; typedef Lib3MFHandle Lib3MF_ResourceIterator; +typedef Lib3MFHandle Lib3MF_CustomXMLAttribute; +typedef Lib3MFHandle Lib3MF_CustomXMLNode; +typedef Lib3MFHandle Lib3MF_CustomXMLNodes; +typedef Lib3MFHandle Lib3MF_CustomDOMTree; typedef Lib3MFHandle Lib3MF_SliceStackIterator; typedef Lib3MFHandle Lib3MF_ObjectIterator; typedef Lib3MFHandle Lib3MF_MeshObjectIterator; @@ -230,6 +264,11 @@ typedef Lib3MFHandle Lib3MF_Texture2D; typedef Lib3MFHandle Lib3MF_BuildItem; typedef Lib3MFHandle Lib3MF_BuildItemIterator; typedef Lib3MFHandle Lib3MF_Slice; +typedef Lib3MFHandle Lib3MF_ToolpathProfile; +typedef Lib3MFHandle Lib3MF_ToolpathLayerReader; +typedef Lib3MFHandle Lib3MF_ToolpathLayerData; +typedef Lib3MFHandle Lib3MF_Toolpath; +typedef Lib3MFHandle Lib3MF_ToolpathIterator; typedef Lib3MFHandle Lib3MF_SliceStack; typedef Lib3MFHandle Lib3MF_Consumer; typedef Lib3MFHandle Lib3MF_AccessRight; @@ -257,6 +296,13 @@ typedef enum eLib3MFSlicesMeshResolution { eSlicesMeshResolutionLowres = 1 } eLib3MFSlicesMeshResolution; +typedef enum eLib3MFPersistentReaderSourceType { + ePersistentReaderSourceTypeUnknown = 0, + ePersistentReaderSourceTypeFileOnDisk = 1, + ePersistentReaderSourceTypeMemoryBuffer = 2, + ePersistentReaderSourceTypeCallback = 3 +} eLib3MFPersistentReaderSourceType; + typedef enum eLib3MFModelUnit { eModelUnitMicroMeter = 0, eModelUnitMilliMeter = 1, @@ -310,6 +356,11 @@ typedef enum eLib3MFBeamLatticeBallMode { eBeamLatticeBallModeAll = 2 } eLib3MFBeamLatticeBallMode; +typedef enum eLib3MFBinaryStreamPredictionType { + eBinaryStreamPredictionTypeNoPrediction = 0, + eBinaryStreamPredictionTypeDeltaPrediction = 1 +} eLib3MFBinaryStreamPredictionType; + typedef enum eLib3MFProgressIdentifier { eProgressIdentifierQUERYCANCELED = 0, eProgressIdentifierDONE = 1, @@ -343,6 +394,19 @@ typedef enum eLib3MFBlendMethod { eBlendMethodMultiply = 2 } eLib3MFBlendMethod; +typedef enum eLib3MFToolpathSegmentType { + eToolpathSegmentTypeUnknown = 0, + eToolpathSegmentTypeHatch = 1, + eToolpathSegmentTypeLoop = 2, + eToolpathSegmentTypePolyline = 3 +} eLib3MFToolpathSegmentType; + +typedef enum eLib3MFToolpathAttributeType { + eToolpathAttributeTypeUnknown = 0, + eToolpathAttributeTypeInteger = 1, + eToolpathAttributeTypeDouble = 2 +} eLib3MFToolpathAttributeType; + typedef enum eLib3MFEncryptionAlgorithm { eEncryptionAlgorithmAES256_GCM = 1 /** http://www.w3.org/2009/xmlenc11#aes256-gcm */ } eLib3MFEncryptionAlgorithm; @@ -383,6 +447,11 @@ typedef union { int m_code; } structEnumLib3MFSlicesMeshResolution; +typedef union { + eLib3MFPersistentReaderSourceType m_enum; + int m_code; +} structEnumLib3MFPersistentReaderSourceType; + typedef union { eLib3MFModelUnit m_enum; int m_code; @@ -423,6 +492,11 @@ typedef union { int m_code; } structEnumLib3MFBeamLatticeBallMode; +typedef union { + eLib3MFBinaryStreamPredictionType m_enum; + int m_code; +} structEnumLib3MFBinaryStreamPredictionType; + typedef union { eLib3MFProgressIdentifier m_enum; int m_code; @@ -433,6 +507,16 @@ typedef union { int m_code; } structEnumLib3MFBlendMethod; +typedef union { + eLib3MFToolpathSegmentType m_enum; + int m_code; +} structEnumLib3MFToolpathSegmentType; + +typedef union { + eLib3MFToolpathAttributeType m_enum; + int m_code; +} structEnumLib3MFToolpathAttributeType; + typedef union { eLib3MFEncryptionAlgorithm m_enum; int m_code; diff --git a/Autogenerated/Bindings/CSharp/Lib3MF.cs b/Autogenerated/Bindings/CSharp/Lib3MF.cs index 9caaa404a..dfe4d8864 100644 --- a/Autogenerated/Bindings/CSharp/Lib3MF.cs +++ b/Autogenerated/Bindings/CSharp/Lib3MF.cs @@ -53,6 +53,13 @@ public enum eSlicesMeshResolution { Lowres = 1 }; + public enum ePersistentReaderSourceType { + Unknown = 0, + FileOnDisk = 1, + MemoryBuffer = 2, + Callback = 3 + }; + public enum eModelUnit { MicroMeter = 0, MilliMeter = 1, @@ -106,6 +113,11 @@ public enum eBeamLatticeBallMode { All = 2 }; + public enum eBinaryStreamPredictionType { + NoPrediction = 0, + DeltaPrediction = 1 + }; + public enum eProgressIdentifier { QUERYCANCELED = 0, DONE = 1, @@ -139,6 +151,19 @@ public enum eBlendMethod { Multiply = 2 }; + public enum eToolpathSegmentType { + Unknown = 0, + Hatch = 1, + Loop = 2, + Polyline = 3 + }; + + public enum eToolpathAttributeType { + Unknown = 0, + Integer = 1, + Double = 2 + }; + public enum eEncryptionAlgorithm { AES256_GCM = 1 }; @@ -328,6 +353,27 @@ public class Lib3MFWrapper [DllImport("lib3mf.dll", EntryPoint = "lib3mf_base_classtypeid", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 Base_ClassTypeId (IntPtr Handle, out UInt64 AClassTypeId); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_binarystream_getbinarypath", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BinaryStream_GetBinaryPath (IntPtr Handle, UInt32 sizePath, out UInt32 neededPath, IntPtr dataPath); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_binarystream_getindexpath", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BinaryStream_GetIndexPath (IntPtr Handle, UInt32 sizePath, out UInt32 neededPath, IntPtr dataPath); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_binarystream_getuuid", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BinaryStream_GetUUID (IntPtr Handle, UInt32 sizeUUID, out UInt32 neededUUID, IntPtr dataUUID); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_binarystream_disablediscretizedarraycompression", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BinaryStream_DisableDiscretizedArrayCompression (IntPtr Handle); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_binarystream_enablediscretizedarraycompression", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BinaryStream_EnableDiscretizedArrayCompression (IntPtr Handle, Double AUnits, Int32 APredictionType); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_binarystream_enablelzma", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BinaryStream_EnableLZMA (IntPtr Handle, UInt32 ALZMALevel); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_binarystream_disablelzma", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 BinaryStream_DisableLZMA (IntPtr Handle); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_writer_writetofile", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 Writer_WriteToFile (IntPtr Handle, byte[] AFilename); @@ -367,6 +413,27 @@ public class Lib3MFWrapper [DllImport("lib3mf.dll", EntryPoint = "lib3mf_writer_setcontentencryptioncallback", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 Writer_SetContentEncryptionCallback (IntPtr Handle, IntPtr ATheCallback, UInt64 AUserData); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_writer_createbinarystream", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Writer_CreateBinaryStream (IntPtr Handle, byte[] AIndexPath, byte[] ABinaryPath, out IntPtr ABinaryStream); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_writer_assignbinarystream", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Writer_AssignBinaryStream (IntPtr Handle, IntPtr AInstance, IntPtr ABinaryStream); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_writer_registercustomnamespace", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Writer_RegisterCustomNamespace (IntPtr Handle, byte[] APrefix, byte[] ANameSpace); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_persistentreadersource_getsourcetype", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 PersistentReaderSource_GetSourceType (IntPtr Handle, out Int32 ASourceType); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_persistentreadersource_invalidatesourcedata", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 PersistentReaderSource_InvalidateSourceData (IntPtr Handle); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_persistentreadersource_sourcedataisvalid", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 PersistentReaderSource_SourceDataIsValid (IntPtr Handle, out Byte ADataIsValid); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_reader_readfrompersistentsource", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Reader_ReadFromPersistentSource (IntPtr Handle, IntPtr ASource); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_reader_readfromfile", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 Reader_ReadFromFile (IntPtr Handle, byte[] AFilename); @@ -439,6 +506,141 @@ public class Lib3MFWrapper [DllImport("lib3mf.dll", EntryPoint = "lib3mf_resourceiterator_count", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 ResourceIterator_Count (IntPtr Handle, out UInt64 ACount); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlattribute_getname", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLAttribute_GetName (IntPtr Handle, UInt32 sizeName, out UInt32 neededName, IntPtr dataName); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlattribute_getvalue", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLAttribute_GetValue (IntPtr Handle, UInt32 sizeValue, out UInt32 neededValue, IntPtr dataValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlattribute_isvalidinteger", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLAttribute_IsValidInteger (IntPtr Handle, Int64 AMinValue, Int64 AMaxValue, out Byte AIsValid); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlattribute_getintegervalue", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLAttribute_GetIntegerValue (IntPtr Handle, Int64 AMinValue, Int64 AMaxValue, out Int64 AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlattribute_isvaliddouble", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLAttribute_IsValidDouble (IntPtr Handle, Double AMinValue, Double AMaxValue, out Byte AIsValid); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlattribute_getdoublevalue", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLAttribute_GetDoubleValue (IntPtr Handle, Double AMinValue, Double AMaxValue, out Double AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlattribute_isvalidbool", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLAttribute_IsValidBool (IntPtr Handle, out Byte AIsValid); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlattribute_getboolvalue", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLAttribute_GetBoolValue (IntPtr Handle, Double AMinValue, Double AMaxValue, out Byte AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlattribute_setvalue", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLAttribute_SetValue (IntPtr Handle, byte[] AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlattribute_setintegervalue", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLAttribute_SetIntegerValue (IntPtr Handle, Int64 AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlattribute_setdoublevalue", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLAttribute_SetDoubleValue (IntPtr Handle, Double AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlattribute_setboolvalue", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLAttribute_SetBoolValue (IntPtr Handle, Byte AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlattribute_remove", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLAttribute_Remove (IntPtr Handle); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnode_getname", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNode_GetName (IntPtr Handle, UInt32 sizeName, out UInt32 neededName, IntPtr dataName); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnode_getnamespace", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNode_GetNameSpace (IntPtr Handle, UInt32 sizeNameSpace, out UInt32 neededNameSpace, IntPtr dataNameSpace); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnode_getattributecount", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNode_GetAttributeCount (IntPtr Handle, out UInt64 ACount); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnode_getattribute", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNode_GetAttribute (IntPtr Handle, UInt64 AIndex, out IntPtr AAttributeInstance); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnode_hasattribute", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNode_HasAttribute (IntPtr Handle, byte[] AName, out Byte AAttributeExists); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnode_findattribute", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNode_FindAttribute (IntPtr Handle, byte[] AName, Byte AMustExist, out IntPtr AAttributeInstance); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnode_removeattribute", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNode_RemoveAttribute (IntPtr Handle, byte[] AName, out Byte AAttributeRemoved); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnode_removeattributebyindex", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNode_RemoveAttributeByIndex (IntPtr Handle, UInt64 AIndex, out Byte AAttributeRemoved); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnode_addattribute", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNode_AddAttribute (IntPtr Handle, byte[] AName, byte[] AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnode_addintegerattribute", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNode_AddIntegerAttribute (IntPtr Handle, byte[] AName, Int64 AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnode_adddoubleattribute", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNode_AddDoubleAttribute (IntPtr Handle, byte[] AName, Double AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnode_addboolattribute", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNode_AddBoolAttribute (IntPtr Handle, byte[] AName, Byte AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnode_getchildren", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNode_GetChildren (IntPtr Handle, out IntPtr AChildNodes); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnode_countchildrenbyname", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNode_CountChildrenByName (IntPtr Handle, byte[] AName, out UInt64 ACount); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnode_getchildrenbyname", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNode_GetChildrenByName (IntPtr Handle, byte[] AName, out IntPtr AChildNodes); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnode_haschild", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNode_HasChild (IntPtr Handle, byte[] AName, out Byte AChildExists); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnode_hasuniquechild", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNode_HasUniqueChild (IntPtr Handle, byte[] AName, out Byte AChildExists); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnode_findchild", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNode_FindChild (IntPtr Handle, byte[] AName, Byte AMustExist, out IntPtr AChildInstance); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnode_addchild", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNode_AddChild (IntPtr Handle, byte[] AName, out IntPtr AChildInstance); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnode_removechild", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNode_RemoveChild (IntPtr Handle, IntPtr AChildInstance); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnode_removechildrenwithname", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNode_RemoveChildrenWithName (IntPtr Handle, byte[] AName, out UInt64 ANumberOfDeletedChildren); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnode_remove", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNode_Remove (IntPtr Handle); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnodes_getnodecount", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNodes_GetNodeCount (IntPtr Handle, out UInt64 ACount); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnodes_getnode", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNodes_GetNode (IntPtr Handle, UInt64 AIndex, out IntPtr ANodeInstance); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnodes_countnodesbyname", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNodes_CountNodesByName (IntPtr Handle, byte[] AName, out UInt64 ACount); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnodes_getnodesbyname", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNodes_GetNodesByName (IntPtr Handle, byte[] AName, out IntPtr ANodes); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnodes_hasnode", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNodes_HasNode (IntPtr Handle, byte[] AName, out Byte ANodeExists); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnodes_hasuniquenode", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNodes_HasUniqueNode (IntPtr Handle, byte[] AName, out Byte ANodeExists); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customxmlnodes_findnode", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomXMLNodes_FindNode (IntPtr Handle, byte[] AName, Byte AMustExist, out IntPtr ANodeInstance); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customdomtree_getnamespace", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomDOMTree_GetNameSpace (IntPtr Handle, UInt32 sizeNameSpace, out UInt32 neededNameSpace, IntPtr dataNameSpace); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customdomtree_getrootnode", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomDOMTree_GetRootNode (IntPtr Handle, out IntPtr ARootNode); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_customdomtree_savetostring", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 CustomDOMTree_SaveToString (IntPtr Handle, UInt32 sizeXMLString, out UInt32 neededXMLString, IntPtr dataXMLString); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_slicestackiterator_getcurrentslicestack", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 SliceStackIterator_GetCurrentSliceStack (IntPtr Handle, out IntPtr AResource); @@ -1015,6 +1217,222 @@ public class Lib3MFWrapper [DllImport("lib3mf.dll", EntryPoint = "lib3mf_slice_getztop", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 Slice_GetZTop (IntPtr Handle, out Double AZTop); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathprofile_getuuid", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathProfile_GetUUID (IntPtr Handle, UInt32 sizeUUID, out UInt32 neededUUID, IntPtr dataUUID); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathprofile_getname", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathProfile_GetName (IntPtr Handle, UInt32 sizeName, out UInt32 neededName, IntPtr dataName); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathprofile_getparametercount", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathProfile_GetParameterCount (IntPtr Handle, out UInt32 ACount); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathprofile_getparametername", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathProfile_GetParameterName (IntPtr Handle, UInt32 AIndex, UInt32 sizeName, out UInt32 neededName, IntPtr dataName); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathprofile_getparameternamespace", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathProfile_GetParameterNameSpace (IntPtr Handle, UInt32 AIndex, UInt32 sizeNameSpace, out UInt32 neededNameSpace, IntPtr dataNameSpace); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathprofile_hasparametervalue", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathProfile_HasParameterValue (IntPtr Handle, byte[] ANameSpaceName, byte[] AValueName, out Byte AValueExists); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathprofile_getparametervalue", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathProfile_GetParameterValue (IntPtr Handle, byte[] ANameSpaceName, byte[] AValueName, UInt32 sizeValue, out UInt32 neededValue, IntPtr dataValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathprofile_getparametervaluedef", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathProfile_GetParameterValueDef (IntPtr Handle, byte[] ANameSpaceName, byte[] AValueName, byte[] ADefaultValue, UInt32 sizeValue, out UInt32 neededValue, IntPtr dataValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathprofile_getparameterdoublevalue", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathProfile_GetParameterDoubleValue (IntPtr Handle, byte[] ANameSpaceName, byte[] AValueName, out Double AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathprofile_getparameterdoublevaluedef", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathProfile_GetParameterDoubleValueDef (IntPtr Handle, byte[] ANameSpaceName, byte[] AValueName, Double ADefaultValue, out Double AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathprofile_getparameterintegervalue", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathProfile_GetParameterIntegerValue (IntPtr Handle, byte[] ANameSpaceName, byte[] AValueName, out Int64 AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathprofile_getparameterintegervaluedef", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathProfile_GetParameterIntegerValueDef (IntPtr Handle, byte[] ANameSpaceName, byte[] AValueName, Int64 ADefaultValue, out Int64 AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathprofile_getparameterboolvalue", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathProfile_GetParameterBoolValue (IntPtr Handle, byte[] ANameSpaceName, byte[] AValueName, out Byte AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathprofile_getparameterboolvaluedef", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathProfile_GetParameterBoolValueDef (IntPtr Handle, byte[] ANameSpaceName, byte[] AValueName, Byte ADefaultValue, out Byte AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathprofile_setname", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathProfile_SetName (IntPtr Handle, byte[] AName); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathprofile_setparametervalue", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathProfile_SetParameterValue (IntPtr Handle, byte[] ANameSpaceName, byte[] AValueName, byte[] AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathprofile_setparameterdoublevalue", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathProfile_SetParameterDoubleValue (IntPtr Handle, byte[] ANameSpaceName, byte[] AValueName, Double AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathprofile_setparameterintegervalue", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathProfile_SetParameterIntegerValue (IntPtr Handle, byte[] ANameSpaceName, byte[] AValueName, Int64 AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathprofile_setparameterboolvalue", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathProfile_SetParameterBoolValue (IntPtr Handle, byte[] ANameSpaceName, byte[] AValueName, Byte AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerreader_getlayerdatauuid", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerReader_GetLayerDataUUID (IntPtr Handle, UInt32 sizeUUID, out UInt32 neededUUID, IntPtr dataUUID); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerreader_getsegmentcount", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerReader_GetSegmentCount (IntPtr Handle, out UInt32 ACount); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerreader_getsegmentinfo", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerReader_GetSegmentInfo (IntPtr Handle, UInt32 AIndex, out Int32 AType, out UInt32 APointCount); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerreader_getsegmentprofile", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerReader_GetSegmentProfile (IntPtr Handle, UInt32 AIndex, out IntPtr AProfile); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerreader_getsegmentprofileuuid", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerReader_GetSegmentProfileUUID (IntPtr Handle, UInt32 AIndex, UInt32 sizeProfileUUID, out UInt32 neededProfileUUID, IntPtr dataProfileUUID); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerreader_getsegmentpart", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerReader_GetSegmentPart (IntPtr Handle, UInt32 AIndex, out IntPtr ABuildItem); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerreader_getsegmentpartuuid", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerReader_GetSegmentPartUUID (IntPtr Handle, UInt32 AIndex, UInt32 sizePartUUID, out UInt32 neededPartUUID, IntPtr dataPartUUID); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerreader_getsegmentlocalpartid", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerReader_GetSegmentLocalPartID (IntPtr Handle, UInt32 AIndex, out UInt32 ALocalPartID); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerreader_getpartuuidbylocalpartid", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerReader_GetPartUUIDByLocalPartID (IntPtr Handle, UInt32 ALocalPartID, UInt32 sizePartUUID, out UInt32 neededPartUUID, IntPtr dataPartUUID); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerreader_getsegmentpointdata", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerReader_GetSegmentPointData (IntPtr Handle, UInt32 AIndex, UInt64 sizePointData, out UInt64 neededPointData, IntPtr dataPointData); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerreader_findattributeinfobyname", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerReader_FindAttributeInfoByName (IntPtr Handle, byte[] ANameSpace, byte[] AAttributeName, out UInt32 AID, out Int32 AAttributeType); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerreader_findattributeidbyname", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerReader_FindAttributeIDByName (IntPtr Handle, byte[] ANameSpace, byte[] AAttributeName, out UInt32 AID); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerreader_findattributevaluebyname", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerReader_FindAttributeValueByName (IntPtr Handle, byte[] ANameSpace, byte[] AAttributeName, out Int32 AAttributeType); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerreader_getsegmentintegerattributebyid", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerReader_GetSegmentIntegerAttributeByID (IntPtr Handle, UInt32 AIndex, UInt32 AID, out Int64 AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerreader_getsegmentintegerattributebyname", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerReader_GetSegmentIntegerAttributeByName (IntPtr Handle, UInt32 AIndex, byte[] ANameSpace, byte[] AAttributeName, out Int64 AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerReader_GetSegmentDoubleAttributeByID (IntPtr Handle, UInt32 AIndex, UInt32 AID, out Double AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerReader_GetSegmentDoubleAttributeByName (IntPtr Handle, UInt32 AIndex, byte[] ANameSpace, byte[] AAttributeName, out Double AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerreader_getcustomdatacount", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerReader_GetCustomDataCount (IntPtr Handle, out UInt32 ACount); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerreader_getcustomdata", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerReader_GetCustomData (IntPtr Handle, UInt32 AIndex, out IntPtr AData); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerreader_getcustomdataname", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerReader_GetCustomDataName (IntPtr Handle, UInt32 AIndex, UInt32 sizeNameSpace, out UInt32 neededNameSpace, IntPtr dataNameSpace, UInt32 sizeDataName, out UInt32 neededDataName, IntPtr dataDataName); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerdata_getlayerdatauuid", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerData_GetLayerDataUUID (IntPtr Handle, UInt32 sizeUUID, out UInt32 neededUUID, IntPtr dataUUID); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerdata_registerprofile", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerData_RegisterProfile (IntPtr Handle, IntPtr AProfile, out UInt32 AProfileID); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerdata_registerbuilditem", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerData_RegisterBuildItem (IntPtr Handle, IntPtr ABuildItem, out UInt32 APartID); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerdata_setsegmentattribute", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerData_SetSegmentAttribute (IntPtr Handle, byte[] ANameSpace, byte[] AAttributeName, byte[] AValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerdata_clearsegmentattributes", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerData_ClearSegmentAttributes (IntPtr Handle); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerdata_writehatchdata", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerData_WriteHatchData (IntPtr Handle, UInt32 AProfileID, UInt32 APartID, UInt64 sizePointData, IntPtr dataPointData); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerdata_writeloop", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerData_WriteLoop (IntPtr Handle, UInt32 AProfileID, UInt32 APartID, UInt64 sizePointData, IntPtr dataPointData); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerdata_writepolyline", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerData_WritePolyline (IntPtr Handle, UInt32 AProfileID, UInt32 APartID, UInt64 sizePointData, IntPtr dataPointData); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerdata_addcustomdata", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerData_AddCustomData (IntPtr Handle, byte[] ANameSpace, byte[] ADataName, out IntPtr AData); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathlayerdata_finish", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathLayerData_Finish (IntPtr Handle); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpath_getunits", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Toolpath_GetUnits (IntPtr Handle, out Double AUnits); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpath_getlayercount", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Toolpath_GetLayerCount (IntPtr Handle, out UInt32 ACount); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpath_getprofilecount", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Toolpath_GetProfileCount (IntPtr Handle, out UInt32 ACount); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpath_addlayer", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Toolpath_AddLayer (IntPtr Handle, UInt32 AZMax, byte[] APath, IntPtr AModelWriter, out IntPtr ALayerData); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpath_getlayerattachment", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Toolpath_GetLayerAttachment (IntPtr Handle, UInt32 AIndex, out IntPtr AAttachment); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpath_readlayerdata", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Toolpath_ReadLayerData (IntPtr Handle, UInt32 AIndex, out IntPtr AToolpathReader); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpath_getlayerpath", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Toolpath_GetLayerPath (IntPtr Handle, UInt32 AIndex, UInt32 sizePath, out UInt32 neededPath, IntPtr dataPath); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpath_getlayerzmax", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Toolpath_GetLayerZMax (IntPtr Handle, UInt32 AIndex, out UInt32 AZMax); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpath_getlayerz", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Toolpath_GetLayerZ (IntPtr Handle, UInt32 ALayerIndex, out UInt32 AZValue); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpath_addprofile", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Toolpath_AddProfile (IntPtr Handle, byte[] AName, out IntPtr AProfile); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpath_getprofile", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Toolpath_GetProfile (IntPtr Handle, UInt32 AProfileIndex, out IntPtr AProfile); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpath_getprofileuuid", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Toolpath_GetProfileUUID (IntPtr Handle, byte[] AProfileUUID, out IntPtr AProfile); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpath_getcustomdatacount", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Toolpath_GetCustomDataCount (IntPtr Handle, out UInt32 ACount); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpath_getcustomdata", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Toolpath_GetCustomData (IntPtr Handle, UInt32 AIndex, out IntPtr AData); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpath_getcustomdataname", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Toolpath_GetCustomDataName (IntPtr Handle, UInt32 AIndex, UInt32 sizeNameSpace, out UInt32 neededNameSpace, IntPtr dataNameSpace, UInt32 sizeDataName, out UInt32 neededDataName, IntPtr dataDataName); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpath_hasuniquecustomdata", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Toolpath_HasUniqueCustomData (IntPtr Handle, byte[] ANameSpace, byte[] ADataName, out Byte ACustomDataExists); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpath_finduniquecustomdata", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Toolpath_FindUniqueCustomData (IntPtr Handle, byte[] ANameSpace, byte[] ADataName, out IntPtr AData); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpath_addcustomdata", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Toolpath_AddCustomData (IntPtr Handle, byte[] ANameSpace, byte[] ADataName, out IntPtr AData); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpath_clearcustomdata", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Toolpath_ClearCustomData (IntPtr Handle, out UInt32 ANumberOfDeletedItems); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpath_deletecustomdata", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Toolpath_DeleteCustomData (IntPtr Handle, IntPtr AData, out Byte ASuccess); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpath_registercustomintegerattribute", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Toolpath_RegisterCustomIntegerAttribute (IntPtr Handle, byte[] ANameSpace, byte[] AAttributeName); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpath_registercustomdoubleattribute", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Toolpath_RegisterCustomDoubleAttribute (IntPtr Handle, byte[] ANameSpace, byte[] AAttributeName); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_toolpathiterator_getcurrenttoolpath", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 ToolpathIterator_GetCurrentToolpath (IntPtr Handle, out IntPtr AResource); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_slicestack_getbottomz", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 SliceStack_GetBottomZ (IntPtr Handle, out Double AZBottom); @@ -1264,6 +1682,9 @@ public class Lib3MFWrapper [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getmultipropertygroups", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 Model_GetMultiPropertyGroups (IntPtr Handle, out IntPtr AResourceIterator); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_gettoolpaths", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Model_GetToolpaths (IntPtr Handle, out IntPtr AResourceIterator); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getslicestacks", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 Model_GetSliceStacks (IntPtr Handle, out IntPtr AResourceIterator); @@ -1303,6 +1724,9 @@ public class Lib3MFWrapper [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_removebuilditem", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 Model_RemoveBuildItem (IntPtr Handle, IntPtr ABuildItemInstance); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_addtoolpath", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Model_AddToolpath (IntPtr Handle, Double AUnitFactor, out IntPtr AToolpathInstance); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getmetadatagroup", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 Model_GetMetaDataGroup (IntPtr Handle, out IntPtr ATheMetaDataGroup); @@ -1345,6 +1769,15 @@ public class Lib3MFWrapper [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getkeystore", CallingConvention=CallingConvention.Cdecl)] public unsafe extern static Int32 Model_GetKeyStore (IntPtr Handle, out IntPtr AKeyStore); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_createpersistentsourcefromfile", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Model_CreatePersistentSourceFromFile (IntPtr Handle, byte[] AFilename, out IntPtr AInstance); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_createpersistentsourcefrombuffer", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Model_CreatePersistentSourceFromBuffer (IntPtr Handle, UInt64 sizeBuffer, IntPtr dataBuffer, out IntPtr AInstance); + + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_createpersistentsourcefromcallback", CallingConvention=CallingConvention.Cdecl)] + public unsafe extern static Int32 Model_CreatePersistentSourceFromCallback (IntPtr Handle, IntPtr ATheReadCallback, UInt64 AStreamSize, IntPtr ATheSeekCallback, UInt64 AUserData, out IntPtr AInstance); + [DllImport("lib3mf.dll", EntryPoint = "lib3mf_getlibraryversion", CharSet = CharSet.Ansi, CallingConvention=CallingConvention.Cdecl)] public extern static Int32 GetLibraryVersion (out UInt32 AMajor, out UInt32 AMinor, out UInt32 AMicro); @@ -1711,11 +2144,17 @@ public static T PolymorphicFactory(IntPtr Handle) where T : class ThrowError (IntPtr.Zero, errorCode); switch (resultClassTypeId) { case 0x856632D0BAF1D8B7: Object = new CBase(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::Base" + case 0xA0EB26254C981E1A: Object = new CBinaryStream(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::BinaryStream" case 0xE76F642F363FD7E9: Object = new CWriter(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::Writer" + case 0xBE46884397CE1319: Object = new CPersistentReaderSource(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::PersistentReaderSource" case 0x2D86831DA59FBE72: Object = new CReader(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::Reader" case 0x0E55A826D377483E: Object = new CPackagePart(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::PackagePart" case 0xDFE3889D1B269CBB: Object = new CResource(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::Resource" case 0x460F3515E2621DBE: Object = new CResourceIterator(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::ResourceIterator" + case 0xEA18C54DBD42B5F6: Object = new CCustomXMLAttribute(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::CustomXMLAttribute" + case 0x26B5AD02041EDF96: Object = new CCustomXMLNode(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::CustomXMLNode" + case 0x8C4B47C97D310E89: Object = new CCustomXMLNodes(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::CustomXMLNodes" + case 0x5E0CF70A6DB6256A: Object = new CCustomDOMTree(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::CustomDOMTree" case 0x69684DB99FA813F6: Object = new CSliceStackIterator(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::SliceStackIterator" case 0xDE92510BD2112288: Object = new CObjectIterator(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::ObjectIterator" case 0xF4196034E2B9FDE6: Object = new CMeshObjectIterator(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::MeshObjectIterator" @@ -1744,6 +2183,11 @@ public static T PolymorphicFactory(IntPtr Handle) where T : class case 0x68FB2D5FFC4BA12A: Object = new CBuildItem(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::BuildItem" case 0xA7D21BD364910860: Object = new CBuildItemIterator(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::BuildItemIterator" case 0x2198BCF4D8DF9C40: Object = new CSlice(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::Slice" + case 0xC869620B90242CA7: Object = new CToolpathProfile(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::ToolpathProfile" + case 0x28DD7D3718F0616E: Object = new CToolpathLayerReader(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::ToolpathLayerReader" + case 0x28C0E70CC44F931A: Object = new CToolpathLayerData(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::ToolpathLayerData" + case 0xF0AAB2C814D9FFB1: Object = new CToolpath(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::Toolpath" + case 0xD0F24425A07F2A81: Object = new CToolpathIterator(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::ToolpathIterator" case 0x6594B031B6096238: Object = new CSliceStack(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::SliceStack" case 0xD9E46D5E6D8118EE: Object = new CConsumer(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::Consumer" case 0x385C42FC5609498A: Object = new CAccessRight(Handle) as T; break; // First 64 bits of SHA1 of a string: "Lib3MF::AccessRight" @@ -1814,6 +2258,81 @@ public UInt64 ClassTypeId () } + public class CBinaryStream : CBase + { + public CBinaryStream (IntPtr NewHandle) : base (NewHandle) + { + } + + public String GetBinaryPath () + { + UInt32 sizePath = 0; + UInt32 neededPath = 0; + CheckError(Internal.Lib3MFWrapper.BinaryStream_GetBinaryPath (Handle, sizePath, out neededPath, IntPtr.Zero)); + sizePath = neededPath; + byte[] bytesPath = new byte[sizePath]; + GCHandle dataPath = GCHandle.Alloc(bytesPath, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.BinaryStream_GetBinaryPath (Handle, sizePath, out neededPath, dataPath.AddrOfPinnedObject())); + dataPath.Free(); + return Encoding.UTF8.GetString(bytesPath).TrimEnd(char.MinValue); + } + + public String GetIndexPath () + { + UInt32 sizePath = 0; + UInt32 neededPath = 0; + CheckError(Internal.Lib3MFWrapper.BinaryStream_GetIndexPath (Handle, sizePath, out neededPath, IntPtr.Zero)); + sizePath = neededPath; + byte[] bytesPath = new byte[sizePath]; + GCHandle dataPath = GCHandle.Alloc(bytesPath, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.BinaryStream_GetIndexPath (Handle, sizePath, out neededPath, dataPath.AddrOfPinnedObject())); + dataPath.Free(); + return Encoding.UTF8.GetString(bytesPath).TrimEnd(char.MinValue); + } + + public String GetUUID () + { + UInt32 sizeUUID = 0; + UInt32 neededUUID = 0; + CheckError(Internal.Lib3MFWrapper.BinaryStream_GetUUID (Handle, sizeUUID, out neededUUID, IntPtr.Zero)); + sizeUUID = neededUUID; + byte[] bytesUUID = new byte[sizeUUID]; + GCHandle dataUUID = GCHandle.Alloc(bytesUUID, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.BinaryStream_GetUUID (Handle, sizeUUID, out neededUUID, dataUUID.AddrOfPinnedObject())); + dataUUID.Free(); + return Encoding.UTF8.GetString(bytesUUID).TrimEnd(char.MinValue); + } + + public void DisableDiscretizedArrayCompression () + { + + CheckError(Internal.Lib3MFWrapper.BinaryStream_DisableDiscretizedArrayCompression (Handle)); + } + + public void EnableDiscretizedArrayCompression (Double AUnits, eBinaryStreamPredictionType APredictionType) + { + Int32 enumPredictionType = (Int32) APredictionType; + + CheckError(Internal.Lib3MFWrapper.BinaryStream_EnableDiscretizedArrayCompression (Handle, AUnits, enumPredictionType)); + } + + public void EnableLZMA (UInt32 ALZMALevel) + { + + CheckError(Internal.Lib3MFWrapper.BinaryStream_EnableLZMA (Handle, ALZMALevel)); + } + + public void DisableLZMA () + { + + CheckError(Internal.Lib3MFWrapper.BinaryStream_DisableLZMA (Handle)); + } + + } + public class CWriter : CBase { public CWriter (IntPtr NewHandle) : base (NewHandle) @@ -1923,6 +2442,66 @@ public void SetContentEncryptionCallback (IntPtr ATheCallback, UInt64 AUserData) CheckError(Internal.Lib3MFWrapper.Writer_SetContentEncryptionCallback (Handle, ATheCallback, AUserData)); } + public CBinaryStream CreateBinaryStream (String AIndexPath, String ABinaryPath) + { + byte[] byteIndexPath = Encoding.UTF8.GetBytes(AIndexPath + char.MinValue); + byte[] byteBinaryPath = Encoding.UTF8.GetBytes(ABinaryPath + char.MinValue); + IntPtr newBinaryStream = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.Writer_CreateBinaryStream (Handle, byteIndexPath, byteBinaryPath, out newBinaryStream)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newBinaryStream); + } + + public void AssignBinaryStream (CBase AInstance, CBinaryStream ABinaryStream) + { + IntPtr AInstanceHandle = IntPtr.Zero; + if (AInstance != null) + AInstanceHandle = AInstance.GetHandle(); + IntPtr ABinaryStreamHandle = IntPtr.Zero; + if (ABinaryStream != null) + ABinaryStreamHandle = ABinaryStream.GetHandle(); + + CheckError(Internal.Lib3MFWrapper.Writer_AssignBinaryStream (Handle, AInstanceHandle, ABinaryStreamHandle)); + } + + public void RegisterCustomNamespace (String APrefix, String ANameSpace) + { + byte[] bytePrefix = Encoding.UTF8.GetBytes(APrefix + char.MinValue); + byte[] byteNameSpace = Encoding.UTF8.GetBytes(ANameSpace + char.MinValue); + + CheckError(Internal.Lib3MFWrapper.Writer_RegisterCustomNamespace (Handle, bytePrefix, byteNameSpace)); + } + + } + + public class CPersistentReaderSource : CBase + { + public CPersistentReaderSource (IntPtr NewHandle) : base (NewHandle) + { + } + + public ePersistentReaderSourceType GetSourceType () + { + Int32 resultSourceType = 0; + + CheckError(Internal.Lib3MFWrapper.PersistentReaderSource_GetSourceType (Handle, out resultSourceType)); + return (ePersistentReaderSourceType) (resultSourceType); + } + + public void InvalidateSourceData () + { + + CheckError(Internal.Lib3MFWrapper.PersistentReaderSource_InvalidateSourceData (Handle)); + } + + public bool SourceDataIsValid () + { + Byte resultDataIsValid = 0; + + CheckError(Internal.Lib3MFWrapper.PersistentReaderSource_SourceDataIsValid (Handle, out resultDataIsValid)); + return (resultDataIsValid != 0); + } + } public class CReader : CBase @@ -1931,6 +2510,15 @@ public CReader (IntPtr NewHandle) : base (NewHandle) { } + public void ReadFromPersistentSource (CPersistentReaderSource ASource) + { + IntPtr ASourceHandle = IntPtr.Zero; + if (ASource != null) + ASourceHandle = ASource.GetHandle(); + + CheckError(Internal.Lib3MFWrapper.Reader_ReadFromPersistentSource (Handle, ASourceHandle)); + } + public void ReadFromFile (String AFilename) { byte[] byteFilename = Encoding.UTF8.GetBytes(AFilename + char.MinValue); @@ -2149,1962 +2737,3172 @@ public UInt64 Count () } - public class CSliceStackIterator : CResourceIterator + public class CCustomXMLAttribute : CBase { - public CSliceStackIterator (IntPtr NewHandle) : base (NewHandle) + public CCustomXMLAttribute (IntPtr NewHandle) : base (NewHandle) { } - public CSliceStack GetCurrentSliceStack () + public String GetName () { - IntPtr newResource = IntPtr.Zero; + UInt32 sizeName = 0; + UInt32 neededName = 0; + CheckError(Internal.Lib3MFWrapper.CustomXMLAttribute_GetName (Handle, sizeName, out neededName, IntPtr.Zero)); + sizeName = neededName; + byte[] bytesName = new byte[sizeName]; + GCHandle dataName = GCHandle.Alloc(bytesName, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.SliceStackIterator_GetCurrentSliceStack (Handle, out newResource)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newResource); + CheckError(Internal.Lib3MFWrapper.CustomXMLAttribute_GetName (Handle, sizeName, out neededName, dataName.AddrOfPinnedObject())); + dataName.Free(); + return Encoding.UTF8.GetString(bytesName).TrimEnd(char.MinValue); } - } - - public class CObjectIterator : CResourceIterator - { - public CObjectIterator (IntPtr NewHandle) : base (NewHandle) + public String GetValue () { + UInt32 sizeValue = 0; + UInt32 neededValue = 0; + CheckError(Internal.Lib3MFWrapper.CustomXMLAttribute_GetValue (Handle, sizeValue, out neededValue, IntPtr.Zero)); + sizeValue = neededValue; + byte[] bytesValue = new byte[sizeValue]; + GCHandle dataValue = GCHandle.Alloc(bytesValue, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.CustomXMLAttribute_GetValue (Handle, sizeValue, out neededValue, dataValue.AddrOfPinnedObject())); + dataValue.Free(); + return Encoding.UTF8.GetString(bytesValue).TrimEnd(char.MinValue); } - public CObject GetCurrentObject () + public bool IsValidInteger (Int64 AMinValue, Int64 AMaxValue) { - IntPtr newResource = IntPtr.Zero; + Byte resultIsValid = 0; - CheckError(Internal.Lib3MFWrapper.ObjectIterator_GetCurrentObject (Handle, out newResource)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newResource); + CheckError(Internal.Lib3MFWrapper.CustomXMLAttribute_IsValidInteger (Handle, AMinValue, AMaxValue, out resultIsValid)); + return (resultIsValid != 0); } - } - - public class CMeshObjectIterator : CResourceIterator - { - public CMeshObjectIterator (IntPtr NewHandle) : base (NewHandle) + public Int64 GetIntegerValue (Int64 AMinValue, Int64 AMaxValue) { + Int64 resultValue = 0; + + CheckError(Internal.Lib3MFWrapper.CustomXMLAttribute_GetIntegerValue (Handle, AMinValue, AMaxValue, out resultValue)); + return resultValue; } - public CMeshObject GetCurrentMeshObject () + public bool IsValidDouble (Double AMinValue, Double AMaxValue) { - IntPtr newResource = IntPtr.Zero; + Byte resultIsValid = 0; - CheckError(Internal.Lib3MFWrapper.MeshObjectIterator_GetCurrentMeshObject (Handle, out newResource)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newResource); + CheckError(Internal.Lib3MFWrapper.CustomXMLAttribute_IsValidDouble (Handle, AMinValue, AMaxValue, out resultIsValid)); + return (resultIsValid != 0); } - } - - public class CComponentsObjectIterator : CResourceIterator - { - public CComponentsObjectIterator (IntPtr NewHandle) : base (NewHandle) + public Double GetDoubleValue (Double AMinValue, Double AMaxValue) { + Double resultValue = 0; + + CheckError(Internal.Lib3MFWrapper.CustomXMLAttribute_GetDoubleValue (Handle, AMinValue, AMaxValue, out resultValue)); + return resultValue; } - public CComponentsObject GetCurrentComponentsObject () + public bool IsValidBool () { - IntPtr newResource = IntPtr.Zero; + Byte resultIsValid = 0; - CheckError(Internal.Lib3MFWrapper.ComponentsObjectIterator_GetCurrentComponentsObject (Handle, out newResource)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newResource); + CheckError(Internal.Lib3MFWrapper.CustomXMLAttribute_IsValidBool (Handle, out resultIsValid)); + return (resultIsValid != 0); } - } + public bool GetBoolValue (Double AMinValue, Double AMaxValue) + { + Byte resultValue = 0; - public class CTexture2DIterator : CResourceIterator - { - public CTexture2DIterator (IntPtr NewHandle) : base (NewHandle) + CheckError(Internal.Lib3MFWrapper.CustomXMLAttribute_GetBoolValue (Handle, AMinValue, AMaxValue, out resultValue)); + return (resultValue != 0); + } + + public void SetValue (String AValue) { + byte[] byteValue = Encoding.UTF8.GetBytes(AValue + char.MinValue); + + CheckError(Internal.Lib3MFWrapper.CustomXMLAttribute_SetValue (Handle, byteValue)); } - public CTexture2D GetCurrentTexture2D () + public void SetIntegerValue (Int64 AValue) { - IntPtr newResource = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.Texture2DIterator_GetCurrentTexture2D (Handle, out newResource)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newResource); + CheckError(Internal.Lib3MFWrapper.CustomXMLAttribute_SetIntegerValue (Handle, AValue)); } - } + public void SetDoubleValue (Double AValue) + { - public class CBaseMaterialGroupIterator : CResourceIterator - { - public CBaseMaterialGroupIterator (IntPtr NewHandle) : base (NewHandle) + CheckError(Internal.Lib3MFWrapper.CustomXMLAttribute_SetDoubleValue (Handle, AValue)); + } + + public void SetBoolValue (bool AValue) { + + CheckError(Internal.Lib3MFWrapper.CustomXMLAttribute_SetBoolValue (Handle, (Byte)( AValue ? 1 : 0 ))); } - public CBaseMaterialGroup GetCurrentBaseMaterialGroup () + public void Remove () { - IntPtr newResource = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup (Handle, out newResource)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newResource); + CheckError(Internal.Lib3MFWrapper.CustomXMLAttribute_Remove (Handle)); } } - public class CColorGroupIterator : CResourceIterator + public class CCustomXMLNode : CBase { - public CColorGroupIterator (IntPtr NewHandle) : base (NewHandle) + public CCustomXMLNode (IntPtr NewHandle) : base (NewHandle) { } - public CColorGroup GetCurrentColorGroup () + public String GetName () { - IntPtr newResource = IntPtr.Zero; + UInt32 sizeName = 0; + UInt32 neededName = 0; + CheckError(Internal.Lib3MFWrapper.CustomXMLNode_GetName (Handle, sizeName, out neededName, IntPtr.Zero)); + sizeName = neededName; + byte[] bytesName = new byte[sizeName]; + GCHandle dataName = GCHandle.Alloc(bytesName, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.ColorGroupIterator_GetCurrentColorGroup (Handle, out newResource)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newResource); + CheckError(Internal.Lib3MFWrapper.CustomXMLNode_GetName (Handle, sizeName, out neededName, dataName.AddrOfPinnedObject())); + dataName.Free(); + return Encoding.UTF8.GetString(bytesName).TrimEnd(char.MinValue); } - } - - public class CTexture2DGroupIterator : CResourceIterator - { - public CTexture2DGroupIterator (IntPtr NewHandle) : base (NewHandle) + public String GetNameSpace () { + UInt32 sizeNameSpace = 0; + UInt32 neededNameSpace = 0; + CheckError(Internal.Lib3MFWrapper.CustomXMLNode_GetNameSpace (Handle, sizeNameSpace, out neededNameSpace, IntPtr.Zero)); + sizeNameSpace = neededNameSpace; + byte[] bytesNameSpace = new byte[sizeNameSpace]; + GCHandle dataNameSpace = GCHandle.Alloc(bytesNameSpace, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.CustomXMLNode_GetNameSpace (Handle, sizeNameSpace, out neededNameSpace, dataNameSpace.AddrOfPinnedObject())); + dataNameSpace.Free(); + return Encoding.UTF8.GetString(bytesNameSpace).TrimEnd(char.MinValue); } - public CTexture2DGroup GetCurrentTexture2DGroup () + public UInt64 GetAttributeCount () { - IntPtr newResource = IntPtr.Zero; + UInt64 resultCount = 0; - CheckError(Internal.Lib3MFWrapper.Texture2DGroupIterator_GetCurrentTexture2DGroup (Handle, out newResource)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newResource); + CheckError(Internal.Lib3MFWrapper.CustomXMLNode_GetAttributeCount (Handle, out resultCount)); + return resultCount; } - } + public CCustomXMLAttribute GetAttribute (UInt64 AIndex) + { + IntPtr newAttributeInstance = IntPtr.Zero; - public class CCompositeMaterialsIterator : CResourceIterator - { - public CCompositeMaterialsIterator (IntPtr NewHandle) : base (NewHandle) + CheckError(Internal.Lib3MFWrapper.CustomXMLNode_GetAttribute (Handle, AIndex, out newAttributeInstance)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newAttributeInstance); + } + + public bool HasAttribute (String AName) { + byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); + Byte resultAttributeExists = 0; + + CheckError(Internal.Lib3MFWrapper.CustomXMLNode_HasAttribute (Handle, byteName, out resultAttributeExists)); + return (resultAttributeExists != 0); } - public CCompositeMaterials GetCurrentCompositeMaterials () + public CCustomXMLAttribute FindAttribute (String AName, bool AMustExist) { - IntPtr newResource = IntPtr.Zero; + byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); + IntPtr newAttributeInstance = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.CompositeMaterialsIterator_GetCurrentCompositeMaterials (Handle, out newResource)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newResource); + CheckError(Internal.Lib3MFWrapper.CustomXMLNode_FindAttribute (Handle, byteName, (Byte)( AMustExist ? 1 : 0 ), out newAttributeInstance)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newAttributeInstance); } - } + public bool RemoveAttribute (String AName) + { + byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); + Byte resultAttributeRemoved = 0; - public class CMultiPropertyGroupIterator : CResourceIterator - { - public CMultiPropertyGroupIterator (IntPtr NewHandle) : base (NewHandle) + CheckError(Internal.Lib3MFWrapper.CustomXMLNode_RemoveAttribute (Handle, byteName, out resultAttributeRemoved)); + return (resultAttributeRemoved != 0); + } + + public bool RemoveAttributeByIndex (UInt64 AIndex) { + Byte resultAttributeRemoved = 0; + + CheckError(Internal.Lib3MFWrapper.CustomXMLNode_RemoveAttributeByIndex (Handle, AIndex, out resultAttributeRemoved)); + return (resultAttributeRemoved != 0); } - public CMultiPropertyGroup GetCurrentMultiPropertyGroup () + public void AddAttribute (String AName, String AValue) { - IntPtr newResource = IntPtr.Zero; + byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); + byte[] byteValue = Encoding.UTF8.GetBytes(AValue + char.MinValue); - CheckError(Internal.Lib3MFWrapper.MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup (Handle, out newResource)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newResource); + CheckError(Internal.Lib3MFWrapper.CustomXMLNode_AddAttribute (Handle, byteName, byteValue)); } - } + public void AddIntegerAttribute (String AName, Int64 AValue) + { + byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); - public class CMetaData : CBase - { - public CMetaData (IntPtr NewHandle) : base (NewHandle) + CheckError(Internal.Lib3MFWrapper.CustomXMLNode_AddIntegerAttribute (Handle, byteName, AValue)); + } + + public void AddDoubleAttribute (String AName, Double AValue) { + byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); + + CheckError(Internal.Lib3MFWrapper.CustomXMLNode_AddDoubleAttribute (Handle, byteName, AValue)); } - public String GetNameSpace () + public void AddBoolAttribute (String AName, bool AValue) { - UInt32 sizeNameSpace = 0; - UInt32 neededNameSpace = 0; - CheckError(Internal.Lib3MFWrapper.MetaData_GetNameSpace (Handle, sizeNameSpace, out neededNameSpace, IntPtr.Zero)); - sizeNameSpace = neededNameSpace; - byte[] bytesNameSpace = new byte[sizeNameSpace]; - GCHandle dataNameSpace = GCHandle.Alloc(bytesNameSpace, GCHandleType.Pinned); + byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); - CheckError(Internal.Lib3MFWrapper.MetaData_GetNameSpace (Handle, sizeNameSpace, out neededNameSpace, dataNameSpace.AddrOfPinnedObject())); - dataNameSpace.Free(); - return Encoding.UTF8.GetString(bytesNameSpace).TrimEnd(char.MinValue); + CheckError(Internal.Lib3MFWrapper.CustomXMLNode_AddBoolAttribute (Handle, byteName, (Byte)( AValue ? 1 : 0 ))); } - public void SetNameSpace (String ANameSpace) + public CCustomXMLNodes GetChildren () { - byte[] byteNameSpace = Encoding.UTF8.GetBytes(ANameSpace + char.MinValue); + IntPtr newChildNodes = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.MetaData_SetNameSpace (Handle, byteNameSpace)); + CheckError(Internal.Lib3MFWrapper.CustomXMLNode_GetChildren (Handle, out newChildNodes)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newChildNodes); } - public String GetName () + public UInt64 CountChildrenByName (String AName) { - UInt32 sizeName = 0; - UInt32 neededName = 0; - CheckError(Internal.Lib3MFWrapper.MetaData_GetName (Handle, sizeName, out neededName, IntPtr.Zero)); - sizeName = neededName; - byte[] bytesName = new byte[sizeName]; - GCHandle dataName = GCHandle.Alloc(bytesName, GCHandleType.Pinned); + byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); + UInt64 resultCount = 0; - CheckError(Internal.Lib3MFWrapper.MetaData_GetName (Handle, sizeName, out neededName, dataName.AddrOfPinnedObject())); - dataName.Free(); - return Encoding.UTF8.GetString(bytesName).TrimEnd(char.MinValue); + CheckError(Internal.Lib3MFWrapper.CustomXMLNode_CountChildrenByName (Handle, byteName, out resultCount)); + return resultCount; } - public void SetName (String AName) + public CCustomXMLNodes GetChildrenByName (String AName) { byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); + IntPtr newChildNodes = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.MetaData_SetName (Handle, byteName)); + CheckError(Internal.Lib3MFWrapper.CustomXMLNode_GetChildrenByName (Handle, byteName, out newChildNodes)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newChildNodes); } - public String GetKey () + public bool HasChild (String AName) { - UInt32 sizeKey = 0; - UInt32 neededKey = 0; - CheckError(Internal.Lib3MFWrapper.MetaData_GetKey (Handle, sizeKey, out neededKey, IntPtr.Zero)); - sizeKey = neededKey; - byte[] bytesKey = new byte[sizeKey]; - GCHandle dataKey = GCHandle.Alloc(bytesKey, GCHandleType.Pinned); + byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); + Byte resultChildExists = 0; - CheckError(Internal.Lib3MFWrapper.MetaData_GetKey (Handle, sizeKey, out neededKey, dataKey.AddrOfPinnedObject())); - dataKey.Free(); - return Encoding.UTF8.GetString(bytesKey).TrimEnd(char.MinValue); + CheckError(Internal.Lib3MFWrapper.CustomXMLNode_HasChild (Handle, byteName, out resultChildExists)); + return (resultChildExists != 0); } - public bool GetMustPreserve () + public bool HasUniqueChild (String AName) { - Byte resultMustPreserve = 0; + byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); + Byte resultChildExists = 0; - CheckError(Internal.Lib3MFWrapper.MetaData_GetMustPreserve (Handle, out resultMustPreserve)); - return (resultMustPreserve != 0); + CheckError(Internal.Lib3MFWrapper.CustomXMLNode_HasUniqueChild (Handle, byteName, out resultChildExists)); + return (resultChildExists != 0); } - public void SetMustPreserve (bool AMustPreserve) + public CCustomXMLNode FindChild (String AName, bool AMustExist) { + byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); + IntPtr newChildInstance = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.MetaData_SetMustPreserve (Handle, (Byte)( AMustPreserve ? 1 : 0 ))); + CheckError(Internal.Lib3MFWrapper.CustomXMLNode_FindChild (Handle, byteName, (Byte)( AMustExist ? 1 : 0 ), out newChildInstance)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newChildInstance); } - public String GetType () + public CCustomXMLNode AddChild (String AName) { - UInt32 sizeType = 0; - UInt32 neededType = 0; - CheckError(Internal.Lib3MFWrapper.MetaData_GetType (Handle, sizeType, out neededType, IntPtr.Zero)); - sizeType = neededType; - byte[] bytesType = new byte[sizeType]; - GCHandle dataType = GCHandle.Alloc(bytesType, GCHandleType.Pinned); + byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); + IntPtr newChildInstance = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.MetaData_GetType (Handle, sizeType, out neededType, dataType.AddrOfPinnedObject())); - dataType.Free(); - return Encoding.UTF8.GetString(bytesType).TrimEnd(char.MinValue); + CheckError(Internal.Lib3MFWrapper.CustomXMLNode_AddChild (Handle, byteName, out newChildInstance)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newChildInstance); } - public void SetType (String AType) + public void RemoveChild (CCustomXMLNode AChildInstance) { - byte[] byteType = Encoding.UTF8.GetBytes(AType + char.MinValue); + IntPtr AChildInstanceHandle = IntPtr.Zero; + if (AChildInstance != null) + AChildInstanceHandle = AChildInstance.GetHandle(); - CheckError(Internal.Lib3MFWrapper.MetaData_SetType (Handle, byteType)); + CheckError(Internal.Lib3MFWrapper.CustomXMLNode_RemoveChild (Handle, AChildInstanceHandle)); } - public String GetValue () + public UInt64 RemoveChildrenWithName (String AName) { - UInt32 sizeValue = 0; - UInt32 neededValue = 0; - CheckError(Internal.Lib3MFWrapper.MetaData_GetValue (Handle, sizeValue, out neededValue, IntPtr.Zero)); - sizeValue = neededValue; - byte[] bytesValue = new byte[sizeValue]; - GCHandle dataValue = GCHandle.Alloc(bytesValue, GCHandleType.Pinned); + byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); + UInt64 resultNumberOfDeletedChildren = 0; - CheckError(Internal.Lib3MFWrapper.MetaData_GetValue (Handle, sizeValue, out neededValue, dataValue.AddrOfPinnedObject())); - dataValue.Free(); - return Encoding.UTF8.GetString(bytesValue).TrimEnd(char.MinValue); + CheckError(Internal.Lib3MFWrapper.CustomXMLNode_RemoveChildrenWithName (Handle, byteName, out resultNumberOfDeletedChildren)); + return resultNumberOfDeletedChildren; } - public void SetValue (String AValue) + public void Remove () { - byte[] byteValue = Encoding.UTF8.GetBytes(AValue + char.MinValue); - CheckError(Internal.Lib3MFWrapper.MetaData_SetValue (Handle, byteValue)); + CheckError(Internal.Lib3MFWrapper.CustomXMLNode_Remove (Handle)); } } - public class CMetaDataGroup : CBase + public class CCustomXMLNodes : CBase { - public CMetaDataGroup (IntPtr NewHandle) : base (NewHandle) + public CCustomXMLNodes (IntPtr NewHandle) : base (NewHandle) { } - public UInt32 GetMetaDataCount () + public UInt64 GetNodeCount () { - UInt32 resultCount = 0; + UInt64 resultCount = 0; - CheckError(Internal.Lib3MFWrapper.MetaDataGroup_GetMetaDataCount (Handle, out resultCount)); + CheckError(Internal.Lib3MFWrapper.CustomXMLNodes_GetNodeCount (Handle, out resultCount)); return resultCount; } - public CMetaData GetMetaData (UInt32 AIndex) + public CCustomXMLNode GetNode (UInt64 AIndex) { - IntPtr newMetaData = IntPtr.Zero; + IntPtr newNodeInstance = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.MetaDataGroup_GetMetaData (Handle, AIndex, out newMetaData)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newMetaData); + CheckError(Internal.Lib3MFWrapper.CustomXMLNodes_GetNode (Handle, AIndex, out newNodeInstance)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newNodeInstance); } - public CMetaData GetMetaDataByKey (String ANameSpace, String AName) + public UInt64 CountNodesByName (String AName) { - byte[] byteNameSpace = Encoding.UTF8.GetBytes(ANameSpace + char.MinValue); byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); - IntPtr newMetaData = IntPtr.Zero; + UInt64 resultCount = 0; - CheckError(Internal.Lib3MFWrapper.MetaDataGroup_GetMetaDataByKey (Handle, byteNameSpace, byteName, out newMetaData)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newMetaData); + CheckError(Internal.Lib3MFWrapper.CustomXMLNodes_CountNodesByName (Handle, byteName, out resultCount)); + return resultCount; } - public void RemoveMetaDataByIndex (UInt32 AIndex) + public CCustomXMLNodes GetNodesByName (String AName) { + byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); + IntPtr newNodes = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.MetaDataGroup_RemoveMetaDataByIndex (Handle, AIndex)); + CheckError(Internal.Lib3MFWrapper.CustomXMLNodes_GetNodesByName (Handle, byteName, out newNodes)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newNodes); } - public void RemoveMetaData (CMetaData ATheMetaData) + public bool HasNode (String AName) { - IntPtr ATheMetaDataHandle = IntPtr.Zero; - if (ATheMetaData != null) - ATheMetaDataHandle = ATheMetaData.GetHandle(); + byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); + Byte resultNodeExists = 0; - CheckError(Internal.Lib3MFWrapper.MetaDataGroup_RemoveMetaData (Handle, ATheMetaDataHandle)); + CheckError(Internal.Lib3MFWrapper.CustomXMLNodes_HasNode (Handle, byteName, out resultNodeExists)); + return (resultNodeExists != 0); } - public CMetaData AddMetaData (String ANameSpace, String AName, String AValue, String AType, bool AMustPreserve) + public bool HasUniqueNode (String AName) { - byte[] byteNameSpace = Encoding.UTF8.GetBytes(ANameSpace + char.MinValue); byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); - byte[] byteValue = Encoding.UTF8.GetBytes(AValue + char.MinValue); - byte[] byteType = Encoding.UTF8.GetBytes(AType + char.MinValue); - IntPtr newMetaData = IntPtr.Zero; + Byte resultNodeExists = 0; - CheckError(Internal.Lib3MFWrapper.MetaDataGroup_AddMetaData (Handle, byteNameSpace, byteName, byteValue, byteType, (Byte)( AMustPreserve ? 1 : 0 ), out newMetaData)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newMetaData); + CheckError(Internal.Lib3MFWrapper.CustomXMLNodes_HasUniqueNode (Handle, byteName, out resultNodeExists)); + return (resultNodeExists != 0); + } + + public CCustomXMLNode FindNode (String AName, bool AMustExist) + { + byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); + IntPtr newNodeInstance = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.CustomXMLNodes_FindNode (Handle, byteName, (Byte)( AMustExist ? 1 : 0 ), out newNodeInstance)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newNodeInstance); } } - public class CObject : CResource + public class CCustomDOMTree : CBase { - public CObject (IntPtr NewHandle) : base (NewHandle) + public CCustomDOMTree (IntPtr NewHandle) : base (NewHandle) { } - public eObjectType GetType () + public String GetNameSpace () { - Int32 resultObjectType = 0; + UInt32 sizeNameSpace = 0; + UInt32 neededNameSpace = 0; + CheckError(Internal.Lib3MFWrapper.CustomDOMTree_GetNameSpace (Handle, sizeNameSpace, out neededNameSpace, IntPtr.Zero)); + sizeNameSpace = neededNameSpace; + byte[] bytesNameSpace = new byte[sizeNameSpace]; + GCHandle dataNameSpace = GCHandle.Alloc(bytesNameSpace, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.Object_GetType (Handle, out resultObjectType)); - return (eObjectType) (resultObjectType); + CheckError(Internal.Lib3MFWrapper.CustomDOMTree_GetNameSpace (Handle, sizeNameSpace, out neededNameSpace, dataNameSpace.AddrOfPinnedObject())); + dataNameSpace.Free(); + return Encoding.UTF8.GetString(bytesNameSpace).TrimEnd(char.MinValue); } - public void SetType (eObjectType AObjectType) + public CCustomXMLNode GetRootNode () { - Int32 enumObjectType = (Int32) AObjectType; + IntPtr newRootNode = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.Object_SetType (Handle, enumObjectType)); + CheckError(Internal.Lib3MFWrapper.CustomDOMTree_GetRootNode (Handle, out newRootNode)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newRootNode); } - public String GetName () + public String SaveToString () { - UInt32 sizeName = 0; - UInt32 neededName = 0; - CheckError(Internal.Lib3MFWrapper.Object_GetName (Handle, sizeName, out neededName, IntPtr.Zero)); - sizeName = neededName; - byte[] bytesName = new byte[sizeName]; - GCHandle dataName = GCHandle.Alloc(bytesName, GCHandleType.Pinned); + UInt32 sizeXMLString = 0; + UInt32 neededXMLString = 0; + CheckError(Internal.Lib3MFWrapper.CustomDOMTree_SaveToString (Handle, sizeXMLString, out neededXMLString, IntPtr.Zero)); + sizeXMLString = neededXMLString; + byte[] bytesXMLString = new byte[sizeXMLString]; + GCHandle dataXMLString = GCHandle.Alloc(bytesXMLString, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.Object_GetName (Handle, sizeName, out neededName, dataName.AddrOfPinnedObject())); - dataName.Free(); - return Encoding.UTF8.GetString(bytesName).TrimEnd(char.MinValue); + CheckError(Internal.Lib3MFWrapper.CustomDOMTree_SaveToString (Handle, sizeXMLString, out neededXMLString, dataXMLString.AddrOfPinnedObject())); + dataXMLString.Free(); + return Encoding.UTF8.GetString(bytesXMLString).TrimEnd(char.MinValue); } - public void SetName (String AName) - { - byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); - - CheckError(Internal.Lib3MFWrapper.Object_SetName (Handle, byteName)); - } + } - public String GetPartNumber () + public class CSliceStackIterator : CResourceIterator + { + public CSliceStackIterator (IntPtr NewHandle) : base (NewHandle) { - UInt32 sizePartNumber = 0; - UInt32 neededPartNumber = 0; - CheckError(Internal.Lib3MFWrapper.Object_GetPartNumber (Handle, sizePartNumber, out neededPartNumber, IntPtr.Zero)); - sizePartNumber = neededPartNumber; - byte[] bytesPartNumber = new byte[sizePartNumber]; - GCHandle dataPartNumber = GCHandle.Alloc(bytesPartNumber, GCHandleType.Pinned); - - CheckError(Internal.Lib3MFWrapper.Object_GetPartNumber (Handle, sizePartNumber, out neededPartNumber, dataPartNumber.AddrOfPinnedObject())); - dataPartNumber.Free(); - return Encoding.UTF8.GetString(bytesPartNumber).TrimEnd(char.MinValue); } - public void SetPartNumber (String APartNumber) + public CSliceStack GetCurrentSliceStack () { - byte[] bytePartNumber = Encoding.UTF8.GetBytes(APartNumber + char.MinValue); + IntPtr newResource = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.Object_SetPartNumber (Handle, bytePartNumber)); + CheckError(Internal.Lib3MFWrapper.SliceStackIterator_GetCurrentSliceStack (Handle, out newResource)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newResource); } - public bool IsMeshObject () - { - Byte resultIsMeshObject = 0; + } - CheckError(Internal.Lib3MFWrapper.Object_IsMeshObject (Handle, out resultIsMeshObject)); - return (resultIsMeshObject != 0); + public class CObjectIterator : CResourceIterator + { + public CObjectIterator (IntPtr NewHandle) : base (NewHandle) + { } - public bool IsComponentsObject () + public CObject GetCurrentObject () { - Byte resultIsComponentsObject = 0; + IntPtr newResource = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.Object_IsComponentsObject (Handle, out resultIsComponentsObject)); - return (resultIsComponentsObject != 0); + CheckError(Internal.Lib3MFWrapper.ObjectIterator_GetCurrentObject (Handle, out newResource)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newResource); } - public bool IsValid () - { - Byte resultIsValid = 0; + } - CheckError(Internal.Lib3MFWrapper.Object_IsValid (Handle, out resultIsValid)); - return (resultIsValid != 0); + public class CMeshObjectIterator : CResourceIterator + { + public CMeshObjectIterator (IntPtr NewHandle) : base (NewHandle) + { } - public void SetAttachmentAsThumbnail (CAttachment AAttachment) + public CMeshObject GetCurrentMeshObject () { - IntPtr AAttachmentHandle = IntPtr.Zero; - if (AAttachment != null) - AAttachmentHandle = AAttachment.GetHandle(); + IntPtr newResource = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.Object_SetAttachmentAsThumbnail (Handle, AAttachmentHandle)); + CheckError(Internal.Lib3MFWrapper.MeshObjectIterator_GetCurrentMeshObject (Handle, out newResource)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newResource); } - public CAttachment GetThumbnailAttachment () - { - IntPtr newAttachment = IntPtr.Zero; + } - CheckError(Internal.Lib3MFWrapper.Object_GetThumbnailAttachment (Handle, out newAttachment)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newAttachment); + public class CComponentsObjectIterator : CResourceIterator + { + public CComponentsObjectIterator (IntPtr NewHandle) : base (NewHandle) + { } - public void ClearThumbnailAttachment () + public CComponentsObject GetCurrentComponentsObject () { + IntPtr newResource = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.Object_ClearThumbnailAttachment (Handle)); + CheckError(Internal.Lib3MFWrapper.ComponentsObjectIterator_GetCurrentComponentsObject (Handle, out newResource)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newResource); } - public sBox GetOutbox () - { - Internal.InternalBox intresultOutbox; + } - CheckError(Internal.Lib3MFWrapper.Object_GetOutbox (Handle, out intresultOutbox)); - return Internal.Lib3MFWrapper.convertInternalToStruct_Box (intresultOutbox); + public class CTexture2DIterator : CResourceIterator + { + public CTexture2DIterator (IntPtr NewHandle) : base (NewHandle) + { } - public String GetUUID (out bool AHasUUID) + public CTexture2D GetCurrentTexture2D () { - Byte resultHasUUID = 0; - UInt32 sizeUUID = 0; - UInt32 neededUUID = 0; - CheckError(Internal.Lib3MFWrapper.Object_GetUUID (Handle, out resultHasUUID, sizeUUID, out neededUUID, IntPtr.Zero)); - sizeUUID = neededUUID; - byte[] bytesUUID = new byte[sizeUUID]; - GCHandle dataUUID = GCHandle.Alloc(bytesUUID, GCHandleType.Pinned); + IntPtr newResource = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.Object_GetUUID (Handle, out resultHasUUID, sizeUUID, out neededUUID, dataUUID.AddrOfPinnedObject())); - AHasUUID = (resultHasUUID != 0); - dataUUID.Free(); - return Encoding.UTF8.GetString(bytesUUID).TrimEnd(char.MinValue); + CheckError(Internal.Lib3MFWrapper.Texture2DIterator_GetCurrentTexture2D (Handle, out newResource)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newResource); } - public void SetUUID (String AUUID) - { - byte[] byteUUID = Encoding.UTF8.GetBytes(AUUID + char.MinValue); + } - CheckError(Internal.Lib3MFWrapper.Object_SetUUID (Handle, byteUUID)); + public class CBaseMaterialGroupIterator : CResourceIterator + { + public CBaseMaterialGroupIterator (IntPtr NewHandle) : base (NewHandle) + { } - public CMetaDataGroup GetMetaDataGroup () + public CBaseMaterialGroup GetCurrentBaseMaterialGroup () { - IntPtr newMetaDataGroup = IntPtr.Zero; + IntPtr newResource = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.Object_GetMetaDataGroup (Handle, out newMetaDataGroup)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newMetaDataGroup); + CheckError(Internal.Lib3MFWrapper.BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup (Handle, out newResource)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newResource); } - public void SetSlicesMeshResolution (eSlicesMeshResolution AMeshResolution) - { - Int32 enumMeshResolution = (Int32) AMeshResolution; + } - CheckError(Internal.Lib3MFWrapper.Object_SetSlicesMeshResolution (Handle, enumMeshResolution)); + public class CColorGroupIterator : CResourceIterator + { + public CColorGroupIterator (IntPtr NewHandle) : base (NewHandle) + { } - public eSlicesMeshResolution GetSlicesMeshResolution () + public CColorGroup GetCurrentColorGroup () { - Int32 resultMeshResolution = 0; + IntPtr newResource = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.Object_GetSlicesMeshResolution (Handle, out resultMeshResolution)); - return (eSlicesMeshResolution) (resultMeshResolution); + CheckError(Internal.Lib3MFWrapper.ColorGroupIterator_GetCurrentColorGroup (Handle, out newResource)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newResource); } - public bool HasSlices (bool ARecursive) - { - Byte resultHasSlices = 0; + } - CheckError(Internal.Lib3MFWrapper.Object_HasSlices (Handle, (Byte)( ARecursive ? 1 : 0 ), out resultHasSlices)); - return (resultHasSlices != 0); + public class CTexture2DGroupIterator : CResourceIterator + { + public CTexture2DGroupIterator (IntPtr NewHandle) : base (NewHandle) + { } - public void ClearSliceStack () + public CTexture2DGroup GetCurrentTexture2DGroup () { + IntPtr newResource = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.Object_ClearSliceStack (Handle)); + CheckError(Internal.Lib3MFWrapper.Texture2DGroupIterator_GetCurrentTexture2DGroup (Handle, out newResource)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newResource); } - public CSliceStack GetSliceStack () - { - IntPtr newSliceStackInstance = IntPtr.Zero; + } - CheckError(Internal.Lib3MFWrapper.Object_GetSliceStack (Handle, out newSliceStackInstance)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newSliceStackInstance); + public class CCompositeMaterialsIterator : CResourceIterator + { + public CCompositeMaterialsIterator (IntPtr NewHandle) : base (NewHandle) + { } - public void AssignSliceStack (CSliceStack ASliceStackInstance) + public CCompositeMaterials GetCurrentCompositeMaterials () { - IntPtr ASliceStackInstanceHandle = IntPtr.Zero; - if (ASliceStackInstance != null) - ASliceStackInstanceHandle = ASliceStackInstance.GetHandle(); + IntPtr newResource = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.Object_AssignSliceStack (Handle, ASliceStackInstanceHandle)); + CheckError(Internal.Lib3MFWrapper.CompositeMaterialsIterator_GetCurrentCompositeMaterials (Handle, out newResource)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newResource); } } - public class CMeshObject : CObject + public class CMultiPropertyGroupIterator : CResourceIterator { - public CMeshObject (IntPtr NewHandle) : base (NewHandle) + public CMultiPropertyGroupIterator (IntPtr NewHandle) : base (NewHandle) { } - public UInt32 GetVertexCount () + public CMultiPropertyGroup GetCurrentMultiPropertyGroup () { - UInt32 resultVertexCount = 0; + IntPtr newResource = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.MeshObject_GetVertexCount (Handle, out resultVertexCount)); - return resultVertexCount; + CheckError(Internal.Lib3MFWrapper.MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup (Handle, out newResource)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newResource); } - public UInt32 GetTriangleCount () - { - UInt32 resultVertexCount = 0; - - CheckError(Internal.Lib3MFWrapper.MeshObject_GetTriangleCount (Handle, out resultVertexCount)); - return resultVertexCount; - } + } - public sPosition GetVertex (UInt32 AIndex) + public class CMetaData : CBase + { + public CMetaData (IntPtr NewHandle) : base (NewHandle) { - Internal.InternalPosition intresultCoordinates; - - CheckError(Internal.Lib3MFWrapper.MeshObject_GetVertex (Handle, AIndex, out intresultCoordinates)); - return Internal.Lib3MFWrapper.convertInternalToStruct_Position (intresultCoordinates); } - public void SetVertex (UInt32 AIndex, sPosition ACoordinates) + public String GetNameSpace () { - Internal.InternalPosition intCoordinates = Internal.Lib3MFWrapper.convertStructToInternal_Position (ACoordinates); + UInt32 sizeNameSpace = 0; + UInt32 neededNameSpace = 0; + CheckError(Internal.Lib3MFWrapper.MetaData_GetNameSpace (Handle, sizeNameSpace, out neededNameSpace, IntPtr.Zero)); + sizeNameSpace = neededNameSpace; + byte[] bytesNameSpace = new byte[sizeNameSpace]; + GCHandle dataNameSpace = GCHandle.Alloc(bytesNameSpace, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.MeshObject_SetVertex (Handle, AIndex, intCoordinates)); + CheckError(Internal.Lib3MFWrapper.MetaData_GetNameSpace (Handle, sizeNameSpace, out neededNameSpace, dataNameSpace.AddrOfPinnedObject())); + dataNameSpace.Free(); + return Encoding.UTF8.GetString(bytesNameSpace).TrimEnd(char.MinValue); } - public UInt32 AddVertex (sPosition ACoordinates) + public void SetNameSpace (String ANameSpace) { - Internal.InternalPosition intCoordinates = Internal.Lib3MFWrapper.convertStructToInternal_Position (ACoordinates); - UInt32 resultNewIndex = 0; + byte[] byteNameSpace = Encoding.UTF8.GetBytes(ANameSpace + char.MinValue); - CheckError(Internal.Lib3MFWrapper.MeshObject_AddVertex (Handle, intCoordinates, out resultNewIndex)); - return resultNewIndex; + CheckError(Internal.Lib3MFWrapper.MetaData_SetNameSpace (Handle, byteNameSpace)); } - public void GetVertices (out sPosition[] AVertices) + public String GetName () { - UInt64 sizeVertices = 0; - UInt64 neededVertices = 0; - CheckError(Internal.Lib3MFWrapper.MeshObject_GetVertices (Handle, sizeVertices, out neededVertices, IntPtr.Zero)); - sizeVertices = neededVertices; - var arrayVertices = new Internal.InternalPosition[sizeVertices]; - GCHandle dataVertices = GCHandle.Alloc(arrayVertices, GCHandleType.Pinned); + UInt32 sizeName = 0; + UInt32 neededName = 0; + CheckError(Internal.Lib3MFWrapper.MetaData_GetName (Handle, sizeName, out neededName, IntPtr.Zero)); + sizeName = neededName; + byte[] bytesName = new byte[sizeName]; + GCHandle dataName = GCHandle.Alloc(bytesName, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.MeshObject_GetVertices (Handle, sizeVertices, out neededVertices, dataVertices.AddrOfPinnedObject())); - dataVertices.Free(); - AVertices = new sPosition[sizeVertices]; - for (int index = 0; index < AVertices.Length; index++) - AVertices[index] = Internal.Lib3MFWrapper.convertInternalToStruct_Position(arrayVertices[index]); + CheckError(Internal.Lib3MFWrapper.MetaData_GetName (Handle, sizeName, out neededName, dataName.AddrOfPinnedObject())); + dataName.Free(); + return Encoding.UTF8.GetString(bytesName).TrimEnd(char.MinValue); } - public sTriangle GetTriangle (UInt32 AIndex) + public void SetName (String AName) { - Internal.InternalTriangle intresultIndices; + byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); - CheckError(Internal.Lib3MFWrapper.MeshObject_GetTriangle (Handle, AIndex, out intresultIndices)); - return Internal.Lib3MFWrapper.convertInternalToStruct_Triangle (intresultIndices); + CheckError(Internal.Lib3MFWrapper.MetaData_SetName (Handle, byteName)); } - public void SetTriangle (UInt32 AIndex, sTriangle AIndices) + public String GetKey () { - Internal.InternalTriangle intIndices = Internal.Lib3MFWrapper.convertStructToInternal_Triangle (AIndices); + UInt32 sizeKey = 0; + UInt32 neededKey = 0; + CheckError(Internal.Lib3MFWrapper.MetaData_GetKey (Handle, sizeKey, out neededKey, IntPtr.Zero)); + sizeKey = neededKey; + byte[] bytesKey = new byte[sizeKey]; + GCHandle dataKey = GCHandle.Alloc(bytesKey, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.MeshObject_SetTriangle (Handle, AIndex, intIndices)); + CheckError(Internal.Lib3MFWrapper.MetaData_GetKey (Handle, sizeKey, out neededKey, dataKey.AddrOfPinnedObject())); + dataKey.Free(); + return Encoding.UTF8.GetString(bytesKey).TrimEnd(char.MinValue); } - public UInt32 AddTriangle (sTriangle AIndices) + public bool GetMustPreserve () { - Internal.InternalTriangle intIndices = Internal.Lib3MFWrapper.convertStructToInternal_Triangle (AIndices); - UInt32 resultNewIndex = 0; + Byte resultMustPreserve = 0; - CheckError(Internal.Lib3MFWrapper.MeshObject_AddTriangle (Handle, intIndices, out resultNewIndex)); - return resultNewIndex; + CheckError(Internal.Lib3MFWrapper.MetaData_GetMustPreserve (Handle, out resultMustPreserve)); + return (resultMustPreserve != 0); } - public void GetTriangleIndices (out sTriangle[] AIndices) + public void SetMustPreserve (bool AMustPreserve) { - UInt64 sizeIndices = 0; - UInt64 neededIndices = 0; - CheckError(Internal.Lib3MFWrapper.MeshObject_GetTriangleIndices (Handle, sizeIndices, out neededIndices, IntPtr.Zero)); - sizeIndices = neededIndices; - var arrayIndices = new Internal.InternalTriangle[sizeIndices]; - GCHandle dataIndices = GCHandle.Alloc(arrayIndices, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.MeshObject_GetTriangleIndices (Handle, sizeIndices, out neededIndices, dataIndices.AddrOfPinnedObject())); - dataIndices.Free(); - AIndices = new sTriangle[sizeIndices]; - for (int index = 0; index < AIndices.Length; index++) - AIndices[index] = Internal.Lib3MFWrapper.convertInternalToStruct_Triangle(arrayIndices[index]); + CheckError(Internal.Lib3MFWrapper.MetaData_SetMustPreserve (Handle, (Byte)( AMustPreserve ? 1 : 0 ))); } - public void SetObjectLevelProperty (UInt32 AUniqueResourceID, UInt32 APropertyID) + public String GetType () { + UInt32 sizeType = 0; + UInt32 neededType = 0; + CheckError(Internal.Lib3MFWrapper.MetaData_GetType (Handle, sizeType, out neededType, IntPtr.Zero)); + sizeType = neededType; + byte[] bytesType = new byte[sizeType]; + GCHandle dataType = GCHandle.Alloc(bytesType, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.MeshObject_SetObjectLevelProperty (Handle, AUniqueResourceID, APropertyID)); + CheckError(Internal.Lib3MFWrapper.MetaData_GetType (Handle, sizeType, out neededType, dataType.AddrOfPinnedObject())); + dataType.Free(); + return Encoding.UTF8.GetString(bytesType).TrimEnd(char.MinValue); } - public bool GetObjectLevelProperty (out UInt32 AUniqueResourceID, out UInt32 APropertyID) + public void SetType (String AType) { - Byte resultHasObjectLevelProperty = 0; + byte[] byteType = Encoding.UTF8.GetBytes(AType + char.MinValue); - CheckError(Internal.Lib3MFWrapper.MeshObject_GetObjectLevelProperty (Handle, out AUniqueResourceID, out APropertyID, out resultHasObjectLevelProperty)); - return (resultHasObjectLevelProperty != 0); + CheckError(Internal.Lib3MFWrapper.MetaData_SetType (Handle, byteType)); } - public void SetTriangleProperties (UInt32 AIndex, sTriangleProperties AProperties) + public String GetValue () { - Internal.InternalTriangleProperties intProperties = Internal.Lib3MFWrapper.convertStructToInternal_TriangleProperties (AProperties); + UInt32 sizeValue = 0; + UInt32 neededValue = 0; + CheckError(Internal.Lib3MFWrapper.MetaData_GetValue (Handle, sizeValue, out neededValue, IntPtr.Zero)); + sizeValue = neededValue; + byte[] bytesValue = new byte[sizeValue]; + GCHandle dataValue = GCHandle.Alloc(bytesValue, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.MeshObject_SetTriangleProperties (Handle, AIndex, intProperties)); + CheckError(Internal.Lib3MFWrapper.MetaData_GetValue (Handle, sizeValue, out neededValue, dataValue.AddrOfPinnedObject())); + dataValue.Free(); + return Encoding.UTF8.GetString(bytesValue).TrimEnd(char.MinValue); } - public void GetTriangleProperties (UInt32 AIndex, out sTriangleProperties AProperty) + public void SetValue (String AValue) { - Internal.InternalTriangleProperties intresultProperty; + byte[] byteValue = Encoding.UTF8.GetBytes(AValue + char.MinValue); - CheckError(Internal.Lib3MFWrapper.MeshObject_GetTriangleProperties (Handle, AIndex, out intresultProperty)); - AProperty = Internal.Lib3MFWrapper.convertInternalToStruct_TriangleProperties (intresultProperty); + CheckError(Internal.Lib3MFWrapper.MetaData_SetValue (Handle, byteValue)); } - public void SetAllTriangleProperties (sTriangleProperties[] APropertiesArray) + } + + public class CMetaDataGroup : CBase + { + public CMetaDataGroup (IntPtr NewHandle) : base (NewHandle) { - Internal.InternalTriangleProperties[] intdataPropertiesArray = new Internal.InternalTriangleProperties[APropertiesArray.Length]; - for (int index = 0; index < APropertiesArray.Length; index++) - intdataPropertiesArray[index] = Internal.Lib3MFWrapper.convertStructToInternal_TriangleProperties(APropertiesArray[index]); - GCHandle dataPropertiesArray = GCHandle.Alloc(intdataPropertiesArray, GCHandleType.Pinned); + } - CheckError(Internal.Lib3MFWrapper.MeshObject_SetAllTriangleProperties (Handle, (UInt64) APropertiesArray.Length, dataPropertiesArray.AddrOfPinnedObject())); - dataPropertiesArray.Free (); + public UInt32 GetMetaDataCount () + { + UInt32 resultCount = 0; + + CheckError(Internal.Lib3MFWrapper.MetaDataGroup_GetMetaDataCount (Handle, out resultCount)); + return resultCount; } - public void GetAllTriangleProperties (out sTriangleProperties[] APropertiesArray) + public CMetaData GetMetaData (UInt32 AIndex) { - UInt64 sizePropertiesArray = 0; - UInt64 neededPropertiesArray = 0; - CheckError(Internal.Lib3MFWrapper.MeshObject_GetAllTriangleProperties (Handle, sizePropertiesArray, out neededPropertiesArray, IntPtr.Zero)); - sizePropertiesArray = neededPropertiesArray; - var arrayPropertiesArray = new Internal.InternalTriangleProperties[sizePropertiesArray]; - GCHandle dataPropertiesArray = GCHandle.Alloc(arrayPropertiesArray, GCHandleType.Pinned); + IntPtr newMetaData = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.MeshObject_GetAllTriangleProperties (Handle, sizePropertiesArray, out neededPropertiesArray, dataPropertiesArray.AddrOfPinnedObject())); - dataPropertiesArray.Free(); - APropertiesArray = new sTriangleProperties[sizePropertiesArray]; - for (int index = 0; index < APropertiesArray.Length; index++) - APropertiesArray[index] = Internal.Lib3MFWrapper.convertInternalToStruct_TriangleProperties(arrayPropertiesArray[index]); + CheckError(Internal.Lib3MFWrapper.MetaDataGroup_GetMetaData (Handle, AIndex, out newMetaData)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newMetaData); } - public void ClearAllProperties () + public CMetaData GetMetaDataByKey (String ANameSpace, String AName) { + byte[] byteNameSpace = Encoding.UTF8.GetBytes(ANameSpace + char.MinValue); + byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); + IntPtr newMetaData = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.MeshObject_ClearAllProperties (Handle)); + CheckError(Internal.Lib3MFWrapper.MetaDataGroup_GetMetaDataByKey (Handle, byteNameSpace, byteName, out newMetaData)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newMetaData); } - public void SetGeometry (sPosition[] AVertices, sTriangle[] AIndices) + public void RemoveMetaDataByIndex (UInt32 AIndex) { - Internal.InternalPosition[] intdataVertices = new Internal.InternalPosition[AVertices.Length]; - for (int index = 0; index < AVertices.Length; index++) - intdataVertices[index] = Internal.Lib3MFWrapper.convertStructToInternal_Position(AVertices[index]); - GCHandle dataVertices = GCHandle.Alloc(intdataVertices, GCHandleType.Pinned); - Internal.InternalTriangle[] intdataIndices = new Internal.InternalTriangle[AIndices.Length]; - for (int index = 0; index < AIndices.Length; index++) - intdataIndices[index] = Internal.Lib3MFWrapper.convertStructToInternal_Triangle(AIndices[index]); - GCHandle dataIndices = GCHandle.Alloc(intdataIndices, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.MeshObject_SetGeometry (Handle, (UInt64) AVertices.Length, dataVertices.AddrOfPinnedObject(), (UInt64) AIndices.Length, dataIndices.AddrOfPinnedObject())); - dataVertices.Free (); - dataIndices.Free (); + CheckError(Internal.Lib3MFWrapper.MetaDataGroup_RemoveMetaDataByIndex (Handle, AIndex)); } - public bool IsManifoldAndOriented () + public void RemoveMetaData (CMetaData ATheMetaData) { - Byte resultIsManifoldAndOriented = 0; + IntPtr ATheMetaDataHandle = IntPtr.Zero; + if (ATheMetaData != null) + ATheMetaDataHandle = ATheMetaData.GetHandle(); - CheckError(Internal.Lib3MFWrapper.MeshObject_IsManifoldAndOriented (Handle, out resultIsManifoldAndOriented)); - return (resultIsManifoldAndOriented != 0); + CheckError(Internal.Lib3MFWrapper.MetaDataGroup_RemoveMetaData (Handle, ATheMetaDataHandle)); } - public CBeamLattice BeamLattice () + public CMetaData AddMetaData (String ANameSpace, String AName, String AValue, String AType, bool AMustPreserve) { - IntPtr newTheBeamLattice = IntPtr.Zero; + byte[] byteNameSpace = Encoding.UTF8.GetBytes(ANameSpace + char.MinValue); + byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); + byte[] byteValue = Encoding.UTF8.GetBytes(AValue + char.MinValue); + byte[] byteType = Encoding.UTF8.GetBytes(AType + char.MinValue); + IntPtr newMetaData = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.MeshObject_BeamLattice (Handle, out newTheBeamLattice)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newTheBeamLattice); + CheckError(Internal.Lib3MFWrapper.MetaDataGroup_AddMetaData (Handle, byteNameSpace, byteName, byteValue, byteType, (Byte)( AMustPreserve ? 1 : 0 ), out newMetaData)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newMetaData); } } - public class CBeamLattice : CBase + public class CObject : CResource { - public CBeamLattice (IntPtr NewHandle) : base (NewHandle) + public CObject (IntPtr NewHandle) : base (NewHandle) { } - public Double GetMinLength () + public eObjectType GetType () { - Double resultMinLength = 0; + Int32 resultObjectType = 0; - CheckError(Internal.Lib3MFWrapper.BeamLattice_GetMinLength (Handle, out resultMinLength)); - return resultMinLength; + CheckError(Internal.Lib3MFWrapper.Object_GetType (Handle, out resultObjectType)); + return (eObjectType) (resultObjectType); } - public void SetMinLength (Double AMinLength) + public void SetType (eObjectType AObjectType) { + Int32 enumObjectType = (Int32) AObjectType; - CheckError(Internal.Lib3MFWrapper.BeamLattice_SetMinLength (Handle, AMinLength)); + CheckError(Internal.Lib3MFWrapper.Object_SetType (Handle, enumObjectType)); } - public void GetClipping (out eBeamLatticeClipMode AClipMode, out UInt32 AUniqueResourceID) + public String GetName () { - Int32 resultClipMode = 0; + UInt32 sizeName = 0; + UInt32 neededName = 0; + CheckError(Internal.Lib3MFWrapper.Object_GetName (Handle, sizeName, out neededName, IntPtr.Zero)); + sizeName = neededName; + byte[] bytesName = new byte[sizeName]; + GCHandle dataName = GCHandle.Alloc(bytesName, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.BeamLattice_GetClipping (Handle, out resultClipMode, out AUniqueResourceID)); - AClipMode = (eBeamLatticeClipMode) (resultClipMode); + CheckError(Internal.Lib3MFWrapper.Object_GetName (Handle, sizeName, out neededName, dataName.AddrOfPinnedObject())); + dataName.Free(); + return Encoding.UTF8.GetString(bytesName).TrimEnd(char.MinValue); } - public void SetClipping (eBeamLatticeClipMode AClipMode, UInt32 AUniqueResourceID) + public void SetName (String AName) { - Int32 enumClipMode = (Int32) AClipMode; + byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); - CheckError(Internal.Lib3MFWrapper.BeamLattice_SetClipping (Handle, enumClipMode, AUniqueResourceID)); + CheckError(Internal.Lib3MFWrapper.Object_SetName (Handle, byteName)); } - public bool GetRepresentation (out UInt32 AUniqueResourceID) + public String GetPartNumber () { - Byte resultHasRepresentation = 0; + UInt32 sizePartNumber = 0; + UInt32 neededPartNumber = 0; + CheckError(Internal.Lib3MFWrapper.Object_GetPartNumber (Handle, sizePartNumber, out neededPartNumber, IntPtr.Zero)); + sizePartNumber = neededPartNumber; + byte[] bytesPartNumber = new byte[sizePartNumber]; + GCHandle dataPartNumber = GCHandle.Alloc(bytesPartNumber, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.BeamLattice_GetRepresentation (Handle, out resultHasRepresentation, out AUniqueResourceID)); - return (resultHasRepresentation != 0); + CheckError(Internal.Lib3MFWrapper.Object_GetPartNumber (Handle, sizePartNumber, out neededPartNumber, dataPartNumber.AddrOfPinnedObject())); + dataPartNumber.Free(); + return Encoding.UTF8.GetString(bytesPartNumber).TrimEnd(char.MinValue); } - public void SetRepresentation (UInt32 AUniqueResourceID) + public void SetPartNumber (String APartNumber) { + byte[] bytePartNumber = Encoding.UTF8.GetBytes(APartNumber + char.MinValue); - CheckError(Internal.Lib3MFWrapper.BeamLattice_SetRepresentation (Handle, AUniqueResourceID)); + CheckError(Internal.Lib3MFWrapper.Object_SetPartNumber (Handle, bytePartNumber)); } - public void GetBallOptions (out eBeamLatticeBallMode ABallMode, out Double ABallRadius) + public bool IsMeshObject () { - Int32 resultBallMode = 0; + Byte resultIsMeshObject = 0; - CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBallOptions (Handle, out resultBallMode, out ABallRadius)); - ABallMode = (eBeamLatticeBallMode) (resultBallMode); + CheckError(Internal.Lib3MFWrapper.Object_IsMeshObject (Handle, out resultIsMeshObject)); + return (resultIsMeshObject != 0); } - public void SetBallOptions (eBeamLatticeBallMode ABallMode, Double ABallRadius) + public bool IsComponentsObject () { - Int32 enumBallMode = (Int32) ABallMode; + Byte resultIsComponentsObject = 0; - CheckError(Internal.Lib3MFWrapper.BeamLattice_SetBallOptions (Handle, enumBallMode, ABallRadius)); + CheckError(Internal.Lib3MFWrapper.Object_IsComponentsObject (Handle, out resultIsComponentsObject)); + return (resultIsComponentsObject != 0); } - public UInt32 GetBeamCount () + public bool IsValid () { - UInt32 resultCount = 0; + Byte resultIsValid = 0; - CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBeamCount (Handle, out resultCount)); - return resultCount; + CheckError(Internal.Lib3MFWrapper.Object_IsValid (Handle, out resultIsValid)); + return (resultIsValid != 0); } - public sBeam GetBeam (UInt32 AIndex) - { - Internal.InternalBeam intresultBeamInfo; - - CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBeam (Handle, AIndex, out intresultBeamInfo)); - return Internal.Lib3MFWrapper.convertInternalToStruct_Beam (intresultBeamInfo); - } - - public UInt32 AddBeam (sBeam ABeamInfo) + public void SetAttachmentAsThumbnail (CAttachment AAttachment) { - Internal.InternalBeam intBeamInfo = Internal.Lib3MFWrapper.convertStructToInternal_Beam (ABeamInfo); - UInt32 resultIndex = 0; + IntPtr AAttachmentHandle = IntPtr.Zero; + if (AAttachment != null) + AAttachmentHandle = AAttachment.GetHandle(); - CheckError(Internal.Lib3MFWrapper.BeamLattice_AddBeam (Handle, intBeamInfo, out resultIndex)); - return resultIndex; + CheckError(Internal.Lib3MFWrapper.Object_SetAttachmentAsThumbnail (Handle, AAttachmentHandle)); } - public void SetBeam (UInt32 AIndex, sBeam ABeamInfo) + public CAttachment GetThumbnailAttachment () { - Internal.InternalBeam intBeamInfo = Internal.Lib3MFWrapper.convertStructToInternal_Beam (ABeamInfo); + IntPtr newAttachment = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.BeamLattice_SetBeam (Handle, AIndex, intBeamInfo)); + CheckError(Internal.Lib3MFWrapper.Object_GetThumbnailAttachment (Handle, out newAttachment)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newAttachment); } - public void SetBeams (sBeam[] ABeamInfo) + public void ClearThumbnailAttachment () { - Internal.InternalBeam[] intdataBeamInfo = new Internal.InternalBeam[ABeamInfo.Length]; - for (int index = 0; index < ABeamInfo.Length; index++) - intdataBeamInfo[index] = Internal.Lib3MFWrapper.convertStructToInternal_Beam(ABeamInfo[index]); - GCHandle dataBeamInfo = GCHandle.Alloc(intdataBeamInfo, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.BeamLattice_SetBeams (Handle, (UInt64) ABeamInfo.Length, dataBeamInfo.AddrOfPinnedObject())); - dataBeamInfo.Free (); + CheckError(Internal.Lib3MFWrapper.Object_ClearThumbnailAttachment (Handle)); } - public void GetBeams (out sBeam[] ABeamInfo) + public sBox GetOutbox () { - UInt64 sizeBeamInfo = 0; - UInt64 neededBeamInfo = 0; - CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBeams (Handle, sizeBeamInfo, out neededBeamInfo, IntPtr.Zero)); - sizeBeamInfo = neededBeamInfo; - var arrayBeamInfo = new Internal.InternalBeam[sizeBeamInfo]; - GCHandle dataBeamInfo = GCHandle.Alloc(arrayBeamInfo, GCHandleType.Pinned); + Internal.InternalBox intresultOutbox; - CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBeams (Handle, sizeBeamInfo, out neededBeamInfo, dataBeamInfo.AddrOfPinnedObject())); - dataBeamInfo.Free(); - ABeamInfo = new sBeam[sizeBeamInfo]; - for (int index = 0; index < ABeamInfo.Length; index++) - ABeamInfo[index] = Internal.Lib3MFWrapper.convertInternalToStruct_Beam(arrayBeamInfo[index]); + CheckError(Internal.Lib3MFWrapper.Object_GetOutbox (Handle, out intresultOutbox)); + return Internal.Lib3MFWrapper.convertInternalToStruct_Box (intresultOutbox); } - public UInt32 GetBallCount () + public String GetUUID (out bool AHasUUID) { - UInt32 resultCount = 0; + Byte resultHasUUID = 0; + UInt32 sizeUUID = 0; + UInt32 neededUUID = 0; + CheckError(Internal.Lib3MFWrapper.Object_GetUUID (Handle, out resultHasUUID, sizeUUID, out neededUUID, IntPtr.Zero)); + sizeUUID = neededUUID; + byte[] bytesUUID = new byte[sizeUUID]; + GCHandle dataUUID = GCHandle.Alloc(bytesUUID, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBallCount (Handle, out resultCount)); - return resultCount; + CheckError(Internal.Lib3MFWrapper.Object_GetUUID (Handle, out resultHasUUID, sizeUUID, out neededUUID, dataUUID.AddrOfPinnedObject())); + AHasUUID = (resultHasUUID != 0); + dataUUID.Free(); + return Encoding.UTF8.GetString(bytesUUID).TrimEnd(char.MinValue); } - public sBall GetBall (UInt32 AIndex) + public void SetUUID (String AUUID) { - Internal.InternalBall intresultBallInfo; + byte[] byteUUID = Encoding.UTF8.GetBytes(AUUID + char.MinValue); - CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBall (Handle, AIndex, out intresultBallInfo)); - return Internal.Lib3MFWrapper.convertInternalToStruct_Ball (intresultBallInfo); + CheckError(Internal.Lib3MFWrapper.Object_SetUUID (Handle, byteUUID)); } - public UInt32 AddBall (sBall ABallInfo) + public CMetaDataGroup GetMetaDataGroup () { - Internal.InternalBall intBallInfo = Internal.Lib3MFWrapper.convertStructToInternal_Ball (ABallInfo); - UInt32 resultIndex = 0; + IntPtr newMetaDataGroup = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.BeamLattice_AddBall (Handle, intBallInfo, out resultIndex)); - return resultIndex; + CheckError(Internal.Lib3MFWrapper.Object_GetMetaDataGroup (Handle, out newMetaDataGroup)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newMetaDataGroup); } - public void SetBall (UInt32 AIndex, sBall ABallInfo) + public void SetSlicesMeshResolution (eSlicesMeshResolution AMeshResolution) { - Internal.InternalBall intBallInfo = Internal.Lib3MFWrapper.convertStructToInternal_Ball (ABallInfo); + Int32 enumMeshResolution = (Int32) AMeshResolution; - CheckError(Internal.Lib3MFWrapper.BeamLattice_SetBall (Handle, AIndex, intBallInfo)); + CheckError(Internal.Lib3MFWrapper.Object_SetSlicesMeshResolution (Handle, enumMeshResolution)); } - public void SetBalls (sBall[] ABallInfo) + public eSlicesMeshResolution GetSlicesMeshResolution () { - Internal.InternalBall[] intdataBallInfo = new Internal.InternalBall[ABallInfo.Length]; - for (int index = 0; index < ABallInfo.Length; index++) - intdataBallInfo[index] = Internal.Lib3MFWrapper.convertStructToInternal_Ball(ABallInfo[index]); - GCHandle dataBallInfo = GCHandle.Alloc(intdataBallInfo, GCHandleType.Pinned); + Int32 resultMeshResolution = 0; - CheckError(Internal.Lib3MFWrapper.BeamLattice_SetBalls (Handle, (UInt64) ABallInfo.Length, dataBallInfo.AddrOfPinnedObject())); - dataBallInfo.Free (); + CheckError(Internal.Lib3MFWrapper.Object_GetSlicesMeshResolution (Handle, out resultMeshResolution)); + return (eSlicesMeshResolution) (resultMeshResolution); } - public void GetBalls (out sBall[] ABallInfo) + public bool HasSlices (bool ARecursive) { - UInt64 sizeBallInfo = 0; - UInt64 neededBallInfo = 0; - CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBalls (Handle, sizeBallInfo, out neededBallInfo, IntPtr.Zero)); - sizeBallInfo = neededBallInfo; - var arrayBallInfo = new Internal.InternalBall[sizeBallInfo]; - GCHandle dataBallInfo = GCHandle.Alloc(arrayBallInfo, GCHandleType.Pinned); + Byte resultHasSlices = 0; - CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBalls (Handle, sizeBallInfo, out neededBallInfo, dataBallInfo.AddrOfPinnedObject())); - dataBallInfo.Free(); - ABallInfo = new sBall[sizeBallInfo]; - for (int index = 0; index < ABallInfo.Length; index++) - ABallInfo[index] = Internal.Lib3MFWrapper.convertInternalToStruct_Ball(arrayBallInfo[index]); + CheckError(Internal.Lib3MFWrapper.Object_HasSlices (Handle, (Byte)( ARecursive ? 1 : 0 ), out resultHasSlices)); + return (resultHasSlices != 0); } - public UInt32 GetBeamSetCount () + public void ClearSliceStack () { - UInt32 resultCount = 0; - CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBeamSetCount (Handle, out resultCount)); - return resultCount; + CheckError(Internal.Lib3MFWrapper.Object_ClearSliceStack (Handle)); } - public CBeamSet AddBeamSet () + public CSliceStack GetSliceStack () { - IntPtr newBeamSet = IntPtr.Zero; + IntPtr newSliceStackInstance = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.BeamLattice_AddBeamSet (Handle, out newBeamSet)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newBeamSet); + CheckError(Internal.Lib3MFWrapper.Object_GetSliceStack (Handle, out newSliceStackInstance)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newSliceStackInstance); } - public CBeamSet GetBeamSet (UInt32 AIndex) + public void AssignSliceStack (CSliceStack ASliceStackInstance) { - IntPtr newBeamSet = IntPtr.Zero; + IntPtr ASliceStackInstanceHandle = IntPtr.Zero; + if (ASliceStackInstance != null) + ASliceStackInstanceHandle = ASliceStackInstance.GetHandle(); - CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBeamSet (Handle, AIndex, out newBeamSet)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newBeamSet); + CheckError(Internal.Lib3MFWrapper.Object_AssignSliceStack (Handle, ASliceStackInstanceHandle)); } } - public class CComponent : CBase + public class CMeshObject : CObject { - public CComponent (IntPtr NewHandle) : base (NewHandle) + public CMeshObject (IntPtr NewHandle) : base (NewHandle) { } - public CObject GetObjectResource () + public UInt32 GetVertexCount () { - IntPtr newObjectResource = IntPtr.Zero; + UInt32 resultVertexCount = 0; - CheckError(Internal.Lib3MFWrapper.Component_GetObjectResource (Handle, out newObjectResource)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newObjectResource); + CheckError(Internal.Lib3MFWrapper.MeshObject_GetVertexCount (Handle, out resultVertexCount)); + return resultVertexCount; } - public UInt32 GetObjectResourceID () + public UInt32 GetTriangleCount () { - UInt32 resultUniqueResourceID = 0; + UInt32 resultVertexCount = 0; - CheckError(Internal.Lib3MFWrapper.Component_GetObjectResourceID (Handle, out resultUniqueResourceID)); - return resultUniqueResourceID; + CheckError(Internal.Lib3MFWrapper.MeshObject_GetTriangleCount (Handle, out resultVertexCount)); + return resultVertexCount; } - public String GetUUID (out bool AHasUUID) + public sPosition GetVertex (UInt32 AIndex) { - Byte resultHasUUID = 0; - UInt32 sizeUUID = 0; - UInt32 neededUUID = 0; - CheckError(Internal.Lib3MFWrapper.Component_GetUUID (Handle, out resultHasUUID, sizeUUID, out neededUUID, IntPtr.Zero)); - sizeUUID = neededUUID; - byte[] bytesUUID = new byte[sizeUUID]; - GCHandle dataUUID = GCHandle.Alloc(bytesUUID, GCHandleType.Pinned); + Internal.InternalPosition intresultCoordinates; - CheckError(Internal.Lib3MFWrapper.Component_GetUUID (Handle, out resultHasUUID, sizeUUID, out neededUUID, dataUUID.AddrOfPinnedObject())); - AHasUUID = (resultHasUUID != 0); - dataUUID.Free(); - return Encoding.UTF8.GetString(bytesUUID).TrimEnd(char.MinValue); + CheckError(Internal.Lib3MFWrapper.MeshObject_GetVertex (Handle, AIndex, out intresultCoordinates)); + return Internal.Lib3MFWrapper.convertInternalToStruct_Position (intresultCoordinates); } - public void SetUUID (String AUUID) + public void SetVertex (UInt32 AIndex, sPosition ACoordinates) { - byte[] byteUUID = Encoding.UTF8.GetBytes(AUUID + char.MinValue); + Internal.InternalPosition intCoordinates = Internal.Lib3MFWrapper.convertStructToInternal_Position (ACoordinates); - CheckError(Internal.Lib3MFWrapper.Component_SetUUID (Handle, byteUUID)); + CheckError(Internal.Lib3MFWrapper.MeshObject_SetVertex (Handle, AIndex, intCoordinates)); } - public bool HasTransform () + public UInt32 AddVertex (sPosition ACoordinates) { - Byte resultHasTransform = 0; + Internal.InternalPosition intCoordinates = Internal.Lib3MFWrapper.convertStructToInternal_Position (ACoordinates); + UInt32 resultNewIndex = 0; - CheckError(Internal.Lib3MFWrapper.Component_HasTransform (Handle, out resultHasTransform)); - return (resultHasTransform != 0); + CheckError(Internal.Lib3MFWrapper.MeshObject_AddVertex (Handle, intCoordinates, out resultNewIndex)); + return resultNewIndex; } - public sTransform GetTransform () + public void GetVertices (out sPosition[] AVertices) { - Internal.InternalTransform intresultTransform; + UInt64 sizeVertices = 0; + UInt64 neededVertices = 0; + CheckError(Internal.Lib3MFWrapper.MeshObject_GetVertices (Handle, sizeVertices, out neededVertices, IntPtr.Zero)); + sizeVertices = neededVertices; + var arrayVertices = new Internal.InternalPosition[sizeVertices]; + GCHandle dataVertices = GCHandle.Alloc(arrayVertices, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.Component_GetTransform (Handle, out intresultTransform)); - return Internal.Lib3MFWrapper.convertInternalToStruct_Transform (intresultTransform); + CheckError(Internal.Lib3MFWrapper.MeshObject_GetVertices (Handle, sizeVertices, out neededVertices, dataVertices.AddrOfPinnedObject())); + dataVertices.Free(); + AVertices = new sPosition[sizeVertices]; + for (int index = 0; index < AVertices.Length; index++) + AVertices[index] = Internal.Lib3MFWrapper.convertInternalToStruct_Position(arrayVertices[index]); } - public void SetTransform (sTransform ATransform) + public sTriangle GetTriangle (UInt32 AIndex) { - Internal.InternalTransform intTransform = Internal.Lib3MFWrapper.convertStructToInternal_Transform (ATransform); + Internal.InternalTriangle intresultIndices; - CheckError(Internal.Lib3MFWrapper.Component_SetTransform (Handle, intTransform)); + CheckError(Internal.Lib3MFWrapper.MeshObject_GetTriangle (Handle, AIndex, out intresultIndices)); + return Internal.Lib3MFWrapper.convertInternalToStruct_Triangle (intresultIndices); } - } - - public class CComponentsObject : CObject - { - public CComponentsObject (IntPtr NewHandle) : base (NewHandle) + public void SetTriangle (UInt32 AIndex, sTriangle AIndices) { + Internal.InternalTriangle intIndices = Internal.Lib3MFWrapper.convertStructToInternal_Triangle (AIndices); + + CheckError(Internal.Lib3MFWrapper.MeshObject_SetTriangle (Handle, AIndex, intIndices)); } - public CComponent AddComponent (CObject AObjectResource, sTransform ATransform) + public UInt32 AddTriangle (sTriangle AIndices) { - IntPtr AObjectResourceHandle = IntPtr.Zero; - if (AObjectResource != null) - AObjectResourceHandle = AObjectResource.GetHandle(); - Internal.InternalTransform intTransform = Internal.Lib3MFWrapper.convertStructToInternal_Transform (ATransform); - IntPtr newComponentInstance = IntPtr.Zero; + Internal.InternalTriangle intIndices = Internal.Lib3MFWrapper.convertStructToInternal_Triangle (AIndices); + UInt32 resultNewIndex = 0; - CheckError(Internal.Lib3MFWrapper.ComponentsObject_AddComponent (Handle, AObjectResourceHandle, intTransform, out newComponentInstance)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newComponentInstance); + CheckError(Internal.Lib3MFWrapper.MeshObject_AddTriangle (Handle, intIndices, out resultNewIndex)); + return resultNewIndex; } - public CComponent GetComponent (UInt32 AIndex) + public void GetTriangleIndices (out sTriangle[] AIndices) { - IntPtr newComponentInstance = IntPtr.Zero; + UInt64 sizeIndices = 0; + UInt64 neededIndices = 0; + CheckError(Internal.Lib3MFWrapper.MeshObject_GetTriangleIndices (Handle, sizeIndices, out neededIndices, IntPtr.Zero)); + sizeIndices = neededIndices; + var arrayIndices = new Internal.InternalTriangle[sizeIndices]; + GCHandle dataIndices = GCHandle.Alloc(arrayIndices, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.ComponentsObject_GetComponent (Handle, AIndex, out newComponentInstance)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newComponentInstance); + CheckError(Internal.Lib3MFWrapper.MeshObject_GetTriangleIndices (Handle, sizeIndices, out neededIndices, dataIndices.AddrOfPinnedObject())); + dataIndices.Free(); + AIndices = new sTriangle[sizeIndices]; + for (int index = 0; index < AIndices.Length; index++) + AIndices[index] = Internal.Lib3MFWrapper.convertInternalToStruct_Triangle(arrayIndices[index]); } - public UInt32 GetComponentCount () + public void SetObjectLevelProperty (UInt32 AUniqueResourceID, UInt32 APropertyID) { - UInt32 resultCount = 0; - CheckError(Internal.Lib3MFWrapper.ComponentsObject_GetComponentCount (Handle, out resultCount)); - return resultCount; + CheckError(Internal.Lib3MFWrapper.MeshObject_SetObjectLevelProperty (Handle, AUniqueResourceID, APropertyID)); + } + + public bool GetObjectLevelProperty (out UInt32 AUniqueResourceID, out UInt32 APropertyID) + { + Byte resultHasObjectLevelProperty = 0; + + CheckError(Internal.Lib3MFWrapper.MeshObject_GetObjectLevelProperty (Handle, out AUniqueResourceID, out APropertyID, out resultHasObjectLevelProperty)); + return (resultHasObjectLevelProperty != 0); + } + + public void SetTriangleProperties (UInt32 AIndex, sTriangleProperties AProperties) + { + Internal.InternalTriangleProperties intProperties = Internal.Lib3MFWrapper.convertStructToInternal_TriangleProperties (AProperties); + + CheckError(Internal.Lib3MFWrapper.MeshObject_SetTriangleProperties (Handle, AIndex, intProperties)); + } + + public void GetTriangleProperties (UInt32 AIndex, out sTriangleProperties AProperty) + { + Internal.InternalTriangleProperties intresultProperty; + + CheckError(Internal.Lib3MFWrapper.MeshObject_GetTriangleProperties (Handle, AIndex, out intresultProperty)); + AProperty = Internal.Lib3MFWrapper.convertInternalToStruct_TriangleProperties (intresultProperty); + } + + public void SetAllTriangleProperties (sTriangleProperties[] APropertiesArray) + { + Internal.InternalTriangleProperties[] intdataPropertiesArray = new Internal.InternalTriangleProperties[APropertiesArray.Length]; + for (int index = 0; index < APropertiesArray.Length; index++) + intdataPropertiesArray[index] = Internal.Lib3MFWrapper.convertStructToInternal_TriangleProperties(APropertiesArray[index]); + GCHandle dataPropertiesArray = GCHandle.Alloc(intdataPropertiesArray, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.MeshObject_SetAllTriangleProperties (Handle, (UInt64) APropertiesArray.Length, dataPropertiesArray.AddrOfPinnedObject())); + dataPropertiesArray.Free (); + } + + public void GetAllTriangleProperties (out sTriangleProperties[] APropertiesArray) + { + UInt64 sizePropertiesArray = 0; + UInt64 neededPropertiesArray = 0; + CheckError(Internal.Lib3MFWrapper.MeshObject_GetAllTriangleProperties (Handle, sizePropertiesArray, out neededPropertiesArray, IntPtr.Zero)); + sizePropertiesArray = neededPropertiesArray; + var arrayPropertiesArray = new Internal.InternalTriangleProperties[sizePropertiesArray]; + GCHandle dataPropertiesArray = GCHandle.Alloc(arrayPropertiesArray, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.MeshObject_GetAllTriangleProperties (Handle, sizePropertiesArray, out neededPropertiesArray, dataPropertiesArray.AddrOfPinnedObject())); + dataPropertiesArray.Free(); + APropertiesArray = new sTriangleProperties[sizePropertiesArray]; + for (int index = 0; index < APropertiesArray.Length; index++) + APropertiesArray[index] = Internal.Lib3MFWrapper.convertInternalToStruct_TriangleProperties(arrayPropertiesArray[index]); + } + + public void ClearAllProperties () + { + + CheckError(Internal.Lib3MFWrapper.MeshObject_ClearAllProperties (Handle)); + } + + public void SetGeometry (sPosition[] AVertices, sTriangle[] AIndices) + { + Internal.InternalPosition[] intdataVertices = new Internal.InternalPosition[AVertices.Length]; + for (int index = 0; index < AVertices.Length; index++) + intdataVertices[index] = Internal.Lib3MFWrapper.convertStructToInternal_Position(AVertices[index]); + GCHandle dataVertices = GCHandle.Alloc(intdataVertices, GCHandleType.Pinned); + Internal.InternalTriangle[] intdataIndices = new Internal.InternalTriangle[AIndices.Length]; + for (int index = 0; index < AIndices.Length; index++) + intdataIndices[index] = Internal.Lib3MFWrapper.convertStructToInternal_Triangle(AIndices[index]); + GCHandle dataIndices = GCHandle.Alloc(intdataIndices, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.MeshObject_SetGeometry (Handle, (UInt64) AVertices.Length, dataVertices.AddrOfPinnedObject(), (UInt64) AIndices.Length, dataIndices.AddrOfPinnedObject())); + dataVertices.Free (); + dataIndices.Free (); + } + + public bool IsManifoldAndOriented () + { + Byte resultIsManifoldAndOriented = 0; + + CheckError(Internal.Lib3MFWrapper.MeshObject_IsManifoldAndOriented (Handle, out resultIsManifoldAndOriented)); + return (resultIsManifoldAndOriented != 0); + } + + public CBeamLattice BeamLattice () + { + IntPtr newTheBeamLattice = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.MeshObject_BeamLattice (Handle, out newTheBeamLattice)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newTheBeamLattice); + } + + } + + public class CBeamLattice : CBase + { + public CBeamLattice (IntPtr NewHandle) : base (NewHandle) + { + } + + public Double GetMinLength () + { + Double resultMinLength = 0; + + CheckError(Internal.Lib3MFWrapper.BeamLattice_GetMinLength (Handle, out resultMinLength)); + return resultMinLength; + } + + public void SetMinLength (Double AMinLength) + { + + CheckError(Internal.Lib3MFWrapper.BeamLattice_SetMinLength (Handle, AMinLength)); + } + + public void GetClipping (out eBeamLatticeClipMode AClipMode, out UInt32 AUniqueResourceID) + { + Int32 resultClipMode = 0; + + CheckError(Internal.Lib3MFWrapper.BeamLattice_GetClipping (Handle, out resultClipMode, out AUniqueResourceID)); + AClipMode = (eBeamLatticeClipMode) (resultClipMode); + } + + public void SetClipping (eBeamLatticeClipMode AClipMode, UInt32 AUniqueResourceID) + { + Int32 enumClipMode = (Int32) AClipMode; + + CheckError(Internal.Lib3MFWrapper.BeamLattice_SetClipping (Handle, enumClipMode, AUniqueResourceID)); + } + + public bool GetRepresentation (out UInt32 AUniqueResourceID) + { + Byte resultHasRepresentation = 0; + + CheckError(Internal.Lib3MFWrapper.BeamLattice_GetRepresentation (Handle, out resultHasRepresentation, out AUniqueResourceID)); + return (resultHasRepresentation != 0); + } + + public void SetRepresentation (UInt32 AUniqueResourceID) + { + + CheckError(Internal.Lib3MFWrapper.BeamLattice_SetRepresentation (Handle, AUniqueResourceID)); + } + + public void GetBallOptions (out eBeamLatticeBallMode ABallMode, out Double ABallRadius) + { + Int32 resultBallMode = 0; + + CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBallOptions (Handle, out resultBallMode, out ABallRadius)); + ABallMode = (eBeamLatticeBallMode) (resultBallMode); + } + + public void SetBallOptions (eBeamLatticeBallMode ABallMode, Double ABallRadius) + { + Int32 enumBallMode = (Int32) ABallMode; + + CheckError(Internal.Lib3MFWrapper.BeamLattice_SetBallOptions (Handle, enumBallMode, ABallRadius)); + } + + public UInt32 GetBeamCount () + { + UInt32 resultCount = 0; + + CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBeamCount (Handle, out resultCount)); + return resultCount; + } + + public sBeam GetBeam (UInt32 AIndex) + { + Internal.InternalBeam intresultBeamInfo; + + CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBeam (Handle, AIndex, out intresultBeamInfo)); + return Internal.Lib3MFWrapper.convertInternalToStruct_Beam (intresultBeamInfo); + } + + public UInt32 AddBeam (sBeam ABeamInfo) + { + Internal.InternalBeam intBeamInfo = Internal.Lib3MFWrapper.convertStructToInternal_Beam (ABeamInfo); + UInt32 resultIndex = 0; + + CheckError(Internal.Lib3MFWrapper.BeamLattice_AddBeam (Handle, intBeamInfo, out resultIndex)); + return resultIndex; + } + + public void SetBeam (UInt32 AIndex, sBeam ABeamInfo) + { + Internal.InternalBeam intBeamInfo = Internal.Lib3MFWrapper.convertStructToInternal_Beam (ABeamInfo); + + CheckError(Internal.Lib3MFWrapper.BeamLattice_SetBeam (Handle, AIndex, intBeamInfo)); + } + + public void SetBeams (sBeam[] ABeamInfo) + { + Internal.InternalBeam[] intdataBeamInfo = new Internal.InternalBeam[ABeamInfo.Length]; + for (int index = 0; index < ABeamInfo.Length; index++) + intdataBeamInfo[index] = Internal.Lib3MFWrapper.convertStructToInternal_Beam(ABeamInfo[index]); + GCHandle dataBeamInfo = GCHandle.Alloc(intdataBeamInfo, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.BeamLattice_SetBeams (Handle, (UInt64) ABeamInfo.Length, dataBeamInfo.AddrOfPinnedObject())); + dataBeamInfo.Free (); + } + + public void GetBeams (out sBeam[] ABeamInfo) + { + UInt64 sizeBeamInfo = 0; + UInt64 neededBeamInfo = 0; + CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBeams (Handle, sizeBeamInfo, out neededBeamInfo, IntPtr.Zero)); + sizeBeamInfo = neededBeamInfo; + var arrayBeamInfo = new Internal.InternalBeam[sizeBeamInfo]; + GCHandle dataBeamInfo = GCHandle.Alloc(arrayBeamInfo, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBeams (Handle, sizeBeamInfo, out neededBeamInfo, dataBeamInfo.AddrOfPinnedObject())); + dataBeamInfo.Free(); + ABeamInfo = new sBeam[sizeBeamInfo]; + for (int index = 0; index < ABeamInfo.Length; index++) + ABeamInfo[index] = Internal.Lib3MFWrapper.convertInternalToStruct_Beam(arrayBeamInfo[index]); + } + + public UInt32 GetBallCount () + { + UInt32 resultCount = 0; + + CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBallCount (Handle, out resultCount)); + return resultCount; + } + + public sBall GetBall (UInt32 AIndex) + { + Internal.InternalBall intresultBallInfo; + + CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBall (Handle, AIndex, out intresultBallInfo)); + return Internal.Lib3MFWrapper.convertInternalToStruct_Ball (intresultBallInfo); + } + + public UInt32 AddBall (sBall ABallInfo) + { + Internal.InternalBall intBallInfo = Internal.Lib3MFWrapper.convertStructToInternal_Ball (ABallInfo); + UInt32 resultIndex = 0; + + CheckError(Internal.Lib3MFWrapper.BeamLattice_AddBall (Handle, intBallInfo, out resultIndex)); + return resultIndex; + } + + public void SetBall (UInt32 AIndex, sBall ABallInfo) + { + Internal.InternalBall intBallInfo = Internal.Lib3MFWrapper.convertStructToInternal_Ball (ABallInfo); + + CheckError(Internal.Lib3MFWrapper.BeamLattice_SetBall (Handle, AIndex, intBallInfo)); + } + + public void SetBalls (sBall[] ABallInfo) + { + Internal.InternalBall[] intdataBallInfo = new Internal.InternalBall[ABallInfo.Length]; + for (int index = 0; index < ABallInfo.Length; index++) + intdataBallInfo[index] = Internal.Lib3MFWrapper.convertStructToInternal_Ball(ABallInfo[index]); + GCHandle dataBallInfo = GCHandle.Alloc(intdataBallInfo, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.BeamLattice_SetBalls (Handle, (UInt64) ABallInfo.Length, dataBallInfo.AddrOfPinnedObject())); + dataBallInfo.Free (); + } + + public void GetBalls (out sBall[] ABallInfo) + { + UInt64 sizeBallInfo = 0; + UInt64 neededBallInfo = 0; + CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBalls (Handle, sizeBallInfo, out neededBallInfo, IntPtr.Zero)); + sizeBallInfo = neededBallInfo; + var arrayBallInfo = new Internal.InternalBall[sizeBallInfo]; + GCHandle dataBallInfo = GCHandle.Alloc(arrayBallInfo, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBalls (Handle, sizeBallInfo, out neededBallInfo, dataBallInfo.AddrOfPinnedObject())); + dataBallInfo.Free(); + ABallInfo = new sBall[sizeBallInfo]; + for (int index = 0; index < ABallInfo.Length; index++) + ABallInfo[index] = Internal.Lib3MFWrapper.convertInternalToStruct_Ball(arrayBallInfo[index]); + } + + public UInt32 GetBeamSetCount () + { + UInt32 resultCount = 0; + + CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBeamSetCount (Handle, out resultCount)); + return resultCount; + } + + public CBeamSet AddBeamSet () + { + IntPtr newBeamSet = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.BeamLattice_AddBeamSet (Handle, out newBeamSet)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newBeamSet); + } + + public CBeamSet GetBeamSet (UInt32 AIndex) + { + IntPtr newBeamSet = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBeamSet (Handle, AIndex, out newBeamSet)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newBeamSet); + } + + } + + public class CComponent : CBase + { + public CComponent (IntPtr NewHandle) : base (NewHandle) + { + } + + public CObject GetObjectResource () + { + IntPtr newObjectResource = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.Component_GetObjectResource (Handle, out newObjectResource)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newObjectResource); + } + + public UInt32 GetObjectResourceID () + { + UInt32 resultUniqueResourceID = 0; + + CheckError(Internal.Lib3MFWrapper.Component_GetObjectResourceID (Handle, out resultUniqueResourceID)); + return resultUniqueResourceID; + } + + public String GetUUID (out bool AHasUUID) + { + Byte resultHasUUID = 0; + UInt32 sizeUUID = 0; + UInt32 neededUUID = 0; + CheckError(Internal.Lib3MFWrapper.Component_GetUUID (Handle, out resultHasUUID, sizeUUID, out neededUUID, IntPtr.Zero)); + sizeUUID = neededUUID; + byte[] bytesUUID = new byte[sizeUUID]; + GCHandle dataUUID = GCHandle.Alloc(bytesUUID, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.Component_GetUUID (Handle, out resultHasUUID, sizeUUID, out neededUUID, dataUUID.AddrOfPinnedObject())); + AHasUUID = (resultHasUUID != 0); + dataUUID.Free(); + return Encoding.UTF8.GetString(bytesUUID).TrimEnd(char.MinValue); + } + + public void SetUUID (String AUUID) + { + byte[] byteUUID = Encoding.UTF8.GetBytes(AUUID + char.MinValue); + + CheckError(Internal.Lib3MFWrapper.Component_SetUUID (Handle, byteUUID)); + } + + public bool HasTransform () + { + Byte resultHasTransform = 0; + + CheckError(Internal.Lib3MFWrapper.Component_HasTransform (Handle, out resultHasTransform)); + return (resultHasTransform != 0); + } + + public sTransform GetTransform () + { + Internal.InternalTransform intresultTransform; + + CheckError(Internal.Lib3MFWrapper.Component_GetTransform (Handle, out intresultTransform)); + return Internal.Lib3MFWrapper.convertInternalToStruct_Transform (intresultTransform); + } + + public void SetTransform (sTransform ATransform) + { + Internal.InternalTransform intTransform = Internal.Lib3MFWrapper.convertStructToInternal_Transform (ATransform); + + CheckError(Internal.Lib3MFWrapper.Component_SetTransform (Handle, intTransform)); + } + + } + + public class CComponentsObject : CObject + { + public CComponentsObject (IntPtr NewHandle) : base (NewHandle) + { + } + + public CComponent AddComponent (CObject AObjectResource, sTransform ATransform) + { + IntPtr AObjectResourceHandle = IntPtr.Zero; + if (AObjectResource != null) + AObjectResourceHandle = AObjectResource.GetHandle(); + Internal.InternalTransform intTransform = Internal.Lib3MFWrapper.convertStructToInternal_Transform (ATransform); + IntPtr newComponentInstance = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.ComponentsObject_AddComponent (Handle, AObjectResourceHandle, intTransform, out newComponentInstance)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newComponentInstance); + } + + public CComponent GetComponent (UInt32 AIndex) + { + IntPtr newComponentInstance = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.ComponentsObject_GetComponent (Handle, AIndex, out newComponentInstance)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newComponentInstance); + } + + public UInt32 GetComponentCount () + { + UInt32 resultCount = 0; + + CheckError(Internal.Lib3MFWrapper.ComponentsObject_GetComponentCount (Handle, out resultCount)); + return resultCount; + } + + } + + public class CBeamSet : CBase + { + public CBeamSet (IntPtr NewHandle) : base (NewHandle) + { + } + + public void SetName (String AName) + { + byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); + + CheckError(Internal.Lib3MFWrapper.BeamSet_SetName (Handle, byteName)); + } + + public String GetName () + { + UInt32 sizeName = 0; + UInt32 neededName = 0; + CheckError(Internal.Lib3MFWrapper.BeamSet_GetName (Handle, sizeName, out neededName, IntPtr.Zero)); + sizeName = neededName; + byte[] bytesName = new byte[sizeName]; + GCHandle dataName = GCHandle.Alloc(bytesName, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.BeamSet_GetName (Handle, sizeName, out neededName, dataName.AddrOfPinnedObject())); + dataName.Free(); + return Encoding.UTF8.GetString(bytesName).TrimEnd(char.MinValue); + } + + public void SetIdentifier (String AIdentifier) + { + byte[] byteIdentifier = Encoding.UTF8.GetBytes(AIdentifier + char.MinValue); + + CheckError(Internal.Lib3MFWrapper.BeamSet_SetIdentifier (Handle, byteIdentifier)); + } + + public String GetIdentifier () + { + UInt32 sizeIdentifier = 0; + UInt32 neededIdentifier = 0; + CheckError(Internal.Lib3MFWrapper.BeamSet_GetIdentifier (Handle, sizeIdentifier, out neededIdentifier, IntPtr.Zero)); + sizeIdentifier = neededIdentifier; + byte[] bytesIdentifier = new byte[sizeIdentifier]; + GCHandle dataIdentifier = GCHandle.Alloc(bytesIdentifier, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.BeamSet_GetIdentifier (Handle, sizeIdentifier, out neededIdentifier, dataIdentifier.AddrOfPinnedObject())); + dataIdentifier.Free(); + return Encoding.UTF8.GetString(bytesIdentifier).TrimEnd(char.MinValue); + } + + public UInt32 GetReferenceCount () + { + UInt32 resultCount = 0; + + CheckError(Internal.Lib3MFWrapper.BeamSet_GetReferenceCount (Handle, out resultCount)); + return resultCount; + } + + public void SetReferences (UInt32[] AReferences) + { + GCHandle dataReferences = GCHandle.Alloc(AReferences, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.BeamSet_SetReferences (Handle, (UInt64) AReferences.Length, dataReferences.AddrOfPinnedObject())); + dataReferences.Free (); + } + + public void GetReferences (out UInt32[] AReferences) + { + UInt64 sizeReferences = 0; + UInt64 neededReferences = 0; + CheckError(Internal.Lib3MFWrapper.BeamSet_GetReferences (Handle, sizeReferences, out neededReferences, IntPtr.Zero)); + sizeReferences = neededReferences; + AReferences = new UInt32[sizeReferences]; + GCHandle dataReferences = GCHandle.Alloc(AReferences, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.BeamSet_GetReferences (Handle, sizeReferences, out neededReferences, dataReferences.AddrOfPinnedObject())); + dataReferences.Free(); + } + + public UInt32 GetBallReferenceCount () + { + UInt32 resultCount = 0; + + CheckError(Internal.Lib3MFWrapper.BeamSet_GetBallReferenceCount (Handle, out resultCount)); + return resultCount; + } + + public void SetBallReferences (UInt32[] ABallReferences) + { + GCHandle dataBallReferences = GCHandle.Alloc(ABallReferences, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.BeamSet_SetBallReferences (Handle, (UInt64) ABallReferences.Length, dataBallReferences.AddrOfPinnedObject())); + dataBallReferences.Free (); + } + + public void GetBallReferences (out UInt32[] ABallReferences) + { + UInt64 sizeBallReferences = 0; + UInt64 neededBallReferences = 0; + CheckError(Internal.Lib3MFWrapper.BeamSet_GetBallReferences (Handle, sizeBallReferences, out neededBallReferences, IntPtr.Zero)); + sizeBallReferences = neededBallReferences; + ABallReferences = new UInt32[sizeBallReferences]; + GCHandle dataBallReferences = GCHandle.Alloc(ABallReferences, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.BeamSet_GetBallReferences (Handle, sizeBallReferences, out neededBallReferences, dataBallReferences.AddrOfPinnedObject())); + dataBallReferences.Free(); + } + + } + + public class CBaseMaterialGroup : CResource + { + public CBaseMaterialGroup (IntPtr NewHandle) : base (NewHandle) + { + } + + public UInt32 GetCount () + { + UInt32 resultCount = 0; + + CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_GetCount (Handle, out resultCount)); + return resultCount; + } + + public void GetAllPropertyIDs (out UInt32[] APropertyIDs) + { + UInt64 sizePropertyIDs = 0; + UInt64 neededPropertyIDs = 0; + CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, IntPtr.Zero)); + sizePropertyIDs = neededPropertyIDs; + APropertyIDs = new UInt32[sizePropertyIDs]; + GCHandle dataPropertyIDs = GCHandle.Alloc(APropertyIDs, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, dataPropertyIDs.AddrOfPinnedObject())); + dataPropertyIDs.Free(); + } + + public UInt32 AddMaterial (String AName, sColor ADisplayColor) + { + byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); + Internal.InternalColor intDisplayColor = Internal.Lib3MFWrapper.convertStructToInternal_Color (ADisplayColor); + UInt32 resultPropertyID = 0; + + CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_AddMaterial (Handle, byteName, intDisplayColor, out resultPropertyID)); + return resultPropertyID; + } + + public void RemoveMaterial (UInt32 APropertyID) + { + + CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_RemoveMaterial (Handle, APropertyID)); + } + + public String GetName (UInt32 APropertyID) + { + UInt32 sizeName = 0; + UInt32 neededName = 0; + CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_GetName (Handle, APropertyID, sizeName, out neededName, IntPtr.Zero)); + sizeName = neededName; + byte[] bytesName = new byte[sizeName]; + GCHandle dataName = GCHandle.Alloc(bytesName, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_GetName (Handle, APropertyID, sizeName, out neededName, dataName.AddrOfPinnedObject())); + dataName.Free(); + return Encoding.UTF8.GetString(bytesName).TrimEnd(char.MinValue); + } + + public void SetName (UInt32 APropertyID, String AName) + { + byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); + + CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_SetName (Handle, APropertyID, byteName)); + } + + public void SetDisplayColor (UInt32 APropertyID, sColor ATheColor) + { + Internal.InternalColor intTheColor = Internal.Lib3MFWrapper.convertStructToInternal_Color (ATheColor); + + CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_SetDisplayColor (Handle, APropertyID, intTheColor)); + } + + public sColor GetDisplayColor (UInt32 APropertyID) + { + Internal.InternalColor intresultTheColor; + + CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_GetDisplayColor (Handle, APropertyID, out intresultTheColor)); + return Internal.Lib3MFWrapper.convertInternalToStruct_Color (intresultTheColor); + } + + } + + public class CColorGroup : CResource + { + public CColorGroup (IntPtr NewHandle) : base (NewHandle) + { + } + + public UInt32 GetCount () + { + UInt32 resultCount = 0; + + CheckError(Internal.Lib3MFWrapper.ColorGroup_GetCount (Handle, out resultCount)); + return resultCount; + } + + public void GetAllPropertyIDs (out UInt32[] APropertyIDs) + { + UInt64 sizePropertyIDs = 0; + UInt64 neededPropertyIDs = 0; + CheckError(Internal.Lib3MFWrapper.ColorGroup_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, IntPtr.Zero)); + sizePropertyIDs = neededPropertyIDs; + APropertyIDs = new UInt32[sizePropertyIDs]; + GCHandle dataPropertyIDs = GCHandle.Alloc(APropertyIDs, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.ColorGroup_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, dataPropertyIDs.AddrOfPinnedObject())); + dataPropertyIDs.Free(); + } + + public UInt32 AddColor (sColor ATheColor) + { + Internal.InternalColor intTheColor = Internal.Lib3MFWrapper.convertStructToInternal_Color (ATheColor); + UInt32 resultPropertyID = 0; + + CheckError(Internal.Lib3MFWrapper.ColorGroup_AddColor (Handle, intTheColor, out resultPropertyID)); + return resultPropertyID; + } + + public void RemoveColor (UInt32 APropertyID) + { + + CheckError(Internal.Lib3MFWrapper.ColorGroup_RemoveColor (Handle, APropertyID)); + } + + public void SetColor (UInt32 APropertyID, sColor ATheColor) + { + Internal.InternalColor intTheColor = Internal.Lib3MFWrapper.convertStructToInternal_Color (ATheColor); + + CheckError(Internal.Lib3MFWrapper.ColorGroup_SetColor (Handle, APropertyID, intTheColor)); + } + + public sColor GetColor (UInt32 APropertyID) + { + Internal.InternalColor intresultTheColor; + + CheckError(Internal.Lib3MFWrapper.ColorGroup_GetColor (Handle, APropertyID, out intresultTheColor)); + return Internal.Lib3MFWrapper.convertInternalToStruct_Color (intresultTheColor); + } + + } + + public class CTexture2DGroup : CResource + { + public CTexture2DGroup (IntPtr NewHandle) : base (NewHandle) + { + } + + public UInt32 GetCount () + { + UInt32 resultCount = 0; + + CheckError(Internal.Lib3MFWrapper.Texture2DGroup_GetCount (Handle, out resultCount)); + return resultCount; + } + + public void GetAllPropertyIDs (out UInt32[] APropertyIDs) + { + UInt64 sizePropertyIDs = 0; + UInt64 neededPropertyIDs = 0; + CheckError(Internal.Lib3MFWrapper.Texture2DGroup_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, IntPtr.Zero)); + sizePropertyIDs = neededPropertyIDs; + APropertyIDs = new UInt32[sizePropertyIDs]; + GCHandle dataPropertyIDs = GCHandle.Alloc(APropertyIDs, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.Texture2DGroup_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, dataPropertyIDs.AddrOfPinnedObject())); + dataPropertyIDs.Free(); + } + + public UInt32 AddTex2Coord (sTex2Coord AUVCoordinate) + { + Internal.InternalTex2Coord intUVCoordinate = Internal.Lib3MFWrapper.convertStructToInternal_Tex2Coord (AUVCoordinate); + UInt32 resultPropertyID = 0; + + CheckError(Internal.Lib3MFWrapper.Texture2DGroup_AddTex2Coord (Handle, intUVCoordinate, out resultPropertyID)); + return resultPropertyID; + } + + public sTex2Coord GetTex2Coord (UInt32 APropertyID) + { + Internal.InternalTex2Coord intresultUVCoordinate; + + CheckError(Internal.Lib3MFWrapper.Texture2DGroup_GetTex2Coord (Handle, APropertyID, out intresultUVCoordinate)); + return Internal.Lib3MFWrapper.convertInternalToStruct_Tex2Coord (intresultUVCoordinate); + } + + public void RemoveTex2Coord (UInt32 APropertyID) + { + + CheckError(Internal.Lib3MFWrapper.Texture2DGroup_RemoveTex2Coord (Handle, APropertyID)); + } + + public CTexture2D GetTexture2D () + { + IntPtr newTexture2DInstance = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.Texture2DGroup_GetTexture2D (Handle, out newTexture2DInstance)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newTexture2DInstance); + } + + } + + public class CCompositeMaterials : CResource + { + public CCompositeMaterials (IntPtr NewHandle) : base (NewHandle) + { + } + + public UInt32 GetCount () + { + UInt32 resultCount = 0; + + CheckError(Internal.Lib3MFWrapper.CompositeMaterials_GetCount (Handle, out resultCount)); + return resultCount; + } + + public void GetAllPropertyIDs (out UInt32[] APropertyIDs) + { + UInt64 sizePropertyIDs = 0; + UInt64 neededPropertyIDs = 0; + CheckError(Internal.Lib3MFWrapper.CompositeMaterials_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, IntPtr.Zero)); + sizePropertyIDs = neededPropertyIDs; + APropertyIDs = new UInt32[sizePropertyIDs]; + GCHandle dataPropertyIDs = GCHandle.Alloc(APropertyIDs, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.CompositeMaterials_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, dataPropertyIDs.AddrOfPinnedObject())); + dataPropertyIDs.Free(); + } + + public CBaseMaterialGroup GetBaseMaterialGroup () + { + IntPtr newBaseMaterialGroupInstance = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.CompositeMaterials_GetBaseMaterialGroup (Handle, out newBaseMaterialGroupInstance)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newBaseMaterialGroupInstance); + } + + public UInt32 AddComposite (sCompositeConstituent[] AComposite) + { + Internal.InternalCompositeConstituent[] intdataComposite = new Internal.InternalCompositeConstituent[AComposite.Length]; + for (int index = 0; index < AComposite.Length; index++) + intdataComposite[index] = Internal.Lib3MFWrapper.convertStructToInternal_CompositeConstituent(AComposite[index]); + GCHandle dataComposite = GCHandle.Alloc(intdataComposite, GCHandleType.Pinned); + UInt32 resultPropertyID = 0; + + CheckError(Internal.Lib3MFWrapper.CompositeMaterials_AddComposite (Handle, (UInt64) AComposite.Length, dataComposite.AddrOfPinnedObject(), out resultPropertyID)); + dataComposite.Free (); + return resultPropertyID; + } + + public void RemoveComposite (UInt32 APropertyID) + { + + CheckError(Internal.Lib3MFWrapper.CompositeMaterials_RemoveComposite (Handle, APropertyID)); + } + + public void GetComposite (UInt32 APropertyID, out sCompositeConstituent[] AComposite) + { + UInt64 sizeComposite = 0; + UInt64 neededComposite = 0; + CheckError(Internal.Lib3MFWrapper.CompositeMaterials_GetComposite (Handle, APropertyID, sizeComposite, out neededComposite, IntPtr.Zero)); + sizeComposite = neededComposite; + var arrayComposite = new Internal.InternalCompositeConstituent[sizeComposite]; + GCHandle dataComposite = GCHandle.Alloc(arrayComposite, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.CompositeMaterials_GetComposite (Handle, APropertyID, sizeComposite, out neededComposite, dataComposite.AddrOfPinnedObject())); + dataComposite.Free(); + AComposite = new sCompositeConstituent[sizeComposite]; + for (int index = 0; index < AComposite.Length; index++) + AComposite[index] = Internal.Lib3MFWrapper.convertInternalToStruct_CompositeConstituent(arrayComposite[index]); + } + + } + + public class CMultiPropertyGroup : CResource + { + public CMultiPropertyGroup (IntPtr NewHandle) : base (NewHandle) + { + } + + public UInt32 GetCount () + { + UInt32 resultCount = 0; + + CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_GetCount (Handle, out resultCount)); + return resultCount; + } + + public void GetAllPropertyIDs (out UInt32[] APropertyIDs) + { + UInt64 sizePropertyIDs = 0; + UInt64 neededPropertyIDs = 0; + CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, IntPtr.Zero)); + sizePropertyIDs = neededPropertyIDs; + APropertyIDs = new UInt32[sizePropertyIDs]; + GCHandle dataPropertyIDs = GCHandle.Alloc(APropertyIDs, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, dataPropertyIDs.AddrOfPinnedObject())); + dataPropertyIDs.Free(); + } + + public UInt32 AddMultiProperty (UInt32[] APropertyIDs) + { + GCHandle dataPropertyIDs = GCHandle.Alloc(APropertyIDs, GCHandleType.Pinned); + UInt32 resultPropertyID = 0; + + CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_AddMultiProperty (Handle, (UInt64) APropertyIDs.Length, dataPropertyIDs.AddrOfPinnedObject(), out resultPropertyID)); + dataPropertyIDs.Free (); + return resultPropertyID; + } + + public void SetMultiProperty (UInt32 APropertyID, UInt32[] APropertyIDs) + { + GCHandle dataPropertyIDs = GCHandle.Alloc(APropertyIDs, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_SetMultiProperty (Handle, APropertyID, (UInt64) APropertyIDs.Length, dataPropertyIDs.AddrOfPinnedObject())); + dataPropertyIDs.Free (); + } + + public void GetMultiProperty (UInt32 APropertyID, out UInt32[] APropertyIDs) + { + UInt64 sizePropertyIDs = 0; + UInt64 neededPropertyIDs = 0; + CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_GetMultiProperty (Handle, APropertyID, sizePropertyIDs, out neededPropertyIDs, IntPtr.Zero)); + sizePropertyIDs = neededPropertyIDs; + APropertyIDs = new UInt32[sizePropertyIDs]; + GCHandle dataPropertyIDs = GCHandle.Alloc(APropertyIDs, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_GetMultiProperty (Handle, APropertyID, sizePropertyIDs, out neededPropertyIDs, dataPropertyIDs.AddrOfPinnedObject())); + dataPropertyIDs.Free(); + } + + public void RemoveMultiProperty (UInt32 APropertyID) + { + + CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_RemoveMultiProperty (Handle, APropertyID)); + } + + public UInt32 GetLayerCount () + { + UInt32 resultCount = 0; + + CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_GetLayerCount (Handle, out resultCount)); + return resultCount; + } + + public UInt32 AddLayer (sMultiPropertyLayer ATheLayer) + { + Internal.InternalMultiPropertyLayer intTheLayer = Internal.Lib3MFWrapper.convertStructToInternal_MultiPropertyLayer (ATheLayer); + UInt32 resultLayerIndex = 0; + + CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_AddLayer (Handle, intTheLayer, out resultLayerIndex)); + return resultLayerIndex; + } + + public sMultiPropertyLayer GetLayer (UInt32 ALayerIndex) + { + Internal.InternalMultiPropertyLayer intresultTheLayer; + + CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_GetLayer (Handle, ALayerIndex, out intresultTheLayer)); + return Internal.Lib3MFWrapper.convertInternalToStruct_MultiPropertyLayer (intresultTheLayer); + } + + public void RemoveLayer (UInt32 ALayerIndex) + { + + CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_RemoveLayer (Handle, ALayerIndex)); } } - public class CBeamSet : CBase + public class CAttachment : CBase { - public CBeamSet (IntPtr NewHandle) : base (NewHandle) + public CAttachment (IntPtr NewHandle) : base (NewHandle) { } - public void SetName (String AName) + public String GetPath () + { + UInt32 sizePath = 0; + UInt32 neededPath = 0; + CheckError(Internal.Lib3MFWrapper.Attachment_GetPath (Handle, sizePath, out neededPath, IntPtr.Zero)); + sizePath = neededPath; + byte[] bytesPath = new byte[sizePath]; + GCHandle dataPath = GCHandle.Alloc(bytesPath, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.Attachment_GetPath (Handle, sizePath, out neededPath, dataPath.AddrOfPinnedObject())); + dataPath.Free(); + return Encoding.UTF8.GetString(bytesPath).TrimEnd(char.MinValue); + } + + public void SetPath (String APath) + { + byte[] bytePath = Encoding.UTF8.GetBytes(APath + char.MinValue); + + CheckError(Internal.Lib3MFWrapper.Attachment_SetPath (Handle, bytePath)); + } + + public CPackagePart PackagePart () + { + IntPtr newPackagePart = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.Attachment_PackagePart (Handle, out newPackagePart)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newPackagePart); + } + + public String GetRelationShipType () + { + UInt32 sizePath = 0; + UInt32 neededPath = 0; + CheckError(Internal.Lib3MFWrapper.Attachment_GetRelationShipType (Handle, sizePath, out neededPath, IntPtr.Zero)); + sizePath = neededPath; + byte[] bytesPath = new byte[sizePath]; + GCHandle dataPath = GCHandle.Alloc(bytesPath, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.Attachment_GetRelationShipType (Handle, sizePath, out neededPath, dataPath.AddrOfPinnedObject())); + dataPath.Free(); + return Encoding.UTF8.GetString(bytesPath).TrimEnd(char.MinValue); + } + + public void SetRelationShipType (String APath) + { + byte[] bytePath = Encoding.UTF8.GetBytes(APath + char.MinValue); + + CheckError(Internal.Lib3MFWrapper.Attachment_SetRelationShipType (Handle, bytePath)); + } + + public void WriteToFile (String AFileName) + { + byte[] byteFileName = Encoding.UTF8.GetBytes(AFileName + char.MinValue); + + CheckError(Internal.Lib3MFWrapper.Attachment_WriteToFile (Handle, byteFileName)); + } + + public void ReadFromFile (String AFileName) + { + byte[] byteFileName = Encoding.UTF8.GetBytes(AFileName + char.MinValue); + + CheckError(Internal.Lib3MFWrapper.Attachment_ReadFromFile (Handle, byteFileName)); + } + + public void ReadFromCallback (IntPtr ATheReadCallback, UInt64 AStreamSize, IntPtr ATheSeekCallback, UInt64 AUserData) + { + + CheckError(Internal.Lib3MFWrapper.Attachment_ReadFromCallback (Handle, ATheReadCallback, AStreamSize, ATheSeekCallback, AUserData)); + } + + public UInt64 GetStreamSize () + { + UInt64 resultStreamSize = 0; + + CheckError(Internal.Lib3MFWrapper.Attachment_GetStreamSize (Handle, out resultStreamSize)); + return resultStreamSize; + } + + public void WriteToBuffer (out Byte[] ABuffer) + { + UInt64 sizeBuffer = 0; + UInt64 neededBuffer = 0; + CheckError(Internal.Lib3MFWrapper.Attachment_WriteToBuffer (Handle, sizeBuffer, out neededBuffer, IntPtr.Zero)); + sizeBuffer = neededBuffer; + ABuffer = new Byte[sizeBuffer]; + GCHandle dataBuffer = GCHandle.Alloc(ABuffer, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.Attachment_WriteToBuffer (Handle, sizeBuffer, out neededBuffer, dataBuffer.AddrOfPinnedObject())); + dataBuffer.Free(); + } + + public void ReadFromBuffer (Byte[] ABuffer) + { + GCHandle dataBuffer = GCHandle.Alloc(ABuffer, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.Attachment_ReadFromBuffer (Handle, (UInt64) ABuffer.Length, dataBuffer.AddrOfPinnedObject())); + dataBuffer.Free (); + } + + } + + public class CTexture2D : CResource + { + public CTexture2D (IntPtr NewHandle) : base (NewHandle) + { + } + + public CAttachment GetAttachment () + { + IntPtr newAttachment = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.Texture2D_GetAttachment (Handle, out newAttachment)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newAttachment); + } + + public void SetAttachment (CAttachment AAttachment) + { + IntPtr AAttachmentHandle = IntPtr.Zero; + if (AAttachment != null) + AAttachmentHandle = AAttachment.GetHandle(); + + CheckError(Internal.Lib3MFWrapper.Texture2D_SetAttachment (Handle, AAttachmentHandle)); + } + + public eTextureType GetContentType () + { + Int32 resultContentType = 0; + + CheckError(Internal.Lib3MFWrapper.Texture2D_GetContentType (Handle, out resultContentType)); + return (eTextureType) (resultContentType); + } + + public void SetContentType (eTextureType AContentType) + { + Int32 enumContentType = (Int32) AContentType; + + CheckError(Internal.Lib3MFWrapper.Texture2D_SetContentType (Handle, enumContentType)); + } + + public void GetTileStyleUV (out eTextureTileStyle ATileStyleU, out eTextureTileStyle ATileStyleV) + { + Int32 resultTileStyleU = 0; + Int32 resultTileStyleV = 0; + + CheckError(Internal.Lib3MFWrapper.Texture2D_GetTileStyleUV (Handle, out resultTileStyleU, out resultTileStyleV)); + ATileStyleU = (eTextureTileStyle) (resultTileStyleU); + ATileStyleV = (eTextureTileStyle) (resultTileStyleV); + } + + public void SetTileStyleUV (eTextureTileStyle ATileStyleU, eTextureTileStyle ATileStyleV) + { + Int32 enumTileStyleU = (Int32) ATileStyleU; + Int32 enumTileStyleV = (Int32) ATileStyleV; + + CheckError(Internal.Lib3MFWrapper.Texture2D_SetTileStyleUV (Handle, enumTileStyleU, enumTileStyleV)); + } + + public eTextureFilter GetFilter () + { + Int32 resultFilter = 0; + + CheckError(Internal.Lib3MFWrapper.Texture2D_GetFilter (Handle, out resultFilter)); + return (eTextureFilter) (resultFilter); + } + + public void SetFilter (eTextureFilter AFilter) + { + Int32 enumFilter = (Int32) AFilter; + + CheckError(Internal.Lib3MFWrapper.Texture2D_SetFilter (Handle, enumFilter)); + } + + } + + public class CBuildItem : CBase + { + public CBuildItem (IntPtr NewHandle) : base (NewHandle) + { + } + + public CObject GetObjectResource () + { + IntPtr newObjectResource = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.BuildItem_GetObjectResource (Handle, out newObjectResource)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newObjectResource); + } + + public String GetUUID (out bool AHasUUID) + { + Byte resultHasUUID = 0; + UInt32 sizeUUID = 0; + UInt32 neededUUID = 0; + CheckError(Internal.Lib3MFWrapper.BuildItem_GetUUID (Handle, out resultHasUUID, sizeUUID, out neededUUID, IntPtr.Zero)); + sizeUUID = neededUUID; + byte[] bytesUUID = new byte[sizeUUID]; + GCHandle dataUUID = GCHandle.Alloc(bytesUUID, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.BuildItem_GetUUID (Handle, out resultHasUUID, sizeUUID, out neededUUID, dataUUID.AddrOfPinnedObject())); + AHasUUID = (resultHasUUID != 0); + dataUUID.Free(); + return Encoding.UTF8.GetString(bytesUUID).TrimEnd(char.MinValue); + } + + public void SetUUID (String AUUID) + { + byte[] byteUUID = Encoding.UTF8.GetBytes(AUUID + char.MinValue); + + CheckError(Internal.Lib3MFWrapper.BuildItem_SetUUID (Handle, byteUUID)); + } + + public UInt32 GetObjectResourceID () + { + UInt32 resultUniqueResourceID = 0; + + CheckError(Internal.Lib3MFWrapper.BuildItem_GetObjectResourceID (Handle, out resultUniqueResourceID)); + return resultUniqueResourceID; + } + + public bool HasObjectTransform () + { + Byte resultHasTransform = 0; + + CheckError(Internal.Lib3MFWrapper.BuildItem_HasObjectTransform (Handle, out resultHasTransform)); + return (resultHasTransform != 0); + } + + public sTransform GetObjectTransform () + { + Internal.InternalTransform intresultTransform; + + CheckError(Internal.Lib3MFWrapper.BuildItem_GetObjectTransform (Handle, out intresultTransform)); + return Internal.Lib3MFWrapper.convertInternalToStruct_Transform (intresultTransform); + } + + public void SetObjectTransform (sTransform ATransform) + { + Internal.InternalTransform intTransform = Internal.Lib3MFWrapper.convertStructToInternal_Transform (ATransform); + + CheckError(Internal.Lib3MFWrapper.BuildItem_SetObjectTransform (Handle, intTransform)); + } + + public String GetPartNumber () { - byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); + UInt32 sizePartNumber = 0; + UInt32 neededPartNumber = 0; + CheckError(Internal.Lib3MFWrapper.BuildItem_GetPartNumber (Handle, sizePartNumber, out neededPartNumber, IntPtr.Zero)); + sizePartNumber = neededPartNumber; + byte[] bytesPartNumber = new byte[sizePartNumber]; + GCHandle dataPartNumber = GCHandle.Alloc(bytesPartNumber, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.BeamSet_SetName (Handle, byteName)); + CheckError(Internal.Lib3MFWrapper.BuildItem_GetPartNumber (Handle, sizePartNumber, out neededPartNumber, dataPartNumber.AddrOfPinnedObject())); + dataPartNumber.Free(); + return Encoding.UTF8.GetString(bytesPartNumber).TrimEnd(char.MinValue); } - public String GetName () + public void SetPartNumber (String ASetPartnumber) { - UInt32 sizeName = 0; - UInt32 neededName = 0; - CheckError(Internal.Lib3MFWrapper.BeamSet_GetName (Handle, sizeName, out neededName, IntPtr.Zero)); - sizeName = neededName; - byte[] bytesName = new byte[sizeName]; - GCHandle dataName = GCHandle.Alloc(bytesName, GCHandleType.Pinned); + byte[] byteSetPartnumber = Encoding.UTF8.GetBytes(ASetPartnumber + char.MinValue); - CheckError(Internal.Lib3MFWrapper.BeamSet_GetName (Handle, sizeName, out neededName, dataName.AddrOfPinnedObject())); - dataName.Free(); - return Encoding.UTF8.GetString(bytesName).TrimEnd(char.MinValue); + CheckError(Internal.Lib3MFWrapper.BuildItem_SetPartNumber (Handle, byteSetPartnumber)); } - public void SetIdentifier (String AIdentifier) + public CMetaDataGroup GetMetaDataGroup () { - byte[] byteIdentifier = Encoding.UTF8.GetBytes(AIdentifier + char.MinValue); + IntPtr newMetaDataGroup = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.BeamSet_SetIdentifier (Handle, byteIdentifier)); + CheckError(Internal.Lib3MFWrapper.BuildItem_GetMetaDataGroup (Handle, out newMetaDataGroup)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newMetaDataGroup); } - public String GetIdentifier () + public sBox GetOutbox () { - UInt32 sizeIdentifier = 0; - UInt32 neededIdentifier = 0; - CheckError(Internal.Lib3MFWrapper.BeamSet_GetIdentifier (Handle, sizeIdentifier, out neededIdentifier, IntPtr.Zero)); - sizeIdentifier = neededIdentifier; - byte[] bytesIdentifier = new byte[sizeIdentifier]; - GCHandle dataIdentifier = GCHandle.Alloc(bytesIdentifier, GCHandleType.Pinned); + Internal.InternalBox intresultOutbox; - CheckError(Internal.Lib3MFWrapper.BeamSet_GetIdentifier (Handle, sizeIdentifier, out neededIdentifier, dataIdentifier.AddrOfPinnedObject())); - dataIdentifier.Free(); - return Encoding.UTF8.GetString(bytesIdentifier).TrimEnd(char.MinValue); + CheckError(Internal.Lib3MFWrapper.BuildItem_GetOutbox (Handle, out intresultOutbox)); + return Internal.Lib3MFWrapper.convertInternalToStruct_Box (intresultOutbox); } - public UInt32 GetReferenceCount () - { - UInt32 resultCount = 0; + } - CheckError(Internal.Lib3MFWrapper.BeamSet_GetReferenceCount (Handle, out resultCount)); - return resultCount; + public class CBuildItemIterator : CBase + { + public CBuildItemIterator (IntPtr NewHandle) : base (NewHandle) + { } - public void SetReferences (UInt32[] AReferences) + public bool MoveNext () { - GCHandle dataReferences = GCHandle.Alloc(AReferences, GCHandleType.Pinned); + Byte resultHasNext = 0; - CheckError(Internal.Lib3MFWrapper.BeamSet_SetReferences (Handle, (UInt64) AReferences.Length, dataReferences.AddrOfPinnedObject())); - dataReferences.Free (); + CheckError(Internal.Lib3MFWrapper.BuildItemIterator_MoveNext (Handle, out resultHasNext)); + return (resultHasNext != 0); } - public void GetReferences (out UInt32[] AReferences) + public bool MovePrevious () { - UInt64 sizeReferences = 0; - UInt64 neededReferences = 0; - CheckError(Internal.Lib3MFWrapper.BeamSet_GetReferences (Handle, sizeReferences, out neededReferences, IntPtr.Zero)); - sizeReferences = neededReferences; - AReferences = new UInt32[sizeReferences]; - GCHandle dataReferences = GCHandle.Alloc(AReferences, GCHandleType.Pinned); + Byte resultHasPrevious = 0; - CheckError(Internal.Lib3MFWrapper.BeamSet_GetReferences (Handle, sizeReferences, out neededReferences, dataReferences.AddrOfPinnedObject())); - dataReferences.Free(); + CheckError(Internal.Lib3MFWrapper.BuildItemIterator_MovePrevious (Handle, out resultHasPrevious)); + return (resultHasPrevious != 0); } - public UInt32 GetBallReferenceCount () + public CBuildItem GetCurrent () { - UInt32 resultCount = 0; + IntPtr newBuildItem = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.BeamSet_GetBallReferenceCount (Handle, out resultCount)); - return resultCount; + CheckError(Internal.Lib3MFWrapper.BuildItemIterator_GetCurrent (Handle, out newBuildItem)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newBuildItem); } - public void SetBallReferences (UInt32[] ABallReferences) + public CBuildItemIterator Clone () { - GCHandle dataBallReferences = GCHandle.Alloc(ABallReferences, GCHandleType.Pinned); + IntPtr newOutBuildItemIterator = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.BeamSet_SetBallReferences (Handle, (UInt64) ABallReferences.Length, dataBallReferences.AddrOfPinnedObject())); - dataBallReferences.Free (); + CheckError(Internal.Lib3MFWrapper.BuildItemIterator_Clone (Handle, out newOutBuildItemIterator)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newOutBuildItemIterator); } - public void GetBallReferences (out UInt32[] ABallReferences) + public UInt64 Count () { - UInt64 sizeBallReferences = 0; - UInt64 neededBallReferences = 0; - CheckError(Internal.Lib3MFWrapper.BeamSet_GetBallReferences (Handle, sizeBallReferences, out neededBallReferences, IntPtr.Zero)); - sizeBallReferences = neededBallReferences; - ABallReferences = new UInt32[sizeBallReferences]; - GCHandle dataBallReferences = GCHandle.Alloc(ABallReferences, GCHandleType.Pinned); + UInt64 resultCount = 0; - CheckError(Internal.Lib3MFWrapper.BeamSet_GetBallReferences (Handle, sizeBallReferences, out neededBallReferences, dataBallReferences.AddrOfPinnedObject())); - dataBallReferences.Free(); + CheckError(Internal.Lib3MFWrapper.BuildItemIterator_Count (Handle, out resultCount)); + return resultCount; } } - public class CBaseMaterialGroup : CResource + public class CSlice : CBase { - public CBaseMaterialGroup (IntPtr NewHandle) : base (NewHandle) + public CSlice (IntPtr NewHandle) : base (NewHandle) { } - public UInt32 GetCount () + public void SetVertices (sPosition2D[] AVertices) { - UInt32 resultCount = 0; + Internal.InternalPosition2D[] intdataVertices = new Internal.InternalPosition2D[AVertices.Length]; + for (int index = 0; index < AVertices.Length; index++) + intdataVertices[index] = Internal.Lib3MFWrapper.convertStructToInternal_Position2D(AVertices[index]); + GCHandle dataVertices = GCHandle.Alloc(intdataVertices, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_GetCount (Handle, out resultCount)); - return resultCount; + CheckError(Internal.Lib3MFWrapper.Slice_SetVertices (Handle, (UInt64) AVertices.Length, dataVertices.AddrOfPinnedObject())); + dataVertices.Free (); } - public void GetAllPropertyIDs (out UInt32[] APropertyIDs) + public void GetVertices (out sPosition2D[] AVertices) { - UInt64 sizePropertyIDs = 0; - UInt64 neededPropertyIDs = 0; - CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, IntPtr.Zero)); - sizePropertyIDs = neededPropertyIDs; - APropertyIDs = new UInt32[sizePropertyIDs]; - GCHandle dataPropertyIDs = GCHandle.Alloc(APropertyIDs, GCHandleType.Pinned); + UInt64 sizeVertices = 0; + UInt64 neededVertices = 0; + CheckError(Internal.Lib3MFWrapper.Slice_GetVertices (Handle, sizeVertices, out neededVertices, IntPtr.Zero)); + sizeVertices = neededVertices; + var arrayVertices = new Internal.InternalPosition2D[sizeVertices]; + GCHandle dataVertices = GCHandle.Alloc(arrayVertices, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, dataPropertyIDs.AddrOfPinnedObject())); - dataPropertyIDs.Free(); + CheckError(Internal.Lib3MFWrapper.Slice_GetVertices (Handle, sizeVertices, out neededVertices, dataVertices.AddrOfPinnedObject())); + dataVertices.Free(); + AVertices = new sPosition2D[sizeVertices]; + for (int index = 0; index < AVertices.Length; index++) + AVertices[index] = Internal.Lib3MFWrapper.convertInternalToStruct_Position2D(arrayVertices[index]); } - public UInt32 AddMaterial (String AName, sColor ADisplayColor) + public UInt64 GetVertexCount () { - byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); - Internal.InternalColor intDisplayColor = Internal.Lib3MFWrapper.convertStructToInternal_Color (ADisplayColor); - UInt32 resultPropertyID = 0; + UInt64 resultCount = 0; - CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_AddMaterial (Handle, byteName, intDisplayColor, out resultPropertyID)); - return resultPropertyID; + CheckError(Internal.Lib3MFWrapper.Slice_GetVertexCount (Handle, out resultCount)); + return resultCount; } - public void RemoveMaterial (UInt32 APropertyID) + public UInt64 AddPolygon (UInt32[] AIndices) { + GCHandle dataIndices = GCHandle.Alloc(AIndices, GCHandleType.Pinned); + UInt64 resultIndex = 0; - CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_RemoveMaterial (Handle, APropertyID)); + CheckError(Internal.Lib3MFWrapper.Slice_AddPolygon (Handle, (UInt64) AIndices.Length, dataIndices.AddrOfPinnedObject(), out resultIndex)); + dataIndices.Free (); + return resultIndex; } - public String GetName (UInt32 APropertyID) + public UInt64 GetPolygonCount () { - UInt32 sizeName = 0; - UInt32 neededName = 0; - CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_GetName (Handle, APropertyID, sizeName, out neededName, IntPtr.Zero)); - sizeName = neededName; - byte[] bytesName = new byte[sizeName]; - GCHandle dataName = GCHandle.Alloc(bytesName, GCHandleType.Pinned); + UInt64 resultCount = 0; - CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_GetName (Handle, APropertyID, sizeName, out neededName, dataName.AddrOfPinnedObject())); - dataName.Free(); - return Encoding.UTF8.GetString(bytesName).TrimEnd(char.MinValue); + CheckError(Internal.Lib3MFWrapper.Slice_GetPolygonCount (Handle, out resultCount)); + return resultCount; } - public void SetName (UInt32 APropertyID, String AName) + public void SetPolygonIndices (UInt64 AIndex, UInt32[] AIndices) { - byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); + GCHandle dataIndices = GCHandle.Alloc(AIndices, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_SetName (Handle, APropertyID, byteName)); + CheckError(Internal.Lib3MFWrapper.Slice_SetPolygonIndices (Handle, AIndex, (UInt64) AIndices.Length, dataIndices.AddrOfPinnedObject())); + dataIndices.Free (); } - public void SetDisplayColor (UInt32 APropertyID, sColor ATheColor) + public void GetPolygonIndices (UInt64 AIndex, out UInt32[] AIndices) { - Internal.InternalColor intTheColor = Internal.Lib3MFWrapper.convertStructToInternal_Color (ATheColor); + UInt64 sizeIndices = 0; + UInt64 neededIndices = 0; + CheckError(Internal.Lib3MFWrapper.Slice_GetPolygonIndices (Handle, AIndex, sizeIndices, out neededIndices, IntPtr.Zero)); + sizeIndices = neededIndices; + AIndices = new UInt32[sizeIndices]; + GCHandle dataIndices = GCHandle.Alloc(AIndices, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_SetDisplayColor (Handle, APropertyID, intTheColor)); + CheckError(Internal.Lib3MFWrapper.Slice_GetPolygonIndices (Handle, AIndex, sizeIndices, out neededIndices, dataIndices.AddrOfPinnedObject())); + dataIndices.Free(); } - public sColor GetDisplayColor (UInt32 APropertyID) + public UInt64 GetPolygonIndexCount (UInt64 AIndex) { - Internal.InternalColor intresultTheColor; + UInt64 resultCount = 0; - CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_GetDisplayColor (Handle, APropertyID, out intresultTheColor)); - return Internal.Lib3MFWrapper.convertInternalToStruct_Color (intresultTheColor); + CheckError(Internal.Lib3MFWrapper.Slice_GetPolygonIndexCount (Handle, AIndex, out resultCount)); + return resultCount; } - } - - public class CColorGroup : CResource - { - public CColorGroup (IntPtr NewHandle) : base (NewHandle) + public Double GetZTop () { + Double resultZTop = 0; + + CheckError(Internal.Lib3MFWrapper.Slice_GetZTop (Handle, out resultZTop)); + return resultZTop; } - public UInt32 GetCount () - { - UInt32 resultCount = 0; + } - CheckError(Internal.Lib3MFWrapper.ColorGroup_GetCount (Handle, out resultCount)); - return resultCount; + public class CToolpathProfile : CBase + { + public CToolpathProfile (IntPtr NewHandle) : base (NewHandle) + { } - public void GetAllPropertyIDs (out UInt32[] APropertyIDs) + public String GetUUID () { - UInt64 sizePropertyIDs = 0; - UInt64 neededPropertyIDs = 0; - CheckError(Internal.Lib3MFWrapper.ColorGroup_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, IntPtr.Zero)); - sizePropertyIDs = neededPropertyIDs; - APropertyIDs = new UInt32[sizePropertyIDs]; - GCHandle dataPropertyIDs = GCHandle.Alloc(APropertyIDs, GCHandleType.Pinned); + UInt32 sizeUUID = 0; + UInt32 neededUUID = 0; + CheckError(Internal.Lib3MFWrapper.ToolpathProfile_GetUUID (Handle, sizeUUID, out neededUUID, IntPtr.Zero)); + sizeUUID = neededUUID; + byte[] bytesUUID = new byte[sizeUUID]; + GCHandle dataUUID = GCHandle.Alloc(bytesUUID, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.ColorGroup_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, dataPropertyIDs.AddrOfPinnedObject())); - dataPropertyIDs.Free(); + CheckError(Internal.Lib3MFWrapper.ToolpathProfile_GetUUID (Handle, sizeUUID, out neededUUID, dataUUID.AddrOfPinnedObject())); + dataUUID.Free(); + return Encoding.UTF8.GetString(bytesUUID).TrimEnd(char.MinValue); } - public UInt32 AddColor (sColor ATheColor) + public String GetName () { - Internal.InternalColor intTheColor = Internal.Lib3MFWrapper.convertStructToInternal_Color (ATheColor); - UInt32 resultPropertyID = 0; + UInt32 sizeName = 0; + UInt32 neededName = 0; + CheckError(Internal.Lib3MFWrapper.ToolpathProfile_GetName (Handle, sizeName, out neededName, IntPtr.Zero)); + sizeName = neededName; + byte[] bytesName = new byte[sizeName]; + GCHandle dataName = GCHandle.Alloc(bytesName, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.ColorGroup_AddColor (Handle, intTheColor, out resultPropertyID)); - return resultPropertyID; + CheckError(Internal.Lib3MFWrapper.ToolpathProfile_GetName (Handle, sizeName, out neededName, dataName.AddrOfPinnedObject())); + dataName.Free(); + return Encoding.UTF8.GetString(bytesName).TrimEnd(char.MinValue); } - public void RemoveColor (UInt32 APropertyID) + public UInt32 GetParameterCount () { + UInt32 resultCount = 0; - CheckError(Internal.Lib3MFWrapper.ColorGroup_RemoveColor (Handle, APropertyID)); + CheckError(Internal.Lib3MFWrapper.ToolpathProfile_GetParameterCount (Handle, out resultCount)); + return resultCount; } - public void SetColor (UInt32 APropertyID, sColor ATheColor) + public String GetParameterName (UInt32 AIndex) { - Internal.InternalColor intTheColor = Internal.Lib3MFWrapper.convertStructToInternal_Color (ATheColor); + UInt32 sizeName = 0; + UInt32 neededName = 0; + CheckError(Internal.Lib3MFWrapper.ToolpathProfile_GetParameterName (Handle, AIndex, sizeName, out neededName, IntPtr.Zero)); + sizeName = neededName; + byte[] bytesName = new byte[sizeName]; + GCHandle dataName = GCHandle.Alloc(bytesName, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.ColorGroup_SetColor (Handle, APropertyID, intTheColor)); + CheckError(Internal.Lib3MFWrapper.ToolpathProfile_GetParameterName (Handle, AIndex, sizeName, out neededName, dataName.AddrOfPinnedObject())); + dataName.Free(); + return Encoding.UTF8.GetString(bytesName).TrimEnd(char.MinValue); } - public sColor GetColor (UInt32 APropertyID) + public String GetParameterNameSpace (UInt32 AIndex) { - Internal.InternalColor intresultTheColor; + UInt32 sizeNameSpace = 0; + UInt32 neededNameSpace = 0; + CheckError(Internal.Lib3MFWrapper.ToolpathProfile_GetParameterNameSpace (Handle, AIndex, sizeNameSpace, out neededNameSpace, IntPtr.Zero)); + sizeNameSpace = neededNameSpace; + byte[] bytesNameSpace = new byte[sizeNameSpace]; + GCHandle dataNameSpace = GCHandle.Alloc(bytesNameSpace, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.ColorGroup_GetColor (Handle, APropertyID, out intresultTheColor)); - return Internal.Lib3MFWrapper.convertInternalToStruct_Color (intresultTheColor); + CheckError(Internal.Lib3MFWrapper.ToolpathProfile_GetParameterNameSpace (Handle, AIndex, sizeNameSpace, out neededNameSpace, dataNameSpace.AddrOfPinnedObject())); + dataNameSpace.Free(); + return Encoding.UTF8.GetString(bytesNameSpace).TrimEnd(char.MinValue); } - } - - public class CTexture2DGroup : CResource - { - public CTexture2DGroup (IntPtr NewHandle) : base (NewHandle) + public bool HasParameterValue (String ANameSpaceName, String AValueName) { + byte[] byteNameSpaceName = Encoding.UTF8.GetBytes(ANameSpaceName + char.MinValue); + byte[] byteValueName = Encoding.UTF8.GetBytes(AValueName + char.MinValue); + Byte resultValueExists = 0; + + CheckError(Internal.Lib3MFWrapper.ToolpathProfile_HasParameterValue (Handle, byteNameSpaceName, byteValueName, out resultValueExists)); + return (resultValueExists != 0); } - public UInt32 GetCount () + public String GetParameterValue (String ANameSpaceName, String AValueName) { - UInt32 resultCount = 0; + byte[] byteNameSpaceName = Encoding.UTF8.GetBytes(ANameSpaceName + char.MinValue); + byte[] byteValueName = Encoding.UTF8.GetBytes(AValueName + char.MinValue); + UInt32 sizeValue = 0; + UInt32 neededValue = 0; + CheckError(Internal.Lib3MFWrapper.ToolpathProfile_GetParameterValue (Handle, byteNameSpaceName, byteValueName, sizeValue, out neededValue, IntPtr.Zero)); + sizeValue = neededValue; + byte[] bytesValue = new byte[sizeValue]; + GCHandle dataValue = GCHandle.Alloc(bytesValue, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.Texture2DGroup_GetCount (Handle, out resultCount)); - return resultCount; + CheckError(Internal.Lib3MFWrapper.ToolpathProfile_GetParameterValue (Handle, byteNameSpaceName, byteValueName, sizeValue, out neededValue, dataValue.AddrOfPinnedObject())); + dataValue.Free(); + return Encoding.UTF8.GetString(bytesValue).TrimEnd(char.MinValue); } - public void GetAllPropertyIDs (out UInt32[] APropertyIDs) + public String GetParameterValueDef (String ANameSpaceName, String AValueName, String ADefaultValue) { - UInt64 sizePropertyIDs = 0; - UInt64 neededPropertyIDs = 0; - CheckError(Internal.Lib3MFWrapper.Texture2DGroup_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, IntPtr.Zero)); - sizePropertyIDs = neededPropertyIDs; - APropertyIDs = new UInt32[sizePropertyIDs]; - GCHandle dataPropertyIDs = GCHandle.Alloc(APropertyIDs, GCHandleType.Pinned); + byte[] byteNameSpaceName = Encoding.UTF8.GetBytes(ANameSpaceName + char.MinValue); + byte[] byteValueName = Encoding.UTF8.GetBytes(AValueName + char.MinValue); + byte[] byteDefaultValue = Encoding.UTF8.GetBytes(ADefaultValue + char.MinValue); + UInt32 sizeValue = 0; + UInt32 neededValue = 0; + CheckError(Internal.Lib3MFWrapper.ToolpathProfile_GetParameterValueDef (Handle, byteNameSpaceName, byteValueName, byteDefaultValue, sizeValue, out neededValue, IntPtr.Zero)); + sizeValue = neededValue; + byte[] bytesValue = new byte[sizeValue]; + GCHandle dataValue = GCHandle.Alloc(bytesValue, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.Texture2DGroup_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, dataPropertyIDs.AddrOfPinnedObject())); - dataPropertyIDs.Free(); + CheckError(Internal.Lib3MFWrapper.ToolpathProfile_GetParameterValueDef (Handle, byteNameSpaceName, byteValueName, byteDefaultValue, sizeValue, out neededValue, dataValue.AddrOfPinnedObject())); + dataValue.Free(); + return Encoding.UTF8.GetString(bytesValue).TrimEnd(char.MinValue); } - public UInt32 AddTex2Coord (sTex2Coord AUVCoordinate) + public Double GetParameterDoubleValue (String ANameSpaceName, String AValueName) { - Internal.InternalTex2Coord intUVCoordinate = Internal.Lib3MFWrapper.convertStructToInternal_Tex2Coord (AUVCoordinate); - UInt32 resultPropertyID = 0; + byte[] byteNameSpaceName = Encoding.UTF8.GetBytes(ANameSpaceName + char.MinValue); + byte[] byteValueName = Encoding.UTF8.GetBytes(AValueName + char.MinValue); + Double resultValue = 0; - CheckError(Internal.Lib3MFWrapper.Texture2DGroup_AddTex2Coord (Handle, intUVCoordinate, out resultPropertyID)); - return resultPropertyID; + CheckError(Internal.Lib3MFWrapper.ToolpathProfile_GetParameterDoubleValue (Handle, byteNameSpaceName, byteValueName, out resultValue)); + return resultValue; } - public sTex2Coord GetTex2Coord (UInt32 APropertyID) + public Double GetParameterDoubleValueDef (String ANameSpaceName, String AValueName, Double ADefaultValue) { - Internal.InternalTex2Coord intresultUVCoordinate; + byte[] byteNameSpaceName = Encoding.UTF8.GetBytes(ANameSpaceName + char.MinValue); + byte[] byteValueName = Encoding.UTF8.GetBytes(AValueName + char.MinValue); + Double resultValue = 0; - CheckError(Internal.Lib3MFWrapper.Texture2DGroup_GetTex2Coord (Handle, APropertyID, out intresultUVCoordinate)); - return Internal.Lib3MFWrapper.convertInternalToStruct_Tex2Coord (intresultUVCoordinate); + CheckError(Internal.Lib3MFWrapper.ToolpathProfile_GetParameterDoubleValueDef (Handle, byteNameSpaceName, byteValueName, ADefaultValue, out resultValue)); + return resultValue; } - public void RemoveTex2Coord (UInt32 APropertyID) + public Int64 GetParameterIntegerValue (String ANameSpaceName, String AValueName) { + byte[] byteNameSpaceName = Encoding.UTF8.GetBytes(ANameSpaceName + char.MinValue); + byte[] byteValueName = Encoding.UTF8.GetBytes(AValueName + char.MinValue); + Int64 resultValue = 0; - CheckError(Internal.Lib3MFWrapper.Texture2DGroup_RemoveTex2Coord (Handle, APropertyID)); + CheckError(Internal.Lib3MFWrapper.ToolpathProfile_GetParameterIntegerValue (Handle, byteNameSpaceName, byteValueName, out resultValue)); + return resultValue; } - public CTexture2D GetTexture2D () + public Int64 GetParameterIntegerValueDef (String ANameSpaceName, String AValueName, Int64 ADefaultValue) { - IntPtr newTexture2DInstance = IntPtr.Zero; + byte[] byteNameSpaceName = Encoding.UTF8.GetBytes(ANameSpaceName + char.MinValue); + byte[] byteValueName = Encoding.UTF8.GetBytes(AValueName + char.MinValue); + Int64 resultValue = 0; - CheckError(Internal.Lib3MFWrapper.Texture2DGroup_GetTexture2D (Handle, out newTexture2DInstance)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newTexture2DInstance); + CheckError(Internal.Lib3MFWrapper.ToolpathProfile_GetParameterIntegerValueDef (Handle, byteNameSpaceName, byteValueName, ADefaultValue, out resultValue)); + return resultValue; } - } - - public class CCompositeMaterials : CResource - { - public CCompositeMaterials (IntPtr NewHandle) : base (NewHandle) + public bool GetParameterBoolValue (String ANameSpaceName, String AValueName) { + byte[] byteNameSpaceName = Encoding.UTF8.GetBytes(ANameSpaceName + char.MinValue); + byte[] byteValueName = Encoding.UTF8.GetBytes(AValueName + char.MinValue); + Byte resultValue = 0; + + CheckError(Internal.Lib3MFWrapper.ToolpathProfile_GetParameterBoolValue (Handle, byteNameSpaceName, byteValueName, out resultValue)); + return (resultValue != 0); } - public UInt32 GetCount () + public bool GetParameterBoolValueDef (String ANameSpaceName, String AValueName, bool ADefaultValue) { - UInt32 resultCount = 0; + byte[] byteNameSpaceName = Encoding.UTF8.GetBytes(ANameSpaceName + char.MinValue); + byte[] byteValueName = Encoding.UTF8.GetBytes(AValueName + char.MinValue); + Byte resultValue = 0; - CheckError(Internal.Lib3MFWrapper.CompositeMaterials_GetCount (Handle, out resultCount)); - return resultCount; + CheckError(Internal.Lib3MFWrapper.ToolpathProfile_GetParameterBoolValueDef (Handle, byteNameSpaceName, byteValueName, (Byte)( ADefaultValue ? 1 : 0 ), out resultValue)); + return (resultValue != 0); } - public void GetAllPropertyIDs (out UInt32[] APropertyIDs) + public void SetName (String AName) { - UInt64 sizePropertyIDs = 0; - UInt64 neededPropertyIDs = 0; - CheckError(Internal.Lib3MFWrapper.CompositeMaterials_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, IntPtr.Zero)); - sizePropertyIDs = neededPropertyIDs; - APropertyIDs = new UInt32[sizePropertyIDs]; - GCHandle dataPropertyIDs = GCHandle.Alloc(APropertyIDs, GCHandleType.Pinned); + byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); - CheckError(Internal.Lib3MFWrapper.CompositeMaterials_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, dataPropertyIDs.AddrOfPinnedObject())); - dataPropertyIDs.Free(); + CheckError(Internal.Lib3MFWrapper.ToolpathProfile_SetName (Handle, byteName)); } - public CBaseMaterialGroup GetBaseMaterialGroup () + public void SetParameterValue (String ANameSpaceName, String AValueName, String AValue) { - IntPtr newBaseMaterialGroupInstance = IntPtr.Zero; + byte[] byteNameSpaceName = Encoding.UTF8.GetBytes(ANameSpaceName + char.MinValue); + byte[] byteValueName = Encoding.UTF8.GetBytes(AValueName + char.MinValue); + byte[] byteValue = Encoding.UTF8.GetBytes(AValue + char.MinValue); - CheckError(Internal.Lib3MFWrapper.CompositeMaterials_GetBaseMaterialGroup (Handle, out newBaseMaterialGroupInstance)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newBaseMaterialGroupInstance); + CheckError(Internal.Lib3MFWrapper.ToolpathProfile_SetParameterValue (Handle, byteNameSpaceName, byteValueName, byteValue)); } - public UInt32 AddComposite (sCompositeConstituent[] AComposite) + public void SetParameterDoubleValue (String ANameSpaceName, String AValueName, Double AValue) { - Internal.InternalCompositeConstituent[] intdataComposite = new Internal.InternalCompositeConstituent[AComposite.Length]; - for (int index = 0; index < AComposite.Length; index++) - intdataComposite[index] = Internal.Lib3MFWrapper.convertStructToInternal_CompositeConstituent(AComposite[index]); - GCHandle dataComposite = GCHandle.Alloc(intdataComposite, GCHandleType.Pinned); - UInt32 resultPropertyID = 0; + byte[] byteNameSpaceName = Encoding.UTF8.GetBytes(ANameSpaceName + char.MinValue); + byte[] byteValueName = Encoding.UTF8.GetBytes(AValueName + char.MinValue); - CheckError(Internal.Lib3MFWrapper.CompositeMaterials_AddComposite (Handle, (UInt64) AComposite.Length, dataComposite.AddrOfPinnedObject(), out resultPropertyID)); - dataComposite.Free (); - return resultPropertyID; + CheckError(Internal.Lib3MFWrapper.ToolpathProfile_SetParameterDoubleValue (Handle, byteNameSpaceName, byteValueName, AValue)); } - public void RemoveComposite (UInt32 APropertyID) + public void SetParameterIntegerValue (String ANameSpaceName, String AValueName, Int64 AValue) { + byte[] byteNameSpaceName = Encoding.UTF8.GetBytes(ANameSpaceName + char.MinValue); + byte[] byteValueName = Encoding.UTF8.GetBytes(AValueName + char.MinValue); - CheckError(Internal.Lib3MFWrapper.CompositeMaterials_RemoveComposite (Handle, APropertyID)); + CheckError(Internal.Lib3MFWrapper.ToolpathProfile_SetParameterIntegerValue (Handle, byteNameSpaceName, byteValueName, AValue)); } - public void GetComposite (UInt32 APropertyID, out sCompositeConstituent[] AComposite) + public void SetParameterBoolValue (String ANameSpaceName, String AValueName, bool AValue) { - UInt64 sizeComposite = 0; - UInt64 neededComposite = 0; - CheckError(Internal.Lib3MFWrapper.CompositeMaterials_GetComposite (Handle, APropertyID, sizeComposite, out neededComposite, IntPtr.Zero)); - sizeComposite = neededComposite; - var arrayComposite = new Internal.InternalCompositeConstituent[sizeComposite]; - GCHandle dataComposite = GCHandle.Alloc(arrayComposite, GCHandleType.Pinned); + byte[] byteNameSpaceName = Encoding.UTF8.GetBytes(ANameSpaceName + char.MinValue); + byte[] byteValueName = Encoding.UTF8.GetBytes(AValueName + char.MinValue); - CheckError(Internal.Lib3MFWrapper.CompositeMaterials_GetComposite (Handle, APropertyID, sizeComposite, out neededComposite, dataComposite.AddrOfPinnedObject())); - dataComposite.Free(); - AComposite = new sCompositeConstituent[sizeComposite]; - for (int index = 0; index < AComposite.Length; index++) - AComposite[index] = Internal.Lib3MFWrapper.convertInternalToStruct_CompositeConstituent(arrayComposite[index]); + CheckError(Internal.Lib3MFWrapper.ToolpathProfile_SetParameterBoolValue (Handle, byteNameSpaceName, byteValueName, (Byte)( AValue ? 1 : 0 ))); } } - public class CMultiPropertyGroup : CResource + public class CToolpathLayerReader : CBase { - public CMultiPropertyGroup (IntPtr NewHandle) : base (NewHandle) - { - } - - public UInt32 GetCount () + public CToolpathLayerReader (IntPtr NewHandle) : base (NewHandle) { - UInt32 resultCount = 0; - - CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_GetCount (Handle, out resultCount)); - return resultCount; } - public void GetAllPropertyIDs (out UInt32[] APropertyIDs) + public String GetLayerDataUUID () { - UInt64 sizePropertyIDs = 0; - UInt64 neededPropertyIDs = 0; - CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, IntPtr.Zero)); - sizePropertyIDs = neededPropertyIDs; - APropertyIDs = new UInt32[sizePropertyIDs]; - GCHandle dataPropertyIDs = GCHandle.Alloc(APropertyIDs, GCHandleType.Pinned); + UInt32 sizeUUID = 0; + UInt32 neededUUID = 0; + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_GetLayerDataUUID (Handle, sizeUUID, out neededUUID, IntPtr.Zero)); + sizeUUID = neededUUID; + byte[] bytesUUID = new byte[sizeUUID]; + GCHandle dataUUID = GCHandle.Alloc(bytesUUID, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, dataPropertyIDs.AddrOfPinnedObject())); - dataPropertyIDs.Free(); + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_GetLayerDataUUID (Handle, sizeUUID, out neededUUID, dataUUID.AddrOfPinnedObject())); + dataUUID.Free(); + return Encoding.UTF8.GetString(bytesUUID).TrimEnd(char.MinValue); } - public UInt32 AddMultiProperty (UInt32[] APropertyIDs) + public UInt32 GetSegmentCount () { - GCHandle dataPropertyIDs = GCHandle.Alloc(APropertyIDs, GCHandleType.Pinned); - UInt32 resultPropertyID = 0; + UInt32 resultCount = 0; - CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_AddMultiProperty (Handle, (UInt64) APropertyIDs.Length, dataPropertyIDs.AddrOfPinnedObject(), out resultPropertyID)); - dataPropertyIDs.Free (); - return resultPropertyID; + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_GetSegmentCount (Handle, out resultCount)); + return resultCount; } - public void SetMultiProperty (UInt32 APropertyID, UInt32[] APropertyIDs) + public void GetSegmentInfo (UInt32 AIndex, out eToolpathSegmentType AType, out UInt32 APointCount) { - GCHandle dataPropertyIDs = GCHandle.Alloc(APropertyIDs, GCHandleType.Pinned); + Int32 resultType = 0; - CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_SetMultiProperty (Handle, APropertyID, (UInt64) APropertyIDs.Length, dataPropertyIDs.AddrOfPinnedObject())); - dataPropertyIDs.Free (); + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_GetSegmentInfo (Handle, AIndex, out resultType, out APointCount)); + AType = (eToolpathSegmentType) (resultType); } - public void GetMultiProperty (UInt32 APropertyID, out UInt32[] APropertyIDs) + public CToolpathProfile GetSegmentProfile (UInt32 AIndex) { - UInt64 sizePropertyIDs = 0; - UInt64 neededPropertyIDs = 0; - CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_GetMultiProperty (Handle, APropertyID, sizePropertyIDs, out neededPropertyIDs, IntPtr.Zero)); - sizePropertyIDs = neededPropertyIDs; - APropertyIDs = new UInt32[sizePropertyIDs]; - GCHandle dataPropertyIDs = GCHandle.Alloc(APropertyIDs, GCHandleType.Pinned); + IntPtr newProfile = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_GetMultiProperty (Handle, APropertyID, sizePropertyIDs, out neededPropertyIDs, dataPropertyIDs.AddrOfPinnedObject())); - dataPropertyIDs.Free(); + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_GetSegmentProfile (Handle, AIndex, out newProfile)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newProfile); } - public void RemoveMultiProperty (UInt32 APropertyID) + public String GetSegmentProfileUUID (UInt32 AIndex) { + UInt32 sizeProfileUUID = 0; + UInt32 neededProfileUUID = 0; + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_GetSegmentProfileUUID (Handle, AIndex, sizeProfileUUID, out neededProfileUUID, IntPtr.Zero)); + sizeProfileUUID = neededProfileUUID; + byte[] bytesProfileUUID = new byte[sizeProfileUUID]; + GCHandle dataProfileUUID = GCHandle.Alloc(bytesProfileUUID, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_RemoveMultiProperty (Handle, APropertyID)); + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_GetSegmentProfileUUID (Handle, AIndex, sizeProfileUUID, out neededProfileUUID, dataProfileUUID.AddrOfPinnedObject())); + dataProfileUUID.Free(); + return Encoding.UTF8.GetString(bytesProfileUUID).TrimEnd(char.MinValue); } - public UInt32 GetLayerCount () + public CBuildItem GetSegmentPart (UInt32 AIndex) { - UInt32 resultCount = 0; + IntPtr newBuildItem = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_GetLayerCount (Handle, out resultCount)); - return resultCount; + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_GetSegmentPart (Handle, AIndex, out newBuildItem)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newBuildItem); } - public UInt32 AddLayer (sMultiPropertyLayer ATheLayer) + public String GetSegmentPartUUID (UInt32 AIndex) { - Internal.InternalMultiPropertyLayer intTheLayer = Internal.Lib3MFWrapper.convertStructToInternal_MultiPropertyLayer (ATheLayer); - UInt32 resultLayerIndex = 0; + UInt32 sizePartUUID = 0; + UInt32 neededPartUUID = 0; + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_GetSegmentPartUUID (Handle, AIndex, sizePartUUID, out neededPartUUID, IntPtr.Zero)); + sizePartUUID = neededPartUUID; + byte[] bytesPartUUID = new byte[sizePartUUID]; + GCHandle dataPartUUID = GCHandle.Alloc(bytesPartUUID, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_AddLayer (Handle, intTheLayer, out resultLayerIndex)); - return resultLayerIndex; + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_GetSegmentPartUUID (Handle, AIndex, sizePartUUID, out neededPartUUID, dataPartUUID.AddrOfPinnedObject())); + dataPartUUID.Free(); + return Encoding.UTF8.GetString(bytesPartUUID).TrimEnd(char.MinValue); } - public sMultiPropertyLayer GetLayer (UInt32 ALayerIndex) + public UInt32 GetSegmentLocalPartID (UInt32 AIndex) { - Internal.InternalMultiPropertyLayer intresultTheLayer; + UInt32 resultLocalPartID = 0; - CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_GetLayer (Handle, ALayerIndex, out intresultTheLayer)); - return Internal.Lib3MFWrapper.convertInternalToStruct_MultiPropertyLayer (intresultTheLayer); + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_GetSegmentLocalPartID (Handle, AIndex, out resultLocalPartID)); + return resultLocalPartID; } - public void RemoveLayer (UInt32 ALayerIndex) + public String GetPartUUIDByLocalPartID (UInt32 ALocalPartID) { + UInt32 sizePartUUID = 0; + UInt32 neededPartUUID = 0; + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_GetPartUUIDByLocalPartID (Handle, ALocalPartID, sizePartUUID, out neededPartUUID, IntPtr.Zero)); + sizePartUUID = neededPartUUID; + byte[] bytesPartUUID = new byte[sizePartUUID]; + GCHandle dataPartUUID = GCHandle.Alloc(bytesPartUUID, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_RemoveLayer (Handle, ALayerIndex)); - } - - } - - public class CAttachment : CBase - { - public CAttachment (IntPtr NewHandle) : base (NewHandle) - { + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_GetPartUUIDByLocalPartID (Handle, ALocalPartID, sizePartUUID, out neededPartUUID, dataPartUUID.AddrOfPinnedObject())); + dataPartUUID.Free(); + return Encoding.UTF8.GetString(bytesPartUUID).TrimEnd(char.MinValue); } - public String GetPath () + public void GetSegmentPointData (UInt32 AIndex, out sPosition2D[] APointData) { - UInt32 sizePath = 0; - UInt32 neededPath = 0; - CheckError(Internal.Lib3MFWrapper.Attachment_GetPath (Handle, sizePath, out neededPath, IntPtr.Zero)); - sizePath = neededPath; - byte[] bytesPath = new byte[sizePath]; - GCHandle dataPath = GCHandle.Alloc(bytesPath, GCHandleType.Pinned); + UInt64 sizePointData = 0; + UInt64 neededPointData = 0; + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_GetSegmentPointData (Handle, AIndex, sizePointData, out neededPointData, IntPtr.Zero)); + sizePointData = neededPointData; + var arrayPointData = new Internal.InternalPosition2D[sizePointData]; + GCHandle dataPointData = GCHandle.Alloc(arrayPointData, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.Attachment_GetPath (Handle, sizePath, out neededPath, dataPath.AddrOfPinnedObject())); - dataPath.Free(); - return Encoding.UTF8.GetString(bytesPath).TrimEnd(char.MinValue); + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_GetSegmentPointData (Handle, AIndex, sizePointData, out neededPointData, dataPointData.AddrOfPinnedObject())); + dataPointData.Free(); + APointData = new sPosition2D[sizePointData]; + for (int index = 0; index < APointData.Length; index++) + APointData[index] = Internal.Lib3MFWrapper.convertInternalToStruct_Position2D(arrayPointData[index]); } - public void SetPath (String APath) + public void FindAttributeInfoByName (String ANameSpace, String AAttributeName, out UInt32 AID, out eToolpathAttributeType AAttributeType) { - byte[] bytePath = Encoding.UTF8.GetBytes(APath + char.MinValue); + byte[] byteNameSpace = Encoding.UTF8.GetBytes(ANameSpace + char.MinValue); + byte[] byteAttributeName = Encoding.UTF8.GetBytes(AAttributeName + char.MinValue); + Int32 resultAttributeType = 0; - CheckError(Internal.Lib3MFWrapper.Attachment_SetPath (Handle, bytePath)); + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_FindAttributeInfoByName (Handle, byteNameSpace, byteAttributeName, out AID, out resultAttributeType)); + AAttributeType = (eToolpathAttributeType) (resultAttributeType); } - public CPackagePart PackagePart () + public UInt32 FindAttributeIDByName (String ANameSpace, String AAttributeName) { - IntPtr newPackagePart = IntPtr.Zero; + byte[] byteNameSpace = Encoding.UTF8.GetBytes(ANameSpace + char.MinValue); + byte[] byteAttributeName = Encoding.UTF8.GetBytes(AAttributeName + char.MinValue); + UInt32 resultID = 0; - CheckError(Internal.Lib3MFWrapper.Attachment_PackagePart (Handle, out newPackagePart)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newPackagePart); + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_FindAttributeIDByName (Handle, byteNameSpace, byteAttributeName, out resultID)); + return resultID; } - public String GetRelationShipType () + public eToolpathAttributeType FindAttributeValueByName (String ANameSpace, String AAttributeName) { - UInt32 sizePath = 0; - UInt32 neededPath = 0; - CheckError(Internal.Lib3MFWrapper.Attachment_GetRelationShipType (Handle, sizePath, out neededPath, IntPtr.Zero)); - sizePath = neededPath; - byte[] bytesPath = new byte[sizePath]; - GCHandle dataPath = GCHandle.Alloc(bytesPath, GCHandleType.Pinned); + byte[] byteNameSpace = Encoding.UTF8.GetBytes(ANameSpace + char.MinValue); + byte[] byteAttributeName = Encoding.UTF8.GetBytes(AAttributeName + char.MinValue); + Int32 resultAttributeType = 0; - CheckError(Internal.Lib3MFWrapper.Attachment_GetRelationShipType (Handle, sizePath, out neededPath, dataPath.AddrOfPinnedObject())); - dataPath.Free(); - return Encoding.UTF8.GetString(bytesPath).TrimEnd(char.MinValue); + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_FindAttributeValueByName (Handle, byteNameSpace, byteAttributeName, out resultAttributeType)); + return (eToolpathAttributeType) (resultAttributeType); } - public void SetRelationShipType (String APath) + public Int64 GetSegmentIntegerAttributeByID (UInt32 AIndex, UInt32 AID) { - byte[] bytePath = Encoding.UTF8.GetBytes(APath + char.MinValue); + Int64 resultValue = 0; - CheckError(Internal.Lib3MFWrapper.Attachment_SetRelationShipType (Handle, bytePath)); + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_GetSegmentIntegerAttributeByID (Handle, AIndex, AID, out resultValue)); + return resultValue; } - public void WriteToFile (String AFileName) + public Int64 GetSegmentIntegerAttributeByName (UInt32 AIndex, String ANameSpace, String AAttributeName) { - byte[] byteFileName = Encoding.UTF8.GetBytes(AFileName + char.MinValue); + byte[] byteNameSpace = Encoding.UTF8.GetBytes(ANameSpace + char.MinValue); + byte[] byteAttributeName = Encoding.UTF8.GetBytes(AAttributeName + char.MinValue); + Int64 resultValue = 0; - CheckError(Internal.Lib3MFWrapper.Attachment_WriteToFile (Handle, byteFileName)); + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_GetSegmentIntegerAttributeByName (Handle, AIndex, byteNameSpace, byteAttributeName, out resultValue)); + return resultValue; } - public void ReadFromFile (String AFileName) + public Double GetSegmentDoubleAttributeByID (UInt32 AIndex, UInt32 AID) { - byte[] byteFileName = Encoding.UTF8.GetBytes(AFileName + char.MinValue); + Double resultValue = 0; - CheckError(Internal.Lib3MFWrapper.Attachment_ReadFromFile (Handle, byteFileName)); + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_GetSegmentDoubleAttributeByID (Handle, AIndex, AID, out resultValue)); + return resultValue; } - public void ReadFromCallback (IntPtr ATheReadCallback, UInt64 AStreamSize, IntPtr ATheSeekCallback, UInt64 AUserData) + public Double GetSegmentDoubleAttributeByName (UInt32 AIndex, String ANameSpace, String AAttributeName) { + byte[] byteNameSpace = Encoding.UTF8.GetBytes(ANameSpace + char.MinValue); + byte[] byteAttributeName = Encoding.UTF8.GetBytes(AAttributeName + char.MinValue); + Double resultValue = 0; - CheckError(Internal.Lib3MFWrapper.Attachment_ReadFromCallback (Handle, ATheReadCallback, AStreamSize, ATheSeekCallback, AUserData)); + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_GetSegmentDoubleAttributeByName (Handle, AIndex, byteNameSpace, byteAttributeName, out resultValue)); + return resultValue; } - public UInt64 GetStreamSize () + public UInt32 GetCustomDataCount () { - UInt64 resultStreamSize = 0; + UInt32 resultCount = 0; - CheckError(Internal.Lib3MFWrapper.Attachment_GetStreamSize (Handle, out resultStreamSize)); - return resultStreamSize; + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_GetCustomDataCount (Handle, out resultCount)); + return resultCount; } - public void WriteToBuffer (out Byte[] ABuffer) + public CCustomDOMTree GetCustomData (UInt32 AIndex) { - UInt64 sizeBuffer = 0; - UInt64 neededBuffer = 0; - CheckError(Internal.Lib3MFWrapper.Attachment_WriteToBuffer (Handle, sizeBuffer, out neededBuffer, IntPtr.Zero)); - sizeBuffer = neededBuffer; - ABuffer = new Byte[sizeBuffer]; - GCHandle dataBuffer = GCHandle.Alloc(ABuffer, GCHandleType.Pinned); + IntPtr newData = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.Attachment_WriteToBuffer (Handle, sizeBuffer, out neededBuffer, dataBuffer.AddrOfPinnedObject())); - dataBuffer.Free(); + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_GetCustomData (Handle, AIndex, out newData)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newData); } - public void ReadFromBuffer (Byte[] ABuffer) + public void GetCustomDataName (UInt32 AIndex, out String ANameSpace, out String ADataName) { - GCHandle dataBuffer = GCHandle.Alloc(ABuffer, GCHandleType.Pinned); + UInt32 sizeNameSpace = 0; + UInt32 neededNameSpace = 0; + UInt32 sizeDataName = 0; + UInt32 neededDataName = 0; + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_GetCustomDataName (Handle, AIndex, sizeNameSpace, out neededNameSpace, IntPtr.Zero, sizeDataName, out neededDataName, IntPtr.Zero)); + sizeNameSpace = neededNameSpace; + byte[] bytesNameSpace = new byte[sizeNameSpace]; + GCHandle dataNameSpace = GCHandle.Alloc(bytesNameSpace, GCHandleType.Pinned); + sizeDataName = neededDataName; + byte[] bytesDataName = new byte[sizeDataName]; + GCHandle dataDataName = GCHandle.Alloc(bytesDataName, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.Attachment_ReadFromBuffer (Handle, (UInt64) ABuffer.Length, dataBuffer.AddrOfPinnedObject())); - dataBuffer.Free (); + CheckError(Internal.Lib3MFWrapper.ToolpathLayerReader_GetCustomDataName (Handle, AIndex, sizeNameSpace, out neededNameSpace, dataNameSpace.AddrOfPinnedObject(), sizeDataName, out neededDataName, dataDataName.AddrOfPinnedObject())); + dataNameSpace.Free(); + ANameSpace = Encoding.UTF8.GetString(bytesNameSpace).TrimEnd(char.MinValue); + dataDataName.Free(); + ADataName = Encoding.UTF8.GetString(bytesDataName).TrimEnd(char.MinValue); } } - public class CTexture2D : CResource + public class CToolpathLayerData : CBase { - public CTexture2D (IntPtr NewHandle) : base (NewHandle) + public CToolpathLayerData (IntPtr NewHandle) : base (NewHandle) { } - public CAttachment GetAttachment () + public String GetLayerDataUUID () { - IntPtr newAttachment = IntPtr.Zero; + UInt32 sizeUUID = 0; + UInt32 neededUUID = 0; + CheckError(Internal.Lib3MFWrapper.ToolpathLayerData_GetLayerDataUUID (Handle, sizeUUID, out neededUUID, IntPtr.Zero)); + sizeUUID = neededUUID; + byte[] bytesUUID = new byte[sizeUUID]; + GCHandle dataUUID = GCHandle.Alloc(bytesUUID, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.Texture2D_GetAttachment (Handle, out newAttachment)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newAttachment); + CheckError(Internal.Lib3MFWrapper.ToolpathLayerData_GetLayerDataUUID (Handle, sizeUUID, out neededUUID, dataUUID.AddrOfPinnedObject())); + dataUUID.Free(); + return Encoding.UTF8.GetString(bytesUUID).TrimEnd(char.MinValue); } - public void SetAttachment (CAttachment AAttachment) + public UInt32 RegisterProfile (CToolpathProfile AProfile) { - IntPtr AAttachmentHandle = IntPtr.Zero; - if (AAttachment != null) - AAttachmentHandle = AAttachment.GetHandle(); + IntPtr AProfileHandle = IntPtr.Zero; + if (AProfile != null) + AProfileHandle = AProfile.GetHandle(); + UInt32 resultProfileID = 0; - CheckError(Internal.Lib3MFWrapper.Texture2D_SetAttachment (Handle, AAttachmentHandle)); + CheckError(Internal.Lib3MFWrapper.ToolpathLayerData_RegisterProfile (Handle, AProfileHandle, out resultProfileID)); + return resultProfileID; } - public eTextureType GetContentType () + public UInt32 RegisterBuildItem (CBuildItem ABuildItem) { - Int32 resultContentType = 0; + IntPtr ABuildItemHandle = IntPtr.Zero; + if (ABuildItem != null) + ABuildItemHandle = ABuildItem.GetHandle(); + UInt32 resultPartID = 0; - CheckError(Internal.Lib3MFWrapper.Texture2D_GetContentType (Handle, out resultContentType)); - return (eTextureType) (resultContentType); + CheckError(Internal.Lib3MFWrapper.ToolpathLayerData_RegisterBuildItem (Handle, ABuildItemHandle, out resultPartID)); + return resultPartID; } - public void SetContentType (eTextureType AContentType) + public void SetSegmentAttribute (String ANameSpace, String AAttributeName, String AValue) { - Int32 enumContentType = (Int32) AContentType; + byte[] byteNameSpace = Encoding.UTF8.GetBytes(ANameSpace + char.MinValue); + byte[] byteAttributeName = Encoding.UTF8.GetBytes(AAttributeName + char.MinValue); + byte[] byteValue = Encoding.UTF8.GetBytes(AValue + char.MinValue); - CheckError(Internal.Lib3MFWrapper.Texture2D_SetContentType (Handle, enumContentType)); + CheckError(Internal.Lib3MFWrapper.ToolpathLayerData_SetSegmentAttribute (Handle, byteNameSpace, byteAttributeName, byteValue)); } - public void GetTileStyleUV (out eTextureTileStyle ATileStyleU, out eTextureTileStyle ATileStyleV) + public void ClearSegmentAttributes () { - Int32 resultTileStyleU = 0; - Int32 resultTileStyleV = 0; - CheckError(Internal.Lib3MFWrapper.Texture2D_GetTileStyleUV (Handle, out resultTileStyleU, out resultTileStyleV)); - ATileStyleU = (eTextureTileStyle) (resultTileStyleU); - ATileStyleV = (eTextureTileStyle) (resultTileStyleV); + CheckError(Internal.Lib3MFWrapper.ToolpathLayerData_ClearSegmentAttributes (Handle)); } - public void SetTileStyleUV (eTextureTileStyle ATileStyleU, eTextureTileStyle ATileStyleV) + public void WriteHatchData (UInt32 AProfileID, UInt32 APartID, sPosition2D[] APointData) { - Int32 enumTileStyleU = (Int32) ATileStyleU; - Int32 enumTileStyleV = (Int32) ATileStyleV; + Internal.InternalPosition2D[] intdataPointData = new Internal.InternalPosition2D[APointData.Length]; + for (int index = 0; index < APointData.Length; index++) + intdataPointData[index] = Internal.Lib3MFWrapper.convertStructToInternal_Position2D(APointData[index]); + GCHandle dataPointData = GCHandle.Alloc(intdataPointData, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.Texture2D_SetTileStyleUV (Handle, enumTileStyleU, enumTileStyleV)); + CheckError(Internal.Lib3MFWrapper.ToolpathLayerData_WriteHatchData (Handle, AProfileID, APartID, (UInt64) APointData.Length, dataPointData.AddrOfPinnedObject())); + dataPointData.Free (); } - public eTextureFilter GetFilter () + public void WriteLoop (UInt32 AProfileID, UInt32 APartID, sPosition2D[] APointData) { - Int32 resultFilter = 0; + Internal.InternalPosition2D[] intdataPointData = new Internal.InternalPosition2D[APointData.Length]; + for (int index = 0; index < APointData.Length; index++) + intdataPointData[index] = Internal.Lib3MFWrapper.convertStructToInternal_Position2D(APointData[index]); + GCHandle dataPointData = GCHandle.Alloc(intdataPointData, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.Texture2D_GetFilter (Handle, out resultFilter)); - return (eTextureFilter) (resultFilter); + CheckError(Internal.Lib3MFWrapper.ToolpathLayerData_WriteLoop (Handle, AProfileID, APartID, (UInt64) APointData.Length, dataPointData.AddrOfPinnedObject())); + dataPointData.Free (); } - public void SetFilter (eTextureFilter AFilter) + public void WritePolyline (UInt32 AProfileID, UInt32 APartID, sPosition2D[] APointData) { - Int32 enumFilter = (Int32) AFilter; - - CheckError(Internal.Lib3MFWrapper.Texture2D_SetFilter (Handle, enumFilter)); - } - - } + Internal.InternalPosition2D[] intdataPointData = new Internal.InternalPosition2D[APointData.Length]; + for (int index = 0; index < APointData.Length; index++) + intdataPointData[index] = Internal.Lib3MFWrapper.convertStructToInternal_Position2D(APointData[index]); + GCHandle dataPointData = GCHandle.Alloc(intdataPointData, GCHandleType.Pinned); - public class CBuildItem : CBase - { - public CBuildItem (IntPtr NewHandle) : base (NewHandle) - { + CheckError(Internal.Lib3MFWrapper.ToolpathLayerData_WritePolyline (Handle, AProfileID, APartID, (UInt64) APointData.Length, dataPointData.AddrOfPinnedObject())); + dataPointData.Free (); } - public CObject GetObjectResource () + public CCustomDOMTree AddCustomData (String ANameSpace, String ADataName) { - IntPtr newObjectResource = IntPtr.Zero; + byte[] byteNameSpace = Encoding.UTF8.GetBytes(ANameSpace + char.MinValue); + byte[] byteDataName = Encoding.UTF8.GetBytes(ADataName + char.MinValue); + IntPtr newData = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.BuildItem_GetObjectResource (Handle, out newObjectResource)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newObjectResource); + CheckError(Internal.Lib3MFWrapper.ToolpathLayerData_AddCustomData (Handle, byteNameSpace, byteDataName, out newData)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newData); } - public String GetUUID (out bool AHasUUID) + public void Finish () { - Byte resultHasUUID = 0; - UInt32 sizeUUID = 0; - UInt32 neededUUID = 0; - CheckError(Internal.Lib3MFWrapper.BuildItem_GetUUID (Handle, out resultHasUUID, sizeUUID, out neededUUID, IntPtr.Zero)); - sizeUUID = neededUUID; - byte[] bytesUUID = new byte[sizeUUID]; - GCHandle dataUUID = GCHandle.Alloc(bytesUUID, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.BuildItem_GetUUID (Handle, out resultHasUUID, sizeUUID, out neededUUID, dataUUID.AddrOfPinnedObject())); - AHasUUID = (resultHasUUID != 0); - dataUUID.Free(); - return Encoding.UTF8.GetString(bytesUUID).TrimEnd(char.MinValue); + CheckError(Internal.Lib3MFWrapper.ToolpathLayerData_Finish (Handle)); } - public void SetUUID (String AUUID) - { - byte[] byteUUID = Encoding.UTF8.GetBytes(AUUID + char.MinValue); + } - CheckError(Internal.Lib3MFWrapper.BuildItem_SetUUID (Handle, byteUUID)); + public class CToolpath : CResource + { + public CToolpath (IntPtr NewHandle) : base (NewHandle) + { } - public UInt32 GetObjectResourceID () + public Double GetUnits () { - UInt32 resultUniqueResourceID = 0; + Double resultUnits = 0; - CheckError(Internal.Lib3MFWrapper.BuildItem_GetObjectResourceID (Handle, out resultUniqueResourceID)); - return resultUniqueResourceID; + CheckError(Internal.Lib3MFWrapper.Toolpath_GetUnits (Handle, out resultUnits)); + return resultUnits; } - public bool HasObjectTransform () + public UInt32 GetLayerCount () { - Byte resultHasTransform = 0; + UInt32 resultCount = 0; - CheckError(Internal.Lib3MFWrapper.BuildItem_HasObjectTransform (Handle, out resultHasTransform)); - return (resultHasTransform != 0); + CheckError(Internal.Lib3MFWrapper.Toolpath_GetLayerCount (Handle, out resultCount)); + return resultCount; } - public sTransform GetObjectTransform () + public UInt32 GetProfileCount () { - Internal.InternalTransform intresultTransform; + UInt32 resultCount = 0; - CheckError(Internal.Lib3MFWrapper.BuildItem_GetObjectTransform (Handle, out intresultTransform)); - return Internal.Lib3MFWrapper.convertInternalToStruct_Transform (intresultTransform); + CheckError(Internal.Lib3MFWrapper.Toolpath_GetProfileCount (Handle, out resultCount)); + return resultCount; } - public void SetObjectTransform (sTransform ATransform) + public CToolpathLayerData AddLayer (UInt32 AZMax, String APath, CWriter AModelWriter) { - Internal.InternalTransform intTransform = Internal.Lib3MFWrapper.convertStructToInternal_Transform (ATransform); + byte[] bytePath = Encoding.UTF8.GetBytes(APath + char.MinValue); + IntPtr AModelWriterHandle = IntPtr.Zero; + if (AModelWriter != null) + AModelWriterHandle = AModelWriter.GetHandle(); + IntPtr newLayerData = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.BuildItem_SetObjectTransform (Handle, intTransform)); + CheckError(Internal.Lib3MFWrapper.Toolpath_AddLayer (Handle, AZMax, bytePath, AModelWriterHandle, out newLayerData)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newLayerData); } - public String GetPartNumber () + public CAttachment GetLayerAttachment (UInt32 AIndex) { - UInt32 sizePartNumber = 0; - UInt32 neededPartNumber = 0; - CheckError(Internal.Lib3MFWrapper.BuildItem_GetPartNumber (Handle, sizePartNumber, out neededPartNumber, IntPtr.Zero)); - sizePartNumber = neededPartNumber; - byte[] bytesPartNumber = new byte[sizePartNumber]; - GCHandle dataPartNumber = GCHandle.Alloc(bytesPartNumber, GCHandleType.Pinned); + IntPtr newAttachment = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.BuildItem_GetPartNumber (Handle, sizePartNumber, out neededPartNumber, dataPartNumber.AddrOfPinnedObject())); - dataPartNumber.Free(); - return Encoding.UTF8.GetString(bytesPartNumber).TrimEnd(char.MinValue); + CheckError(Internal.Lib3MFWrapper.Toolpath_GetLayerAttachment (Handle, AIndex, out newAttachment)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newAttachment); } - public void SetPartNumber (String ASetPartnumber) + public CToolpathLayerReader ReadLayerData (UInt32 AIndex) { - byte[] byteSetPartnumber = Encoding.UTF8.GetBytes(ASetPartnumber + char.MinValue); + IntPtr newToolpathReader = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.BuildItem_SetPartNumber (Handle, byteSetPartnumber)); + CheckError(Internal.Lib3MFWrapper.Toolpath_ReadLayerData (Handle, AIndex, out newToolpathReader)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newToolpathReader); } - public CMetaDataGroup GetMetaDataGroup () + public String GetLayerPath (UInt32 AIndex) { - IntPtr newMetaDataGroup = IntPtr.Zero; + UInt32 sizePath = 0; + UInt32 neededPath = 0; + CheckError(Internal.Lib3MFWrapper.Toolpath_GetLayerPath (Handle, AIndex, sizePath, out neededPath, IntPtr.Zero)); + sizePath = neededPath; + byte[] bytesPath = new byte[sizePath]; + GCHandle dataPath = GCHandle.Alloc(bytesPath, GCHandleType.Pinned); - CheckError(Internal.Lib3MFWrapper.BuildItem_GetMetaDataGroup (Handle, out newMetaDataGroup)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newMetaDataGroup); + CheckError(Internal.Lib3MFWrapper.Toolpath_GetLayerPath (Handle, AIndex, sizePath, out neededPath, dataPath.AddrOfPinnedObject())); + dataPath.Free(); + return Encoding.UTF8.GetString(bytesPath).TrimEnd(char.MinValue); } - public sBox GetOutbox () + public UInt32 GetLayerZMax (UInt32 AIndex) { - Internal.InternalBox intresultOutbox; + UInt32 resultZMax = 0; - CheckError(Internal.Lib3MFWrapper.BuildItem_GetOutbox (Handle, out intresultOutbox)); - return Internal.Lib3MFWrapper.convertInternalToStruct_Box (intresultOutbox); + CheckError(Internal.Lib3MFWrapper.Toolpath_GetLayerZMax (Handle, AIndex, out resultZMax)); + return resultZMax; } - } - - public class CBuildItemIterator : CBase - { - public CBuildItemIterator (IntPtr NewHandle) : base (NewHandle) + public UInt32 GetLayerZ (UInt32 ALayerIndex) { + UInt32 resultZValue = 0; + + CheckError(Internal.Lib3MFWrapper.Toolpath_GetLayerZ (Handle, ALayerIndex, out resultZValue)); + return resultZValue; } - public bool MoveNext () + public CToolpathProfile AddProfile (String AName) { - Byte resultHasNext = 0; + byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue); + IntPtr newProfile = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.BuildItemIterator_MoveNext (Handle, out resultHasNext)); - return (resultHasNext != 0); + CheckError(Internal.Lib3MFWrapper.Toolpath_AddProfile (Handle, byteName, out newProfile)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newProfile); } - public bool MovePrevious () + public CToolpathProfile GetProfile (UInt32 AProfileIndex) { - Byte resultHasPrevious = 0; + IntPtr newProfile = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.BuildItemIterator_MovePrevious (Handle, out resultHasPrevious)); - return (resultHasPrevious != 0); + CheckError(Internal.Lib3MFWrapper.Toolpath_GetProfile (Handle, AProfileIndex, out newProfile)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newProfile); } - public CBuildItem GetCurrent () + public CToolpathProfile GetProfileUUID (String AProfileUUID) { - IntPtr newBuildItem = IntPtr.Zero; + byte[] byteProfileUUID = Encoding.UTF8.GetBytes(AProfileUUID + char.MinValue); + IntPtr newProfile = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.BuildItemIterator_GetCurrent (Handle, out newBuildItem)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newBuildItem); + CheckError(Internal.Lib3MFWrapper.Toolpath_GetProfileUUID (Handle, byteProfileUUID, out newProfile)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newProfile); } - public CBuildItemIterator Clone () + public UInt32 GetCustomDataCount () { - IntPtr newOutBuildItemIterator = IntPtr.Zero; + UInt32 resultCount = 0; - CheckError(Internal.Lib3MFWrapper.BuildItemIterator_Clone (Handle, out newOutBuildItemIterator)); - return Internal.Lib3MFWrapper.PolymorphicFactory(newOutBuildItemIterator); + CheckError(Internal.Lib3MFWrapper.Toolpath_GetCustomDataCount (Handle, out resultCount)); + return resultCount; } - public UInt64 Count () + public CCustomDOMTree GetCustomData (UInt32 AIndex) { - UInt64 resultCount = 0; + IntPtr newData = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.BuildItemIterator_Count (Handle, out resultCount)); - return resultCount; + CheckError(Internal.Lib3MFWrapper.Toolpath_GetCustomData (Handle, AIndex, out newData)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newData); } - } - - public class CSlice : CBase - { - public CSlice (IntPtr NewHandle) : base (NewHandle) + public void GetCustomDataName (UInt32 AIndex, out String ANameSpace, out String ADataName) { + UInt32 sizeNameSpace = 0; + UInt32 neededNameSpace = 0; + UInt32 sizeDataName = 0; + UInt32 neededDataName = 0; + CheckError(Internal.Lib3MFWrapper.Toolpath_GetCustomDataName (Handle, AIndex, sizeNameSpace, out neededNameSpace, IntPtr.Zero, sizeDataName, out neededDataName, IntPtr.Zero)); + sizeNameSpace = neededNameSpace; + byte[] bytesNameSpace = new byte[sizeNameSpace]; + GCHandle dataNameSpace = GCHandle.Alloc(bytesNameSpace, GCHandleType.Pinned); + sizeDataName = neededDataName; + byte[] bytesDataName = new byte[sizeDataName]; + GCHandle dataDataName = GCHandle.Alloc(bytesDataName, GCHandleType.Pinned); + + CheckError(Internal.Lib3MFWrapper.Toolpath_GetCustomDataName (Handle, AIndex, sizeNameSpace, out neededNameSpace, dataNameSpace.AddrOfPinnedObject(), sizeDataName, out neededDataName, dataDataName.AddrOfPinnedObject())); + dataNameSpace.Free(); + ANameSpace = Encoding.UTF8.GetString(bytesNameSpace).TrimEnd(char.MinValue); + dataDataName.Free(); + ADataName = Encoding.UTF8.GetString(bytesDataName).TrimEnd(char.MinValue); } - public void SetVertices (sPosition2D[] AVertices) + public bool HasUniqueCustomData (String ANameSpace, String ADataName) { - Internal.InternalPosition2D[] intdataVertices = new Internal.InternalPosition2D[AVertices.Length]; - for (int index = 0; index < AVertices.Length; index++) - intdataVertices[index] = Internal.Lib3MFWrapper.convertStructToInternal_Position2D(AVertices[index]); - GCHandle dataVertices = GCHandle.Alloc(intdataVertices, GCHandleType.Pinned); + byte[] byteNameSpace = Encoding.UTF8.GetBytes(ANameSpace + char.MinValue); + byte[] byteDataName = Encoding.UTF8.GetBytes(ADataName + char.MinValue); + Byte resultCustomDataExists = 0; - CheckError(Internal.Lib3MFWrapper.Slice_SetVertices (Handle, (UInt64) AVertices.Length, dataVertices.AddrOfPinnedObject())); - dataVertices.Free (); + CheckError(Internal.Lib3MFWrapper.Toolpath_HasUniqueCustomData (Handle, byteNameSpace, byteDataName, out resultCustomDataExists)); + return (resultCustomDataExists != 0); } - public void GetVertices (out sPosition2D[] AVertices) + public CCustomDOMTree FindUniqueCustomData (String ANameSpace, String ADataName) { - UInt64 sizeVertices = 0; - UInt64 neededVertices = 0; - CheckError(Internal.Lib3MFWrapper.Slice_GetVertices (Handle, sizeVertices, out neededVertices, IntPtr.Zero)); - sizeVertices = neededVertices; - var arrayVertices = new Internal.InternalPosition2D[sizeVertices]; - GCHandle dataVertices = GCHandle.Alloc(arrayVertices, GCHandleType.Pinned); + byte[] byteNameSpace = Encoding.UTF8.GetBytes(ANameSpace + char.MinValue); + byte[] byteDataName = Encoding.UTF8.GetBytes(ADataName + char.MinValue); + IntPtr newData = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.Slice_GetVertices (Handle, sizeVertices, out neededVertices, dataVertices.AddrOfPinnedObject())); - dataVertices.Free(); - AVertices = new sPosition2D[sizeVertices]; - for (int index = 0; index < AVertices.Length; index++) - AVertices[index] = Internal.Lib3MFWrapper.convertInternalToStruct_Position2D(arrayVertices[index]); + CheckError(Internal.Lib3MFWrapper.Toolpath_FindUniqueCustomData (Handle, byteNameSpace, byteDataName, out newData)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newData); } - public UInt64 GetVertexCount () + public CCustomDOMTree AddCustomData (String ANameSpace, String ADataName) { - UInt64 resultCount = 0; + byte[] byteNameSpace = Encoding.UTF8.GetBytes(ANameSpace + char.MinValue); + byte[] byteDataName = Encoding.UTF8.GetBytes(ADataName + char.MinValue); + IntPtr newData = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.Slice_GetVertexCount (Handle, out resultCount)); - return resultCount; + CheckError(Internal.Lib3MFWrapper.Toolpath_AddCustomData (Handle, byteNameSpace, byteDataName, out newData)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newData); } - public UInt64 AddPolygon (UInt32[] AIndices) + public UInt32 ClearCustomData () { - GCHandle dataIndices = GCHandle.Alloc(AIndices, GCHandleType.Pinned); - UInt64 resultIndex = 0; + UInt32 resultNumberOfDeletedItems = 0; - CheckError(Internal.Lib3MFWrapper.Slice_AddPolygon (Handle, (UInt64) AIndices.Length, dataIndices.AddrOfPinnedObject(), out resultIndex)); - dataIndices.Free (); - return resultIndex; + CheckError(Internal.Lib3MFWrapper.Toolpath_ClearCustomData (Handle, out resultNumberOfDeletedItems)); + return resultNumberOfDeletedItems; } - public UInt64 GetPolygonCount () + public bool DeleteCustomData (CCustomDOMTree AData) { - UInt64 resultCount = 0; + IntPtr ADataHandle = IntPtr.Zero; + if (AData != null) + ADataHandle = AData.GetHandle(); + Byte resultSuccess = 0; - CheckError(Internal.Lib3MFWrapper.Slice_GetPolygonCount (Handle, out resultCount)); - return resultCount; + CheckError(Internal.Lib3MFWrapper.Toolpath_DeleteCustomData (Handle, ADataHandle, out resultSuccess)); + return (resultSuccess != 0); } - public void SetPolygonIndices (UInt64 AIndex, UInt32[] AIndices) + public void RegisterCustomIntegerAttribute (String ANameSpace, String AAttributeName) { - GCHandle dataIndices = GCHandle.Alloc(AIndices, GCHandleType.Pinned); + byte[] byteNameSpace = Encoding.UTF8.GetBytes(ANameSpace + char.MinValue); + byte[] byteAttributeName = Encoding.UTF8.GetBytes(AAttributeName + char.MinValue); - CheckError(Internal.Lib3MFWrapper.Slice_SetPolygonIndices (Handle, AIndex, (UInt64) AIndices.Length, dataIndices.AddrOfPinnedObject())); - dataIndices.Free (); + CheckError(Internal.Lib3MFWrapper.Toolpath_RegisterCustomIntegerAttribute (Handle, byteNameSpace, byteAttributeName)); } - public void GetPolygonIndices (UInt64 AIndex, out UInt32[] AIndices) + public void RegisterCustomDoubleAttribute (String ANameSpace, String AAttributeName) { - UInt64 sizeIndices = 0; - UInt64 neededIndices = 0; - CheckError(Internal.Lib3MFWrapper.Slice_GetPolygonIndices (Handle, AIndex, sizeIndices, out neededIndices, IntPtr.Zero)); - sizeIndices = neededIndices; - AIndices = new UInt32[sizeIndices]; - GCHandle dataIndices = GCHandle.Alloc(AIndices, GCHandleType.Pinned); + byte[] byteNameSpace = Encoding.UTF8.GetBytes(ANameSpace + char.MinValue); + byte[] byteAttributeName = Encoding.UTF8.GetBytes(AAttributeName + char.MinValue); - CheckError(Internal.Lib3MFWrapper.Slice_GetPolygonIndices (Handle, AIndex, sizeIndices, out neededIndices, dataIndices.AddrOfPinnedObject())); - dataIndices.Free(); + CheckError(Internal.Lib3MFWrapper.Toolpath_RegisterCustomDoubleAttribute (Handle, byteNameSpace, byteAttributeName)); } - public UInt64 GetPolygonIndexCount (UInt64 AIndex) - { - UInt64 resultCount = 0; + } - CheckError(Internal.Lib3MFWrapper.Slice_GetPolygonIndexCount (Handle, AIndex, out resultCount)); - return resultCount; + public class CToolpathIterator : CResourceIterator + { + public CToolpathIterator (IntPtr NewHandle) : base (NewHandle) + { } - public Double GetZTop () + public CToolpath GetCurrentToolpath () { - Double resultZTop = 0; + IntPtr newResource = IntPtr.Zero; - CheckError(Internal.Lib3MFWrapper.Slice_GetZTop (Handle, out resultZTop)); - return resultZTop; + CheckError(Internal.Lib3MFWrapper.ToolpathIterator_GetCurrentToolpath (Handle, out newResource)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newResource); } } @@ -4948,6 +6746,14 @@ public CMultiPropertyGroupIterator GetMultiPropertyGroups () return Internal.Lib3MFWrapper.PolymorphicFactory(newResourceIterator); } + public CToolpathIterator GetToolpaths () + { + IntPtr newResourceIterator = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.Model_GetToolpaths (Handle, out newResourceIterator)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newResourceIterator); + } + public CSliceStackIterator GetSliceStacks () { IntPtr newResourceIterator = IntPtr.Zero; @@ -5066,6 +6872,14 @@ public void RemoveBuildItem (CBuildItem ABuildItemInstance) CheckError(Internal.Lib3MFWrapper.Model_RemoveBuildItem (Handle, ABuildItemInstanceHandle)); } + public CToolpath AddToolpath (Double AUnitFactor) + { + IntPtr newToolpathInstance = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.Model_AddToolpath (Handle, AUnitFactor, out newToolpathInstance)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newToolpathInstance); + } + public CMetaDataGroup GetMetaDataGroup () { IntPtr newTheMetaDataGroup = IntPtr.Zero; @@ -5177,6 +6991,33 @@ public CKeyStore GetKeyStore () return Internal.Lib3MFWrapper.PolymorphicFactory(newKeyStore); } + public CPersistentReaderSource CreatePersistentSourceFromFile (String AFilename) + { + byte[] byteFilename = Encoding.UTF8.GetBytes(AFilename + char.MinValue); + IntPtr newInstance = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.Model_CreatePersistentSourceFromFile (Handle, byteFilename, out newInstance)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newInstance); + } + + public CPersistentReaderSource CreatePersistentSourceFromBuffer (Byte[] ABuffer) + { + GCHandle dataBuffer = GCHandle.Alloc(ABuffer, GCHandleType.Pinned); + IntPtr newInstance = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.Model_CreatePersistentSourceFromBuffer (Handle, (UInt64) ABuffer.Length, dataBuffer.AddrOfPinnedObject(), out newInstance)); + dataBuffer.Free (); + return Internal.Lib3MFWrapper.PolymorphicFactory(newInstance); + } + + public CPersistentReaderSource CreatePersistentSourceFromCallback (IntPtr ATheReadCallback, UInt64 AStreamSize, IntPtr ATheSeekCallback, UInt64 AUserData) + { + IntPtr newInstance = IntPtr.Zero; + + CheckError(Internal.Lib3MFWrapper.Model_CreatePersistentSourceFromCallback (Handle, ATheReadCallback, AStreamSize, ATheSeekCallback, AUserData, out newInstance)); + return Internal.Lib3MFWrapper.PolymorphicFactory(newInstance); + } + } class Wrapper diff --git a/Autogenerated/Bindings/Cpp/lib3mf_abi.hpp b/Autogenerated/Bindings/Cpp/lib3mf_abi.hpp index 44b8273b8..f1341db56 100644 --- a/Autogenerated/Bindings/Cpp/lib3mf_abi.hpp +++ b/Autogenerated/Bindings/Cpp/lib3mf_abi.hpp @@ -66,6 +66,78 @@ extern "C" { */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_base_classtypeid(Lib3MF_Base pBase, Lib3MF_uint64 * pClassTypeId); +/************************************************************************************************************************* + Class definition for BinaryStream +**************************************************************************************************************************/ + +/** +* Retrieves an binary streams package path for the binary data. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of binary streams package binary path., may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_binarystream_getbinarypath(Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Retrieves an binary streams package path for the index data. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of binary streams package index path., may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_binarystream_getindexpath(Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Retrieves an binary streams uuid. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of binary streams uuid, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_binarystream_getuuid(Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); + +/** +* Sets the float compression mode to raw. All subsequent writes will adhere to this mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_binarystream_disablediscretizedarraycompression(Lib3MF_BinaryStream pBinaryStream); + +/** +* Sets the compression mode to a quantized array. All subsequent writes will adhere to this mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] dUnits - Unit factor to use for quantization. +* @param[in] ePredictionType - Prediction type to use for arrays. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_binarystream_enablediscretizedarraycompression(Lib3MF_BinaryStream pBinaryStream, Lib3MF_double dUnits, Lib3MF::eBinaryStreamPredictionType ePredictionType); + +/** +* Enables LZMA mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nLZMALevel - LZMA Level (0-9) +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_binarystream_enablelzma(Lib3MF_BinaryStream pBinaryStream, Lib3MF_uint32 nLZMALevel); + +/** +* Disables LZMA mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_binarystream_disablelzma(Lib3MF_BinaryStream pBinaryStream); + /************************************************************************************************************************* Class definition for Writer **************************************************************************************************************************/ @@ -199,10 +271,80 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_writer_addkeywrappingcallback(Lib3MF_Writer */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_writer_setcontentencryptioncallback(Lib3MF_Writer pWriter, Lib3MF::ContentEncryptionCallback pTheCallback, Lib3MF_pvoid pUserData); +/** +* Creates a binary stream object. Only applicable for 3MF Writers. +* +* @param[in] pWriter - Writer instance. +* @param[in] pIndexPath - Package path to write the index into +* @param[in] pBinaryPath - Package path to write raw binary data into +* @param[out] pBinaryStream - Returns a package path. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_writer_createbinarystream(Lib3MF_Writer pWriter, const char * pIndexPath, const char * pBinaryPath, Lib3MF_BinaryStream * pBinaryStream); + +/** +* Sets a binary stream for an object. Currently supported objects are Meshes and Toolpath layers. +* +* @param[in] pWriter - Writer instance. +* @param[in] pInstance - Object instance to assign Binary stream to. +* @param[in] pBinaryStream - Binary stream object to use for this layer. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_writer_assignbinarystream(Lib3MF_Writer pWriter, Lib3MF_Base pInstance, Lib3MF_BinaryStream pBinaryStream); + +/** +* Registers a custom 3MF Namespace. Fails if Prefix is already registered. +* +* @param[in] pWriter - Writer instance. +* @param[in] pPrefix - Prefix to be used. MUST NOT be empty. MUST be alphanumeric, not starting with a number +* @param[in] pNameSpace - Namespace to be used. MUST NOT be empty. MUST be alphanumeric, not starting with a number +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_writer_registercustomnamespace(Lib3MF_Writer pWriter, const char * pPrefix, const char * pNameSpace); + +/************************************************************************************************************************* + Class definition for PersistentReaderSource +**************************************************************************************************************************/ + +/** +* Retrieves the type of source data. +* +* @param[in] pPersistentReaderSource - PersistentReaderSource instance. +* @param[out] pSourceType - Reader Source Type +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_persistentreadersource_getsourcetype(Lib3MF_PersistentReaderSource pPersistentReaderSource, Lib3MF::ePersistentReaderSourceType * pSourceType); + +/** +* Invalidates the reader source. Every subsequent read on this data will fail. +* +* @param[in] pPersistentReaderSource - PersistentReaderSource instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_persistentreadersource_invalidatesourcedata(Lib3MF_PersistentReaderSource pPersistentReaderSource); + +/** +* Checks if the source data is valid. Any read on an invalid source object will fail. +* +* @param[in] pPersistentReaderSource - PersistentReaderSource instance. +* @param[out] pDataIsValid - The source data is valid. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_persistentreadersource_sourcedataisvalid(Lib3MF_PersistentReaderSource pPersistentReaderSource, bool * pDataIsValid); + /************************************************************************************************************************* Class definition for Reader **************************************************************************************************************************/ +/** +* Reads a model from a persistent source object. The object will be referenced until the Model is destroyed or cleared. +* +* @param[in] pReader - Reader instance. +* @param[in] pSource - Source object to read from +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_reader_readfrompersistentsource(Lib3MF_Reader pReader, Lib3MF_PersistentReaderSource pSource); + /** * Reads a model from a file. The file type is specified by the Model Reader class * @@ -446,1987 +588,3252 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_resourceiterator_clone(Lib3MF_ResourceIterat LIB3MF_DECLSPEC Lib3MFResult lib3mf_resourceiterator_count(Lib3MF_ResourceIterator pResourceIterator, Lib3MF_uint64 * pCount); /************************************************************************************************************************* - Class definition for SliceStackIterator + Class definition for CustomXMLAttribute **************************************************************************************************************************/ /** -* Returns the SliceStack the iterator points at. +* Retrieves name of the attribute. * -* @param[in] pSliceStackIterator - SliceStackIterator instance. -* @param[out] pResource - returns the SliceStack instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the attribute., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slicestackiterator_getcurrentslicestack(Lib3MF_SliceStackIterator pSliceStackIterator, Lib3MF_SliceStack * pResource); - -/************************************************************************************************************************* - Class definition for ObjectIterator -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_getname(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Returns the Object the iterator points at. +* Retrieves value of the attribute as string. * -* @param[in] pObjectIterator - ObjectIterator instance. -* @param[out] pResource - returns the Object instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of returns the value of the attribute., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_objectiterator_getcurrentobject(Lib3MF_ObjectIterator pObjectIterator, Lib3MF_Object * pResource); - -/************************************************************************************************************************* - Class definition for MeshObjectIterator -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_getvalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* Returns the MeshObject the iterator points at. +* Checks if the value is a valid integer in the given range. * -* @param[in] pMeshObjectIterator - MeshObjectIterator instance. -* @param[out] pResource - returns the MeshObject instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nMinValue - Minimum allowed value +* @param[in] nMaxValue - Maximum allowed value +* @param[out] pIsValid - returns if the value is a valid integer. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobjectiterator_getcurrentmeshobject(Lib3MF_MeshObjectIterator pMeshObjectIterator, Lib3MF_MeshObject * pResource); - -/************************************************************************************************************************* - Class definition for ComponentsObjectIterator -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_isvalidinteger(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nMinValue, Lib3MF_int64 nMaxValue, bool * pIsValid); /** -* Returns the ComponentsObject the iterator points at. +* Returns the value as integer. Fails if the value is not a valid integer in the given range. * -* @param[in] pComponentsObjectIterator - ComponentsObjectIterator instance. -* @param[out] pResource - returns the ComponentsObject instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nMinValue - Minimum allowed value +* @param[in] nMaxValue - Maximum allowed value +* @param[out] pValue - returns the value. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobjectiterator_getcurrentcomponentsobject(Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource); - -/************************************************************************************************************************* - Class definition for Texture2DIterator -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_getintegervalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nMinValue, Lib3MF_int64 nMaxValue, Lib3MF_int64 * pValue); /** -* Returns the Texture2D the iterator points at. +* Checks if the value is a valid double in the given range. * -* @param[in] pTexture2DIterator - Texture2DIterator instance. -* @param[out] pResource - returns the Texture2D instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dMinValue - Minimum allowed value +* @param[in] dMaxValue - Maximum allowed value +* @param[out] pIsValid - returns if the value is a valid double. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2diterator_getcurrenttexture2d(Lib3MF_Texture2DIterator pTexture2DIterator, Lib3MF_Texture2D * pResource); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_isvaliddouble(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, bool * pIsValid); -/************************************************************************************************************************* - Class definition for BaseMaterialGroupIterator -**************************************************************************************************************************/ +/** +* Returns the value as double. Fails if the value is not a valid double in the given range. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dMinValue - Minimum allowed value +* @param[in] dMaxValue - Maximum allowed value +* @param[out] pValue - returns the value . +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_getdoublevalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, Lib3MF_double * pValue); /** -* Returns the MaterialGroup the iterator points at. +* Checks if the value is a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. * -* @param[in] pBaseMaterialGroupIterator - BaseMaterialGroupIterator instance. -* @param[out] pResource - returns the BaseMaterialGroup instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[out] pIsValid - returns if the value is a valid bool. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup(Lib3MF_BaseMaterialGroupIterator pBaseMaterialGroupIterator, Lib3MF_BaseMaterialGroup * pResource); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_isvalidbool(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, bool * pIsValid); -/************************************************************************************************************************* - Class definition for ColorGroupIterator -**************************************************************************************************************************/ +/** +* Returns the value as bool. Fails if the value is not a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dMinValue - Minimum allowed value +* @param[in] dMaxValue - Maximum allowed value +* @param[out] pValue - returns the value . +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_getboolvalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, bool * pValue); /** -* Returns the ColorGroup the iterator points at. +* Sets the value of the attribute as string. * -* @param[in] pColorGroupIterator - ColorGroupIterator instance. -* @param[out] pResource - returns the ColorGroup instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] pValue - new value of the attribute. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroupiterator_getcurrentcolorgroup(Lib3MF_ColorGroupIterator pColorGroupIterator, Lib3MF_ColorGroup * pResource); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_setvalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const char * pValue); -/************************************************************************************************************************* - Class definition for Texture2DGroupIterator -**************************************************************************************************************************/ +/** +* Sets the value of the attribute as integer. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nValue - new value of the attribute. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_setintegervalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nValue); /** -* Returns the Texture2DGroup the iterator points at. +* Sets the value of the attribute as double. * -* @param[in] pTexture2DGroupIterator - Texture2DGroupIterator instance. -* @param[out] pResource - returns the Texture2DGroup instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dValue - new value of the attribute. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup(Lib3MF_Texture2DGroupIterator pTexture2DGroupIterator, Lib3MF_Texture2DGroup * pResource); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_setdoublevalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dValue); -/************************************************************************************************************************* - Class definition for CompositeMaterialsIterator -**************************************************************************************************************************/ +/** +* Sets the value of the attribute as bool. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] bValue - new value of the attribute. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_setboolvalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, bool bValue); /** -* Returns the CompositeMaterials the iterator points at. +* Removes the attribute from its parent node. All subsequent calls to the class will fail. * -* @param[in] pCompositeMaterialsIterator - CompositeMaterialsIterator instance. -* @param[out] pResource - returns the CompositeMaterials instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerialsiterator_getcurrentcompositematerials(Lib3MF_CompositeMaterialsIterator pCompositeMaterialsIterator, Lib3MF_CompositeMaterials * pResource); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_remove(Lib3MF_CustomXMLAttribute pCustomXMLAttribute); /************************************************************************************************************************* - Class definition for MultiPropertyGroupIterator + Class definition for CustomXMLNode **************************************************************************************************************************/ /** -* Returns the MultiPropertyGroup the iterator points at. +* Retrieves name of the node. * -* @param[in] pMultiPropertyGroupIterator - MultiPropertyGroupIterator instance. -* @param[out] pResource - returns the MultiPropertyGroup instance. +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the node., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup(Lib3MF_MultiPropertyGroupIterator pMultiPropertyGroupIterator, Lib3MF_MultiPropertyGroup * pResource); - -/************************************************************************************************************************* - Class definition for MetaData -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_getname(Lib3MF_CustomXMLNode pCustomXMLNode, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* returns the namespace URL of the metadata +* Retrieves namespace of the node. * -* @param[in] pMetaData - MetaData instance. +* @param[in] pCustomXMLNode - CustomXMLNode instance. * @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) * @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameSpaceBuffer - buffer of the namespace URL of the metadata, may be NULL +* @param[out] pNameSpaceBuffer - buffer of returns the namespace of the node., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getnamespace(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_getnamespace(Lib3MF_CustomXMLNode pCustomXMLNode, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* sets a new namespace URL of the metadata +* Returns number of attributes. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pNameSpace - the new namespace URL of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[out] pCount - returns the number of attributes. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_setnamespace(Lib3MF_MetaData pMetaData, const char * pNameSpace); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_getattributecount(Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 * pCount); /** -* returns the name of a metadata +* Returns attribute instance. Fails if Index is out of range. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of the name of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] nIndex - Index of the attribute to return (0-based). +* @param[out] pAttributeInstance - XML Document attribute. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getname(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_getattribute(Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 nIndex, Lib3MF_CustomXMLAttribute * pAttributeInstance); /** -* sets a new name of a metadata +* Returns if attribute of a specific name exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pName - the new name of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[out] pAttributeExists - Returns if the attribute exists. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_setname(Lib3MF_MetaData pMetaData, const char * pName); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_hasattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pAttributeExists); /** -* returns the (namespace+name) of a metadata +* Returns attribute instance of a specific name. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nKeyBufferSize - size of the buffer (including trailing 0) -* @param[out] pKeyNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pKeyBuffer - buffer of the key (namespace+name) of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] bMustExist - If true, the call fails if attribute does not exist. If falls, the call will return null if the attribute does not exist. +* @param[out] pAttributeInstance - XML Document attribute. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getkey(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nKeyBufferSize, Lib3MF_uint32* pKeyNeededChars, char * pKeyBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_findattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bMustExist, Lib3MF_CustomXMLAttribute * pAttributeInstance); /** -* returns, whether a metadata must be preserved +* Removes the attribute with a specific name. Does nothing if attribute does not exist. * -* @param[in] pMetaData - MetaData instance. -* @param[out] pMustPreserve - returns, whether a metadata must be preserved +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[out] pAttributeRemoved - Returns true if an attribute was removed. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getmustpreserve(Lib3MF_MetaData pMetaData, bool * pMustPreserve); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_removeattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pAttributeRemoved); /** -* sets whether a metadata must be preserved +* Removes the attribute with a specific index. Fails if index is invalid * -* @param[in] pMetaData - MetaData instance. -* @param[in] bMustPreserve - a new value whether a metadata must be preserved +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] nIndex - Index of the attribute to remove (0-based). +* @param[out] pAttributeRemoved - Returns true if an attribute was removed. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_setmustpreserve(Lib3MF_MetaData pMetaData, bool bMustPreserve); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_removeattributebyindex(Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 nIndex, bool * pAttributeRemoved); /** -* returns the type of a metadata +* Adds an attribute with a specific name and string value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nTypeBufferSize - size of the buffer (including trailing 0) -* @param[out] pTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pTypeBuffer - buffer of the type of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] pValue - Value of the attribute. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_gettype(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nTypeBufferSize, Lib3MF_uint32* pTypeNeededChars, char * pTypeBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_addattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, const char * pValue); /** -* sets a new type of a metadata. This must be a simple XML type +* Adds an attribute with a specific name and integer value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pType - a new type of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] nValue - Value of the attribute. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_settype(Lib3MF_MetaData pMetaData, const char * pType); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_addintegerattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_int64 nValue); /** -* returns the value of the metadata +* Adds an attribute with a specific name and double value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nValueBufferSize - size of the buffer (including trailing 0) -* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pValueBuffer - buffer of the value of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] dValue - Value of the attribute. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getvalue(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_adddoubleattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_double dValue); /** -* sets a new value of the metadata +* Adds an attribute with a specific name and bool value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pValue - a new value of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] bValue - Value of the attribute. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_setvalue(Lib3MF_MetaData pMetaData, const char * pValue); - -/************************************************************************************************************************* - Class definition for MetaDataGroup -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_addboolattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bValue); /** -* returns the number of metadata in this metadatagroup +* Returns all the child nodes of the XML Node. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[out] pCount - returns the number metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[out] pChildNodes - returns the list of child nodes. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_getmetadatacount(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_getchildren(Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_CustomXMLNodes * pChildNodes); /** -* returns a metadata value within this metadatagroup +* Returns how many children of the XML Node have a specific name. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] nIndex - Index of the Metadata. -* @param[out] pMetaData - an instance of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the node. +* @param[out] pCount - returns the number children with the specified name. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_getmetadata(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex, Lib3MF_MetaData * pMetaData); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_countchildrenbyname(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_uint64 * pCount); /** -* returns a metadata value within this metadatagroup +* Returns all the child nodes of the XML Node with a specific name. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] pNameSpace - the namespace of the metadata -* @param[in] pName - the name of the Metadata -* @param[out] pMetaData - an instance of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildNodes - returns the list of child nodes. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_getmetadatabykey(Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, Lib3MF_MetaData * pMetaData); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_getchildrenbyname(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_CustomXMLNodes * pChildNodes); /** -* removes metadata by index from the model. +* Returns if a child with a specific name exist. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] nIndex - Index of the metadata to remove +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildExists - returns if a child with a specific name exists. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_removemetadatabyindex(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_haschild(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pChildExists); /** -* removes metadata from the model. +* Returns if a child with a specific name exist once and only once. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] pTheMetaData - The metadata to remove +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildExists - returns if a child with a specific name exists once and only once. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_removemetadata(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_MetaData pTheMetaData); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_hasuniquechild(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pChildExists); /** -* adds a new metadata to this metadatagroup +* Returns child with a specific name. Throws an error if name does not exist once and only once. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] pNameSpace - the namespace of the metadata -* @param[in] pName - the name of the metadata -* @param[in] pValue - the value of the metadata -* @param[in] pType - the type of the metadata -* @param[in] bMustPreserve - shuold the metadata be preserved -* @param[out] pMetaData - a new instance of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[in] bMustExist - If true, the call fails if child does not exist. If falls, the call will return null if the child does not exist. +* @param[out] pChildInstance - returns child instance or null. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_addmetadata(Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, const char * pValue, const char * pType, bool bMustPreserve, Lib3MF_MetaData * pMetaData); - -/************************************************************************************************************************* - Class definition for Object -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_findchild(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bMustExist, Lib3MF_CustomXMLNode * pChildInstance); /** -* Retrieves an object's type +* Adds a new child with a specific name. * -* @param[in] pObject - Object instance. -* @param[out] pObjectType - returns object type enum. +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildInstance - returns child instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_gettype(Lib3MF_Object pObject, Lib3MF::eObjectType * pObjectType); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_addchild(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_CustomXMLNode * pChildInstance); /** -* Sets an object's type +* Removes a specific child. All subsequent calls to the child will fail after the call. * -* @param[in] pObject - Object instance. -* @param[in] eObjectType - object type enum. +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pChildInstance - child instance to remove. Fails if given instance is not a child of the node. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_settype(Lib3MF_Object pObject, Lib3MF::eObjectType eObjectType); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_removechild(Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_CustomXMLNode pChildInstance); /** -* Retrieves an object's name +* Removes all children with a specific name. Does nothing if no child with the name exists. All subsequent calls to the deleted children will fail after the call. * -* @param[in] pObject - Object instance. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of returns object name., may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the children. +* @param[out] pNumberOfDeletedChildren - Returns how many children have been deleted. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getname(Lib3MF_Object pObject, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_removechildrenwithname(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_uint64 * pNumberOfDeletedChildren); /** -* Sets an object's name string +* Removes the node from its parent. The root node of the document can not be removed. Any subsequent call to the node fails after this. * -* @param[in] pObject - Object instance. -* @param[in] pName - new object name. +* @param[in] pCustomXMLNode - CustomXMLNode instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setname(Lib3MF_Object pObject, const char * pName); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_remove(Lib3MF_CustomXMLNode pCustomXMLNode); + +/************************************************************************************************************************* + Class definition for CustomXMLNodes +**************************************************************************************************************************/ /** -* Retrieves an object's part number +* Returns number of nodes. * -* @param[in] pObject - Object instance. -* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) -* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPartNumberBuffer - buffer of returns object part number., may be NULL +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[out] pCount - returns the number of nodes in the list. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getpartnumber(Lib3MF_Object pObject, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnodes_getnodecount(Lib3MF_CustomXMLNodes pCustomXMLNodes, Lib3MF_uint64 * pCount); /** -* Sets an objects partnumber string +* Returns node instance. Fails if Index is out of range. * -* @param[in] pObject - Object instance. -* @param[in] pPartNumber - new object part number. +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] nIndex - Index of the node to return (0-based). +* @param[out] pNodeInstance - XML Node node. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setpartnumber(Lib3MF_Object pObject, const char * pPartNumber); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnodes_getnode(Lib3MF_CustomXMLNodes pCustomXMLNodes, Lib3MF_uint64 nIndex, Lib3MF_CustomXMLNode * pNodeInstance); /** -* Retrieves, if an object is a mesh object +* Returns how many nodes of the XML Node have a specific name. * -* @param[in] pObject - Object instance. -* @param[out] pIsMeshObject - returns, whether the object is a mesh object +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pCount - returns the number of nodes with the specified name. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_ismeshobject(Lib3MF_Object pObject, bool * pIsMeshObject); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnodes_countnodesbyname(Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, Lib3MF_uint64 * pCount); /** -* Retrieves, if an object is a components object +* Returns all the nodes nodes of the XML Node with a specific name. * -* @param[in] pObject - Object instance. -* @param[out] pIsComponentsObject - returns, whether the object is a components object +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pNodes - returns the list of node nodes. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_iscomponentsobject(Lib3MF_Object pObject, bool * pIsComponentsObject); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnodes_getnodesbyname(Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, Lib3MF_CustomXMLNodes * pNodes); /** -* Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. +* Returns if a node with a specific name exist. * -* @param[in] pObject - Object instance. -* @param[out] pIsValid - returns whether the object is a valid object description +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pNodeExists - returns if a node with a specific name exists. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_isvalid(Lib3MF_Object pObject, bool * pIsValid); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnodes_hasnode(Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool * pNodeExists); /** -* Use an existing attachment as thumbnail for this object +* Returns if a node with a specific name exist once and only once. * -* @param[in] pObject - Object instance. -* @param[in] pAttachment - Instance of a new or the existing thumbnailattachment object. +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pNodeExists - returns if a node with a specific name exists once and only once. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setattachmentasthumbnail(Lib3MF_Object pObject, Lib3MF_Attachment pAttachment); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnodes_hasuniquenode(Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool * pNodeExists); /** -* Get the attachment containing the object thumbnail. +* Returns node with a specific name. Throws an error if name does not exist once and only once. * -* @param[in] pObject - Object instance. -* @param[out] pAttachment - Instance of the thumbnailattachment object or NULL. +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[in] bMustExist - If true, the call fails if node does not exist. If falls, the call will return null if the node does not exist. +* @param[out] pNodeInstance - returns node instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getthumbnailattachment(Lib3MF_Object pObject, Lib3MF_Attachment * pAttachment); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnodes_findnode(Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool bMustExist, Lib3MF_CustomXMLNode * pNodeInstance); + +/************************************************************************************************************************* + Class definition for CustomDOMTree +**************************************************************************************************************************/ /** -* Clears the attachment. The attachment instance is not removed from the package. +* Returns the namespace identifier for the DOM Tree. * -* @param[in] pObject - Object instance. +* @param[in] pCustomDOMTree - CustomDOMTree instance. +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of returns the namespace of the DOM Tree., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_clearthumbnailattachment(Lib3MF_Object pObject); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customdomtree_getnamespace(Lib3MF_CustomDOMTree pCustomDOMTree, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* Returns the outbox of a build item +* Returns root node of the tree. * -* @param[in] pObject - Object instance. -* @param[out] pOutbox - Outbox of this build item +* @param[in] pCustomDOMTree - CustomDOMTree instance. +* @param[out] pRootNode - Root node of the document. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getoutbox(Lib3MF_Object pObject, Lib3MF::sBox * pOutbox); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customdomtree_getrootnode(Lib3MF_CustomDOMTree pCustomDOMTree, Lib3MF_CustomXMLNode * pRootNode); /** -* Retrieves an object's uuid string (see production extension specification) +* Saves the XML tree into a string. * -* @param[in] pObject - Object instance. -* @param[out] pHasUUID - flag whether the build item has a UUID -* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pUUIDBuffer - buffer of returns object uuid., may be NULL +* @param[in] pCustomDOMTree - CustomDOMTree instance. +* @param[in] nXMLStringBufferSize - size of the buffer (including trailing 0) +* @param[out] pXMLStringNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pXMLStringBuffer - buffer of String with the XML Content., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getuuid(Lib3MF_Object pObject, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customdomtree_savetostring(Lib3MF_CustomDOMTree pCustomDOMTree, const Lib3MF_uint32 nXMLStringBufferSize, Lib3MF_uint32* pXMLStringNeededChars, char * pXMLStringBuffer); + +/************************************************************************************************************************* + Class definition for SliceStackIterator +**************************************************************************************************************************/ /** -* Sets a build object's uuid string (see production extension specification) +* Returns the SliceStack the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] pUUID - new object uuid string. +* @param[in] pSliceStackIterator - SliceStackIterator instance. +* @param[out] pResource - returns the SliceStack instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setuuid(Lib3MF_Object pObject, const char * pUUID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slicestackiterator_getcurrentslicestack(Lib3MF_SliceStackIterator pSliceStackIterator, Lib3MF_SliceStack * pResource); + +/************************************************************************************************************************* + Class definition for ObjectIterator +**************************************************************************************************************************/ /** -* Returns the metadatagroup of this object +* Returns the Object the iterator points at. * -* @param[in] pObject - Object instance. -* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this object +* @param[in] pObjectIterator - ObjectIterator instance. +* @param[out] pResource - returns the Object instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getmetadatagroup(Lib3MF_Object pObject, Lib3MF_MetaDataGroup * pMetaDataGroup); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_objectiterator_getcurrentobject(Lib3MF_ObjectIterator pObjectIterator, Lib3MF_Object * pResource); + +/************************************************************************************************************************* + Class definition for MeshObjectIterator +**************************************************************************************************************************/ /** -* set the meshresolution of the mesh object +* Returns the MeshObject the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] eMeshResolution - meshresolution of this object +* @param[in] pMeshObjectIterator - MeshObjectIterator instance. +* @param[out] pResource - returns the MeshObject instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setslicesmeshresolution(Lib3MF_Object pObject, Lib3MF::eSlicesMeshResolution eMeshResolution); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobjectiterator_getcurrentmeshobject(Lib3MF_MeshObjectIterator pMeshObjectIterator, Lib3MF_MeshObject * pResource); + +/************************************************************************************************************************* + Class definition for ComponentsObjectIterator +**************************************************************************************************************************/ /** -* get the meshresolution of the mesh object +* Returns the ComponentsObject the iterator points at. * -* @param[in] pObject - Object instance. -* @param[out] pMeshResolution - meshresolution of this object +* @param[in] pComponentsObjectIterator - ComponentsObjectIterator instance. +* @param[out] pResource - returns the ComponentsObject instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getslicesmeshresolution(Lib3MF_Object pObject, Lib3MF::eSlicesMeshResolution * pMeshResolution); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobjectiterator_getcurrentcomponentsobject(Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource); + +/************************************************************************************************************************* + Class definition for Texture2DIterator +**************************************************************************************************************************/ /** -* returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack +* Returns the Texture2D the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] bRecursive - check also all referenced objects? -* @param[out] pHasSlices - does the object have a slice stack? +* @param[in] pTexture2DIterator - Texture2DIterator instance. +* @param[out] pResource - returns the Texture2D instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_hasslices(Lib3MF_Object pObject, bool bRecursive, bool * pHasSlices); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2diterator_getcurrenttexture2d(Lib3MF_Texture2DIterator pTexture2DIterator, Lib3MF_Texture2D * pResource); + +/************************************************************************************************************************* + Class definition for BaseMaterialGroupIterator +**************************************************************************************************************************/ /** -* unlinks the attached slicestack from this object. If no slice stack is attached, do noting. +* Returns the MaterialGroup the iterator points at. * -* @param[in] pObject - Object instance. +* @param[in] pBaseMaterialGroupIterator - BaseMaterialGroupIterator instance. +* @param[out] pResource - returns the BaseMaterialGroup instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_clearslicestack(Lib3MF_Object pObject); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup(Lib3MF_BaseMaterialGroupIterator pBaseMaterialGroupIterator, Lib3MF_BaseMaterialGroup * pResource); + +/************************************************************************************************************************* + Class definition for ColorGroupIterator +**************************************************************************************************************************/ /** -* get the Slicestack attached to the object +* Returns the ColorGroup the iterator points at. * -* @param[in] pObject - Object instance. -* @param[out] pSliceStackInstance - returns the slicestack instance +* @param[in] pColorGroupIterator - ColorGroupIterator instance. +* @param[out] pResource - returns the ColorGroup instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getslicestack(Lib3MF_Object pObject, Lib3MF_SliceStack * pSliceStackInstance); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroupiterator_getcurrentcolorgroup(Lib3MF_ColorGroupIterator pColorGroupIterator, Lib3MF_ColorGroup * pResource); + +/************************************************************************************************************************* + Class definition for Texture2DGroupIterator +**************************************************************************************************************************/ /** -* assigns a slicestack to the object +* Returns the Texture2DGroup the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] pSliceStackInstance - the new slice stack of this Object +* @param[in] pTexture2DGroupIterator - Texture2DGroupIterator instance. +* @param[out] pResource - returns the Texture2DGroup instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_assignslicestack(Lib3MF_Object pObject, Lib3MF_SliceStack pSliceStackInstance); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup(Lib3MF_Texture2DGroupIterator pTexture2DGroupIterator, Lib3MF_Texture2DGroup * pResource); /************************************************************************************************************************* - Class definition for MeshObject + Class definition for CompositeMaterialsIterator **************************************************************************************************************************/ /** -* Returns the vertex count of a mesh object. +* Returns the CompositeMaterials the iterator points at. * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pVertexCount - filled with the vertex count. +* @param[in] pCompositeMaterialsIterator - CompositeMaterialsIterator instance. +* @param[out] pResource - returns the CompositeMaterials instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getvertexcount(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerialsiterator_getcurrentcompositematerials(Lib3MF_CompositeMaterialsIterator pCompositeMaterialsIterator, Lib3MF_CompositeMaterials * pResource); + +/************************************************************************************************************************* + Class definition for MultiPropertyGroupIterator +**************************************************************************************************************************/ /** -* Returns the triangle count of a mesh object. +* Returns the MultiPropertyGroup the iterator points at. * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pVertexCount - filled with the triangle count. +* @param[in] pMultiPropertyGroupIterator - MultiPropertyGroupIterator instance. +* @param[out] pResource - returns the MultiPropertyGroup instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettrianglecount(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup(Lib3MF_MultiPropertyGroupIterator pMultiPropertyGroupIterator, Lib3MF_MultiPropertyGroup * pResource); + +/************************************************************************************************************************* + Class definition for MetaData +**************************************************************************************************************************/ /** -* Returns the vertex count of a mesh object. +* returns the namespace URL of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) -* @param[out] pCoordinates - filled with the vertex coordinates. +* @param[in] pMetaData - MetaData instance. +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of the namespace URL of the metadata, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getvertex(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, Lib3MF::sPosition * pCoordinates); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getnamespace(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* Sets the coordinates of a single vertex of a mesh object +* sets a new namespace URL of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) -* @param[in] pCoordinates - contains the vertex coordinates. +* @param[in] pMetaData - MetaData instance. +* @param[in] pNameSpace - the new namespace URL of the metadata * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_setvertex(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const Lib3MF::sPosition * pCoordinates); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_setnamespace(Lib3MF_MetaData pMetaData, const char * pNameSpace); /** -* Adds a single vertex to a mesh object +* returns the name of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] pCoordinates - contains the vertex coordinates. -* @param[out] pNewIndex - Index of the new vertex +* @param[in] pMetaData - MetaData instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of the name of the metadata, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_addvertex(Lib3MF_MeshObject pMeshObject, const Lib3MF::sPosition * pCoordinates, Lib3MF_uint32 * pNewIndex); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getname(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Obtains all vertex positions of a mesh object +* sets a new name of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pVerticesBuffer - Position buffer of contains the vertex coordinates. +* @param[in] pMetaData - MetaData instance. +* @param[in] pName - the new name of the metadata * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getvertices(Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, Lib3MF::sPosition * pVerticesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_setname(Lib3MF_MetaData pMetaData, const char * pName); /** -* Returns indices of a single triangle of a mesh object. +* returns the (namespace+name) of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[out] pIndices - filled with the triangle indices. +* @param[in] pMetaData - MetaData instance. +* @param[in] nKeyBufferSize - size of the buffer (including trailing 0) +* @param[out] pKeyNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pKeyBuffer - buffer of the key (namespace+name) of the metadata, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettriangle(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, Lib3MF::sTriangle * pIndices); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getkey(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nKeyBufferSize, Lib3MF_uint32* pKeyNeededChars, char * pKeyBuffer); /** -* Sets the indices of a single triangle of a mesh object. +* returns, whether a metadata must be preserved * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[in] pIndices - contains the triangle indices. +* @param[in] pMetaData - MetaData instance. +* @param[out] pMustPreserve - returns, whether a metadata must be preserved * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_settriangle(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const Lib3MF::sTriangle * pIndices); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getmustpreserve(Lib3MF_MetaData pMetaData, bool * pMustPreserve); /** -* Adds a single triangle to a mesh object +* sets whether a metadata must be preserved * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] pIndices - contains the triangle indices. -* @param[out] pNewIndex - Index of the new triangle +* @param[in] pMetaData - MetaData instance. +* @param[in] bMustPreserve - a new value whether a metadata must be preserved * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_addtriangle(Lib3MF_MeshObject pMeshObject, const Lib3MF::sTriangle * pIndices, Lib3MF_uint32 * pNewIndex); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_setmustpreserve(Lib3MF_MetaData pMetaData, bool bMustPreserve); /** -* Get all triangles of a mesh object +* returns the type of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @param[in] pMetaData - MetaData instance. +* @param[in] nTypeBufferSize - size of the buffer (including trailing 0) +* @param[out] pTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pTypeBuffer - buffer of the type of the metadata, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettriangleindices(Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF::sTriangle * pIndicesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_gettype(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nTypeBufferSize, Lib3MF_uint32* pTypeNeededChars, char * pTypeBuffer); /** -* Sets the property at the object-level of the mesh object. +* sets a new type of a metadata. This must be a simple XML type * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nUniqueResourceID - the object-level Property UniqueResourceID. -* @param[in] nPropertyID - the object-level PropertyID. +* @param[in] pMetaData - MetaData instance. +* @param[in] pType - a new type of the metadata * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_setobjectlevelproperty(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nUniqueResourceID, Lib3MF_uint32 nPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_settype(Lib3MF_MetaData pMetaData, const char * pType); /** -* Gets the property at the object-level of the mesh object. +* returns the value of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pUniqueResourceID - the object-level Property UniqueResourceID. -* @param[out] pPropertyID - the object-level PropertyID. -* @param[out] pHasObjectLevelProperty - Has an object-level property been specified? +* @param[in] pMetaData - MetaData instance. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of the value of the metadata, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getobjectlevelproperty(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pUniqueResourceID, Lib3MF_uint32 * pPropertyID, bool * pHasObjectLevelProperty); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getvalue(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* Sets the properties of a single triangle of a mesh object. +* sets a new value of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[in] pProperties - contains the triangle properties. +* @param[in] pMetaData - MetaData instance. +* @param[in] pValue - a new value of the metadata * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_settriangleproperties(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const Lib3MF::sTriangleProperties * pProperties); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_setvalue(Lib3MF_MetaData pMetaData, const char * pValue); -/** -* Gets the properties of a single triangle of a mesh object. -* -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[out] pProperty - returns the triangle properties. -* @return error code or 0 (success) -*/ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettriangleproperties(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, Lib3MF::sTriangleProperties * pProperty); +/************************************************************************************************************************* + Class definition for MetaDataGroup +**************************************************************************************************************************/ /** -* Sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. +* returns the number of metadata in this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer -* @param[in] pPropertiesArrayBuffer - TriangleProperties buffer of contains the triangle properties array. Must have trianglecount elements. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[out] pCount - returns the number metadata * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_setalltriangleproperties(Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nPropertiesArrayBufferSize, const Lib3MF::sTriangleProperties * pPropertiesArrayBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_getmetadatacount(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 * pCount); /** -* Gets the properties of all triangles of a mesh object. +* returns a metadata value within this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer -* @param[out] pPropertiesArrayNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertiesArrayBuffer - TriangleProperties buffer of returns the triangle properties array. Must have trianglecount elements. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] nIndex - Index of the Metadata. +* @param[out] pMetaData - an instance of the metadata * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getalltriangleproperties(Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nPropertiesArrayBufferSize, Lib3MF_uint64* pPropertiesArrayNeededCount, Lib3MF::sTriangleProperties * pPropertiesArrayBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_getmetadata(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex, Lib3MF_MetaData * pMetaData); /** -* Clears all properties of this mesh object (triangle and object-level). +* returns a metadata value within this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] pNameSpace - the namespace of the metadata +* @param[in] pName - the name of the Metadata +* @param[out] pMetaData - an instance of the metadata * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_clearallproperties(Lib3MF_MeshObject pMeshObject); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_getmetadatabykey(Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, Lib3MF_MetaData * pMetaData); /** -* Set all triangles of a mesh object +* removes metadata by index from the model. * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[in] pVerticesBuffer - Position buffer of contains the positions. -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[in] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] nIndex - Index of the metadata to remove * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_setgeometry(Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nVerticesBufferSize, const Lib3MF::sPosition * pVerticesBuffer, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF::sTriangle * pIndicesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_removemetadatabyindex(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex); /** -* Retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. +* removes metadata from the model. * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pIsManifoldAndOriented - returns, if the object is oriented and manifold. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] pTheMetaData - The metadata to remove * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_ismanifoldandoriented(Lib3MF_MeshObject pMeshObject, bool * pIsManifoldAndOriented); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_removemetadata(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_MetaData pTheMetaData); /** -* Retrieves the BeamLattice within this MeshObject. +* adds a new metadata to this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pTheBeamLattice - the BeamLattice within this MeshObject +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] pNameSpace - the namespace of the metadata +* @param[in] pName - the name of the metadata +* @param[in] pValue - the value of the metadata +* @param[in] pType - the type of the metadata +* @param[in] bMustPreserve - shuold the metadata be preserved +* @param[out] pMetaData - a new instance of the metadata * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_beamlattice(Lib3MF_MeshObject pMeshObject, Lib3MF_BeamLattice * pTheBeamLattice); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_addmetadata(Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, const char * pValue, const char * pType, bool bMustPreserve, Lib3MF_MetaData * pMetaData); /************************************************************************************************************************* - Class definition for BeamLattice + Class definition for Object **************************************************************************************************************************/ /** -* Returns the minimal length of beams for the beamlattice. +* Retrieves an object's type * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pMinLength - minimal length of beams for the beamlattice +* @param[in] pObject - Object instance. +* @param[out] pObjectType - returns object type enum. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getminlength(Lib3MF_BeamLattice pBeamLattice, Lib3MF_double * pMinLength); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_gettype(Lib3MF_Object pObject, Lib3MF::eObjectType * pObjectType); /** -* Sets the minimal length of beams for the beamlattice. +* Sets an object's type * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] dMinLength - minimal length of beams for the beamlattice +* @param[in] pObject - Object instance. +* @param[in] eObjectType - object type enum. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setminlength(Lib3MF_BeamLattice pBeamLattice, Lib3MF_double dMinLength); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_settype(Lib3MF_Object pObject, Lib3MF::eObjectType eObjectType); /** -* Returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* Retrieves an object's name * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pClipMode - contains the clip mode of this mesh -* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object or an undefined value if pClipMode is MODELBEAMLATTICECLIPMODE_NONE +* @param[in] pObject - Object instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns object name., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getclipping(Lib3MF_BeamLattice pBeamLattice, Lib3MF::eBeamLatticeClipMode * pClipMode, Lib3MF_uint32 * pUniqueResourceID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getname(Lib3MF_Object pObject, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* Sets an object's name string * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] eClipMode - contains the clip mode of this mesh -* @param[in] nUniqueResourceID - the UniqueResourceID of the clipping mesh-object. This mesh-object has to be defined before setting the Clipping. +* @param[in] pObject - Object instance. +* @param[in] pName - new object name. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setclipping(Lib3MF_BeamLattice pBeamLattice, Lib3MF::eBeamLatticeClipMode eClipMode, Lib3MF_uint32 nUniqueResourceID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setname(Lib3MF_Object pObject, const char * pName); /** -* Returns the representation-mesh for the beamlattice of this mesh. +* Retrieves an object's part number * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pHasRepresentation - flag whether the beamlattice has a representation mesh. -* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object. +* @param[in] pObject - Object instance. +* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartNumberBuffer - buffer of returns object part number., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getrepresentation(Lib3MF_BeamLattice pBeamLattice, bool * pHasRepresentation, Lib3MF_uint32 * pUniqueResourceID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getpartnumber(Lib3MF_Object pObject, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); /** -* Sets the representation-mesh for the beamlattice of this mesh. +* Sets an objects partnumber string * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nUniqueResourceID - the UniqueResourceID of the representation mesh-object. This mesh-object has to be defined before setting the representation. +* @param[in] pObject - Object instance. +* @param[in] pPartNumber - new object part number. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setrepresentation(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nUniqueResourceID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setpartnumber(Lib3MF_Object pObject, const char * pPartNumber); /** -* Returns the ball mode and the default ball radius for the beamlattice of this mesh. +* Retrieves, if an object is a mesh object * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pBallMode - contains the ball mode of this mesh -* @param[out] pBallRadius - default ball radius of balls for the beamlattice +* @param[in] pObject - Object instance. +* @param[out] pIsMeshObject - returns, whether the object is a mesh object * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getballoptions(Lib3MF_BeamLattice pBeamLattice, Lib3MF::eBeamLatticeBallMode * pBallMode, Lib3MF_double * pBallRadius); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_ismeshobject(Lib3MF_Object pObject, bool * pIsMeshObject); /** -* Sets the ball mode and thedefault ball radius for the beamlattice. +* Retrieves, if an object is a components object * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] eBallMode - contains the ball mode of this mesh -* @param[in] dBallRadius - default ball radius of balls for the beamlattice +* @param[in] pObject - Object instance. +* @param[out] pIsComponentsObject - returns, whether the object is a components object * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setballoptions(Lib3MF_BeamLattice pBeamLattice, Lib3MF::eBeamLatticeBallMode eBallMode, Lib3MF_double dBallRadius); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_iscomponentsobject(Lib3MF_Object pObject, bool * pIsComponentsObject); /** -* Returns the beam count of a mesh object. +* Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pCount - filled with the beam count. +* @param[in] pObject - Object instance. +* @param[out] pIsValid - returns whether the object is a valid object description * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeamcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_isvalid(Lib3MF_Object pObject, bool * pIsValid); /** -* Returns indices, radii and capmodes of a single beam of a mesh object. +* Use an existing attachment as thumbnail for this object * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the beam (0 to beamcount - 1). -* @param[out] pBeamInfo - filled with the beam indices, radii and capmodes. +* @param[in] pObject - Object instance. +* @param[in] pAttachment - Instance of a new or the existing thumbnailattachment object. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeam(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF::sBeam * pBeamInfo); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setattachmentasthumbnail(Lib3MF_Object pObject, Lib3MF_Attachment pAttachment); /** -* Adds a single beam to a mesh object. +* Get the attachment containing the object thumbnail. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] pBeamInfo - contains the node indices, radii and capmodes. -* @param[out] pIndex - filled with the new Index of the beam. +* @param[in] pObject - Object instance. +* @param[out] pAttachment - Instance of the thumbnailattachment object or NULL. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_addbeam(Lib3MF_BeamLattice pBeamLattice, const Lib3MF::sBeam * pBeamInfo, Lib3MF_uint32 * pIndex); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getthumbnailattachment(Lib3MF_Object pObject, Lib3MF_Attachment * pAttachment); /** -* Sets the indices, radii and capmodes of a single beam of a mesh object. +* Clears the attachment. The attachment instance is not removed from the package. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the beam (0 to beamcount - 1). -* @param[in] pBeamInfo - filled with the beam indices, radii and capmodes. +* @param[in] pObject - Object instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setbeam(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const Lib3MF::sBeam * pBeamInfo); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_clearthumbnailattachment(Lib3MF_Object pObject); /** -* Sets all beam indices, radii and capmodes of a mesh object. +* Returns the outbox of a build item * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBeamInfoBufferSize - Number of elements in buffer -* @param[in] pBeamInfoBuffer - Beam buffer of contains information of a number of beams +* @param[in] pObject - Object instance. +* @param[out] pOutbox - Outbox of this build item * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setbeams(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBeamInfoBufferSize, const Lib3MF::sBeam * pBeamInfoBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getoutbox(Lib3MF_Object pObject, Lib3MF::sBox * pOutbox); + +/** +* Retrieves an object's uuid string (see production extension specification) +* +* @param[in] pObject - Object instance. +* @param[out] pHasUUID - flag whether the build item has a UUID +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of returns object uuid., may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getuuid(Lib3MF_Object pObject, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); + +/** +* Sets a build object's uuid string (see production extension specification) +* +* @param[in] pObject - Object instance. +* @param[in] pUUID - new object uuid string. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setuuid(Lib3MF_Object pObject, const char * pUUID); + +/** +* Returns the metadatagroup of this object +* +* @param[in] pObject - Object instance. +* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getmetadatagroup(Lib3MF_Object pObject, Lib3MF_MetaDataGroup * pMetaDataGroup); + +/** +* set the meshresolution of the mesh object +* +* @param[in] pObject - Object instance. +* @param[in] eMeshResolution - meshresolution of this object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setslicesmeshresolution(Lib3MF_Object pObject, Lib3MF::eSlicesMeshResolution eMeshResolution); + +/** +* get the meshresolution of the mesh object +* +* @param[in] pObject - Object instance. +* @param[out] pMeshResolution - meshresolution of this object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getslicesmeshresolution(Lib3MF_Object pObject, Lib3MF::eSlicesMeshResolution * pMeshResolution); + +/** +* returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack +* +* @param[in] pObject - Object instance. +* @param[in] bRecursive - check also all referenced objects? +* @param[out] pHasSlices - does the object have a slice stack? +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_hasslices(Lib3MF_Object pObject, bool bRecursive, bool * pHasSlices); + +/** +* unlinks the attached slicestack from this object. If no slice stack is attached, do noting. +* +* @param[in] pObject - Object instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_clearslicestack(Lib3MF_Object pObject); + +/** +* get the Slicestack attached to the object +* +* @param[in] pObject - Object instance. +* @param[out] pSliceStackInstance - returns the slicestack instance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getslicestack(Lib3MF_Object pObject, Lib3MF_SliceStack * pSliceStackInstance); + +/** +* assigns a slicestack to the object +* +* @param[in] pObject - Object instance. +* @param[in] pSliceStackInstance - the new slice stack of this Object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_assignslicestack(Lib3MF_Object pObject, Lib3MF_SliceStack pSliceStackInstance); + +/************************************************************************************************************************* + Class definition for MeshObject +**************************************************************************************************************************/ + +/** +* Returns the vertex count of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pVertexCount - filled with the vertex count. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getvertexcount(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); + +/** +* Returns the triangle count of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pVertexCount - filled with the triangle count. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettrianglecount(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); + +/** +* Returns the vertex count of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) +* @param[out] pCoordinates - filled with the vertex coordinates. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getvertex(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, Lib3MF::sPosition * pCoordinates); + +/** +* Sets the coordinates of a single vertex of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) +* @param[in] pCoordinates - contains the vertex coordinates. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_setvertex(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const Lib3MF::sPosition * pCoordinates); + +/** +* Adds a single vertex to a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] pCoordinates - contains the vertex coordinates. +* @param[out] pNewIndex - Index of the new vertex +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_addvertex(Lib3MF_MeshObject pMeshObject, const Lib3MF::sPosition * pCoordinates, Lib3MF_uint32 * pNewIndex); + +/** +* Obtains all vertex positions of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pVerticesBuffer - Position buffer of contains the vertex coordinates. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getvertices(Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, Lib3MF::sPosition * pVerticesBuffer); + +/** +* Returns indices of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[out] pIndices - filled with the triangle indices. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettriangle(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, Lib3MF::sTriangle * pIndices); + +/** +* Sets the indices of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[in] pIndices - contains the triangle indices. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_settriangle(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const Lib3MF::sTriangle * pIndices); + +/** +* Adds a single triangle to a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] pIndices - contains the triangle indices. +* @param[out] pNewIndex - Index of the new triangle +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_addtriangle(Lib3MF_MeshObject pMeshObject, const Lib3MF::sTriangle * pIndices, Lib3MF_uint32 * pNewIndex); + +/** +* Get all triangles of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettriangleindices(Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF::sTriangle * pIndicesBuffer); + +/** +* Sets the property at the object-level of the mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nUniqueResourceID - the object-level Property UniqueResourceID. +* @param[in] nPropertyID - the object-level PropertyID. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_setobjectlevelproperty(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nUniqueResourceID, Lib3MF_uint32 nPropertyID); + +/** +* Gets the property at the object-level of the mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pUniqueResourceID - the object-level Property UniqueResourceID. +* @param[out] pPropertyID - the object-level PropertyID. +* @param[out] pHasObjectLevelProperty - Has an object-level property been specified? +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getobjectlevelproperty(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pUniqueResourceID, Lib3MF_uint32 * pPropertyID, bool * pHasObjectLevelProperty); + +/** +* Sets the properties of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[in] pProperties - contains the triangle properties. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_settriangleproperties(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const Lib3MF::sTriangleProperties * pProperties); + +/** +* Gets the properties of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[out] pProperty - returns the triangle properties. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettriangleproperties(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, Lib3MF::sTriangleProperties * pProperty); + +/** +* Sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer +* @param[in] pPropertiesArrayBuffer - TriangleProperties buffer of contains the triangle properties array. Must have trianglecount elements. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_setalltriangleproperties(Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nPropertiesArrayBufferSize, const Lib3MF::sTriangleProperties * pPropertiesArrayBuffer); + +/** +* Gets the properties of all triangles of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer +* @param[out] pPropertiesArrayNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertiesArrayBuffer - TriangleProperties buffer of returns the triangle properties array. Must have trianglecount elements. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getalltriangleproperties(Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nPropertiesArrayBufferSize, Lib3MF_uint64* pPropertiesArrayNeededCount, Lib3MF::sTriangleProperties * pPropertiesArrayBuffer); + +/** +* Clears all properties of this mesh object (triangle and object-level). +* +* @param[in] pMeshObject - MeshObject instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_clearallproperties(Lib3MF_MeshObject pMeshObject); + +/** +* Set all triangles of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[in] pVerticesBuffer - Position buffer of contains the positions. +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[in] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_setgeometry(Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nVerticesBufferSize, const Lib3MF::sPosition * pVerticesBuffer, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF::sTriangle * pIndicesBuffer); + +/** +* Retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pIsManifoldAndOriented - returns, if the object is oriented and manifold. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_ismanifoldandoriented(Lib3MF_MeshObject pMeshObject, bool * pIsManifoldAndOriented); + +/** +* Retrieves the BeamLattice within this MeshObject. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pTheBeamLattice - the BeamLattice within this MeshObject +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_beamlattice(Lib3MF_MeshObject pMeshObject, Lib3MF_BeamLattice * pTheBeamLattice); + +/************************************************************************************************************************* + Class definition for BeamLattice +**************************************************************************************************************************/ + +/** +* Returns the minimal length of beams for the beamlattice. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pMinLength - minimal length of beams for the beamlattice +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getminlength(Lib3MF_BeamLattice pBeamLattice, Lib3MF_double * pMinLength); + +/** +* Sets the minimal length of beams for the beamlattice. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] dMinLength - minimal length of beams for the beamlattice +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setminlength(Lib3MF_BeamLattice pBeamLattice, Lib3MF_double dMinLength); + +/** +* Returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pClipMode - contains the clip mode of this mesh +* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object or an undefined value if pClipMode is MODELBEAMLATTICECLIPMODE_NONE +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getclipping(Lib3MF_BeamLattice pBeamLattice, Lib3MF::eBeamLatticeClipMode * pClipMode, Lib3MF_uint32 * pUniqueResourceID); + +/** +* Sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] eClipMode - contains the clip mode of this mesh +* @param[in] nUniqueResourceID - the UniqueResourceID of the clipping mesh-object. This mesh-object has to be defined before setting the Clipping. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setclipping(Lib3MF_BeamLattice pBeamLattice, Lib3MF::eBeamLatticeClipMode eClipMode, Lib3MF_uint32 nUniqueResourceID); + +/** +* Returns the representation-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pHasRepresentation - flag whether the beamlattice has a representation mesh. +* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getrepresentation(Lib3MF_BeamLattice pBeamLattice, bool * pHasRepresentation, Lib3MF_uint32 * pUniqueResourceID); + +/** +* Sets the representation-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nUniqueResourceID - the UniqueResourceID of the representation mesh-object. This mesh-object has to be defined before setting the representation. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setrepresentation(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nUniqueResourceID); + +/** +* Returns the ball mode and the default ball radius for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pBallMode - contains the ball mode of this mesh +* @param[out] pBallRadius - default ball radius of balls for the beamlattice +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getballoptions(Lib3MF_BeamLattice pBeamLattice, Lib3MF::eBeamLatticeBallMode * pBallMode, Lib3MF_double * pBallRadius); + +/** +* Sets the ball mode and thedefault ball radius for the beamlattice. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] eBallMode - contains the ball mode of this mesh +* @param[in] dBallRadius - default ball radius of balls for the beamlattice +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setballoptions(Lib3MF_BeamLattice pBeamLattice, Lib3MF::eBeamLatticeBallMode eBallMode, Lib3MF_double dBallRadius); + +/** +* Returns the beam count of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pCount - filled with the beam count. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeamcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); + +/** +* Returns indices, radii and capmodes of a single beam of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the beam (0 to beamcount - 1). +* @param[out] pBeamInfo - filled with the beam indices, radii and capmodes. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeam(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF::sBeam * pBeamInfo); + +/** +* Adds a single beam to a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] pBeamInfo - contains the node indices, radii and capmodes. +* @param[out] pIndex - filled with the new Index of the beam. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_addbeam(Lib3MF_BeamLattice pBeamLattice, const Lib3MF::sBeam * pBeamInfo, Lib3MF_uint32 * pIndex); + +/** +* Sets the indices, radii and capmodes of a single beam of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the beam (0 to beamcount - 1). +* @param[in] pBeamInfo - filled with the beam indices, radii and capmodes. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setbeam(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const Lib3MF::sBeam * pBeamInfo); + +/** +* Sets all beam indices, radii and capmodes of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBeamInfoBufferSize - Number of elements in buffer +* @param[in] pBeamInfoBuffer - Beam buffer of contains information of a number of beams +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setbeams(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBeamInfoBufferSize, const Lib3MF::sBeam * pBeamInfoBuffer); + +/** +* obtains all beam indices, radii and capmodes of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBeamInfoBufferSize - Number of elements in buffer +* @param[out] pBeamInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBeamInfoBuffer - Beam buffer of contains information of all beams +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeams(Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBeamInfoBufferSize, Lib3MF_uint64* pBeamInfoNeededCount, Lib3MF::sBeam * pBeamInfoBuffer); + +/** +* Returns the ball count of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pCount - filled with the ball count. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getballcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); + +/** +* Returns index and radius of a single ball of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the ball (0 to ballcount - 1). +* @param[out] pBallInfo - filled with the ball node index and radius. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getball(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF::sBall * pBallInfo); + +/** +* Adds a single ball to a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] pBallInfo - contains the node index and radius. +* @param[out] pIndex - filled with the new Index of the ball. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_addball(Lib3MF_BeamLattice pBeamLattice, const Lib3MF::sBall * pBallInfo, Lib3MF_uint32 * pIndex); + +/** +* Sets the index and radius of a single ball of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the ball (0 to ballcount - 1). +* @param[in] pBallInfo - filled with the ball node index and radius. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setball(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const Lib3MF::sBall * pBallInfo); + +/** +* Sets all ball indices and radii of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBallInfoBufferSize - Number of elements in buffer +* @param[in] pBallInfoBuffer - Ball buffer of contains information of a number of balls +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setballs(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBallInfoBufferSize, const Lib3MF::sBall * pBallInfoBuffer); + +/** +* obtains all ball indices and radii of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBallInfoBufferSize - Number of elements in buffer +* @param[out] pBallInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBallInfoBuffer - Ball buffer of contains information of all balls +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getballs(Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBallInfoBufferSize, Lib3MF_uint64* pBallInfoNeededCount, Lib3MF::sBall * pBallInfoBuffer); + +/** +* Returns the number of beamsets of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pCount - filled with the beamset count. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeamsetcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); + +/** +* Adds an empty beamset to a mesh object +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pBeamSet - the new beamset +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_addbeamset(Lib3MF_BeamLattice pBeamLattice, Lib3MF_BeamSet * pBeamSet); + +/** +* Returns a beamset of a mesh object +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - index of the requested beamset (0 ... beamsetcount-1). +* @param[out] pBeamSet - the requested beamset +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeamset(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF_BeamSet * pBeamSet); + +/************************************************************************************************************************* + Class definition for Component +**************************************************************************************************************************/ + +/** +* Returns the Resource Instance of the component. +* +* @param[in] pComponent - Component instance. +* @param[out] pObjectResource - filled with the Resource Instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_getobjectresource(Lib3MF_Component pComponent, Lib3MF_Object * pObjectResource); + +/** +* Returns the UniqueResourceID of the component. +* +* @param[in] pComponent - Component instance. +* @param[out] pUniqueResourceID - returns the UniqueResourceID. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_getobjectresourceid(Lib3MF_Component pComponent, Lib3MF_uint32 * pUniqueResourceID); + +/** +* returns, whether a component has a UUID and, if true, the component's UUID +* +* @param[in] pComponent - Component instance. +* @param[out] pHasUUID - flag whether the component has a UUID +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_getuuid(Lib3MF_Component pComponent, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); + +/** +* sets the component's UUID +* +* @param[in] pComponent - Component instance. +* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_setuuid(Lib3MF_Component pComponent, const char * pUUID); + +/** +* Returns, if the component has a different transformation than the identity matrix +* +* @param[in] pComponent - Component instance. +* @param[out] pHasTransform - if true is returned, the transformation is not equal than the identity +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_hastransform(Lib3MF_Component pComponent, bool * pHasTransform); + +/** +* Returns the transformation matrix of the component. +* +* @param[in] pComponent - Component instance. +* @param[out] pTransform - filled with the component transformation matrix +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_gettransform(Lib3MF_Component pComponent, Lib3MF::sTransform * pTransform); + +/** +* Sets the transformation matrix of the component. +* +* @param[in] pComponent - Component instance. +* @param[in] pTransform - new transformation matrix +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_settransform(Lib3MF_Component pComponent, const Lib3MF::sTransform * pTransform); + +/************************************************************************************************************************* + Class definition for ComponentsObject +**************************************************************************************************************************/ + +/** +* Adds a new component to a components object. +* +* @param[in] pComponentsObject - ComponentsObject instance. +* @param[in] pObjectResource - object to add as component. Must not lead to circular references! +* @param[in] pTransform - optional transform matrix for the component. +* @param[out] pComponentInstance - new component instance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobject_addcomponent(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_Object pObjectResource, const Lib3MF::sTransform * pTransform, Lib3MF_Component * pComponentInstance); + +/** +* Retrieves a component from a component object. +* +* @param[in] pComponentsObject - ComponentsObject instance. +* @param[in] nIndex - index of the component to retrieve (0 to componentcount - 1) +* @param[out] pComponentInstance - component instance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobject_getcomponent(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 nIndex, Lib3MF_Component * pComponentInstance); + +/** +* Retrieves a component count of a component object. +* +* @param[in] pComponentsObject - ComponentsObject instance. +* @param[out] pCount - returns the component count +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobject_getcomponentcount(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 * pCount); + +/************************************************************************************************************************* + Class definition for BeamSet +**************************************************************************************************************************/ + +/** +* Sets a beamset's name string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] pName - new name of the beamset. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_setname(Lib3MF_BeamSet pBeamSet, const char * pName); + +/** +* Retrieves a beamset's name string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the beamset., may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getname(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); + +/** +* Sets a beamset's identifier string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] pIdentifier - new name of the beamset. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_setidentifier(Lib3MF_BeamSet pBeamSet, const char * pIdentifier); + +/** +* Retrieves a beamset's identifier string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nIdentifierBufferSize - size of the buffer (including trailing 0) +* @param[out] pIdentifierNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pIdentifierBuffer - buffer of returns the identifier of the beamset., may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getidentifier(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer); + +/** +* Retrieves the reference count of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[out] pCount - returns the reference count +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getreferencecount(Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); + +/** +* Sets the references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nReferencesBufferSize - Number of elements in buffer +* @param[in] pReferencesBuffer - uint32 buffer of the new indices of all beams in this beamset +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_setreferences(Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nReferencesBufferSize, const Lib3MF_uint32 * pReferencesBuffer); + +/** +* Retrieves the references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nReferencesBufferSize - Number of elements in buffer +* @param[out] pReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pReferencesBuffer - uint32 buffer of retrieves the indices of all beams in this beamset +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getreferences(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nReferencesBufferSize, Lib3MF_uint64* pReferencesNeededCount, Lib3MF_uint32 * pReferencesBuffer); + +/** +* Retrieves the ball reference count of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[out] pCount - returns the ball reference count +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getballreferencecount(Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); + +/** +* Sets the ball references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nBallReferencesBufferSize - Number of elements in buffer +* @param[in] pBallReferencesBuffer - uint32 buffer of the new indices of all balls in this beamset +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_setballreferences(Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nBallReferencesBufferSize, const Lib3MF_uint32 * pBallReferencesBuffer); + +/** +* Retrieves the ball references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nBallReferencesBufferSize - Number of elements in buffer +* @param[out] pBallReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBallReferencesBuffer - uint32 buffer of retrieves the indices of all balls in this beamset +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getballreferences(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nBallReferencesBufferSize, Lib3MF_uint64* pBallReferencesNeededCount, Lib3MF_uint32 * pBallReferencesBuffer); + +/************************************************************************************************************************* + Class definition for BaseMaterialGroup +**************************************************************************************************************************/ + +/** +* Retrieves the count of base materials in the material group. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[out] pCount - returns the count of base materials. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_getcount(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all materials in this group +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the material in the material group. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_getallpropertyids(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Adds a new material to the material group +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] pName - new name of the base material. +* @param[in] pDisplayColor - Display color of the material +* @param[out] pPropertyID - returns new PropertyID of the new material in the material group. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_addmaterial(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const char * pName, const Lib3MF::sColor * pDisplayColor, Lib3MF_uint32 * pPropertyID); + +/** +* Removes a material from the material group. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_removematerial(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID); + +/** +* Returns the base material's name +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the base material., may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_getname(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); + +/** +* Sets a base material's name +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] pName - new name of the base material. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_setname(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const char * pName); + +/** +* Sets a base material's display color. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] pTheColor - The base material's display color +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_setdisplaycolor(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF::sColor * pTheColor); + +/** +* Returns a base material's display color. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[out] pTheColor - The base material's display color +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_getdisplaycolor(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, Lib3MF::sColor * pTheColor); + +/************************************************************************************************************************* + Class definition for ColorGroup +**************************************************************************************************************************/ + +/** +* Retrieves the count of base materials in this Color Group. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[out] pCount - returns the count of colors within this color group. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_getcount(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all colors within this group +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the color in the color group. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_getallpropertyids(Lib3MF_ColorGroup pColorGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Adds a new value. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] pTheColor - The new color +* @param[out] pPropertyID - PropertyID of the new color within this color group. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_addcolor(Lib3MF_ColorGroup pColorGroup, const Lib3MF::sColor * pTheColor, Lib3MF_uint32 * pPropertyID); + +/** +* Removes a color from the color group. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyID - PropertyID of the color to be removed from the color group. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_removecolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID); + +/** +* Sets a color value. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyID - PropertyID of a color within this color group. +* @param[in] pTheColor - The color +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_setcolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, const Lib3MF::sColor * pTheColor); + +/** +* Sets a color value. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyID - PropertyID of a color within this color group. +* @param[out] pTheColor - The color +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_getcolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, Lib3MF::sColor * pTheColor); + +/************************************************************************************************************************* + Class definition for Texture2DGroup +**************************************************************************************************************************/ + +/** +* Retrieves the count of tex2coords in the Texture2DGroup. +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[out] pCount - returns the count of tex2coords. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_getcount(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all tex2coords in this Texture2DGroup +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the tex2coords in the Texture2DGroup. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_getallpropertyids(Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Adds a new tex2coord to the Texture2DGroup +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. +* @param[out] pPropertyID - returns new PropertyID of the new tex2coord in the Texture2DGroup. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_addtex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF::sTex2Coord * pUVCoordinate, Lib3MF_uint32 * pPropertyID); + +/** +* Obtains a tex2coord to the Texture2DGroup +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] nPropertyID - the PropertyID of the tex2coord in the Texture2DGroup. +* @param[out] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_gettex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID, Lib3MF::sTex2Coord * pUVCoordinate); + +/** +* Removes a tex2coords from the Texture2DGroup. +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] nPropertyID - PropertyID of the tex2coords in the Texture2DGroup. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_removetex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID); + +/** +* Obtains the texture2D instance of this group. +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[out] pTexture2DInstance - the texture2D instance of this group. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_gettexture2d(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_Texture2D * pTexture2DInstance); + +/************************************************************************************************************************* + Class definition for CompositeMaterials +**************************************************************************************************************************/ + +/** +* Retrieves the count of Composite-s in the CompositeMaterials. +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[out] pCount - returns the count of Composite-s +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_getcount(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the Composite-Mixing Values in the CompositeMaterials. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_getallpropertyids(Lib3MF_CompositeMaterials pCompositeMaterials, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Obtains the BaseMaterialGroup instance of this CompositeMaterials. +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[out] pBaseMaterialGroupInstance - returns the BaseMaterialGroup instance of this CompositeMaterials +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_getbasematerialgroup(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance); + +/** +* Adds a new Composite-Mixing Values to the CompositeMaterials. +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nCompositeBufferSize - Number of elements in buffer +* @param[in] pCompositeBuffer - CompositeConstituent buffer of The Composite Constituents to be added as composite +* @param[out] pPropertyID - returns new PropertyID of the new Composite in the CompositeMaterials. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_addcomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint64 nCompositeBufferSize, const Lib3MF::sCompositeConstituent * pCompositeBuffer, Lib3MF_uint32 * pPropertyID); /** -* obtains all beam indices, radii and capmodes of a mesh object. +* Removes a Composite-Maxing Ratio from the CompositeMaterials. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBeamInfoBufferSize - Number of elements in buffer -* @param[out] pBeamInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBeamInfoBuffer - Beam buffer of contains information of all beams +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nPropertyID - PropertyID of the Composite-Mixing Values in the CompositeMaterials to be removed. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeams(Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBeamInfoBufferSize, Lib3MF_uint64* pBeamInfoNeededCount, Lib3MF::sBeam * pBeamInfoBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_removecomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID); /** -* Returns the ball count of a mesh object. +* Obtains a Composite-Maxing Ratio of this CompositeMaterials. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pCount - filled with the ball count. +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nPropertyID - the PropertyID of the Composite-Maxing Ratio in the CompositeMaterials. +* @param[in] nCompositeBufferSize - Number of elements in buffer +* @param[out] pCompositeNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pCompositeBuffer - CompositeConstituent buffer of The Composite-Mixing Values with the given PropertyID * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getballcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_getcomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nCompositeBufferSize, Lib3MF_uint64* pCompositeNeededCount, Lib3MF::sCompositeConstituent * pCompositeBuffer); + +/************************************************************************************************************************* + Class definition for MultiPropertyGroup +**************************************************************************************************************************/ /** -* Returns index and radius of a single ball of a mesh object. +* Retrieves the count of MultiProperty-s in the MultiPropertyGroup. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the ball (0 to ballcount - 1). -* @param[out] pBallInfo - filled with the ball node index and radius. +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[out] pCount - returns the count of MultiProperty-s * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getball(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF::sBall * pBallInfo); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getcount(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); /** -* Adds a single ball to a mesh object. +* returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] pBallInfo - contains the node index and radius. -* @param[out] pIndex - filled with the new Index of the ball. +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the MultiProperty-s in the MultiPropertyGroup. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_addball(Lib3MF_BeamLattice pBeamLattice, const Lib3MF::sBall * pBallInfo, Lib3MF_uint32 * pIndex); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getallpropertyids(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); /** -* Sets the index and radius of a single ball of a mesh object. +* Adds a new MultiProperty to the MultiPropertyGroup. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the ball (0 to ballcount - 1). -* @param[in] pBallInfo - filled with the ball node index and radius. +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[in] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the new MultiProperty. +* @param[out] pPropertyID - returns the PropertyID of the new MultiProperty in the MultiPropertyGroup. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setball(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const Lib3MF::sBall * pBallInfo); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_addmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer, Lib3MF_uint32 * pPropertyID); /** -* Sets all ball indices and radii of a mesh object. +* Sets the PropertyIDs of a MultiProperty. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBallInfoBufferSize - Number of elements in buffer -* @param[in] pBallInfoBuffer - Ball buffer of contains information of a number of balls +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyID - the PropertyID of the MultiProperty to be changed. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[in] pPropertyIDsBuffer - uint32 buffer of The new PropertyIDs of the MultiProperty * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setballs(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBallInfoBufferSize, const Lib3MF::sBall * pBallInfoBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_setmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer); /** -* obtains all ball indices and radii of a mesh object. +* Obtains the PropertyIDs of a MultiProperty. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBallInfoBufferSize - Number of elements in buffer -* @param[out] pBallInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBallInfoBuffer - Ball buffer of contains information of all balls +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyID - the PropertyID of the MultiProperty to be queried. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the MultiProperty +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Removes a MultiProperty from this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyID - the PropertyID of the MultiProperty to be removed. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_removemultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID); + +/** +* Retrieves the number of layers of this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[out] pCount - returns the number of layers +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getlayercount(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); + +/** +* Adds a MultiPropertyLayer to this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] pTheLayer - The MultiPropertyLayer to add to this MultiPropertyGroup +* @param[out] pLayerIndex - returns the index of this MultiPropertyLayer +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_addlayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF::sMultiPropertyLayer * pTheLayer, Lib3MF_uint32 * pLayerIndex); + +/** +* Obtains a MultiPropertyLayer of this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nLayerIndex - The Index of the MultiPropertyLayer queried +* @param[out] pTheLayer - The MultiPropertyLayer with index LayerIndex within MultiPropertyGroup +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getlayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex, Lib3MF::sMultiPropertyLayer * pTheLayer); + +/** +* Removes a MultiPropertyLayer from this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nLayerIndex - The Index of the MultiPropertyLayer to be removed +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_removelayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex); + +/************************************************************************************************************************* + Class definition for Attachment +**************************************************************************************************************************/ + +/** +* Retrieves an attachment's package path. This function will be removed in a later release. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of returns the attachment's package path string, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_getpath(Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Sets an attachment's package path. This function will be removed in a later release. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pPath - new path of the attachment. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_setpath(Lib3MF_Attachment pAttachment, const char * pPath); + +/** +* Returns the PackagePart that is this attachment. +* +* @param[in] pAttachment - Attachment instance. +* @param[out] pPackagePart - The PackagePart of this attachment. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_packagepart(Lib3MF_Attachment pAttachment, Lib3MF_PackagePart * pPackagePart); + +/** +* Retrieves an attachment's relationship type +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of returns the attachment's package relationship type string, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_getrelationshiptype(Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Sets an attachment's relationship type. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pPath - new relationship type string. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_setrelationshiptype(Lib3MF_Attachment pAttachment, const char * pPath); + +/** +* Writes out the attachment as file. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pFileName - file to write into. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_writetofile(Lib3MF_Attachment pAttachment, const char * pFileName); + +/** +* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pFileName - file to read from. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_readfromfile(Lib3MF_Attachment pAttachment, const char * pFileName); + +/** +* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pTheReadCallback - Callback to call for reading a data chunk +* @param[in] nStreamSize - number of bytes the callback returns +* @param[in] pTheSeekCallback - Callback to call for seeking in the stream. +* @param[in] pUserData - Userdata that is passed to the callback function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_readfromcallback(Lib3MF_Attachment pAttachment, Lib3MF::ReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MF::SeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData); + +/** +* Retrieves the size of the attachment stream +* +* @param[in] pAttachment - Attachment instance. +* @param[out] pStreamSize - the stream size +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_getstreamsize(Lib3MF_Attachment pAttachment, Lib3MF_uint64 * pStreamSize); + +/** +* Writes out the attachment into a buffer +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nBufferBufferSize - Number of elements in buffer +* @param[out] pBufferNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBufferBuffer - uint8 buffer of Buffer to write into +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_writetobuffer(Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer); + +/** +* Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nBufferBufferSize - Number of elements in buffer +* @param[in] pBufferBuffer - uint8 buffer of Buffer to read from +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_readfrombuffer(Lib3MF_Attachment pAttachment, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer); + +/************************************************************************************************************************* + Class definition for Texture2D +**************************************************************************************************************************/ + +/** +* Retrieves the attachment located at the path of the texture. +* +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pAttachment - attachment that holds the texture's image information. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getballs(Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBallInfoBufferSize, Lib3MF_uint64* pBallInfoNeededCount, Lib3MF::sBall * pBallInfoBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_getattachment(Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment * pAttachment); /** -* Returns the number of beamsets of a mesh object. +* Sets the texture's package path to the path of the attachment. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pCount - filled with the beamset count. +* @param[in] pTexture2D - Texture2D instance. +* @param[in] pAttachment - attachment that holds the texture's image information. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeamsetcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_setattachment(Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment pAttachment); /** -* Adds an empty beamset to a mesh object +* Retrieves a texture's content type. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pBeamSet - the new beamset +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pContentType - returns content type enum. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_addbeamset(Lib3MF_BeamLattice pBeamLattice, Lib3MF_BeamSet * pBeamSet); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_getcontenttype(Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureType * pContentType); /** -* Returns a beamset of a mesh object +* Retrieves a texture's content type. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - index of the requested beamset (0 ... beamsetcount-1). -* @param[out] pBeamSet - the requested beamset +* @param[in] pTexture2D - Texture2D instance. +* @param[in] eContentType - new Content Type * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeamset(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF_BeamSet * pBeamSet); - -/************************************************************************************************************************* - Class definition for Component -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_setcontenttype(Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureType eContentType); /** -* Returns the Resource Instance of the component. +* Retrieves a texture's tilestyle type. * -* @param[in] pComponent - Component instance. -* @param[out] pObjectResource - filled with the Resource Instance. +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pTileStyleU - returns tilestyle type enum. +* @param[out] pTileStyleV - returns tilestyle type enum. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_getobjectresource(Lib3MF_Component pComponent, Lib3MF_Object * pObjectResource); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_gettilestyleuv(Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureTileStyle * pTileStyleU, Lib3MF::eTextureTileStyle * pTileStyleV); /** -* Returns the UniqueResourceID of the component. +* Sets a texture's tilestyle type. * -* @param[in] pComponent - Component instance. -* @param[out] pUniqueResourceID - returns the UniqueResourceID. +* @param[in] pTexture2D - Texture2D instance. +* @param[in] eTileStyleU - new tilestyle type enum. +* @param[in] eTileStyleV - new tilestyle type enum. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_getobjectresourceid(Lib3MF_Component pComponent, Lib3MF_uint32 * pUniqueResourceID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_settilestyleuv(Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureTileStyle eTileStyleU, Lib3MF::eTextureTileStyle eTileStyleV); /** -* returns, whether a component has a UUID and, if true, the component's UUID +* Retrieves a texture's filter type. * -* @param[in] pComponent - Component instance. -* @param[out] pHasUUID - flag whether the component has a UUID -* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pFilter - returns filter type enum. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_getuuid(Lib3MF_Component pComponent, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_getfilter(Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureFilter * pFilter); /** -* sets the component's UUID +* Sets a texture's filter type. * -* @param[in] pComponent - Component instance. -* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' +* @param[in] pTexture2D - Texture2D instance. +* @param[in] eFilter - sets new filter type enum. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_setuuid(Lib3MF_Component pComponent, const char * pUUID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_setfilter(Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureFilter eFilter); + +/************************************************************************************************************************* + Class definition for BuildItem +**************************************************************************************************************************/ /** -* Returns, if the component has a different transformation than the identity matrix +* Retrieves the object resource associated to a build item * -* @param[in] pComponent - Component instance. -* @param[out] pHasTransform - if true is returned, the transformation is not equal than the identity +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pObjectResource - returns the associated resource instance * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_hastransform(Lib3MF_Component pComponent, bool * pHasTransform); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getobjectresource(Lib3MF_BuildItem pBuildItem, Lib3MF_Object * pObjectResource); /** -* Returns the transformation matrix of the component. +* returns, whether a build item has a UUID and, if true, the build item's UUID * -* @param[in] pComponent - Component instance. -* @param[out] pTransform - filled with the component transformation matrix +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pHasUUID - flag whether the build item has a UUID +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_gettransform(Lib3MF_Component pComponent, Lib3MF::sTransform * pTransform); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getuuid(Lib3MF_BuildItem pBuildItem, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* Sets the transformation matrix of the component. +* sets the build item's UUID * -* @param[in] pComponent - Component instance. -* @param[in] pTransform - new transformation matrix +* @param[in] pBuildItem - BuildItem instance. +* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_settransform(Lib3MF_Component pComponent, const Lib3MF::sTransform * pTransform); - -/************************************************************************************************************************* - Class definition for ComponentsObject -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_setuuid(Lib3MF_BuildItem pBuildItem, const char * pUUID); /** -* Adds a new component to a components object. +* Retrieves the object UniqueResourceID associated to a build item * -* @param[in] pComponentsObject - ComponentsObject instance. -* @param[in] pObjectResource - object to add as component. Must not lead to circular references! -* @param[in] pTransform - optional transform matrix for the component. -* @param[out] pComponentInstance - new component instance +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pUniqueResourceID - returns the UniqueResourceID of the object * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobject_addcomponent(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_Object pObjectResource, const Lib3MF::sTransform * pTransform, Lib3MF_Component * pComponentInstance); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getobjectresourceid(Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pUniqueResourceID); /** -* Retrieves a component from a component object. +* Checks, if a build item has a non-identity transformation matrix * -* @param[in] pComponentsObject - ComponentsObject instance. -* @param[in] nIndex - index of the component to retrieve (0 to componentcount - 1) -* @param[out] pComponentInstance - component instance +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pHasTransform - returns true, if the transformation matrix is not the identity * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobject_getcomponent(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 nIndex, Lib3MF_Component * pComponentInstance); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_hasobjecttransform(Lib3MF_BuildItem pBuildItem, bool * pHasTransform); /** -* Retrieves a component count of a component object. +* Retrieves a build item's transformation matrix. * -* @param[in] pComponentsObject - ComponentsObject instance. -* @param[out] pCount - returns the component count +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pTransform - returns the transformation matrix * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobject_getcomponentcount(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 * pCount); - -/************************************************************************************************************************* - Class definition for BeamSet -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getobjecttransform(Lib3MF_BuildItem pBuildItem, Lib3MF::sTransform * pTransform); /** -* Sets a beamset's name string +* Sets a build item's transformation matrix. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] pName - new name of the beamset. +* @param[in] pBuildItem - BuildItem instance. +* @param[in] pTransform - new transformation matrix * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_setname(Lib3MF_BeamSet pBeamSet, const char * pName); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_setobjecttransform(Lib3MF_BuildItem pBuildItem, const Lib3MF::sTransform * pTransform); /** -* Retrieves a beamset's name string +* Retrieves a build item's part number string * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of returns the name of the beamset., may be NULL +* @param[in] pBuildItem - BuildItem instance. +* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartNumberBuffer - buffer of Returns a build item's part number string, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getname(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getpartnumber(Lib3MF_BuildItem pBuildItem, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); /** -* Sets a beamset's identifier string +* Sets a build item's part number string * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] pIdentifier - new name of the beamset. +* @param[in] pBuildItem - BuildItem instance. +* @param[in] pSetPartnumber - new part number string for referencing parts from the outside world * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_setidentifier(Lib3MF_BeamSet pBeamSet, const char * pIdentifier); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_setpartnumber(Lib3MF_BuildItem pBuildItem, const char * pSetPartnumber); /** -* Retrieves a beamset's identifier string +* Returns the metadatagroup of this build item * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nIdentifierBufferSize - size of the buffer (including trailing 0) -* @param[out] pIdentifierNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pIdentifierBuffer - buffer of returns the identifier of the beamset., may be NULL +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this build item * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getidentifier(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getmetadatagroup(Lib3MF_BuildItem pBuildItem, Lib3MF_MetaDataGroup * pMetaDataGroup); /** -* Retrieves the reference count of a beamset +* Returns the outbox of a build item * -* @param[in] pBeamSet - BeamSet instance. -* @param[out] pCount - returns the reference count +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pOutbox - Outbox of this build item * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getreferencecount(Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getoutbox(Lib3MF_BuildItem pBuildItem, Lib3MF::sBox * pOutbox); + +/************************************************************************************************************************* + Class definition for BuildItemIterator +**************************************************************************************************************************/ /** -* Sets the references of a beamset +* Iterates to the next build item in the list. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nReferencesBufferSize - Number of elements in buffer -* @param[in] pReferencesBuffer - uint32 buffer of the new indices of all beams in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pHasNext - Iterates to the next build item in the list. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_setreferences(Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nReferencesBufferSize, const Lib3MF_uint32 * pReferencesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_movenext(Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasNext); /** -* Retrieves the references of a beamset +* Iterates to the previous build item in the list. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nReferencesBufferSize - Number of elements in buffer -* @param[out] pReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pReferencesBuffer - uint32 buffer of retrieves the indices of all beams in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pHasPrevious - Iterates to the previous build item in the list. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getreferences(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nReferencesBufferSize, Lib3MF_uint64* pReferencesNeededCount, Lib3MF_uint32 * pReferencesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_moveprevious(Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasPrevious); /** -* Retrieves the ball reference count of a beamset +* Returns the build item the iterator points at. * -* @param[in] pBeamSet - BeamSet instance. -* @param[out] pCount - returns the ball reference count +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pBuildItem - returns the build item instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getballreferencecount(Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_getcurrent(Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItem * pBuildItem); /** -* Sets the ball references of a beamset +* Creates a new build item iterator with the same build item list. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nBallReferencesBufferSize - Number of elements in buffer -* @param[in] pBallReferencesBuffer - uint32 buffer of the new indices of all balls in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pOutBuildItemIterator - returns the cloned Iterator instance * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_setballreferences(Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nBallReferencesBufferSize, const Lib3MF_uint32 * pBallReferencesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_clone(Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItemIterator * pOutBuildItemIterator); /** -* Retrieves the ball references of a beamset +* Returns the number of build items the iterator captures. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nBallReferencesBufferSize - Number of elements in buffer -* @param[out] pBallReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBallReferencesBuffer - uint32 buffer of retrieves the indices of all balls in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pCount - returns the number of build items the iterator captures. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getballreferences(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nBallReferencesBufferSize, Lib3MF_uint64* pBallReferencesNeededCount, Lib3MF_uint32 * pBallReferencesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_count(Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_uint64 * pCount); /************************************************************************************************************************* - Class definition for BaseMaterialGroup + Class definition for Slice **************************************************************************************************************************/ /** -* Retrieves the count of base materials in the material group. +* Set all vertices of a slice. All polygons will be cleared. * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[out] pCount - returns the count of base materials. +* @param[in] pSlice - Slice instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[in] pVerticesBuffer - Position2D buffer of contains the positions. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_getcount(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_setvertices(Lib3MF_Slice pSlice, Lib3MF_uint64 nVerticesBufferSize, const Lib3MF::sPosition2D * pVerticesBuffer); /** -* returns all the PropertyIDs of all materials in this group +* Get all vertices of a slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the material in the material group. +* @param[in] pSlice - Slice instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pVerticesBuffer - Position2D buffer of contains the positions. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getvertices(Lib3MF_Slice pSlice, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, Lib3MF::sPosition2D * pVerticesBuffer); + +/** +* Get the number of vertices in a slice +* +* @param[in] pSlice - Slice instance. +* @param[out] pCount - the number of vertices in the slice * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_getallpropertyids(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getvertexcount(Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); /** -* Adds a new material to the material group +* Add a new polygon to this slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] pName - new name of the base material. -* @param[in] pDisplayColor - Display color of the material -* @param[out] pPropertyID - returns new PropertyID of the new material in the material group. +* @param[in] pSlice - Slice instance. +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the new polygon +* @param[out] pIndex - the index of the new polygon * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_addmaterial(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const char * pName, const Lib3MF::sColor * pDisplayColor, Lib3MF_uint32 * pPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_addpolygon(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer, Lib3MF_uint64 * pIndex); /** -* Removes a material from the material group. +* Get the number of polygons in the slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] pSlice - Slice instance. +* @param[out] pCount - the number of polygons in the slice * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_removematerial(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getpolygoncount(Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); /** -* Returns the base material's name +* Set all indices of a polygon * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of returns the name of the base material., may be NULL +* @param[in] pSlice - Slice instance. +* @param[in] nIndex - the index of the polygon to manipulate +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the index-th polygon * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_getname(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_setpolygonindices(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer); /** -* Sets a base material's name +* Get all vertices of a slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[in] pName - new name of the base material. +* @param[in] pSlice - Slice instance. +* @param[in] nIndex - the index of the polygon to manipulate +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pIndicesBuffer - uint32 buffer of the indices of the index-th polygon * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_setname(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const char * pName); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getpolygonindices(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF_uint32 * pIndicesBuffer); /** -* Sets a base material's display color. +* Get the number of vertices in a slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[in] pTheColor - The base material's display color +* @param[in] pSlice - Slice instance. +* @param[in] nIndex - the index of the polygon to manipulate +* @param[out] pCount - the number of indices of the index-th polygon * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_setdisplaycolor(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF::sColor * pTheColor); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getpolygonindexcount(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 * pCount); /** -* Returns a base material's display color. +* Get the upper Z-Coordinate of this slice. * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[out] pTheColor - The base material's display color +* @param[in] pSlice - Slice instance. +* @param[out] pZTop - the upper Z-Coordinate of this slice * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_getdisplaycolor(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, Lib3MF::sColor * pTheColor); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getztop(Lib3MF_Slice pSlice, Lib3MF_double * pZTop); /************************************************************************************************************************* - Class definition for ColorGroup + Class definition for ToolpathProfile **************************************************************************************************************************/ /** -* Retrieves the count of base materials in this Color Group. +* Retrieves the profile's uuid * -* @param[in] pColorGroup - ColorGroup instance. -* @param[out] pCount - returns the count of colors within this color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_getcount(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getuuid(Lib3MF_ToolpathProfile pToolpathProfile, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* returns all the PropertyIDs of all colors within this group +* Retrieves the profile's name * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the color in the color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of Returns the name., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_getallpropertyids(Lib3MF_ColorGroup pColorGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getname(Lib3MF_ToolpathProfile pToolpathProfile, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Adds a new value. +* Returns the number of parameters. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] pTheColor - The new color -* @param[out] pPropertyID - PropertyID of the new color within this color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[out] pCount - Returns the number of parameters. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_addcolor(Lib3MF_ColorGroup pColorGroup, const Lib3MF::sColor * pTheColor, Lib3MF_uint32 * pPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparametercount(Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 * pCount); /** -* Removes a color from the color group. +* Returns the Name of a parameter. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyID - PropertyID of the color to be removed from the color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nIndex - Index of Parameter (0-based). Call will fail if an invalid index is given. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of Returns the name of the parameter., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_removecolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparametername(Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Sets a color value. +* Returns the NameSpace of a parameter. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyID - PropertyID of a color within this color group. -* @param[in] pTheColor - The color +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nIndex - Index of Parameter (0-based). Call will fail if an invalid index is given. +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of Returns the namespace of the parameter., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_setcolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, const Lib3MF::sColor * pTheColor); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparameternamespace(Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* Sets a color value. +* Checks if a parameter value exists. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyID - PropertyID of a color within this color group. -* @param[out] pTheColor - The color +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValueExists - Returns if a value exists. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_getcolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, Lib3MF::sColor * pTheColor); - -/************************************************************************************************************************* - Class definition for Texture2DGroup -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_hasparametervalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool * pValueExists); /** -* Retrieves the count of tex2coords in the Texture2DGroup. +* Retrieves a profile's parameter value. Fails if value does not exist. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[out] pCount - returns the count of tex2coords. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of Returns the value of the field., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_getcount(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparametervalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* returns all the PropertyIDs of all tex2coords in this Texture2DGroup +* Retrieves a profile's parameter value * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the tex2coords in the Texture2DGroup. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] pDefaultValue - Default value if value does not exist. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of Returns the value of the field., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_getallpropertyids(Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparametervaluedef(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const char * pDefaultValue, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* Adds a new tex2coord to the Texture2DGroup +* Retrieves a profile's parameter value as double. Fails if value does not exist or is not a double value. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. -* @param[out] pPropertyID - returns new PropertyID of the new tex2coord in the Texture2DGroup. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_addtex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF::sTex2Coord * pUVCoordinate, Lib3MF_uint32 * pPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparameterdoublevalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double * pValue); /** -* Obtains a tex2coord to the Texture2DGroup +* Retrieves a profile's parameter value as double. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] nPropertyID - the PropertyID of the tex2coord in the Texture2DGroup. -* @param[out] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] dDefaultValue - Default value if value does not exist or is not a double value. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_gettex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID, Lib3MF::sTex2Coord * pUVCoordinate); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparameterdoublevaluedef(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double dDefaultValue, Lib3MF_double * pValue); /** -* Removes a tex2coords from the Texture2DGroup. +* Retrieves a profile's parameter value as integer. Fails if value does not exist or is not a integer value. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] nPropertyID - PropertyID of the tex2coords in the Texture2DGroup. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_removetex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparameterintegervalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 * pValue); /** -* Obtains the texture2D instance of this group. +* Retrieves a profile's parameter value as integer. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[out] pTexture2DInstance - the texture2D instance of this group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] nDefaultValue - Default value if value does not exist or is not a integer value. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_gettexture2d(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_Texture2D * pTexture2DInstance); - -/************************************************************************************************************************* - Class definition for CompositeMaterials -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparameterintegervaluedef(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 nDefaultValue, Lib3MF_int64 * pValue); /** -* Retrieves the count of Composite-s in the CompositeMaterials. +* Retrieves a profile's parameter value as boolean. Fails if value does not exist or is not a boolean value. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[out] pCount - returns the count of Composite-s +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_getcount(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparameterboolvalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool * pValue); /** -* returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials +* Retrieves a profile's parameter value as boolean. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the Composite-Mixing Values in the CompositeMaterials. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] bDefaultValue - Default value if value does not exist or is not a boolean value. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_getallpropertyids(Lib3MF_CompositeMaterials pCompositeMaterials, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparameterboolvaluedef(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool bDefaultValue, bool * pValue); /** -* Obtains the BaseMaterialGroup instance of this CompositeMaterials. +* Sets the profile's name * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[out] pBaseMaterialGroupInstance - returns the BaseMaterialGroup instance of this CompositeMaterials +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pName - Returns the name. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_getbasematerialgroup(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_setname(Lib3MF_ToolpathProfile pToolpathProfile, const char * pName); /** -* Adds a new Composite-Mixing Values to the CompositeMaterials. +* Sets a profile's parameter value. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nCompositeBufferSize - Number of elements in buffer -* @param[in] pCompositeBuffer - CompositeConstituent buffer of The Composite Constituents to be added as composite -* @param[out] pPropertyID - returns new PropertyID of the new Composite in the CompositeMaterials. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] pValue - String value of the parameter. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_addcomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint64 nCompositeBufferSize, const Lib3MF::sCompositeConstituent * pCompositeBuffer, Lib3MF_uint32 * pPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_setparametervalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const char * pValue); /** -* Removes a Composite-Maxing Ratio from the CompositeMaterials. +* Sets a profile's parameter value as double. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nPropertyID - PropertyID of the Composite-Mixing Values in the CompositeMaterials to be removed. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] dValue - Double value of the parameter. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_removecomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_setparameterdoublevalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double dValue); /** -* Obtains a Composite-Maxing Ratio of this CompositeMaterials. +* Sets a profile's parameter value as integer. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nPropertyID - the PropertyID of the Composite-Maxing Ratio in the CompositeMaterials. -* @param[in] nCompositeBufferSize - Number of elements in buffer -* @param[out] pCompositeNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pCompositeBuffer - CompositeConstituent buffer of The Composite-Mixing Values with the given PropertyID +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] nValue - Integer value of the parameter. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_getcomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nCompositeBufferSize, Lib3MF_uint64* pCompositeNeededCount, Lib3MF::sCompositeConstituent * pCompositeBuffer); - -/************************************************************************************************************************* - Class definition for MultiPropertyGroup -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_setparameterintegervalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 nValue); /** -* Retrieves the count of MultiProperty-s in the MultiPropertyGroup. +* Sets a profile's parameter value as boolean. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[out] pCount - returns the count of MultiProperty-s +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] bValue - Boolean value of the parameter. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getcount(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_setparameterboolvalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool bValue); + +/************************************************************************************************************************* + Class definition for ToolpathLayerReader +**************************************************************************************************************************/ /** -* returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup +* Retrieves the layerdata's uuid * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the MultiProperty-s in the MultiPropertyGroup. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getallpropertyids(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getlayerdatauuid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* Adds a new MultiProperty to the MultiPropertyGroup. +* Retrieves the count of segments. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[in] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the new MultiProperty. -* @param[out] pPropertyID - returns the PropertyID of the new MultiProperty in the MultiPropertyGroup. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[out] pCount - Count * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_addmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer, Lib3MF_uint32 * pPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentcount(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 * pCount); /** -* Sets the PropertyIDs of a MultiProperty. +* Retrieves the segment type information . * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyID - the PropertyID of the MultiProperty to be changed. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[in] pPropertyIDsBuffer - uint32 buffer of The new PropertyIDs of the MultiProperty +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pType - Segment Type +* @param[out] pPointCount - Point count of segment. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_setmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentinfo(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF::eToolpathSegmentType * pType, Lib3MF_uint32 * pPointCount); /** -* Obtains the PropertyIDs of a MultiProperty. +* Retrieves the assigned segment profile. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyID - the PropertyID of the MultiProperty to be queried. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the MultiProperty +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pProfile - Segment Profile * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentprofile(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_ToolpathProfile * pProfile); /** -* Removes a MultiProperty from this MultiPropertyGroup. +* Retrieves the assigned segment profile uuid. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyID - the PropertyID of the MultiProperty to be removed. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[in] nProfileUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pProfileUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pProfileUUIDBuffer - buffer of Segment Profile UUID, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_removemultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentprofileuuid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nProfileUUIDBufferSize, Lib3MF_uint32* pProfileUUIDNeededChars, char * pProfileUUIDBuffer); /** -* Retrieves the number of layers of this MultiPropertyGroup. +* Retrieves the assigned segment profile. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[out] pCount - returns the number of layers +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pBuildItem - Segment Build Item * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getlayercount(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentpart(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_BuildItem * pBuildItem); /** -* Adds a MultiPropertyLayer to this MultiPropertyGroup. +* Retrieves the assigned segment part uuid. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] pTheLayer - The MultiPropertyLayer to add to this MultiPropertyGroup -* @param[out] pLayerIndex - returns the index of this MultiPropertyLayer +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[in] nPartUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartUUIDBuffer - buffer of Segment Part UUID, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_addlayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF::sMultiPropertyLayer * pTheLayer, Lib3MF_uint32 * pLayerIndex); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentpartuuid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nPartUUIDBufferSize, Lib3MF_uint32* pPartUUIDNeededChars, char * pPartUUIDBuffer); /** -* Obtains a MultiPropertyLayer of this MultiPropertyGroup. +* Retrieves the assigned segment part id. ATTENTION: This ID is only unique within the layer and there is no guarantee to be globally unique or consistent across layers. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nLayerIndex - The Index of the MultiPropertyLayer queried -* @param[out] pTheLayer - The MultiPropertyLayer with index LayerIndex within MultiPropertyGroup +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pLocalPartID - Local Segment Part ID * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getlayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex, Lib3MF::sMultiPropertyLayer * pTheLayer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentlocalpartid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 * pLocalPartID); /** -* Removes a MultiPropertyLayer from this MultiPropertyGroup. +* Retrieves the global part UUID by the local part ID. Fails if part ID does not exist in this layer. ATTENTION: This ID is only unique within the layer and there is no guarantee to be globally unique or consistent across layers. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nLayerIndex - The Index of the MultiPropertyLayer to be removed +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nLocalPartID - Local Segment Part ID +* @param[in] nPartUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartUUIDBuffer - buffer of Segment Part UUID, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_removelayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex); - -/************************************************************************************************************************* - Class definition for Attachment -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getpartuuidbylocalpartid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nLocalPartID, const Lib3MF_uint32 nPartUUIDBufferSize, Lib3MF_uint32* pPartUUIDNeededChars, char * pPartUUIDBuffer); /** -* Retrieves an attachment's package path. This function will be removed in a later release. +* Retrieves the assigned segment point list. For type hatch, the points are taken pairwise. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nPathBufferSize - size of the buffer (including trailing 0) -* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPathBuffer - buffer of returns the attachment's package path string, may be NULL +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[out] pPointDataNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPointDataBuffer - Position2D buffer of The point data array * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_getpath(Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentpointdata(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint64 nPointDataBufferSize, Lib3MF_uint64* pPointDataNeededCount, Lib3MF::sPosition2D * pPointDataBuffer); /** -* Sets an attachment's package path. This function will be removed in a later release. +* Retrieves a segment attribute Information by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pPath - new path of the attachment. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pID - Attribute ID. +* @param[out] pAttributeType - Attribute Type. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_setpath(Lib3MF_Attachment pAttachment, const char * pPath); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_findattributeinfobyname(Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, Lib3MF_uint32 * pID, Lib3MF::eToolpathAttributeType * pAttributeType); /** -* Returns the PackagePart that is this attachment. +* Retrieves a segment attribute ID by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[out] pPackagePart - The PackagePart of this attachment. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pID - Attribute ID. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_packagepart(Lib3MF_Attachment pAttachment, Lib3MF_PackagePart * pPackagePart); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_findattributeidbyname(Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, Lib3MF_uint32 * pID); /** -* Retrieves an attachment's relationship type +* Retrieves a segment attribute Type by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nPathBufferSize - size of the buffer (including trailing 0) -* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPathBuffer - buffer of returns the attachment's package relationship type string, may be NULL +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pAttributeType - Attribute Type. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_getrelationshiptype(Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_findattributevaluebyname(Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, Lib3MF::eToolpathAttributeType * pAttributeType); /** -* Sets an attachment's relationship type. +* Retrieves a segment Uint32 attribute by Attribute ID. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pPath - new relationship type string. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] nID - Attribute ID. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_setrelationshiptype(Lib3MF_Attachment pAttachment, const char * pPath); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentintegerattributebyid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 nID, Lib3MF_int64 * pValue); /** -* Writes out the attachment as file. +* Retrieves a segment integer attribute by Attribute Name. Will fail if Attribute does not exist or is of different type. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pFileName - file to write into. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_writetofile(Lib3MF_Attachment pAttachment, const char * pFileName); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentintegerattributebyname(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const char * pNameSpace, const char * pAttributeName, Lib3MF_int64 * pValue); /** -* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Retrieves a segment Double attribute by Attribute ID. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pFileName - file to read from. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] nID - Attribute ID. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_readfromfile(Lib3MF_Attachment pAttachment, const char * pFileName); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 nID, Lib3MF_double * pValue); /** -* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Retrieves a segment Double attribute by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pTheReadCallback - Callback to call for reading a data chunk -* @param[in] nStreamSize - number of bytes the callback returns -* @param[in] pTheSeekCallback - Callback to call for seeking in the stream. -* @param[in] pUserData - Userdata that is passed to the callback function +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_readfromcallback(Lib3MF_Attachment pAttachment, Lib3MF::ReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MF::SeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const char * pNameSpace, const char * pAttributeName, Lib3MF_double * pValue); /** -* Retrieves the size of the attachment stream +* Retrieves the count of custom data elements. * -* @param[in] pAttachment - Attachment instance. -* @param[out] pStreamSize - the stream size +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[out] pCount - Count * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_getstreamsize(Lib3MF_Attachment pAttachment, Lib3MF_uint64 * pStreamSize); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getcustomdatacount(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 * pCount); /** -* Writes out the attachment into a buffer +* Retrieves the custom data. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nBufferBufferSize - Number of elements in buffer -* @param[out] pBufferNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBufferBuffer - uint8 buffer of Buffer to write into +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_writetobuffer(Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getcustomdata(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_CustomDOMTree * pData); /** -* Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). +* Retrieves the node name of the custom data. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nBufferBufferSize - Number of elements in buffer -* @param[in] pBufferBuffer - uint8 buffer of Buffer to read from +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of Namespace of the custom data tree., may be NULL +* @param[in] nDataNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pDataNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pDataNameBuffer - buffer of Root name of the data tree., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_readfrombuffer(Lib3MF_Attachment pAttachment, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getcustomdataname(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer, const Lib3MF_uint32 nDataNameBufferSize, Lib3MF_uint32* pDataNameNeededChars, char * pDataNameBuffer); /************************************************************************************************************************* - Class definition for Texture2D + Class definition for ToolpathLayerData **************************************************************************************************************************/ /** -* Retrieves the attachment located at the path of the texture. +* Retrieves the layerdata's uuid * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pAttachment - attachment that holds the texture's image information. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_getattachment(Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment * pAttachment); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_getlayerdatauuid(Lib3MF_ToolpathLayerData pToolpathLayerData, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* Sets the texture's package path to the path of the attachment. +* Registers a toolpath profile * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] pAttachment - attachment that holds the texture's image information. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pProfile - The toolpath profile to register. +* @param[out] pProfileID - returns the local profile ID for the layer. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_setattachment(Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment pAttachment); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_registerprofile(Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_ToolpathProfile pProfile, Lib3MF_uint32 * pProfileID); /** -* Retrieves a texture's content type. +* Registers a Model Build Item * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pContentType - returns content type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pBuildItem - The model build item to use. +* @param[out] pPartID - returns the local part ID for the layer. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_getcontenttype(Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureType * pContentType); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_registerbuilditem(Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pPartID); /** -* Retrieves a texture's content type. +* Sets Segment Attribute for all following segments that are added. Overrides previously set attribute. * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] eContentType - new Content Type +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pNameSpace - The namespace of the attribute to register. +* @param[in] pAttributeName - The name of the attribute to register. +* @param[in] pValue - The value of the attribute to register. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_setcontenttype(Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureType eContentType); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_setsegmentattribute(Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pAttributeName, const char * pValue); /** -* Retrieves a texture's tilestyle type. +* Clears current segment attributes. * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pTileStyleU - returns tilestyle type enum. -* @param[out] pTileStyleV - returns tilestyle type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_gettilestyleuv(Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureTileStyle * pTileStyleU, Lib3MF::eTextureTileStyle * pTileStyleV); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_clearsegmentattributes(Lib3MF_ToolpathLayerData pToolpathLayerData); /** -* Sets a texture's tilestyle type. +* writes hatch data to the layer. * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] eTileStyleU - new tilestyle type enum. -* @param[in] eTileStyleV - new tilestyle type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nProfileID - The toolpath profile to use +* @param[in] nPartID - The toolpath part to use +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[in] pPointDataBuffer - Position2D buffer of The point data * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_settilestyleuv(Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureTileStyle eTileStyleU, Lib3MF::eTextureTileStyle eTileStyleV); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_writehatchdata(Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const Lib3MF::sPosition2D * pPointDataBuffer); /** -* Retrieves a texture's filter type. +* writes loop data to the layer. * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pFilter - returns filter type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nProfileID - The toolpath profile to use +* @param[in] nPartID - The toolpath part to use +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[in] pPointDataBuffer - Position2D buffer of The point data * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_getfilter(Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureFilter * pFilter); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_writeloop(Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const Lib3MF::sPosition2D * pPointDataBuffer); /** -* Sets a texture's filter type. +* writes polyline data to the layer. * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] eFilter - sets new filter type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nProfileID - The toolpath profile to use +* @param[in] nPartID - The toolpath part to use +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[in] pPointDataBuffer - Position2D buffer of The point data * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_setfilter(Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureFilter eFilter); - -/************************************************************************************************************************* - Class definition for BuildItem -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_writepolyline(Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const Lib3MF::sPosition2D * pPointDataBuffer); /** -* Retrieves the object resource associated to a build item +* Adds a custom data DOM tree to the layer. Layer MUST not be finished when changing the DOM tree. * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pObjectResource - returns the associated resource instance +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pDataName - Root name of the data tree. MUST not be empty. MUST be a valid XML name string. +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getobjectresource(Lib3MF_BuildItem pBuildItem, Lib3MF_Object * pObjectResource); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_addcustomdata(Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData); /** -* returns, whether a build item has a UUID and, if true, the build item's UUID +* finishes all writing of the layer and compresses toolpath data. * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pHasUUID - flag whether the build item has a UUID -* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL +* @param[in] pToolpathLayerData - ToolpathLayerData instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getuuid(Lib3MF_BuildItem pBuildItem, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_finish(Lib3MF_ToolpathLayerData pToolpathLayerData); + +/************************************************************************************************************************* + Class definition for Toolpath +**************************************************************************************************************************/ /** -* sets the build item's UUID +* Retrieves the unit factor * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' +* @param[in] pToolpath - Toolpath instance. +* @param[out] pUnits - Returns the unit factor. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_setuuid(Lib3MF_BuildItem pBuildItem, const char * pUUID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getunits(Lib3MF_Toolpath pToolpath, Lib3MF_double * pUnits); /** -* Retrieves the object UniqueResourceID associated to a build item +* Retrieves the count of layers * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pUniqueResourceID - returns the UniqueResourceID of the object +* @param[in] pToolpath - Toolpath instance. +* @param[out] pCount - Returns the layer count * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getobjectresourceid(Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pUniqueResourceID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getlayercount(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount); /** -* Checks, if a build item has a non-identity transformation matrix +* Retrieves the count of profiles * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pHasTransform - returns true, if the transformation matrix is not the identity +* @param[in] pToolpath - Toolpath instance. +* @param[out] pCount - Returns the profile count * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_hasobjecttransform(Lib3MF_BuildItem pBuildItem, bool * pHasTransform); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getprofilecount(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount); /** -* Retrieves a build item's transformation matrix. +* Adds a new toolpath layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pTransform - returns the transformation matrix +* @param[in] pToolpath - Toolpath instance. +* @param[in] nZMax - ZMax value +* @param[in] pPath - Package Path +* @param[in] pModelWriter - The model writer that writes out the 3MF. +* @param[out] pLayerData - Returns the layerdata object to write the layer content into. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getobjecttransform(Lib3MF_BuildItem pBuildItem, Lib3MF::sTransform * pTransform); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_addlayer(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nZMax, const char * pPath, Lib3MF_Writer pModelWriter, Lib3MF_ToolpathLayerData * pLayerData); /** -* Sets a build item's transformation matrix. +* Retrieves the Attachment of a layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] pTransform - new transformation matrix +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[out] pAttachment - Attachment * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_setobjecttransform(Lib3MF_BuildItem pBuildItem, const Lib3MF::sTransform * pTransform); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getlayerattachment(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_Attachment * pAttachment); /** -* Retrieves a build item's part number string +* Reads the toolpath of a layer. * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) -* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPartNumberBuffer - buffer of Returns a build item's part number string, may be NULL +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[out] pToolpathReader - Toolpath Reader Instance * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getpartnumber(Lib3MF_BuildItem pBuildItem, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_readlayerdata(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_ToolpathLayerReader * pToolpathReader); /** -* Sets a build item's part number string +* Retrieves the Path of a layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] pSetPartnumber - new part number string for referencing parts from the outside world +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of Package Path, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_setpartnumber(Lib3MF_BuildItem pBuildItem, const char * pSetPartnumber); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getlayerpath(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); /** -* Returns the metadatagroup of this build item +* Retrieves the ZMax of a layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this build item +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[out] pZMax - ZMax value * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getmetadatagroup(Lib3MF_BuildItem pBuildItem, Lib3MF_MetaDataGroup * pMetaDataGroup); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getlayerzmax(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_uint32 * pZMax); /** -* Returns the outbox of a build item +* Return the z value of a layer in units. * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pOutbox - Outbox of this build item +* @param[in] pToolpath - Toolpath instance. +* @param[in] nLayerIndex - Layer Index. +* @param[out] pZValue - Z Value in Units. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getoutbox(Lib3MF_BuildItem pBuildItem, Lib3MF::sBox * pOutbox); - -/************************************************************************************************************************* - Class definition for BuildItemIterator -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getlayerz(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nLayerIndex, Lib3MF_uint32 * pZValue); /** -* Iterates to the next build item in the list. +* Adds a new profile to the toolpath. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pHasNext - Iterates to the next build item in the list. +* @param[in] pToolpath - Toolpath instance. +* @param[in] pName - the name. +* @param[out] pProfile - Returns the profile. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_movenext(Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasNext); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_addprofile(Lib3MF_Toolpath pToolpath, const char * pName, Lib3MF_ToolpathProfile * pProfile); /** -* Iterates to the previous build item in the list. +* Returns a profile of the toolpath. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pHasPrevious - Iterates to the previous build item in the list. +* @param[in] pToolpath - Toolpath instance. +* @param[in] nProfileIndex - Layer Index. +* @param[out] pProfile - Returns the profile. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_moveprevious(Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasPrevious); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getprofile(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nProfileIndex, Lib3MF_ToolpathProfile * pProfile); /** -* Returns the build item the iterator points at. +* Returns a profile of the toolpath by UUID. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pBuildItem - returns the build item instance. +* @param[in] pToolpath - Toolpath instance. +* @param[in] pProfileUUID - UUID string. +* @param[out] pProfile - Returns the profile. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_getcurrent(Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItem * pBuildItem); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getprofileuuid(Lib3MF_Toolpath pToolpath, const char * pProfileUUID, Lib3MF_ToolpathProfile * pProfile); /** -* Creates a new build item iterator with the same build item list. +* Retrieves the count of custom data elements. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pOutBuildItemIterator - returns the cloned Iterator instance +* @param[in] pToolpath - Toolpath instance. +* @param[out] pCount - Count * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_clone(Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItemIterator * pOutBuildItemIterator); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getcustomdatacount(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount); /** -* Returns the number of build items the iterator captures. +* Retrieves the custom data. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pCount - returns the number of build items the iterator captures. +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_count(Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_uint64 * pCount); - -/************************************************************************************************************************* - Class definition for Slice -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getcustomdata(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_CustomDOMTree * pData); /** -* Set all vertices of a slice. All polygons will be cleared. +* Retrieves the node name of the custom data. * -* @param[in] pSlice - Slice instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[in] pVerticesBuffer - Position2D buffer of contains the positions. +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of Namespace of the custom data tree., may be NULL +* @param[in] nDataNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pDataNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pDataNameBuffer - buffer of Root name of the data tree., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_setvertices(Lib3MF_Slice pSlice, Lib3MF_uint64 nVerticesBufferSize, const Lib3MF::sPosition2D * pVerticesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getcustomdataname(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer, const Lib3MF_uint32 nDataNameBufferSize, Lib3MF_uint32* pDataNameNeededChars, char * pDataNameBuffer); /** -* Get all vertices of a slice +* Retrieves if custom data with a specific namespace and name combination exists. * -* @param[in] pSlice - Slice instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pVerticesBuffer - Position2D buffer of contains the positions. +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. +* @param[in] pDataName - Root name of the data tree. +* @param[out] pCustomDataExists - Returns true if DOM Tree Exists. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getvertices(Lib3MF_Slice pSlice, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, Lib3MF::sPosition2D * pVerticesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_hasuniquecustomdata(Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, bool * pCustomDataExists); /** -* Get the number of vertices in a slice +* Retrieves the custom data with a specific namespace and name combination. Fails if combination is not unique. * -* @param[in] pSlice - Slice instance. -* @param[out] pCount - the number of vertices in the slice +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. +* @param[in] pDataName - Root name of the data tree. +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getvertexcount(Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_finduniquecustomdata(Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData); /** -* Add a new polygon to this slice +* Adds a custom data DOM tree to the toolpath. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the new polygon -* @param[out] pIndex - the index of the new polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pDataName - Root name of the data tree. MUST not be empty. MUST be a valid XML name string. +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_addpolygon(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer, Lib3MF_uint64 * pIndex); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_addcustomdata(Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData); /** -* Get the number of polygons in the slice +* Deletes all custom data. * -* @param[in] pSlice - Slice instance. -* @param[out] pCount - the number of polygons in the slice +* @param[in] pToolpath - Toolpath instance. +* @param[out] pNumberOfDeletedItems - Returns number of deleted items. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getpolygoncount(Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_clearcustomdata(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pNumberOfDeletedItems); /** -* Set all indices of a polygon +* Deletes a custom data instance from the list. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndex - the index of the polygon to manipulate -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the index-th polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pData - DOM Tree of the data. +* @param[out] pSuccess - Returns if deletion was successful. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_setpolygonindices(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_deletecustomdata(Lib3MF_Toolpath pToolpath, Lib3MF_CustomDOMTree pData, bool * pSuccess); /** -* Get all vertices of a slice +* Registers an Integer Attribute that each segment holds. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndex - the index of the polygon to manipulate -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pIndicesBuffer - uint32 buffer of the indices of the index-th polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pAttributeName - Attribute name. MUST not be empty. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getpolygonindices(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF_uint32 * pIndicesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_registercustomintegerattribute(Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pAttributeName); /** -* Get the number of vertices in a slice +* Registers a Double Attribute that each segment holds. Registering only applies to reader or writer objects created after the call. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndex - the index of the polygon to manipulate -* @param[out] pCount - the number of indices of the index-th polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pAttributeName - Attribute name. MUST not be empty. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getpolygonindexcount(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_registercustomdoubleattribute(Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pAttributeName); + +/************************************************************************************************************************* + Class definition for ToolpathIterator +**************************************************************************************************************************/ /** -* Get the upper Z-Coordinate of this slice. +* Returns the Toolpath the iterator points at. * -* @param[in] pSlice - Slice instance. -* @param[out] pZTop - the upper Z-Coordinate of this slice +* @param[in] pToolpathIterator - ToolpathIterator instance. +* @param[out] pResource - returns the Toolpath instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getztop(Lib3MF_Slice pSlice, Lib3MF_double * pZTop); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathiterator_getcurrenttoolpath(Lib3MF_ToolpathIterator pToolpathIterator, Lib3MF_Toolpath * pResource); /************************************************************************************************************************* Class definition for SliceStack @@ -3274,6 +4681,15 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getcompositematerials(Lib3MF_Model pMo */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getmultipropertygroups(Lib3MF_Model pModel, Lib3MF_MultiPropertyGroupIterator * pResourceIterator); +/** +* creates a Toolpath instance with all toolpath resources. +* +* @param[in] pModel - Model instance. +* @param[out] pResourceIterator - returns the iterator instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_gettoolpaths(Lib3MF_Model pModel, Lib3MF_ToolpathIterator * pResourceIterator); + /** * creates a resource iterator instance with all slice stack resources. * @@ -3397,6 +4813,16 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_addbuilditem(Lib3MF_Model pModel, Lib3 */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_removebuilditem(Lib3MF_Model pModel, Lib3MF_BuildItem pBuildItemInstance); +/** +* adds an empty Toolpath resource to the model. +* +* @param[in] pModel - Model instance. +* @param[in] dUnitFactor - The toolpath instance of the created Toolpath. +* @param[out] pToolpathInstance - The toolpath instance of the created Toolpath. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_addtoolpath(Lib3MF_Model pModel, Lib3MF_double dUnitFactor, Lib3MF_Toolpath * pToolpathInstance); + /** * Returns the metadata of the model as MetaDataGroup * @@ -3528,6 +4954,40 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_setrandomnumbercallback(Lib3MF_Model p */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getkeystore(Lib3MF_Model pModel, Lib3MF_KeyStore * pKeyStore); +/** +* Creates an OPC Reader Source from a file. +* +* @param[in] pModel - Model instance. +* @param[in] pFilename - Filename to read from +* @param[out] pInstance - The instance of the created reader source +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_createpersistentsourcefromfile(Lib3MF_Model pModel, const char * pFilename, Lib3MF_PersistentReaderSource * pInstance); + +/** +* Creates an OPC Reader Source from a memory buffer. The memory buffer MUST exist as long as the Source object exists. +* +* @param[in] pModel - Model instance. +* @param[in] nBufferBufferSize - Number of elements in buffer +* @param[in] pBufferBuffer - uint8 buffer of Buffer to read from +* @param[out] pInstance - The instance of the created reader source +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_createpersistentsourcefrombuffer(Lib3MF_Model pModel, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer, Lib3MF_PersistentReaderSource * pInstance); + +/** +* Creates an OPC Reader Source from a data provided by a callback function. The callbacks MUST exist as long as the source object exists. +* +* @param[in] pModel - Model instance. +* @param[in] pTheReadCallback - Callback to call for reading a data chunk +* @param[in] nStreamSize - number of bytes the callback returns +* @param[in] pTheSeekCallback - Callback to call for seeking in the stream. +* @param[in] pUserData - Userdata that is passed to the callback function +* @param[out] pInstance - The instance of the created reader source +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_createpersistentsourcefromcallback(Lib3MF_Model pModel, Lib3MF::ReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MF::SeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData, Lib3MF_PersistentReaderSource * pInstance); + /************************************************************************************************************************* Global functions **************************************************************************************************************************/ diff --git a/Autogenerated/Bindings/Cpp/lib3mf_implicit.hpp b/Autogenerated/Bindings/Cpp/lib3mf_implicit.hpp index c69787d70..25a019fbe 100644 --- a/Autogenerated/Bindings/Cpp/lib3mf_implicit.hpp +++ b/Autogenerated/Bindings/Cpp/lib3mf_implicit.hpp @@ -58,11 +58,17 @@ namespace Lib3MF { **************************************************************************************************************************/ class CWrapper; class CBase; +class CBinaryStream; class CWriter; +class CPersistentReaderSource; class CReader; class CPackagePart; class CResource; class CResourceIterator; +class CCustomXMLAttribute; +class CCustomXMLNode; +class CCustomXMLNodes; +class CCustomDOMTree; class CSliceStackIterator; class CObjectIterator; class CMeshObjectIterator; @@ -91,6 +97,11 @@ class CTexture2D; class CBuildItem; class CBuildItemIterator; class CSlice; +class CToolpathProfile; +class CToolpathLayerReader; +class CToolpathLayerData; +class CToolpath; +class CToolpathIterator; class CSliceStack; class CConsumer; class CAccessRight; @@ -105,11 +116,17 @@ class CModel; **************************************************************************************************************************/ typedef CWrapper CLib3MFWrapper; typedef CBase CLib3MFBase; +typedef CBinaryStream CLib3MFBinaryStream; typedef CWriter CLib3MFWriter; +typedef CPersistentReaderSource CLib3MFPersistentReaderSource; typedef CReader CLib3MFReader; typedef CPackagePart CLib3MFPackagePart; typedef CResource CLib3MFResource; typedef CResourceIterator CLib3MFResourceIterator; +typedef CCustomXMLAttribute CLib3MFCustomXMLAttribute; +typedef CCustomXMLNode CLib3MFCustomXMLNode; +typedef CCustomXMLNodes CLib3MFCustomXMLNodes; +typedef CCustomDOMTree CLib3MFCustomDOMTree; typedef CSliceStackIterator CLib3MFSliceStackIterator; typedef CObjectIterator CLib3MFObjectIterator; typedef CMeshObjectIterator CLib3MFMeshObjectIterator; @@ -138,6 +155,11 @@ typedef CTexture2D CLib3MFTexture2D; typedef CBuildItem CLib3MFBuildItem; typedef CBuildItemIterator CLib3MFBuildItemIterator; typedef CSlice CLib3MFSlice; +typedef CToolpathProfile CLib3MFToolpathProfile; +typedef CToolpathLayerReader CLib3MFToolpathLayerReader; +typedef CToolpathLayerData CLib3MFToolpathLayerData; +typedef CToolpath CLib3MFToolpath; +typedef CToolpathIterator CLib3MFToolpathIterator; typedef CSliceStack CLib3MFSliceStack; typedef CConsumer CLib3MFConsumer; typedef CAccessRight CLib3MFAccessRight; @@ -152,11 +174,17 @@ typedef CModel CLib3MFModel; **************************************************************************************************************************/ typedef std::shared_ptr PWrapper; typedef std::shared_ptr PBase; +typedef std::shared_ptr PBinaryStream; typedef std::shared_ptr PWriter; +typedef std::shared_ptr PPersistentReaderSource; typedef std::shared_ptr PReader; typedef std::shared_ptr PPackagePart; typedef std::shared_ptr PResource; typedef std::shared_ptr PResourceIterator; +typedef std::shared_ptr PCustomXMLAttribute; +typedef std::shared_ptr PCustomXMLNode; +typedef std::shared_ptr PCustomXMLNodes; +typedef std::shared_ptr PCustomDOMTree; typedef std::shared_ptr PSliceStackIterator; typedef std::shared_ptr PObjectIterator; typedef std::shared_ptr PMeshObjectIterator; @@ -185,6 +213,11 @@ typedef std::shared_ptr PTexture2D; typedef std::shared_ptr PBuildItem; typedef std::shared_ptr PBuildItemIterator; typedef std::shared_ptr PSlice; +typedef std::shared_ptr PToolpathProfile; +typedef std::shared_ptr PToolpathLayerReader; +typedef std::shared_ptr PToolpathLayerData; +typedef std::shared_ptr PToolpath; +typedef std::shared_ptr PToolpathIterator; typedef std::shared_ptr PSliceStack; typedef std::shared_ptr PConsumer; typedef std::shared_ptr PAccessRight; @@ -199,11 +232,17 @@ typedef std::shared_ptr PModel; **************************************************************************************************************************/ typedef PWrapper PLib3MFWrapper; typedef PBase PLib3MFBase; +typedef PBinaryStream PLib3MFBinaryStream; typedef PWriter PLib3MFWriter; +typedef PPersistentReaderSource PLib3MFPersistentReaderSource; typedef PReader PLib3MFReader; typedef PPackagePart PLib3MFPackagePart; typedef PResource PLib3MFResource; typedef PResourceIterator PLib3MFResourceIterator; +typedef PCustomXMLAttribute PLib3MFCustomXMLAttribute; +typedef PCustomXMLNode PLib3MFCustomXMLNode; +typedef PCustomXMLNodes PLib3MFCustomXMLNodes; +typedef PCustomDOMTree PLib3MFCustomDOMTree; typedef PSliceStackIterator PLib3MFSliceStackIterator; typedef PObjectIterator PLib3MFObjectIterator; typedef PMeshObjectIterator PLib3MFMeshObjectIterator; @@ -232,6 +271,11 @@ typedef PTexture2D PLib3MFTexture2D; typedef PBuildItem PLib3MFBuildItem; typedef PBuildItemIterator PLib3MFBuildItemIterator; typedef PSlice PLib3MFSlice; +typedef PToolpathProfile PLib3MFToolpathProfile; +typedef PToolpathLayerReader PLib3MFToolpathLayerReader; +typedef PToolpathLayerData PLib3MFToolpathLayerData; +typedef PToolpath PLib3MFToolpath; +typedef PToolpathIterator PLib3MFToolpathIterator; typedef PSliceStack PLib3MFSliceStack; typedef PConsumer PLib3MFConsumer; typedef PAccessRight PLib3MFAccessRight; @@ -355,6 +399,10 @@ class ELib3MFException : public std::exception { case LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER: return "UNKOWNPROGRESSIDENTIFIER"; case LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT: return "ELEMENTCOUNTEXCEEDSLIMIT"; case LIB3MF_ERROR_INVALIDRESOURCE: return "INVALIDRESOURCE"; + case LIB3MF_ERROR_INVALIDNODEINDEX: return "INVALIDNODEINDEX"; + case LIB3MF_ERROR_INVALIDATTRIBUTEINDEX: return "INVALIDATTRIBUTEINDEX"; + case LIB3MF_ERROR_DUPLICATECUSTOMDATA: return "DUPLICATECUSTOMDATA"; + case LIB3MF_ERROR_CUSTOMDATANOTFOUND: return "CUSTOMDATANOTFOUND"; case LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE: return "BEAMLATTICE_INVALID_OBJECTTYPE"; case LIB3MF_ERROR_INVALIDKEYSTORE: return "INVALIDKEYSTORE"; case LIB3MF_ERROR_INVALIDKEYSTORECONSUMER: return "INVALIDKEYSTORECONSUMER"; @@ -362,6 +410,16 @@ class ELib3MFException : public std::exception { case LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND: return "KEYSTORERESOURCEDATANOTFOUND"; case LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED: return "SECURECONTEXTNOTREGISTERED"; case LIB3MF_ERROR_INVALIDKEYSIZE: return "INVALIDKEYSIZE"; + case LIB3MF_ERROR_TOOLPATH_NOTWRITINGHEADER: return "TOOLPATH_NOTWRITINGHEADER"; + case LIB3MF_ERROR_TOOLPATH_NOTWRITINGDATA: return "TOOLPATH_NOTWRITINGDATA"; + case LIB3MF_ERROR_TOOLPATH_DATAHASBEENWRITTEN: return "TOOLPATH_DATAHASBEENWRITTEN"; + case LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT: return "TOOLPATH_INVALIDPOINTCOUNT"; + case LIB3MF_ERROR_TOOLPATH_ATTRIBUTEALREADYDEFINED: return "TOOLPATH_ATTRIBUTEALREADYDEFINED"; + case LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE: return "TOOLPATH_INVALIDATTRIBUTETYPE"; + case LIB3MF_ERROR_EMPTYNAMESPACEPREFIX: return "EMPTYNAMESPACEPREFIX"; + case LIB3MF_ERROR_EMPTYNAMESPACE: return "EMPTYNAMESPACE"; + case LIB3MF_ERROR_INVALIDNAMESPACEPREFIX: return "INVALIDNAMESPACEPREFIX"; + case LIB3MF_ERROR_WRITERDOESNOTSUPPORTNAMESPACES: return "WRITERDOESNOTSUPPORTNAMESPACES"; } return "UNKNOWN"; } @@ -406,13 +464,27 @@ class ELib3MFException : public std::exception { case LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER: return "A progress identifier is unknown"; case LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT: return "An element buffer exceeds its spec limit"; case LIB3MF_ERROR_INVALIDRESOURCE: return "A resource is invalid"; + case LIB3MF_ERROR_INVALIDNODEINDEX: return "Invalid node index"; + case LIB3MF_ERROR_INVALIDATTRIBUTEINDEX: return "Invalid attribute index"; + case LIB3MF_ERROR_DUPLICATECUSTOMDATA: return "Duplicate custom data"; + case LIB3MF_ERROR_CUSTOMDATANOTFOUND: return "Custom data not found"; case LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE: return "This object type is not valid for beamlattices"; case LIB3MF_ERROR_INVALIDKEYSTORE: return "The keystore object is invalid"; case LIB3MF_ERROR_INVALIDKEYSTORECONSUMER: return "The consumer keystore object is invalid"; case LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND: return "A consumer has not been found"; case LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND: return "A resource data has not been found"; case LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED: return "A Key or Conentent encryption callback has not been registered"; - case LIB3MF_ERROR_INVALIDKEYSIZE: return "The key siue is invalid"; + case LIB3MF_ERROR_INVALIDKEYSIZE: return "The key size is invalid"; + case LIB3MF_ERROR_TOOLPATH_NOTWRITINGHEADER: return "Not in toolpath header writing mode"; + case LIB3MF_ERROR_TOOLPATH_NOTWRITINGDATA: return "Not in toolpath data writing mode"; + case LIB3MF_ERROR_TOOLPATH_DATAHASBEENWRITTEN: return "Toolpath has already been written out"; + case LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT: return "Toolpath has an invalid number of points"; + case LIB3MF_ERROR_TOOLPATH_ATTRIBUTEALREADYDEFINED: return "Toolpath attribute already defined"; + case LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE: return "Toolpath attribute is of invalid type"; + case LIB3MF_ERROR_EMPTYNAMESPACEPREFIX: return "Empty namespace prefix."; + case LIB3MF_ERROR_EMPTYNAMESPACE: return "Empty namespace."; + case LIB3MF_ERROR_INVALIDNAMESPACEPREFIX: return "Invalid namespace prefix."; + case LIB3MF_ERROR_WRITERDOESNOTSUPPORTNAMESPACES: return "Writer does not support namespaces."; } return "unknown error"; } @@ -522,11 +594,17 @@ class CWrapper { } friend class CBase; + friend class CBinaryStream; friend class CWriter; + friend class CPersistentReaderSource; friend class CReader; friend class CPackagePart; friend class CResource; friend class CResourceIterator; + friend class CCustomXMLAttribute; + friend class CCustomXMLNode; + friend class CCustomXMLNodes; + friend class CCustomDOMTree; friend class CSliceStackIterator; friend class CObjectIterator; friend class CMeshObjectIterator; @@ -555,6 +633,11 @@ class CWrapper { friend class CBuildItem; friend class CBuildItemIterator; friend class CSlice; + friend class CToolpathProfile; + friend class CToolpathLayerReader; + friend class CToolpathLayerData; + friend class CToolpath; + friend class CToolpathIterator; friend class CSliceStack; friend class CConsumer; friend class CAccessRight; @@ -624,6 +707,29 @@ class CBase { inline Lib3MF_uint64 ClassTypeId(); }; +/************************************************************************************************************************* + Class CBinaryStream +**************************************************************************************************************************/ +class CBinaryStream : public CBase { +public: + + /** + * CBinaryStream::CBinaryStream - Constructor for BinaryStream class. + */ + CBinaryStream(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CBase(pWrapper, pHandle) + { + } + + inline std::string GetBinaryPath(); + inline std::string GetIndexPath(); + inline std::string GetUUID(); + inline void DisableDiscretizedArrayCompression(); + inline void EnableDiscretizedArrayCompression(const Lib3MF_double dUnits, const eBinaryStreamPredictionType ePredictionType); + inline void EnableLZMA(const Lib3MF_uint32 nLZMALevel); + inline void DisableLZMA(); +}; + /************************************************************************************************************************* Class CWriter **************************************************************************************************************************/ @@ -651,6 +757,28 @@ class CWriter : public CBase { inline Lib3MF_uint32 GetWarningCount(); inline void AddKeyWrappingCallback(const std::string & sConsumerID, const KeyWrappingCallback pTheCallback, const Lib3MF_pvoid pUserData); inline void SetContentEncryptionCallback(const ContentEncryptionCallback pTheCallback, const Lib3MF_pvoid pUserData); + inline PBinaryStream CreateBinaryStream(const std::string & sIndexPath, const std::string & sBinaryPath); + inline void AssignBinaryStream(classParam pInstance, classParam pBinaryStream); + inline void RegisterCustomNamespace(const std::string & sPrefix, const std::string & sNameSpace); +}; + +/************************************************************************************************************************* + Class CPersistentReaderSource +**************************************************************************************************************************/ +class CPersistentReaderSource : public CBase { +public: + + /** + * CPersistentReaderSource::CPersistentReaderSource - Constructor for PersistentReaderSource class. + */ + CPersistentReaderSource(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CBase(pWrapper, pHandle) + { + } + + inline ePersistentReaderSourceType GetSourceType(); + inline void InvalidateSourceData(); + inline bool SourceDataIsValid(); }; /************************************************************************************************************************* @@ -667,6 +795,7 @@ class CReader : public CBase { { } + inline void ReadFromPersistentSource(classParam pSource); inline void ReadFromFile(const std::string & sFilename); inline void ReadFromBuffer(const CInputVector & BufferBuffer); inline void ReadFromCallback(const ReadCallback pTheReadCallback, const Lib3MF_uint64 nStreamSize, const SeekCallback pTheSeekCallback, const Lib3MF_pvoid pUserData); @@ -741,6 +870,115 @@ class CResourceIterator : public CBase { inline Lib3MF_uint64 Count(); }; +/************************************************************************************************************************* + Class CCustomXMLAttribute +**************************************************************************************************************************/ +class CCustomXMLAttribute : public CBase { +public: + + /** + * CCustomXMLAttribute::CCustomXMLAttribute - Constructor for CustomXMLAttribute class. + */ + CCustomXMLAttribute(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CBase(pWrapper, pHandle) + { + } + + inline std::string GetName(); + inline std::string GetValue(); + inline bool IsValidInteger(const Lib3MF_int64 nMinValue, const Lib3MF_int64 nMaxValue); + inline Lib3MF_int64 GetIntegerValue(const Lib3MF_int64 nMinValue, const Lib3MF_int64 nMaxValue); + inline bool IsValidDouble(const Lib3MF_double dMinValue, const Lib3MF_double dMaxValue); + inline Lib3MF_double GetDoubleValue(const Lib3MF_double dMinValue, const Lib3MF_double dMaxValue); + inline bool IsValidBool(); + inline bool GetBoolValue(const Lib3MF_double dMinValue, const Lib3MF_double dMaxValue); + inline void SetValue(const std::string & sValue); + inline void SetIntegerValue(const Lib3MF_int64 nValue); + inline void SetDoubleValue(const Lib3MF_double dValue); + inline void SetBoolValue(const bool bValue); + inline void Remove(); +}; + +/************************************************************************************************************************* + Class CCustomXMLNode +**************************************************************************************************************************/ +class CCustomXMLNode : public CBase { +public: + + /** + * CCustomXMLNode::CCustomXMLNode - Constructor for CustomXMLNode class. + */ + CCustomXMLNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CBase(pWrapper, pHandle) + { + } + + inline std::string GetName(); + inline std::string GetNameSpace(); + inline Lib3MF_uint64 GetAttributeCount(); + inline PCustomXMLAttribute GetAttribute(const Lib3MF_uint64 nIndex); + inline bool HasAttribute(const std::string & sName); + inline PCustomXMLAttribute FindAttribute(const std::string & sName, const bool bMustExist); + inline bool RemoveAttribute(const std::string & sName); + inline bool RemoveAttributeByIndex(const Lib3MF_uint64 nIndex); + inline void AddAttribute(const std::string & sName, const std::string & sValue); + inline void AddIntegerAttribute(const std::string & sName, const Lib3MF_int64 nValue); + inline void AddDoubleAttribute(const std::string & sName, const Lib3MF_double dValue); + inline void AddBoolAttribute(const std::string & sName, const bool bValue); + inline PCustomXMLNodes GetChildren(); + inline Lib3MF_uint64 CountChildrenByName(const std::string & sName); + inline PCustomXMLNodes GetChildrenByName(const std::string & sName); + inline bool HasChild(const std::string & sName); + inline bool HasUniqueChild(const std::string & sName); + inline PCustomXMLNode FindChild(const std::string & sName, const bool bMustExist); + inline PCustomXMLNode AddChild(const std::string & sName); + inline void RemoveChild(classParam pChildInstance); + inline Lib3MF_uint64 RemoveChildrenWithName(const std::string & sName); + inline void Remove(); +}; + +/************************************************************************************************************************* + Class CCustomXMLNodes +**************************************************************************************************************************/ +class CCustomXMLNodes : public CBase { +public: + + /** + * CCustomXMLNodes::CCustomXMLNodes - Constructor for CustomXMLNodes class. + */ + CCustomXMLNodes(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CBase(pWrapper, pHandle) + { + } + + inline Lib3MF_uint64 GetNodeCount(); + inline PCustomXMLNode GetNode(const Lib3MF_uint64 nIndex); + inline Lib3MF_uint64 CountNodesByName(const std::string & sName); + inline PCustomXMLNodes GetNodesByName(const std::string & sName); + inline bool HasNode(const std::string & sName); + inline bool HasUniqueNode(const std::string & sName); + inline PCustomXMLNode FindNode(const std::string & sName, const bool bMustExist); +}; + +/************************************************************************************************************************* + Class CCustomDOMTree +**************************************************************************************************************************/ +class CCustomDOMTree : public CBase { +public: + + /** + * CCustomDOMTree::CCustomDOMTree - Constructor for CustomDOMTree class. + */ + CCustomDOMTree(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CBase(pWrapper, pHandle) + { + } + + inline std::string GetNameSpace(); + inline PCustomXMLNode GetRootNode(); + inline std::string SaveToString(); +}; + /************************************************************************************************************************* Class CSliceStackIterator **************************************************************************************************************************/ @@ -1381,6 +1619,158 @@ class CSlice : public CBase { inline Lib3MF_double GetZTop(); }; +/************************************************************************************************************************* + Class CToolpathProfile +**************************************************************************************************************************/ +class CToolpathProfile : public CBase { +public: + + /** + * CToolpathProfile::CToolpathProfile - Constructor for ToolpathProfile class. + */ + CToolpathProfile(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CBase(pWrapper, pHandle) + { + } + + inline std::string GetUUID(); + inline std::string GetName(); + inline Lib3MF_uint32 GetParameterCount(); + inline std::string GetParameterName(const Lib3MF_uint32 nIndex); + inline std::string GetParameterNameSpace(const Lib3MF_uint32 nIndex); + inline bool HasParameterValue(const std::string & sNameSpaceName, const std::string & sValueName); + inline std::string GetParameterValue(const std::string & sNameSpaceName, const std::string & sValueName); + inline std::string GetParameterValueDef(const std::string & sNameSpaceName, const std::string & sValueName, const std::string & sDefaultValue); + inline Lib3MF_double GetParameterDoubleValue(const std::string & sNameSpaceName, const std::string & sValueName); + inline Lib3MF_double GetParameterDoubleValueDef(const std::string & sNameSpaceName, const std::string & sValueName, const Lib3MF_double dDefaultValue); + inline Lib3MF_int64 GetParameterIntegerValue(const std::string & sNameSpaceName, const std::string & sValueName); + inline Lib3MF_int64 GetParameterIntegerValueDef(const std::string & sNameSpaceName, const std::string & sValueName, const Lib3MF_int64 nDefaultValue); + inline bool GetParameterBoolValue(const std::string & sNameSpaceName, const std::string & sValueName); + inline bool GetParameterBoolValueDef(const std::string & sNameSpaceName, const std::string & sValueName, const bool bDefaultValue); + inline void SetName(const std::string & sName); + inline void SetParameterValue(const std::string & sNameSpaceName, const std::string & sValueName, const std::string & sValue); + inline void SetParameterDoubleValue(const std::string & sNameSpaceName, const std::string & sValueName, const Lib3MF_double dValue); + inline void SetParameterIntegerValue(const std::string & sNameSpaceName, const std::string & sValueName, const Lib3MF_int64 nValue); + inline void SetParameterBoolValue(const std::string & sNameSpaceName, const std::string & sValueName, const bool bValue); +}; + +/************************************************************************************************************************* + Class CToolpathLayerReader +**************************************************************************************************************************/ +class CToolpathLayerReader : public CBase { +public: + + /** + * CToolpathLayerReader::CToolpathLayerReader - Constructor for ToolpathLayerReader class. + */ + CToolpathLayerReader(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CBase(pWrapper, pHandle) + { + } + + inline std::string GetLayerDataUUID(); + inline Lib3MF_uint32 GetSegmentCount(); + inline void GetSegmentInfo(const Lib3MF_uint32 nIndex, eToolpathSegmentType & eType, Lib3MF_uint32 & nPointCount); + inline PToolpathProfile GetSegmentProfile(const Lib3MF_uint32 nIndex); + inline std::string GetSegmentProfileUUID(const Lib3MF_uint32 nIndex); + inline PBuildItem GetSegmentPart(const Lib3MF_uint32 nIndex); + inline std::string GetSegmentPartUUID(const Lib3MF_uint32 nIndex); + inline Lib3MF_uint32 GetSegmentLocalPartID(const Lib3MF_uint32 nIndex); + inline std::string GetPartUUIDByLocalPartID(const Lib3MF_uint32 nLocalPartID); + inline void GetSegmentPointData(const Lib3MF_uint32 nIndex, std::vector & PointDataBuffer); + inline void FindAttributeInfoByName(const std::string & sNameSpace, const std::string & sAttributeName, Lib3MF_uint32 & nID, eToolpathAttributeType & eAttributeType); + inline Lib3MF_uint32 FindAttributeIDByName(const std::string & sNameSpace, const std::string & sAttributeName); + inline eToolpathAttributeType FindAttributeValueByName(const std::string & sNameSpace, const std::string & sAttributeName); + inline Lib3MF_int64 GetSegmentIntegerAttributeByID(const Lib3MF_uint32 nIndex, const Lib3MF_uint32 nID); + inline Lib3MF_int64 GetSegmentIntegerAttributeByName(const Lib3MF_uint32 nIndex, const std::string & sNameSpace, const std::string & sAttributeName); + inline Lib3MF_double GetSegmentDoubleAttributeByID(const Lib3MF_uint32 nIndex, const Lib3MF_uint32 nID); + inline Lib3MF_double GetSegmentDoubleAttributeByName(const Lib3MF_uint32 nIndex, const std::string & sNameSpace, const std::string & sAttributeName); + inline Lib3MF_uint32 GetCustomDataCount(); + inline PCustomDOMTree GetCustomData(const Lib3MF_uint32 nIndex); + inline void GetCustomDataName(const Lib3MF_uint32 nIndex, std::string & sNameSpace, std::string & sDataName); +}; + +/************************************************************************************************************************* + Class CToolpathLayerData +**************************************************************************************************************************/ +class CToolpathLayerData : public CBase { +public: + + /** + * CToolpathLayerData::CToolpathLayerData - Constructor for ToolpathLayerData class. + */ + CToolpathLayerData(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CBase(pWrapper, pHandle) + { + } + + inline std::string GetLayerDataUUID(); + inline Lib3MF_uint32 RegisterProfile(classParam pProfile); + inline Lib3MF_uint32 RegisterBuildItem(classParam pBuildItem); + inline void SetSegmentAttribute(const std::string & sNameSpace, const std::string & sAttributeName, const std::string & sValue); + inline void ClearSegmentAttributes(); + inline void WriteHatchData(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const CInputVector & PointDataBuffer); + inline void WriteLoop(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const CInputVector & PointDataBuffer); + inline void WritePolyline(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const CInputVector & PointDataBuffer); + inline PCustomDOMTree AddCustomData(const std::string & sNameSpace, const std::string & sDataName); + inline void Finish(); +}; + +/************************************************************************************************************************* + Class CToolpath +**************************************************************************************************************************/ +class CToolpath : public CResource { +public: + + /** + * CToolpath::CToolpath - Constructor for Toolpath class. + */ + CToolpath(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CResource(pWrapper, pHandle) + { + } + + inline Lib3MF_double GetUnits(); + inline Lib3MF_uint32 GetLayerCount(); + inline Lib3MF_uint32 GetProfileCount(); + inline PToolpathLayerData AddLayer(const Lib3MF_uint32 nZMax, const std::string & sPath, classParam pModelWriter); + inline PAttachment GetLayerAttachment(const Lib3MF_uint32 nIndex); + inline PToolpathLayerReader ReadLayerData(const Lib3MF_uint32 nIndex); + inline std::string GetLayerPath(const Lib3MF_uint32 nIndex); + inline Lib3MF_uint32 GetLayerZMax(const Lib3MF_uint32 nIndex); + inline Lib3MF_uint32 GetLayerZ(const Lib3MF_uint32 nLayerIndex); + inline PToolpathProfile AddProfile(const std::string & sName); + inline PToolpathProfile GetProfile(const Lib3MF_uint32 nProfileIndex); + inline PToolpathProfile GetProfileUUID(const std::string & sProfileUUID); + inline Lib3MF_uint32 GetCustomDataCount(); + inline PCustomDOMTree GetCustomData(const Lib3MF_uint32 nIndex); + inline void GetCustomDataName(const Lib3MF_uint32 nIndex, std::string & sNameSpace, std::string & sDataName); + inline bool HasUniqueCustomData(const std::string & sNameSpace, const std::string & sDataName); + inline PCustomDOMTree FindUniqueCustomData(const std::string & sNameSpace, const std::string & sDataName); + inline PCustomDOMTree AddCustomData(const std::string & sNameSpace, const std::string & sDataName); + inline Lib3MF_uint32 ClearCustomData(); + inline bool DeleteCustomData(classParam pData); + inline void RegisterCustomIntegerAttribute(const std::string & sNameSpace, const std::string & sAttributeName); + inline void RegisterCustomDoubleAttribute(const std::string & sNameSpace, const std::string & sAttributeName); +}; + +/************************************************************************************************************************* + Class CToolpathIterator +**************************************************************************************************************************/ +class CToolpathIterator : public CResourceIterator { +public: + + /** + * CToolpathIterator::CToolpathIterator - Constructor for ToolpathIterator class. + */ + CToolpathIterator(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CResourceIterator(pWrapper, pHandle) + { + } + + inline PToolpath GetCurrentToolpath(); +}; + /************************************************************************************************************************* Class CSliceStack **************************************************************************************************************************/ @@ -1590,6 +1980,7 @@ class CModel : public CBase { inline PTexture2DGroupIterator GetTexture2DGroups(); inline PCompositeMaterialsIterator GetCompositeMaterials(); inline PMultiPropertyGroupIterator GetMultiPropertyGroups(); + inline PToolpathIterator GetToolpaths(); inline PSliceStackIterator GetSliceStacks(); inline PModel MergeToModel(); inline PMeshObject AddMeshObject(); @@ -1603,6 +1994,7 @@ class CModel : public CBase { inline PMultiPropertyGroup AddMultiPropertyGroup(); inline PBuildItem AddBuildItem(classParam pObject, const sTransform & Transform); inline void RemoveBuildItem(classParam pBuildItemInstance); + inline PToolpath AddToolpath(const Lib3MF_double dUnitFactor); inline PMetaDataGroup GetMetaDataGroup(); inline PAttachment AddAttachment(const std::string & sURI, const std::string & sRelationShipType); inline void RemoveAttachment(classParam pAttachmentInstance); @@ -1617,6 +2009,9 @@ class CModel : public CBase { inline void RemoveCustomContentType(const std::string & sExtension); inline void SetRandomNumberCallback(const RandomNumberCallback pTheCallback, const Lib3MF_pvoid pUserData); inline PKeyStore GetKeyStore(); + inline PPersistentReaderSource CreatePersistentSourceFromFile(const std::string & sFilename); + inline PPersistentReaderSource CreatePersistentSourceFromBuffer(const CInputVector & BufferBuffer); + inline PPersistentReaderSource CreatePersistentSourceFromCallback(const ReadCallback pTheReadCallback, const Lib3MF_uint64 nStreamSize, const SeekCallback pTheSeekCallback, const Lib3MF_pvoid pUserData); }; /************************************************************************************************************************* @@ -1636,11 +2031,17 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) CheckError(nullptr, lib3mf_base_classtypeid(pHandle, &resultClassTypeId)); switch(resultClassTypeId) { case 0x856632D0BAF1D8B7UL: return new CBase(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Base" + case 0xA0EB26254C981E1AUL: return new CBinaryStream(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::BinaryStream" case 0xE76F642F363FD7E9UL: return new CWriter(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Writer" + case 0xBE46884397CE1319UL: return new CPersistentReaderSource(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::PersistentReaderSource" case 0x2D86831DA59FBE72UL: return new CReader(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Reader" case 0x0E55A826D377483EUL: return new CPackagePart(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::PackagePart" case 0xDFE3889D1B269CBBUL: return new CResource(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Resource" case 0x460F3515E2621DBEUL: return new CResourceIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ResourceIterator" + case 0xEA18C54DBD42B5F6UL: return new CCustomXMLAttribute(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::CustomXMLAttribute" + case 0x26B5AD02041EDF96UL: return new CCustomXMLNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::CustomXMLNode" + case 0x8C4B47C97D310E89UL: return new CCustomXMLNodes(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::CustomXMLNodes" + case 0x5E0CF70A6DB6256AUL: return new CCustomDOMTree(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::CustomDOMTree" case 0x69684DB99FA813F6UL: return new CSliceStackIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::SliceStackIterator" case 0xDE92510BD2112288UL: return new CObjectIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ObjectIterator" case 0xF4196034E2B9FDE6UL: return new CMeshObjectIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::MeshObjectIterator" @@ -1669,6 +2070,11 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) case 0x68FB2D5FFC4BA12AUL: return new CBuildItem(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::BuildItem" case 0xA7D21BD364910860UL: return new CBuildItemIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::BuildItemIterator" case 0x2198BCF4D8DF9C40UL: return new CSlice(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Slice" + case 0xC869620B90242CA7UL: return new CToolpathProfile(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ToolpathProfile" + case 0x28DD7D3718F0616EUL: return new CToolpathLayerReader(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ToolpathLayerReader" + case 0x28C0E70CC44F931AUL: return new CToolpathLayerData(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ToolpathLayerData" + case 0xF0AAB2C814D9FFB1UL: return new CToolpath(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Toolpath" + case 0xD0F24425A07F2A81UL: return new CToolpathIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ToolpathIterator" case 0x6594B031B6096238UL: return new CSliceStack(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::SliceStack" case 0xD9E46D5E6D8118EEUL: return new CConsumer(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Consumer" case 0x385C42FC5609498AUL: return new CAccessRight(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::AccessRight" @@ -1974,6 +2380,90 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) return resultClassTypeId; } + /** + * Method definitions for class CBinaryStream + */ + + /** + * CBinaryStream::GetBinaryPath - Retrieves an binary streams package path for the binary data. + * @return binary streams package binary path. + */ + std::string CBinaryStream::GetBinaryPath() + { + Lib3MF_uint32 bytesNeededPath = 0; + Lib3MF_uint32 bytesWrittenPath = 0; + CheckError(lib3mf_binarystream_getbinarypath(m_pHandle, 0, &bytesNeededPath, nullptr)); + std::vector bufferPath(bytesNeededPath); + CheckError(lib3mf_binarystream_getbinarypath(m_pHandle, bytesNeededPath, &bytesWrittenPath, &bufferPath[0])); + + return std::string(&bufferPath[0]); + } + + /** + * CBinaryStream::GetIndexPath - Retrieves an binary streams package path for the index data. + * @return binary streams package index path. + */ + std::string CBinaryStream::GetIndexPath() + { + Lib3MF_uint32 bytesNeededPath = 0; + Lib3MF_uint32 bytesWrittenPath = 0; + CheckError(lib3mf_binarystream_getindexpath(m_pHandle, 0, &bytesNeededPath, nullptr)); + std::vector bufferPath(bytesNeededPath); + CheckError(lib3mf_binarystream_getindexpath(m_pHandle, bytesNeededPath, &bytesWrittenPath, &bufferPath[0])); + + return std::string(&bufferPath[0]); + } + + /** + * CBinaryStream::GetUUID - Retrieves an binary streams uuid. + * @return binary streams uuid + */ + std::string CBinaryStream::GetUUID() + { + Lib3MF_uint32 bytesNeededUUID = 0; + Lib3MF_uint32 bytesWrittenUUID = 0; + CheckError(lib3mf_binarystream_getuuid(m_pHandle, 0, &bytesNeededUUID, nullptr)); + std::vector bufferUUID(bytesNeededUUID); + CheckError(lib3mf_binarystream_getuuid(m_pHandle, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0])); + + return std::string(&bufferUUID[0]); + } + + /** + * CBinaryStream::DisableDiscretizedArrayCompression - Sets the float compression mode to raw. All subsequent writes will adhere to this mode. + */ + void CBinaryStream::DisableDiscretizedArrayCompression() + { + CheckError(lib3mf_binarystream_disablediscretizedarraycompression(m_pHandle)); + } + + /** + * CBinaryStream::EnableDiscretizedArrayCompression - Sets the compression mode to a quantized array. All subsequent writes will adhere to this mode. + * @param[in] dUnits - Unit factor to use for quantization. + * @param[in] ePredictionType - Prediction type to use for arrays. + */ + void CBinaryStream::EnableDiscretizedArrayCompression(const Lib3MF_double dUnits, const eBinaryStreamPredictionType ePredictionType) + { + CheckError(lib3mf_binarystream_enablediscretizedarraycompression(m_pHandle, dUnits, ePredictionType)); + } + + /** + * CBinaryStream::EnableLZMA - Enables LZMA mode. + * @param[in] nLZMALevel - LZMA Level (0-9) + */ + void CBinaryStream::EnableLZMA(const Lib3MF_uint32 nLZMALevel) + { + CheckError(lib3mf_binarystream_enablelzma(m_pHandle, nLZMALevel)); + } + + /** + * CBinaryStream::DisableLZMA - Disables LZMA mode. + */ + void CBinaryStream::DisableLZMA() + { + CheckError(lib3mf_binarystream_disablelzma(m_pHandle)); + } + /** * Method definitions for class CWriter */ @@ -2125,10 +2615,95 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) CheckError(lib3mf_writer_setcontentencryptioncallback(m_pHandle, pTheCallback, pUserData)); } + /** + * CWriter::CreateBinaryStream - Creates a binary stream object. Only applicable for 3MF Writers. + * @param[in] sIndexPath - Package path to write the index into + * @param[in] sBinaryPath - Package path to write raw binary data into + * @return Returns a package path. + */ + PBinaryStream CWriter::CreateBinaryStream(const std::string & sIndexPath, const std::string & sBinaryPath) + { + Lib3MFHandle hBinaryStream = nullptr; + CheckError(lib3mf_writer_createbinarystream(m_pHandle, sIndexPath.c_str(), sBinaryPath.c_str(), &hBinaryStream)); + + if (!hBinaryStream) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBinaryStream))); + } + + /** + * CWriter::AssignBinaryStream - Sets a binary stream for an object. Currently supported objects are Meshes and Toolpath layers. + * @param[in] pInstance - Object instance to assign Binary stream to. + * @param[in] pBinaryStream - Binary stream object to use for this layer. + */ + void CWriter::AssignBinaryStream(classParam pInstance, classParam pBinaryStream) + { + Lib3MFHandle hInstance = pInstance.GetHandle(); + Lib3MFHandle hBinaryStream = pBinaryStream.GetHandle(); + CheckError(lib3mf_writer_assignbinarystream(m_pHandle, hInstance, hBinaryStream)); + } + + /** + * CWriter::RegisterCustomNamespace - Registers a custom 3MF Namespace. Fails if Prefix is already registered. + * @param[in] sPrefix - Prefix to be used. MUST NOT be empty. MUST be alphanumeric, not starting with a number + * @param[in] sNameSpace - Namespace to be used. MUST NOT be empty. MUST be alphanumeric, not starting with a number + */ + void CWriter::RegisterCustomNamespace(const std::string & sPrefix, const std::string & sNameSpace) + { + CheckError(lib3mf_writer_registercustomnamespace(m_pHandle, sPrefix.c_str(), sNameSpace.c_str())); + } + + /** + * Method definitions for class CPersistentReaderSource + */ + + /** + * CPersistentReaderSource::GetSourceType - Retrieves the type of source data. + * @return Reader Source Type + */ + ePersistentReaderSourceType CPersistentReaderSource::GetSourceType() + { + ePersistentReaderSourceType resultSourceType = (ePersistentReaderSourceType) 0; + CheckError(lib3mf_persistentreadersource_getsourcetype(m_pHandle, &resultSourceType)); + + return resultSourceType; + } + + /** + * CPersistentReaderSource::InvalidateSourceData - Invalidates the reader source. Every subsequent read on this data will fail. + */ + void CPersistentReaderSource::InvalidateSourceData() + { + CheckError(lib3mf_persistentreadersource_invalidatesourcedata(m_pHandle)); + } + + /** + * CPersistentReaderSource::SourceDataIsValid - Checks if the source data is valid. Any read on an invalid source object will fail. + * @return The source data is valid. + */ + bool CPersistentReaderSource::SourceDataIsValid() + { + bool resultDataIsValid = 0; + CheckError(lib3mf_persistentreadersource_sourcedataisvalid(m_pHandle, &resultDataIsValid)); + + return resultDataIsValid; + } + /** * Method definitions for class CReader */ + /** + * CReader::ReadFromPersistentSource - Reads a model from a persistent source object. The object will be referenced until the Model is destroyed or cleared. + * @param[in] pSource - Source object to read from + */ + void CReader::ReadFromPersistentSource(classParam pSource) + { + Lib3MFHandle hSource = pSource.GetHandle(); + CheckError(lib3mf_reader_readfrompersistentsource(m_pHandle, hSource)); + } + /** * CReader::ReadFromFile - Reads a model from a file. The file type is specified by the Model Reader class * @param[in] sFilename - Filename to read from @@ -2422,2445 +2997,4081 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) } /** - * Method definitions for class CSliceStackIterator + * Method definitions for class CCustomXMLAttribute */ /** - * CSliceStackIterator::GetCurrentSliceStack - Returns the SliceStack the iterator points at. - * @return returns the SliceStack instance. + * CCustomXMLAttribute::GetName - Retrieves name of the attribute. + * @return returns the name of the attribute. */ - PSliceStack CSliceStackIterator::GetCurrentSliceStack() + std::string CCustomXMLAttribute::GetName() { - Lib3MFHandle hResource = nullptr; - CheckError(lib3mf_slicestackiterator_getcurrentslicestack(m_pHandle, &hResource)); + Lib3MF_uint32 bytesNeededName = 0; + Lib3MF_uint32 bytesWrittenName = 0; + CheckError(lib3mf_customxmlattribute_getname(m_pHandle, 0, &bytesNeededName, nullptr)); + std::vector bufferName(bytesNeededName); + CheckError(lib3mf_customxmlattribute_getname(m_pHandle, bytesNeededName, &bytesWrittenName, &bufferName[0])); - if (!hResource) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + return std::string(&bufferName[0]); } /** - * Method definitions for class CObjectIterator - */ - - /** - * CObjectIterator::GetCurrentObject - Returns the Object the iterator points at. - * @return returns the Object instance. + * CCustomXMLAttribute::GetValue - Retrieves value of the attribute as string. + * @return returns the value of the attribute. */ - PObject CObjectIterator::GetCurrentObject() + std::string CCustomXMLAttribute::GetValue() { - Lib3MFHandle hResource = nullptr; - CheckError(lib3mf_objectiterator_getcurrentobject(m_pHandle, &hResource)); + Lib3MF_uint32 bytesNeededValue = 0; + Lib3MF_uint32 bytesWrittenValue = 0; + CheckError(lib3mf_customxmlattribute_getvalue(m_pHandle, 0, &bytesNeededValue, nullptr)); + std::vector bufferValue(bytesNeededValue); + CheckError(lib3mf_customxmlattribute_getvalue(m_pHandle, bytesNeededValue, &bytesWrittenValue, &bufferValue[0])); - if (!hResource) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + return std::string(&bufferValue[0]); } /** - * Method definitions for class CMeshObjectIterator - */ - - /** - * CMeshObjectIterator::GetCurrentMeshObject - Returns the MeshObject the iterator points at. - * @return returns the MeshObject instance. + * CCustomXMLAttribute::IsValidInteger - Checks if the value is a valid integer in the given range. + * @param[in] nMinValue - Minimum allowed value + * @param[in] nMaxValue - Maximum allowed value + * @return returns if the value is a valid integer. */ - PMeshObject CMeshObjectIterator::GetCurrentMeshObject() + bool CCustomXMLAttribute::IsValidInteger(const Lib3MF_int64 nMinValue, const Lib3MF_int64 nMaxValue) { - Lib3MFHandle hResource = nullptr; - CheckError(lib3mf_meshobjectiterator_getcurrentmeshobject(m_pHandle, &hResource)); + bool resultIsValid = 0; + CheckError(lib3mf_customxmlattribute_isvalidinteger(m_pHandle, nMinValue, nMaxValue, &resultIsValid)); - if (!hResource) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + return resultIsValid; } /** - * Method definitions for class CComponentsObjectIterator - */ - - /** - * CComponentsObjectIterator::GetCurrentComponentsObject - Returns the ComponentsObject the iterator points at. - * @return returns the ComponentsObject instance. + * CCustomXMLAttribute::GetIntegerValue - Returns the value as integer. Fails if the value is not a valid integer in the given range. + * @param[in] nMinValue - Minimum allowed value + * @param[in] nMaxValue - Maximum allowed value + * @return returns the value. */ - PComponentsObject CComponentsObjectIterator::GetCurrentComponentsObject() + Lib3MF_int64 CCustomXMLAttribute::GetIntegerValue(const Lib3MF_int64 nMinValue, const Lib3MF_int64 nMaxValue) { - Lib3MFHandle hResource = nullptr; - CheckError(lib3mf_componentsobjectiterator_getcurrentcomponentsobject(m_pHandle, &hResource)); + Lib3MF_int64 resultValue = 0; + CheckError(lib3mf_customxmlattribute_getintegervalue(m_pHandle, nMinValue, nMaxValue, &resultValue)); - if (!hResource) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + return resultValue; } /** - * Method definitions for class CTexture2DIterator - */ - - /** - * CTexture2DIterator::GetCurrentTexture2D - Returns the Texture2D the iterator points at. - * @return returns the Texture2D instance. + * CCustomXMLAttribute::IsValidDouble - Checks if the value is a valid double in the given range. + * @param[in] dMinValue - Minimum allowed value + * @param[in] dMaxValue - Maximum allowed value + * @return returns if the value is a valid double. */ - PTexture2D CTexture2DIterator::GetCurrentTexture2D() + bool CCustomXMLAttribute::IsValidDouble(const Lib3MF_double dMinValue, const Lib3MF_double dMaxValue) { - Lib3MFHandle hResource = nullptr; - CheckError(lib3mf_texture2diterator_getcurrenttexture2d(m_pHandle, &hResource)); + bool resultIsValid = 0; + CheckError(lib3mf_customxmlattribute_isvaliddouble(m_pHandle, dMinValue, dMaxValue, &resultIsValid)); - if (!hResource) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + return resultIsValid; } /** - * Method definitions for class CBaseMaterialGroupIterator - */ + * CCustomXMLAttribute::GetDoubleValue - Returns the value as double. Fails if the value is not a valid double in the given range. + * @param[in] dMinValue - Minimum allowed value + * @param[in] dMaxValue - Maximum allowed value + * @return returns the value . + */ + Lib3MF_double CCustomXMLAttribute::GetDoubleValue(const Lib3MF_double dMinValue, const Lib3MF_double dMaxValue) + { + Lib3MF_double resultValue = 0; + CheckError(lib3mf_customxmlattribute_getdoublevalue(m_pHandle, dMinValue, dMaxValue, &resultValue)); + + return resultValue; + } /** - * CBaseMaterialGroupIterator::GetCurrentBaseMaterialGroup - Returns the MaterialGroup the iterator points at. - * @return returns the BaseMaterialGroup instance. + * CCustomXMLAttribute::IsValidBool - Checks if the value is a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. + * @return returns if the value is a valid bool. */ - PBaseMaterialGroup CBaseMaterialGroupIterator::GetCurrentBaseMaterialGroup() + bool CCustomXMLAttribute::IsValidBool() { - Lib3MFHandle hResource = nullptr; - CheckError(lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup(m_pHandle, &hResource)); + bool resultIsValid = 0; + CheckError(lib3mf_customxmlattribute_isvalidbool(m_pHandle, &resultIsValid)); - if (!hResource) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + return resultIsValid; } /** - * Method definitions for class CColorGroupIterator - */ + * CCustomXMLAttribute::GetBoolValue - Returns the value as bool. Fails if the value is not a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. + * @param[in] dMinValue - Minimum allowed value + * @param[in] dMaxValue - Maximum allowed value + * @return returns the value . + */ + bool CCustomXMLAttribute::GetBoolValue(const Lib3MF_double dMinValue, const Lib3MF_double dMaxValue) + { + bool resultValue = 0; + CheckError(lib3mf_customxmlattribute_getboolvalue(m_pHandle, dMinValue, dMaxValue, &resultValue)); + + return resultValue; + } /** - * CColorGroupIterator::GetCurrentColorGroup - Returns the ColorGroup the iterator points at. - * @return returns the ColorGroup instance. + * CCustomXMLAttribute::SetValue - Sets the value of the attribute as string. + * @param[in] sValue - new value of the attribute. */ - PColorGroup CColorGroupIterator::GetCurrentColorGroup() + void CCustomXMLAttribute::SetValue(const std::string & sValue) { - Lib3MFHandle hResource = nullptr; - CheckError(lib3mf_colorgroupiterator_getcurrentcolorgroup(m_pHandle, &hResource)); - - if (!hResource) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + CheckError(lib3mf_customxmlattribute_setvalue(m_pHandle, sValue.c_str())); } /** - * Method definitions for class CTexture2DGroupIterator - */ + * CCustomXMLAttribute::SetIntegerValue - Sets the value of the attribute as integer. + * @param[in] nValue - new value of the attribute. + */ + void CCustomXMLAttribute::SetIntegerValue(const Lib3MF_int64 nValue) + { + CheckError(lib3mf_customxmlattribute_setintegervalue(m_pHandle, nValue)); + } /** - * CTexture2DGroupIterator::GetCurrentTexture2DGroup - Returns the Texture2DGroup the iterator points at. - * @return returns the Texture2DGroup instance. + * CCustomXMLAttribute::SetDoubleValue - Sets the value of the attribute as double. + * @param[in] dValue - new value of the attribute. */ - PTexture2DGroup CTexture2DGroupIterator::GetCurrentTexture2DGroup() + void CCustomXMLAttribute::SetDoubleValue(const Lib3MF_double dValue) { - Lib3MFHandle hResource = nullptr; - CheckError(lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup(m_pHandle, &hResource)); - - if (!hResource) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + CheckError(lib3mf_customxmlattribute_setdoublevalue(m_pHandle, dValue)); } /** - * Method definitions for class CCompositeMaterialsIterator - */ + * CCustomXMLAttribute::SetBoolValue - Sets the value of the attribute as bool. + * @param[in] bValue - new value of the attribute. + */ + void CCustomXMLAttribute::SetBoolValue(const bool bValue) + { + CheckError(lib3mf_customxmlattribute_setboolvalue(m_pHandle, bValue)); + } /** - * CCompositeMaterialsIterator::GetCurrentCompositeMaterials - Returns the CompositeMaterials the iterator points at. - * @return returns the CompositeMaterials instance. + * CCustomXMLAttribute::Remove - Removes the attribute from its parent node. All subsequent calls to the class will fail. */ - PCompositeMaterials CCompositeMaterialsIterator::GetCurrentCompositeMaterials() + void CCustomXMLAttribute::Remove() { - Lib3MFHandle hResource = nullptr; - CheckError(lib3mf_compositematerialsiterator_getcurrentcompositematerials(m_pHandle, &hResource)); - - if (!hResource) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + CheckError(lib3mf_customxmlattribute_remove(m_pHandle)); } /** - * Method definitions for class CMultiPropertyGroupIterator + * Method definitions for class CCustomXMLNode */ /** - * CMultiPropertyGroupIterator::GetCurrentMultiPropertyGroup - Returns the MultiPropertyGroup the iterator points at. - * @return returns the MultiPropertyGroup instance. + * CCustomXMLNode::GetName - Retrieves name of the node. + * @return returns the name of the node. */ - PMultiPropertyGroup CMultiPropertyGroupIterator::GetCurrentMultiPropertyGroup() + std::string CCustomXMLNode::GetName() { - Lib3MFHandle hResource = nullptr; - CheckError(lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup(m_pHandle, &hResource)); + Lib3MF_uint32 bytesNeededName = 0; + Lib3MF_uint32 bytesWrittenName = 0; + CheckError(lib3mf_customxmlnode_getname(m_pHandle, 0, &bytesNeededName, nullptr)); + std::vector bufferName(bytesNeededName); + CheckError(lib3mf_customxmlnode_getname(m_pHandle, bytesNeededName, &bytesWrittenName, &bufferName[0])); - if (!hResource) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + return std::string(&bufferName[0]); } /** - * Method definitions for class CMetaData - */ - - /** - * CMetaData::GetNameSpace - returns the namespace URL of the metadata - * @return the namespace URL of the metadata + * CCustomXMLNode::GetNameSpace - Retrieves namespace of the node. + * @return returns the namespace of the node. */ - std::string CMetaData::GetNameSpace() + std::string CCustomXMLNode::GetNameSpace() { Lib3MF_uint32 bytesNeededNameSpace = 0; Lib3MF_uint32 bytesWrittenNameSpace = 0; - CheckError(lib3mf_metadata_getnamespace(m_pHandle, 0, &bytesNeededNameSpace, nullptr)); + CheckError(lib3mf_customxmlnode_getnamespace(m_pHandle, 0, &bytesNeededNameSpace, nullptr)); std::vector bufferNameSpace(bytesNeededNameSpace); - CheckError(lib3mf_metadata_getnamespace(m_pHandle, bytesNeededNameSpace, &bytesWrittenNameSpace, &bufferNameSpace[0])); + CheckError(lib3mf_customxmlnode_getnamespace(m_pHandle, bytesNeededNameSpace, &bytesWrittenNameSpace, &bufferNameSpace[0])); return std::string(&bufferNameSpace[0]); } /** - * CMetaData::SetNameSpace - sets a new namespace URL of the metadata - * @param[in] sNameSpace - the new namespace URL of the metadata + * CCustomXMLNode::GetAttributeCount - Returns number of attributes. + * @return returns the number of attributes. */ - void CMetaData::SetNameSpace(const std::string & sNameSpace) + Lib3MF_uint64 CCustomXMLNode::GetAttributeCount() { - CheckError(lib3mf_metadata_setnamespace(m_pHandle, sNameSpace.c_str())); + Lib3MF_uint64 resultCount = 0; + CheckError(lib3mf_customxmlnode_getattributecount(m_pHandle, &resultCount)); + + return resultCount; } /** - * CMetaData::GetName - returns the name of a metadata - * @return the name of the metadata + * CCustomXMLNode::GetAttribute - Returns attribute instance. Fails if Index is out of range. + * @param[in] nIndex - Index of the attribute to return (0-based). + * @return XML Document attribute. */ - std::string CMetaData::GetName() + PCustomXMLAttribute CCustomXMLNode::GetAttribute(const Lib3MF_uint64 nIndex) { - Lib3MF_uint32 bytesNeededName = 0; - Lib3MF_uint32 bytesWrittenName = 0; - CheckError(lib3mf_metadata_getname(m_pHandle, 0, &bytesNeededName, nullptr)); - std::vector bufferName(bytesNeededName); - CheckError(lib3mf_metadata_getname(m_pHandle, bytesNeededName, &bytesWrittenName, &bufferName[0])); + Lib3MFHandle hAttributeInstance = nullptr; + CheckError(lib3mf_customxmlnode_getattribute(m_pHandle, nIndex, &hAttributeInstance)); - return std::string(&bufferName[0]); + if (!hAttributeInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hAttributeInstance))); } /** - * CMetaData::SetName - sets a new name of a metadata - * @param[in] sName - the new name of the metadata + * CCustomXMLNode::HasAttribute - Returns if attribute of a specific name exists. + * @param[in] sName - Name of the attribute. + * @return Returns if the attribute exists. */ - void CMetaData::SetName(const std::string & sName) + bool CCustomXMLNode::HasAttribute(const std::string & sName) { - CheckError(lib3mf_metadata_setname(m_pHandle, sName.c_str())); + bool resultAttributeExists = 0; + CheckError(lib3mf_customxmlnode_hasattribute(m_pHandle, sName.c_str(), &resultAttributeExists)); + + return resultAttributeExists; } /** - * CMetaData::GetKey - returns the (namespace+name) of a metadata - * @return the key (namespace+name) of the metadata + * CCustomXMLNode::FindAttribute - Returns attribute instance of a specific name. + * @param[in] sName - Name of the attribute. + * @param[in] bMustExist - If true, the call fails if attribute does not exist. If falls, the call will return null if the attribute does not exist. + * @return XML Document attribute. */ - std::string CMetaData::GetKey() + PCustomXMLAttribute CCustomXMLNode::FindAttribute(const std::string & sName, const bool bMustExist) { - Lib3MF_uint32 bytesNeededKey = 0; - Lib3MF_uint32 bytesWrittenKey = 0; - CheckError(lib3mf_metadata_getkey(m_pHandle, 0, &bytesNeededKey, nullptr)); - std::vector bufferKey(bytesNeededKey); - CheckError(lib3mf_metadata_getkey(m_pHandle, bytesNeededKey, &bytesWrittenKey, &bufferKey[0])); + Lib3MFHandle hAttributeInstance = nullptr; + CheckError(lib3mf_customxmlnode_findattribute(m_pHandle, sName.c_str(), bMustExist, &hAttributeInstance)); - return std::string(&bufferKey[0]); + if (hAttributeInstance) { + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hAttributeInstance))); + } else { + return nullptr; + } } /** - * CMetaData::GetMustPreserve - returns, whether a metadata must be preserved - * @return returns, whether a metadata must be preserved + * CCustomXMLNode::RemoveAttribute - Removes the attribute with a specific name. Does nothing if attribute does not exist. + * @param[in] sName - Name of the attribute. + * @return Returns true if an attribute was removed. */ - bool CMetaData::GetMustPreserve() + bool CCustomXMLNode::RemoveAttribute(const std::string & sName) { - bool resultMustPreserve = 0; - CheckError(lib3mf_metadata_getmustpreserve(m_pHandle, &resultMustPreserve)); + bool resultAttributeRemoved = 0; + CheckError(lib3mf_customxmlnode_removeattribute(m_pHandle, sName.c_str(), &resultAttributeRemoved)); - return resultMustPreserve; + return resultAttributeRemoved; } /** - * CMetaData::SetMustPreserve - sets whether a metadata must be preserved - * @param[in] bMustPreserve - a new value whether a metadata must be preserved + * CCustomXMLNode::RemoveAttributeByIndex - Removes the attribute with a specific index. Fails if index is invalid + * @param[in] nIndex - Index of the attribute to remove (0-based). + * @return Returns true if an attribute was removed. */ - void CMetaData::SetMustPreserve(const bool bMustPreserve) + bool CCustomXMLNode::RemoveAttributeByIndex(const Lib3MF_uint64 nIndex) { - CheckError(lib3mf_metadata_setmustpreserve(m_pHandle, bMustPreserve)); + bool resultAttributeRemoved = 0; + CheckError(lib3mf_customxmlnode_removeattributebyindex(m_pHandle, nIndex, &resultAttributeRemoved)); + + return resultAttributeRemoved; } /** - * CMetaData::GetType - returns the type of a metadata - * @return the type of the metadata + * CCustomXMLNode::AddAttribute - Adds an attribute with a specific name and string value. Fails if attribute already exists. + * @param[in] sName - Name of the attribute. + * @param[in] sValue - Value of the attribute. */ - std::string CMetaData::GetType() + void CCustomXMLNode::AddAttribute(const std::string & sName, const std::string & sValue) { - Lib3MF_uint32 bytesNeededType = 0; - Lib3MF_uint32 bytesWrittenType = 0; - CheckError(lib3mf_metadata_gettype(m_pHandle, 0, &bytesNeededType, nullptr)); - std::vector bufferType(bytesNeededType); - CheckError(lib3mf_metadata_gettype(m_pHandle, bytesNeededType, &bytesWrittenType, &bufferType[0])); - - return std::string(&bufferType[0]); + CheckError(lib3mf_customxmlnode_addattribute(m_pHandle, sName.c_str(), sValue.c_str())); } /** - * CMetaData::SetType - sets a new type of a metadata. This must be a simple XML type - * @param[in] sType - a new type of the metadata + * CCustomXMLNode::AddIntegerAttribute - Adds an attribute with a specific name and integer value. Fails if attribute already exists. + * @param[in] sName - Name of the attribute. + * @param[in] nValue - Value of the attribute. */ - void CMetaData::SetType(const std::string & sType) + void CCustomXMLNode::AddIntegerAttribute(const std::string & sName, const Lib3MF_int64 nValue) { - CheckError(lib3mf_metadata_settype(m_pHandle, sType.c_str())); + CheckError(lib3mf_customxmlnode_addintegerattribute(m_pHandle, sName.c_str(), nValue)); } /** - * CMetaData::GetValue - returns the value of the metadata - * @return the value of the metadata + * CCustomXMLNode::AddDoubleAttribute - Adds an attribute with a specific name and double value. Fails if attribute already exists. + * @param[in] sName - Name of the attribute. + * @param[in] dValue - Value of the attribute. */ - std::string CMetaData::GetValue() + void CCustomXMLNode::AddDoubleAttribute(const std::string & sName, const Lib3MF_double dValue) { - Lib3MF_uint32 bytesNeededValue = 0; - Lib3MF_uint32 bytesWrittenValue = 0; - CheckError(lib3mf_metadata_getvalue(m_pHandle, 0, &bytesNeededValue, nullptr)); - std::vector bufferValue(bytesNeededValue); - CheckError(lib3mf_metadata_getvalue(m_pHandle, bytesNeededValue, &bytesWrittenValue, &bufferValue[0])); - - return std::string(&bufferValue[0]); + CheckError(lib3mf_customxmlnode_adddoubleattribute(m_pHandle, sName.c_str(), dValue)); } /** - * CMetaData::SetValue - sets a new value of the metadata - * @param[in] sValue - a new value of the metadata + * CCustomXMLNode::AddBoolAttribute - Adds an attribute with a specific name and bool value. Fails if attribute already exists. + * @param[in] sName - Name of the attribute. + * @param[in] bValue - Value of the attribute. */ - void CMetaData::SetValue(const std::string & sValue) + void CCustomXMLNode::AddBoolAttribute(const std::string & sName, const bool bValue) { - CheckError(lib3mf_metadata_setvalue(m_pHandle, sValue.c_str())); + CheckError(lib3mf_customxmlnode_addboolattribute(m_pHandle, sName.c_str(), bValue)); } /** - * Method definitions for class CMetaDataGroup - */ + * CCustomXMLNode::GetChildren - Returns all the child nodes of the XML Node. + * @return returns the list of child nodes. + */ + PCustomXMLNodes CCustomXMLNode::GetChildren() + { + Lib3MFHandle hChildNodes = nullptr; + CheckError(lib3mf_customxmlnode_getchildren(m_pHandle, &hChildNodes)); + + if (!hChildNodes) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hChildNodes))); + } /** - * CMetaDataGroup::GetMetaDataCount - returns the number of metadata in this metadatagroup - * @return returns the number metadata + * CCustomXMLNode::CountChildrenByName - Returns how many children of the XML Node have a specific name. + * @param[in] sName - Name of the node. + * @return returns the number children with the specified name. */ - Lib3MF_uint32 CMetaDataGroup::GetMetaDataCount() + Lib3MF_uint64 CCustomXMLNode::CountChildrenByName(const std::string & sName) { - Lib3MF_uint32 resultCount = 0; - CheckError(lib3mf_metadatagroup_getmetadatacount(m_pHandle, &resultCount)); + Lib3MF_uint64 resultCount = 0; + CheckError(lib3mf_customxmlnode_countchildrenbyname(m_pHandle, sName.c_str(), &resultCount)); return resultCount; } /** - * CMetaDataGroup::GetMetaData - returns a metadata value within this metadatagroup - * @param[in] nIndex - Index of the Metadata. - * @return an instance of the metadata + * CCustomXMLNode::GetChildrenByName - Returns all the child nodes of the XML Node with a specific name. + * @param[in] sName - Name of the child. + * @return returns the list of child nodes. */ - PMetaData CMetaDataGroup::GetMetaData(const Lib3MF_uint32 nIndex) + PCustomXMLNodes CCustomXMLNode::GetChildrenByName(const std::string & sName) { - Lib3MFHandle hMetaData = nullptr; - CheckError(lib3mf_metadatagroup_getmetadata(m_pHandle, nIndex, &hMetaData)); + Lib3MFHandle hChildNodes = nullptr; + CheckError(lib3mf_customxmlnode_getchildrenbyname(m_pHandle, sName.c_str(), &hChildNodes)); - if (!hMetaData) { + if (!hChildNodes) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMetaData))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hChildNodes))); } /** - * CMetaDataGroup::GetMetaDataByKey - returns a metadata value within this metadatagroup - * @param[in] sNameSpace - the namespace of the metadata - * @param[in] sName - the name of the Metadata - * @return an instance of the metadata + * CCustomXMLNode::HasChild - Returns if a child with a specific name exist. + * @param[in] sName - Name of the child. + * @return returns if a child with a specific name exists. */ - PMetaData CMetaDataGroup::GetMetaDataByKey(const std::string & sNameSpace, const std::string & sName) + bool CCustomXMLNode::HasChild(const std::string & sName) { - Lib3MFHandle hMetaData = nullptr; - CheckError(lib3mf_metadatagroup_getmetadatabykey(m_pHandle, sNameSpace.c_str(), sName.c_str(), &hMetaData)); + bool resultChildExists = 0; + CheckError(lib3mf_customxmlnode_haschild(m_pHandle, sName.c_str(), &resultChildExists)); - if (!hMetaData) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMetaData))); + return resultChildExists; } /** - * CMetaDataGroup::RemoveMetaDataByIndex - removes metadata by index from the model. - * @param[in] nIndex - Index of the metadata to remove + * CCustomXMLNode::HasUniqueChild - Returns if a child with a specific name exist once and only once. + * @param[in] sName - Name of the child. + * @return returns if a child with a specific name exists once and only once. */ - void CMetaDataGroup::RemoveMetaDataByIndex(const Lib3MF_uint32 nIndex) + bool CCustomXMLNode::HasUniqueChild(const std::string & sName) { - CheckError(lib3mf_metadatagroup_removemetadatabyindex(m_pHandle, nIndex)); + bool resultChildExists = 0; + CheckError(lib3mf_customxmlnode_hasuniquechild(m_pHandle, sName.c_str(), &resultChildExists)); + + return resultChildExists; } /** - * CMetaDataGroup::RemoveMetaData - removes metadata from the model. - * @param[in] pTheMetaData - The metadata to remove + * CCustomXMLNode::FindChild - Returns child with a specific name. Throws an error if name does not exist once and only once. + * @param[in] sName - Name of the child. + * @param[in] bMustExist - If true, the call fails if child does not exist. If falls, the call will return null if the child does not exist. + * @return returns child instance or null. */ - void CMetaDataGroup::RemoveMetaData(classParam pTheMetaData) + PCustomXMLNode CCustomXMLNode::FindChild(const std::string & sName, const bool bMustExist) { - Lib3MFHandle hTheMetaData = pTheMetaData.GetHandle(); - CheckError(lib3mf_metadatagroup_removemetadata(m_pHandle, hTheMetaData)); + Lib3MFHandle hChildInstance = nullptr; + CheckError(lib3mf_customxmlnode_findchild(m_pHandle, sName.c_str(), bMustExist, &hChildInstance)); + + if (hChildInstance) { + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hChildInstance))); + } else { + return nullptr; + } } /** - * CMetaDataGroup::AddMetaData - adds a new metadata to this metadatagroup - * @param[in] sNameSpace - the namespace of the metadata - * @param[in] sName - the name of the metadata - * @param[in] sValue - the value of the metadata - * @param[in] sType - the type of the metadata - * @param[in] bMustPreserve - shuold the metadata be preserved - * @return a new instance of the metadata + * CCustomXMLNode::AddChild - Adds a new child with a specific name. + * @param[in] sName - Name of the child. + * @return returns child instance. */ - PMetaData CMetaDataGroup::AddMetaData(const std::string & sNameSpace, const std::string & sName, const std::string & sValue, const std::string & sType, const bool bMustPreserve) + PCustomXMLNode CCustomXMLNode::AddChild(const std::string & sName) { - Lib3MFHandle hMetaData = nullptr; - CheckError(lib3mf_metadatagroup_addmetadata(m_pHandle, sNameSpace.c_str(), sName.c_str(), sValue.c_str(), sType.c_str(), bMustPreserve, &hMetaData)); + Lib3MFHandle hChildInstance = nullptr; + CheckError(lib3mf_customxmlnode_addchild(m_pHandle, sName.c_str(), &hChildInstance)); - if (!hMetaData) { + if (!hChildInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMetaData))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hChildInstance))); } /** - * Method definitions for class CObject - */ - - /** - * CObject::GetType - Retrieves an object's type - * @return returns object type enum. + * CCustomXMLNode::RemoveChild - Removes a specific child. All subsequent calls to the child will fail after the call. + * @param[in] pChildInstance - child instance to remove. Fails if given instance is not a child of the node. */ - eObjectType CObject::GetType() + void CCustomXMLNode::RemoveChild(classParam pChildInstance) { - eObjectType resultObjectType = (eObjectType) 0; - CheckError(lib3mf_object_gettype(m_pHandle, &resultObjectType)); - - return resultObjectType; + Lib3MFHandle hChildInstance = pChildInstance.GetHandle(); + CheckError(lib3mf_customxmlnode_removechild(m_pHandle, hChildInstance)); } /** - * CObject::SetType - Sets an object's type - * @param[in] eObjectType - object type enum. + * CCustomXMLNode::RemoveChildrenWithName - Removes all children with a specific name. Does nothing if no child with the name exists. All subsequent calls to the deleted children will fail after the call. + * @param[in] sName - Name of the children. + * @return Returns how many children have been deleted. */ - void CObject::SetType(const eObjectType eObjectType) + Lib3MF_uint64 CCustomXMLNode::RemoveChildrenWithName(const std::string & sName) { - CheckError(lib3mf_object_settype(m_pHandle, eObjectType)); + Lib3MF_uint64 resultNumberOfDeletedChildren = 0; + CheckError(lib3mf_customxmlnode_removechildrenwithname(m_pHandle, sName.c_str(), &resultNumberOfDeletedChildren)); + + return resultNumberOfDeletedChildren; } /** - * CObject::GetName - Retrieves an object's name - * @return returns object name. + * CCustomXMLNode::Remove - Removes the node from its parent. The root node of the document can not be removed. Any subsequent call to the node fails after this. */ - std::string CObject::GetName() + void CCustomXMLNode::Remove() { - Lib3MF_uint32 bytesNeededName = 0; - Lib3MF_uint32 bytesWrittenName = 0; - CheckError(lib3mf_object_getname(m_pHandle, 0, &bytesNeededName, nullptr)); - std::vector bufferName(bytesNeededName); - CheckError(lib3mf_object_getname(m_pHandle, bytesNeededName, &bytesWrittenName, &bufferName[0])); - - return std::string(&bufferName[0]); + CheckError(lib3mf_customxmlnode_remove(m_pHandle)); } /** - * CObject::SetName - Sets an object's name string - * @param[in] sName - new object name. - */ - void CObject::SetName(const std::string & sName) - { - CheckError(lib3mf_object_setname(m_pHandle, sName.c_str())); - } + * Method definitions for class CCustomXMLNodes + */ /** - * CObject::GetPartNumber - Retrieves an object's part number - * @return returns object part number. + * CCustomXMLNodes::GetNodeCount - Returns number of nodes. + * @return returns the number of nodes in the list. */ - std::string CObject::GetPartNumber() + Lib3MF_uint64 CCustomXMLNodes::GetNodeCount() { - Lib3MF_uint32 bytesNeededPartNumber = 0; - Lib3MF_uint32 bytesWrittenPartNumber = 0; - CheckError(lib3mf_object_getpartnumber(m_pHandle, 0, &bytesNeededPartNumber, nullptr)); - std::vector bufferPartNumber(bytesNeededPartNumber); - CheckError(lib3mf_object_getpartnumber(m_pHandle, bytesNeededPartNumber, &bytesWrittenPartNumber, &bufferPartNumber[0])); + Lib3MF_uint64 resultCount = 0; + CheckError(lib3mf_customxmlnodes_getnodecount(m_pHandle, &resultCount)); - return std::string(&bufferPartNumber[0]); + return resultCount; } /** - * CObject::SetPartNumber - Sets an objects partnumber string - * @param[in] sPartNumber - new object part number. + * CCustomXMLNodes::GetNode - Returns node instance. Fails if Index is out of range. + * @param[in] nIndex - Index of the node to return (0-based). + * @return XML Node node. */ - void CObject::SetPartNumber(const std::string & sPartNumber) + PCustomXMLNode CCustomXMLNodes::GetNode(const Lib3MF_uint64 nIndex) { - CheckError(lib3mf_object_setpartnumber(m_pHandle, sPartNumber.c_str())); + Lib3MFHandle hNodeInstance = nullptr; + CheckError(lib3mf_customxmlnodes_getnode(m_pHandle, nIndex, &hNodeInstance)); + + if (!hNodeInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNodeInstance))); } /** - * CObject::IsMeshObject - Retrieves, if an object is a mesh object - * @return returns, whether the object is a mesh object + * CCustomXMLNodes::CountNodesByName - Returns how many nodes of the XML Node have a specific name. + * @param[in] sName - Name of the node. + * @return returns the number of nodes with the specified name. */ - bool CObject::IsMeshObject() + Lib3MF_uint64 CCustomXMLNodes::CountNodesByName(const std::string & sName) { - bool resultIsMeshObject = 0; - CheckError(lib3mf_object_ismeshobject(m_pHandle, &resultIsMeshObject)); + Lib3MF_uint64 resultCount = 0; + CheckError(lib3mf_customxmlnodes_countnodesbyname(m_pHandle, sName.c_str(), &resultCount)); - return resultIsMeshObject; + return resultCount; } /** - * CObject::IsComponentsObject - Retrieves, if an object is a components object - * @return returns, whether the object is a components object + * CCustomXMLNodes::GetNodesByName - Returns all the nodes nodes of the XML Node with a specific name. + * @param[in] sName - Name of the node. + * @return returns the list of node nodes. */ - bool CObject::IsComponentsObject() + PCustomXMLNodes CCustomXMLNodes::GetNodesByName(const std::string & sName) { - bool resultIsComponentsObject = 0; - CheckError(lib3mf_object_iscomponentsobject(m_pHandle, &resultIsComponentsObject)); + Lib3MFHandle hNodes = nullptr; + CheckError(lib3mf_customxmlnodes_getnodesbyname(m_pHandle, sName.c_str(), &hNodes)); - return resultIsComponentsObject; + if (!hNodes) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNodes))); } /** - * CObject::IsValid - Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. - * @return returns whether the object is a valid object description + * CCustomXMLNodes::HasNode - Returns if a node with a specific name exist. + * @param[in] sName - Name of the node. + * @return returns if a node with a specific name exists. */ - bool CObject::IsValid() + bool CCustomXMLNodes::HasNode(const std::string & sName) { - bool resultIsValid = 0; - CheckError(lib3mf_object_isvalid(m_pHandle, &resultIsValid)); + bool resultNodeExists = 0; + CheckError(lib3mf_customxmlnodes_hasnode(m_pHandle, sName.c_str(), &resultNodeExists)); - return resultIsValid; + return resultNodeExists; } /** - * CObject::SetAttachmentAsThumbnail - Use an existing attachment as thumbnail for this object - * @param[in] pAttachment - Instance of a new or the existing thumbnailattachment object. + * CCustomXMLNodes::HasUniqueNode - Returns if a node with a specific name exist once and only once. + * @param[in] sName - Name of the node. + * @return returns if a node with a specific name exists once and only once. */ - void CObject::SetAttachmentAsThumbnail(classParam pAttachment) + bool CCustomXMLNodes::HasUniqueNode(const std::string & sName) { - Lib3MFHandle hAttachment = pAttachment.GetHandle(); - CheckError(lib3mf_object_setattachmentasthumbnail(m_pHandle, hAttachment)); + bool resultNodeExists = 0; + CheckError(lib3mf_customxmlnodes_hasuniquenode(m_pHandle, sName.c_str(), &resultNodeExists)); + + return resultNodeExists; } /** - * CObject::GetThumbnailAttachment - Get the attachment containing the object thumbnail. - * @return Instance of the thumbnailattachment object or NULL. + * CCustomXMLNodes::FindNode - Returns node with a specific name. Throws an error if name does not exist once and only once. + * @param[in] sName - Name of the node. + * @param[in] bMustExist - If true, the call fails if node does not exist. If falls, the call will return null if the node does not exist. + * @return returns node instance. */ - PAttachment CObject::GetThumbnailAttachment() + PCustomXMLNode CCustomXMLNodes::FindNode(const std::string & sName, const bool bMustExist) { - Lib3MFHandle hAttachment = nullptr; - CheckError(lib3mf_object_getthumbnailattachment(m_pHandle, &hAttachment)); + Lib3MFHandle hNodeInstance = nullptr; + CheckError(lib3mf_customxmlnodes_findnode(m_pHandle, sName.c_str(), bMustExist, &hNodeInstance)); - if (hAttachment) { - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hAttachment))); + if (hNodeInstance) { + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNodeInstance))); } else { return nullptr; } } /** - * CObject::ClearThumbnailAttachment - Clears the attachment. The attachment instance is not removed from the package. - */ - void CObject::ClearThumbnailAttachment() - { - CheckError(lib3mf_object_clearthumbnailattachment(m_pHandle)); - } + * Method definitions for class CCustomDOMTree + */ /** - * CObject::GetOutbox - Returns the outbox of a build item - * @return Outbox of this build item + * CCustomDOMTree::GetNameSpace - Returns the namespace identifier for the DOM Tree. + * @return returns the namespace of the DOM Tree. */ - sBox CObject::GetOutbox() + std::string CCustomDOMTree::GetNameSpace() { - sBox resultOutbox; - CheckError(lib3mf_object_getoutbox(m_pHandle, &resultOutbox)); + Lib3MF_uint32 bytesNeededNameSpace = 0; + Lib3MF_uint32 bytesWrittenNameSpace = 0; + CheckError(lib3mf_customdomtree_getnamespace(m_pHandle, 0, &bytesNeededNameSpace, nullptr)); + std::vector bufferNameSpace(bytesNeededNameSpace); + CheckError(lib3mf_customdomtree_getnamespace(m_pHandle, bytesNeededNameSpace, &bytesWrittenNameSpace, &bufferNameSpace[0])); - return resultOutbox; + return std::string(&bufferNameSpace[0]); } /** - * CObject::GetUUID - Retrieves an object's uuid string (see production extension specification) - * @param[out] bHasUUID - flag whether the build item has a UUID - * @return returns object uuid. + * CCustomDOMTree::GetRootNode - Returns root node of the tree. + * @return Root node of the document. */ - std::string CObject::GetUUID(bool & bHasUUID) + PCustomXMLNode CCustomDOMTree::GetRootNode() { - Lib3MF_uint32 bytesNeededUUID = 0; - Lib3MF_uint32 bytesWrittenUUID = 0; - CheckError(lib3mf_object_getuuid(m_pHandle, &bHasUUID, 0, &bytesNeededUUID, nullptr)); - std::vector bufferUUID(bytesNeededUUID); - CheckError(lib3mf_object_getuuid(m_pHandle, &bHasUUID, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0])); + Lib3MFHandle hRootNode = nullptr; + CheckError(lib3mf_customdomtree_getrootnode(m_pHandle, &hRootNode)); - return std::string(&bufferUUID[0]); + if (!hRootNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hRootNode))); } /** - * CObject::SetUUID - Sets a build object's uuid string (see production extension specification) - * @param[in] sUUID - new object uuid string. + * CCustomDOMTree::SaveToString - Saves the XML tree into a string. + * @return String with the XML Content. */ - void CObject::SetUUID(const std::string & sUUID) + std::string CCustomDOMTree::SaveToString() { - CheckError(lib3mf_object_setuuid(m_pHandle, sUUID.c_str())); + Lib3MF_uint32 bytesNeededXMLString = 0; + Lib3MF_uint32 bytesWrittenXMLString = 0; + CheckError(lib3mf_customdomtree_savetostring(m_pHandle, 0, &bytesNeededXMLString, nullptr)); + std::vector bufferXMLString(bytesNeededXMLString); + CheckError(lib3mf_customdomtree_savetostring(m_pHandle, bytesNeededXMLString, &bytesWrittenXMLString, &bufferXMLString[0])); + + return std::string(&bufferXMLString[0]); } /** - * CObject::GetMetaDataGroup - Returns the metadatagroup of this object - * @return returns an Instance of the metadatagroup of this object + * Method definitions for class CSliceStackIterator + */ + + /** + * CSliceStackIterator::GetCurrentSliceStack - Returns the SliceStack the iterator points at. + * @return returns the SliceStack instance. */ - PMetaDataGroup CObject::GetMetaDataGroup() + PSliceStack CSliceStackIterator::GetCurrentSliceStack() { - Lib3MFHandle hMetaDataGroup = nullptr; - CheckError(lib3mf_object_getmetadatagroup(m_pHandle, &hMetaDataGroup)); + Lib3MFHandle hResource = nullptr; + CheckError(lib3mf_slicestackiterator_getcurrentslicestack(m_pHandle, &hResource)); - if (!hMetaDataGroup) { + if (!hResource) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMetaDataGroup))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); } /** - * CObject::SetSlicesMeshResolution - set the meshresolution of the mesh object - * @param[in] eMeshResolution - meshresolution of this object - */ - void CObject::SetSlicesMeshResolution(const eSlicesMeshResolution eMeshResolution) - { - CheckError(lib3mf_object_setslicesmeshresolution(m_pHandle, eMeshResolution)); - } + * Method definitions for class CObjectIterator + */ /** - * CObject::GetSlicesMeshResolution - get the meshresolution of the mesh object - * @return meshresolution of this object + * CObjectIterator::GetCurrentObject - Returns the Object the iterator points at. + * @return returns the Object instance. */ - eSlicesMeshResolution CObject::GetSlicesMeshResolution() + PObject CObjectIterator::GetCurrentObject() { - eSlicesMeshResolution resultMeshResolution = (eSlicesMeshResolution) 0; - CheckError(lib3mf_object_getslicesmeshresolution(m_pHandle, &resultMeshResolution)); + Lib3MFHandle hResource = nullptr; + CheckError(lib3mf_objectiterator_getcurrentobject(m_pHandle, &hResource)); - return resultMeshResolution; + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); } /** - * CObject::HasSlices - returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack - * @param[in] bRecursive - check also all referenced objects? - * @return does the object have a slice stack? + * Method definitions for class CMeshObjectIterator + */ + + /** + * CMeshObjectIterator::GetCurrentMeshObject - Returns the MeshObject the iterator points at. + * @return returns the MeshObject instance. */ - bool CObject::HasSlices(const bool bRecursive) + PMeshObject CMeshObjectIterator::GetCurrentMeshObject() { - bool resultHasSlices = 0; - CheckError(lib3mf_object_hasslices(m_pHandle, bRecursive, &resultHasSlices)); + Lib3MFHandle hResource = nullptr; + CheckError(lib3mf_meshobjectiterator_getcurrentmeshobject(m_pHandle, &hResource)); - return resultHasSlices; + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); } /** - * CObject::ClearSliceStack - unlinks the attached slicestack from this object. If no slice stack is attached, do noting. - */ - void CObject::ClearSliceStack() - { - CheckError(lib3mf_object_clearslicestack(m_pHandle)); - } + * Method definitions for class CComponentsObjectIterator + */ /** - * CObject::GetSliceStack - get the Slicestack attached to the object - * @return returns the slicestack instance + * CComponentsObjectIterator::GetCurrentComponentsObject - Returns the ComponentsObject the iterator points at. + * @return returns the ComponentsObject instance. */ - PSliceStack CObject::GetSliceStack() + PComponentsObject CComponentsObjectIterator::GetCurrentComponentsObject() { - Lib3MFHandle hSliceStackInstance = nullptr; - CheckError(lib3mf_object_getslicestack(m_pHandle, &hSliceStackInstance)); + Lib3MFHandle hResource = nullptr; + CheckError(lib3mf_componentsobjectiterator_getcurrentcomponentsobject(m_pHandle, &hResource)); - if (!hSliceStackInstance) { + if (!hResource) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hSliceStackInstance))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); } /** - * CObject::AssignSliceStack - assigns a slicestack to the object - * @param[in] pSliceStackInstance - the new slice stack of this Object + * Method definitions for class CTexture2DIterator + */ + + /** + * CTexture2DIterator::GetCurrentTexture2D - Returns the Texture2D the iterator points at. + * @return returns the Texture2D instance. */ - void CObject::AssignSliceStack(classParam pSliceStackInstance) + PTexture2D CTexture2DIterator::GetCurrentTexture2D() { - Lib3MFHandle hSliceStackInstance = pSliceStackInstance.GetHandle(); - CheckError(lib3mf_object_assignslicestack(m_pHandle, hSliceStackInstance)); + Lib3MFHandle hResource = nullptr; + CheckError(lib3mf_texture2diterator_getcurrenttexture2d(m_pHandle, &hResource)); + + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); } /** - * Method definitions for class CMeshObject + * Method definitions for class CBaseMaterialGroupIterator */ /** - * CMeshObject::GetVertexCount - Returns the vertex count of a mesh object. - * @return filled with the vertex count. + * CBaseMaterialGroupIterator::GetCurrentBaseMaterialGroup - Returns the MaterialGroup the iterator points at. + * @return returns the BaseMaterialGroup instance. */ - Lib3MF_uint32 CMeshObject::GetVertexCount() + PBaseMaterialGroup CBaseMaterialGroupIterator::GetCurrentBaseMaterialGroup() { - Lib3MF_uint32 resultVertexCount = 0; - CheckError(lib3mf_meshobject_getvertexcount(m_pHandle, &resultVertexCount)); + Lib3MFHandle hResource = nullptr; + CheckError(lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup(m_pHandle, &hResource)); - return resultVertexCount; + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + } + + /** + * Method definitions for class CColorGroupIterator + */ + + /** + * CColorGroupIterator::GetCurrentColorGroup - Returns the ColorGroup the iterator points at. + * @return returns the ColorGroup instance. + */ + PColorGroup CColorGroupIterator::GetCurrentColorGroup() + { + Lib3MFHandle hResource = nullptr; + CheckError(lib3mf_colorgroupiterator_getcurrentcolorgroup(m_pHandle, &hResource)); + + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + } + + /** + * Method definitions for class CTexture2DGroupIterator + */ + + /** + * CTexture2DGroupIterator::GetCurrentTexture2DGroup - Returns the Texture2DGroup the iterator points at. + * @return returns the Texture2DGroup instance. + */ + PTexture2DGroup CTexture2DGroupIterator::GetCurrentTexture2DGroup() + { + Lib3MFHandle hResource = nullptr; + CheckError(lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup(m_pHandle, &hResource)); + + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + } + + /** + * Method definitions for class CCompositeMaterialsIterator + */ + + /** + * CCompositeMaterialsIterator::GetCurrentCompositeMaterials - Returns the CompositeMaterials the iterator points at. + * @return returns the CompositeMaterials instance. + */ + PCompositeMaterials CCompositeMaterialsIterator::GetCurrentCompositeMaterials() + { + Lib3MFHandle hResource = nullptr; + CheckError(lib3mf_compositematerialsiterator_getcurrentcompositematerials(m_pHandle, &hResource)); + + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + } + + /** + * Method definitions for class CMultiPropertyGroupIterator + */ + + /** + * CMultiPropertyGroupIterator::GetCurrentMultiPropertyGroup - Returns the MultiPropertyGroup the iterator points at. + * @return returns the MultiPropertyGroup instance. + */ + PMultiPropertyGroup CMultiPropertyGroupIterator::GetCurrentMultiPropertyGroup() + { + Lib3MFHandle hResource = nullptr; + CheckError(lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup(m_pHandle, &hResource)); + + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + } + + /** + * Method definitions for class CMetaData + */ + + /** + * CMetaData::GetNameSpace - returns the namespace URL of the metadata + * @return the namespace URL of the metadata + */ + std::string CMetaData::GetNameSpace() + { + Lib3MF_uint32 bytesNeededNameSpace = 0; + Lib3MF_uint32 bytesWrittenNameSpace = 0; + CheckError(lib3mf_metadata_getnamespace(m_pHandle, 0, &bytesNeededNameSpace, nullptr)); + std::vector bufferNameSpace(bytesNeededNameSpace); + CheckError(lib3mf_metadata_getnamespace(m_pHandle, bytesNeededNameSpace, &bytesWrittenNameSpace, &bufferNameSpace[0])); + + return std::string(&bufferNameSpace[0]); + } + + /** + * CMetaData::SetNameSpace - sets a new namespace URL of the metadata + * @param[in] sNameSpace - the new namespace URL of the metadata + */ + void CMetaData::SetNameSpace(const std::string & sNameSpace) + { + CheckError(lib3mf_metadata_setnamespace(m_pHandle, sNameSpace.c_str())); + } + + /** + * CMetaData::GetName - returns the name of a metadata + * @return the name of the metadata + */ + std::string CMetaData::GetName() + { + Lib3MF_uint32 bytesNeededName = 0; + Lib3MF_uint32 bytesWrittenName = 0; + CheckError(lib3mf_metadata_getname(m_pHandle, 0, &bytesNeededName, nullptr)); + std::vector bufferName(bytesNeededName); + CheckError(lib3mf_metadata_getname(m_pHandle, bytesNeededName, &bytesWrittenName, &bufferName[0])); + + return std::string(&bufferName[0]); + } + + /** + * CMetaData::SetName - sets a new name of a metadata + * @param[in] sName - the new name of the metadata + */ + void CMetaData::SetName(const std::string & sName) + { + CheckError(lib3mf_metadata_setname(m_pHandle, sName.c_str())); + } + + /** + * CMetaData::GetKey - returns the (namespace+name) of a metadata + * @return the key (namespace+name) of the metadata + */ + std::string CMetaData::GetKey() + { + Lib3MF_uint32 bytesNeededKey = 0; + Lib3MF_uint32 bytesWrittenKey = 0; + CheckError(lib3mf_metadata_getkey(m_pHandle, 0, &bytesNeededKey, nullptr)); + std::vector bufferKey(bytesNeededKey); + CheckError(lib3mf_metadata_getkey(m_pHandle, bytesNeededKey, &bytesWrittenKey, &bufferKey[0])); + + return std::string(&bufferKey[0]); + } + + /** + * CMetaData::GetMustPreserve - returns, whether a metadata must be preserved + * @return returns, whether a metadata must be preserved + */ + bool CMetaData::GetMustPreserve() + { + bool resultMustPreserve = 0; + CheckError(lib3mf_metadata_getmustpreserve(m_pHandle, &resultMustPreserve)); + + return resultMustPreserve; + } + + /** + * CMetaData::SetMustPreserve - sets whether a metadata must be preserved + * @param[in] bMustPreserve - a new value whether a metadata must be preserved + */ + void CMetaData::SetMustPreserve(const bool bMustPreserve) + { + CheckError(lib3mf_metadata_setmustpreserve(m_pHandle, bMustPreserve)); + } + + /** + * CMetaData::GetType - returns the type of a metadata + * @return the type of the metadata + */ + std::string CMetaData::GetType() + { + Lib3MF_uint32 bytesNeededType = 0; + Lib3MF_uint32 bytesWrittenType = 0; + CheckError(lib3mf_metadata_gettype(m_pHandle, 0, &bytesNeededType, nullptr)); + std::vector bufferType(bytesNeededType); + CheckError(lib3mf_metadata_gettype(m_pHandle, bytesNeededType, &bytesWrittenType, &bufferType[0])); + + return std::string(&bufferType[0]); + } + + /** + * CMetaData::SetType - sets a new type of a metadata. This must be a simple XML type + * @param[in] sType - a new type of the metadata + */ + void CMetaData::SetType(const std::string & sType) + { + CheckError(lib3mf_metadata_settype(m_pHandle, sType.c_str())); + } + + /** + * CMetaData::GetValue - returns the value of the metadata + * @return the value of the metadata + */ + std::string CMetaData::GetValue() + { + Lib3MF_uint32 bytesNeededValue = 0; + Lib3MF_uint32 bytesWrittenValue = 0; + CheckError(lib3mf_metadata_getvalue(m_pHandle, 0, &bytesNeededValue, nullptr)); + std::vector bufferValue(bytesNeededValue); + CheckError(lib3mf_metadata_getvalue(m_pHandle, bytesNeededValue, &bytesWrittenValue, &bufferValue[0])); + + return std::string(&bufferValue[0]); + } + + /** + * CMetaData::SetValue - sets a new value of the metadata + * @param[in] sValue - a new value of the metadata + */ + void CMetaData::SetValue(const std::string & sValue) + { + CheckError(lib3mf_metadata_setvalue(m_pHandle, sValue.c_str())); + } + + /** + * Method definitions for class CMetaDataGroup + */ + + /** + * CMetaDataGroup::GetMetaDataCount - returns the number of metadata in this metadatagroup + * @return returns the number metadata + */ + Lib3MF_uint32 CMetaDataGroup::GetMetaDataCount() + { + Lib3MF_uint32 resultCount = 0; + CheckError(lib3mf_metadatagroup_getmetadatacount(m_pHandle, &resultCount)); + + return resultCount; + } + + /** + * CMetaDataGroup::GetMetaData - returns a metadata value within this metadatagroup + * @param[in] nIndex - Index of the Metadata. + * @return an instance of the metadata + */ + PMetaData CMetaDataGroup::GetMetaData(const Lib3MF_uint32 nIndex) + { + Lib3MFHandle hMetaData = nullptr; + CheckError(lib3mf_metadatagroup_getmetadata(m_pHandle, nIndex, &hMetaData)); + + if (!hMetaData) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMetaData))); + } + + /** + * CMetaDataGroup::GetMetaDataByKey - returns a metadata value within this metadatagroup + * @param[in] sNameSpace - the namespace of the metadata + * @param[in] sName - the name of the Metadata + * @return an instance of the metadata + */ + PMetaData CMetaDataGroup::GetMetaDataByKey(const std::string & sNameSpace, const std::string & sName) + { + Lib3MFHandle hMetaData = nullptr; + CheckError(lib3mf_metadatagroup_getmetadatabykey(m_pHandle, sNameSpace.c_str(), sName.c_str(), &hMetaData)); + + if (!hMetaData) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMetaData))); + } + + /** + * CMetaDataGroup::RemoveMetaDataByIndex - removes metadata by index from the model. + * @param[in] nIndex - Index of the metadata to remove + */ + void CMetaDataGroup::RemoveMetaDataByIndex(const Lib3MF_uint32 nIndex) + { + CheckError(lib3mf_metadatagroup_removemetadatabyindex(m_pHandle, nIndex)); + } + + /** + * CMetaDataGroup::RemoveMetaData - removes metadata from the model. + * @param[in] pTheMetaData - The metadata to remove + */ + void CMetaDataGroup::RemoveMetaData(classParam pTheMetaData) + { + Lib3MFHandle hTheMetaData = pTheMetaData.GetHandle(); + CheckError(lib3mf_metadatagroup_removemetadata(m_pHandle, hTheMetaData)); + } + + /** + * CMetaDataGroup::AddMetaData - adds a new metadata to this metadatagroup + * @param[in] sNameSpace - the namespace of the metadata + * @param[in] sName - the name of the metadata + * @param[in] sValue - the value of the metadata + * @param[in] sType - the type of the metadata + * @param[in] bMustPreserve - shuold the metadata be preserved + * @return a new instance of the metadata + */ + PMetaData CMetaDataGroup::AddMetaData(const std::string & sNameSpace, const std::string & sName, const std::string & sValue, const std::string & sType, const bool bMustPreserve) + { + Lib3MFHandle hMetaData = nullptr; + CheckError(lib3mf_metadatagroup_addmetadata(m_pHandle, sNameSpace.c_str(), sName.c_str(), sValue.c_str(), sType.c_str(), bMustPreserve, &hMetaData)); + + if (!hMetaData) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMetaData))); + } + + /** + * Method definitions for class CObject + */ + + /** + * CObject::GetType - Retrieves an object's type + * @return returns object type enum. + */ + eObjectType CObject::GetType() + { + eObjectType resultObjectType = (eObjectType) 0; + CheckError(lib3mf_object_gettype(m_pHandle, &resultObjectType)); + + return resultObjectType; + } + + /** + * CObject::SetType - Sets an object's type + * @param[in] eObjectType - object type enum. + */ + void CObject::SetType(const eObjectType eObjectType) + { + CheckError(lib3mf_object_settype(m_pHandle, eObjectType)); + } + + /** + * CObject::GetName - Retrieves an object's name + * @return returns object name. + */ + std::string CObject::GetName() + { + Lib3MF_uint32 bytesNeededName = 0; + Lib3MF_uint32 bytesWrittenName = 0; + CheckError(lib3mf_object_getname(m_pHandle, 0, &bytesNeededName, nullptr)); + std::vector bufferName(bytesNeededName); + CheckError(lib3mf_object_getname(m_pHandle, bytesNeededName, &bytesWrittenName, &bufferName[0])); + + return std::string(&bufferName[0]); + } + + /** + * CObject::SetName - Sets an object's name string + * @param[in] sName - new object name. + */ + void CObject::SetName(const std::string & sName) + { + CheckError(lib3mf_object_setname(m_pHandle, sName.c_str())); + } + + /** + * CObject::GetPartNumber - Retrieves an object's part number + * @return returns object part number. + */ + std::string CObject::GetPartNumber() + { + Lib3MF_uint32 bytesNeededPartNumber = 0; + Lib3MF_uint32 bytesWrittenPartNumber = 0; + CheckError(lib3mf_object_getpartnumber(m_pHandle, 0, &bytesNeededPartNumber, nullptr)); + std::vector bufferPartNumber(bytesNeededPartNumber); + CheckError(lib3mf_object_getpartnumber(m_pHandle, bytesNeededPartNumber, &bytesWrittenPartNumber, &bufferPartNumber[0])); + + return std::string(&bufferPartNumber[0]); + } + + /** + * CObject::SetPartNumber - Sets an objects partnumber string + * @param[in] sPartNumber - new object part number. + */ + void CObject::SetPartNumber(const std::string & sPartNumber) + { + CheckError(lib3mf_object_setpartnumber(m_pHandle, sPartNumber.c_str())); + } + + /** + * CObject::IsMeshObject - Retrieves, if an object is a mesh object + * @return returns, whether the object is a mesh object + */ + bool CObject::IsMeshObject() + { + bool resultIsMeshObject = 0; + CheckError(lib3mf_object_ismeshobject(m_pHandle, &resultIsMeshObject)); + + return resultIsMeshObject; + } + + /** + * CObject::IsComponentsObject - Retrieves, if an object is a components object + * @return returns, whether the object is a components object + */ + bool CObject::IsComponentsObject() + { + bool resultIsComponentsObject = 0; + CheckError(lib3mf_object_iscomponentsobject(m_pHandle, &resultIsComponentsObject)); + + return resultIsComponentsObject; + } + + /** + * CObject::IsValid - Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. + * @return returns whether the object is a valid object description + */ + bool CObject::IsValid() + { + bool resultIsValid = 0; + CheckError(lib3mf_object_isvalid(m_pHandle, &resultIsValid)); + + return resultIsValid; + } + + /** + * CObject::SetAttachmentAsThumbnail - Use an existing attachment as thumbnail for this object + * @param[in] pAttachment - Instance of a new or the existing thumbnailattachment object. + */ + void CObject::SetAttachmentAsThumbnail(classParam pAttachment) + { + Lib3MFHandle hAttachment = pAttachment.GetHandle(); + CheckError(lib3mf_object_setattachmentasthumbnail(m_pHandle, hAttachment)); + } + + /** + * CObject::GetThumbnailAttachment - Get the attachment containing the object thumbnail. + * @return Instance of the thumbnailattachment object or NULL. + */ + PAttachment CObject::GetThumbnailAttachment() + { + Lib3MFHandle hAttachment = nullptr; + CheckError(lib3mf_object_getthumbnailattachment(m_pHandle, &hAttachment)); + + if (hAttachment) { + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hAttachment))); + } else { + return nullptr; + } + } + + /** + * CObject::ClearThumbnailAttachment - Clears the attachment. The attachment instance is not removed from the package. + */ + void CObject::ClearThumbnailAttachment() + { + CheckError(lib3mf_object_clearthumbnailattachment(m_pHandle)); + } + + /** + * CObject::GetOutbox - Returns the outbox of a build item + * @return Outbox of this build item + */ + sBox CObject::GetOutbox() + { + sBox resultOutbox; + CheckError(lib3mf_object_getoutbox(m_pHandle, &resultOutbox)); + + return resultOutbox; + } + + /** + * CObject::GetUUID - Retrieves an object's uuid string (see production extension specification) + * @param[out] bHasUUID - flag whether the build item has a UUID + * @return returns object uuid. + */ + std::string CObject::GetUUID(bool & bHasUUID) + { + Lib3MF_uint32 bytesNeededUUID = 0; + Lib3MF_uint32 bytesWrittenUUID = 0; + CheckError(lib3mf_object_getuuid(m_pHandle, &bHasUUID, 0, &bytesNeededUUID, nullptr)); + std::vector bufferUUID(bytesNeededUUID); + CheckError(lib3mf_object_getuuid(m_pHandle, &bHasUUID, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0])); + + return std::string(&bufferUUID[0]); + } + + /** + * CObject::SetUUID - Sets a build object's uuid string (see production extension specification) + * @param[in] sUUID - new object uuid string. + */ + void CObject::SetUUID(const std::string & sUUID) + { + CheckError(lib3mf_object_setuuid(m_pHandle, sUUID.c_str())); + } + + /** + * CObject::GetMetaDataGroup - Returns the metadatagroup of this object + * @return returns an Instance of the metadatagroup of this object + */ + PMetaDataGroup CObject::GetMetaDataGroup() + { + Lib3MFHandle hMetaDataGroup = nullptr; + CheckError(lib3mf_object_getmetadatagroup(m_pHandle, &hMetaDataGroup)); + + if (!hMetaDataGroup) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMetaDataGroup))); + } + + /** + * CObject::SetSlicesMeshResolution - set the meshresolution of the mesh object + * @param[in] eMeshResolution - meshresolution of this object + */ + void CObject::SetSlicesMeshResolution(const eSlicesMeshResolution eMeshResolution) + { + CheckError(lib3mf_object_setslicesmeshresolution(m_pHandle, eMeshResolution)); + } + + /** + * CObject::GetSlicesMeshResolution - get the meshresolution of the mesh object + * @return meshresolution of this object + */ + eSlicesMeshResolution CObject::GetSlicesMeshResolution() + { + eSlicesMeshResolution resultMeshResolution = (eSlicesMeshResolution) 0; + CheckError(lib3mf_object_getslicesmeshresolution(m_pHandle, &resultMeshResolution)); + + return resultMeshResolution; + } + + /** + * CObject::HasSlices - returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack + * @param[in] bRecursive - check also all referenced objects? + * @return does the object have a slice stack? + */ + bool CObject::HasSlices(const bool bRecursive) + { + bool resultHasSlices = 0; + CheckError(lib3mf_object_hasslices(m_pHandle, bRecursive, &resultHasSlices)); + + return resultHasSlices; + } + + /** + * CObject::ClearSliceStack - unlinks the attached slicestack from this object. If no slice stack is attached, do noting. + */ + void CObject::ClearSliceStack() + { + CheckError(lib3mf_object_clearslicestack(m_pHandle)); + } + + /** + * CObject::GetSliceStack - get the Slicestack attached to the object + * @return returns the slicestack instance + */ + PSliceStack CObject::GetSliceStack() + { + Lib3MFHandle hSliceStackInstance = nullptr; + CheckError(lib3mf_object_getslicestack(m_pHandle, &hSliceStackInstance)); + + if (!hSliceStackInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hSliceStackInstance))); + } + + /** + * CObject::AssignSliceStack - assigns a slicestack to the object + * @param[in] pSliceStackInstance - the new slice stack of this Object + */ + void CObject::AssignSliceStack(classParam pSliceStackInstance) + { + Lib3MFHandle hSliceStackInstance = pSliceStackInstance.GetHandle(); + CheckError(lib3mf_object_assignslicestack(m_pHandle, hSliceStackInstance)); + } + + /** + * Method definitions for class CMeshObject + */ + + /** + * CMeshObject::GetVertexCount - Returns the vertex count of a mesh object. + * @return filled with the vertex count. + */ + Lib3MF_uint32 CMeshObject::GetVertexCount() + { + Lib3MF_uint32 resultVertexCount = 0; + CheckError(lib3mf_meshobject_getvertexcount(m_pHandle, &resultVertexCount)); + + return resultVertexCount; + } + + /** + * CMeshObject::GetTriangleCount - Returns the triangle count of a mesh object. + * @return filled with the triangle count. + */ + Lib3MF_uint32 CMeshObject::GetTriangleCount() + { + Lib3MF_uint32 resultVertexCount = 0; + CheckError(lib3mf_meshobject_gettrianglecount(m_pHandle, &resultVertexCount)); + + return resultVertexCount; + } + + /** + * CMeshObject::GetVertex - Returns the vertex count of a mesh object. + * @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) + * @return filled with the vertex coordinates. + */ + sPosition CMeshObject::GetVertex(const Lib3MF_uint32 nIndex) + { + sPosition resultCoordinates; + CheckError(lib3mf_meshobject_getvertex(m_pHandle, nIndex, &resultCoordinates)); + + return resultCoordinates; + } + + /** + * CMeshObject::SetVertex - Sets the coordinates of a single vertex of a mesh object + * @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) + * @param[in] Coordinates - contains the vertex coordinates. + */ + void CMeshObject::SetVertex(const Lib3MF_uint32 nIndex, const sPosition & Coordinates) + { + CheckError(lib3mf_meshobject_setvertex(m_pHandle, nIndex, &Coordinates)); + } + + /** + * CMeshObject::AddVertex - Adds a single vertex to a mesh object + * @param[in] Coordinates - contains the vertex coordinates. + * @return Index of the new vertex + */ + Lib3MF_uint32 CMeshObject::AddVertex(const sPosition & Coordinates) + { + Lib3MF_uint32 resultNewIndex = 0; + CheckError(lib3mf_meshobject_addvertex(m_pHandle, &Coordinates, &resultNewIndex)); + + return resultNewIndex; + } + + /** + * CMeshObject::GetVertices - Obtains all vertex positions of a mesh object + * @param[out] VerticesBuffer - contains the vertex coordinates. + */ + void CMeshObject::GetVertices(std::vector & VerticesBuffer) + { + Lib3MF_uint64 elementsNeededVertices = 0; + Lib3MF_uint64 elementsWrittenVertices = 0; + CheckError(lib3mf_meshobject_getvertices(m_pHandle, 0, &elementsNeededVertices, nullptr)); + VerticesBuffer.resize((size_t) elementsNeededVertices); + CheckError(lib3mf_meshobject_getvertices(m_pHandle, elementsNeededVertices, &elementsWrittenVertices, VerticesBuffer.data())); + } + + /** + * CMeshObject::GetTriangle - Returns indices of a single triangle of a mesh object. + * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) + * @return filled with the triangle indices. + */ + sTriangle CMeshObject::GetTriangle(const Lib3MF_uint32 nIndex) + { + sTriangle resultIndices; + CheckError(lib3mf_meshobject_gettriangle(m_pHandle, nIndex, &resultIndices)); + + return resultIndices; + } + + /** + * CMeshObject::SetTriangle - Sets the indices of a single triangle of a mesh object. + * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) + * @param[in] Indices - contains the triangle indices. + */ + void CMeshObject::SetTriangle(const Lib3MF_uint32 nIndex, const sTriangle & Indices) + { + CheckError(lib3mf_meshobject_settriangle(m_pHandle, nIndex, &Indices)); + } + + /** + * CMeshObject::AddTriangle - Adds a single triangle to a mesh object + * @param[in] Indices - contains the triangle indices. + * @return Index of the new triangle + */ + Lib3MF_uint32 CMeshObject::AddTriangle(const sTriangle & Indices) + { + Lib3MF_uint32 resultNewIndex = 0; + CheckError(lib3mf_meshobject_addtriangle(m_pHandle, &Indices, &resultNewIndex)); + + return resultNewIndex; + } + + /** + * CMeshObject::GetTriangleIndices - Get all triangles of a mesh object + * @param[out] IndicesBuffer - contains the triangle indices. + */ + void CMeshObject::GetTriangleIndices(std::vector & IndicesBuffer) + { + Lib3MF_uint64 elementsNeededIndices = 0; + Lib3MF_uint64 elementsWrittenIndices = 0; + CheckError(lib3mf_meshobject_gettriangleindices(m_pHandle, 0, &elementsNeededIndices, nullptr)); + IndicesBuffer.resize((size_t) elementsNeededIndices); + CheckError(lib3mf_meshobject_gettriangleindices(m_pHandle, elementsNeededIndices, &elementsWrittenIndices, IndicesBuffer.data())); + } + + /** + * CMeshObject::SetObjectLevelProperty - Sets the property at the object-level of the mesh object. + * @param[in] nUniqueResourceID - the object-level Property UniqueResourceID. + * @param[in] nPropertyID - the object-level PropertyID. + */ + void CMeshObject::SetObjectLevelProperty(const Lib3MF_uint32 nUniqueResourceID, const Lib3MF_uint32 nPropertyID) + { + CheckError(lib3mf_meshobject_setobjectlevelproperty(m_pHandle, nUniqueResourceID, nPropertyID)); + } + + /** + * CMeshObject::GetObjectLevelProperty - Gets the property at the object-level of the mesh object. + * @param[out] nUniqueResourceID - the object-level Property UniqueResourceID. + * @param[out] nPropertyID - the object-level PropertyID. + * @return Has an object-level property been specified? + */ + bool CMeshObject::GetObjectLevelProperty(Lib3MF_uint32 & nUniqueResourceID, Lib3MF_uint32 & nPropertyID) + { + bool resultHasObjectLevelProperty = 0; + CheckError(lib3mf_meshobject_getobjectlevelproperty(m_pHandle, &nUniqueResourceID, &nPropertyID, &resultHasObjectLevelProperty)); + + return resultHasObjectLevelProperty; + } + + /** + * CMeshObject::SetTriangleProperties - Sets the properties of a single triangle of a mesh object. + * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) + * @param[in] Properties - contains the triangle properties. + */ + void CMeshObject::SetTriangleProperties(const Lib3MF_uint32 nIndex, const sTriangleProperties & Properties) + { + CheckError(lib3mf_meshobject_settriangleproperties(m_pHandle, nIndex, &Properties)); + } + + /** + * CMeshObject::GetTriangleProperties - Gets the properties of a single triangle of a mesh object. + * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) + * @param[out] Property - returns the triangle properties. + */ + void CMeshObject::GetTriangleProperties(const Lib3MF_uint32 nIndex, sTriangleProperties & Property) + { + CheckError(lib3mf_meshobject_gettriangleproperties(m_pHandle, nIndex, &Property)); + } + + /** + * CMeshObject::SetAllTriangleProperties - Sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. + * @param[in] PropertiesArrayBuffer - contains the triangle properties array. Must have trianglecount elements. + */ + void CMeshObject::SetAllTriangleProperties(const CInputVector & PropertiesArrayBuffer) + { + CheckError(lib3mf_meshobject_setalltriangleproperties(m_pHandle, (Lib3MF_uint64)PropertiesArrayBuffer.size(), PropertiesArrayBuffer.data())); + } + + /** + * CMeshObject::GetAllTriangleProperties - Gets the properties of all triangles of a mesh object. + * @param[out] PropertiesArrayBuffer - returns the triangle properties array. Must have trianglecount elements. + */ + void CMeshObject::GetAllTriangleProperties(std::vector & PropertiesArrayBuffer) + { + Lib3MF_uint64 elementsNeededPropertiesArray = 0; + Lib3MF_uint64 elementsWrittenPropertiesArray = 0; + CheckError(lib3mf_meshobject_getalltriangleproperties(m_pHandle, 0, &elementsNeededPropertiesArray, nullptr)); + PropertiesArrayBuffer.resize((size_t) elementsNeededPropertiesArray); + CheckError(lib3mf_meshobject_getalltriangleproperties(m_pHandle, elementsNeededPropertiesArray, &elementsWrittenPropertiesArray, PropertiesArrayBuffer.data())); + } + + /** + * CMeshObject::ClearAllProperties - Clears all properties of this mesh object (triangle and object-level). + */ + void CMeshObject::ClearAllProperties() + { + CheckError(lib3mf_meshobject_clearallproperties(m_pHandle)); + } + + /** + * CMeshObject::SetGeometry - Set all triangles of a mesh object + * @param[in] VerticesBuffer - contains the positions. + * @param[in] IndicesBuffer - contains the triangle indices. + */ + void CMeshObject::SetGeometry(const CInputVector & VerticesBuffer, const CInputVector & IndicesBuffer) + { + CheckError(lib3mf_meshobject_setgeometry(m_pHandle, (Lib3MF_uint64)VerticesBuffer.size(), VerticesBuffer.data(), (Lib3MF_uint64)IndicesBuffer.size(), IndicesBuffer.data())); + } + + /** + * CMeshObject::IsManifoldAndOriented - Retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. + * @return returns, if the object is oriented and manifold. + */ + bool CMeshObject::IsManifoldAndOriented() + { + bool resultIsManifoldAndOriented = 0; + CheckError(lib3mf_meshobject_ismanifoldandoriented(m_pHandle, &resultIsManifoldAndOriented)); + + return resultIsManifoldAndOriented; + } + + /** + * CMeshObject::BeamLattice - Retrieves the BeamLattice within this MeshObject. + * @return the BeamLattice within this MeshObject + */ + PBeamLattice CMeshObject::BeamLattice() + { + Lib3MFHandle hTheBeamLattice = nullptr; + CheckError(lib3mf_meshobject_beamlattice(m_pHandle, &hTheBeamLattice)); + + if (!hTheBeamLattice) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheBeamLattice))); + } + + /** + * Method definitions for class CBeamLattice + */ + + /** + * CBeamLattice::GetMinLength - Returns the minimal length of beams for the beamlattice. + * @return minimal length of beams for the beamlattice + */ + Lib3MF_double CBeamLattice::GetMinLength() + { + Lib3MF_double resultMinLength = 0; + CheckError(lib3mf_beamlattice_getminlength(m_pHandle, &resultMinLength)); + + return resultMinLength; + } + + /** + * CBeamLattice::SetMinLength - Sets the minimal length of beams for the beamlattice. + * @param[in] dMinLength - minimal length of beams for the beamlattice + */ + void CBeamLattice::SetMinLength(const Lib3MF_double dMinLength) + { + CheckError(lib3mf_beamlattice_setminlength(m_pHandle, dMinLength)); + } + + /** + * CBeamLattice::GetClipping - Returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. + * @param[out] eClipMode - contains the clip mode of this mesh + * @param[out] nUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object or an undefined value if pClipMode is MODELBEAMLATTICECLIPMODE_NONE + */ + void CBeamLattice::GetClipping(eBeamLatticeClipMode & eClipMode, Lib3MF_uint32 & nUniqueResourceID) + { + CheckError(lib3mf_beamlattice_getclipping(m_pHandle, &eClipMode, &nUniqueResourceID)); + } + + /** + * CBeamLattice::SetClipping - Sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. + * @param[in] eClipMode - contains the clip mode of this mesh + * @param[in] nUniqueResourceID - the UniqueResourceID of the clipping mesh-object. This mesh-object has to be defined before setting the Clipping. + */ + void CBeamLattice::SetClipping(const eBeamLatticeClipMode eClipMode, const Lib3MF_uint32 nUniqueResourceID) + { + CheckError(lib3mf_beamlattice_setclipping(m_pHandle, eClipMode, nUniqueResourceID)); + } + + /** + * CBeamLattice::GetRepresentation - Returns the representation-mesh for the beamlattice of this mesh. + * @return flag whether the beamlattice has a representation mesh. + * @param[out] nUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object. + */ + bool CBeamLattice::GetRepresentation(Lib3MF_uint32 & nUniqueResourceID) + { + bool resultHasRepresentation = 0; + CheckError(lib3mf_beamlattice_getrepresentation(m_pHandle, &resultHasRepresentation, &nUniqueResourceID)); + + return resultHasRepresentation; + } + + /** + * CBeamLattice::SetRepresentation - Sets the representation-mesh for the beamlattice of this mesh. + * @param[in] nUniqueResourceID - the UniqueResourceID of the representation mesh-object. This mesh-object has to be defined before setting the representation. + */ + void CBeamLattice::SetRepresentation(const Lib3MF_uint32 nUniqueResourceID) + { + CheckError(lib3mf_beamlattice_setrepresentation(m_pHandle, nUniqueResourceID)); + } + + /** + * CBeamLattice::GetBallOptions - Returns the ball mode and the default ball radius for the beamlattice of this mesh. + * @param[out] eBallMode - contains the ball mode of this mesh + * @param[out] dBallRadius - default ball radius of balls for the beamlattice + */ + void CBeamLattice::GetBallOptions(eBeamLatticeBallMode & eBallMode, Lib3MF_double & dBallRadius) + { + CheckError(lib3mf_beamlattice_getballoptions(m_pHandle, &eBallMode, &dBallRadius)); + } + + /** + * CBeamLattice::SetBallOptions - Sets the ball mode and thedefault ball radius for the beamlattice. + * @param[in] eBallMode - contains the ball mode of this mesh + * @param[in] dBallRadius - default ball radius of balls for the beamlattice + */ + void CBeamLattice::SetBallOptions(const eBeamLatticeBallMode eBallMode, const Lib3MF_double dBallRadius) + { + CheckError(lib3mf_beamlattice_setballoptions(m_pHandle, eBallMode, dBallRadius)); + } + + /** + * CBeamLattice::GetBeamCount - Returns the beam count of a mesh object. + * @return filled with the beam count. + */ + Lib3MF_uint32 CBeamLattice::GetBeamCount() + { + Lib3MF_uint32 resultCount = 0; + CheckError(lib3mf_beamlattice_getbeamcount(m_pHandle, &resultCount)); + + return resultCount; + } + + /** + * CBeamLattice::GetBeam - Returns indices, radii and capmodes of a single beam of a mesh object. + * @param[in] nIndex - Index of the beam (0 to beamcount - 1). + * @return filled with the beam indices, radii and capmodes. + */ + sBeam CBeamLattice::GetBeam(const Lib3MF_uint32 nIndex) + { + sBeam resultBeamInfo; + CheckError(lib3mf_beamlattice_getbeam(m_pHandle, nIndex, &resultBeamInfo)); + + return resultBeamInfo; + } + + /** + * CBeamLattice::AddBeam - Adds a single beam to a mesh object. + * @param[in] BeamInfo - contains the node indices, radii and capmodes. + * @return filled with the new Index of the beam. + */ + Lib3MF_uint32 CBeamLattice::AddBeam(const sBeam & BeamInfo) + { + Lib3MF_uint32 resultIndex = 0; + CheckError(lib3mf_beamlattice_addbeam(m_pHandle, &BeamInfo, &resultIndex)); + + return resultIndex; + } + + /** + * CBeamLattice::SetBeam - Sets the indices, radii and capmodes of a single beam of a mesh object. + * @param[in] nIndex - Index of the beam (0 to beamcount - 1). + * @param[in] BeamInfo - filled with the beam indices, radii and capmodes. + */ + void CBeamLattice::SetBeam(const Lib3MF_uint32 nIndex, const sBeam & BeamInfo) + { + CheckError(lib3mf_beamlattice_setbeam(m_pHandle, nIndex, &BeamInfo)); + } + + /** + * CBeamLattice::SetBeams - Sets all beam indices, radii and capmodes of a mesh object. + * @param[in] BeamInfoBuffer - contains information of a number of beams + */ + void CBeamLattice::SetBeams(const CInputVector & BeamInfoBuffer) + { + CheckError(lib3mf_beamlattice_setbeams(m_pHandle, (Lib3MF_uint64)BeamInfoBuffer.size(), BeamInfoBuffer.data())); + } + + /** + * CBeamLattice::GetBeams - obtains all beam indices, radii and capmodes of a mesh object. + * @param[out] BeamInfoBuffer - contains information of all beams + */ + void CBeamLattice::GetBeams(std::vector & BeamInfoBuffer) + { + Lib3MF_uint64 elementsNeededBeamInfo = 0; + Lib3MF_uint64 elementsWrittenBeamInfo = 0; + CheckError(lib3mf_beamlattice_getbeams(m_pHandle, 0, &elementsNeededBeamInfo, nullptr)); + BeamInfoBuffer.resize((size_t) elementsNeededBeamInfo); + CheckError(lib3mf_beamlattice_getbeams(m_pHandle, elementsNeededBeamInfo, &elementsWrittenBeamInfo, BeamInfoBuffer.data())); + } + + /** + * CBeamLattice::GetBallCount - Returns the ball count of a mesh object. + * @return filled with the ball count. + */ + Lib3MF_uint32 CBeamLattice::GetBallCount() + { + Lib3MF_uint32 resultCount = 0; + CheckError(lib3mf_beamlattice_getballcount(m_pHandle, &resultCount)); + + return resultCount; + } + + /** + * CBeamLattice::GetBall - Returns index and radius of a single ball of a mesh object. + * @param[in] nIndex - Index of the ball (0 to ballcount - 1). + * @return filled with the ball node index and radius. + */ + sBall CBeamLattice::GetBall(const Lib3MF_uint32 nIndex) + { + sBall resultBallInfo; + CheckError(lib3mf_beamlattice_getball(m_pHandle, nIndex, &resultBallInfo)); + + return resultBallInfo; + } + + /** + * CBeamLattice::AddBall - Adds a single ball to a mesh object. + * @param[in] BallInfo - contains the node index and radius. + * @return filled with the new Index of the ball. + */ + Lib3MF_uint32 CBeamLattice::AddBall(const sBall & BallInfo) + { + Lib3MF_uint32 resultIndex = 0; + CheckError(lib3mf_beamlattice_addball(m_pHandle, &BallInfo, &resultIndex)); + + return resultIndex; + } + + /** + * CBeamLattice::SetBall - Sets the index and radius of a single ball of a mesh object. + * @param[in] nIndex - Index of the ball (0 to ballcount - 1). + * @param[in] BallInfo - filled with the ball node index and radius. + */ + void CBeamLattice::SetBall(const Lib3MF_uint32 nIndex, const sBall & BallInfo) + { + CheckError(lib3mf_beamlattice_setball(m_pHandle, nIndex, &BallInfo)); + } + + /** + * CBeamLattice::SetBalls - Sets all ball indices and radii of a mesh object. + * @param[in] BallInfoBuffer - contains information of a number of balls + */ + void CBeamLattice::SetBalls(const CInputVector & BallInfoBuffer) + { + CheckError(lib3mf_beamlattice_setballs(m_pHandle, (Lib3MF_uint64)BallInfoBuffer.size(), BallInfoBuffer.data())); + } + + /** + * CBeamLattice::GetBalls - obtains all ball indices and radii of a mesh object. + * @param[out] BallInfoBuffer - contains information of all balls + */ + void CBeamLattice::GetBalls(std::vector & BallInfoBuffer) + { + Lib3MF_uint64 elementsNeededBallInfo = 0; + Lib3MF_uint64 elementsWrittenBallInfo = 0; + CheckError(lib3mf_beamlattice_getballs(m_pHandle, 0, &elementsNeededBallInfo, nullptr)); + BallInfoBuffer.resize((size_t) elementsNeededBallInfo); + CheckError(lib3mf_beamlattice_getballs(m_pHandle, elementsNeededBallInfo, &elementsWrittenBallInfo, BallInfoBuffer.data())); + } + + /** + * CBeamLattice::GetBeamSetCount - Returns the number of beamsets of a mesh object. + * @return filled with the beamset count. + */ + Lib3MF_uint32 CBeamLattice::GetBeamSetCount() + { + Lib3MF_uint32 resultCount = 0; + CheckError(lib3mf_beamlattice_getbeamsetcount(m_pHandle, &resultCount)); + + return resultCount; + } + + /** + * CBeamLattice::AddBeamSet - Adds an empty beamset to a mesh object + * @return the new beamset + */ + PBeamSet CBeamLattice::AddBeamSet() + { + Lib3MFHandle hBeamSet = nullptr; + CheckError(lib3mf_beamlattice_addbeamset(m_pHandle, &hBeamSet)); + + if (!hBeamSet) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBeamSet))); + } + + /** + * CBeamLattice::GetBeamSet - Returns a beamset of a mesh object + * @param[in] nIndex - index of the requested beamset (0 ... beamsetcount-1). + * @return the requested beamset + */ + PBeamSet CBeamLattice::GetBeamSet(const Lib3MF_uint32 nIndex) + { + Lib3MFHandle hBeamSet = nullptr; + CheckError(lib3mf_beamlattice_getbeamset(m_pHandle, nIndex, &hBeamSet)); + + if (!hBeamSet) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBeamSet))); + } + + /** + * Method definitions for class CComponent + */ + + /** + * CComponent::GetObjectResource - Returns the Resource Instance of the component. + * @return filled with the Resource Instance. + */ + PObject CComponent::GetObjectResource() + { + Lib3MFHandle hObjectResource = nullptr; + CheckError(lib3mf_component_getobjectresource(m_pHandle, &hObjectResource)); + + if (!hObjectResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hObjectResource))); + } + + /** + * CComponent::GetObjectResourceID - Returns the UniqueResourceID of the component. + * @return returns the UniqueResourceID. + */ + Lib3MF_uint32 CComponent::GetObjectResourceID() + { + Lib3MF_uint32 resultUniqueResourceID = 0; + CheckError(lib3mf_component_getobjectresourceid(m_pHandle, &resultUniqueResourceID)); + + return resultUniqueResourceID; + } + + /** + * CComponent::GetUUID - returns, whether a component has a UUID and, if true, the component's UUID + * @param[out] bHasUUID - flag whether the component has a UUID + * @return the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + */ + std::string CComponent::GetUUID(bool & bHasUUID) + { + Lib3MF_uint32 bytesNeededUUID = 0; + Lib3MF_uint32 bytesWrittenUUID = 0; + CheckError(lib3mf_component_getuuid(m_pHandle, &bHasUUID, 0, &bytesNeededUUID, nullptr)); + std::vector bufferUUID(bytesNeededUUID); + CheckError(lib3mf_component_getuuid(m_pHandle, &bHasUUID, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0])); + + return std::string(&bufferUUID[0]); + } + + /** + * CComponent::SetUUID - sets the component's UUID + * @param[in] sUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + */ + void CComponent::SetUUID(const std::string & sUUID) + { + CheckError(lib3mf_component_setuuid(m_pHandle, sUUID.c_str())); + } + + /** + * CComponent::HasTransform - Returns, if the component has a different transformation than the identity matrix + * @return if true is returned, the transformation is not equal than the identity + */ + bool CComponent::HasTransform() + { + bool resultHasTransform = 0; + CheckError(lib3mf_component_hastransform(m_pHandle, &resultHasTransform)); + + return resultHasTransform; + } + + /** + * CComponent::GetTransform - Returns the transformation matrix of the component. + * @return filled with the component transformation matrix + */ + sTransform CComponent::GetTransform() + { + sTransform resultTransform; + CheckError(lib3mf_component_gettransform(m_pHandle, &resultTransform)); + + return resultTransform; + } + + /** + * CComponent::SetTransform - Sets the transformation matrix of the component. + * @param[in] Transform - new transformation matrix + */ + void CComponent::SetTransform(const sTransform & Transform) + { + CheckError(lib3mf_component_settransform(m_pHandle, &Transform)); + } + + /** + * Method definitions for class CComponentsObject + */ + + /** + * CComponentsObject::AddComponent - Adds a new component to a components object. + * @param[in] pObjectResource - object to add as component. Must not lead to circular references! + * @param[in] Transform - optional transform matrix for the component. + * @return new component instance + */ + PComponent CComponentsObject::AddComponent(classParam pObjectResource, const sTransform & Transform) + { + Lib3MFHandle hObjectResource = pObjectResource.GetHandle(); + Lib3MFHandle hComponentInstance = nullptr; + CheckError(lib3mf_componentsobject_addcomponent(m_pHandle, hObjectResource, &Transform, &hComponentInstance)); + + if (!hComponentInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hComponentInstance))); + } + + /** + * CComponentsObject::GetComponent - Retrieves a component from a component object. + * @param[in] nIndex - index of the component to retrieve (0 to componentcount - 1) + * @return component instance + */ + PComponent CComponentsObject::GetComponent(const Lib3MF_uint32 nIndex) + { + Lib3MFHandle hComponentInstance = nullptr; + CheckError(lib3mf_componentsobject_getcomponent(m_pHandle, nIndex, &hComponentInstance)); + + if (!hComponentInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hComponentInstance))); + } + + /** + * CComponentsObject::GetComponentCount - Retrieves a component count of a component object. + * @return returns the component count + */ + Lib3MF_uint32 CComponentsObject::GetComponentCount() + { + Lib3MF_uint32 resultCount = 0; + CheckError(lib3mf_componentsobject_getcomponentcount(m_pHandle, &resultCount)); + + return resultCount; + } + + /** + * Method definitions for class CBeamSet + */ + + /** + * CBeamSet::SetName - Sets a beamset's name string + * @param[in] sName - new name of the beamset. + */ + void CBeamSet::SetName(const std::string & sName) + { + CheckError(lib3mf_beamset_setname(m_pHandle, sName.c_str())); + } + + /** + * CBeamSet::GetName - Retrieves a beamset's name string + * @return returns the name of the beamset. + */ + std::string CBeamSet::GetName() + { + Lib3MF_uint32 bytesNeededName = 0; + Lib3MF_uint32 bytesWrittenName = 0; + CheckError(lib3mf_beamset_getname(m_pHandle, 0, &bytesNeededName, nullptr)); + std::vector bufferName(bytesNeededName); + CheckError(lib3mf_beamset_getname(m_pHandle, bytesNeededName, &bytesWrittenName, &bufferName[0])); + + return std::string(&bufferName[0]); + } + + /** + * CBeamSet::SetIdentifier - Sets a beamset's identifier string + * @param[in] sIdentifier - new name of the beamset. + */ + void CBeamSet::SetIdentifier(const std::string & sIdentifier) + { + CheckError(lib3mf_beamset_setidentifier(m_pHandle, sIdentifier.c_str())); + } + + /** + * CBeamSet::GetIdentifier - Retrieves a beamset's identifier string + * @return returns the identifier of the beamset. + */ + std::string CBeamSet::GetIdentifier() + { + Lib3MF_uint32 bytesNeededIdentifier = 0; + Lib3MF_uint32 bytesWrittenIdentifier = 0; + CheckError(lib3mf_beamset_getidentifier(m_pHandle, 0, &bytesNeededIdentifier, nullptr)); + std::vector bufferIdentifier(bytesNeededIdentifier); + CheckError(lib3mf_beamset_getidentifier(m_pHandle, bytesNeededIdentifier, &bytesWrittenIdentifier, &bufferIdentifier[0])); + + return std::string(&bufferIdentifier[0]); } /** - * CMeshObject::GetTriangleCount - Returns the triangle count of a mesh object. - * @return filled with the triangle count. + * CBeamSet::GetReferenceCount - Retrieves the reference count of a beamset + * @return returns the reference count */ - Lib3MF_uint32 CMeshObject::GetTriangleCount() + Lib3MF_uint32 CBeamSet::GetReferenceCount() { - Lib3MF_uint32 resultVertexCount = 0; - CheckError(lib3mf_meshobject_gettrianglecount(m_pHandle, &resultVertexCount)); + Lib3MF_uint32 resultCount = 0; + CheckError(lib3mf_beamset_getreferencecount(m_pHandle, &resultCount)); - return resultVertexCount; + return resultCount; } /** - * CMeshObject::GetVertex - Returns the vertex count of a mesh object. - * @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) - * @return filled with the vertex coordinates. + * CBeamSet::SetReferences - Sets the references of a beamset + * @param[in] ReferencesBuffer - the new indices of all beams in this beamset */ - sPosition CMeshObject::GetVertex(const Lib3MF_uint32 nIndex) + void CBeamSet::SetReferences(const CInputVector & ReferencesBuffer) { - sPosition resultCoordinates; - CheckError(lib3mf_meshobject_getvertex(m_pHandle, nIndex, &resultCoordinates)); + CheckError(lib3mf_beamset_setreferences(m_pHandle, (Lib3MF_uint64)ReferencesBuffer.size(), ReferencesBuffer.data())); + } + + /** + * CBeamSet::GetReferences - Retrieves the references of a beamset + * @param[out] ReferencesBuffer - retrieves the indices of all beams in this beamset + */ + void CBeamSet::GetReferences(std::vector & ReferencesBuffer) + { + Lib3MF_uint64 elementsNeededReferences = 0; + Lib3MF_uint64 elementsWrittenReferences = 0; + CheckError(lib3mf_beamset_getreferences(m_pHandle, 0, &elementsNeededReferences, nullptr)); + ReferencesBuffer.resize((size_t) elementsNeededReferences); + CheckError(lib3mf_beamset_getreferences(m_pHandle, elementsNeededReferences, &elementsWrittenReferences, ReferencesBuffer.data())); + } + + /** + * CBeamSet::GetBallReferenceCount - Retrieves the ball reference count of a beamset + * @return returns the ball reference count + */ + Lib3MF_uint32 CBeamSet::GetBallReferenceCount() + { + Lib3MF_uint32 resultCount = 0; + CheckError(lib3mf_beamset_getballreferencecount(m_pHandle, &resultCount)); - return resultCoordinates; + return resultCount; } /** - * CMeshObject::SetVertex - Sets the coordinates of a single vertex of a mesh object - * @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) - * @param[in] Coordinates - contains the vertex coordinates. + * CBeamSet::SetBallReferences - Sets the ball references of a beamset + * @param[in] BallReferencesBuffer - the new indices of all balls in this beamset */ - void CMeshObject::SetVertex(const Lib3MF_uint32 nIndex, const sPosition & Coordinates) + void CBeamSet::SetBallReferences(const CInputVector & BallReferencesBuffer) { - CheckError(lib3mf_meshobject_setvertex(m_pHandle, nIndex, &Coordinates)); + CheckError(lib3mf_beamset_setballreferences(m_pHandle, (Lib3MF_uint64)BallReferencesBuffer.size(), BallReferencesBuffer.data())); } /** - * CMeshObject::AddVertex - Adds a single vertex to a mesh object - * @param[in] Coordinates - contains the vertex coordinates. - * @return Index of the new vertex + * CBeamSet::GetBallReferences - Retrieves the ball references of a beamset + * @param[out] BallReferencesBuffer - retrieves the indices of all balls in this beamset */ - Lib3MF_uint32 CMeshObject::AddVertex(const sPosition & Coordinates) + void CBeamSet::GetBallReferences(std::vector & BallReferencesBuffer) { - Lib3MF_uint32 resultNewIndex = 0; - CheckError(lib3mf_meshobject_addvertex(m_pHandle, &Coordinates, &resultNewIndex)); + Lib3MF_uint64 elementsNeededBallReferences = 0; + Lib3MF_uint64 elementsWrittenBallReferences = 0; + CheckError(lib3mf_beamset_getballreferences(m_pHandle, 0, &elementsNeededBallReferences, nullptr)); + BallReferencesBuffer.resize((size_t) elementsNeededBallReferences); + CheckError(lib3mf_beamset_getballreferences(m_pHandle, elementsNeededBallReferences, &elementsWrittenBallReferences, BallReferencesBuffer.data())); + } + + /** + * Method definitions for class CBaseMaterialGroup + */ + + /** + * CBaseMaterialGroup::GetCount - Retrieves the count of base materials in the material group. + * @return returns the count of base materials. + */ + Lib3MF_uint32 CBaseMaterialGroup::GetCount() + { + Lib3MF_uint32 resultCount = 0; + CheckError(lib3mf_basematerialgroup_getcount(m_pHandle, &resultCount)); - return resultNewIndex; + return resultCount; } /** - * CMeshObject::GetVertices - Obtains all vertex positions of a mesh object - * @param[out] VerticesBuffer - contains the vertex coordinates. + * CBaseMaterialGroup::GetAllPropertyIDs - returns all the PropertyIDs of all materials in this group + * @param[out] PropertyIDsBuffer - PropertyID of the material in the material group. */ - void CMeshObject::GetVertices(std::vector & VerticesBuffer) + void CBaseMaterialGroup::GetAllPropertyIDs(std::vector & PropertyIDsBuffer) { - Lib3MF_uint64 elementsNeededVertices = 0; - Lib3MF_uint64 elementsWrittenVertices = 0; - CheckError(lib3mf_meshobject_getvertices(m_pHandle, 0, &elementsNeededVertices, nullptr)); - VerticesBuffer.resize((size_t) elementsNeededVertices); - CheckError(lib3mf_meshobject_getvertices(m_pHandle, elementsNeededVertices, &elementsWrittenVertices, VerticesBuffer.data())); + Lib3MF_uint64 elementsNeededPropertyIDs = 0; + Lib3MF_uint64 elementsWrittenPropertyIDs = 0; + CheckError(lib3mf_basematerialgroup_getallpropertyids(m_pHandle, 0, &elementsNeededPropertyIDs, nullptr)); + PropertyIDsBuffer.resize((size_t) elementsNeededPropertyIDs); + CheckError(lib3mf_basematerialgroup_getallpropertyids(m_pHandle, elementsNeededPropertyIDs, &elementsWrittenPropertyIDs, PropertyIDsBuffer.data())); } /** - * CMeshObject::GetTriangle - Returns indices of a single triangle of a mesh object. - * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) - * @return filled with the triangle indices. + * CBaseMaterialGroup::AddMaterial - Adds a new material to the material group + * @param[in] sName - new name of the base material. + * @param[in] DisplayColor - Display color of the material + * @return returns new PropertyID of the new material in the material group. */ - sTriangle CMeshObject::GetTriangle(const Lib3MF_uint32 nIndex) + Lib3MF_uint32 CBaseMaterialGroup::AddMaterial(const std::string & sName, const sColor & DisplayColor) { - sTriangle resultIndices; - CheckError(lib3mf_meshobject_gettriangle(m_pHandle, nIndex, &resultIndices)); + Lib3MF_uint32 resultPropertyID = 0; + CheckError(lib3mf_basematerialgroup_addmaterial(m_pHandle, sName.c_str(), &DisplayColor, &resultPropertyID)); - return resultIndices; + return resultPropertyID; } /** - * CMeshObject::SetTriangle - Sets the indices of a single triangle of a mesh object. - * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) - * @param[in] Indices - contains the triangle indices. + * CBaseMaterialGroup::RemoveMaterial - Removes a material from the material group. + * @param[in] nPropertyID - PropertyID of the material in the material group. */ - void CMeshObject::SetTriangle(const Lib3MF_uint32 nIndex, const sTriangle & Indices) + void CBaseMaterialGroup::RemoveMaterial(const Lib3MF_uint32 nPropertyID) { - CheckError(lib3mf_meshobject_settriangle(m_pHandle, nIndex, &Indices)); + CheckError(lib3mf_basematerialgroup_removematerial(m_pHandle, nPropertyID)); } /** - * CMeshObject::AddTriangle - Adds a single triangle to a mesh object - * @param[in] Indices - contains the triangle indices. - * @return Index of the new triangle + * CBaseMaterialGroup::GetName - Returns the base material's name + * @param[in] nPropertyID - PropertyID of the material in the material group. + * @return returns the name of the base material. */ - Lib3MF_uint32 CMeshObject::AddTriangle(const sTriangle & Indices) + std::string CBaseMaterialGroup::GetName(const Lib3MF_uint32 nPropertyID) { - Lib3MF_uint32 resultNewIndex = 0; - CheckError(lib3mf_meshobject_addtriangle(m_pHandle, &Indices, &resultNewIndex)); + Lib3MF_uint32 bytesNeededName = 0; + Lib3MF_uint32 bytesWrittenName = 0; + CheckError(lib3mf_basematerialgroup_getname(m_pHandle, nPropertyID, 0, &bytesNeededName, nullptr)); + std::vector bufferName(bytesNeededName); + CheckError(lib3mf_basematerialgroup_getname(m_pHandle, nPropertyID, bytesNeededName, &bytesWrittenName, &bufferName[0])); - return resultNewIndex; + return std::string(&bufferName[0]); } /** - * CMeshObject::GetTriangleIndices - Get all triangles of a mesh object - * @param[out] IndicesBuffer - contains the triangle indices. + * CBaseMaterialGroup::SetName - Sets a base material's name + * @param[in] nPropertyID - PropertyID of the material in the material group. + * @param[in] sName - new name of the base material. */ - void CMeshObject::GetTriangleIndices(std::vector & IndicesBuffer) + void CBaseMaterialGroup::SetName(const Lib3MF_uint32 nPropertyID, const std::string & sName) { - Lib3MF_uint64 elementsNeededIndices = 0; - Lib3MF_uint64 elementsWrittenIndices = 0; - CheckError(lib3mf_meshobject_gettriangleindices(m_pHandle, 0, &elementsNeededIndices, nullptr)); - IndicesBuffer.resize((size_t) elementsNeededIndices); - CheckError(lib3mf_meshobject_gettriangleindices(m_pHandle, elementsNeededIndices, &elementsWrittenIndices, IndicesBuffer.data())); + CheckError(lib3mf_basematerialgroup_setname(m_pHandle, nPropertyID, sName.c_str())); } /** - * CMeshObject::SetObjectLevelProperty - Sets the property at the object-level of the mesh object. - * @param[in] nUniqueResourceID - the object-level Property UniqueResourceID. - * @param[in] nPropertyID - the object-level PropertyID. + * CBaseMaterialGroup::SetDisplayColor - Sets a base material's display color. + * @param[in] nPropertyID - PropertyID of the material in the material group. + * @param[in] TheColor - The base material's display color */ - void CMeshObject::SetObjectLevelProperty(const Lib3MF_uint32 nUniqueResourceID, const Lib3MF_uint32 nPropertyID) + void CBaseMaterialGroup::SetDisplayColor(const Lib3MF_uint32 nPropertyID, const sColor & TheColor) + { + CheckError(lib3mf_basematerialgroup_setdisplaycolor(m_pHandle, nPropertyID, &TheColor)); + } + + /** + * CBaseMaterialGroup::GetDisplayColor - Returns a base material's display color. + * @param[in] nPropertyID - PropertyID of the material in the material group. + * @return The base material's display color + */ + sColor CBaseMaterialGroup::GetDisplayColor(const Lib3MF_uint32 nPropertyID) + { + sColor resultTheColor; + CheckError(lib3mf_basematerialgroup_getdisplaycolor(m_pHandle, nPropertyID, &resultTheColor)); + + return resultTheColor; + } + + /** + * Method definitions for class CColorGroup + */ + + /** + * CColorGroup::GetCount - Retrieves the count of base materials in this Color Group. + * @return returns the count of colors within this color group. + */ + Lib3MF_uint32 CColorGroup::GetCount() + { + Lib3MF_uint32 resultCount = 0; + CheckError(lib3mf_colorgroup_getcount(m_pHandle, &resultCount)); + + return resultCount; + } + + /** + * CColorGroup::GetAllPropertyIDs - returns all the PropertyIDs of all colors within this group + * @param[out] PropertyIDsBuffer - PropertyID of the color in the color group. + */ + void CColorGroup::GetAllPropertyIDs(std::vector & PropertyIDsBuffer) + { + Lib3MF_uint64 elementsNeededPropertyIDs = 0; + Lib3MF_uint64 elementsWrittenPropertyIDs = 0; + CheckError(lib3mf_colorgroup_getallpropertyids(m_pHandle, 0, &elementsNeededPropertyIDs, nullptr)); + PropertyIDsBuffer.resize((size_t) elementsNeededPropertyIDs); + CheckError(lib3mf_colorgroup_getallpropertyids(m_pHandle, elementsNeededPropertyIDs, &elementsWrittenPropertyIDs, PropertyIDsBuffer.data())); + } + + /** + * CColorGroup::AddColor - Adds a new value. + * @param[in] TheColor - The new color + * @return PropertyID of the new color within this color group. + */ + Lib3MF_uint32 CColorGroup::AddColor(const sColor & TheColor) + { + Lib3MF_uint32 resultPropertyID = 0; + CheckError(lib3mf_colorgroup_addcolor(m_pHandle, &TheColor, &resultPropertyID)); + + return resultPropertyID; + } + + /** + * CColorGroup::RemoveColor - Removes a color from the color group. + * @param[in] nPropertyID - PropertyID of the color to be removed from the color group. + */ + void CColorGroup::RemoveColor(const Lib3MF_uint32 nPropertyID) + { + CheckError(lib3mf_colorgroup_removecolor(m_pHandle, nPropertyID)); + } + + /** + * CColorGroup::SetColor - Sets a color value. + * @param[in] nPropertyID - PropertyID of a color within this color group. + * @param[in] TheColor - The color + */ + void CColorGroup::SetColor(const Lib3MF_uint32 nPropertyID, const sColor & TheColor) + { + CheckError(lib3mf_colorgroup_setcolor(m_pHandle, nPropertyID, &TheColor)); + } + + /** + * CColorGroup::GetColor - Sets a color value. + * @param[in] nPropertyID - PropertyID of a color within this color group. + * @return The color + */ + sColor CColorGroup::GetColor(const Lib3MF_uint32 nPropertyID) { - CheckError(lib3mf_meshobject_setobjectlevelproperty(m_pHandle, nUniqueResourceID, nPropertyID)); + sColor resultTheColor; + CheckError(lib3mf_colorgroup_getcolor(m_pHandle, nPropertyID, &resultTheColor)); + + return resultTheColor; } /** - * CMeshObject::GetObjectLevelProperty - Gets the property at the object-level of the mesh object. - * @param[out] nUniqueResourceID - the object-level Property UniqueResourceID. - * @param[out] nPropertyID - the object-level PropertyID. - * @return Has an object-level property been specified? + * Method definitions for class CTexture2DGroup + */ + + /** + * CTexture2DGroup::GetCount - Retrieves the count of tex2coords in the Texture2DGroup. + * @return returns the count of tex2coords. */ - bool CMeshObject::GetObjectLevelProperty(Lib3MF_uint32 & nUniqueResourceID, Lib3MF_uint32 & nPropertyID) + Lib3MF_uint32 CTexture2DGroup::GetCount() { - bool resultHasObjectLevelProperty = 0; - CheckError(lib3mf_meshobject_getobjectlevelproperty(m_pHandle, &nUniqueResourceID, &nPropertyID, &resultHasObjectLevelProperty)); + Lib3MF_uint32 resultCount = 0; + CheckError(lib3mf_texture2dgroup_getcount(m_pHandle, &resultCount)); - return resultHasObjectLevelProperty; + return resultCount; } /** - * CMeshObject::SetTriangleProperties - Sets the properties of a single triangle of a mesh object. - * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) - * @param[in] Properties - contains the triangle properties. + * CTexture2DGroup::GetAllPropertyIDs - returns all the PropertyIDs of all tex2coords in this Texture2DGroup + * @param[out] PropertyIDsBuffer - PropertyID of the tex2coords in the Texture2DGroup. */ - void CMeshObject::SetTriangleProperties(const Lib3MF_uint32 nIndex, const sTriangleProperties & Properties) + void CTexture2DGroup::GetAllPropertyIDs(std::vector & PropertyIDsBuffer) { - CheckError(lib3mf_meshobject_settriangleproperties(m_pHandle, nIndex, &Properties)); + Lib3MF_uint64 elementsNeededPropertyIDs = 0; + Lib3MF_uint64 elementsWrittenPropertyIDs = 0; + CheckError(lib3mf_texture2dgroup_getallpropertyids(m_pHandle, 0, &elementsNeededPropertyIDs, nullptr)); + PropertyIDsBuffer.resize((size_t) elementsNeededPropertyIDs); + CheckError(lib3mf_texture2dgroup_getallpropertyids(m_pHandle, elementsNeededPropertyIDs, &elementsWrittenPropertyIDs, PropertyIDsBuffer.data())); } /** - * CMeshObject::GetTriangleProperties - Gets the properties of a single triangle of a mesh object. - * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) - * @param[out] Property - returns the triangle properties. + * CTexture2DGroup::AddTex2Coord - Adds a new tex2coord to the Texture2DGroup + * @param[in] UVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. + * @return returns new PropertyID of the new tex2coord in the Texture2DGroup. */ - void CMeshObject::GetTriangleProperties(const Lib3MF_uint32 nIndex, sTriangleProperties & Property) + Lib3MF_uint32 CTexture2DGroup::AddTex2Coord(const sTex2Coord & UVCoordinate) { - CheckError(lib3mf_meshobject_gettriangleproperties(m_pHandle, nIndex, &Property)); + Lib3MF_uint32 resultPropertyID = 0; + CheckError(lib3mf_texture2dgroup_addtex2coord(m_pHandle, &UVCoordinate, &resultPropertyID)); + + return resultPropertyID; } /** - * CMeshObject::SetAllTriangleProperties - Sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. - * @param[in] PropertiesArrayBuffer - contains the triangle properties array. Must have trianglecount elements. + * CTexture2DGroup::GetTex2Coord - Obtains a tex2coord to the Texture2DGroup + * @param[in] nPropertyID - the PropertyID of the tex2coord in the Texture2DGroup. + * @return The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. */ - void CMeshObject::SetAllTriangleProperties(const CInputVector & PropertiesArrayBuffer) + sTex2Coord CTexture2DGroup::GetTex2Coord(const Lib3MF_uint32 nPropertyID) { - CheckError(lib3mf_meshobject_setalltriangleproperties(m_pHandle, (Lib3MF_uint64)PropertiesArrayBuffer.size(), PropertiesArrayBuffer.data())); + sTex2Coord resultUVCoordinate; + CheckError(lib3mf_texture2dgroup_gettex2coord(m_pHandle, nPropertyID, &resultUVCoordinate)); + + return resultUVCoordinate; } /** - * CMeshObject::GetAllTriangleProperties - Gets the properties of all triangles of a mesh object. - * @param[out] PropertiesArrayBuffer - returns the triangle properties array. Must have trianglecount elements. + * CTexture2DGroup::RemoveTex2Coord - Removes a tex2coords from the Texture2DGroup. + * @param[in] nPropertyID - PropertyID of the tex2coords in the Texture2DGroup. */ - void CMeshObject::GetAllTriangleProperties(std::vector & PropertiesArrayBuffer) + void CTexture2DGroup::RemoveTex2Coord(const Lib3MF_uint32 nPropertyID) { - Lib3MF_uint64 elementsNeededPropertiesArray = 0; - Lib3MF_uint64 elementsWrittenPropertiesArray = 0; - CheckError(lib3mf_meshobject_getalltriangleproperties(m_pHandle, 0, &elementsNeededPropertiesArray, nullptr)); - PropertiesArrayBuffer.resize((size_t) elementsNeededPropertiesArray); - CheckError(lib3mf_meshobject_getalltriangleproperties(m_pHandle, elementsNeededPropertiesArray, &elementsWrittenPropertiesArray, PropertiesArrayBuffer.data())); + CheckError(lib3mf_texture2dgroup_removetex2coord(m_pHandle, nPropertyID)); } /** - * CMeshObject::ClearAllProperties - Clears all properties of this mesh object (triangle and object-level). + * CTexture2DGroup::GetTexture2D - Obtains the texture2D instance of this group. + * @return the texture2D instance of this group. */ - void CMeshObject::ClearAllProperties() + PTexture2D CTexture2DGroup::GetTexture2D() { - CheckError(lib3mf_meshobject_clearallproperties(m_pHandle)); + Lib3MFHandle hTexture2DInstance = nullptr; + CheckError(lib3mf_texture2dgroup_gettexture2d(m_pHandle, &hTexture2DInstance)); + + if (!hTexture2DInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTexture2DInstance))); } /** - * CMeshObject::SetGeometry - Set all triangles of a mesh object - * @param[in] VerticesBuffer - contains the positions. - * @param[in] IndicesBuffer - contains the triangle indices. + * Method definitions for class CCompositeMaterials + */ + + /** + * CCompositeMaterials::GetCount - Retrieves the count of Composite-s in the CompositeMaterials. + * @return returns the count of Composite-s */ - void CMeshObject::SetGeometry(const CInputVector & VerticesBuffer, const CInputVector & IndicesBuffer) + Lib3MF_uint32 CCompositeMaterials::GetCount() { - CheckError(lib3mf_meshobject_setgeometry(m_pHandle, (Lib3MF_uint64)VerticesBuffer.size(), VerticesBuffer.data(), (Lib3MF_uint64)IndicesBuffer.size(), IndicesBuffer.data())); + Lib3MF_uint32 resultCount = 0; + CheckError(lib3mf_compositematerials_getcount(m_pHandle, &resultCount)); + + return resultCount; } /** - * CMeshObject::IsManifoldAndOriented - Retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. - * @return returns, if the object is oriented and manifold. + * CCompositeMaterials::GetAllPropertyIDs - returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials + * @param[out] PropertyIDsBuffer - PropertyID of the Composite-Mixing Values in the CompositeMaterials. */ - bool CMeshObject::IsManifoldAndOriented() + void CCompositeMaterials::GetAllPropertyIDs(std::vector & PropertyIDsBuffer) { - bool resultIsManifoldAndOriented = 0; - CheckError(lib3mf_meshobject_ismanifoldandoriented(m_pHandle, &resultIsManifoldAndOriented)); - - return resultIsManifoldAndOriented; + Lib3MF_uint64 elementsNeededPropertyIDs = 0; + Lib3MF_uint64 elementsWrittenPropertyIDs = 0; + CheckError(lib3mf_compositematerials_getallpropertyids(m_pHandle, 0, &elementsNeededPropertyIDs, nullptr)); + PropertyIDsBuffer.resize((size_t) elementsNeededPropertyIDs); + CheckError(lib3mf_compositematerials_getallpropertyids(m_pHandle, elementsNeededPropertyIDs, &elementsWrittenPropertyIDs, PropertyIDsBuffer.data())); } /** - * CMeshObject::BeamLattice - Retrieves the BeamLattice within this MeshObject. - * @return the BeamLattice within this MeshObject + * CCompositeMaterials::GetBaseMaterialGroup - Obtains the BaseMaterialGroup instance of this CompositeMaterials. + * @return returns the BaseMaterialGroup instance of this CompositeMaterials */ - PBeamLattice CMeshObject::BeamLattice() + PBaseMaterialGroup CCompositeMaterials::GetBaseMaterialGroup() { - Lib3MFHandle hTheBeamLattice = nullptr; - CheckError(lib3mf_meshobject_beamlattice(m_pHandle, &hTheBeamLattice)); + Lib3MFHandle hBaseMaterialGroupInstance = nullptr; + CheckError(lib3mf_compositematerials_getbasematerialgroup(m_pHandle, &hBaseMaterialGroupInstance)); - if (!hTheBeamLattice) { + if (!hBaseMaterialGroupInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheBeamLattice))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBaseMaterialGroupInstance))); } /** - * Method definitions for class CBeamLattice - */ + * CCompositeMaterials::AddComposite - Adds a new Composite-Mixing Values to the CompositeMaterials. + * @param[in] CompositeBuffer - The Composite Constituents to be added as composite + * @return returns new PropertyID of the new Composite in the CompositeMaterials. + */ + Lib3MF_uint32 CCompositeMaterials::AddComposite(const CInputVector & CompositeBuffer) + { + Lib3MF_uint32 resultPropertyID = 0; + CheckError(lib3mf_compositematerials_addcomposite(m_pHandle, (Lib3MF_uint64)CompositeBuffer.size(), CompositeBuffer.data(), &resultPropertyID)); + + return resultPropertyID; + } /** - * CBeamLattice::GetMinLength - Returns the minimal length of beams for the beamlattice. - * @return minimal length of beams for the beamlattice + * CCompositeMaterials::RemoveComposite - Removes a Composite-Maxing Ratio from the CompositeMaterials. + * @param[in] nPropertyID - PropertyID of the Composite-Mixing Values in the CompositeMaterials to be removed. */ - Lib3MF_double CBeamLattice::GetMinLength() + void CCompositeMaterials::RemoveComposite(const Lib3MF_uint32 nPropertyID) { - Lib3MF_double resultMinLength = 0; - CheckError(lib3mf_beamlattice_getminlength(m_pHandle, &resultMinLength)); - - return resultMinLength; + CheckError(lib3mf_compositematerials_removecomposite(m_pHandle, nPropertyID)); } /** - * CBeamLattice::SetMinLength - Sets the minimal length of beams for the beamlattice. - * @param[in] dMinLength - minimal length of beams for the beamlattice + * CCompositeMaterials::GetComposite - Obtains a Composite-Maxing Ratio of this CompositeMaterials. + * @param[in] nPropertyID - the PropertyID of the Composite-Maxing Ratio in the CompositeMaterials. + * @param[out] CompositeBuffer - The Composite-Mixing Values with the given PropertyID */ - void CBeamLattice::SetMinLength(const Lib3MF_double dMinLength) + void CCompositeMaterials::GetComposite(const Lib3MF_uint32 nPropertyID, std::vector & CompositeBuffer) { - CheckError(lib3mf_beamlattice_setminlength(m_pHandle, dMinLength)); + Lib3MF_uint64 elementsNeededComposite = 0; + Lib3MF_uint64 elementsWrittenComposite = 0; + CheckError(lib3mf_compositematerials_getcomposite(m_pHandle, nPropertyID, 0, &elementsNeededComposite, nullptr)); + CompositeBuffer.resize((size_t) elementsNeededComposite); + CheckError(lib3mf_compositematerials_getcomposite(m_pHandle, nPropertyID, elementsNeededComposite, &elementsWrittenComposite, CompositeBuffer.data())); } /** - * CBeamLattice::GetClipping - Returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. - * @param[out] eClipMode - contains the clip mode of this mesh - * @param[out] nUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object or an undefined value if pClipMode is MODELBEAMLATTICECLIPMODE_NONE + * Method definitions for class CMultiPropertyGroup + */ + + /** + * CMultiPropertyGroup::GetCount - Retrieves the count of MultiProperty-s in the MultiPropertyGroup. + * @return returns the count of MultiProperty-s */ - void CBeamLattice::GetClipping(eBeamLatticeClipMode & eClipMode, Lib3MF_uint32 & nUniqueResourceID) + Lib3MF_uint32 CMultiPropertyGroup::GetCount() { - CheckError(lib3mf_beamlattice_getclipping(m_pHandle, &eClipMode, &nUniqueResourceID)); + Lib3MF_uint32 resultCount = 0; + CheckError(lib3mf_multipropertygroup_getcount(m_pHandle, &resultCount)); + + return resultCount; } /** - * CBeamLattice::SetClipping - Sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. - * @param[in] eClipMode - contains the clip mode of this mesh - * @param[in] nUniqueResourceID - the UniqueResourceID of the clipping mesh-object. This mesh-object has to be defined before setting the Clipping. + * CMultiPropertyGroup::GetAllPropertyIDs - returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup + * @param[out] PropertyIDsBuffer - PropertyID of the MultiProperty-s in the MultiPropertyGroup. */ - void CBeamLattice::SetClipping(const eBeamLatticeClipMode eClipMode, const Lib3MF_uint32 nUniqueResourceID) + void CMultiPropertyGroup::GetAllPropertyIDs(std::vector & PropertyIDsBuffer) { - CheckError(lib3mf_beamlattice_setclipping(m_pHandle, eClipMode, nUniqueResourceID)); + Lib3MF_uint64 elementsNeededPropertyIDs = 0; + Lib3MF_uint64 elementsWrittenPropertyIDs = 0; + CheckError(lib3mf_multipropertygroup_getallpropertyids(m_pHandle, 0, &elementsNeededPropertyIDs, nullptr)); + PropertyIDsBuffer.resize((size_t) elementsNeededPropertyIDs); + CheckError(lib3mf_multipropertygroup_getallpropertyids(m_pHandle, elementsNeededPropertyIDs, &elementsWrittenPropertyIDs, PropertyIDsBuffer.data())); } /** - * CBeamLattice::GetRepresentation - Returns the representation-mesh for the beamlattice of this mesh. - * @return flag whether the beamlattice has a representation mesh. - * @param[out] nUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object. + * CMultiPropertyGroup::AddMultiProperty - Adds a new MultiProperty to the MultiPropertyGroup. + * @param[in] PropertyIDsBuffer - The PropertyIDs of the new MultiProperty. + * @return returns the PropertyID of the new MultiProperty in the MultiPropertyGroup. */ - bool CBeamLattice::GetRepresentation(Lib3MF_uint32 & nUniqueResourceID) + Lib3MF_uint32 CMultiPropertyGroup::AddMultiProperty(const CInputVector & PropertyIDsBuffer) { - bool resultHasRepresentation = 0; - CheckError(lib3mf_beamlattice_getrepresentation(m_pHandle, &resultHasRepresentation, &nUniqueResourceID)); + Lib3MF_uint32 resultPropertyID = 0; + CheckError(lib3mf_multipropertygroup_addmultiproperty(m_pHandle, (Lib3MF_uint64)PropertyIDsBuffer.size(), PropertyIDsBuffer.data(), &resultPropertyID)); - return resultHasRepresentation; + return resultPropertyID; } /** - * CBeamLattice::SetRepresentation - Sets the representation-mesh for the beamlattice of this mesh. - * @param[in] nUniqueResourceID - the UniqueResourceID of the representation mesh-object. This mesh-object has to be defined before setting the representation. + * CMultiPropertyGroup::SetMultiProperty - Sets the PropertyIDs of a MultiProperty. + * @param[in] nPropertyID - the PropertyID of the MultiProperty to be changed. + * @param[in] PropertyIDsBuffer - The new PropertyIDs of the MultiProperty */ - void CBeamLattice::SetRepresentation(const Lib3MF_uint32 nUniqueResourceID) + void CMultiPropertyGroup::SetMultiProperty(const Lib3MF_uint32 nPropertyID, const CInputVector & PropertyIDsBuffer) { - CheckError(lib3mf_beamlattice_setrepresentation(m_pHandle, nUniqueResourceID)); + CheckError(lib3mf_multipropertygroup_setmultiproperty(m_pHandle, nPropertyID, (Lib3MF_uint64)PropertyIDsBuffer.size(), PropertyIDsBuffer.data())); } /** - * CBeamLattice::GetBallOptions - Returns the ball mode and the default ball radius for the beamlattice of this mesh. - * @param[out] eBallMode - contains the ball mode of this mesh - * @param[out] dBallRadius - default ball radius of balls for the beamlattice + * CMultiPropertyGroup::GetMultiProperty - Obtains the PropertyIDs of a MultiProperty. + * @param[in] nPropertyID - the PropertyID of the MultiProperty to be queried. + * @param[out] PropertyIDsBuffer - The PropertyIDs of the MultiProperty */ - void CBeamLattice::GetBallOptions(eBeamLatticeBallMode & eBallMode, Lib3MF_double & dBallRadius) + void CMultiPropertyGroup::GetMultiProperty(const Lib3MF_uint32 nPropertyID, std::vector & PropertyIDsBuffer) { - CheckError(lib3mf_beamlattice_getballoptions(m_pHandle, &eBallMode, &dBallRadius)); + Lib3MF_uint64 elementsNeededPropertyIDs = 0; + Lib3MF_uint64 elementsWrittenPropertyIDs = 0; + CheckError(lib3mf_multipropertygroup_getmultiproperty(m_pHandle, nPropertyID, 0, &elementsNeededPropertyIDs, nullptr)); + PropertyIDsBuffer.resize((size_t) elementsNeededPropertyIDs); + CheckError(lib3mf_multipropertygroup_getmultiproperty(m_pHandle, nPropertyID, elementsNeededPropertyIDs, &elementsWrittenPropertyIDs, PropertyIDsBuffer.data())); } /** - * CBeamLattice::SetBallOptions - Sets the ball mode and thedefault ball radius for the beamlattice. - * @param[in] eBallMode - contains the ball mode of this mesh - * @param[in] dBallRadius - default ball radius of balls for the beamlattice + * CMultiPropertyGroup::RemoveMultiProperty - Removes a MultiProperty from this MultiPropertyGroup. + * @param[in] nPropertyID - the PropertyID of the MultiProperty to be removed. */ - void CBeamLattice::SetBallOptions(const eBeamLatticeBallMode eBallMode, const Lib3MF_double dBallRadius) + void CMultiPropertyGroup::RemoveMultiProperty(const Lib3MF_uint32 nPropertyID) { - CheckError(lib3mf_beamlattice_setballoptions(m_pHandle, eBallMode, dBallRadius)); + CheckError(lib3mf_multipropertygroup_removemultiproperty(m_pHandle, nPropertyID)); } /** - * CBeamLattice::GetBeamCount - Returns the beam count of a mesh object. - * @return filled with the beam count. + * CMultiPropertyGroup::GetLayerCount - Retrieves the number of layers of this MultiPropertyGroup. + * @return returns the number of layers */ - Lib3MF_uint32 CBeamLattice::GetBeamCount() + Lib3MF_uint32 CMultiPropertyGroup::GetLayerCount() { Lib3MF_uint32 resultCount = 0; - CheckError(lib3mf_beamlattice_getbeamcount(m_pHandle, &resultCount)); + CheckError(lib3mf_multipropertygroup_getlayercount(m_pHandle, &resultCount)); return resultCount; } /** - * CBeamLattice::GetBeam - Returns indices, radii and capmodes of a single beam of a mesh object. - * @param[in] nIndex - Index of the beam (0 to beamcount - 1). - * @return filled with the beam indices, radii and capmodes. + * CMultiPropertyGroup::AddLayer - Adds a MultiPropertyLayer to this MultiPropertyGroup. + * @param[in] TheLayer - The MultiPropertyLayer to add to this MultiPropertyGroup + * @return returns the index of this MultiPropertyLayer */ - sBeam CBeamLattice::GetBeam(const Lib3MF_uint32 nIndex) + Lib3MF_uint32 CMultiPropertyGroup::AddLayer(const sMultiPropertyLayer & TheLayer) { - sBeam resultBeamInfo; - CheckError(lib3mf_beamlattice_getbeam(m_pHandle, nIndex, &resultBeamInfo)); + Lib3MF_uint32 resultLayerIndex = 0; + CheckError(lib3mf_multipropertygroup_addlayer(m_pHandle, &TheLayer, &resultLayerIndex)); - return resultBeamInfo; + return resultLayerIndex; } /** - * CBeamLattice::AddBeam - Adds a single beam to a mesh object. - * @param[in] BeamInfo - contains the node indices, radii and capmodes. - * @return filled with the new Index of the beam. + * CMultiPropertyGroup::GetLayer - Obtains a MultiPropertyLayer of this MultiPropertyGroup. + * @param[in] nLayerIndex - The Index of the MultiPropertyLayer queried + * @return The MultiPropertyLayer with index LayerIndex within MultiPropertyGroup */ - Lib3MF_uint32 CBeamLattice::AddBeam(const sBeam & BeamInfo) + sMultiPropertyLayer CMultiPropertyGroup::GetLayer(const Lib3MF_uint32 nLayerIndex) { - Lib3MF_uint32 resultIndex = 0; - CheckError(lib3mf_beamlattice_addbeam(m_pHandle, &BeamInfo, &resultIndex)); + sMultiPropertyLayer resultTheLayer; + CheckError(lib3mf_multipropertygroup_getlayer(m_pHandle, nLayerIndex, &resultTheLayer)); - return resultIndex; + return resultTheLayer; } /** - * CBeamLattice::SetBeam - Sets the indices, radii and capmodes of a single beam of a mesh object. - * @param[in] nIndex - Index of the beam (0 to beamcount - 1). - * @param[in] BeamInfo - filled with the beam indices, radii and capmodes. + * CMultiPropertyGroup::RemoveLayer - Removes a MultiPropertyLayer from this MultiPropertyGroup. + * @param[in] nLayerIndex - The Index of the MultiPropertyLayer to be removed */ - void CBeamLattice::SetBeam(const Lib3MF_uint32 nIndex, const sBeam & BeamInfo) + void CMultiPropertyGroup::RemoveLayer(const Lib3MF_uint32 nLayerIndex) { - CheckError(lib3mf_beamlattice_setbeam(m_pHandle, nIndex, &BeamInfo)); + CheckError(lib3mf_multipropertygroup_removelayer(m_pHandle, nLayerIndex)); } /** - * CBeamLattice::SetBeams - Sets all beam indices, radii and capmodes of a mesh object. - * @param[in] BeamInfoBuffer - contains information of a number of beams + * Method definitions for class CAttachment + */ + + /** + * CAttachment::GetPath - Retrieves an attachment's package path. This function will be removed in a later release. + * @return returns the attachment's package path string */ - void CBeamLattice::SetBeams(const CInputVector & BeamInfoBuffer) + std::string CAttachment::GetPath() { - CheckError(lib3mf_beamlattice_setbeams(m_pHandle, (Lib3MF_uint64)BeamInfoBuffer.size(), BeamInfoBuffer.data())); + Lib3MF_uint32 bytesNeededPath = 0; + Lib3MF_uint32 bytesWrittenPath = 0; + CheckError(lib3mf_attachment_getpath(m_pHandle, 0, &bytesNeededPath, nullptr)); + std::vector bufferPath(bytesNeededPath); + CheckError(lib3mf_attachment_getpath(m_pHandle, bytesNeededPath, &bytesWrittenPath, &bufferPath[0])); + + return std::string(&bufferPath[0]); } /** - * CBeamLattice::GetBeams - obtains all beam indices, radii and capmodes of a mesh object. - * @param[out] BeamInfoBuffer - contains information of all beams + * CAttachment::SetPath - Sets an attachment's package path. This function will be removed in a later release. + * @param[in] sPath - new path of the attachment. */ - void CBeamLattice::GetBeams(std::vector & BeamInfoBuffer) + void CAttachment::SetPath(const std::string & sPath) { - Lib3MF_uint64 elementsNeededBeamInfo = 0; - Lib3MF_uint64 elementsWrittenBeamInfo = 0; - CheckError(lib3mf_beamlattice_getbeams(m_pHandle, 0, &elementsNeededBeamInfo, nullptr)); - BeamInfoBuffer.resize((size_t) elementsNeededBeamInfo); - CheckError(lib3mf_beamlattice_getbeams(m_pHandle, elementsNeededBeamInfo, &elementsWrittenBeamInfo, BeamInfoBuffer.data())); + CheckError(lib3mf_attachment_setpath(m_pHandle, sPath.c_str())); } /** - * CBeamLattice::GetBallCount - Returns the ball count of a mesh object. - * @return filled with the ball count. + * CAttachment::PackagePart - Returns the PackagePart that is this attachment. + * @return The PackagePart of this attachment. */ - Lib3MF_uint32 CBeamLattice::GetBallCount() + PPackagePart CAttachment::PackagePart() { - Lib3MF_uint32 resultCount = 0; - CheckError(lib3mf_beamlattice_getballcount(m_pHandle, &resultCount)); + Lib3MFHandle hPackagePart = nullptr; + CheckError(lib3mf_attachment_packagepart(m_pHandle, &hPackagePart)); - return resultCount; + if (!hPackagePart) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPackagePart))); } /** - * CBeamLattice::GetBall - Returns index and radius of a single ball of a mesh object. - * @param[in] nIndex - Index of the ball (0 to ballcount - 1). - * @return filled with the ball node index and radius. + * CAttachment::GetRelationShipType - Retrieves an attachment's relationship type + * @return returns the attachment's package relationship type string */ - sBall CBeamLattice::GetBall(const Lib3MF_uint32 nIndex) + std::string CAttachment::GetRelationShipType() { - sBall resultBallInfo; - CheckError(lib3mf_beamlattice_getball(m_pHandle, nIndex, &resultBallInfo)); + Lib3MF_uint32 bytesNeededPath = 0; + Lib3MF_uint32 bytesWrittenPath = 0; + CheckError(lib3mf_attachment_getrelationshiptype(m_pHandle, 0, &bytesNeededPath, nullptr)); + std::vector bufferPath(bytesNeededPath); + CheckError(lib3mf_attachment_getrelationshiptype(m_pHandle, bytesNeededPath, &bytesWrittenPath, &bufferPath[0])); - return resultBallInfo; + return std::string(&bufferPath[0]); } /** - * CBeamLattice::AddBall - Adds a single ball to a mesh object. - * @param[in] BallInfo - contains the node index and radius. - * @return filled with the new Index of the ball. + * CAttachment::SetRelationShipType - Sets an attachment's relationship type. + * @param[in] sPath - new relationship type string. */ - Lib3MF_uint32 CBeamLattice::AddBall(const sBall & BallInfo) + void CAttachment::SetRelationShipType(const std::string & sPath) { - Lib3MF_uint32 resultIndex = 0; - CheckError(lib3mf_beamlattice_addball(m_pHandle, &BallInfo, &resultIndex)); - - return resultIndex; + CheckError(lib3mf_attachment_setrelationshiptype(m_pHandle, sPath.c_str())); } /** - * CBeamLattice::SetBall - Sets the index and radius of a single ball of a mesh object. - * @param[in] nIndex - Index of the ball (0 to ballcount - 1). - * @param[in] BallInfo - filled with the ball node index and radius. + * CAttachment::WriteToFile - Writes out the attachment as file. + * @param[in] sFileName - file to write into. */ - void CBeamLattice::SetBall(const Lib3MF_uint32 nIndex, const sBall & BallInfo) + void CAttachment::WriteToFile(const std::string & sFileName) { - CheckError(lib3mf_beamlattice_setball(m_pHandle, nIndex, &BallInfo)); + CheckError(lib3mf_attachment_writetofile(m_pHandle, sFileName.c_str())); } /** - * CBeamLattice::SetBalls - Sets all ball indices and radii of a mesh object. - * @param[in] BallInfoBuffer - contains information of a number of balls + * CAttachment::ReadFromFile - Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. + * @param[in] sFileName - file to read from. */ - void CBeamLattice::SetBalls(const CInputVector & BallInfoBuffer) + void CAttachment::ReadFromFile(const std::string & sFileName) { - CheckError(lib3mf_beamlattice_setballs(m_pHandle, (Lib3MF_uint64)BallInfoBuffer.size(), BallInfoBuffer.data())); + CheckError(lib3mf_attachment_readfromfile(m_pHandle, sFileName.c_str())); } /** - * CBeamLattice::GetBalls - obtains all ball indices and radii of a mesh object. - * @param[out] BallInfoBuffer - contains information of all balls + * CAttachment::ReadFromCallback - Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. + * @param[in] pTheReadCallback - Callback to call for reading a data chunk + * @param[in] nStreamSize - number of bytes the callback returns + * @param[in] pTheSeekCallback - Callback to call for seeking in the stream. + * @param[in] pUserData - Userdata that is passed to the callback function */ - void CBeamLattice::GetBalls(std::vector & BallInfoBuffer) + void CAttachment::ReadFromCallback(const ReadCallback pTheReadCallback, const Lib3MF_uint64 nStreamSize, const SeekCallback pTheSeekCallback, const Lib3MF_pvoid pUserData) { - Lib3MF_uint64 elementsNeededBallInfo = 0; - Lib3MF_uint64 elementsWrittenBallInfo = 0; - CheckError(lib3mf_beamlattice_getballs(m_pHandle, 0, &elementsNeededBallInfo, nullptr)); - BallInfoBuffer.resize((size_t) elementsNeededBallInfo); - CheckError(lib3mf_beamlattice_getballs(m_pHandle, elementsNeededBallInfo, &elementsWrittenBallInfo, BallInfoBuffer.data())); + CheckError(lib3mf_attachment_readfromcallback(m_pHandle, pTheReadCallback, nStreamSize, pTheSeekCallback, pUserData)); } /** - * CBeamLattice::GetBeamSetCount - Returns the number of beamsets of a mesh object. - * @return filled with the beamset count. + * CAttachment::GetStreamSize - Retrieves the size of the attachment stream + * @return the stream size */ - Lib3MF_uint32 CBeamLattice::GetBeamSetCount() + Lib3MF_uint64 CAttachment::GetStreamSize() { - Lib3MF_uint32 resultCount = 0; - CheckError(lib3mf_beamlattice_getbeamsetcount(m_pHandle, &resultCount)); + Lib3MF_uint64 resultStreamSize = 0; + CheckError(lib3mf_attachment_getstreamsize(m_pHandle, &resultStreamSize)); - return resultCount; + return resultStreamSize; } /** - * CBeamLattice::AddBeamSet - Adds an empty beamset to a mesh object - * @return the new beamset + * CAttachment::WriteToBuffer - Writes out the attachment into a buffer + * @param[out] BufferBuffer - Buffer to write into */ - PBeamSet CBeamLattice::AddBeamSet() + void CAttachment::WriteToBuffer(std::vector & BufferBuffer) { - Lib3MFHandle hBeamSet = nullptr; - CheckError(lib3mf_beamlattice_addbeamset(m_pHandle, &hBeamSet)); - - if (!hBeamSet) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBeamSet))); + Lib3MF_uint64 elementsNeededBuffer = 0; + Lib3MF_uint64 elementsWrittenBuffer = 0; + CheckError(lib3mf_attachment_writetobuffer(m_pHandle, 0, &elementsNeededBuffer, nullptr)); + BufferBuffer.resize((size_t) elementsNeededBuffer); + CheckError(lib3mf_attachment_writetobuffer(m_pHandle, elementsNeededBuffer, &elementsWrittenBuffer, BufferBuffer.data())); } /** - * CBeamLattice::GetBeamSet - Returns a beamset of a mesh object - * @param[in] nIndex - index of the requested beamset (0 ... beamsetcount-1). - * @return the requested beamset + * CAttachment::ReadFromBuffer - Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). + * @param[in] BufferBuffer - Buffer to read from */ - PBeamSet CBeamLattice::GetBeamSet(const Lib3MF_uint32 nIndex) + void CAttachment::ReadFromBuffer(const CInputVector & BufferBuffer) { - Lib3MFHandle hBeamSet = nullptr; - CheckError(lib3mf_beamlattice_getbeamset(m_pHandle, nIndex, &hBeamSet)); - - if (!hBeamSet) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBeamSet))); + CheckError(lib3mf_attachment_readfrombuffer(m_pHandle, (Lib3MF_uint64)BufferBuffer.size(), BufferBuffer.data())); } /** - * Method definitions for class CComponent + * Method definitions for class CTexture2D */ /** - * CComponent::GetObjectResource - Returns the Resource Instance of the component. - * @return filled with the Resource Instance. + * CTexture2D::GetAttachment - Retrieves the attachment located at the path of the texture. + * @return attachment that holds the texture's image information. */ - PObject CComponent::GetObjectResource() + PAttachment CTexture2D::GetAttachment() { - Lib3MFHandle hObjectResource = nullptr; - CheckError(lib3mf_component_getobjectresource(m_pHandle, &hObjectResource)); + Lib3MFHandle hAttachment = nullptr; + CheckError(lib3mf_texture2d_getattachment(m_pHandle, &hAttachment)); - if (!hObjectResource) { + if (!hAttachment) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hObjectResource))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hAttachment))); } /** - * CComponent::GetObjectResourceID - Returns the UniqueResourceID of the component. - * @return returns the UniqueResourceID. + * CTexture2D::SetAttachment - Sets the texture's package path to the path of the attachment. + * @param[in] pAttachment - attachment that holds the texture's image information. */ - Lib3MF_uint32 CComponent::GetObjectResourceID() + void CTexture2D::SetAttachment(classParam pAttachment) { - Lib3MF_uint32 resultUniqueResourceID = 0; - CheckError(lib3mf_component_getobjectresourceid(m_pHandle, &resultUniqueResourceID)); - - return resultUniqueResourceID; + Lib3MFHandle hAttachment = pAttachment.GetHandle(); + CheckError(lib3mf_texture2d_setattachment(m_pHandle, hAttachment)); } /** - * CComponent::GetUUID - returns, whether a component has a UUID and, if true, the component's UUID - * @param[out] bHasUUID - flag whether the component has a UUID - * @return the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + * CTexture2D::GetContentType - Retrieves a texture's content type. + * @return returns content type enum. */ - std::string CComponent::GetUUID(bool & bHasUUID) + eTextureType CTexture2D::GetContentType() { - Lib3MF_uint32 bytesNeededUUID = 0; - Lib3MF_uint32 bytesWrittenUUID = 0; - CheckError(lib3mf_component_getuuid(m_pHandle, &bHasUUID, 0, &bytesNeededUUID, nullptr)); - std::vector bufferUUID(bytesNeededUUID); - CheckError(lib3mf_component_getuuid(m_pHandle, &bHasUUID, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0])); + eTextureType resultContentType = (eTextureType) 0; + CheckError(lib3mf_texture2d_getcontenttype(m_pHandle, &resultContentType)); - return std::string(&bufferUUID[0]); + return resultContentType; } /** - * CComponent::SetUUID - sets the component's UUID - * @param[in] sUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + * CTexture2D::SetContentType - Retrieves a texture's content type. + * @param[in] eContentType - new Content Type */ - void CComponent::SetUUID(const std::string & sUUID) + void CTexture2D::SetContentType(const eTextureType eContentType) { - CheckError(lib3mf_component_setuuid(m_pHandle, sUUID.c_str())); + CheckError(lib3mf_texture2d_setcontenttype(m_pHandle, eContentType)); } /** - * CComponent::HasTransform - Returns, if the component has a different transformation than the identity matrix - * @return if true is returned, the transformation is not equal than the identity + * CTexture2D::GetTileStyleUV - Retrieves a texture's tilestyle type. + * @param[out] eTileStyleU - returns tilestyle type enum. + * @param[out] eTileStyleV - returns tilestyle type enum. */ - bool CComponent::HasTransform() + void CTexture2D::GetTileStyleUV(eTextureTileStyle & eTileStyleU, eTextureTileStyle & eTileStyleV) { - bool resultHasTransform = 0; - CheckError(lib3mf_component_hastransform(m_pHandle, &resultHasTransform)); - - return resultHasTransform; + CheckError(lib3mf_texture2d_gettilestyleuv(m_pHandle, &eTileStyleU, &eTileStyleV)); + } + + /** + * CTexture2D::SetTileStyleUV - Sets a texture's tilestyle type. + * @param[in] eTileStyleU - new tilestyle type enum. + * @param[in] eTileStyleV - new tilestyle type enum. + */ + void CTexture2D::SetTileStyleUV(const eTextureTileStyle eTileStyleU, const eTextureTileStyle eTileStyleV) + { + CheckError(lib3mf_texture2d_settilestyleuv(m_pHandle, eTileStyleU, eTileStyleV)); } /** - * CComponent::GetTransform - Returns the transformation matrix of the component. - * @return filled with the component transformation matrix + * CTexture2D::GetFilter - Retrieves a texture's filter type. + * @return returns filter type enum. */ - sTransform CComponent::GetTransform() + eTextureFilter CTexture2D::GetFilter() { - sTransform resultTransform; - CheckError(lib3mf_component_gettransform(m_pHandle, &resultTransform)); + eTextureFilter resultFilter = (eTextureFilter) 0; + CheckError(lib3mf_texture2d_getfilter(m_pHandle, &resultFilter)); - return resultTransform; + return resultFilter; } /** - * CComponent::SetTransform - Sets the transformation matrix of the component. - * @param[in] Transform - new transformation matrix + * CTexture2D::SetFilter - Sets a texture's filter type. + * @param[in] eFilter - sets new filter type enum. */ - void CComponent::SetTransform(const sTransform & Transform) + void CTexture2D::SetFilter(const eTextureFilter eFilter) { - CheckError(lib3mf_component_settransform(m_pHandle, &Transform)); + CheckError(lib3mf_texture2d_setfilter(m_pHandle, eFilter)); } /** - * Method definitions for class CComponentsObject + * Method definitions for class CBuildItem */ /** - * CComponentsObject::AddComponent - Adds a new component to a components object. - * @param[in] pObjectResource - object to add as component. Must not lead to circular references! - * @param[in] Transform - optional transform matrix for the component. - * @return new component instance - */ - PComponent CComponentsObject::AddComponent(classParam pObjectResource, const sTransform & Transform) - { - Lib3MFHandle hObjectResource = pObjectResource.GetHandle(); - Lib3MFHandle hComponentInstance = nullptr; - CheckError(lib3mf_componentsobject_addcomponent(m_pHandle, hObjectResource, &Transform, &hComponentInstance)); - - if (!hComponentInstance) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hComponentInstance))); - } - - /** - * CComponentsObject::GetComponent - Retrieves a component from a component object. - * @param[in] nIndex - index of the component to retrieve (0 to componentcount - 1) - * @return component instance + * CBuildItem::GetObjectResource - Retrieves the object resource associated to a build item + * @return returns the associated resource instance */ - PComponent CComponentsObject::GetComponent(const Lib3MF_uint32 nIndex) + PObject CBuildItem::GetObjectResource() { - Lib3MFHandle hComponentInstance = nullptr; - CheckError(lib3mf_componentsobject_getcomponent(m_pHandle, nIndex, &hComponentInstance)); + Lib3MFHandle hObjectResource = nullptr; + CheckError(lib3mf_builditem_getobjectresource(m_pHandle, &hObjectResource)); - if (!hComponentInstance) { + if (!hObjectResource) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hComponentInstance))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hObjectResource))); } /** - * CComponentsObject::GetComponentCount - Retrieves a component count of a component object. - * @return returns the component count + * CBuildItem::GetUUID - returns, whether a build item has a UUID and, if true, the build item's UUID + * @param[out] bHasUUID - flag whether the build item has a UUID + * @return the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' */ - Lib3MF_uint32 CComponentsObject::GetComponentCount() + std::string CBuildItem::GetUUID(bool & bHasUUID) { - Lib3MF_uint32 resultCount = 0; - CheckError(lib3mf_componentsobject_getcomponentcount(m_pHandle, &resultCount)); + Lib3MF_uint32 bytesNeededUUID = 0; + Lib3MF_uint32 bytesWrittenUUID = 0; + CheckError(lib3mf_builditem_getuuid(m_pHandle, &bHasUUID, 0, &bytesNeededUUID, nullptr)); + std::vector bufferUUID(bytesNeededUUID); + CheckError(lib3mf_builditem_getuuid(m_pHandle, &bHasUUID, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0])); - return resultCount; + return std::string(&bufferUUID[0]); } /** - * Method definitions for class CBeamSet - */ - - /** - * CBeamSet::SetName - Sets a beamset's name string - * @param[in] sName - new name of the beamset. + * CBuildItem::SetUUID - sets the build item's UUID + * @param[in] sUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' */ - void CBeamSet::SetName(const std::string & sName) + void CBuildItem::SetUUID(const std::string & sUUID) { - CheckError(lib3mf_beamset_setname(m_pHandle, sName.c_str())); + CheckError(lib3mf_builditem_setuuid(m_pHandle, sUUID.c_str())); } /** - * CBeamSet::GetName - Retrieves a beamset's name string - * @return returns the name of the beamset. + * CBuildItem::GetObjectResourceID - Retrieves the object UniqueResourceID associated to a build item + * @return returns the UniqueResourceID of the object */ - std::string CBeamSet::GetName() + Lib3MF_uint32 CBuildItem::GetObjectResourceID() { - Lib3MF_uint32 bytesNeededName = 0; - Lib3MF_uint32 bytesWrittenName = 0; - CheckError(lib3mf_beamset_getname(m_pHandle, 0, &bytesNeededName, nullptr)); - std::vector bufferName(bytesNeededName); - CheckError(lib3mf_beamset_getname(m_pHandle, bytesNeededName, &bytesWrittenName, &bufferName[0])); + Lib3MF_uint32 resultUniqueResourceID = 0; + CheckError(lib3mf_builditem_getobjectresourceid(m_pHandle, &resultUniqueResourceID)); - return std::string(&bufferName[0]); - } - - /** - * CBeamSet::SetIdentifier - Sets a beamset's identifier string - * @param[in] sIdentifier - new name of the beamset. - */ - void CBeamSet::SetIdentifier(const std::string & sIdentifier) - { - CheckError(lib3mf_beamset_setidentifier(m_pHandle, sIdentifier.c_str())); + return resultUniqueResourceID; } /** - * CBeamSet::GetIdentifier - Retrieves a beamset's identifier string - * @return returns the identifier of the beamset. + * CBuildItem::HasObjectTransform - Checks, if a build item has a non-identity transformation matrix + * @return returns true, if the transformation matrix is not the identity */ - std::string CBeamSet::GetIdentifier() + bool CBuildItem::HasObjectTransform() { - Lib3MF_uint32 bytesNeededIdentifier = 0; - Lib3MF_uint32 bytesWrittenIdentifier = 0; - CheckError(lib3mf_beamset_getidentifier(m_pHandle, 0, &bytesNeededIdentifier, nullptr)); - std::vector bufferIdentifier(bytesNeededIdentifier); - CheckError(lib3mf_beamset_getidentifier(m_pHandle, bytesNeededIdentifier, &bytesWrittenIdentifier, &bufferIdentifier[0])); + bool resultHasTransform = 0; + CheckError(lib3mf_builditem_hasobjecttransform(m_pHandle, &resultHasTransform)); - return std::string(&bufferIdentifier[0]); + return resultHasTransform; } /** - * CBeamSet::GetReferenceCount - Retrieves the reference count of a beamset - * @return returns the reference count + * CBuildItem::GetObjectTransform - Retrieves a build item's transformation matrix. + * @return returns the transformation matrix */ - Lib3MF_uint32 CBeamSet::GetReferenceCount() + sTransform CBuildItem::GetObjectTransform() { - Lib3MF_uint32 resultCount = 0; - CheckError(lib3mf_beamset_getreferencecount(m_pHandle, &resultCount)); + sTransform resultTransform; + CheckError(lib3mf_builditem_getobjecttransform(m_pHandle, &resultTransform)); - return resultCount; + return resultTransform; } /** - * CBeamSet::SetReferences - Sets the references of a beamset - * @param[in] ReferencesBuffer - the new indices of all beams in this beamset + * CBuildItem::SetObjectTransform - Sets a build item's transformation matrix. + * @param[in] Transform - new transformation matrix */ - void CBeamSet::SetReferences(const CInputVector & ReferencesBuffer) + void CBuildItem::SetObjectTransform(const sTransform & Transform) { - CheckError(lib3mf_beamset_setreferences(m_pHandle, (Lib3MF_uint64)ReferencesBuffer.size(), ReferencesBuffer.data())); + CheckError(lib3mf_builditem_setobjecttransform(m_pHandle, &Transform)); } /** - * CBeamSet::GetReferences - Retrieves the references of a beamset - * @param[out] ReferencesBuffer - retrieves the indices of all beams in this beamset + * CBuildItem::GetPartNumber - Retrieves a build item's part number string + * @return Returns a build item's part number string */ - void CBeamSet::GetReferences(std::vector & ReferencesBuffer) + std::string CBuildItem::GetPartNumber() { - Lib3MF_uint64 elementsNeededReferences = 0; - Lib3MF_uint64 elementsWrittenReferences = 0; - CheckError(lib3mf_beamset_getreferences(m_pHandle, 0, &elementsNeededReferences, nullptr)); - ReferencesBuffer.resize((size_t) elementsNeededReferences); - CheckError(lib3mf_beamset_getreferences(m_pHandle, elementsNeededReferences, &elementsWrittenReferences, ReferencesBuffer.data())); + Lib3MF_uint32 bytesNeededPartNumber = 0; + Lib3MF_uint32 bytesWrittenPartNumber = 0; + CheckError(lib3mf_builditem_getpartnumber(m_pHandle, 0, &bytesNeededPartNumber, nullptr)); + std::vector bufferPartNumber(bytesNeededPartNumber); + CheckError(lib3mf_builditem_getpartnumber(m_pHandle, bytesNeededPartNumber, &bytesWrittenPartNumber, &bufferPartNumber[0])); + + return std::string(&bufferPartNumber[0]); } /** - * CBeamSet::GetBallReferenceCount - Retrieves the ball reference count of a beamset - * @return returns the ball reference count + * CBuildItem::SetPartNumber - Sets a build item's part number string + * @param[in] sSetPartnumber - new part number string for referencing parts from the outside world */ - Lib3MF_uint32 CBeamSet::GetBallReferenceCount() + void CBuildItem::SetPartNumber(const std::string & sSetPartnumber) { - Lib3MF_uint32 resultCount = 0; - CheckError(lib3mf_beamset_getballreferencecount(m_pHandle, &resultCount)); - - return resultCount; + CheckError(lib3mf_builditem_setpartnumber(m_pHandle, sSetPartnumber.c_str())); } /** - * CBeamSet::SetBallReferences - Sets the ball references of a beamset - * @param[in] BallReferencesBuffer - the new indices of all balls in this beamset + * CBuildItem::GetMetaDataGroup - Returns the metadatagroup of this build item + * @return returns an Instance of the metadatagroup of this build item */ - void CBeamSet::SetBallReferences(const CInputVector & BallReferencesBuffer) + PMetaDataGroup CBuildItem::GetMetaDataGroup() { - CheckError(lib3mf_beamset_setballreferences(m_pHandle, (Lib3MF_uint64)BallReferencesBuffer.size(), BallReferencesBuffer.data())); + Lib3MFHandle hMetaDataGroup = nullptr; + CheckError(lib3mf_builditem_getmetadatagroup(m_pHandle, &hMetaDataGroup)); + + if (!hMetaDataGroup) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMetaDataGroup))); } /** - * CBeamSet::GetBallReferences - Retrieves the ball references of a beamset - * @param[out] BallReferencesBuffer - retrieves the indices of all balls in this beamset + * CBuildItem::GetOutbox - Returns the outbox of a build item + * @return Outbox of this build item */ - void CBeamSet::GetBallReferences(std::vector & BallReferencesBuffer) + sBox CBuildItem::GetOutbox() { - Lib3MF_uint64 elementsNeededBallReferences = 0; - Lib3MF_uint64 elementsWrittenBallReferences = 0; - CheckError(lib3mf_beamset_getballreferences(m_pHandle, 0, &elementsNeededBallReferences, nullptr)); - BallReferencesBuffer.resize((size_t) elementsNeededBallReferences); - CheckError(lib3mf_beamset_getballreferences(m_pHandle, elementsNeededBallReferences, &elementsWrittenBallReferences, BallReferencesBuffer.data())); + sBox resultOutbox; + CheckError(lib3mf_builditem_getoutbox(m_pHandle, &resultOutbox)); + + return resultOutbox; } /** - * Method definitions for class CBaseMaterialGroup + * Method definitions for class CBuildItemIterator */ /** - * CBaseMaterialGroup::GetCount - Retrieves the count of base materials in the material group. - * @return returns the count of base materials. + * CBuildItemIterator::MoveNext - Iterates to the next build item in the list. + * @return Iterates to the next build item in the list. */ - Lib3MF_uint32 CBaseMaterialGroup::GetCount() + bool CBuildItemIterator::MoveNext() { - Lib3MF_uint32 resultCount = 0; - CheckError(lib3mf_basematerialgroup_getcount(m_pHandle, &resultCount)); + bool resultHasNext = 0; + CheckError(lib3mf_builditemiterator_movenext(m_pHandle, &resultHasNext)); - return resultCount; + return resultHasNext; } /** - * CBaseMaterialGroup::GetAllPropertyIDs - returns all the PropertyIDs of all materials in this group - * @param[out] PropertyIDsBuffer - PropertyID of the material in the material group. + * CBuildItemIterator::MovePrevious - Iterates to the previous build item in the list. + * @return Iterates to the previous build item in the list. */ - void CBaseMaterialGroup::GetAllPropertyIDs(std::vector & PropertyIDsBuffer) + bool CBuildItemIterator::MovePrevious() { - Lib3MF_uint64 elementsNeededPropertyIDs = 0; - Lib3MF_uint64 elementsWrittenPropertyIDs = 0; - CheckError(lib3mf_basematerialgroup_getallpropertyids(m_pHandle, 0, &elementsNeededPropertyIDs, nullptr)); - PropertyIDsBuffer.resize((size_t) elementsNeededPropertyIDs); - CheckError(lib3mf_basematerialgroup_getallpropertyids(m_pHandle, elementsNeededPropertyIDs, &elementsWrittenPropertyIDs, PropertyIDsBuffer.data())); + bool resultHasPrevious = 0; + CheckError(lib3mf_builditemiterator_moveprevious(m_pHandle, &resultHasPrevious)); + + return resultHasPrevious; } /** - * CBaseMaterialGroup::AddMaterial - Adds a new material to the material group - * @param[in] sName - new name of the base material. - * @param[in] DisplayColor - Display color of the material - * @return returns new PropertyID of the new material in the material group. + * CBuildItemIterator::GetCurrent - Returns the build item the iterator points at. + * @return returns the build item instance. */ - Lib3MF_uint32 CBaseMaterialGroup::AddMaterial(const std::string & sName, const sColor & DisplayColor) + PBuildItem CBuildItemIterator::GetCurrent() { - Lib3MF_uint32 resultPropertyID = 0; - CheckError(lib3mf_basematerialgroup_addmaterial(m_pHandle, sName.c_str(), &DisplayColor, &resultPropertyID)); + Lib3MFHandle hBuildItem = nullptr; + CheckError(lib3mf_builditemiterator_getcurrent(m_pHandle, &hBuildItem)); - return resultPropertyID; + if (!hBuildItem) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBuildItem))); } /** - * CBaseMaterialGroup::RemoveMaterial - Removes a material from the material group. - * @param[in] nPropertyID - PropertyID of the material in the material group. + * CBuildItemIterator::Clone - Creates a new build item iterator with the same build item list. + * @return returns the cloned Iterator instance */ - void CBaseMaterialGroup::RemoveMaterial(const Lib3MF_uint32 nPropertyID) + PBuildItemIterator CBuildItemIterator::Clone() { - CheckError(lib3mf_basematerialgroup_removematerial(m_pHandle, nPropertyID)); + Lib3MFHandle hOutBuildItemIterator = nullptr; + CheckError(lib3mf_builditemiterator_clone(m_pHandle, &hOutBuildItemIterator)); + + if (!hOutBuildItemIterator) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hOutBuildItemIterator))); } /** - * CBaseMaterialGroup::GetName - Returns the base material's name - * @param[in] nPropertyID - PropertyID of the material in the material group. - * @return returns the name of the base material. + * CBuildItemIterator::Count - Returns the number of build items the iterator captures. + * @return returns the number of build items the iterator captures. */ - std::string CBaseMaterialGroup::GetName(const Lib3MF_uint32 nPropertyID) + Lib3MF_uint64 CBuildItemIterator::Count() { - Lib3MF_uint32 bytesNeededName = 0; - Lib3MF_uint32 bytesWrittenName = 0; - CheckError(lib3mf_basematerialgroup_getname(m_pHandle, nPropertyID, 0, &bytesNeededName, nullptr)); - std::vector bufferName(bytesNeededName); - CheckError(lib3mf_basematerialgroup_getname(m_pHandle, nPropertyID, bytesNeededName, &bytesWrittenName, &bufferName[0])); + Lib3MF_uint64 resultCount = 0; + CheckError(lib3mf_builditemiterator_count(m_pHandle, &resultCount)); - return std::string(&bufferName[0]); + return resultCount; } /** - * CBaseMaterialGroup::SetName - Sets a base material's name - * @param[in] nPropertyID - PropertyID of the material in the material group. - * @param[in] sName - new name of the base material. + * Method definitions for class CSlice + */ + + /** + * CSlice::SetVertices - Set all vertices of a slice. All polygons will be cleared. + * @param[in] VerticesBuffer - contains the positions. */ - void CBaseMaterialGroup::SetName(const Lib3MF_uint32 nPropertyID, const std::string & sName) + void CSlice::SetVertices(const CInputVector & VerticesBuffer) { - CheckError(lib3mf_basematerialgroup_setname(m_pHandle, nPropertyID, sName.c_str())); + CheckError(lib3mf_slice_setvertices(m_pHandle, (Lib3MF_uint64)VerticesBuffer.size(), VerticesBuffer.data())); } /** - * CBaseMaterialGroup::SetDisplayColor - Sets a base material's display color. - * @param[in] nPropertyID - PropertyID of the material in the material group. - * @param[in] TheColor - The base material's display color + * CSlice::GetVertices - Get all vertices of a slice + * @param[out] VerticesBuffer - contains the positions. */ - void CBaseMaterialGroup::SetDisplayColor(const Lib3MF_uint32 nPropertyID, const sColor & TheColor) + void CSlice::GetVertices(std::vector & VerticesBuffer) { - CheckError(lib3mf_basematerialgroup_setdisplaycolor(m_pHandle, nPropertyID, &TheColor)); + Lib3MF_uint64 elementsNeededVertices = 0; + Lib3MF_uint64 elementsWrittenVertices = 0; + CheckError(lib3mf_slice_getvertices(m_pHandle, 0, &elementsNeededVertices, nullptr)); + VerticesBuffer.resize((size_t) elementsNeededVertices); + CheckError(lib3mf_slice_getvertices(m_pHandle, elementsNeededVertices, &elementsWrittenVertices, VerticesBuffer.data())); } /** - * CBaseMaterialGroup::GetDisplayColor - Returns a base material's display color. - * @param[in] nPropertyID - PropertyID of the material in the material group. - * @return The base material's display color + * CSlice::GetVertexCount - Get the number of vertices in a slice + * @return the number of vertices in the slice */ - sColor CBaseMaterialGroup::GetDisplayColor(const Lib3MF_uint32 nPropertyID) + Lib3MF_uint64 CSlice::GetVertexCount() { - sColor resultTheColor; - CheckError(lib3mf_basematerialgroup_getdisplaycolor(m_pHandle, nPropertyID, &resultTheColor)); + Lib3MF_uint64 resultCount = 0; + CheckError(lib3mf_slice_getvertexcount(m_pHandle, &resultCount)); - return resultTheColor; + return resultCount; } /** - * Method definitions for class CColorGroup - */ + * CSlice::AddPolygon - Add a new polygon to this slice + * @param[in] IndicesBuffer - the new indices of the new polygon + * @return the index of the new polygon + */ + Lib3MF_uint64 CSlice::AddPolygon(const CInputVector & IndicesBuffer) + { + Lib3MF_uint64 resultIndex = 0; + CheckError(lib3mf_slice_addpolygon(m_pHandle, (Lib3MF_uint64)IndicesBuffer.size(), IndicesBuffer.data(), &resultIndex)); + + return resultIndex; + } /** - * CColorGroup::GetCount - Retrieves the count of base materials in this Color Group. - * @return returns the count of colors within this color group. + * CSlice::GetPolygonCount - Get the number of polygons in the slice + * @return the number of polygons in the slice */ - Lib3MF_uint32 CColorGroup::GetCount() + Lib3MF_uint64 CSlice::GetPolygonCount() { - Lib3MF_uint32 resultCount = 0; - CheckError(lib3mf_colorgroup_getcount(m_pHandle, &resultCount)); + Lib3MF_uint64 resultCount = 0; + CheckError(lib3mf_slice_getpolygoncount(m_pHandle, &resultCount)); return resultCount; } /** - * CColorGroup::GetAllPropertyIDs - returns all the PropertyIDs of all colors within this group - * @param[out] PropertyIDsBuffer - PropertyID of the color in the color group. + * CSlice::SetPolygonIndices - Set all indices of a polygon + * @param[in] nIndex - the index of the polygon to manipulate + * @param[in] IndicesBuffer - the new indices of the index-th polygon */ - void CColorGroup::GetAllPropertyIDs(std::vector & PropertyIDsBuffer) + void CSlice::SetPolygonIndices(const Lib3MF_uint64 nIndex, const CInputVector & IndicesBuffer) { - Lib3MF_uint64 elementsNeededPropertyIDs = 0; - Lib3MF_uint64 elementsWrittenPropertyIDs = 0; - CheckError(lib3mf_colorgroup_getallpropertyids(m_pHandle, 0, &elementsNeededPropertyIDs, nullptr)); - PropertyIDsBuffer.resize((size_t) elementsNeededPropertyIDs); - CheckError(lib3mf_colorgroup_getallpropertyids(m_pHandle, elementsNeededPropertyIDs, &elementsWrittenPropertyIDs, PropertyIDsBuffer.data())); + CheckError(lib3mf_slice_setpolygonindices(m_pHandle, nIndex, (Lib3MF_uint64)IndicesBuffer.size(), IndicesBuffer.data())); } /** - * CColorGroup::AddColor - Adds a new value. - * @param[in] TheColor - The new color - * @return PropertyID of the new color within this color group. + * CSlice::GetPolygonIndices - Get all vertices of a slice + * @param[in] nIndex - the index of the polygon to manipulate + * @param[out] IndicesBuffer - the indices of the index-th polygon */ - Lib3MF_uint32 CColorGroup::AddColor(const sColor & TheColor) + void CSlice::GetPolygonIndices(const Lib3MF_uint64 nIndex, std::vector & IndicesBuffer) { - Lib3MF_uint32 resultPropertyID = 0; - CheckError(lib3mf_colorgroup_addcolor(m_pHandle, &TheColor, &resultPropertyID)); - - return resultPropertyID; + Lib3MF_uint64 elementsNeededIndices = 0; + Lib3MF_uint64 elementsWrittenIndices = 0; + CheckError(lib3mf_slice_getpolygonindices(m_pHandle, nIndex, 0, &elementsNeededIndices, nullptr)); + IndicesBuffer.resize((size_t) elementsNeededIndices); + CheckError(lib3mf_slice_getpolygonindices(m_pHandle, nIndex, elementsNeededIndices, &elementsWrittenIndices, IndicesBuffer.data())); } /** - * CColorGroup::RemoveColor - Removes a color from the color group. - * @param[in] nPropertyID - PropertyID of the color to be removed from the color group. + * CSlice::GetPolygonIndexCount - Get the number of vertices in a slice + * @param[in] nIndex - the index of the polygon to manipulate + * @return the number of indices of the index-th polygon */ - void CColorGroup::RemoveColor(const Lib3MF_uint32 nPropertyID) + Lib3MF_uint64 CSlice::GetPolygonIndexCount(const Lib3MF_uint64 nIndex) { - CheckError(lib3mf_colorgroup_removecolor(m_pHandle, nPropertyID)); + Lib3MF_uint64 resultCount = 0; + CheckError(lib3mf_slice_getpolygonindexcount(m_pHandle, nIndex, &resultCount)); + + return resultCount; } /** - * CColorGroup::SetColor - Sets a color value. - * @param[in] nPropertyID - PropertyID of a color within this color group. - * @param[in] TheColor - The color + * CSlice::GetZTop - Get the upper Z-Coordinate of this slice. + * @return the upper Z-Coordinate of this slice */ - void CColorGroup::SetColor(const Lib3MF_uint32 nPropertyID, const sColor & TheColor) + Lib3MF_double CSlice::GetZTop() { - CheckError(lib3mf_colorgroup_setcolor(m_pHandle, nPropertyID, &TheColor)); + Lib3MF_double resultZTop = 0; + CheckError(lib3mf_slice_getztop(m_pHandle, &resultZTop)); + + return resultZTop; } /** - * CColorGroup::GetColor - Sets a color value. - * @param[in] nPropertyID - PropertyID of a color within this color group. - * @return The color + * Method definitions for class CToolpathProfile + */ + + /** + * CToolpathProfile::GetUUID - Retrieves the profile's uuid + * @return Returns the uuid value. */ - sColor CColorGroup::GetColor(const Lib3MF_uint32 nPropertyID) + std::string CToolpathProfile::GetUUID() { - sColor resultTheColor; - CheckError(lib3mf_colorgroup_getcolor(m_pHandle, nPropertyID, &resultTheColor)); + Lib3MF_uint32 bytesNeededUUID = 0; + Lib3MF_uint32 bytesWrittenUUID = 0; + CheckError(lib3mf_toolpathprofile_getuuid(m_pHandle, 0, &bytesNeededUUID, nullptr)); + std::vector bufferUUID(bytesNeededUUID); + CheckError(lib3mf_toolpathprofile_getuuid(m_pHandle, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0])); - return resultTheColor; + return std::string(&bufferUUID[0]); } /** - * Method definitions for class CTexture2DGroup - */ + * CToolpathProfile::GetName - Retrieves the profile's name + * @return Returns the name. + */ + std::string CToolpathProfile::GetName() + { + Lib3MF_uint32 bytesNeededName = 0; + Lib3MF_uint32 bytesWrittenName = 0; + CheckError(lib3mf_toolpathprofile_getname(m_pHandle, 0, &bytesNeededName, nullptr)); + std::vector bufferName(bytesNeededName); + CheckError(lib3mf_toolpathprofile_getname(m_pHandle, bytesNeededName, &bytesWrittenName, &bufferName[0])); + + return std::string(&bufferName[0]); + } /** - * CTexture2DGroup::GetCount - Retrieves the count of tex2coords in the Texture2DGroup. - * @return returns the count of tex2coords. + * CToolpathProfile::GetParameterCount - Returns the number of parameters. + * @return Returns the number of parameters. */ - Lib3MF_uint32 CTexture2DGroup::GetCount() + Lib3MF_uint32 CToolpathProfile::GetParameterCount() { Lib3MF_uint32 resultCount = 0; - CheckError(lib3mf_texture2dgroup_getcount(m_pHandle, &resultCount)); + CheckError(lib3mf_toolpathprofile_getparametercount(m_pHandle, &resultCount)); return resultCount; } /** - * CTexture2DGroup::GetAllPropertyIDs - returns all the PropertyIDs of all tex2coords in this Texture2DGroup - * @param[out] PropertyIDsBuffer - PropertyID of the tex2coords in the Texture2DGroup. + * CToolpathProfile::GetParameterName - Returns the Name of a parameter. + * @param[in] nIndex - Index of Parameter (0-based). Call will fail if an invalid index is given. + * @return Returns the name of the parameter. */ - void CTexture2DGroup::GetAllPropertyIDs(std::vector & PropertyIDsBuffer) + std::string CToolpathProfile::GetParameterName(const Lib3MF_uint32 nIndex) { - Lib3MF_uint64 elementsNeededPropertyIDs = 0; - Lib3MF_uint64 elementsWrittenPropertyIDs = 0; - CheckError(lib3mf_texture2dgroup_getallpropertyids(m_pHandle, 0, &elementsNeededPropertyIDs, nullptr)); - PropertyIDsBuffer.resize((size_t) elementsNeededPropertyIDs); - CheckError(lib3mf_texture2dgroup_getallpropertyids(m_pHandle, elementsNeededPropertyIDs, &elementsWrittenPropertyIDs, PropertyIDsBuffer.data())); + Lib3MF_uint32 bytesNeededName = 0; + Lib3MF_uint32 bytesWrittenName = 0; + CheckError(lib3mf_toolpathprofile_getparametername(m_pHandle, nIndex, 0, &bytesNeededName, nullptr)); + std::vector bufferName(bytesNeededName); + CheckError(lib3mf_toolpathprofile_getparametername(m_pHandle, nIndex, bytesNeededName, &bytesWrittenName, &bufferName[0])); + + return std::string(&bufferName[0]); } /** - * CTexture2DGroup::AddTex2Coord - Adds a new tex2coord to the Texture2DGroup - * @param[in] UVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. - * @return returns new PropertyID of the new tex2coord in the Texture2DGroup. + * CToolpathProfile::GetParameterNameSpace - Returns the NameSpace of a parameter. + * @param[in] nIndex - Index of Parameter (0-based). Call will fail if an invalid index is given. + * @return Returns the namespace of the parameter. */ - Lib3MF_uint32 CTexture2DGroup::AddTex2Coord(const sTex2Coord & UVCoordinate) + std::string CToolpathProfile::GetParameterNameSpace(const Lib3MF_uint32 nIndex) { - Lib3MF_uint32 resultPropertyID = 0; - CheckError(lib3mf_texture2dgroup_addtex2coord(m_pHandle, &UVCoordinate, &resultPropertyID)); + Lib3MF_uint32 bytesNeededNameSpace = 0; + Lib3MF_uint32 bytesWrittenNameSpace = 0; + CheckError(lib3mf_toolpathprofile_getparameternamespace(m_pHandle, nIndex, 0, &bytesNeededNameSpace, nullptr)); + std::vector bufferNameSpace(bytesNeededNameSpace); + CheckError(lib3mf_toolpathprofile_getparameternamespace(m_pHandle, nIndex, bytesNeededNameSpace, &bytesWrittenNameSpace, &bufferNameSpace[0])); - return resultPropertyID; + return std::string(&bufferNameSpace[0]); } /** - * CTexture2DGroup::GetTex2Coord - Obtains a tex2coord to the Texture2DGroup - * @param[in] nPropertyID - the PropertyID of the tex2coord in the Texture2DGroup. - * @return The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. + * CToolpathProfile::HasParameterValue - Checks if a parameter value exists. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @return Returns if a value exists. */ - sTex2Coord CTexture2DGroup::GetTex2Coord(const Lib3MF_uint32 nPropertyID) + bool CToolpathProfile::HasParameterValue(const std::string & sNameSpaceName, const std::string & sValueName) { - sTex2Coord resultUVCoordinate; - CheckError(lib3mf_texture2dgroup_gettex2coord(m_pHandle, nPropertyID, &resultUVCoordinate)); + bool resultValueExists = 0; + CheckError(lib3mf_toolpathprofile_hasparametervalue(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), &resultValueExists)); - return resultUVCoordinate; + return resultValueExists; } /** - * CTexture2DGroup::RemoveTex2Coord - Removes a tex2coords from the Texture2DGroup. - * @param[in] nPropertyID - PropertyID of the tex2coords in the Texture2DGroup. + * CToolpathProfile::GetParameterValue - Retrieves a profile's parameter value. Fails if value does not exist. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @return Returns the value of the field. */ - void CTexture2DGroup::RemoveTex2Coord(const Lib3MF_uint32 nPropertyID) + std::string CToolpathProfile::GetParameterValue(const std::string & sNameSpaceName, const std::string & sValueName) { - CheckError(lib3mf_texture2dgroup_removetex2coord(m_pHandle, nPropertyID)); + Lib3MF_uint32 bytesNeededValue = 0; + Lib3MF_uint32 bytesWrittenValue = 0; + CheckError(lib3mf_toolpathprofile_getparametervalue(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), 0, &bytesNeededValue, nullptr)); + std::vector bufferValue(bytesNeededValue); + CheckError(lib3mf_toolpathprofile_getparametervalue(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), bytesNeededValue, &bytesWrittenValue, &bufferValue[0])); + + return std::string(&bufferValue[0]); } /** - * CTexture2DGroup::GetTexture2D - Obtains the texture2D instance of this group. - * @return the texture2D instance of this group. + * CToolpathProfile::GetParameterValueDef - Retrieves a profile's parameter value + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @param[in] sDefaultValue - Default value if value does not exist. + * @return Returns the value of the field. */ - PTexture2D CTexture2DGroup::GetTexture2D() + std::string CToolpathProfile::GetParameterValueDef(const std::string & sNameSpaceName, const std::string & sValueName, const std::string & sDefaultValue) { - Lib3MFHandle hTexture2DInstance = nullptr; - CheckError(lib3mf_texture2dgroup_gettexture2d(m_pHandle, &hTexture2DInstance)); + Lib3MF_uint32 bytesNeededValue = 0; + Lib3MF_uint32 bytesWrittenValue = 0; + CheckError(lib3mf_toolpathprofile_getparametervaluedef(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), sDefaultValue.c_str(), 0, &bytesNeededValue, nullptr)); + std::vector bufferValue(bytesNeededValue); + CheckError(lib3mf_toolpathprofile_getparametervaluedef(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), sDefaultValue.c_str(), bytesNeededValue, &bytesWrittenValue, &bufferValue[0])); - if (!hTexture2DInstance) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTexture2DInstance))); + return std::string(&bufferValue[0]); } /** - * Method definitions for class CCompositeMaterials - */ - - /** - * CCompositeMaterials::GetCount - Retrieves the count of Composite-s in the CompositeMaterials. - * @return returns the count of Composite-s + * CToolpathProfile::GetParameterDoubleValue - Retrieves a profile's parameter value as double. Fails if value does not exist or is not a double value. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @return Returns the value of the field. */ - Lib3MF_uint32 CCompositeMaterials::GetCount() + Lib3MF_double CToolpathProfile::GetParameterDoubleValue(const std::string & sNameSpaceName, const std::string & sValueName) { - Lib3MF_uint32 resultCount = 0; - CheckError(lib3mf_compositematerials_getcount(m_pHandle, &resultCount)); + Lib3MF_double resultValue = 0; + CheckError(lib3mf_toolpathprofile_getparameterdoublevalue(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), &resultValue)); - return resultCount; + return resultValue; } /** - * CCompositeMaterials::GetAllPropertyIDs - returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials - * @param[out] PropertyIDsBuffer - PropertyID of the Composite-Mixing Values in the CompositeMaterials. + * CToolpathProfile::GetParameterDoubleValueDef - Retrieves a profile's parameter value as double. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @param[in] dDefaultValue - Default value if value does not exist or is not a double value. + * @return Returns the value of the field. */ - void CCompositeMaterials::GetAllPropertyIDs(std::vector & PropertyIDsBuffer) + Lib3MF_double CToolpathProfile::GetParameterDoubleValueDef(const std::string & sNameSpaceName, const std::string & sValueName, const Lib3MF_double dDefaultValue) { - Lib3MF_uint64 elementsNeededPropertyIDs = 0; - Lib3MF_uint64 elementsWrittenPropertyIDs = 0; - CheckError(lib3mf_compositematerials_getallpropertyids(m_pHandle, 0, &elementsNeededPropertyIDs, nullptr)); - PropertyIDsBuffer.resize((size_t) elementsNeededPropertyIDs); - CheckError(lib3mf_compositematerials_getallpropertyids(m_pHandle, elementsNeededPropertyIDs, &elementsWrittenPropertyIDs, PropertyIDsBuffer.data())); + Lib3MF_double resultValue = 0; + CheckError(lib3mf_toolpathprofile_getparameterdoublevaluedef(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), dDefaultValue, &resultValue)); + + return resultValue; } /** - * CCompositeMaterials::GetBaseMaterialGroup - Obtains the BaseMaterialGroup instance of this CompositeMaterials. - * @return returns the BaseMaterialGroup instance of this CompositeMaterials + * CToolpathProfile::GetParameterIntegerValue - Retrieves a profile's parameter value as integer. Fails if value does not exist or is not a integer value. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @return Returns the value of the field. */ - PBaseMaterialGroup CCompositeMaterials::GetBaseMaterialGroup() + Lib3MF_int64 CToolpathProfile::GetParameterIntegerValue(const std::string & sNameSpaceName, const std::string & sValueName) { - Lib3MFHandle hBaseMaterialGroupInstance = nullptr; - CheckError(lib3mf_compositematerials_getbasematerialgroup(m_pHandle, &hBaseMaterialGroupInstance)); + Lib3MF_int64 resultValue = 0; + CheckError(lib3mf_toolpathprofile_getparameterintegervalue(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), &resultValue)); - if (!hBaseMaterialGroupInstance) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBaseMaterialGroupInstance))); + return resultValue; } /** - * CCompositeMaterials::AddComposite - Adds a new Composite-Mixing Values to the CompositeMaterials. - * @param[in] CompositeBuffer - The Composite Constituents to be added as composite - * @return returns new PropertyID of the new Composite in the CompositeMaterials. + * CToolpathProfile::GetParameterIntegerValueDef - Retrieves a profile's parameter value as integer. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @param[in] nDefaultValue - Default value if value does not exist or is not a integer value. + * @return Returns the value of the field. */ - Lib3MF_uint32 CCompositeMaterials::AddComposite(const CInputVector & CompositeBuffer) + Lib3MF_int64 CToolpathProfile::GetParameterIntegerValueDef(const std::string & sNameSpaceName, const std::string & sValueName, const Lib3MF_int64 nDefaultValue) { - Lib3MF_uint32 resultPropertyID = 0; - CheckError(lib3mf_compositematerials_addcomposite(m_pHandle, (Lib3MF_uint64)CompositeBuffer.size(), CompositeBuffer.data(), &resultPropertyID)); + Lib3MF_int64 resultValue = 0; + CheckError(lib3mf_toolpathprofile_getparameterintegervaluedef(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), nDefaultValue, &resultValue)); - return resultPropertyID; + return resultValue; } /** - * CCompositeMaterials::RemoveComposite - Removes a Composite-Maxing Ratio from the CompositeMaterials. - * @param[in] nPropertyID - PropertyID of the Composite-Mixing Values in the CompositeMaterials to be removed. + * CToolpathProfile::GetParameterBoolValue - Retrieves a profile's parameter value as boolean. Fails if value does not exist or is not a boolean value. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @return Returns the value of the field. */ - void CCompositeMaterials::RemoveComposite(const Lib3MF_uint32 nPropertyID) + bool CToolpathProfile::GetParameterBoolValue(const std::string & sNameSpaceName, const std::string & sValueName) { - CheckError(lib3mf_compositematerials_removecomposite(m_pHandle, nPropertyID)); + bool resultValue = 0; + CheckError(lib3mf_toolpathprofile_getparameterboolvalue(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), &resultValue)); + + return resultValue; } /** - * CCompositeMaterials::GetComposite - Obtains a Composite-Maxing Ratio of this CompositeMaterials. - * @param[in] nPropertyID - the PropertyID of the Composite-Maxing Ratio in the CompositeMaterials. - * @param[out] CompositeBuffer - The Composite-Mixing Values with the given PropertyID + * CToolpathProfile::GetParameterBoolValueDef - Retrieves a profile's parameter value as boolean. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @param[in] bDefaultValue - Default value if value does not exist or is not a boolean value. + * @return Returns the value of the field. */ - void CCompositeMaterials::GetComposite(const Lib3MF_uint32 nPropertyID, std::vector & CompositeBuffer) + bool CToolpathProfile::GetParameterBoolValueDef(const std::string & sNameSpaceName, const std::string & sValueName, const bool bDefaultValue) { - Lib3MF_uint64 elementsNeededComposite = 0; - Lib3MF_uint64 elementsWrittenComposite = 0; - CheckError(lib3mf_compositematerials_getcomposite(m_pHandle, nPropertyID, 0, &elementsNeededComposite, nullptr)); - CompositeBuffer.resize((size_t) elementsNeededComposite); - CheckError(lib3mf_compositematerials_getcomposite(m_pHandle, nPropertyID, elementsNeededComposite, &elementsWrittenComposite, CompositeBuffer.data())); + bool resultValue = 0; + CheckError(lib3mf_toolpathprofile_getparameterboolvaluedef(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), bDefaultValue, &resultValue)); + + return resultValue; } /** - * Method definitions for class CMultiPropertyGroup - */ - - /** - * CMultiPropertyGroup::GetCount - Retrieves the count of MultiProperty-s in the MultiPropertyGroup. - * @return returns the count of MultiProperty-s + * CToolpathProfile::SetName - Sets the profile's name + * @param[in] sName - Returns the name. */ - Lib3MF_uint32 CMultiPropertyGroup::GetCount() + void CToolpathProfile::SetName(const std::string & sName) { - Lib3MF_uint32 resultCount = 0; - CheckError(lib3mf_multipropertygroup_getcount(m_pHandle, &resultCount)); - - return resultCount; + CheckError(lib3mf_toolpathprofile_setname(m_pHandle, sName.c_str())); } /** - * CMultiPropertyGroup::GetAllPropertyIDs - returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup - * @param[out] PropertyIDsBuffer - PropertyID of the MultiProperty-s in the MultiPropertyGroup. + * CToolpathProfile::SetParameterValue - Sets a profile's parameter value. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @param[in] sValue - String value of the parameter. */ - void CMultiPropertyGroup::GetAllPropertyIDs(std::vector & PropertyIDsBuffer) + void CToolpathProfile::SetParameterValue(const std::string & sNameSpaceName, const std::string & sValueName, const std::string & sValue) { - Lib3MF_uint64 elementsNeededPropertyIDs = 0; - Lib3MF_uint64 elementsWrittenPropertyIDs = 0; - CheckError(lib3mf_multipropertygroup_getallpropertyids(m_pHandle, 0, &elementsNeededPropertyIDs, nullptr)); - PropertyIDsBuffer.resize((size_t) elementsNeededPropertyIDs); - CheckError(lib3mf_multipropertygroup_getallpropertyids(m_pHandle, elementsNeededPropertyIDs, &elementsWrittenPropertyIDs, PropertyIDsBuffer.data())); + CheckError(lib3mf_toolpathprofile_setparametervalue(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), sValue.c_str())); } /** - * CMultiPropertyGroup::AddMultiProperty - Adds a new MultiProperty to the MultiPropertyGroup. - * @param[in] PropertyIDsBuffer - The PropertyIDs of the new MultiProperty. - * @return returns the PropertyID of the new MultiProperty in the MultiPropertyGroup. + * CToolpathProfile::SetParameterDoubleValue - Sets a profile's parameter value as double. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @param[in] dValue - Double value of the parameter. */ - Lib3MF_uint32 CMultiPropertyGroup::AddMultiProperty(const CInputVector & PropertyIDsBuffer) + void CToolpathProfile::SetParameterDoubleValue(const std::string & sNameSpaceName, const std::string & sValueName, const Lib3MF_double dValue) { - Lib3MF_uint32 resultPropertyID = 0; - CheckError(lib3mf_multipropertygroup_addmultiproperty(m_pHandle, (Lib3MF_uint64)PropertyIDsBuffer.size(), PropertyIDsBuffer.data(), &resultPropertyID)); - - return resultPropertyID; + CheckError(lib3mf_toolpathprofile_setparameterdoublevalue(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), dValue)); } /** - * CMultiPropertyGroup::SetMultiProperty - Sets the PropertyIDs of a MultiProperty. - * @param[in] nPropertyID - the PropertyID of the MultiProperty to be changed. - * @param[in] PropertyIDsBuffer - The new PropertyIDs of the MultiProperty + * CToolpathProfile::SetParameterIntegerValue - Sets a profile's parameter value as integer. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @param[in] nValue - Integer value of the parameter. */ - void CMultiPropertyGroup::SetMultiProperty(const Lib3MF_uint32 nPropertyID, const CInputVector & PropertyIDsBuffer) + void CToolpathProfile::SetParameterIntegerValue(const std::string & sNameSpaceName, const std::string & sValueName, const Lib3MF_int64 nValue) { - CheckError(lib3mf_multipropertygroup_setmultiproperty(m_pHandle, nPropertyID, (Lib3MF_uint64)PropertyIDsBuffer.size(), PropertyIDsBuffer.data())); + CheckError(lib3mf_toolpathprofile_setparameterintegervalue(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), nValue)); } /** - * CMultiPropertyGroup::GetMultiProperty - Obtains the PropertyIDs of a MultiProperty. - * @param[in] nPropertyID - the PropertyID of the MultiProperty to be queried. - * @param[out] PropertyIDsBuffer - The PropertyIDs of the MultiProperty + * CToolpathProfile::SetParameterBoolValue - Sets a profile's parameter value as boolean. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @param[in] bValue - Boolean value of the parameter. */ - void CMultiPropertyGroup::GetMultiProperty(const Lib3MF_uint32 nPropertyID, std::vector & PropertyIDsBuffer) + void CToolpathProfile::SetParameterBoolValue(const std::string & sNameSpaceName, const std::string & sValueName, const bool bValue) { - Lib3MF_uint64 elementsNeededPropertyIDs = 0; - Lib3MF_uint64 elementsWrittenPropertyIDs = 0; - CheckError(lib3mf_multipropertygroup_getmultiproperty(m_pHandle, nPropertyID, 0, &elementsNeededPropertyIDs, nullptr)); - PropertyIDsBuffer.resize((size_t) elementsNeededPropertyIDs); - CheckError(lib3mf_multipropertygroup_getmultiproperty(m_pHandle, nPropertyID, elementsNeededPropertyIDs, &elementsWrittenPropertyIDs, PropertyIDsBuffer.data())); + CheckError(lib3mf_toolpathprofile_setparameterboolvalue(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), bValue)); } /** - * CMultiPropertyGroup::RemoveMultiProperty - Removes a MultiProperty from this MultiPropertyGroup. - * @param[in] nPropertyID - the PropertyID of the MultiProperty to be removed. + * Method definitions for class CToolpathLayerReader + */ + + /** + * CToolpathLayerReader::GetLayerDataUUID - Retrieves the layerdata's uuid + * @return Returns the uuid value. */ - void CMultiPropertyGroup::RemoveMultiProperty(const Lib3MF_uint32 nPropertyID) + std::string CToolpathLayerReader::GetLayerDataUUID() { - CheckError(lib3mf_multipropertygroup_removemultiproperty(m_pHandle, nPropertyID)); + Lib3MF_uint32 bytesNeededUUID = 0; + Lib3MF_uint32 bytesWrittenUUID = 0; + CheckError(lib3mf_toolpathlayerreader_getlayerdatauuid(m_pHandle, 0, &bytesNeededUUID, nullptr)); + std::vector bufferUUID(bytesNeededUUID); + CheckError(lib3mf_toolpathlayerreader_getlayerdatauuid(m_pHandle, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0])); + + return std::string(&bufferUUID[0]); } /** - * CMultiPropertyGroup::GetLayerCount - Retrieves the number of layers of this MultiPropertyGroup. - * @return returns the number of layers + * CToolpathLayerReader::GetSegmentCount - Retrieves the count of segments. + * @return Count */ - Lib3MF_uint32 CMultiPropertyGroup::GetLayerCount() + Lib3MF_uint32 CToolpathLayerReader::GetSegmentCount() { Lib3MF_uint32 resultCount = 0; - CheckError(lib3mf_multipropertygroup_getlayercount(m_pHandle, &resultCount)); + CheckError(lib3mf_toolpathlayerreader_getsegmentcount(m_pHandle, &resultCount)); return resultCount; } /** - * CMultiPropertyGroup::AddLayer - Adds a MultiPropertyLayer to this MultiPropertyGroup. - * @param[in] TheLayer - The MultiPropertyLayer to add to this MultiPropertyGroup - * @return returns the index of this MultiPropertyLayer + * CToolpathLayerReader::GetSegmentInfo - Retrieves the segment type information . + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @param[out] eType - Segment Type + * @param[out] nPointCount - Point count of segment. */ - Lib3MF_uint32 CMultiPropertyGroup::AddLayer(const sMultiPropertyLayer & TheLayer) + void CToolpathLayerReader::GetSegmentInfo(const Lib3MF_uint32 nIndex, eToolpathSegmentType & eType, Lib3MF_uint32 & nPointCount) { - Lib3MF_uint32 resultLayerIndex = 0; - CheckError(lib3mf_multipropertygroup_addlayer(m_pHandle, &TheLayer, &resultLayerIndex)); - - return resultLayerIndex; + CheckError(lib3mf_toolpathlayerreader_getsegmentinfo(m_pHandle, nIndex, &eType, &nPointCount)); } /** - * CMultiPropertyGroup::GetLayer - Obtains a MultiPropertyLayer of this MultiPropertyGroup. - * @param[in] nLayerIndex - The Index of the MultiPropertyLayer queried - * @return The MultiPropertyLayer with index LayerIndex within MultiPropertyGroup + * CToolpathLayerReader::GetSegmentProfile - Retrieves the assigned segment profile. + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @return Segment Profile */ - sMultiPropertyLayer CMultiPropertyGroup::GetLayer(const Lib3MF_uint32 nLayerIndex) + PToolpathProfile CToolpathLayerReader::GetSegmentProfile(const Lib3MF_uint32 nIndex) { - sMultiPropertyLayer resultTheLayer; - CheckError(lib3mf_multipropertygroup_getlayer(m_pHandle, nLayerIndex, &resultTheLayer)); + Lib3MFHandle hProfile = nullptr; + CheckError(lib3mf_toolpathlayerreader_getsegmentprofile(m_pHandle, nIndex, &hProfile)); - return resultTheLayer; + if (!hProfile) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hProfile))); } /** - * CMultiPropertyGroup::RemoveLayer - Removes a MultiPropertyLayer from this MultiPropertyGroup. - * @param[in] nLayerIndex - The Index of the MultiPropertyLayer to be removed + * CToolpathLayerReader::GetSegmentProfileUUID - Retrieves the assigned segment profile uuid. + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @return Segment Profile UUID */ - void CMultiPropertyGroup::RemoveLayer(const Lib3MF_uint32 nLayerIndex) + std::string CToolpathLayerReader::GetSegmentProfileUUID(const Lib3MF_uint32 nIndex) { - CheckError(lib3mf_multipropertygroup_removelayer(m_pHandle, nLayerIndex)); + Lib3MF_uint32 bytesNeededProfileUUID = 0; + Lib3MF_uint32 bytesWrittenProfileUUID = 0; + CheckError(lib3mf_toolpathlayerreader_getsegmentprofileuuid(m_pHandle, nIndex, 0, &bytesNeededProfileUUID, nullptr)); + std::vector bufferProfileUUID(bytesNeededProfileUUID); + CheckError(lib3mf_toolpathlayerreader_getsegmentprofileuuid(m_pHandle, nIndex, bytesNeededProfileUUID, &bytesWrittenProfileUUID, &bufferProfileUUID[0])); + + return std::string(&bufferProfileUUID[0]); } /** - * Method definitions for class CAttachment - */ + * CToolpathLayerReader::GetSegmentPart - Retrieves the assigned segment profile. + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @return Segment Build Item + */ + PBuildItem CToolpathLayerReader::GetSegmentPart(const Lib3MF_uint32 nIndex) + { + Lib3MFHandle hBuildItem = nullptr; + CheckError(lib3mf_toolpathlayerreader_getsegmentpart(m_pHandle, nIndex, &hBuildItem)); + + if (!hBuildItem) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBuildItem))); + } /** - * CAttachment::GetPath - Retrieves an attachment's package path. This function will be removed in a later release. - * @return returns the attachment's package path string + * CToolpathLayerReader::GetSegmentPartUUID - Retrieves the assigned segment part uuid. + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @return Segment Part UUID */ - std::string CAttachment::GetPath() + std::string CToolpathLayerReader::GetSegmentPartUUID(const Lib3MF_uint32 nIndex) { - Lib3MF_uint32 bytesNeededPath = 0; - Lib3MF_uint32 bytesWrittenPath = 0; - CheckError(lib3mf_attachment_getpath(m_pHandle, 0, &bytesNeededPath, nullptr)); - std::vector bufferPath(bytesNeededPath); - CheckError(lib3mf_attachment_getpath(m_pHandle, bytesNeededPath, &bytesWrittenPath, &bufferPath[0])); + Lib3MF_uint32 bytesNeededPartUUID = 0; + Lib3MF_uint32 bytesWrittenPartUUID = 0; + CheckError(lib3mf_toolpathlayerreader_getsegmentpartuuid(m_pHandle, nIndex, 0, &bytesNeededPartUUID, nullptr)); + std::vector bufferPartUUID(bytesNeededPartUUID); + CheckError(lib3mf_toolpathlayerreader_getsegmentpartuuid(m_pHandle, nIndex, bytesNeededPartUUID, &bytesWrittenPartUUID, &bufferPartUUID[0])); - return std::string(&bufferPath[0]); + return std::string(&bufferPartUUID[0]); } /** - * CAttachment::SetPath - Sets an attachment's package path. This function will be removed in a later release. - * @param[in] sPath - new path of the attachment. + * CToolpathLayerReader::GetSegmentLocalPartID - Retrieves the assigned segment part id. ATTENTION: This ID is only unique within the layer and there is no guarantee to be globally unique or consistent across layers. + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @return Local Segment Part ID */ - void CAttachment::SetPath(const std::string & sPath) + Lib3MF_uint32 CToolpathLayerReader::GetSegmentLocalPartID(const Lib3MF_uint32 nIndex) { - CheckError(lib3mf_attachment_setpath(m_pHandle, sPath.c_str())); + Lib3MF_uint32 resultLocalPartID = 0; + CheckError(lib3mf_toolpathlayerreader_getsegmentlocalpartid(m_pHandle, nIndex, &resultLocalPartID)); + + return resultLocalPartID; } /** - * CAttachment::PackagePart - Returns the PackagePart that is this attachment. - * @return The PackagePart of this attachment. + * CToolpathLayerReader::GetPartUUIDByLocalPartID - Retrieves the global part UUID by the local part ID. Fails if part ID does not exist in this layer. ATTENTION: This ID is only unique within the layer and there is no guarantee to be globally unique or consistent across layers. + * @param[in] nLocalPartID - Local Segment Part ID + * @return Segment Part UUID */ - PPackagePart CAttachment::PackagePart() + std::string CToolpathLayerReader::GetPartUUIDByLocalPartID(const Lib3MF_uint32 nLocalPartID) { - Lib3MFHandle hPackagePart = nullptr; - CheckError(lib3mf_attachment_packagepart(m_pHandle, &hPackagePart)); + Lib3MF_uint32 bytesNeededPartUUID = 0; + Lib3MF_uint32 bytesWrittenPartUUID = 0; + CheckError(lib3mf_toolpathlayerreader_getpartuuidbylocalpartid(m_pHandle, nLocalPartID, 0, &bytesNeededPartUUID, nullptr)); + std::vector bufferPartUUID(bytesNeededPartUUID); + CheckError(lib3mf_toolpathlayerreader_getpartuuidbylocalpartid(m_pHandle, nLocalPartID, bytesNeededPartUUID, &bytesWrittenPartUUID, &bufferPartUUID[0])); - if (!hPackagePart) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPackagePart))); + return std::string(&bufferPartUUID[0]); } /** - * CAttachment::GetRelationShipType - Retrieves an attachment's relationship type - * @return returns the attachment's package relationship type string + * CToolpathLayerReader::GetSegmentPointData - Retrieves the assigned segment point list. For type hatch, the points are taken pairwise. + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @param[out] PointDataBuffer - The point data array */ - std::string CAttachment::GetRelationShipType() + void CToolpathLayerReader::GetSegmentPointData(const Lib3MF_uint32 nIndex, std::vector & PointDataBuffer) { - Lib3MF_uint32 bytesNeededPath = 0; - Lib3MF_uint32 bytesWrittenPath = 0; - CheckError(lib3mf_attachment_getrelationshiptype(m_pHandle, 0, &bytesNeededPath, nullptr)); - std::vector bufferPath(bytesNeededPath); - CheckError(lib3mf_attachment_getrelationshiptype(m_pHandle, bytesNeededPath, &bytesWrittenPath, &bufferPath[0])); - - return std::string(&bufferPath[0]); + Lib3MF_uint64 elementsNeededPointData = 0; + Lib3MF_uint64 elementsWrittenPointData = 0; + CheckError(lib3mf_toolpathlayerreader_getsegmentpointdata(m_pHandle, nIndex, 0, &elementsNeededPointData, nullptr)); + PointDataBuffer.resize((size_t) elementsNeededPointData); + CheckError(lib3mf_toolpathlayerreader_getsegmentpointdata(m_pHandle, nIndex, elementsNeededPointData, &elementsWrittenPointData, PointDataBuffer.data())); } /** - * CAttachment::SetRelationShipType - Sets an attachment's relationship type. - * @param[in] sPath - new relationship type string. + * CToolpathLayerReader::FindAttributeInfoByName - Retrieves a segment attribute Information by Attribute Name. Will fail if Attribute does not exist. + * @param[in] sNameSpace - Namespace of the custom attribute. + * @param[in] sAttributeName - Name of the custom attribute. + * @param[out] nID - Attribute ID. + * @param[out] eAttributeType - Attribute Type. */ - void CAttachment::SetRelationShipType(const std::string & sPath) + void CToolpathLayerReader::FindAttributeInfoByName(const std::string & sNameSpace, const std::string & sAttributeName, Lib3MF_uint32 & nID, eToolpathAttributeType & eAttributeType) { - CheckError(lib3mf_attachment_setrelationshiptype(m_pHandle, sPath.c_str())); + CheckError(lib3mf_toolpathlayerreader_findattributeinfobyname(m_pHandle, sNameSpace.c_str(), sAttributeName.c_str(), &nID, &eAttributeType)); } /** - * CAttachment::WriteToFile - Writes out the attachment as file. - * @param[in] sFileName - file to write into. + * CToolpathLayerReader::FindAttributeIDByName - Retrieves a segment attribute ID by Attribute Name. Will fail if Attribute does not exist. + * @param[in] sNameSpace - Namespace of the custom attribute. + * @param[in] sAttributeName - Name of the custom attribute. + * @return Attribute ID. */ - void CAttachment::WriteToFile(const std::string & sFileName) + Lib3MF_uint32 CToolpathLayerReader::FindAttributeIDByName(const std::string & sNameSpace, const std::string & sAttributeName) { - CheckError(lib3mf_attachment_writetofile(m_pHandle, sFileName.c_str())); + Lib3MF_uint32 resultID = 0; + CheckError(lib3mf_toolpathlayerreader_findattributeidbyname(m_pHandle, sNameSpace.c_str(), sAttributeName.c_str(), &resultID)); + + return resultID; } /** - * CAttachment::ReadFromFile - Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. - * @param[in] sFileName - file to read from. + * CToolpathLayerReader::FindAttributeValueByName - Retrieves a segment attribute Type by Attribute Name. Will fail if Attribute does not exist. + * @param[in] sNameSpace - Namespace of the custom attribute. + * @param[in] sAttributeName - Name of the custom attribute. + * @return Attribute Type. */ - void CAttachment::ReadFromFile(const std::string & sFileName) + eToolpathAttributeType CToolpathLayerReader::FindAttributeValueByName(const std::string & sNameSpace, const std::string & sAttributeName) { - CheckError(lib3mf_attachment_readfromfile(m_pHandle, sFileName.c_str())); + eToolpathAttributeType resultAttributeType = (eToolpathAttributeType) 0; + CheckError(lib3mf_toolpathlayerreader_findattributevaluebyname(m_pHandle, sNameSpace.c_str(), sAttributeName.c_str(), &resultAttributeType)); + + return resultAttributeType; } /** - * CAttachment::ReadFromCallback - Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. - * @param[in] pTheReadCallback - Callback to call for reading a data chunk - * @param[in] nStreamSize - number of bytes the callback returns - * @param[in] pTheSeekCallback - Callback to call for seeking in the stream. - * @param[in] pUserData - Userdata that is passed to the callback function + * CToolpathLayerReader::GetSegmentIntegerAttributeByID - Retrieves a segment Uint32 attribute by Attribute ID. Will fail if Attribute does not exist. + * @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. + * @param[in] nID - Attribute ID. + * @return Attribute Value. */ - void CAttachment::ReadFromCallback(const ReadCallback pTheReadCallback, const Lib3MF_uint64 nStreamSize, const SeekCallback pTheSeekCallback, const Lib3MF_pvoid pUserData) + Lib3MF_int64 CToolpathLayerReader::GetSegmentIntegerAttributeByID(const Lib3MF_uint32 nIndex, const Lib3MF_uint32 nID) { - CheckError(lib3mf_attachment_readfromcallback(m_pHandle, pTheReadCallback, nStreamSize, pTheSeekCallback, pUserData)); + Lib3MF_int64 resultValue = 0; + CheckError(lib3mf_toolpathlayerreader_getsegmentintegerattributebyid(m_pHandle, nIndex, nID, &resultValue)); + + return resultValue; } /** - * CAttachment::GetStreamSize - Retrieves the size of the attachment stream - * @return the stream size + * CToolpathLayerReader::GetSegmentIntegerAttributeByName - Retrieves a segment integer attribute by Attribute Name. Will fail if Attribute does not exist or is of different type. + * @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. + * @param[in] sNameSpace - Namespace of the custom attribute. + * @param[in] sAttributeName - Name of the custom attribute. + * @return Attribute Value. */ - Lib3MF_uint64 CAttachment::GetStreamSize() + Lib3MF_int64 CToolpathLayerReader::GetSegmentIntegerAttributeByName(const Lib3MF_uint32 nIndex, const std::string & sNameSpace, const std::string & sAttributeName) { - Lib3MF_uint64 resultStreamSize = 0; - CheckError(lib3mf_attachment_getstreamsize(m_pHandle, &resultStreamSize)); + Lib3MF_int64 resultValue = 0; + CheckError(lib3mf_toolpathlayerreader_getsegmentintegerattributebyname(m_pHandle, nIndex, sNameSpace.c_str(), sAttributeName.c_str(), &resultValue)); - return resultStreamSize; + return resultValue; } /** - * CAttachment::WriteToBuffer - Writes out the attachment into a buffer - * @param[out] BufferBuffer - Buffer to write into + * CToolpathLayerReader::GetSegmentDoubleAttributeByID - Retrieves a segment Double attribute by Attribute ID. Will fail if Attribute does not exist. + * @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. + * @param[in] nID - Attribute ID. + * @return Attribute Value. */ - void CAttachment::WriteToBuffer(std::vector & BufferBuffer) + Lib3MF_double CToolpathLayerReader::GetSegmentDoubleAttributeByID(const Lib3MF_uint32 nIndex, const Lib3MF_uint32 nID) { - Lib3MF_uint64 elementsNeededBuffer = 0; - Lib3MF_uint64 elementsWrittenBuffer = 0; - CheckError(lib3mf_attachment_writetobuffer(m_pHandle, 0, &elementsNeededBuffer, nullptr)); - BufferBuffer.resize((size_t) elementsNeededBuffer); - CheckError(lib3mf_attachment_writetobuffer(m_pHandle, elementsNeededBuffer, &elementsWrittenBuffer, BufferBuffer.data())); + Lib3MF_double resultValue = 0; + CheckError(lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid(m_pHandle, nIndex, nID, &resultValue)); + + return resultValue; } /** - * CAttachment::ReadFromBuffer - Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). - * @param[in] BufferBuffer - Buffer to read from + * CToolpathLayerReader::GetSegmentDoubleAttributeByName - Retrieves a segment Double attribute by Attribute Name. Will fail if Attribute does not exist. + * @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. + * @param[in] sNameSpace - Namespace of the custom attribute. + * @param[in] sAttributeName - Name of the custom attribute. + * @return Attribute Value. */ - void CAttachment::ReadFromBuffer(const CInputVector & BufferBuffer) + Lib3MF_double CToolpathLayerReader::GetSegmentDoubleAttributeByName(const Lib3MF_uint32 nIndex, const std::string & sNameSpace, const std::string & sAttributeName) { - CheckError(lib3mf_attachment_readfrombuffer(m_pHandle, (Lib3MF_uint64)BufferBuffer.size(), BufferBuffer.data())); + Lib3MF_double resultValue = 0; + CheckError(lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname(m_pHandle, nIndex, sNameSpace.c_str(), sAttributeName.c_str(), &resultValue)); + + return resultValue; } /** - * Method definitions for class CTexture2D - */ + * CToolpathLayerReader::GetCustomDataCount - Retrieves the count of custom data elements. + * @return Count + */ + Lib3MF_uint32 CToolpathLayerReader::GetCustomDataCount() + { + Lib3MF_uint32 resultCount = 0; + CheckError(lib3mf_toolpathlayerreader_getcustomdatacount(m_pHandle, &resultCount)); + + return resultCount; + } /** - * CTexture2D::GetAttachment - Retrieves the attachment located at the path of the texture. - * @return attachment that holds the texture's image information. + * CToolpathLayerReader::GetCustomData - Retrieves the custom data. + * @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count + * @return DOM Tree of the data. */ - PAttachment CTexture2D::GetAttachment() + PCustomDOMTree CToolpathLayerReader::GetCustomData(const Lib3MF_uint32 nIndex) { - Lib3MFHandle hAttachment = nullptr; - CheckError(lib3mf_texture2d_getattachment(m_pHandle, &hAttachment)); + Lib3MFHandle hData = nullptr; + CheckError(lib3mf_toolpathlayerreader_getcustomdata(m_pHandle, nIndex, &hData)); - if (!hAttachment) { + if (!hData) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hAttachment))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hData))); } /** - * CTexture2D::SetAttachment - Sets the texture's package path to the path of the attachment. - * @param[in] pAttachment - attachment that holds the texture's image information. + * CToolpathLayerReader::GetCustomDataName - Retrieves the node name of the custom data. + * @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count + * @param[out] sNameSpace - Namespace of the custom data tree. + * @param[out] sDataName - Root name of the data tree. */ - void CTexture2D::SetAttachment(classParam pAttachment) + void CToolpathLayerReader::GetCustomDataName(const Lib3MF_uint32 nIndex, std::string & sNameSpace, std::string & sDataName) { - Lib3MFHandle hAttachment = pAttachment.GetHandle(); - CheckError(lib3mf_texture2d_setattachment(m_pHandle, hAttachment)); + Lib3MF_uint32 bytesNeededNameSpace = 0; + Lib3MF_uint32 bytesWrittenNameSpace = 0; + Lib3MF_uint32 bytesNeededDataName = 0; + Lib3MF_uint32 bytesWrittenDataName = 0; + CheckError(lib3mf_toolpathlayerreader_getcustomdataname(m_pHandle, nIndex, 0, &bytesNeededNameSpace, nullptr, 0, &bytesNeededDataName, nullptr)); + std::vector bufferNameSpace(bytesNeededNameSpace); + std::vector bufferDataName(bytesNeededDataName); + CheckError(lib3mf_toolpathlayerreader_getcustomdataname(m_pHandle, nIndex, bytesNeededNameSpace, &bytesWrittenNameSpace, &bufferNameSpace[0], bytesNeededDataName, &bytesWrittenDataName, &bufferDataName[0])); + sNameSpace = std::string(&bufferNameSpace[0]); + sDataName = std::string(&bufferDataName[0]); } /** - * CTexture2D::GetContentType - Retrieves a texture's content type. - * @return returns content type enum. + * Method definitions for class CToolpathLayerData + */ + + /** + * CToolpathLayerData::GetLayerDataUUID - Retrieves the layerdata's uuid + * @return Returns the uuid value. */ - eTextureType CTexture2D::GetContentType() + std::string CToolpathLayerData::GetLayerDataUUID() { - eTextureType resultContentType = (eTextureType) 0; - CheckError(lib3mf_texture2d_getcontenttype(m_pHandle, &resultContentType)); + Lib3MF_uint32 bytesNeededUUID = 0; + Lib3MF_uint32 bytesWrittenUUID = 0; + CheckError(lib3mf_toolpathlayerdata_getlayerdatauuid(m_pHandle, 0, &bytesNeededUUID, nullptr)); + std::vector bufferUUID(bytesNeededUUID); + CheckError(lib3mf_toolpathlayerdata_getlayerdatauuid(m_pHandle, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0])); - return resultContentType; + return std::string(&bufferUUID[0]); } /** - * CTexture2D::SetContentType - Retrieves a texture's content type. - * @param[in] eContentType - new Content Type + * CToolpathLayerData::RegisterProfile - Registers a toolpath profile + * @param[in] pProfile - The toolpath profile to register. + * @return returns the local profile ID for the layer. */ - void CTexture2D::SetContentType(const eTextureType eContentType) + Lib3MF_uint32 CToolpathLayerData::RegisterProfile(classParam pProfile) { - CheckError(lib3mf_texture2d_setcontenttype(m_pHandle, eContentType)); + Lib3MFHandle hProfile = pProfile.GetHandle(); + Lib3MF_uint32 resultProfileID = 0; + CheckError(lib3mf_toolpathlayerdata_registerprofile(m_pHandle, hProfile, &resultProfileID)); + + return resultProfileID; } /** - * CTexture2D::GetTileStyleUV - Retrieves a texture's tilestyle type. - * @param[out] eTileStyleU - returns tilestyle type enum. - * @param[out] eTileStyleV - returns tilestyle type enum. + * CToolpathLayerData::RegisterBuildItem - Registers a Model Build Item + * @param[in] pBuildItem - The model build item to use. + * @return returns the local part ID for the layer. */ - void CTexture2D::GetTileStyleUV(eTextureTileStyle & eTileStyleU, eTextureTileStyle & eTileStyleV) + Lib3MF_uint32 CToolpathLayerData::RegisterBuildItem(classParam pBuildItem) { - CheckError(lib3mf_texture2d_gettilestyleuv(m_pHandle, &eTileStyleU, &eTileStyleV)); + Lib3MFHandle hBuildItem = pBuildItem.GetHandle(); + Lib3MF_uint32 resultPartID = 0; + CheckError(lib3mf_toolpathlayerdata_registerbuilditem(m_pHandle, hBuildItem, &resultPartID)); + + return resultPartID; } /** - * CTexture2D::SetTileStyleUV - Sets a texture's tilestyle type. - * @param[in] eTileStyleU - new tilestyle type enum. - * @param[in] eTileStyleV - new tilestyle type enum. + * CToolpathLayerData::SetSegmentAttribute - Sets Segment Attribute for all following segments that are added. Overrides previously set attribute. + * @param[in] sNameSpace - The namespace of the attribute to register. + * @param[in] sAttributeName - The name of the attribute to register. + * @param[in] sValue - The value of the attribute to register. */ - void CTexture2D::SetTileStyleUV(const eTextureTileStyle eTileStyleU, const eTextureTileStyle eTileStyleV) + void CToolpathLayerData::SetSegmentAttribute(const std::string & sNameSpace, const std::string & sAttributeName, const std::string & sValue) { - CheckError(lib3mf_texture2d_settilestyleuv(m_pHandle, eTileStyleU, eTileStyleV)); + CheckError(lib3mf_toolpathlayerdata_setsegmentattribute(m_pHandle, sNameSpace.c_str(), sAttributeName.c_str(), sValue.c_str())); } /** - * CTexture2D::GetFilter - Retrieves a texture's filter type. - * @return returns filter type enum. + * CToolpathLayerData::ClearSegmentAttributes - Clears current segment attributes. */ - eTextureFilter CTexture2D::GetFilter() + void CToolpathLayerData::ClearSegmentAttributes() { - eTextureFilter resultFilter = (eTextureFilter) 0; - CheckError(lib3mf_texture2d_getfilter(m_pHandle, &resultFilter)); - - return resultFilter; + CheckError(lib3mf_toolpathlayerdata_clearsegmentattributes(m_pHandle)); } /** - * CTexture2D::SetFilter - Sets a texture's filter type. - * @param[in] eFilter - sets new filter type enum. + * CToolpathLayerData::WriteHatchData - writes hatch data to the layer. + * @param[in] nProfileID - The toolpath profile to use + * @param[in] nPartID - The toolpath part to use + * @param[in] PointDataBuffer - The point data */ - void CTexture2D::SetFilter(const eTextureFilter eFilter) + void CToolpathLayerData::WriteHatchData(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const CInputVector & PointDataBuffer) { - CheckError(lib3mf_texture2d_setfilter(m_pHandle, eFilter)); + CheckError(lib3mf_toolpathlayerdata_writehatchdata(m_pHandle, nProfileID, nPartID, (Lib3MF_uint64)PointDataBuffer.size(), PointDataBuffer.data())); } /** - * Method definitions for class CBuildItem - */ - - /** - * CBuildItem::GetObjectResource - Retrieves the object resource associated to a build item - * @return returns the associated resource instance + * CToolpathLayerData::WriteLoop - writes loop data to the layer. + * @param[in] nProfileID - The toolpath profile to use + * @param[in] nPartID - The toolpath part to use + * @param[in] PointDataBuffer - The point data */ - PObject CBuildItem::GetObjectResource() + void CToolpathLayerData::WriteLoop(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const CInputVector & PointDataBuffer) { - Lib3MFHandle hObjectResource = nullptr; - CheckError(lib3mf_builditem_getobjectresource(m_pHandle, &hObjectResource)); - - if (!hObjectResource) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hObjectResource))); + CheckError(lib3mf_toolpathlayerdata_writeloop(m_pHandle, nProfileID, nPartID, (Lib3MF_uint64)PointDataBuffer.size(), PointDataBuffer.data())); } /** - * CBuildItem::GetUUID - returns, whether a build item has a UUID and, if true, the build item's UUID - * @param[out] bHasUUID - flag whether the build item has a UUID - * @return the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + * CToolpathLayerData::WritePolyline - writes polyline data to the layer. + * @param[in] nProfileID - The toolpath profile to use + * @param[in] nPartID - The toolpath part to use + * @param[in] PointDataBuffer - The point data */ - std::string CBuildItem::GetUUID(bool & bHasUUID) + void CToolpathLayerData::WritePolyline(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const CInputVector & PointDataBuffer) { - Lib3MF_uint32 bytesNeededUUID = 0; - Lib3MF_uint32 bytesWrittenUUID = 0; - CheckError(lib3mf_builditem_getuuid(m_pHandle, &bHasUUID, 0, &bytesNeededUUID, nullptr)); - std::vector bufferUUID(bytesNeededUUID); - CheckError(lib3mf_builditem_getuuid(m_pHandle, &bHasUUID, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0])); - - return std::string(&bufferUUID[0]); + CheckError(lib3mf_toolpathlayerdata_writepolyline(m_pHandle, nProfileID, nPartID, (Lib3MF_uint64)PointDataBuffer.size(), PointDataBuffer.data())); } /** - * CBuildItem::SetUUID - sets the build item's UUID - * @param[in] sUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + * CToolpathLayerData::AddCustomData - Adds a custom data DOM tree to the layer. Layer MUST not be finished when changing the DOM tree. + * @param[in] sNameSpace - Namespace of the custom data tree. MUST not be empty. + * @param[in] sDataName - Root name of the data tree. MUST not be empty. MUST be a valid XML name string. + * @return DOM Tree of the data. */ - void CBuildItem::SetUUID(const std::string & sUUID) + PCustomDOMTree CToolpathLayerData::AddCustomData(const std::string & sNameSpace, const std::string & sDataName) { - CheckError(lib3mf_builditem_setuuid(m_pHandle, sUUID.c_str())); + Lib3MFHandle hData = nullptr; + CheckError(lib3mf_toolpathlayerdata_addcustomdata(m_pHandle, sNameSpace.c_str(), sDataName.c_str(), &hData)); + + if (!hData) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hData))); } /** - * CBuildItem::GetObjectResourceID - Retrieves the object UniqueResourceID associated to a build item - * @return returns the UniqueResourceID of the object + * CToolpathLayerData::Finish - finishes all writing of the layer and compresses toolpath data. */ - Lib3MF_uint32 CBuildItem::GetObjectResourceID() + void CToolpathLayerData::Finish() { - Lib3MF_uint32 resultUniqueResourceID = 0; - CheckError(lib3mf_builditem_getobjectresourceid(m_pHandle, &resultUniqueResourceID)); - - return resultUniqueResourceID; + CheckError(lib3mf_toolpathlayerdata_finish(m_pHandle)); } /** - * CBuildItem::HasObjectTransform - Checks, if a build item has a non-identity transformation matrix - * @return returns true, if the transformation matrix is not the identity + * Method definitions for class CToolpath + */ + + /** + * CToolpath::GetUnits - Retrieves the unit factor + * @return Returns the unit factor. */ - bool CBuildItem::HasObjectTransform() + Lib3MF_double CToolpath::GetUnits() { - bool resultHasTransform = 0; - CheckError(lib3mf_builditem_hasobjecttransform(m_pHandle, &resultHasTransform)); + Lib3MF_double resultUnits = 0; + CheckError(lib3mf_toolpath_getunits(m_pHandle, &resultUnits)); - return resultHasTransform; + return resultUnits; } /** - * CBuildItem::GetObjectTransform - Retrieves a build item's transformation matrix. - * @return returns the transformation matrix + * CToolpath::GetLayerCount - Retrieves the count of layers + * @return Returns the layer count */ - sTransform CBuildItem::GetObjectTransform() + Lib3MF_uint32 CToolpath::GetLayerCount() { - sTransform resultTransform; - CheckError(lib3mf_builditem_getobjecttransform(m_pHandle, &resultTransform)); + Lib3MF_uint32 resultCount = 0; + CheckError(lib3mf_toolpath_getlayercount(m_pHandle, &resultCount)); - return resultTransform; + return resultCount; } /** - * CBuildItem::SetObjectTransform - Sets a build item's transformation matrix. - * @param[in] Transform - new transformation matrix + * CToolpath::GetProfileCount - Retrieves the count of profiles + * @return Returns the profile count */ - void CBuildItem::SetObjectTransform(const sTransform & Transform) + Lib3MF_uint32 CToolpath::GetProfileCount() { - CheckError(lib3mf_builditem_setobjecttransform(m_pHandle, &Transform)); + Lib3MF_uint32 resultCount = 0; + CheckError(lib3mf_toolpath_getprofilecount(m_pHandle, &resultCount)); + + return resultCount; } /** - * CBuildItem::GetPartNumber - Retrieves a build item's part number string - * @return Returns a build item's part number string + * CToolpath::AddLayer - Adds a new toolpath layer + * @param[in] nZMax - ZMax value + * @param[in] sPath - Package Path + * @param[in] pModelWriter - The model writer that writes out the 3MF. + * @return Returns the layerdata object to write the layer content into. */ - std::string CBuildItem::GetPartNumber() + PToolpathLayerData CToolpath::AddLayer(const Lib3MF_uint32 nZMax, const std::string & sPath, classParam pModelWriter) { - Lib3MF_uint32 bytesNeededPartNumber = 0; - Lib3MF_uint32 bytesWrittenPartNumber = 0; - CheckError(lib3mf_builditem_getpartnumber(m_pHandle, 0, &bytesNeededPartNumber, nullptr)); - std::vector bufferPartNumber(bytesNeededPartNumber); - CheckError(lib3mf_builditem_getpartnumber(m_pHandle, bytesNeededPartNumber, &bytesWrittenPartNumber, &bufferPartNumber[0])); + Lib3MFHandle hModelWriter = pModelWriter.GetHandle(); + Lib3MFHandle hLayerData = nullptr; + CheckError(lib3mf_toolpath_addlayer(m_pHandle, nZMax, sPath.c_str(), hModelWriter, &hLayerData)); - return std::string(&bufferPartNumber[0]); + if (!hLayerData) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hLayerData))); } /** - * CBuildItem::SetPartNumber - Sets a build item's part number string - * @param[in] sSetPartnumber - new part number string for referencing parts from the outside world + * CToolpath::GetLayerAttachment - Retrieves the Attachment of a layer + * @param[in] nIndex - Layer Index + * @return Attachment */ - void CBuildItem::SetPartNumber(const std::string & sSetPartnumber) + PAttachment CToolpath::GetLayerAttachment(const Lib3MF_uint32 nIndex) { - CheckError(lib3mf_builditem_setpartnumber(m_pHandle, sSetPartnumber.c_str())); + Lib3MFHandle hAttachment = nullptr; + CheckError(lib3mf_toolpath_getlayerattachment(m_pHandle, nIndex, &hAttachment)); + + if (!hAttachment) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hAttachment))); } /** - * CBuildItem::GetMetaDataGroup - Returns the metadatagroup of this build item - * @return returns an Instance of the metadatagroup of this build item + * CToolpath::ReadLayerData - Reads the toolpath of a layer. + * @param[in] nIndex - Layer Index + * @return Toolpath Reader Instance */ - PMetaDataGroup CBuildItem::GetMetaDataGroup() + PToolpathLayerReader CToolpath::ReadLayerData(const Lib3MF_uint32 nIndex) { - Lib3MFHandle hMetaDataGroup = nullptr; - CheckError(lib3mf_builditem_getmetadatagroup(m_pHandle, &hMetaDataGroup)); + Lib3MFHandle hToolpathReader = nullptr; + CheckError(lib3mf_toolpath_readlayerdata(m_pHandle, nIndex, &hToolpathReader)); - if (!hMetaDataGroup) { + if (!hToolpathReader) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMetaDataGroup))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hToolpathReader))); } /** - * CBuildItem::GetOutbox - Returns the outbox of a build item - * @return Outbox of this build item + * CToolpath::GetLayerPath - Retrieves the Path of a layer + * @param[in] nIndex - Layer Index + * @return Package Path */ - sBox CBuildItem::GetOutbox() + std::string CToolpath::GetLayerPath(const Lib3MF_uint32 nIndex) { - sBox resultOutbox; - CheckError(lib3mf_builditem_getoutbox(m_pHandle, &resultOutbox)); + Lib3MF_uint32 bytesNeededPath = 0; + Lib3MF_uint32 bytesWrittenPath = 0; + CheckError(lib3mf_toolpath_getlayerpath(m_pHandle, nIndex, 0, &bytesNeededPath, nullptr)); + std::vector bufferPath(bytesNeededPath); + CheckError(lib3mf_toolpath_getlayerpath(m_pHandle, nIndex, bytesNeededPath, &bytesWrittenPath, &bufferPath[0])); - return resultOutbox; + return std::string(&bufferPath[0]); } /** - * Method definitions for class CBuildItemIterator - */ + * CToolpath::GetLayerZMax - Retrieves the ZMax of a layer + * @param[in] nIndex - Layer Index + * @return ZMax value + */ + Lib3MF_uint32 CToolpath::GetLayerZMax(const Lib3MF_uint32 nIndex) + { + Lib3MF_uint32 resultZMax = 0; + CheckError(lib3mf_toolpath_getlayerzmax(m_pHandle, nIndex, &resultZMax)); + + return resultZMax; + } /** - * CBuildItemIterator::MoveNext - Iterates to the next build item in the list. - * @return Iterates to the next build item in the list. + * CToolpath::GetLayerZ - Return the z value of a layer in units. + * @param[in] nLayerIndex - Layer Index. + * @return Z Value in Units. */ - bool CBuildItemIterator::MoveNext() + Lib3MF_uint32 CToolpath::GetLayerZ(const Lib3MF_uint32 nLayerIndex) { - bool resultHasNext = 0; - CheckError(lib3mf_builditemiterator_movenext(m_pHandle, &resultHasNext)); + Lib3MF_uint32 resultZValue = 0; + CheckError(lib3mf_toolpath_getlayerz(m_pHandle, nLayerIndex, &resultZValue)); - return resultHasNext; + return resultZValue; } /** - * CBuildItemIterator::MovePrevious - Iterates to the previous build item in the list. - * @return Iterates to the previous build item in the list. + * CToolpath::AddProfile - Adds a new profile to the toolpath. + * @param[in] sName - the name. + * @return Returns the profile. */ - bool CBuildItemIterator::MovePrevious() + PToolpathProfile CToolpath::AddProfile(const std::string & sName) { - bool resultHasPrevious = 0; - CheckError(lib3mf_builditemiterator_moveprevious(m_pHandle, &resultHasPrevious)); + Lib3MFHandle hProfile = nullptr; + CheckError(lib3mf_toolpath_addprofile(m_pHandle, sName.c_str(), &hProfile)); - return resultHasPrevious; + if (!hProfile) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hProfile))); } /** - * CBuildItemIterator::GetCurrent - Returns the build item the iterator points at. - * @return returns the build item instance. + * CToolpath::GetProfile - Returns a profile of the toolpath. + * @param[in] nProfileIndex - Layer Index. + * @return Returns the profile. */ - PBuildItem CBuildItemIterator::GetCurrent() + PToolpathProfile CToolpath::GetProfile(const Lib3MF_uint32 nProfileIndex) { - Lib3MFHandle hBuildItem = nullptr; - CheckError(lib3mf_builditemiterator_getcurrent(m_pHandle, &hBuildItem)); + Lib3MFHandle hProfile = nullptr; + CheckError(lib3mf_toolpath_getprofile(m_pHandle, nProfileIndex, &hProfile)); - if (!hBuildItem) { + if (!hProfile) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBuildItem))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hProfile))); } /** - * CBuildItemIterator::Clone - Creates a new build item iterator with the same build item list. - * @return returns the cloned Iterator instance + * CToolpath::GetProfileUUID - Returns a profile of the toolpath by UUID. + * @param[in] sProfileUUID - UUID string. + * @return Returns the profile. */ - PBuildItemIterator CBuildItemIterator::Clone() + PToolpathProfile CToolpath::GetProfileUUID(const std::string & sProfileUUID) { - Lib3MFHandle hOutBuildItemIterator = nullptr; - CheckError(lib3mf_builditemiterator_clone(m_pHandle, &hOutBuildItemIterator)); + Lib3MFHandle hProfile = nullptr; + CheckError(lib3mf_toolpath_getprofileuuid(m_pHandle, sProfileUUID.c_str(), &hProfile)); - if (!hOutBuildItemIterator) { + if (!hProfile) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hOutBuildItemIterator))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hProfile))); } /** - * CBuildItemIterator::Count - Returns the number of build items the iterator captures. - * @return returns the number of build items the iterator captures. + * CToolpath::GetCustomDataCount - Retrieves the count of custom data elements. + * @return Count */ - Lib3MF_uint64 CBuildItemIterator::Count() + Lib3MF_uint32 CToolpath::GetCustomDataCount() { - Lib3MF_uint64 resultCount = 0; - CheckError(lib3mf_builditemiterator_count(m_pHandle, &resultCount)); + Lib3MF_uint32 resultCount = 0; + CheckError(lib3mf_toolpath_getcustomdatacount(m_pHandle, &resultCount)); return resultCount; } /** - * Method definitions for class CSlice - */ + * CToolpath::GetCustomData - Retrieves the custom data. + * @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count + * @return DOM Tree of the data. + */ + PCustomDOMTree CToolpath::GetCustomData(const Lib3MF_uint32 nIndex) + { + Lib3MFHandle hData = nullptr; + CheckError(lib3mf_toolpath_getcustomdata(m_pHandle, nIndex, &hData)); + + if (!hData) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hData))); + } /** - * CSlice::SetVertices - Set all vertices of a slice. All polygons will be cleared. - * @param[in] VerticesBuffer - contains the positions. + * CToolpath::GetCustomDataName - Retrieves the node name of the custom data. + * @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count + * @param[out] sNameSpace - Namespace of the custom data tree. + * @param[out] sDataName - Root name of the data tree. */ - void CSlice::SetVertices(const CInputVector & VerticesBuffer) + void CToolpath::GetCustomDataName(const Lib3MF_uint32 nIndex, std::string & sNameSpace, std::string & sDataName) { - CheckError(lib3mf_slice_setvertices(m_pHandle, (Lib3MF_uint64)VerticesBuffer.size(), VerticesBuffer.data())); + Lib3MF_uint32 bytesNeededNameSpace = 0; + Lib3MF_uint32 bytesWrittenNameSpace = 0; + Lib3MF_uint32 bytesNeededDataName = 0; + Lib3MF_uint32 bytesWrittenDataName = 0; + CheckError(lib3mf_toolpath_getcustomdataname(m_pHandle, nIndex, 0, &bytesNeededNameSpace, nullptr, 0, &bytesNeededDataName, nullptr)); + std::vector bufferNameSpace(bytesNeededNameSpace); + std::vector bufferDataName(bytesNeededDataName); + CheckError(lib3mf_toolpath_getcustomdataname(m_pHandle, nIndex, bytesNeededNameSpace, &bytesWrittenNameSpace, &bufferNameSpace[0], bytesNeededDataName, &bytesWrittenDataName, &bufferDataName[0])); + sNameSpace = std::string(&bufferNameSpace[0]); + sDataName = std::string(&bufferDataName[0]); } /** - * CSlice::GetVertices - Get all vertices of a slice - * @param[out] VerticesBuffer - contains the positions. + * CToolpath::HasUniqueCustomData - Retrieves if custom data with a specific namespace and name combination exists. + * @param[in] sNameSpace - Namespace of the custom data tree. + * @param[in] sDataName - Root name of the data tree. + * @return Returns true if DOM Tree Exists. */ - void CSlice::GetVertices(std::vector & VerticesBuffer) + bool CToolpath::HasUniqueCustomData(const std::string & sNameSpace, const std::string & sDataName) { - Lib3MF_uint64 elementsNeededVertices = 0; - Lib3MF_uint64 elementsWrittenVertices = 0; - CheckError(lib3mf_slice_getvertices(m_pHandle, 0, &elementsNeededVertices, nullptr)); - VerticesBuffer.resize((size_t) elementsNeededVertices); - CheckError(lib3mf_slice_getvertices(m_pHandle, elementsNeededVertices, &elementsWrittenVertices, VerticesBuffer.data())); + bool resultCustomDataExists = 0; + CheckError(lib3mf_toolpath_hasuniquecustomdata(m_pHandle, sNameSpace.c_str(), sDataName.c_str(), &resultCustomDataExists)); + + return resultCustomDataExists; } /** - * CSlice::GetVertexCount - Get the number of vertices in a slice - * @return the number of vertices in the slice + * CToolpath::FindUniqueCustomData - Retrieves the custom data with a specific namespace and name combination. Fails if combination is not unique. + * @param[in] sNameSpace - Namespace of the custom data tree. + * @param[in] sDataName - Root name of the data tree. + * @return DOM Tree of the data. */ - Lib3MF_uint64 CSlice::GetVertexCount() + PCustomDOMTree CToolpath::FindUniqueCustomData(const std::string & sNameSpace, const std::string & sDataName) { - Lib3MF_uint64 resultCount = 0; - CheckError(lib3mf_slice_getvertexcount(m_pHandle, &resultCount)); + Lib3MFHandle hData = nullptr; + CheckError(lib3mf_toolpath_finduniquecustomdata(m_pHandle, sNameSpace.c_str(), sDataName.c_str(), &hData)); - return resultCount; + if (!hData) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hData))); } /** - * CSlice::AddPolygon - Add a new polygon to this slice - * @param[in] IndicesBuffer - the new indices of the new polygon - * @return the index of the new polygon + * CToolpath::AddCustomData - Adds a custom data DOM tree to the toolpath. + * @param[in] sNameSpace - Namespace of the custom data tree. MUST not be empty. + * @param[in] sDataName - Root name of the data tree. MUST not be empty. MUST be a valid XML name string. + * @return DOM Tree of the data. */ - Lib3MF_uint64 CSlice::AddPolygon(const CInputVector & IndicesBuffer) + PCustomDOMTree CToolpath::AddCustomData(const std::string & sNameSpace, const std::string & sDataName) { - Lib3MF_uint64 resultIndex = 0; - CheckError(lib3mf_slice_addpolygon(m_pHandle, (Lib3MF_uint64)IndicesBuffer.size(), IndicesBuffer.data(), &resultIndex)); + Lib3MFHandle hData = nullptr; + CheckError(lib3mf_toolpath_addcustomdata(m_pHandle, sNameSpace.c_str(), sDataName.c_str(), &hData)); - return resultIndex; + if (!hData) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hData))); } /** - * CSlice::GetPolygonCount - Get the number of polygons in the slice - * @return the number of polygons in the slice + * CToolpath::ClearCustomData - Deletes all custom data. + * @return Returns number of deleted items. */ - Lib3MF_uint64 CSlice::GetPolygonCount() + Lib3MF_uint32 CToolpath::ClearCustomData() { - Lib3MF_uint64 resultCount = 0; - CheckError(lib3mf_slice_getpolygoncount(m_pHandle, &resultCount)); + Lib3MF_uint32 resultNumberOfDeletedItems = 0; + CheckError(lib3mf_toolpath_clearcustomdata(m_pHandle, &resultNumberOfDeletedItems)); - return resultCount; + return resultNumberOfDeletedItems; } /** - * CSlice::SetPolygonIndices - Set all indices of a polygon - * @param[in] nIndex - the index of the polygon to manipulate - * @param[in] IndicesBuffer - the new indices of the index-th polygon + * CToolpath::DeleteCustomData - Deletes a custom data instance from the list. + * @param[in] pData - DOM Tree of the data. + * @return Returns if deletion was successful. */ - void CSlice::SetPolygonIndices(const Lib3MF_uint64 nIndex, const CInputVector & IndicesBuffer) + bool CToolpath::DeleteCustomData(classParam pData) { - CheckError(lib3mf_slice_setpolygonindices(m_pHandle, nIndex, (Lib3MF_uint64)IndicesBuffer.size(), IndicesBuffer.data())); + Lib3MFHandle hData = pData.GetHandle(); + bool resultSuccess = 0; + CheckError(lib3mf_toolpath_deletecustomdata(m_pHandle, hData, &resultSuccess)); + + return resultSuccess; } /** - * CSlice::GetPolygonIndices - Get all vertices of a slice - * @param[in] nIndex - the index of the polygon to manipulate - * @param[out] IndicesBuffer - the indices of the index-th polygon + * CToolpath::RegisterCustomIntegerAttribute - Registers an Integer Attribute that each segment holds. + * @param[in] sNameSpace - Namespace of the custom data tree. MUST not be empty. + * @param[in] sAttributeName - Attribute name. MUST not be empty. */ - void CSlice::GetPolygonIndices(const Lib3MF_uint64 nIndex, std::vector & IndicesBuffer) + void CToolpath::RegisterCustomIntegerAttribute(const std::string & sNameSpace, const std::string & sAttributeName) { - Lib3MF_uint64 elementsNeededIndices = 0; - Lib3MF_uint64 elementsWrittenIndices = 0; - CheckError(lib3mf_slice_getpolygonindices(m_pHandle, nIndex, 0, &elementsNeededIndices, nullptr)); - IndicesBuffer.resize((size_t) elementsNeededIndices); - CheckError(lib3mf_slice_getpolygonindices(m_pHandle, nIndex, elementsNeededIndices, &elementsWrittenIndices, IndicesBuffer.data())); + CheckError(lib3mf_toolpath_registercustomintegerattribute(m_pHandle, sNameSpace.c_str(), sAttributeName.c_str())); } /** - * CSlice::GetPolygonIndexCount - Get the number of vertices in a slice - * @param[in] nIndex - the index of the polygon to manipulate - * @return the number of indices of the index-th polygon + * CToolpath::RegisterCustomDoubleAttribute - Registers a Double Attribute that each segment holds. Registering only applies to reader or writer objects created after the call. + * @param[in] sNameSpace - Namespace of the custom data tree. MUST not be empty. + * @param[in] sAttributeName - Attribute name. MUST not be empty. */ - Lib3MF_uint64 CSlice::GetPolygonIndexCount(const Lib3MF_uint64 nIndex) + void CToolpath::RegisterCustomDoubleAttribute(const std::string & sNameSpace, const std::string & sAttributeName) { - Lib3MF_uint64 resultCount = 0; - CheckError(lib3mf_slice_getpolygonindexcount(m_pHandle, nIndex, &resultCount)); - - return resultCount; + CheckError(lib3mf_toolpath_registercustomdoubleattribute(m_pHandle, sNameSpace.c_str(), sAttributeName.c_str())); } /** - * CSlice::GetZTop - Get the upper Z-Coordinate of this slice. - * @return the upper Z-Coordinate of this slice + * Method definitions for class CToolpathIterator + */ + + /** + * CToolpathIterator::GetCurrentToolpath - Returns the Toolpath the iterator points at. + * @return returns the Toolpath instance. */ - Lib3MF_double CSlice::GetZTop() + PToolpath CToolpathIterator::GetCurrentToolpath() { - Lib3MF_double resultZTop = 0; - CheckError(lib3mf_slice_getztop(m_pHandle, &resultZTop)); + Lib3MFHandle hResource = nullptr; + CheckError(lib3mf_toolpathiterator_getcurrenttoolpath(m_pHandle, &hResource)); - return resultZTop; + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); } /** @@ -6062,6 +8273,21 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceIterator))); } + /** + * CModel::GetToolpaths - creates a Toolpath instance with all toolpath resources. + * @return returns the iterator instance. + */ + PToolpathIterator CModel::GetToolpaths() + { + Lib3MFHandle hResourceIterator = nullptr; + CheckError(lib3mf_model_gettoolpaths(m_pHandle, &hResourceIterator)); + + if (!hResourceIterator) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceIterator))); + } + /** * CModel::GetSliceStacks - creates a resource iterator instance with all slice stack resources. * @return returns the iterator instance. @@ -6262,6 +8488,22 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) CheckError(lib3mf_model_removebuilditem(m_pHandle, hBuildItemInstance)); } + /** + * CModel::AddToolpath - adds an empty Toolpath resource to the model. + * @param[in] dUnitFactor - The toolpath instance of the created Toolpath. + * @return The toolpath instance of the created Toolpath. + */ + PToolpath CModel::AddToolpath(const Lib3MF_double dUnitFactor) + { + Lib3MFHandle hToolpathInstance = nullptr; + CheckError(lib3mf_model_addtoolpath(m_pHandle, dUnitFactor, &hToolpathInstance)); + + if (!hToolpathInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hToolpathInstance))); + } + /** * CModel::GetMetaDataGroup - Returns the metadata of the model as MetaDataGroup * @return returns an Instance of the metadatagroup of the model @@ -6442,6 +8684,57 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) } return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hKeyStore))); } + + /** + * CModel::CreatePersistentSourceFromFile - Creates an OPC Reader Source from a file. + * @param[in] sFilename - Filename to read from + * @return The instance of the created reader source + */ + PPersistentReaderSource CModel::CreatePersistentSourceFromFile(const std::string & sFilename) + { + Lib3MFHandle hInstance = nullptr; + CheckError(lib3mf_model_createpersistentsourcefromfile(m_pHandle, sFilename.c_str(), &hInstance)); + + if (!hInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hInstance))); + } + + /** + * CModel::CreatePersistentSourceFromBuffer - Creates an OPC Reader Source from a memory buffer. The memory buffer MUST exist as long as the Source object exists. + * @param[in] BufferBuffer - Buffer to read from + * @return The instance of the created reader source + */ + PPersistentReaderSource CModel::CreatePersistentSourceFromBuffer(const CInputVector & BufferBuffer) + { + Lib3MFHandle hInstance = nullptr; + CheckError(lib3mf_model_createpersistentsourcefrombuffer(m_pHandle, (Lib3MF_uint64)BufferBuffer.size(), BufferBuffer.data(), &hInstance)); + + if (!hInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hInstance))); + } + + /** + * CModel::CreatePersistentSourceFromCallback - Creates an OPC Reader Source from a data provided by a callback function. The callbacks MUST exist as long as the source object exists. + * @param[in] pTheReadCallback - Callback to call for reading a data chunk + * @param[in] nStreamSize - number of bytes the callback returns + * @param[in] pTheSeekCallback - Callback to call for seeking in the stream. + * @param[in] pUserData - Userdata that is passed to the callback function + * @return The instance of the created reader source + */ + PPersistentReaderSource CModel::CreatePersistentSourceFromCallback(const ReadCallback pTheReadCallback, const Lib3MF_uint64 nStreamSize, const SeekCallback pTheSeekCallback, const Lib3MF_pvoid pUserData) + { + Lib3MFHandle hInstance = nullptr; + CheckError(lib3mf_model_createpersistentsourcefromcallback(m_pHandle, pTheReadCallback, nStreamSize, pTheSeekCallback, pUserData, &hInstance)); + + if (!hInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hInstance))); + } } // namespace Lib3MF diff --git a/Autogenerated/Bindings/Cpp/lib3mf_types.hpp b/Autogenerated/Bindings/Cpp/lib3mf_types.hpp index 705f02718..d7b8241ca 100644 --- a/Autogenerated/Bindings/Cpp/lib3mf_types.hpp +++ b/Autogenerated/Bindings/Cpp/lib3mf_types.hpp @@ -129,13 +129,27 @@ typedef void * Lib3MF_pvoid; #define LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER 140 /** A progress identifier is unknown */ #define LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT 141 /** An element buffer exceeds its spec limit */ #define LIB3MF_ERROR_INVALIDRESOURCE 142 /** A resource is invalid */ +#define LIB3MF_ERROR_INVALIDNODEINDEX 143 /** Invalid node index */ +#define LIB3MF_ERROR_INVALIDATTRIBUTEINDEX 144 /** Invalid attribute index */ +#define LIB3MF_ERROR_DUPLICATECUSTOMDATA 145 /** Duplicate custom data */ +#define LIB3MF_ERROR_CUSTOMDATANOTFOUND 146 /** Custom data not found */ #define LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE 2000 /** This object type is not valid for beamlattices */ #define LIB3MF_ERROR_INVALIDKEYSTORE 3000 /** The keystore object is invalid */ #define LIB3MF_ERROR_INVALIDKEYSTORECONSUMER 3001 /** The consumer keystore object is invalid */ #define LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND 3002 /** A consumer has not been found */ #define LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND 3003 /** A resource data has not been found */ #define LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED 3004 /** A Key or Conentent encryption callback has not been registered */ -#define LIB3MF_ERROR_INVALIDKEYSIZE 3005 /** The key siue is invalid */ +#define LIB3MF_ERROR_INVALIDKEYSIZE 3005 /** The key size is invalid */ +#define LIB3MF_ERROR_TOOLPATH_NOTWRITINGHEADER 4000 /** Not in toolpath header writing mode */ +#define LIB3MF_ERROR_TOOLPATH_NOTWRITINGDATA 4001 /** Not in toolpath data writing mode */ +#define LIB3MF_ERROR_TOOLPATH_DATAHASBEENWRITTEN 4002 /** Toolpath has already been written out */ +#define LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT 4003 /** Toolpath has an invalid number of points */ +#define LIB3MF_ERROR_TOOLPATH_ATTRIBUTEALREADYDEFINED 4004 /** Toolpath attribute already defined */ +#define LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE 4005 /** Toolpath attribute is of invalid type */ +#define LIB3MF_ERROR_EMPTYNAMESPACEPREFIX 4006 /** Empty namespace prefix. */ +#define LIB3MF_ERROR_EMPTYNAMESPACE 4007 /** Empty namespace. */ +#define LIB3MF_ERROR_INVALIDNAMESPACEPREFIX 4008 /** Invalid namespace prefix. */ +#define LIB3MF_ERROR_WRITERDOESNOTSUPPORTNAMESPACES 4009 /** Writer does not support namespaces. */ /************************************************************************************************************************* Error strings for Lib3MF @@ -180,13 +194,27 @@ inline const char * LIB3MF_GETERRORSTRING (Lib3MFResult nErrorCode) { case LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER: return "A progress identifier is unknown"; case LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT: return "An element buffer exceeds its spec limit"; case LIB3MF_ERROR_INVALIDRESOURCE: return "A resource is invalid"; + case LIB3MF_ERROR_INVALIDNODEINDEX: return "Invalid node index"; + case LIB3MF_ERROR_INVALIDATTRIBUTEINDEX: return "Invalid attribute index"; + case LIB3MF_ERROR_DUPLICATECUSTOMDATA: return "Duplicate custom data"; + case LIB3MF_ERROR_CUSTOMDATANOTFOUND: return "Custom data not found"; case LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE: return "This object type is not valid for beamlattices"; case LIB3MF_ERROR_INVALIDKEYSTORE: return "The keystore object is invalid"; case LIB3MF_ERROR_INVALIDKEYSTORECONSUMER: return "The consumer keystore object is invalid"; case LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND: return "A consumer has not been found"; case LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND: return "A resource data has not been found"; case LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED: return "A Key or Conentent encryption callback has not been registered"; - case LIB3MF_ERROR_INVALIDKEYSIZE: return "The key siue is invalid"; + case LIB3MF_ERROR_INVALIDKEYSIZE: return "The key size is invalid"; + case LIB3MF_ERROR_TOOLPATH_NOTWRITINGHEADER: return "Not in toolpath header writing mode"; + case LIB3MF_ERROR_TOOLPATH_NOTWRITINGDATA: return "Not in toolpath data writing mode"; + case LIB3MF_ERROR_TOOLPATH_DATAHASBEENWRITTEN: return "Toolpath has already been written out"; + case LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT: return "Toolpath has an invalid number of points"; + case LIB3MF_ERROR_TOOLPATH_ATTRIBUTEALREADYDEFINED: return "Toolpath attribute already defined"; + case LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE: return "Toolpath attribute is of invalid type"; + case LIB3MF_ERROR_EMPTYNAMESPACEPREFIX: return "Empty namespace prefix."; + case LIB3MF_ERROR_EMPTYNAMESPACE: return "Empty namespace."; + case LIB3MF_ERROR_INVALIDNAMESPACEPREFIX: return "Invalid namespace prefix."; + case LIB3MF_ERROR_WRITERDOESNOTSUPPORTNAMESPACES: return "Writer does not support namespaces."; default: return "unknown error"; } } @@ -196,11 +224,17 @@ inline const char * LIB3MF_GETERRORSTRING (Lib3MFResult nErrorCode) { **************************************************************************************************************************/ typedef Lib3MFHandle Lib3MF_Base; +typedef Lib3MFHandle Lib3MF_BinaryStream; typedef Lib3MFHandle Lib3MF_Writer; +typedef Lib3MFHandle Lib3MF_PersistentReaderSource; typedef Lib3MFHandle Lib3MF_Reader; typedef Lib3MFHandle Lib3MF_PackagePart; typedef Lib3MFHandle Lib3MF_Resource; typedef Lib3MFHandle Lib3MF_ResourceIterator; +typedef Lib3MFHandle Lib3MF_CustomXMLAttribute; +typedef Lib3MFHandle Lib3MF_CustomXMLNode; +typedef Lib3MFHandle Lib3MF_CustomXMLNodes; +typedef Lib3MFHandle Lib3MF_CustomDOMTree; typedef Lib3MFHandle Lib3MF_SliceStackIterator; typedef Lib3MFHandle Lib3MF_ObjectIterator; typedef Lib3MFHandle Lib3MF_MeshObjectIterator; @@ -229,6 +263,11 @@ typedef Lib3MFHandle Lib3MF_Texture2D; typedef Lib3MFHandle Lib3MF_BuildItem; typedef Lib3MFHandle Lib3MF_BuildItemIterator; typedef Lib3MFHandle Lib3MF_Slice; +typedef Lib3MFHandle Lib3MF_ToolpathProfile; +typedef Lib3MFHandle Lib3MF_ToolpathLayerReader; +typedef Lib3MFHandle Lib3MF_ToolpathLayerData; +typedef Lib3MFHandle Lib3MF_Toolpath; +typedef Lib3MFHandle Lib3MF_ToolpathIterator; typedef Lib3MFHandle Lib3MF_SliceStack; typedef Lib3MFHandle Lib3MF_Consumer; typedef Lib3MFHandle Lib3MF_AccessRight; @@ -258,6 +297,13 @@ namespace Lib3MF { Lowres = 1 }; + enum class ePersistentReaderSourceType : Lib3MF_int32 { + Unknown = 0, + FileOnDisk = 1, + MemoryBuffer = 2, + Callback = 3 + }; + enum class eModelUnit : Lib3MF_int32 { MicroMeter = 0, MilliMeter = 1, @@ -311,6 +357,11 @@ namespace Lib3MF { All = 2 }; + enum class eBinaryStreamPredictionType : Lib3MF_int32 { + NoPrediction = 0, + DeltaPrediction = 1 + }; + enum class eProgressIdentifier : Lib3MF_int32 { QUERYCANCELED = 0, DONE = 1, @@ -344,6 +395,19 @@ namespace Lib3MF { Multiply = 2 }; + enum class eToolpathSegmentType : Lib3MF_int32 { + Unknown = 0, + Hatch = 1, + Loop = 2, + Polyline = 3 + }; + + enum class eToolpathAttributeType : Lib3MF_int32 { + Unknown = 0, + Integer = 1, + Double = 2 + }; + enum class eEncryptionAlgorithm : Lib3MF_int32 { AES256_GCM = 1 /** http://www.w3.org/2009/xmlenc11#aes256-gcm */ }; @@ -520,6 +584,7 @@ namespace Lib3MF { // define legacy C-names for enums, structs and function types typedef Lib3MF::ePropertyType eLib3MFPropertyType; typedef Lib3MF::eSlicesMeshResolution eLib3MFSlicesMeshResolution; +typedef Lib3MF::ePersistentReaderSourceType eLib3MFPersistentReaderSourceType; typedef Lib3MF::eModelUnit eLib3MFModelUnit; typedef Lib3MF::eObjectType eLib3MFObjectType; typedef Lib3MF::eTextureType eLib3MFTextureType; @@ -528,8 +593,11 @@ typedef Lib3MF::eTextureFilter eLib3MFTextureFilter; typedef Lib3MF::eBeamLatticeCapMode eLib3MFBeamLatticeCapMode; typedef Lib3MF::eBeamLatticeClipMode eLib3MFBeamLatticeClipMode; typedef Lib3MF::eBeamLatticeBallMode eLib3MFBeamLatticeBallMode; +typedef Lib3MF::eBinaryStreamPredictionType eLib3MFBinaryStreamPredictionType; typedef Lib3MF::eProgressIdentifier eLib3MFProgressIdentifier; typedef Lib3MF::eBlendMethod eLib3MFBlendMethod; +typedef Lib3MF::eToolpathSegmentType eLib3MFToolpathSegmentType; +typedef Lib3MF::eToolpathAttributeType eLib3MFToolpathAttributeType; typedef Lib3MF::eEncryptionAlgorithm eLib3MFEncryptionAlgorithm; typedef Lib3MF::eWrappingAlgorithm eLib3MFWrappingAlgorithm; typedef Lib3MF::eMgfAlgorithm eLib3MFMgfAlgorithm; diff --git a/Autogenerated/Bindings/CppDynamic/lib3mf_abi.hpp b/Autogenerated/Bindings/CppDynamic/lib3mf_abi.hpp index 4efde3a1a..586dbdc18 100644 --- a/Autogenerated/Bindings/CppDynamic/lib3mf_abi.hpp +++ b/Autogenerated/Bindings/CppDynamic/lib3mf_abi.hpp @@ -188,10 +188,49 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_writer_addkeywrappingcallback(Lib3MF_Writer */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_writer_setcontentencryptioncallback(Lib3MF_Writer pWriter, Lib3MF::ContentEncryptionCallback pTheCallback, Lib3MF_pvoid pUserData); +/************************************************************************************************************************* + Class definition for PersistentReaderSource +**************************************************************************************************************************/ + +/** +* Retrieves the type of source data. +* +* @param[in] pPersistentReaderSource - PersistentReaderSource instance. +* @param[out] pSourceType - Reader Source Type +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_persistentreadersource_getsourcetype(Lib3MF_PersistentReaderSource pPersistentReaderSource, Lib3MF::ePersistentReaderSourceType * pSourceType); + +/** +* Invalidates the reader source. Every subsequent read on this data will fail. +* +* @param[in] pPersistentReaderSource - PersistentReaderSource instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_persistentreadersource_invalidatesourcedata(Lib3MF_PersistentReaderSource pPersistentReaderSource); + +/** +* Checks if the source data is valid. Any read on an invalid source object will fail. +* +* @param[in] pPersistentReaderSource - PersistentReaderSource instance. +* @param[out] pDataIsValid - The source data is valid. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_persistentreadersource_sourcedataisvalid(Lib3MF_PersistentReaderSource pPersistentReaderSource, bool * pDataIsValid); + /************************************************************************************************************************* Class definition for Reader **************************************************************************************************************************/ +/** +* Reads a model from a persistent source object. The object will be referenced until the Model is destroyed or cleared. +* +* @param[in] pReader - Reader instance. +* @param[in] pSource - Source object to read from +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_reader_readfrompersistentsource(Lib3MF_Reader pReader, Lib3MF_PersistentReaderSource pSource); + /** * Reads a model from a file. The file type is specified by the Model Reader class * @@ -2417,6 +2456,394 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getpolygonindexcount(Lib3MF_Slice pSli */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getztop(Lib3MF_Slice pSlice, Lib3MF_double * pZTop); +/************************************************************************************************************************* + Class definition for ToolpathProfile +**************************************************************************************************************************/ + +/** +* Retrieves the profile's uuid +* +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getuuid(Lib3MF_ToolpathProfile pToolpathProfile, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); + +/** +* Retrieves the profile's name +* +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of Returns the name., may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getname(Lib3MF_ToolpathProfile pToolpathProfile, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); + +/** +* Checks if a parameter value exists. +* +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValueExists - Returns if a value exists. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_hasparametervalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool * pValueExists); + +/** +* Retrieves a profile's parameter value. Fails if value does not exist. +* +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValue - Returns the value of the field. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparameterdoublevalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double * pValue); + +/** +* Retrieves a profile's parameter value +* +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] dDefaultValue - Default value if value does not exist. +* @param[out] pValue - Returns the value of the field. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparameterdoublevaluedef(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double dDefaultValue, Lib3MF_double * pValue); + +/** +* Sets the profile's name +* +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pName - Returns the name. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_setname(Lib3MF_ToolpathProfile pToolpathProfile, const char * pName); + +/** +* Sets a profile's parameter value. +* +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] dValue - Double value of the parameter. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_setparameterdoublevalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double dValue); + +/************************************************************************************************************************* + Class definition for ToolpathLayerReader +**************************************************************************************************************************/ + +/** +* Retrieves the layerdata's uuid +* +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getlayerdatauuid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); + +/** +* Retrieves the count of segments. +* +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[out] pCount - Count +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentcount(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 * pCount); + +/** +* Retrieves the segment type information . +* +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pType - Segment Type +* @param[out] pPointCount - Point count of segment. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentinfo(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF::eToolpathSegmentType * pType, Lib3MF_uint32 * pPointCount); + +/** +* Retrieves the assigned segment profile. +* +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pProfile - Segment Profile +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentprofile(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_ToolpathProfile * pProfile); + +/** +* Retrieves the assigned segment profile uuid. +* +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[in] nProfileUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pProfileUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pProfileUUIDBuffer - buffer of Segment Profile UUID, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentprofileuuid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nProfileUUIDBufferSize, Lib3MF_uint32* pProfileUUIDNeededChars, char * pProfileUUIDBuffer); + +/** +* Retrieves the assigned segment profile. +* +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pBuildItem - Segment Build Item +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentpart(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_BuildItem * pBuildItem); + +/** +* Retrieves the assigned segment part uuid. +* +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[in] nPartUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartUUIDBuffer - buffer of Segment Part UUID, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentpartuuid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nPartUUIDBufferSize, Lib3MF_uint32* pPartUUIDNeededChars, char * pPartUUIDBuffer); + +/** +* Retrieves the assigned segment point list. For type hatch, the points are taken pairwise. +* +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[out] pPointDataNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPointDataBuffer - Position2D buffer of The point data array +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentpointdata(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint64 nPointDataBufferSize, Lib3MF_uint64* pPointDataNeededCount, Lib3MF::sPosition2D * pPointDataBuffer); + +/************************************************************************************************************************* + Class definition for ToolpathLayerData +**************************************************************************************************************************/ + +/** +* Retrieves the layerdata's uuid +* +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_getlayerdatauuid(Lib3MF_ToolpathLayerData pToolpathLayerData, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); + +/** +* Registers a toolpath profile +* +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pProfile - The toolpath profile to register. +* @param[out] pProfileID - returns the local profile ID for the layer. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_registerprofile(Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_ToolpathProfile pProfile, Lib3MF_uint32 * pProfileID); + +/** +* Registers a Model Build Item +* +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pBuildItem - The model build item to use. +* @param[out] pPartID - returns the local part ID for the layer. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_registerbuilditem(Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pPartID); + +/** +* writes hatch data to the layer. +* +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nProfileID - The toolpath profile to use +* @param[in] nPartID - The toolpath part to use +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[in] pPointDataBuffer - Position2D buffer of The point data +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_writehatchdata(Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const Lib3MF::sPosition2D * pPointDataBuffer); + +/** +* writes loop data to the layer. +* +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nProfileID - The toolpath profile to use +* @param[in] nPartID - The toolpath part to use +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[in] pPointDataBuffer - Position2D buffer of The point data +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_writeloop(Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const Lib3MF::sPosition2D * pPointDataBuffer); + +/** +* writes polyline data to the layer. +* +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nProfileID - The toolpath profile to use +* @param[in] nPartID - The toolpath part to use +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[in] pPointDataBuffer - Position2D buffer of The point data +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_writepolyline(Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const Lib3MF::sPosition2D * pPointDataBuffer); + +/** +* finishes all writing of the layer and compresses toolpath data. +* +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_finish(Lib3MF_ToolpathLayerData pToolpathLayerData); + +/************************************************************************************************************************* + Class definition for Toolpath +**************************************************************************************************************************/ + +/** +* Retrieves the unit factor +* +* @param[in] pToolpath - Toolpath instance. +* @param[out] pUnits - Returns the unit factor. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getunits(Lib3MF_Toolpath pToolpath, Lib3MF_double * pUnits); + +/** +* Retrieves the count of layers +* +* @param[in] pToolpath - Toolpath instance. +* @param[out] pCount - Returns the layer count +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getlayercount(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount); + +/** +* Retrieves the count of profiles +* +* @param[in] pToolpath - Toolpath instance. +* @param[out] pCount - Returns the profile count +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getprofilecount(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount); + +/** +* Adds a new toolpath layer +* +* @param[in] pToolpath - Toolpath instance. +* @param[in] nZMax - ZMax value +* @param[in] pPath - Package Path +* @param[in] pModelWriter - The model writer that writes out the 3MF. +* @param[out] pLayerData - Returns the layerdata object to write the layer content into. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_addlayer(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nZMax, const char * pPath, Lib3MF_Writer pModelWriter, Lib3MF_ToolpathLayerData * pLayerData); + +/** +* Retrieves the Attachment of a layer +* +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[out] pAttachment - Attachment +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getlayerattachment(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_Attachment * pAttachment); + +/** +* Reads the toolpath of a layer. +* +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[out] pToolpathReader - Toolpath Reader Instance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_readlayerdata(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_ToolpathLayerReader * pToolpathReader); + +/** +* Retrieves the Path of a layer +* +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of Package Path, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getlayerpath(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Retrieves the ZMax of a layer +* +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[out] pZMax - ZMax value +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getlayerzmax(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_uint32 * pZMax); + +/** +* Return the z value of a layer in units. +* +* @param[in] pToolpath - Toolpath instance. +* @param[in] nLayerIndex - Layer Index. +* @param[out] pZValue - Z Value in Units. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getlayerz(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nLayerIndex, Lib3MF_uint32 * pZValue); + +/** +* Adds a new profile to the toolpath. +* +* @param[in] pToolpath - Toolpath instance. +* @param[in] pName - the name. +* @param[out] pProfile - Returns the profile. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_addprofile(Lib3MF_Toolpath pToolpath, const char * pName, Lib3MF_ToolpathProfile * pProfile); + +/** +* Returns a profile of the toolpath. +* +* @param[in] pToolpath - Toolpath instance. +* @param[in] nProfileIndex - Layer Index. +* @param[out] pProfile - Returns the profile. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getprofile(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nProfileIndex, Lib3MF_ToolpathProfile * pProfile); + +/** +* Returns a profile of the toolpath by UUID. +* +* @param[in] pToolpath - Toolpath instance. +* @param[in] pProfileUUID - UUID string. +* @param[out] pProfile - Returns the profile. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getprofileuuid(Lib3MF_Toolpath pToolpath, const char * pProfileUUID, Lib3MF_ToolpathProfile * pProfile); + +/************************************************************************************************************************* + Class definition for ToolpathIterator +**************************************************************************************************************************/ + +/** +* Returns the Toolpath the iterator points at. +* +* @param[in] pToolpathIterator - ToolpathIterator instance. +* @param[out] pResource - returns the Toolpath instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathiterator_getcurrenttoolpath(Lib3MF_ToolpathIterator pToolpathIterator, Lib3MF_Toolpath * pResource); + /************************************************************************************************************************* Class definition for SliceStack **************************************************************************************************************************/ @@ -3253,6 +3680,15 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getcompositematerials(Lib3MF_Model pMo */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getmultipropertygroups(Lib3MF_Model pModel, Lib3MF_MultiPropertyGroupIterator * pResourceIterator); +/** +* creates a Toolpath instance with all toolpath resources. +* +* @param[in] pModel - Model instance. +* @param[out] pResourceIterator - returns the iterator instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_gettoolpaths(Lib3MF_Model pModel, Lib3MF_ToolpathIterator * pResourceIterator); + /** * creates a resource iterator instance with all slice stack resources. * @@ -3376,6 +3812,16 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_addbuilditem(Lib3MF_Model pModel, Lib3 */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_removebuilditem(Lib3MF_Model pModel, Lib3MF_BuildItem pBuildItemInstance); +/** +* adds an empty Toolpath resource to the model. +* +* @param[in] pModel - Model instance. +* @param[in] dUnitFactor - The toolpath instance of the created Toolpath. +* @param[out] pToolpathInstance - The toolpath instance of the created Toolpath. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_addtoolpath(Lib3MF_Model pModel, Lib3MF_double dUnitFactor, Lib3MF_Toolpath * pToolpathInstance); + /** * Returns the metadata of the model as MetaDataGroup * @@ -3507,6 +3953,40 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_setrandomnumbercallback(Lib3MF_Model p */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getkeystore(Lib3MF_Model pModel, Lib3MF_KeyStore * pKeyStore); +/** +* Creates an OPC Reader Source from a file. +* +* @param[in] pModel - Model instance. +* @param[in] pFilename - Filename to read from +* @param[out] pInstance - The instance of the created reader source +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_createpersistentsourcefromfile(Lib3MF_Model pModel, const char * pFilename, Lib3MF_PersistentReaderSource * pInstance); + +/** +* Creates an OPC Reader Source from a memory buffer. The memory buffer MUST exist as long as the Source object exists. +* +* @param[in] pModel - Model instance. +* @param[in] nBufferBufferSize - Number of elements in buffer +* @param[in] pBufferBuffer - uint8 buffer of Buffer to read from +* @param[out] pInstance - The instance of the created reader source +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_createpersistentsourcefrombuffer(Lib3MF_Model pModel, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer, Lib3MF_PersistentReaderSource * pInstance); + +/** +* Creates an OPC Reader Source from a data provided by a callback function. The callbacks MUST exist as long as the source object exists. +* +* @param[in] pModel - Model instance. +* @param[in] pTheReadCallback - Callback to call for reading a data chunk +* @param[in] nStreamSize - number of bytes the callback returns +* @param[in] pTheSeekCallback - Callback to call for seeking in the stream. +* @param[in] pUserData - Userdata that is passed to the callback function +* @param[out] pInstance - The instance of the created reader source +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_createpersistentsourcefromcallback(Lib3MF_Model pModel, Lib3MF::ReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MF::SeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData, Lib3MF_PersistentReaderSource * pInstance); + /************************************************************************************************************************* Global functions **************************************************************************************************************************/ diff --git a/Autogenerated/Bindings/CppDynamic/lib3mf_dynamic.h b/Autogenerated/Bindings/CppDynamic/lib3mf_dynamic.h index bfe996afe..0d4a79f47 100644 --- a/Autogenerated/Bindings/CppDynamic/lib3mf_dynamic.h +++ b/Autogenerated/Bindings/CppDynamic/lib3mf_dynamic.h @@ -53,6 +53,78 @@ Interface version: 2.3.2 */ typedef Lib3MFResult (*PLib3MFBase_ClassTypeIdPtr) (Lib3MF_Base pBase, Lib3MF_uint64 * pClassTypeId); +/************************************************************************************************************************* + Class definition for BinaryStream +**************************************************************************************************************************/ + +/** +* Retrieves an binary streams package path for the binary data. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of binary streams package binary path., may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_GetBinaryPathPtr) (Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Retrieves an binary streams package path for the index data. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of binary streams package index path., may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_GetIndexPathPtr) (Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Retrieves an binary streams uuid. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of binary streams uuid, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_GetUUIDPtr) (Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); + +/** +* Sets the float compression mode to raw. All subsequent writes will adhere to this mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_DisableDiscretizedArrayCompressionPtr) (Lib3MF_BinaryStream pBinaryStream); + +/** +* Sets the compression mode to a quantized array. All subsequent writes will adhere to this mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] dUnits - Unit factor to use for quantization. +* @param[in] ePredictionType - Prediction type to use for arrays. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_EnableDiscretizedArrayCompressionPtr) (Lib3MF_BinaryStream pBinaryStream, Lib3MF_double dUnits, Lib3MF::eBinaryStreamPredictionType ePredictionType); + +/** +* Enables LZMA mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nLZMALevel - LZMA Level (0-9) +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_EnableLZMAPtr) (Lib3MF_BinaryStream pBinaryStream, Lib3MF_uint32 nLZMALevel); + +/** +* Disables LZMA mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_DisableLZMAPtr) (Lib3MF_BinaryStream pBinaryStream); + /************************************************************************************************************************* Class definition for Writer **************************************************************************************************************************/ @@ -186,10 +258,80 @@ typedef Lib3MFResult (*PLib3MFWriter_AddKeyWrappingCallbackPtr) (Lib3MF_Writer p */ typedef Lib3MFResult (*PLib3MFWriter_SetContentEncryptionCallbackPtr) (Lib3MF_Writer pWriter, Lib3MF::ContentEncryptionCallback pTheCallback, Lib3MF_pvoid pUserData); +/** +* Creates a binary stream object. Only applicable for 3MF Writers. +* +* @param[in] pWriter - Writer instance. +* @param[in] pIndexPath - Package path to write the index into +* @param[in] pBinaryPath - Package path to write raw binary data into +* @param[out] pBinaryStream - Returns a package path. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFWriter_CreateBinaryStreamPtr) (Lib3MF_Writer pWriter, const char * pIndexPath, const char * pBinaryPath, Lib3MF_BinaryStream * pBinaryStream); + +/** +* Sets a binary stream for an object. Currently supported objects are Meshes and Toolpath layers. +* +* @param[in] pWriter - Writer instance. +* @param[in] pInstance - Object instance to assign Binary stream to. +* @param[in] pBinaryStream - Binary stream object to use for this layer. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFWriter_AssignBinaryStreamPtr) (Lib3MF_Writer pWriter, Lib3MF_Base pInstance, Lib3MF_BinaryStream pBinaryStream); + +/** +* Registers a custom 3MF Namespace. Fails if Prefix is already registered. +* +* @param[in] pWriter - Writer instance. +* @param[in] pPrefix - Prefix to be used. MUST NOT be empty. MUST be alphanumeric, not starting with a number +* @param[in] pNameSpace - Namespace to be used. MUST NOT be empty. MUST be alphanumeric, not starting with a number +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFWriter_RegisterCustomNamespacePtr) (Lib3MF_Writer pWriter, const char * pPrefix, const char * pNameSpace); + +/************************************************************************************************************************* + Class definition for PersistentReaderSource +**************************************************************************************************************************/ + +/** +* Retrieves the type of source data. +* +* @param[in] pPersistentReaderSource - PersistentReaderSource instance. +* @param[out] pSourceType - Reader Source Type +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFPersistentReaderSource_GetSourceTypePtr) (Lib3MF_PersistentReaderSource pPersistentReaderSource, Lib3MF::ePersistentReaderSourceType * pSourceType); + +/** +* Invalidates the reader source. Every subsequent read on this data will fail. +* +* @param[in] pPersistentReaderSource - PersistentReaderSource instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFPersistentReaderSource_InvalidateSourceDataPtr) (Lib3MF_PersistentReaderSource pPersistentReaderSource); + +/** +* Checks if the source data is valid. Any read on an invalid source object will fail. +* +* @param[in] pPersistentReaderSource - PersistentReaderSource instance. +* @param[out] pDataIsValid - The source data is valid. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFPersistentReaderSource_SourceDataIsValidPtr) (Lib3MF_PersistentReaderSource pPersistentReaderSource, bool * pDataIsValid); + /************************************************************************************************************************* Class definition for Reader **************************************************************************************************************************/ +/** +* Reads a model from a persistent source object. The object will be referenced until the Model is destroyed or cleared. +* +* @param[in] pReader - Reader instance. +* @param[in] pSource - Source object to read from +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFReader_ReadFromPersistentSourcePtr) (Lib3MF_Reader pReader, Lib3MF_PersistentReaderSource pSource); + /** * Reads a model from a file. The file type is specified by the Model Reader class * @@ -433,1987 +575,3252 @@ typedef Lib3MFResult (*PLib3MFResourceIterator_ClonePtr) (Lib3MF_ResourceIterato typedef Lib3MFResult (*PLib3MFResourceIterator_CountPtr) (Lib3MF_ResourceIterator pResourceIterator, Lib3MF_uint64 * pCount); /************************************************************************************************************************* - Class definition for SliceStackIterator + Class definition for CustomXMLAttribute **************************************************************************************************************************/ /** -* Returns the SliceStack the iterator points at. +* Retrieves name of the attribute. * -* @param[in] pSliceStackIterator - SliceStackIterator instance. -* @param[out] pResource - returns the SliceStack instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the attribute., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSliceStackIterator_GetCurrentSliceStackPtr) (Lib3MF_SliceStackIterator pSliceStackIterator, Lib3MF_SliceStack * pResource); - -/************************************************************************************************************************* - Class definition for ObjectIterator -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_GetNamePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Returns the Object the iterator points at. +* Retrieves value of the attribute as string. * -* @param[in] pObjectIterator - ObjectIterator instance. -* @param[out] pResource - returns the Object instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of returns the value of the attribute., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObjectIterator_GetCurrentObjectPtr) (Lib3MF_ObjectIterator pObjectIterator, Lib3MF_Object * pResource); - -/************************************************************************************************************************* - Class definition for MeshObjectIterator -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_GetValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* Returns the MeshObject the iterator points at. +* Checks if the value is a valid integer in the given range. * -* @param[in] pMeshObjectIterator - MeshObjectIterator instance. -* @param[out] pResource - returns the MeshObject instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nMinValue - Minimum allowed value +* @param[in] nMaxValue - Maximum allowed value +* @param[out] pIsValid - returns if the value is a valid integer. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) (Lib3MF_MeshObjectIterator pMeshObjectIterator, Lib3MF_MeshObject * pResource); - -/************************************************************************************************************************* - Class definition for ComponentsObjectIterator -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_IsValidIntegerPtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nMinValue, Lib3MF_int64 nMaxValue, bool * pIsValid); /** -* Returns the ComponentsObject the iterator points at. +* Returns the value as integer. Fails if the value is not a valid integer in the given range. * -* @param[in] pComponentsObjectIterator - ComponentsObjectIterator instance. -* @param[out] pResource - returns the ComponentsObject instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nMinValue - Minimum allowed value +* @param[in] nMaxValue - Maximum allowed value +* @param[out] pValue - returns the value. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) (Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource); - -/************************************************************************************************************************* - Class definition for Texture2DIterator -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_GetIntegerValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nMinValue, Lib3MF_int64 nMaxValue, Lib3MF_int64 * pValue); /** -* Returns the Texture2D the iterator points at. +* Checks if the value is a valid double in the given range. * -* @param[in] pTexture2DIterator - Texture2DIterator instance. -* @param[out] pResource - returns the Texture2D instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dMinValue - Minimum allowed value +* @param[in] dMaxValue - Maximum allowed value +* @param[out] pIsValid - returns if the value is a valid double. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) (Lib3MF_Texture2DIterator pTexture2DIterator, Lib3MF_Texture2D * pResource); +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_IsValidDoublePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, bool * pIsValid); -/************************************************************************************************************************* - Class definition for BaseMaterialGroupIterator -**************************************************************************************************************************/ +/** +* Returns the value as double. Fails if the value is not a valid double in the given range. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dMinValue - Minimum allowed value +* @param[in] dMaxValue - Maximum allowed value +* @param[out] pValue - returns the value . +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_GetDoubleValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, Lib3MF_double * pValue); /** -* Returns the MaterialGroup the iterator points at. +* Checks if the value is a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. * -* @param[in] pBaseMaterialGroupIterator - BaseMaterialGroupIterator instance. -* @param[out] pResource - returns the BaseMaterialGroup instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[out] pIsValid - returns if the value is a valid bool. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr) (Lib3MF_BaseMaterialGroupIterator pBaseMaterialGroupIterator, Lib3MF_BaseMaterialGroup * pResource); +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_IsValidBoolPtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, bool * pIsValid); -/************************************************************************************************************************* - Class definition for ColorGroupIterator -**************************************************************************************************************************/ +/** +* Returns the value as bool. Fails if the value is not a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dMinValue - Minimum allowed value +* @param[in] dMaxValue - Maximum allowed value +* @param[out] pValue - returns the value . +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_GetBoolValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, bool * pValue); /** -* Returns the ColorGroup the iterator points at. +* Sets the value of the attribute as string. * -* @param[in] pColorGroupIterator - ColorGroupIterator instance. -* @param[out] pResource - returns the ColorGroup instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] pValue - new value of the attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroupIterator_GetCurrentColorGroupPtr) (Lib3MF_ColorGroupIterator pColorGroupIterator, Lib3MF_ColorGroup * pResource); +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_SetValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const char * pValue); -/************************************************************************************************************************* - Class definition for Texture2DGroupIterator -**************************************************************************************************************************/ +/** +* Sets the value of the attribute as integer. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nValue - new value of the attribute. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_SetIntegerValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nValue); /** -* Returns the Texture2DGroup the iterator points at. +* Sets the value of the attribute as double. * -* @param[in] pTexture2DGroupIterator - Texture2DGroupIterator instance. -* @param[out] pResource - returns the Texture2DGroup instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dValue - new value of the attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupPtr) (Lib3MF_Texture2DGroupIterator pTexture2DGroupIterator, Lib3MF_Texture2DGroup * pResource); +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_SetDoubleValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dValue); -/************************************************************************************************************************* - Class definition for CompositeMaterialsIterator -**************************************************************************************************************************/ +/** +* Sets the value of the attribute as bool. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] bValue - new value of the attribute. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_SetBoolValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, bool bValue); /** -* Returns the CompositeMaterials the iterator points at. +* Removes the attribute from its parent node. All subsequent calls to the class will fail. * -* @param[in] pCompositeMaterialsIterator - CompositeMaterialsIterator instance. -* @param[out] pResource - returns the CompositeMaterials instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsPtr) (Lib3MF_CompositeMaterialsIterator pCompositeMaterialsIterator, Lib3MF_CompositeMaterials * pResource); +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_RemovePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute); /************************************************************************************************************************* - Class definition for MultiPropertyGroupIterator + Class definition for CustomXMLNode **************************************************************************************************************************/ /** -* Returns the MultiPropertyGroup the iterator points at. +* Retrieves name of the node. * -* @param[in] pMultiPropertyGroupIterator - MultiPropertyGroupIterator instance. -* @param[out] pResource - returns the MultiPropertyGroup instance. +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the node., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupPtr) (Lib3MF_MultiPropertyGroupIterator pMultiPropertyGroupIterator, Lib3MF_MultiPropertyGroup * pResource); - -/************************************************************************************************************************* - Class definition for MetaData -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLNode_GetNamePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* returns the namespace URL of the metadata +* Retrieves namespace of the node. * -* @param[in] pMetaData - MetaData instance. +* @param[in] pCustomXMLNode - CustomXMLNode instance. * @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) * @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameSpaceBuffer - buffer of the namespace URL of the metadata, may be NULL +* @param[out] pNameSpaceBuffer - buffer of returns the namespace of the node., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_GetNameSpacePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_GetNameSpacePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* sets a new namespace URL of the metadata +* Returns number of attributes. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pNameSpace - the new namespace URL of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[out] pCount - returns the number of attributes. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_SetNameSpacePtr) (Lib3MF_MetaData pMetaData, const char * pNameSpace); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_GetAttributeCountPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 * pCount); /** -* returns the name of a metadata +* Returns attribute instance. Fails if Index is out of range. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of the name of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] nIndex - Index of the attribute to return (0-based). +* @param[out] pAttributeInstance - XML Document attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_GetNamePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_GetAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 nIndex, Lib3MF_CustomXMLAttribute * pAttributeInstance); /** -* sets a new name of a metadata +* Returns if attribute of a specific name exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pName - the new name of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[out] pAttributeExists - Returns if the attribute exists. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_SetNamePtr) (Lib3MF_MetaData pMetaData, const char * pName); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_HasAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pAttributeExists); /** -* returns the (namespace+name) of a metadata +* Returns attribute instance of a specific name. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nKeyBufferSize - size of the buffer (including trailing 0) -* @param[out] pKeyNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pKeyBuffer - buffer of the key (namespace+name) of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] bMustExist - If true, the call fails if attribute does not exist. If falls, the call will return null if the attribute does not exist. +* @param[out] pAttributeInstance - XML Document attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_GetKeyPtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nKeyBufferSize, Lib3MF_uint32* pKeyNeededChars, char * pKeyBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_FindAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bMustExist, Lib3MF_CustomXMLAttribute * pAttributeInstance); /** -* returns, whether a metadata must be preserved +* Removes the attribute with a specific name. Does nothing if attribute does not exist. * -* @param[in] pMetaData - MetaData instance. -* @param[out] pMustPreserve - returns, whether a metadata must be preserved +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[out] pAttributeRemoved - Returns true if an attribute was removed. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_GetMustPreservePtr) (Lib3MF_MetaData pMetaData, bool * pMustPreserve); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_RemoveAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pAttributeRemoved); /** -* sets whether a metadata must be preserved +* Removes the attribute with a specific index. Fails if index is invalid * -* @param[in] pMetaData - MetaData instance. -* @param[in] bMustPreserve - a new value whether a metadata must be preserved +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] nIndex - Index of the attribute to remove (0-based). +* @param[out] pAttributeRemoved - Returns true if an attribute was removed. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_SetMustPreservePtr) (Lib3MF_MetaData pMetaData, bool bMustPreserve); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_RemoveAttributeByIndexPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 nIndex, bool * pAttributeRemoved); /** -* returns the type of a metadata +* Adds an attribute with a specific name and string value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nTypeBufferSize - size of the buffer (including trailing 0) -* @param[out] pTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pTypeBuffer - buffer of the type of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] pValue - Value of the attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_GetTypePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nTypeBufferSize, Lib3MF_uint32* pTypeNeededChars, char * pTypeBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_AddAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, const char * pValue); /** -* sets a new type of a metadata. This must be a simple XML type +* Adds an attribute with a specific name and integer value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pType - a new type of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] nValue - Value of the attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_SetTypePtr) (Lib3MF_MetaData pMetaData, const char * pType); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_AddIntegerAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_int64 nValue); /** -* returns the value of the metadata +* Adds an attribute with a specific name and double value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nValueBufferSize - size of the buffer (including trailing 0) -* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pValueBuffer - buffer of the value of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] dValue - Value of the attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_GetValuePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_AddDoubleAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_double dValue); /** -* sets a new value of the metadata +* Adds an attribute with a specific name and bool value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pValue - a new value of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] bValue - Value of the attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_SetValuePtr) (Lib3MF_MetaData pMetaData, const char * pValue); - -/************************************************************************************************************************* - Class definition for MetaDataGroup -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLNode_AddBoolAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bValue); /** -* returns the number of metadata in this metadatagroup +* Returns all the child nodes of the XML Node. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[out] pCount - returns the number metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[out] pChildNodes - returns the list of child nodes. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaDataGroup_GetMetaDataCountPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_GetChildrenPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_CustomXMLNodes * pChildNodes); /** -* returns a metadata value within this metadatagroup +* Returns how many children of the XML Node have a specific name. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] nIndex - Index of the Metadata. -* @param[out] pMetaData - an instance of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the node. +* @param[out] pCount - returns the number children with the specified name. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaDataGroup_GetMetaDataPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex, Lib3MF_MetaData * pMetaData); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_CountChildrenByNamePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_uint64 * pCount); /** -* returns a metadata value within this metadatagroup +* Returns all the child nodes of the XML Node with a specific name. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] pNameSpace - the namespace of the metadata -* @param[in] pName - the name of the Metadata -* @param[out] pMetaData - an instance of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildNodes - returns the list of child nodes. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaDataGroup_GetMetaDataByKeyPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, Lib3MF_MetaData * pMetaData); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_GetChildrenByNamePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_CustomXMLNodes * pChildNodes); /** -* removes metadata by index from the model. +* Returns if a child with a specific name exist. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] nIndex - Index of the metadata to remove +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildExists - returns if a child with a specific name exists. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaDataGroup_RemoveMetaDataByIndexPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_HasChildPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pChildExists); /** -* removes metadata from the model. +* Returns if a child with a specific name exist once and only once. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] pTheMetaData - The metadata to remove +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildExists - returns if a child with a specific name exists once and only once. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaDataGroup_RemoveMetaDataPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_MetaData pTheMetaData); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_HasUniqueChildPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pChildExists); /** -* adds a new metadata to this metadatagroup +* Returns child with a specific name. Throws an error if name does not exist once and only once. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] pNameSpace - the namespace of the metadata -* @param[in] pName - the name of the metadata -* @param[in] pValue - the value of the metadata -* @param[in] pType - the type of the metadata -* @param[in] bMustPreserve - shuold the metadata be preserved -* @param[out] pMetaData - a new instance of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[in] bMustExist - If true, the call fails if child does not exist. If falls, the call will return null if the child does not exist. +* @param[out] pChildInstance - returns child instance or null. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaDataGroup_AddMetaDataPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, const char * pValue, const char * pType, bool bMustPreserve, Lib3MF_MetaData * pMetaData); - -/************************************************************************************************************************* - Class definition for Object -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLNode_FindChildPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bMustExist, Lib3MF_CustomXMLNode * pChildInstance); /** -* Retrieves an object's type +* Adds a new child with a specific name. * -* @param[in] pObject - Object instance. -* @param[out] pObjectType - returns object type enum. +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildInstance - returns child instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetTypePtr) (Lib3MF_Object pObject, Lib3MF::eObjectType * pObjectType); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_AddChildPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_CustomXMLNode * pChildInstance); /** -* Sets an object's type +* Removes a specific child. All subsequent calls to the child will fail after the call. * -* @param[in] pObject - Object instance. -* @param[in] eObjectType - object type enum. +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pChildInstance - child instance to remove. Fails if given instance is not a child of the node. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_SetTypePtr) (Lib3MF_Object pObject, Lib3MF::eObjectType eObjectType); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_RemoveChildPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_CustomXMLNode pChildInstance); /** -* Retrieves an object's name +* Removes all children with a specific name. Does nothing if no child with the name exists. All subsequent calls to the deleted children will fail after the call. * -* @param[in] pObject - Object instance. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of returns object name., may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the children. +* @param[out] pNumberOfDeletedChildren - Returns how many children have been deleted. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetNamePtr) (Lib3MF_Object pObject, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_RemoveChildrenWithNamePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_uint64 * pNumberOfDeletedChildren); /** -* Sets an object's name string +* Removes the node from its parent. The root node of the document can not be removed. Any subsequent call to the node fails after this. * -* @param[in] pObject - Object instance. -* @param[in] pName - new object name. +* @param[in] pCustomXMLNode - CustomXMLNode instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_SetNamePtr) (Lib3MF_Object pObject, const char * pName); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_RemovePtr) (Lib3MF_CustomXMLNode pCustomXMLNode); + +/************************************************************************************************************************* + Class definition for CustomXMLNodes +**************************************************************************************************************************/ /** -* Retrieves an object's part number +* Returns number of nodes. * -* @param[in] pObject - Object instance. -* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) -* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPartNumberBuffer - buffer of returns object part number., may be NULL +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[out] pCount - returns the number of nodes in the list. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetPartNumberPtr) (Lib3MF_Object pObject, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_GetNodeCountPtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, Lib3MF_uint64 * pCount); /** -* Sets an objects partnumber string +* Returns node instance. Fails if Index is out of range. * -* @param[in] pObject - Object instance. -* @param[in] pPartNumber - new object part number. +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] nIndex - Index of the node to return (0-based). +* @param[out] pNodeInstance - XML Node node. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_SetPartNumberPtr) (Lib3MF_Object pObject, const char * pPartNumber); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_GetNodePtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, Lib3MF_uint64 nIndex, Lib3MF_CustomXMLNode * pNodeInstance); /** -* Retrieves, if an object is a mesh object +* Returns how many nodes of the XML Node have a specific name. * -* @param[in] pObject - Object instance. -* @param[out] pIsMeshObject - returns, whether the object is a mesh object +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pCount - returns the number of nodes with the specified name. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_IsMeshObjectPtr) (Lib3MF_Object pObject, bool * pIsMeshObject); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_CountNodesByNamePtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, Lib3MF_uint64 * pCount); /** -* Retrieves, if an object is a components object +* Returns all the nodes nodes of the XML Node with a specific name. * -* @param[in] pObject - Object instance. -* @param[out] pIsComponentsObject - returns, whether the object is a components object +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pNodes - returns the list of node nodes. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_IsComponentsObjectPtr) (Lib3MF_Object pObject, bool * pIsComponentsObject); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_GetNodesByNamePtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, Lib3MF_CustomXMLNodes * pNodes); /** -* Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. +* Returns if a node with a specific name exist. * -* @param[in] pObject - Object instance. -* @param[out] pIsValid - returns whether the object is a valid object description +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pNodeExists - returns if a node with a specific name exists. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_IsValidPtr) (Lib3MF_Object pObject, bool * pIsValid); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_HasNodePtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool * pNodeExists); /** -* Use an existing attachment as thumbnail for this object +* Returns if a node with a specific name exist once and only once. * -* @param[in] pObject - Object instance. -* @param[in] pAttachment - Instance of a new or the existing thumbnailattachment object. +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pNodeExists - returns if a node with a specific name exists once and only once. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_SetAttachmentAsThumbnailPtr) (Lib3MF_Object pObject, Lib3MF_Attachment pAttachment); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_HasUniqueNodePtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool * pNodeExists); /** -* Get the attachment containing the object thumbnail. +* Returns node with a specific name. Throws an error if name does not exist once and only once. * -* @param[in] pObject - Object instance. -* @param[out] pAttachment - Instance of the thumbnailattachment object or NULL. +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[in] bMustExist - If true, the call fails if node does not exist. If falls, the call will return null if the node does not exist. +* @param[out] pNodeInstance - returns node instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetThumbnailAttachmentPtr) (Lib3MF_Object pObject, Lib3MF_Attachment * pAttachment); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_FindNodePtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool bMustExist, Lib3MF_CustomXMLNode * pNodeInstance); + +/************************************************************************************************************************* + Class definition for CustomDOMTree +**************************************************************************************************************************/ /** -* Clears the attachment. The attachment instance is not removed from the package. +* Returns the namespace identifier for the DOM Tree. * -* @param[in] pObject - Object instance. +* @param[in] pCustomDOMTree - CustomDOMTree instance. +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of returns the namespace of the DOM Tree., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_ClearThumbnailAttachmentPtr) (Lib3MF_Object pObject); +typedef Lib3MFResult (*PLib3MFCustomDOMTree_GetNameSpacePtr) (Lib3MF_CustomDOMTree pCustomDOMTree, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* Returns the outbox of a build item +* Returns root node of the tree. * -* @param[in] pObject - Object instance. -* @param[out] pOutbox - Outbox of this build item +* @param[in] pCustomDOMTree - CustomDOMTree instance. +* @param[out] pRootNode - Root node of the document. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetOutboxPtr) (Lib3MF_Object pObject, Lib3MF::sBox * pOutbox); +typedef Lib3MFResult (*PLib3MFCustomDOMTree_GetRootNodePtr) (Lib3MF_CustomDOMTree pCustomDOMTree, Lib3MF_CustomXMLNode * pRootNode); /** -* Retrieves an object's uuid string (see production extension specification) +* Saves the XML tree into a string. * -* @param[in] pObject - Object instance. -* @param[out] pHasUUID - flag whether the build item has a UUID -* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pUUIDBuffer - buffer of returns object uuid., may be NULL +* @param[in] pCustomDOMTree - CustomDOMTree instance. +* @param[in] nXMLStringBufferSize - size of the buffer (including trailing 0) +* @param[out] pXMLStringNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pXMLStringBuffer - buffer of String with the XML Content., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetUUIDPtr) (Lib3MF_Object pObject, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); +typedef Lib3MFResult (*PLib3MFCustomDOMTree_SaveToStringPtr) (Lib3MF_CustomDOMTree pCustomDOMTree, const Lib3MF_uint32 nXMLStringBufferSize, Lib3MF_uint32* pXMLStringNeededChars, char * pXMLStringBuffer); + +/************************************************************************************************************************* + Class definition for SliceStackIterator +**************************************************************************************************************************/ /** -* Sets a build object's uuid string (see production extension specification) +* Returns the SliceStack the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] pUUID - new object uuid string. +* @param[in] pSliceStackIterator - SliceStackIterator instance. +* @param[out] pResource - returns the SliceStack instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_SetUUIDPtr) (Lib3MF_Object pObject, const char * pUUID); +typedef Lib3MFResult (*PLib3MFSliceStackIterator_GetCurrentSliceStackPtr) (Lib3MF_SliceStackIterator pSliceStackIterator, Lib3MF_SliceStack * pResource); + +/************************************************************************************************************************* + Class definition for ObjectIterator +**************************************************************************************************************************/ /** -* Returns the metadatagroup of this object +* Returns the Object the iterator points at. * -* @param[in] pObject - Object instance. -* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this object +* @param[in] pObjectIterator - ObjectIterator instance. +* @param[out] pResource - returns the Object instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetMetaDataGroupPtr) (Lib3MF_Object pObject, Lib3MF_MetaDataGroup * pMetaDataGroup); +typedef Lib3MFResult (*PLib3MFObjectIterator_GetCurrentObjectPtr) (Lib3MF_ObjectIterator pObjectIterator, Lib3MF_Object * pResource); + +/************************************************************************************************************************* + Class definition for MeshObjectIterator +**************************************************************************************************************************/ /** -* set the meshresolution of the mesh object +* Returns the MeshObject the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] eMeshResolution - meshresolution of this object +* @param[in] pMeshObjectIterator - MeshObjectIterator instance. +* @param[out] pResource - returns the MeshObject instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_SetSlicesMeshResolutionPtr) (Lib3MF_Object pObject, Lib3MF::eSlicesMeshResolution eMeshResolution); +typedef Lib3MFResult (*PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) (Lib3MF_MeshObjectIterator pMeshObjectIterator, Lib3MF_MeshObject * pResource); + +/************************************************************************************************************************* + Class definition for ComponentsObjectIterator +**************************************************************************************************************************/ /** -* get the meshresolution of the mesh object +* Returns the ComponentsObject the iterator points at. * -* @param[in] pObject - Object instance. -* @param[out] pMeshResolution - meshresolution of this object +* @param[in] pComponentsObjectIterator - ComponentsObjectIterator instance. +* @param[out] pResource - returns the ComponentsObject instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetSlicesMeshResolutionPtr) (Lib3MF_Object pObject, Lib3MF::eSlicesMeshResolution * pMeshResolution); +typedef Lib3MFResult (*PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) (Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource); + +/************************************************************************************************************************* + Class definition for Texture2DIterator +**************************************************************************************************************************/ /** -* returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack +* Returns the Texture2D the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] bRecursive - check also all referenced objects? -* @param[out] pHasSlices - does the object have a slice stack? +* @param[in] pTexture2DIterator - Texture2DIterator instance. +* @param[out] pResource - returns the Texture2D instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_HasSlicesPtr) (Lib3MF_Object pObject, bool bRecursive, bool * pHasSlices); +typedef Lib3MFResult (*PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) (Lib3MF_Texture2DIterator pTexture2DIterator, Lib3MF_Texture2D * pResource); + +/************************************************************************************************************************* + Class definition for BaseMaterialGroupIterator +**************************************************************************************************************************/ /** -* unlinks the attached slicestack from this object. If no slice stack is attached, do noting. +* Returns the MaterialGroup the iterator points at. * -* @param[in] pObject - Object instance. +* @param[in] pBaseMaterialGroupIterator - BaseMaterialGroupIterator instance. +* @param[out] pResource - returns the BaseMaterialGroup instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_ClearSliceStackPtr) (Lib3MF_Object pObject); +typedef Lib3MFResult (*PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr) (Lib3MF_BaseMaterialGroupIterator pBaseMaterialGroupIterator, Lib3MF_BaseMaterialGroup * pResource); + +/************************************************************************************************************************* + Class definition for ColorGroupIterator +**************************************************************************************************************************/ /** -* get the Slicestack attached to the object +* Returns the ColorGroup the iterator points at. * -* @param[in] pObject - Object instance. -* @param[out] pSliceStackInstance - returns the slicestack instance +* @param[in] pColorGroupIterator - ColorGroupIterator instance. +* @param[out] pResource - returns the ColorGroup instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetSliceStackPtr) (Lib3MF_Object pObject, Lib3MF_SliceStack * pSliceStackInstance); +typedef Lib3MFResult (*PLib3MFColorGroupIterator_GetCurrentColorGroupPtr) (Lib3MF_ColorGroupIterator pColorGroupIterator, Lib3MF_ColorGroup * pResource); + +/************************************************************************************************************************* + Class definition for Texture2DGroupIterator +**************************************************************************************************************************/ /** -* assigns a slicestack to the object +* Returns the Texture2DGroup the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] pSliceStackInstance - the new slice stack of this Object +* @param[in] pTexture2DGroupIterator - Texture2DGroupIterator instance. +* @param[out] pResource - returns the Texture2DGroup instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_AssignSliceStackPtr) (Lib3MF_Object pObject, Lib3MF_SliceStack pSliceStackInstance); +typedef Lib3MFResult (*PLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupPtr) (Lib3MF_Texture2DGroupIterator pTexture2DGroupIterator, Lib3MF_Texture2DGroup * pResource); /************************************************************************************************************************* - Class definition for MeshObject + Class definition for CompositeMaterialsIterator **************************************************************************************************************************/ /** -* Returns the vertex count of a mesh object. +* Returns the CompositeMaterials the iterator points at. * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pVertexCount - filled with the vertex count. +* @param[in] pCompositeMaterialsIterator - CompositeMaterialsIterator instance. +* @param[out] pResource - returns the CompositeMaterials instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetVertexCountPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); +typedef Lib3MFResult (*PLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsPtr) (Lib3MF_CompositeMaterialsIterator pCompositeMaterialsIterator, Lib3MF_CompositeMaterials * pResource); + +/************************************************************************************************************************* + Class definition for MultiPropertyGroupIterator +**************************************************************************************************************************/ /** -* Returns the triangle count of a mesh object. +* Returns the MultiPropertyGroup the iterator points at. * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pVertexCount - filled with the triangle count. +* @param[in] pMultiPropertyGroupIterator - MultiPropertyGroupIterator instance. +* @param[out] pResource - returns the MultiPropertyGroup instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetTriangleCountPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); +typedef Lib3MFResult (*PLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupPtr) (Lib3MF_MultiPropertyGroupIterator pMultiPropertyGroupIterator, Lib3MF_MultiPropertyGroup * pResource); + +/************************************************************************************************************************* + Class definition for MetaData +**************************************************************************************************************************/ /** -* Returns the vertex count of a mesh object. +* returns the namespace URL of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) -* @param[out] pCoordinates - filled with the vertex coordinates. +* @param[in] pMetaData - MetaData instance. +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of the namespace URL of the metadata, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetVertexPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, Lib3MF::sPosition * pCoordinates); +typedef Lib3MFResult (*PLib3MFMetaData_GetNameSpacePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* Sets the coordinates of a single vertex of a mesh object +* sets a new namespace URL of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) -* @param[in] pCoordinates - contains the vertex coordinates. +* @param[in] pMetaData - MetaData instance. +* @param[in] pNameSpace - the new namespace URL of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_SetVertexPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const Lib3MF::sPosition * pCoordinates); +typedef Lib3MFResult (*PLib3MFMetaData_SetNameSpacePtr) (Lib3MF_MetaData pMetaData, const char * pNameSpace); /** -* Adds a single vertex to a mesh object +* returns the name of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] pCoordinates - contains the vertex coordinates. -* @param[out] pNewIndex - Index of the new vertex +* @param[in] pMetaData - MetaData instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of the name of the metadata, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_AddVertexPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF::sPosition * pCoordinates, Lib3MF_uint32 * pNewIndex); +typedef Lib3MFResult (*PLib3MFMetaData_GetNamePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Obtains all vertex positions of a mesh object +* sets a new name of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pVerticesBuffer - Position buffer of contains the vertex coordinates. +* @param[in] pMetaData - MetaData instance. +* @param[in] pName - the new name of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetVerticesPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, Lib3MF::sPosition * pVerticesBuffer); +typedef Lib3MFResult (*PLib3MFMetaData_SetNamePtr) (Lib3MF_MetaData pMetaData, const char * pName); /** -* Returns indices of a single triangle of a mesh object. +* returns the (namespace+name) of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[out] pIndices - filled with the triangle indices. +* @param[in] pMetaData - MetaData instance. +* @param[in] nKeyBufferSize - size of the buffer (including trailing 0) +* @param[out] pKeyNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pKeyBuffer - buffer of the key (namespace+name) of the metadata, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetTrianglePtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, Lib3MF::sTriangle * pIndices); +typedef Lib3MFResult (*PLib3MFMetaData_GetKeyPtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nKeyBufferSize, Lib3MF_uint32* pKeyNeededChars, char * pKeyBuffer); /** -* Sets the indices of a single triangle of a mesh object. +* returns, whether a metadata must be preserved * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[in] pIndices - contains the triangle indices. +* @param[in] pMetaData - MetaData instance. +* @param[out] pMustPreserve - returns, whether a metadata must be preserved * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_SetTrianglePtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const Lib3MF::sTriangle * pIndices); +typedef Lib3MFResult (*PLib3MFMetaData_GetMustPreservePtr) (Lib3MF_MetaData pMetaData, bool * pMustPreserve); /** -* Adds a single triangle to a mesh object +* sets whether a metadata must be preserved * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] pIndices - contains the triangle indices. -* @param[out] pNewIndex - Index of the new triangle +* @param[in] pMetaData - MetaData instance. +* @param[in] bMustPreserve - a new value whether a metadata must be preserved * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_AddTrianglePtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF::sTriangle * pIndices, Lib3MF_uint32 * pNewIndex); +typedef Lib3MFResult (*PLib3MFMetaData_SetMustPreservePtr) (Lib3MF_MetaData pMetaData, bool bMustPreserve); /** -* Get all triangles of a mesh object +* returns the type of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @param[in] pMetaData - MetaData instance. +* @param[in] nTypeBufferSize - size of the buffer (including trailing 0) +* @param[out] pTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pTypeBuffer - buffer of the type of the metadata, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetTriangleIndicesPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF::sTriangle * pIndicesBuffer); +typedef Lib3MFResult (*PLib3MFMetaData_GetTypePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nTypeBufferSize, Lib3MF_uint32* pTypeNeededChars, char * pTypeBuffer); /** -* Sets the property at the object-level of the mesh object. +* sets a new type of a metadata. This must be a simple XML type * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nUniqueResourceID - the object-level Property UniqueResourceID. -* @param[in] nPropertyID - the object-level PropertyID. +* @param[in] pMetaData - MetaData instance. +* @param[in] pType - a new type of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_SetObjectLevelPropertyPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nUniqueResourceID, Lib3MF_uint32 nPropertyID); +typedef Lib3MFResult (*PLib3MFMetaData_SetTypePtr) (Lib3MF_MetaData pMetaData, const char * pType); /** -* Gets the property at the object-level of the mesh object. +* returns the value of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pUniqueResourceID - the object-level Property UniqueResourceID. -* @param[out] pPropertyID - the object-level PropertyID. -* @param[out] pHasObjectLevelProperty - Has an object-level property been specified? +* @param[in] pMetaData - MetaData instance. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of the value of the metadata, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetObjectLevelPropertyPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pUniqueResourceID, Lib3MF_uint32 * pPropertyID, bool * pHasObjectLevelProperty); +typedef Lib3MFResult (*PLib3MFMetaData_GetValuePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* Sets the properties of a single triangle of a mesh object. +* sets a new value of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[in] pProperties - contains the triangle properties. +* @param[in] pMetaData - MetaData instance. +* @param[in] pValue - a new value of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_SetTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const Lib3MF::sTriangleProperties * pProperties); +typedef Lib3MFResult (*PLib3MFMetaData_SetValuePtr) (Lib3MF_MetaData pMetaData, const char * pValue); -/** -* Gets the properties of a single triangle of a mesh object. -* -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[out] pProperty - returns the triangle properties. -* @return error code or 0 (success) -*/ -typedef Lib3MFResult (*PLib3MFMeshObject_GetTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, Lib3MF::sTriangleProperties * pProperty); +/************************************************************************************************************************* + Class definition for MetaDataGroup +**************************************************************************************************************************/ /** -* Sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. +* returns the number of metadata in this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer -* @param[in] pPropertiesArrayBuffer - TriangleProperties buffer of contains the triangle properties array. Must have trianglecount elements. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[out] pCount - returns the number metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_SetAllTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nPropertiesArrayBufferSize, const Lib3MF::sTriangleProperties * pPropertiesArrayBuffer); +typedef Lib3MFResult (*PLib3MFMetaDataGroup_GetMetaDataCountPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 * pCount); /** -* Gets the properties of all triangles of a mesh object. +* returns a metadata value within this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer -* @param[out] pPropertiesArrayNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertiesArrayBuffer - TriangleProperties buffer of returns the triangle properties array. Must have trianglecount elements. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] nIndex - Index of the Metadata. +* @param[out] pMetaData - an instance of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetAllTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nPropertiesArrayBufferSize, Lib3MF_uint64* pPropertiesArrayNeededCount, Lib3MF::sTriangleProperties * pPropertiesArrayBuffer); +typedef Lib3MFResult (*PLib3MFMetaDataGroup_GetMetaDataPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex, Lib3MF_MetaData * pMetaData); /** -* Clears all properties of this mesh object (triangle and object-level). +* returns a metadata value within this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] pNameSpace - the namespace of the metadata +* @param[in] pName - the name of the Metadata +* @param[out] pMetaData - an instance of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_ClearAllPropertiesPtr) (Lib3MF_MeshObject pMeshObject); +typedef Lib3MFResult (*PLib3MFMetaDataGroup_GetMetaDataByKeyPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, Lib3MF_MetaData * pMetaData); /** -* Set all triangles of a mesh object +* removes metadata by index from the model. * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[in] pVerticesBuffer - Position buffer of contains the positions. -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[in] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] nIndex - Index of the metadata to remove * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_SetGeometryPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nVerticesBufferSize, const Lib3MF::sPosition * pVerticesBuffer, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF::sTriangle * pIndicesBuffer); +typedef Lib3MFResult (*PLib3MFMetaDataGroup_RemoveMetaDataByIndexPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex); /** -* Retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. +* removes metadata from the model. * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pIsManifoldAndOriented - returns, if the object is oriented and manifold. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] pTheMetaData - The metadata to remove * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_IsManifoldAndOrientedPtr) (Lib3MF_MeshObject pMeshObject, bool * pIsManifoldAndOriented); +typedef Lib3MFResult (*PLib3MFMetaDataGroup_RemoveMetaDataPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_MetaData pTheMetaData); /** -* Retrieves the BeamLattice within this MeshObject. +* adds a new metadata to this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pTheBeamLattice - the BeamLattice within this MeshObject +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] pNameSpace - the namespace of the metadata +* @param[in] pName - the name of the metadata +* @param[in] pValue - the value of the metadata +* @param[in] pType - the type of the metadata +* @param[in] bMustPreserve - shuold the metadata be preserved +* @param[out] pMetaData - a new instance of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_BeamLatticePtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_BeamLattice * pTheBeamLattice); +typedef Lib3MFResult (*PLib3MFMetaDataGroup_AddMetaDataPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, const char * pValue, const char * pType, bool bMustPreserve, Lib3MF_MetaData * pMetaData); /************************************************************************************************************************* - Class definition for BeamLattice + Class definition for Object **************************************************************************************************************************/ /** -* Returns the minimal length of beams for the beamlattice. +* Retrieves an object's type * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pMinLength - minimal length of beams for the beamlattice +* @param[in] pObject - Object instance. +* @param[out] pObjectType - returns object type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetMinLengthPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_double * pMinLength); +typedef Lib3MFResult (*PLib3MFObject_GetTypePtr) (Lib3MF_Object pObject, Lib3MF::eObjectType * pObjectType); /** -* Sets the minimal length of beams for the beamlattice. +* Sets an object's type * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] dMinLength - minimal length of beams for the beamlattice +* @param[in] pObject - Object instance. +* @param[in] eObjectType - object type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetMinLengthPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_double dMinLength); +typedef Lib3MFResult (*PLib3MFObject_SetTypePtr) (Lib3MF_Object pObject, Lib3MF::eObjectType eObjectType); /** -* Returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* Retrieves an object's name * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pClipMode - contains the clip mode of this mesh -* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object or an undefined value if pClipMode is MODELBEAMLATTICECLIPMODE_NONE +* @param[in] pObject - Object instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns object name., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetClippingPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF::eBeamLatticeClipMode * pClipMode, Lib3MF_uint32 * pUniqueResourceID); +typedef Lib3MFResult (*PLib3MFObject_GetNamePtr) (Lib3MF_Object pObject, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* Sets an object's name string * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] eClipMode - contains the clip mode of this mesh -* @param[in] nUniqueResourceID - the UniqueResourceID of the clipping mesh-object. This mesh-object has to be defined before setting the Clipping. +* @param[in] pObject - Object instance. +* @param[in] pName - new object name. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetClippingPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF::eBeamLatticeClipMode eClipMode, Lib3MF_uint32 nUniqueResourceID); +typedef Lib3MFResult (*PLib3MFObject_SetNamePtr) (Lib3MF_Object pObject, const char * pName); /** -* Returns the representation-mesh for the beamlattice of this mesh. +* Retrieves an object's part number * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pHasRepresentation - flag whether the beamlattice has a representation mesh. -* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object. +* @param[in] pObject - Object instance. +* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartNumberBuffer - buffer of returns object part number., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetRepresentationPtr) (Lib3MF_BeamLattice pBeamLattice, bool * pHasRepresentation, Lib3MF_uint32 * pUniqueResourceID); +typedef Lib3MFResult (*PLib3MFObject_GetPartNumberPtr) (Lib3MF_Object pObject, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); /** -* Sets the representation-mesh for the beamlattice of this mesh. +* Sets an objects partnumber string * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nUniqueResourceID - the UniqueResourceID of the representation mesh-object. This mesh-object has to be defined before setting the representation. +* @param[in] pObject - Object instance. +* @param[in] pPartNumber - new object part number. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetRepresentationPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nUniqueResourceID); +typedef Lib3MFResult (*PLib3MFObject_SetPartNumberPtr) (Lib3MF_Object pObject, const char * pPartNumber); /** -* Returns the ball mode and the default ball radius for the beamlattice of this mesh. +* Retrieves, if an object is a mesh object * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pBallMode - contains the ball mode of this mesh -* @param[out] pBallRadius - default ball radius of balls for the beamlattice +* @param[in] pObject - Object instance. +* @param[out] pIsMeshObject - returns, whether the object is a mesh object * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallOptionsPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF::eBeamLatticeBallMode * pBallMode, Lib3MF_double * pBallRadius); +typedef Lib3MFResult (*PLib3MFObject_IsMeshObjectPtr) (Lib3MF_Object pObject, bool * pIsMeshObject); /** -* Sets the ball mode and thedefault ball radius for the beamlattice. +* Retrieves, if an object is a components object * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] eBallMode - contains the ball mode of this mesh -* @param[in] dBallRadius - default ball radius of balls for the beamlattice +* @param[in] pObject - Object instance. +* @param[out] pIsComponentsObject - returns, whether the object is a components object * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetBallOptionsPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF::eBeamLatticeBallMode eBallMode, Lib3MF_double dBallRadius); +typedef Lib3MFResult (*PLib3MFObject_IsComponentsObjectPtr) (Lib3MF_Object pObject, bool * pIsComponentsObject); /** -* Returns the beam count of a mesh object. +* Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pCount - filled with the beam count. +* @param[in] pObject - Object instance. +* @param[out] pIsValid - returns whether the object is a valid object description * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamCountPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFObject_IsValidPtr) (Lib3MF_Object pObject, bool * pIsValid); /** -* Returns indices, radii and capmodes of a single beam of a mesh object. +* Use an existing attachment as thumbnail for this object * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the beam (0 to beamcount - 1). -* @param[out] pBeamInfo - filled with the beam indices, radii and capmodes. +* @param[in] pObject - Object instance. +* @param[in] pAttachment - Instance of a new or the existing thumbnailattachment object. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF::sBeam * pBeamInfo); +typedef Lib3MFResult (*PLib3MFObject_SetAttachmentAsThumbnailPtr) (Lib3MF_Object pObject, Lib3MF_Attachment pAttachment); /** -* Adds a single beam to a mesh object. +* Get the attachment containing the object thumbnail. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] pBeamInfo - contains the node indices, radii and capmodes. -* @param[out] pIndex - filled with the new Index of the beam. +* @param[in] pObject - Object instance. +* @param[out] pAttachment - Instance of the thumbnailattachment object or NULL. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_AddBeamPtr) (Lib3MF_BeamLattice pBeamLattice, const Lib3MF::sBeam * pBeamInfo, Lib3MF_uint32 * pIndex); +typedef Lib3MFResult (*PLib3MFObject_GetThumbnailAttachmentPtr) (Lib3MF_Object pObject, Lib3MF_Attachment * pAttachment); /** -* Sets the indices, radii and capmodes of a single beam of a mesh object. +* Clears the attachment. The attachment instance is not removed from the package. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the beam (0 to beamcount - 1). -* @param[in] pBeamInfo - filled with the beam indices, radii and capmodes. +* @param[in] pObject - Object instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetBeamPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const Lib3MF::sBeam * pBeamInfo); +typedef Lib3MFResult (*PLib3MFObject_ClearThumbnailAttachmentPtr) (Lib3MF_Object pObject); /** -* Sets all beam indices, radii and capmodes of a mesh object. +* Returns the outbox of a build item * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBeamInfoBufferSize - Number of elements in buffer -* @param[in] pBeamInfoBuffer - Beam buffer of contains information of a number of beams +* @param[in] pObject - Object instance. +* @param[out] pOutbox - Outbox of this build item * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetBeamsPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBeamInfoBufferSize, const Lib3MF::sBeam * pBeamInfoBuffer); +typedef Lib3MFResult (*PLib3MFObject_GetOutboxPtr) (Lib3MF_Object pObject, Lib3MF::sBox * pOutbox); + +/** +* Retrieves an object's uuid string (see production extension specification) +* +* @param[in] pObject - Object instance. +* @param[out] pHasUUID - flag whether the build item has a UUID +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of returns object uuid., may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_GetUUIDPtr) (Lib3MF_Object pObject, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); + +/** +* Sets a build object's uuid string (see production extension specification) +* +* @param[in] pObject - Object instance. +* @param[in] pUUID - new object uuid string. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_SetUUIDPtr) (Lib3MF_Object pObject, const char * pUUID); + +/** +* Returns the metadatagroup of this object +* +* @param[in] pObject - Object instance. +* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_GetMetaDataGroupPtr) (Lib3MF_Object pObject, Lib3MF_MetaDataGroup * pMetaDataGroup); + +/** +* set the meshresolution of the mesh object +* +* @param[in] pObject - Object instance. +* @param[in] eMeshResolution - meshresolution of this object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_SetSlicesMeshResolutionPtr) (Lib3MF_Object pObject, Lib3MF::eSlicesMeshResolution eMeshResolution); + +/** +* get the meshresolution of the mesh object +* +* @param[in] pObject - Object instance. +* @param[out] pMeshResolution - meshresolution of this object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_GetSlicesMeshResolutionPtr) (Lib3MF_Object pObject, Lib3MF::eSlicesMeshResolution * pMeshResolution); + +/** +* returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack +* +* @param[in] pObject - Object instance. +* @param[in] bRecursive - check also all referenced objects? +* @param[out] pHasSlices - does the object have a slice stack? +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_HasSlicesPtr) (Lib3MF_Object pObject, bool bRecursive, bool * pHasSlices); + +/** +* unlinks the attached slicestack from this object. If no slice stack is attached, do noting. +* +* @param[in] pObject - Object instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_ClearSliceStackPtr) (Lib3MF_Object pObject); + +/** +* get the Slicestack attached to the object +* +* @param[in] pObject - Object instance. +* @param[out] pSliceStackInstance - returns the slicestack instance +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_GetSliceStackPtr) (Lib3MF_Object pObject, Lib3MF_SliceStack * pSliceStackInstance); + +/** +* assigns a slicestack to the object +* +* @param[in] pObject - Object instance. +* @param[in] pSliceStackInstance - the new slice stack of this Object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_AssignSliceStackPtr) (Lib3MF_Object pObject, Lib3MF_SliceStack pSliceStackInstance); + +/************************************************************************************************************************* + Class definition for MeshObject +**************************************************************************************************************************/ + +/** +* Returns the vertex count of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pVertexCount - filled with the vertex count. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetVertexCountPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); + +/** +* Returns the triangle count of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pVertexCount - filled with the triangle count. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetTriangleCountPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); + +/** +* Returns the vertex count of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) +* @param[out] pCoordinates - filled with the vertex coordinates. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetVertexPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, Lib3MF::sPosition * pCoordinates); + +/** +* Sets the coordinates of a single vertex of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) +* @param[in] pCoordinates - contains the vertex coordinates. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_SetVertexPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const Lib3MF::sPosition * pCoordinates); + +/** +* Adds a single vertex to a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] pCoordinates - contains the vertex coordinates. +* @param[out] pNewIndex - Index of the new vertex +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_AddVertexPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF::sPosition * pCoordinates, Lib3MF_uint32 * pNewIndex); + +/** +* Obtains all vertex positions of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pVerticesBuffer - Position buffer of contains the vertex coordinates. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetVerticesPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, Lib3MF::sPosition * pVerticesBuffer); + +/** +* Returns indices of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[out] pIndices - filled with the triangle indices. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetTrianglePtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, Lib3MF::sTriangle * pIndices); + +/** +* Sets the indices of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[in] pIndices - contains the triangle indices. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_SetTrianglePtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const Lib3MF::sTriangle * pIndices); + +/** +* Adds a single triangle to a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] pIndices - contains the triangle indices. +* @param[out] pNewIndex - Index of the new triangle +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_AddTrianglePtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF::sTriangle * pIndices, Lib3MF_uint32 * pNewIndex); + +/** +* Get all triangles of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetTriangleIndicesPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF::sTriangle * pIndicesBuffer); + +/** +* Sets the property at the object-level of the mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nUniqueResourceID - the object-level Property UniqueResourceID. +* @param[in] nPropertyID - the object-level PropertyID. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_SetObjectLevelPropertyPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nUniqueResourceID, Lib3MF_uint32 nPropertyID); + +/** +* Gets the property at the object-level of the mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pUniqueResourceID - the object-level Property UniqueResourceID. +* @param[out] pPropertyID - the object-level PropertyID. +* @param[out] pHasObjectLevelProperty - Has an object-level property been specified? +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetObjectLevelPropertyPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pUniqueResourceID, Lib3MF_uint32 * pPropertyID, bool * pHasObjectLevelProperty); + +/** +* Sets the properties of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[in] pProperties - contains the triangle properties. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_SetTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const Lib3MF::sTriangleProperties * pProperties); + +/** +* Gets the properties of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[out] pProperty - returns the triangle properties. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, Lib3MF::sTriangleProperties * pProperty); + +/** +* Sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer +* @param[in] pPropertiesArrayBuffer - TriangleProperties buffer of contains the triangle properties array. Must have trianglecount elements. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_SetAllTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nPropertiesArrayBufferSize, const Lib3MF::sTriangleProperties * pPropertiesArrayBuffer); + +/** +* Gets the properties of all triangles of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer +* @param[out] pPropertiesArrayNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertiesArrayBuffer - TriangleProperties buffer of returns the triangle properties array. Must have trianglecount elements. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetAllTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nPropertiesArrayBufferSize, Lib3MF_uint64* pPropertiesArrayNeededCount, Lib3MF::sTriangleProperties * pPropertiesArrayBuffer); + +/** +* Clears all properties of this mesh object (triangle and object-level). +* +* @param[in] pMeshObject - MeshObject instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_ClearAllPropertiesPtr) (Lib3MF_MeshObject pMeshObject); + +/** +* Set all triangles of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[in] pVerticesBuffer - Position buffer of contains the positions. +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[in] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_SetGeometryPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nVerticesBufferSize, const Lib3MF::sPosition * pVerticesBuffer, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF::sTriangle * pIndicesBuffer); + +/** +* Retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pIsManifoldAndOriented - returns, if the object is oriented and manifold. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_IsManifoldAndOrientedPtr) (Lib3MF_MeshObject pMeshObject, bool * pIsManifoldAndOriented); + +/** +* Retrieves the BeamLattice within this MeshObject. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pTheBeamLattice - the BeamLattice within this MeshObject +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_BeamLatticePtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_BeamLattice * pTheBeamLattice); + +/************************************************************************************************************************* + Class definition for BeamLattice +**************************************************************************************************************************/ + +/** +* Returns the minimal length of beams for the beamlattice. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pMinLength - minimal length of beams for the beamlattice +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetMinLengthPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_double * pMinLength); + +/** +* Sets the minimal length of beams for the beamlattice. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] dMinLength - minimal length of beams for the beamlattice +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetMinLengthPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_double dMinLength); + +/** +* Returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pClipMode - contains the clip mode of this mesh +* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object or an undefined value if pClipMode is MODELBEAMLATTICECLIPMODE_NONE +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetClippingPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF::eBeamLatticeClipMode * pClipMode, Lib3MF_uint32 * pUniqueResourceID); + +/** +* Sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] eClipMode - contains the clip mode of this mesh +* @param[in] nUniqueResourceID - the UniqueResourceID of the clipping mesh-object. This mesh-object has to be defined before setting the Clipping. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetClippingPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF::eBeamLatticeClipMode eClipMode, Lib3MF_uint32 nUniqueResourceID); + +/** +* Returns the representation-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pHasRepresentation - flag whether the beamlattice has a representation mesh. +* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetRepresentationPtr) (Lib3MF_BeamLattice pBeamLattice, bool * pHasRepresentation, Lib3MF_uint32 * pUniqueResourceID); + +/** +* Sets the representation-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nUniqueResourceID - the UniqueResourceID of the representation mesh-object. This mesh-object has to be defined before setting the representation. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetRepresentationPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nUniqueResourceID); + +/** +* Returns the ball mode and the default ball radius for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pBallMode - contains the ball mode of this mesh +* @param[out] pBallRadius - default ball radius of balls for the beamlattice +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallOptionsPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF::eBeamLatticeBallMode * pBallMode, Lib3MF_double * pBallRadius); + +/** +* Sets the ball mode and thedefault ball radius for the beamlattice. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] eBallMode - contains the ball mode of this mesh +* @param[in] dBallRadius - default ball radius of balls for the beamlattice +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetBallOptionsPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF::eBeamLatticeBallMode eBallMode, Lib3MF_double dBallRadius); + +/** +* Returns the beam count of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pCount - filled with the beam count. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamCountPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); + +/** +* Returns indices, radii and capmodes of a single beam of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the beam (0 to beamcount - 1). +* @param[out] pBeamInfo - filled with the beam indices, radii and capmodes. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF::sBeam * pBeamInfo); + +/** +* Adds a single beam to a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] pBeamInfo - contains the node indices, radii and capmodes. +* @param[out] pIndex - filled with the new Index of the beam. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_AddBeamPtr) (Lib3MF_BeamLattice pBeamLattice, const Lib3MF::sBeam * pBeamInfo, Lib3MF_uint32 * pIndex); + +/** +* Sets the indices, radii and capmodes of a single beam of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the beam (0 to beamcount - 1). +* @param[in] pBeamInfo - filled with the beam indices, radii and capmodes. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetBeamPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const Lib3MF::sBeam * pBeamInfo); + +/** +* Sets all beam indices, radii and capmodes of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBeamInfoBufferSize - Number of elements in buffer +* @param[in] pBeamInfoBuffer - Beam buffer of contains information of a number of beams +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetBeamsPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBeamInfoBufferSize, const Lib3MF::sBeam * pBeamInfoBuffer); + +/** +* obtains all beam indices, radii and capmodes of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBeamInfoBufferSize - Number of elements in buffer +* @param[out] pBeamInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBeamInfoBuffer - Beam buffer of contains information of all beams +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamsPtr) (Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBeamInfoBufferSize, Lib3MF_uint64* pBeamInfoNeededCount, Lib3MF::sBeam * pBeamInfoBuffer); + +/** +* Returns the ball count of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pCount - filled with the ball count. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallCountPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); + +/** +* Returns index and radius of a single ball of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the ball (0 to ballcount - 1). +* @param[out] pBallInfo - filled with the ball node index and radius. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF::sBall * pBallInfo); + +/** +* Adds a single ball to a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] pBallInfo - contains the node index and radius. +* @param[out] pIndex - filled with the new Index of the ball. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_AddBallPtr) (Lib3MF_BeamLattice pBeamLattice, const Lib3MF::sBall * pBallInfo, Lib3MF_uint32 * pIndex); + +/** +* Sets the index and radius of a single ball of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the ball (0 to ballcount - 1). +* @param[in] pBallInfo - filled with the ball node index and radius. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetBallPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const Lib3MF::sBall * pBallInfo); + +/** +* Sets all ball indices and radii of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBallInfoBufferSize - Number of elements in buffer +* @param[in] pBallInfoBuffer - Ball buffer of contains information of a number of balls +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetBallsPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBallInfoBufferSize, const Lib3MF::sBall * pBallInfoBuffer); + +/** +* obtains all ball indices and radii of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBallInfoBufferSize - Number of elements in buffer +* @param[out] pBallInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBallInfoBuffer - Ball buffer of contains information of all balls +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallsPtr) (Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBallInfoBufferSize, Lib3MF_uint64* pBallInfoNeededCount, Lib3MF::sBall * pBallInfoBuffer); + +/** +* Returns the number of beamsets of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pCount - filled with the beamset count. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamSetCountPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); + +/** +* Adds an empty beamset to a mesh object +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pBeamSet - the new beamset +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_AddBeamSetPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_BeamSet * pBeamSet); + +/** +* Returns a beamset of a mesh object +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - index of the requested beamset (0 ... beamsetcount-1). +* @param[out] pBeamSet - the requested beamset +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamSetPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF_BeamSet * pBeamSet); + +/************************************************************************************************************************* + Class definition for Component +**************************************************************************************************************************/ + +/** +* Returns the Resource Instance of the component. +* +* @param[in] pComponent - Component instance. +* @param[out] pObjectResource - filled with the Resource Instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_GetObjectResourcePtr) (Lib3MF_Component pComponent, Lib3MF_Object * pObjectResource); + +/** +* Returns the UniqueResourceID of the component. +* +* @param[in] pComponent - Component instance. +* @param[out] pUniqueResourceID - returns the UniqueResourceID. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_GetObjectResourceIDPtr) (Lib3MF_Component pComponent, Lib3MF_uint32 * pUniqueResourceID); + +/** +* returns, whether a component has a UUID and, if true, the component's UUID +* +* @param[in] pComponent - Component instance. +* @param[out] pHasUUID - flag whether the component has a UUID +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_GetUUIDPtr) (Lib3MF_Component pComponent, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); + +/** +* sets the component's UUID +* +* @param[in] pComponent - Component instance. +* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_SetUUIDPtr) (Lib3MF_Component pComponent, const char * pUUID); + +/** +* Returns, if the component has a different transformation than the identity matrix +* +* @param[in] pComponent - Component instance. +* @param[out] pHasTransform - if true is returned, the transformation is not equal than the identity +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_HasTransformPtr) (Lib3MF_Component pComponent, bool * pHasTransform); + +/** +* Returns the transformation matrix of the component. +* +* @param[in] pComponent - Component instance. +* @param[out] pTransform - filled with the component transformation matrix +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_GetTransformPtr) (Lib3MF_Component pComponent, Lib3MF::sTransform * pTransform); + +/** +* Sets the transformation matrix of the component. +* +* @param[in] pComponent - Component instance. +* @param[in] pTransform - new transformation matrix +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_SetTransformPtr) (Lib3MF_Component pComponent, const Lib3MF::sTransform * pTransform); + +/************************************************************************************************************************* + Class definition for ComponentsObject +**************************************************************************************************************************/ + +/** +* Adds a new component to a components object. +* +* @param[in] pComponentsObject - ComponentsObject instance. +* @param[in] pObjectResource - object to add as component. Must not lead to circular references! +* @param[in] pTransform - optional transform matrix for the component. +* @param[out] pComponentInstance - new component instance +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponentsObject_AddComponentPtr) (Lib3MF_ComponentsObject pComponentsObject, Lib3MF_Object pObjectResource, const Lib3MF::sTransform * pTransform, Lib3MF_Component * pComponentInstance); + +/** +* Retrieves a component from a component object. +* +* @param[in] pComponentsObject - ComponentsObject instance. +* @param[in] nIndex - index of the component to retrieve (0 to componentcount - 1) +* @param[out] pComponentInstance - component instance +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponentsObject_GetComponentPtr) (Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 nIndex, Lib3MF_Component * pComponentInstance); + +/** +* Retrieves a component count of a component object. +* +* @param[in] pComponentsObject - ComponentsObject instance. +* @param[out] pCount - returns the component count +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponentsObject_GetComponentCountPtr) (Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 * pCount); + +/************************************************************************************************************************* + Class definition for BeamSet +**************************************************************************************************************************/ + +/** +* Sets a beamset's name string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] pName - new name of the beamset. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_SetNamePtr) (Lib3MF_BeamSet pBeamSet, const char * pName); + +/** +* Retrieves a beamset's name string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the beamset., may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_GetNamePtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); + +/** +* Sets a beamset's identifier string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] pIdentifier - new name of the beamset. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_SetIdentifierPtr) (Lib3MF_BeamSet pBeamSet, const char * pIdentifier); + +/** +* Retrieves a beamset's identifier string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nIdentifierBufferSize - size of the buffer (including trailing 0) +* @param[out] pIdentifierNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pIdentifierBuffer - buffer of returns the identifier of the beamset., may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_GetIdentifierPtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer); + +/** +* Retrieves the reference count of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[out] pCount - returns the reference count +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_GetReferenceCountPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); + +/** +* Sets the references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nReferencesBufferSize - Number of elements in buffer +* @param[in] pReferencesBuffer - uint32 buffer of the new indices of all beams in this beamset +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_SetReferencesPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nReferencesBufferSize, const Lib3MF_uint32 * pReferencesBuffer); + +/** +* Retrieves the references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nReferencesBufferSize - Number of elements in buffer +* @param[out] pReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pReferencesBuffer - uint32 buffer of retrieves the indices of all beams in this beamset +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_GetReferencesPtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nReferencesBufferSize, Lib3MF_uint64* pReferencesNeededCount, Lib3MF_uint32 * pReferencesBuffer); + +/** +* Retrieves the ball reference count of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[out] pCount - returns the ball reference count +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_GetBallReferenceCountPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); + +/** +* Sets the ball references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nBallReferencesBufferSize - Number of elements in buffer +* @param[in] pBallReferencesBuffer - uint32 buffer of the new indices of all balls in this beamset +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_SetBallReferencesPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nBallReferencesBufferSize, const Lib3MF_uint32 * pBallReferencesBuffer); + +/** +* Retrieves the ball references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nBallReferencesBufferSize - Number of elements in buffer +* @param[out] pBallReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBallReferencesBuffer - uint32 buffer of retrieves the indices of all balls in this beamset +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_GetBallReferencesPtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nBallReferencesBufferSize, Lib3MF_uint64* pBallReferencesNeededCount, Lib3MF_uint32 * pBallReferencesBuffer); + +/************************************************************************************************************************* + Class definition for BaseMaterialGroup +**************************************************************************************************************************/ + +/** +* Retrieves the count of base materials in the material group. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[out] pCount - returns the count of base materials. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetCountPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all materials in this group +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the material in the material group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetAllPropertyIDsPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Adds a new material to the material group +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] pName - new name of the base material. +* @param[in] pDisplayColor - Display color of the material +* @param[out] pPropertyID - returns new PropertyID of the new material in the material group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_AddMaterialPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const char * pName, const Lib3MF::sColor * pDisplayColor, Lib3MF_uint32 * pPropertyID); + +/** +* Removes a material from the material group. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_RemoveMaterialPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID); + +/** +* Returns the base material's name +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the base material., may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetNamePtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); + +/** +* Sets a base material's name +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] pName - new name of the base material. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_SetNamePtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const char * pName); + +/** +* Sets a base material's display color. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] pTheColor - The base material's display color +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_SetDisplayColorPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF::sColor * pTheColor); + +/** +* Returns a base material's display color. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[out] pTheColor - The base material's display color +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetDisplayColorPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, Lib3MF::sColor * pTheColor); + +/************************************************************************************************************************* + Class definition for ColorGroup +**************************************************************************************************************************/ + +/** +* Retrieves the count of base materials in this Color Group. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[out] pCount - returns the count of colors within this color group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFColorGroup_GetCountPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all colors within this group +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the color in the color group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFColorGroup_GetAllPropertyIDsPtr) (Lib3MF_ColorGroup pColorGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Adds a new value. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] pTheColor - The new color +* @param[out] pPropertyID - PropertyID of the new color within this color group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFColorGroup_AddColorPtr) (Lib3MF_ColorGroup pColorGroup, const Lib3MF::sColor * pTheColor, Lib3MF_uint32 * pPropertyID); + +/** +* Removes a color from the color group. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyID - PropertyID of the color to be removed from the color group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFColorGroup_RemoveColorPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID); + +/** +* Sets a color value. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyID - PropertyID of a color within this color group. +* @param[in] pTheColor - The color +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFColorGroup_SetColorPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, const Lib3MF::sColor * pTheColor); + +/** +* Sets a color value. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyID - PropertyID of a color within this color group. +* @param[out] pTheColor - The color +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFColorGroup_GetColorPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, Lib3MF::sColor * pTheColor); + +/************************************************************************************************************************* + Class definition for Texture2DGroup +**************************************************************************************************************************/ + +/** +* Retrieves the count of tex2coords in the Texture2DGroup. +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[out] pCount - returns the count of tex2coords. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetCountPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all tex2coords in this Texture2DGroup +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the tex2coords in the Texture2DGroup. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetAllPropertyIDsPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Adds a new tex2coord to the Texture2DGroup +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. +* @param[out] pPropertyID - returns new PropertyID of the new tex2coord in the Texture2DGroup. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFTexture2DGroup_AddTex2CoordPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF::sTex2Coord * pUVCoordinate, Lib3MF_uint32 * pPropertyID); + +/** +* Obtains a tex2coord to the Texture2DGroup +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] nPropertyID - the PropertyID of the tex2coord in the Texture2DGroup. +* @param[out] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetTex2CoordPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID, Lib3MF::sTex2Coord * pUVCoordinate); + +/** +* Removes a tex2coords from the Texture2DGroup. +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] nPropertyID - PropertyID of the tex2coords in the Texture2DGroup. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFTexture2DGroup_RemoveTex2CoordPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID); + +/** +* Obtains the texture2D instance of this group. +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[out] pTexture2DInstance - the texture2D instance of this group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetTexture2DPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_Texture2D * pTexture2DInstance); + +/************************************************************************************************************************* + Class definition for CompositeMaterials +**************************************************************************************************************************/ + +/** +* Retrieves the count of Composite-s in the CompositeMaterials. +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[out] pCount - returns the count of Composite-s +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetCountPtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the Composite-Mixing Values in the CompositeMaterials. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetAllPropertyIDsPtr) (Lib3MF_CompositeMaterials pCompositeMaterials, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Obtains the BaseMaterialGroup instance of this CompositeMaterials. +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[out] pBaseMaterialGroupInstance - returns the BaseMaterialGroup instance of this CompositeMaterials +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetBaseMaterialGroupPtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance); + +/** +* Adds a new Composite-Mixing Values to the CompositeMaterials. +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nCompositeBufferSize - Number of elements in buffer +* @param[in] pCompositeBuffer - CompositeConstituent buffer of The Composite Constituents to be added as composite +* @param[out] pPropertyID - returns new PropertyID of the new Composite in the CompositeMaterials. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCompositeMaterials_AddCompositePtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint64 nCompositeBufferSize, const Lib3MF::sCompositeConstituent * pCompositeBuffer, Lib3MF_uint32 * pPropertyID); /** -* obtains all beam indices, radii and capmodes of a mesh object. +* Removes a Composite-Maxing Ratio from the CompositeMaterials. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBeamInfoBufferSize - Number of elements in buffer -* @param[out] pBeamInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBeamInfoBuffer - Beam buffer of contains information of all beams +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nPropertyID - PropertyID of the Composite-Mixing Values in the CompositeMaterials to be removed. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamsPtr) (Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBeamInfoBufferSize, Lib3MF_uint64* pBeamInfoNeededCount, Lib3MF::sBeam * pBeamInfoBuffer); +typedef Lib3MFResult (*PLib3MFCompositeMaterials_RemoveCompositePtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID); /** -* Returns the ball count of a mesh object. +* Obtains a Composite-Maxing Ratio of this CompositeMaterials. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pCount - filled with the ball count. +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nPropertyID - the PropertyID of the Composite-Maxing Ratio in the CompositeMaterials. +* @param[in] nCompositeBufferSize - Number of elements in buffer +* @param[out] pCompositeNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pCompositeBuffer - CompositeConstituent buffer of The Composite-Mixing Values with the given PropertyID * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallCountPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetCompositePtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nCompositeBufferSize, Lib3MF_uint64* pCompositeNeededCount, Lib3MF::sCompositeConstituent * pCompositeBuffer); + +/************************************************************************************************************************* + Class definition for MultiPropertyGroup +**************************************************************************************************************************/ /** -* Returns index and radius of a single ball of a mesh object. +* Retrieves the count of MultiProperty-s in the MultiPropertyGroup. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the ball (0 to ballcount - 1). -* @param[out] pBallInfo - filled with the ball node index and radius. +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[out] pCount - returns the count of MultiProperty-s * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF::sBall * pBallInfo); +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetCountPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); /** -* Adds a single ball to a mesh object. +* returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] pBallInfo - contains the node index and radius. -* @param[out] pIndex - filled with the new Index of the ball. +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the MultiProperty-s in the MultiPropertyGroup. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_AddBallPtr) (Lib3MF_BeamLattice pBeamLattice, const Lib3MF::sBall * pBallInfo, Lib3MF_uint32 * pIndex); +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetAllPropertyIDsPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); /** -* Sets the index and radius of a single ball of a mesh object. +* Adds a new MultiProperty to the MultiPropertyGroup. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the ball (0 to ballcount - 1). -* @param[in] pBallInfo - filled with the ball node index and radius. +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[in] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the new MultiProperty. +* @param[out] pPropertyID - returns the PropertyID of the new MultiProperty in the MultiPropertyGroup. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetBallPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const Lib3MF::sBall * pBallInfo); +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_AddMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer, Lib3MF_uint32 * pPropertyID); /** -* Sets all ball indices and radii of a mesh object. +* Sets the PropertyIDs of a MultiProperty. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBallInfoBufferSize - Number of elements in buffer -* @param[in] pBallInfoBuffer - Ball buffer of contains information of a number of balls +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyID - the PropertyID of the MultiProperty to be changed. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[in] pPropertyIDsBuffer - uint32 buffer of The new PropertyIDs of the MultiProperty * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetBallsPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBallInfoBufferSize, const Lib3MF::sBall * pBallInfoBuffer); +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_SetMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer); /** -* obtains all ball indices and radii of a mesh object. +* Obtains the PropertyIDs of a MultiProperty. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBallInfoBufferSize - Number of elements in buffer -* @param[out] pBallInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBallInfoBuffer - Ball buffer of contains information of all balls +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyID - the PropertyID of the MultiProperty to be queried. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the MultiProperty +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Removes a MultiProperty from this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyID - the PropertyID of the MultiProperty to be removed. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_RemoveMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID); + +/** +* Retrieves the number of layers of this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[out] pCount - returns the number of layers +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetLayerCountPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); + +/** +* Adds a MultiPropertyLayer to this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] pTheLayer - The MultiPropertyLayer to add to this MultiPropertyGroup +* @param[out] pLayerIndex - returns the index of this MultiPropertyLayer +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_AddLayerPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF::sMultiPropertyLayer * pTheLayer, Lib3MF_uint32 * pLayerIndex); + +/** +* Obtains a MultiPropertyLayer of this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nLayerIndex - The Index of the MultiPropertyLayer queried +* @param[out] pTheLayer - The MultiPropertyLayer with index LayerIndex within MultiPropertyGroup +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetLayerPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex, Lib3MF::sMultiPropertyLayer * pTheLayer); + +/** +* Removes a MultiPropertyLayer from this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nLayerIndex - The Index of the MultiPropertyLayer to be removed +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_RemoveLayerPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex); + +/************************************************************************************************************************* + Class definition for Attachment +**************************************************************************************************************************/ + +/** +* Retrieves an attachment's package path. This function will be removed in a later release. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of returns the attachment's package path string, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_GetPathPtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Sets an attachment's package path. This function will be removed in a later release. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pPath - new path of the attachment. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_SetPathPtr) (Lib3MF_Attachment pAttachment, const char * pPath); + +/** +* Returns the PackagePart that is this attachment. +* +* @param[in] pAttachment - Attachment instance. +* @param[out] pPackagePart - The PackagePart of this attachment. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_PackagePartPtr) (Lib3MF_Attachment pAttachment, Lib3MF_PackagePart * pPackagePart); + +/** +* Retrieves an attachment's relationship type +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of returns the attachment's package relationship type string, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_GetRelationShipTypePtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Sets an attachment's relationship type. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pPath - new relationship type string. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_SetRelationShipTypePtr) (Lib3MF_Attachment pAttachment, const char * pPath); + +/** +* Writes out the attachment as file. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pFileName - file to write into. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_WriteToFilePtr) (Lib3MF_Attachment pAttachment, const char * pFileName); + +/** +* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pFileName - file to read from. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_ReadFromFilePtr) (Lib3MF_Attachment pAttachment, const char * pFileName); + +/** +* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pTheReadCallback - Callback to call for reading a data chunk +* @param[in] nStreamSize - number of bytes the callback returns +* @param[in] pTheSeekCallback - Callback to call for seeking in the stream. +* @param[in] pUserData - Userdata that is passed to the callback function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_ReadFromCallbackPtr) (Lib3MF_Attachment pAttachment, Lib3MF::ReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MF::SeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData); + +/** +* Retrieves the size of the attachment stream +* +* @param[in] pAttachment - Attachment instance. +* @param[out] pStreamSize - the stream size +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_GetStreamSizePtr) (Lib3MF_Attachment pAttachment, Lib3MF_uint64 * pStreamSize); + +/** +* Writes out the attachment into a buffer +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nBufferBufferSize - Number of elements in buffer +* @param[out] pBufferNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBufferBuffer - uint8 buffer of Buffer to write into +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_WriteToBufferPtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer); + +/** +* Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nBufferBufferSize - Number of elements in buffer +* @param[in] pBufferBuffer - uint8 buffer of Buffer to read from +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_ReadFromBufferPtr) (Lib3MF_Attachment pAttachment, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer); + +/************************************************************************************************************************* + Class definition for Texture2D +**************************************************************************************************************************/ + +/** +* Retrieves the attachment located at the path of the texture. +* +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pAttachment - attachment that holds the texture's image information. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallsPtr) (Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBallInfoBufferSize, Lib3MF_uint64* pBallInfoNeededCount, Lib3MF::sBall * pBallInfoBuffer); +typedef Lib3MFResult (*PLib3MFTexture2D_GetAttachmentPtr) (Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment * pAttachment); /** -* Returns the number of beamsets of a mesh object. +* Sets the texture's package path to the path of the attachment. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pCount - filled with the beamset count. +* @param[in] pTexture2D - Texture2D instance. +* @param[in] pAttachment - attachment that holds the texture's image information. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamSetCountPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFTexture2D_SetAttachmentPtr) (Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment pAttachment); /** -* Adds an empty beamset to a mesh object +* Retrieves a texture's content type. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pBeamSet - the new beamset +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pContentType - returns content type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_AddBeamSetPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_BeamSet * pBeamSet); +typedef Lib3MFResult (*PLib3MFTexture2D_GetContentTypePtr) (Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureType * pContentType); /** -* Returns a beamset of a mesh object +* Retrieves a texture's content type. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - index of the requested beamset (0 ... beamsetcount-1). -* @param[out] pBeamSet - the requested beamset +* @param[in] pTexture2D - Texture2D instance. +* @param[in] eContentType - new Content Type * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamSetPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF_BeamSet * pBeamSet); - -/************************************************************************************************************************* - Class definition for Component -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFTexture2D_SetContentTypePtr) (Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureType eContentType); /** -* Returns the Resource Instance of the component. +* Retrieves a texture's tilestyle type. * -* @param[in] pComponent - Component instance. -* @param[out] pObjectResource - filled with the Resource Instance. +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pTileStyleU - returns tilestyle type enum. +* @param[out] pTileStyleV - returns tilestyle type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_GetObjectResourcePtr) (Lib3MF_Component pComponent, Lib3MF_Object * pObjectResource); +typedef Lib3MFResult (*PLib3MFTexture2D_GetTileStyleUVPtr) (Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureTileStyle * pTileStyleU, Lib3MF::eTextureTileStyle * pTileStyleV); /** -* Returns the UniqueResourceID of the component. +* Sets a texture's tilestyle type. * -* @param[in] pComponent - Component instance. -* @param[out] pUniqueResourceID - returns the UniqueResourceID. +* @param[in] pTexture2D - Texture2D instance. +* @param[in] eTileStyleU - new tilestyle type enum. +* @param[in] eTileStyleV - new tilestyle type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_GetObjectResourceIDPtr) (Lib3MF_Component pComponent, Lib3MF_uint32 * pUniqueResourceID); +typedef Lib3MFResult (*PLib3MFTexture2D_SetTileStyleUVPtr) (Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureTileStyle eTileStyleU, Lib3MF::eTextureTileStyle eTileStyleV); /** -* returns, whether a component has a UUID and, if true, the component's UUID +* Retrieves a texture's filter type. * -* @param[in] pComponent - Component instance. -* @param[out] pHasUUID - flag whether the component has a UUID -* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pFilter - returns filter type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_GetUUIDPtr) (Lib3MF_Component pComponent, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); +typedef Lib3MFResult (*PLib3MFTexture2D_GetFilterPtr) (Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureFilter * pFilter); /** -* sets the component's UUID +* Sets a texture's filter type. * -* @param[in] pComponent - Component instance. -* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' +* @param[in] pTexture2D - Texture2D instance. +* @param[in] eFilter - sets new filter type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_SetUUIDPtr) (Lib3MF_Component pComponent, const char * pUUID); +typedef Lib3MFResult (*PLib3MFTexture2D_SetFilterPtr) (Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureFilter eFilter); + +/************************************************************************************************************************* + Class definition for BuildItem +**************************************************************************************************************************/ /** -* Returns, if the component has a different transformation than the identity matrix +* Retrieves the object resource associated to a build item * -* @param[in] pComponent - Component instance. -* @param[out] pHasTransform - if true is returned, the transformation is not equal than the identity +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pObjectResource - returns the associated resource instance * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_HasTransformPtr) (Lib3MF_Component pComponent, bool * pHasTransform); +typedef Lib3MFResult (*PLib3MFBuildItem_GetObjectResourcePtr) (Lib3MF_BuildItem pBuildItem, Lib3MF_Object * pObjectResource); /** -* Returns the transformation matrix of the component. +* returns, whether a build item has a UUID and, if true, the build item's UUID * -* @param[in] pComponent - Component instance. -* @param[out] pTransform - filled with the component transformation matrix +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pHasUUID - flag whether the build item has a UUID +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_GetTransformPtr) (Lib3MF_Component pComponent, Lib3MF::sTransform * pTransform); +typedef Lib3MFResult (*PLib3MFBuildItem_GetUUIDPtr) (Lib3MF_BuildItem pBuildItem, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* Sets the transformation matrix of the component. +* sets the build item's UUID * -* @param[in] pComponent - Component instance. -* @param[in] pTransform - new transformation matrix +* @param[in] pBuildItem - BuildItem instance. +* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_SetTransformPtr) (Lib3MF_Component pComponent, const Lib3MF::sTransform * pTransform); - -/************************************************************************************************************************* - Class definition for ComponentsObject -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFBuildItem_SetUUIDPtr) (Lib3MF_BuildItem pBuildItem, const char * pUUID); /** -* Adds a new component to a components object. +* Retrieves the object UniqueResourceID associated to a build item * -* @param[in] pComponentsObject - ComponentsObject instance. -* @param[in] pObjectResource - object to add as component. Must not lead to circular references! -* @param[in] pTransform - optional transform matrix for the component. -* @param[out] pComponentInstance - new component instance +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pUniqueResourceID - returns the UniqueResourceID of the object * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponentsObject_AddComponentPtr) (Lib3MF_ComponentsObject pComponentsObject, Lib3MF_Object pObjectResource, const Lib3MF::sTransform * pTransform, Lib3MF_Component * pComponentInstance); +typedef Lib3MFResult (*PLib3MFBuildItem_GetObjectResourceIDPtr) (Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pUniqueResourceID); /** -* Retrieves a component from a component object. +* Checks, if a build item has a non-identity transformation matrix * -* @param[in] pComponentsObject - ComponentsObject instance. -* @param[in] nIndex - index of the component to retrieve (0 to componentcount - 1) -* @param[out] pComponentInstance - component instance +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pHasTransform - returns true, if the transformation matrix is not the identity * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponentsObject_GetComponentPtr) (Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 nIndex, Lib3MF_Component * pComponentInstance); +typedef Lib3MFResult (*PLib3MFBuildItem_HasObjectTransformPtr) (Lib3MF_BuildItem pBuildItem, bool * pHasTransform); /** -* Retrieves a component count of a component object. +* Retrieves a build item's transformation matrix. * -* @param[in] pComponentsObject - ComponentsObject instance. -* @param[out] pCount - returns the component count +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pTransform - returns the transformation matrix * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponentsObject_GetComponentCountPtr) (Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 * pCount); - -/************************************************************************************************************************* - Class definition for BeamSet -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFBuildItem_GetObjectTransformPtr) (Lib3MF_BuildItem pBuildItem, Lib3MF::sTransform * pTransform); /** -* Sets a beamset's name string +* Sets a build item's transformation matrix. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] pName - new name of the beamset. +* @param[in] pBuildItem - BuildItem instance. +* @param[in] pTransform - new transformation matrix * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_SetNamePtr) (Lib3MF_BeamSet pBeamSet, const char * pName); +typedef Lib3MFResult (*PLib3MFBuildItem_SetObjectTransformPtr) (Lib3MF_BuildItem pBuildItem, const Lib3MF::sTransform * pTransform); /** -* Retrieves a beamset's name string +* Retrieves a build item's part number string * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of returns the name of the beamset., may be NULL +* @param[in] pBuildItem - BuildItem instance. +* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartNumberBuffer - buffer of Returns a build item's part number string, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_GetNamePtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +typedef Lib3MFResult (*PLib3MFBuildItem_GetPartNumberPtr) (Lib3MF_BuildItem pBuildItem, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); /** -* Sets a beamset's identifier string +* Sets a build item's part number string * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] pIdentifier - new name of the beamset. +* @param[in] pBuildItem - BuildItem instance. +* @param[in] pSetPartnumber - new part number string for referencing parts from the outside world * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_SetIdentifierPtr) (Lib3MF_BeamSet pBeamSet, const char * pIdentifier); +typedef Lib3MFResult (*PLib3MFBuildItem_SetPartNumberPtr) (Lib3MF_BuildItem pBuildItem, const char * pSetPartnumber); /** -* Retrieves a beamset's identifier string +* Returns the metadatagroup of this build item * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nIdentifierBufferSize - size of the buffer (including trailing 0) -* @param[out] pIdentifierNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pIdentifierBuffer - buffer of returns the identifier of the beamset., may be NULL +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this build item * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_GetIdentifierPtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer); +typedef Lib3MFResult (*PLib3MFBuildItem_GetMetaDataGroupPtr) (Lib3MF_BuildItem pBuildItem, Lib3MF_MetaDataGroup * pMetaDataGroup); /** -* Retrieves the reference count of a beamset +* Returns the outbox of a build item * -* @param[in] pBeamSet - BeamSet instance. -* @param[out] pCount - returns the reference count +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pOutbox - Outbox of this build item * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_GetReferenceCountPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFBuildItem_GetOutboxPtr) (Lib3MF_BuildItem pBuildItem, Lib3MF::sBox * pOutbox); + +/************************************************************************************************************************* + Class definition for BuildItemIterator +**************************************************************************************************************************/ /** -* Sets the references of a beamset +* Iterates to the next build item in the list. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nReferencesBufferSize - Number of elements in buffer -* @param[in] pReferencesBuffer - uint32 buffer of the new indices of all beams in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pHasNext - Iterates to the next build item in the list. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_SetReferencesPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nReferencesBufferSize, const Lib3MF_uint32 * pReferencesBuffer); +typedef Lib3MFResult (*PLib3MFBuildItemIterator_MoveNextPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasNext); /** -* Retrieves the references of a beamset +* Iterates to the previous build item in the list. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nReferencesBufferSize - Number of elements in buffer -* @param[out] pReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pReferencesBuffer - uint32 buffer of retrieves the indices of all beams in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pHasPrevious - Iterates to the previous build item in the list. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_GetReferencesPtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nReferencesBufferSize, Lib3MF_uint64* pReferencesNeededCount, Lib3MF_uint32 * pReferencesBuffer); +typedef Lib3MFResult (*PLib3MFBuildItemIterator_MovePreviousPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasPrevious); /** -* Retrieves the ball reference count of a beamset +* Returns the build item the iterator points at. * -* @param[in] pBeamSet - BeamSet instance. -* @param[out] pCount - returns the ball reference count +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pBuildItem - returns the build item instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_GetBallReferenceCountPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFBuildItemIterator_GetCurrentPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItem * pBuildItem); /** -* Sets the ball references of a beamset +* Creates a new build item iterator with the same build item list. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nBallReferencesBufferSize - Number of elements in buffer -* @param[in] pBallReferencesBuffer - uint32 buffer of the new indices of all balls in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pOutBuildItemIterator - returns the cloned Iterator instance * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_SetBallReferencesPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nBallReferencesBufferSize, const Lib3MF_uint32 * pBallReferencesBuffer); +typedef Lib3MFResult (*PLib3MFBuildItemIterator_ClonePtr) (Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItemIterator * pOutBuildItemIterator); /** -* Retrieves the ball references of a beamset +* Returns the number of build items the iterator captures. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nBallReferencesBufferSize - Number of elements in buffer -* @param[out] pBallReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBallReferencesBuffer - uint32 buffer of retrieves the indices of all balls in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pCount - returns the number of build items the iterator captures. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_GetBallReferencesPtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nBallReferencesBufferSize, Lib3MF_uint64* pBallReferencesNeededCount, Lib3MF_uint32 * pBallReferencesBuffer); +typedef Lib3MFResult (*PLib3MFBuildItemIterator_CountPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_uint64 * pCount); /************************************************************************************************************************* - Class definition for BaseMaterialGroup + Class definition for Slice **************************************************************************************************************************/ /** -* Retrieves the count of base materials in the material group. +* Set all vertices of a slice. All polygons will be cleared. * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[out] pCount - returns the count of base materials. +* @param[in] pSlice - Slice instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[in] pVerticesBuffer - Position2D buffer of contains the positions. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetCountPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFSlice_SetVerticesPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nVerticesBufferSize, const Lib3MF::sPosition2D * pVerticesBuffer); /** -* returns all the PropertyIDs of all materials in this group +* Get all vertices of a slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the material in the material group. +* @param[in] pSlice - Slice instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pVerticesBuffer - Position2D buffer of contains the positions. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFSlice_GetVerticesPtr) (Lib3MF_Slice pSlice, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, Lib3MF::sPosition2D * pVerticesBuffer); + +/** +* Get the number of vertices in a slice +* +* @param[in] pSlice - Slice instance. +* @param[out] pCount - the number of vertices in the slice * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetAllPropertyIDsPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFSlice_GetVertexCountPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); /** -* Adds a new material to the material group +* Add a new polygon to this slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] pName - new name of the base material. -* @param[in] pDisplayColor - Display color of the material -* @param[out] pPropertyID - returns new PropertyID of the new material in the material group. +* @param[in] pSlice - Slice instance. +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the new polygon +* @param[out] pIndex - the index of the new polygon * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_AddMaterialPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const char * pName, const Lib3MF::sColor * pDisplayColor, Lib3MF_uint32 * pPropertyID); +typedef Lib3MFResult (*PLib3MFSlice_AddPolygonPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer, Lib3MF_uint64 * pIndex); /** -* Removes a material from the material group. +* Get the number of polygons in the slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] pSlice - Slice instance. +* @param[out] pCount - the number of polygons in the slice * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_RemoveMaterialPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID); +typedef Lib3MFResult (*PLib3MFSlice_GetPolygonCountPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); /** -* Returns the base material's name +* Set all indices of a polygon * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of returns the name of the base material., may be NULL +* @param[in] pSlice - Slice instance. +* @param[in] nIndex - the index of the polygon to manipulate +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the index-th polygon * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetNamePtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +typedef Lib3MFResult (*PLib3MFSlice_SetPolygonIndicesPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer); /** -* Sets a base material's name +* Get all vertices of a slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[in] pName - new name of the base material. +* @param[in] pSlice - Slice instance. +* @param[in] nIndex - the index of the polygon to manipulate +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pIndicesBuffer - uint32 buffer of the indices of the index-th polygon * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_SetNamePtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const char * pName); +typedef Lib3MFResult (*PLib3MFSlice_GetPolygonIndicesPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF_uint32 * pIndicesBuffer); /** -* Sets a base material's display color. +* Get the number of vertices in a slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[in] pTheColor - The base material's display color +* @param[in] pSlice - Slice instance. +* @param[in] nIndex - the index of the polygon to manipulate +* @param[out] pCount - the number of indices of the index-th polygon * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_SetDisplayColorPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF::sColor * pTheColor); +typedef Lib3MFResult (*PLib3MFSlice_GetPolygonIndexCountPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 * pCount); /** -* Returns a base material's display color. +* Get the upper Z-Coordinate of this slice. * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[out] pTheColor - The base material's display color +* @param[in] pSlice - Slice instance. +* @param[out] pZTop - the upper Z-Coordinate of this slice * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetDisplayColorPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, Lib3MF::sColor * pTheColor); +typedef Lib3MFResult (*PLib3MFSlice_GetZTopPtr) (Lib3MF_Slice pSlice, Lib3MF_double * pZTop); /************************************************************************************************************************* - Class definition for ColorGroup + Class definition for ToolpathProfile **************************************************************************************************************************/ /** -* Retrieves the count of base materials in this Color Group. +* Retrieves the profile's uuid * -* @param[in] pColorGroup - ColorGroup instance. -* @param[out] pCount - returns the count of colors within this color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroup_GetCountPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetUUIDPtr) (Lib3MF_ToolpathProfile pToolpathProfile, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* returns all the PropertyIDs of all colors within this group +* Retrieves the profile's name * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the color in the color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of Returns the name., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroup_GetAllPropertyIDsPtr) (Lib3MF_ColorGroup pColorGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetNamePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Adds a new value. +* Returns the number of parameters. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] pTheColor - The new color -* @param[out] pPropertyID - PropertyID of the new color within this color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[out] pCount - Returns the number of parameters. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroup_AddColorPtr) (Lib3MF_ColorGroup pColorGroup, const Lib3MF::sColor * pTheColor, Lib3MF_uint32 * pPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterCountPtr) (Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 * pCount); /** -* Removes a color from the color group. +* Returns the Name of a parameter. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyID - PropertyID of the color to be removed from the color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nIndex - Index of Parameter (0-based). Call will fail if an invalid index is given. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of Returns the name of the parameter., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroup_RemoveColorPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterNamePtr) (Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Sets a color value. +* Returns the NameSpace of a parameter. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyID - PropertyID of a color within this color group. -* @param[in] pTheColor - The color +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nIndex - Index of Parameter (0-based). Call will fail if an invalid index is given. +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of Returns the namespace of the parameter., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroup_SetColorPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, const Lib3MF::sColor * pTheColor); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterNameSpacePtr) (Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* Sets a color value. +* Checks if a parameter value exists. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyID - PropertyID of a color within this color group. -* @param[out] pTheColor - The color +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValueExists - Returns if a value exists. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroup_GetColorPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, Lib3MF::sColor * pTheColor); - -/************************************************************************************************************************* - Class definition for Texture2DGroup -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpathProfile_HasParameterValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool * pValueExists); /** -* Retrieves the count of tex2coords in the Texture2DGroup. +* Retrieves a profile's parameter value. Fails if value does not exist. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[out] pCount - returns the count of tex2coords. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of Returns the value of the field., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetCountPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* returns all the PropertyIDs of all tex2coords in this Texture2DGroup +* Retrieves a profile's parameter value * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the tex2coords in the Texture2DGroup. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] pDefaultValue - Default value if value does not exist. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of Returns the value of the field., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetAllPropertyIDsPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterValueDefPtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const char * pDefaultValue, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* Adds a new tex2coord to the Texture2DGroup +* Retrieves a profile's parameter value as double. Fails if value does not exist or is not a double value. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. -* @param[out] pPropertyID - returns new PropertyID of the new tex2coord in the Texture2DGroup. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroup_AddTex2CoordPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF::sTex2Coord * pUVCoordinate, Lib3MF_uint32 * pPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterDoubleValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double * pValue); /** -* Obtains a tex2coord to the Texture2DGroup +* Retrieves a profile's parameter value as double. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] nPropertyID - the PropertyID of the tex2coord in the Texture2DGroup. -* @param[out] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] dDefaultValue - Default value if value does not exist or is not a double value. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetTex2CoordPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID, Lib3MF::sTex2Coord * pUVCoordinate); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterDoubleValueDefPtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double dDefaultValue, Lib3MF_double * pValue); /** -* Removes a tex2coords from the Texture2DGroup. +* Retrieves a profile's parameter value as integer. Fails if value does not exist or is not a integer value. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] nPropertyID - PropertyID of the tex2coords in the Texture2DGroup. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroup_RemoveTex2CoordPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterIntegerValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 * pValue); /** -* Obtains the texture2D instance of this group. +* Retrieves a profile's parameter value as integer. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[out] pTexture2DInstance - the texture2D instance of this group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] nDefaultValue - Default value if value does not exist or is not a integer value. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetTexture2DPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_Texture2D * pTexture2DInstance); - -/************************************************************************************************************************* - Class definition for CompositeMaterials -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterIntegerValueDefPtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 nDefaultValue, Lib3MF_int64 * pValue); /** -* Retrieves the count of Composite-s in the CompositeMaterials. +* Retrieves a profile's parameter value as boolean. Fails if value does not exist or is not a boolean value. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[out] pCount - returns the count of Composite-s +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetCountPtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterBoolValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool * pValue); /** -* returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials +* Retrieves a profile's parameter value as boolean. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the Composite-Mixing Values in the CompositeMaterials. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] bDefaultValue - Default value if value does not exist or is not a boolean value. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetAllPropertyIDsPtr) (Lib3MF_CompositeMaterials pCompositeMaterials, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterBoolValueDefPtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool bDefaultValue, bool * pValue); /** -* Obtains the BaseMaterialGroup instance of this CompositeMaterials. +* Sets the profile's name * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[out] pBaseMaterialGroupInstance - returns the BaseMaterialGroup instance of this CompositeMaterials +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pName - Returns the name. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetBaseMaterialGroupPtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance); +typedef Lib3MFResult (*PLib3MFToolpathProfile_SetNamePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pName); /** -* Adds a new Composite-Mixing Values to the CompositeMaterials. +* Sets a profile's parameter value. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nCompositeBufferSize - Number of elements in buffer -* @param[in] pCompositeBuffer - CompositeConstituent buffer of The Composite Constituents to be added as composite -* @param[out] pPropertyID - returns new PropertyID of the new Composite in the CompositeMaterials. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] pValue - String value of the parameter. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterials_AddCompositePtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint64 nCompositeBufferSize, const Lib3MF::sCompositeConstituent * pCompositeBuffer, Lib3MF_uint32 * pPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathProfile_SetParameterValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const char * pValue); /** -* Removes a Composite-Maxing Ratio from the CompositeMaterials. +* Sets a profile's parameter value as double. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nPropertyID - PropertyID of the Composite-Mixing Values in the CompositeMaterials to be removed. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] dValue - Double value of the parameter. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterials_RemoveCompositePtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathProfile_SetParameterDoubleValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double dValue); /** -* Obtains a Composite-Maxing Ratio of this CompositeMaterials. +* Sets a profile's parameter value as integer. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nPropertyID - the PropertyID of the Composite-Maxing Ratio in the CompositeMaterials. -* @param[in] nCompositeBufferSize - Number of elements in buffer -* @param[out] pCompositeNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pCompositeBuffer - CompositeConstituent buffer of The Composite-Mixing Values with the given PropertyID +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] nValue - Integer value of the parameter. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetCompositePtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nCompositeBufferSize, Lib3MF_uint64* pCompositeNeededCount, Lib3MF::sCompositeConstituent * pCompositeBuffer); - -/************************************************************************************************************************* - Class definition for MultiPropertyGroup -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpathProfile_SetParameterIntegerValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 nValue); /** -* Retrieves the count of MultiProperty-s in the MultiPropertyGroup. +* Sets a profile's parameter value as boolean. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[out] pCount - returns the count of MultiProperty-s +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] bValue - Boolean value of the parameter. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetCountPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFToolpathProfile_SetParameterBoolValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool bValue); + +/************************************************************************************************************************* + Class definition for ToolpathLayerReader +**************************************************************************************************************************/ /** -* returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup +* Retrieves the layerdata's uuid * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the MultiProperty-s in the MultiPropertyGroup. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetAllPropertyIDsPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetLayerDataUUIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* Adds a new MultiProperty to the MultiPropertyGroup. +* Retrieves the count of segments. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[in] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the new MultiProperty. -* @param[out] pPropertyID - returns the PropertyID of the new MultiProperty in the MultiPropertyGroup. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[out] pCount - Count * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_AddMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer, Lib3MF_uint32 * pPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentCountPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 * pCount); /** -* Sets the PropertyIDs of a MultiProperty. +* Retrieves the segment type information . * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyID - the PropertyID of the MultiProperty to be changed. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[in] pPropertyIDsBuffer - uint32 buffer of The new PropertyIDs of the MultiProperty +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pType - Segment Type +* @param[out] pPointCount - Point count of segment. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_SetMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentInfoPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF::eToolpathSegmentType * pType, Lib3MF_uint32 * pPointCount); /** -* Obtains the PropertyIDs of a MultiProperty. +* Retrieves the assigned segment profile. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyID - the PropertyID of the MultiProperty to be queried. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the MultiProperty +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pProfile - Segment Profile * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentProfilePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_ToolpathProfile * pProfile); /** -* Removes a MultiProperty from this MultiPropertyGroup. +* Retrieves the assigned segment profile uuid. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyID - the PropertyID of the MultiProperty to be removed. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[in] nProfileUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pProfileUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pProfileUUIDBuffer - buffer of Segment Profile UUID, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_RemoveMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentProfileUUIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nProfileUUIDBufferSize, Lib3MF_uint32* pProfileUUIDNeededChars, char * pProfileUUIDBuffer); /** -* Retrieves the number of layers of this MultiPropertyGroup. +* Retrieves the assigned segment profile. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[out] pCount - returns the number of layers +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pBuildItem - Segment Build Item * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetLayerCountPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentPartPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_BuildItem * pBuildItem); /** -* Adds a MultiPropertyLayer to this MultiPropertyGroup. +* Retrieves the assigned segment part uuid. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] pTheLayer - The MultiPropertyLayer to add to this MultiPropertyGroup -* @param[out] pLayerIndex - returns the index of this MultiPropertyLayer +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[in] nPartUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartUUIDBuffer - buffer of Segment Part UUID, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_AddLayerPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF::sMultiPropertyLayer * pTheLayer, Lib3MF_uint32 * pLayerIndex); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentPartUUIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nPartUUIDBufferSize, Lib3MF_uint32* pPartUUIDNeededChars, char * pPartUUIDBuffer); /** -* Obtains a MultiPropertyLayer of this MultiPropertyGroup. +* Retrieves the assigned segment part id. ATTENTION: This ID is only unique within the layer and there is no guarantee to be globally unique or consistent across layers. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nLayerIndex - The Index of the MultiPropertyLayer queried -* @param[out] pTheLayer - The MultiPropertyLayer with index LayerIndex within MultiPropertyGroup +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pLocalPartID - Local Segment Part ID * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetLayerPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex, Lib3MF::sMultiPropertyLayer * pTheLayer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentLocalPartIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 * pLocalPartID); /** -* Removes a MultiPropertyLayer from this MultiPropertyGroup. +* Retrieves the global part UUID by the local part ID. Fails if part ID does not exist in this layer. ATTENTION: This ID is only unique within the layer and there is no guarantee to be globally unique or consistent across layers. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nLayerIndex - The Index of the MultiPropertyLayer to be removed +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nLocalPartID - Local Segment Part ID +* @param[in] nPartUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartUUIDBuffer - buffer of Segment Part UUID, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_RemoveLayerPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex); - -/************************************************************************************************************************* - Class definition for Attachment -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nLocalPartID, const Lib3MF_uint32 nPartUUIDBufferSize, Lib3MF_uint32* pPartUUIDNeededChars, char * pPartUUIDBuffer); /** -* Retrieves an attachment's package path. This function will be removed in a later release. +* Retrieves the assigned segment point list. For type hatch, the points are taken pairwise. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nPathBufferSize - size of the buffer (including trailing 0) -* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPathBuffer - buffer of returns the attachment's package path string, may be NULL +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[out] pPointDataNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPointDataBuffer - Position2D buffer of The point data array * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_GetPathPtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentPointDataPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint64 nPointDataBufferSize, Lib3MF_uint64* pPointDataNeededCount, Lib3MF::sPosition2D * pPointDataBuffer); /** -* Sets an attachment's package path. This function will be removed in a later release. +* Retrieves a segment attribute Information by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pPath - new path of the attachment. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pID - Attribute ID. +* @param[out] pAttributeType - Attribute Type. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_SetPathPtr) (Lib3MF_Attachment pAttachment, const char * pPath); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_FindAttributeInfoByNamePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, Lib3MF_uint32 * pID, Lib3MF::eToolpathAttributeType * pAttributeType); /** -* Returns the PackagePart that is this attachment. +* Retrieves a segment attribute ID by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[out] pPackagePart - The PackagePart of this attachment. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pID - Attribute ID. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_PackagePartPtr) (Lib3MF_Attachment pAttachment, Lib3MF_PackagePart * pPackagePart); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_FindAttributeIDByNamePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, Lib3MF_uint32 * pID); /** -* Retrieves an attachment's relationship type +* Retrieves a segment attribute Type by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nPathBufferSize - size of the buffer (including trailing 0) -* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPathBuffer - buffer of returns the attachment's package relationship type string, may be NULL +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pAttributeType - Attribute Type. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_GetRelationShipTypePtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_FindAttributeValueByNamePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, Lib3MF::eToolpathAttributeType * pAttributeType); /** -* Sets an attachment's relationship type. +* Retrieves a segment Uint32 attribute by Attribute ID. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pPath - new relationship type string. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] nID - Attribute ID. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_SetRelationShipTypePtr) (Lib3MF_Attachment pAttachment, const char * pPath); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 nID, Lib3MF_int64 * pValue); /** -* Writes out the attachment as file. +* Retrieves a segment integer attribute by Attribute Name. Will fail if Attribute does not exist or is of different type. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pFileName - file to write into. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_WriteToFilePtr) (Lib3MF_Attachment pAttachment, const char * pFileName); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByNamePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const char * pNameSpace, const char * pAttributeName, Lib3MF_int64 * pValue); /** -* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Retrieves a segment Double attribute by Attribute ID. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pFileName - file to read from. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] nID - Attribute ID. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_ReadFromFilePtr) (Lib3MF_Attachment pAttachment, const char * pFileName); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 nID, Lib3MF_double * pValue); /** -* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Retrieves a segment Double attribute by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pTheReadCallback - Callback to call for reading a data chunk -* @param[in] nStreamSize - number of bytes the callback returns -* @param[in] pTheSeekCallback - Callback to call for seeking in the stream. -* @param[in] pUserData - Userdata that is passed to the callback function +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_ReadFromCallbackPtr) (Lib3MF_Attachment pAttachment, Lib3MF::ReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MF::SeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByNamePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const char * pNameSpace, const char * pAttributeName, Lib3MF_double * pValue); /** -* Retrieves the size of the attachment stream +* Retrieves the count of custom data elements. * -* @param[in] pAttachment - Attachment instance. -* @param[out] pStreamSize - the stream size +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[out] pCount - Count * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_GetStreamSizePtr) (Lib3MF_Attachment pAttachment, Lib3MF_uint64 * pStreamSize); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetCustomDataCountPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 * pCount); /** -* Writes out the attachment into a buffer +* Retrieves the custom data. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nBufferBufferSize - Number of elements in buffer -* @param[out] pBufferNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBufferBuffer - uint8 buffer of Buffer to write into +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_WriteToBufferPtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetCustomDataPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_CustomDOMTree * pData); /** -* Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). +* Retrieves the node name of the custom data. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nBufferBufferSize - Number of elements in buffer -* @param[in] pBufferBuffer - uint8 buffer of Buffer to read from +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of Namespace of the custom data tree., may be NULL +* @param[in] nDataNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pDataNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pDataNameBuffer - buffer of Root name of the data tree., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_ReadFromBufferPtr) (Lib3MF_Attachment pAttachment, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetCustomDataNamePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer, const Lib3MF_uint32 nDataNameBufferSize, Lib3MF_uint32* pDataNameNeededChars, char * pDataNameBuffer); /************************************************************************************************************************* - Class definition for Texture2D + Class definition for ToolpathLayerData **************************************************************************************************************************/ /** -* Retrieves the attachment located at the path of the texture. +* Retrieves the layerdata's uuid * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pAttachment - attachment that holds the texture's image information. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_GetAttachmentPtr) (Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment * pAttachment); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_GetLayerDataUUIDPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* Sets the texture's package path to the path of the attachment. +* Registers a toolpath profile * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] pAttachment - attachment that holds the texture's image information. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pProfile - The toolpath profile to register. +* @param[out] pProfileID - returns the local profile ID for the layer. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_SetAttachmentPtr) (Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment pAttachment); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_RegisterProfilePtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_ToolpathProfile pProfile, Lib3MF_uint32 * pProfileID); /** -* Retrieves a texture's content type. +* Registers a Model Build Item * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pContentType - returns content type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pBuildItem - The model build item to use. +* @param[out] pPartID - returns the local part ID for the layer. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_GetContentTypePtr) (Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureType * pContentType); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_RegisterBuildItemPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pPartID); /** -* Retrieves a texture's content type. +* Sets Segment Attribute for all following segments that are added. Overrides previously set attribute. * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] eContentType - new Content Type +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pNameSpace - The namespace of the attribute to register. +* @param[in] pAttributeName - The name of the attribute to register. +* @param[in] pValue - The value of the attribute to register. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_SetContentTypePtr) (Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureType eContentType); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_SetSegmentAttributePtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pAttributeName, const char * pValue); /** -* Retrieves a texture's tilestyle type. +* Clears current segment attributes. * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pTileStyleU - returns tilestyle type enum. -* @param[out] pTileStyleV - returns tilestyle type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_GetTileStyleUVPtr) (Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureTileStyle * pTileStyleU, Lib3MF::eTextureTileStyle * pTileStyleV); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_ClearSegmentAttributesPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData); /** -* Sets a texture's tilestyle type. +* writes hatch data to the layer. * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] eTileStyleU - new tilestyle type enum. -* @param[in] eTileStyleV - new tilestyle type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nProfileID - The toolpath profile to use +* @param[in] nPartID - The toolpath part to use +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[in] pPointDataBuffer - Position2D buffer of The point data * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_SetTileStyleUVPtr) (Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureTileStyle eTileStyleU, Lib3MF::eTextureTileStyle eTileStyleV); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_WriteHatchDataPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const Lib3MF::sPosition2D * pPointDataBuffer); /** -* Retrieves a texture's filter type. +* writes loop data to the layer. * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pFilter - returns filter type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nProfileID - The toolpath profile to use +* @param[in] nPartID - The toolpath part to use +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[in] pPointDataBuffer - Position2D buffer of The point data * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_GetFilterPtr) (Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureFilter * pFilter); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_WriteLoopPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const Lib3MF::sPosition2D * pPointDataBuffer); /** -* Sets a texture's filter type. +* writes polyline data to the layer. * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] eFilter - sets new filter type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nProfileID - The toolpath profile to use +* @param[in] nPartID - The toolpath part to use +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[in] pPointDataBuffer - Position2D buffer of The point data * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_SetFilterPtr) (Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureFilter eFilter); - -/************************************************************************************************************************* - Class definition for BuildItem -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpathLayerData_WritePolylinePtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const Lib3MF::sPosition2D * pPointDataBuffer); /** -* Retrieves the object resource associated to a build item +* Adds a custom data DOM tree to the layer. Layer MUST not be finished when changing the DOM tree. * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pObjectResource - returns the associated resource instance +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pDataName - Root name of the data tree. MUST not be empty. MUST be a valid XML name string. +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetObjectResourcePtr) (Lib3MF_BuildItem pBuildItem, Lib3MF_Object * pObjectResource); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_AddCustomDataPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData); /** -* returns, whether a build item has a UUID and, if true, the build item's UUID +* finishes all writing of the layer and compresses toolpath data. * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pHasUUID - flag whether the build item has a UUID -* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL +* @param[in] pToolpathLayerData - ToolpathLayerData instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetUUIDPtr) (Lib3MF_BuildItem pBuildItem, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_FinishPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData); + +/************************************************************************************************************************* + Class definition for Toolpath +**************************************************************************************************************************/ /** -* sets the build item's UUID +* Retrieves the unit factor * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' +* @param[in] pToolpath - Toolpath instance. +* @param[out] pUnits - Returns the unit factor. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_SetUUIDPtr) (Lib3MF_BuildItem pBuildItem, const char * pUUID); +typedef Lib3MFResult (*PLib3MFToolpath_GetUnitsPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_double * pUnits); /** -* Retrieves the object UniqueResourceID associated to a build item +* Retrieves the count of layers * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pUniqueResourceID - returns the UniqueResourceID of the object +* @param[in] pToolpath - Toolpath instance. +* @param[out] pCount - Returns the layer count * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetObjectResourceIDPtr) (Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pUniqueResourceID); +typedef Lib3MFResult (*PLib3MFToolpath_GetLayerCountPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount); /** -* Checks, if a build item has a non-identity transformation matrix +* Retrieves the count of profiles * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pHasTransform - returns true, if the transformation matrix is not the identity +* @param[in] pToolpath - Toolpath instance. +* @param[out] pCount - Returns the profile count * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_HasObjectTransformPtr) (Lib3MF_BuildItem pBuildItem, bool * pHasTransform); +typedef Lib3MFResult (*PLib3MFToolpath_GetProfileCountPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount); /** -* Retrieves a build item's transformation matrix. +* Adds a new toolpath layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pTransform - returns the transformation matrix +* @param[in] pToolpath - Toolpath instance. +* @param[in] nZMax - ZMax value +* @param[in] pPath - Package Path +* @param[in] pModelWriter - The model writer that writes out the 3MF. +* @param[out] pLayerData - Returns the layerdata object to write the layer content into. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetObjectTransformPtr) (Lib3MF_BuildItem pBuildItem, Lib3MF::sTransform * pTransform); +typedef Lib3MFResult (*PLib3MFToolpath_AddLayerPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nZMax, const char * pPath, Lib3MF_Writer pModelWriter, Lib3MF_ToolpathLayerData * pLayerData); /** -* Sets a build item's transformation matrix. +* Retrieves the Attachment of a layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] pTransform - new transformation matrix +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[out] pAttachment - Attachment * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_SetObjectTransformPtr) (Lib3MF_BuildItem pBuildItem, const Lib3MF::sTransform * pTransform); +typedef Lib3MFResult (*PLib3MFToolpath_GetLayerAttachmentPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_Attachment * pAttachment); /** -* Retrieves a build item's part number string +* Reads the toolpath of a layer. * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) -* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPartNumberBuffer - buffer of Returns a build item's part number string, may be NULL +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[out] pToolpathReader - Toolpath Reader Instance * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetPartNumberPtr) (Lib3MF_BuildItem pBuildItem, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); +typedef Lib3MFResult (*PLib3MFToolpath_ReadLayerDataPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_ToolpathLayerReader * pToolpathReader); /** -* Sets a build item's part number string +* Retrieves the Path of a layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] pSetPartnumber - new part number string for referencing parts from the outside world +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of Package Path, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_SetPartNumberPtr) (Lib3MF_BuildItem pBuildItem, const char * pSetPartnumber); +typedef Lib3MFResult (*PLib3MFToolpath_GetLayerPathPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); /** -* Returns the metadatagroup of this build item +* Retrieves the ZMax of a layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this build item +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[out] pZMax - ZMax value * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetMetaDataGroupPtr) (Lib3MF_BuildItem pBuildItem, Lib3MF_MetaDataGroup * pMetaDataGroup); +typedef Lib3MFResult (*PLib3MFToolpath_GetLayerZMaxPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_uint32 * pZMax); /** -* Returns the outbox of a build item +* Return the z value of a layer in units. * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pOutbox - Outbox of this build item +* @param[in] pToolpath - Toolpath instance. +* @param[in] nLayerIndex - Layer Index. +* @param[out] pZValue - Z Value in Units. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetOutboxPtr) (Lib3MF_BuildItem pBuildItem, Lib3MF::sBox * pOutbox); - -/************************************************************************************************************************* - Class definition for BuildItemIterator -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpath_GetLayerZPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nLayerIndex, Lib3MF_uint32 * pZValue); /** -* Iterates to the next build item in the list. +* Adds a new profile to the toolpath. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pHasNext - Iterates to the next build item in the list. +* @param[in] pToolpath - Toolpath instance. +* @param[in] pName - the name. +* @param[out] pProfile - Returns the profile. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItemIterator_MoveNextPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasNext); +typedef Lib3MFResult (*PLib3MFToolpath_AddProfilePtr) (Lib3MF_Toolpath pToolpath, const char * pName, Lib3MF_ToolpathProfile * pProfile); /** -* Iterates to the previous build item in the list. +* Returns a profile of the toolpath. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pHasPrevious - Iterates to the previous build item in the list. +* @param[in] pToolpath - Toolpath instance. +* @param[in] nProfileIndex - Layer Index. +* @param[out] pProfile - Returns the profile. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItemIterator_MovePreviousPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasPrevious); +typedef Lib3MFResult (*PLib3MFToolpath_GetProfilePtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nProfileIndex, Lib3MF_ToolpathProfile * pProfile); /** -* Returns the build item the iterator points at. +* Returns a profile of the toolpath by UUID. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pBuildItem - returns the build item instance. +* @param[in] pToolpath - Toolpath instance. +* @param[in] pProfileUUID - UUID string. +* @param[out] pProfile - Returns the profile. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItemIterator_GetCurrentPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItem * pBuildItem); +typedef Lib3MFResult (*PLib3MFToolpath_GetProfileUUIDPtr) (Lib3MF_Toolpath pToolpath, const char * pProfileUUID, Lib3MF_ToolpathProfile * pProfile); /** -* Creates a new build item iterator with the same build item list. +* Retrieves the count of custom data elements. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pOutBuildItemIterator - returns the cloned Iterator instance +* @param[in] pToolpath - Toolpath instance. +* @param[out] pCount - Count * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItemIterator_ClonePtr) (Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItemIterator * pOutBuildItemIterator); +typedef Lib3MFResult (*PLib3MFToolpath_GetCustomDataCountPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount); /** -* Returns the number of build items the iterator captures. +* Retrieves the custom data. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pCount - returns the number of build items the iterator captures. +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItemIterator_CountPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_uint64 * pCount); - -/************************************************************************************************************************* - Class definition for Slice -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpath_GetCustomDataPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_CustomDOMTree * pData); /** -* Set all vertices of a slice. All polygons will be cleared. +* Retrieves the node name of the custom data. * -* @param[in] pSlice - Slice instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[in] pVerticesBuffer - Position2D buffer of contains the positions. +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of Namespace of the custom data tree., may be NULL +* @param[in] nDataNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pDataNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pDataNameBuffer - buffer of Root name of the data tree., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_SetVerticesPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nVerticesBufferSize, const Lib3MF::sPosition2D * pVerticesBuffer); +typedef Lib3MFResult (*PLib3MFToolpath_GetCustomDataNamePtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer, const Lib3MF_uint32 nDataNameBufferSize, Lib3MF_uint32* pDataNameNeededChars, char * pDataNameBuffer); /** -* Get all vertices of a slice +* Retrieves if custom data with a specific namespace and name combination exists. * -* @param[in] pSlice - Slice instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pVerticesBuffer - Position2D buffer of contains the positions. +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. +* @param[in] pDataName - Root name of the data tree. +* @param[out] pCustomDataExists - Returns true if DOM Tree Exists. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_GetVerticesPtr) (Lib3MF_Slice pSlice, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, Lib3MF::sPosition2D * pVerticesBuffer); +typedef Lib3MFResult (*PLib3MFToolpath_HasUniqueCustomDataPtr) (Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, bool * pCustomDataExists); /** -* Get the number of vertices in a slice +* Retrieves the custom data with a specific namespace and name combination. Fails if combination is not unique. * -* @param[in] pSlice - Slice instance. -* @param[out] pCount - the number of vertices in the slice +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. +* @param[in] pDataName - Root name of the data tree. +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_GetVertexCountPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); +typedef Lib3MFResult (*PLib3MFToolpath_FindUniqueCustomDataPtr) (Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData); /** -* Add a new polygon to this slice +* Adds a custom data DOM tree to the toolpath. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the new polygon -* @param[out] pIndex - the index of the new polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pDataName - Root name of the data tree. MUST not be empty. MUST be a valid XML name string. +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_AddPolygonPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer, Lib3MF_uint64 * pIndex); +typedef Lib3MFResult (*PLib3MFToolpath_AddCustomDataPtr) (Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData); /** -* Get the number of polygons in the slice +* Deletes all custom data. * -* @param[in] pSlice - Slice instance. -* @param[out] pCount - the number of polygons in the slice +* @param[in] pToolpath - Toolpath instance. +* @param[out] pNumberOfDeletedItems - Returns number of deleted items. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_GetPolygonCountPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); +typedef Lib3MFResult (*PLib3MFToolpath_ClearCustomDataPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pNumberOfDeletedItems); /** -* Set all indices of a polygon +* Deletes a custom data instance from the list. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndex - the index of the polygon to manipulate -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the index-th polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pData - DOM Tree of the data. +* @param[out] pSuccess - Returns if deletion was successful. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_SetPolygonIndicesPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer); +typedef Lib3MFResult (*PLib3MFToolpath_DeleteCustomDataPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_CustomDOMTree pData, bool * pSuccess); /** -* Get all vertices of a slice +* Registers an Integer Attribute that each segment holds. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndex - the index of the polygon to manipulate -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pIndicesBuffer - uint32 buffer of the indices of the index-th polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pAttributeName - Attribute name. MUST not be empty. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_GetPolygonIndicesPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF_uint32 * pIndicesBuffer); +typedef Lib3MFResult (*PLib3MFToolpath_RegisterCustomIntegerAttributePtr) (Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pAttributeName); /** -* Get the number of vertices in a slice +* Registers a Double Attribute that each segment holds. Registering only applies to reader or writer objects created after the call. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndex - the index of the polygon to manipulate -* @param[out] pCount - the number of indices of the index-th polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pAttributeName - Attribute name. MUST not be empty. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_GetPolygonIndexCountPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 * pCount); +typedef Lib3MFResult (*PLib3MFToolpath_RegisterCustomDoubleAttributePtr) (Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pAttributeName); + +/************************************************************************************************************************* + Class definition for ToolpathIterator +**************************************************************************************************************************/ /** -* Get the upper Z-Coordinate of this slice. +* Returns the Toolpath the iterator points at. * -* @param[in] pSlice - Slice instance. -* @param[out] pZTop - the upper Z-Coordinate of this slice +* @param[in] pToolpathIterator - ToolpathIterator instance. +* @param[out] pResource - returns the Toolpath instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_GetZTopPtr) (Lib3MF_Slice pSlice, Lib3MF_double * pZTop); +typedef Lib3MFResult (*PLib3MFToolpathIterator_GetCurrentToolpathPtr) (Lib3MF_ToolpathIterator pToolpathIterator, Lib3MF_Toolpath * pResource); /************************************************************************************************************************* Class definition for SliceStack @@ -3261,6 +4668,15 @@ typedef Lib3MFResult (*PLib3MFModel_GetCompositeMaterialsPtr) (Lib3MF_Model pMod */ typedef Lib3MFResult (*PLib3MFModel_GetMultiPropertyGroupsPtr) (Lib3MF_Model pModel, Lib3MF_MultiPropertyGroupIterator * pResourceIterator); +/** +* creates a Toolpath instance with all toolpath resources. +* +* @param[in] pModel - Model instance. +* @param[out] pResourceIterator - returns the iterator instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_GetToolpathsPtr) (Lib3MF_Model pModel, Lib3MF_ToolpathIterator * pResourceIterator); + /** * creates a resource iterator instance with all slice stack resources. * @@ -3384,6 +4800,16 @@ typedef Lib3MFResult (*PLib3MFModel_AddBuildItemPtr) (Lib3MF_Model pModel, Lib3M */ typedef Lib3MFResult (*PLib3MFModel_RemoveBuildItemPtr) (Lib3MF_Model pModel, Lib3MF_BuildItem pBuildItemInstance); +/** +* adds an empty Toolpath resource to the model. +* +* @param[in] pModel - Model instance. +* @param[in] dUnitFactor - The toolpath instance of the created Toolpath. +* @param[out] pToolpathInstance - The toolpath instance of the created Toolpath. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_AddToolpathPtr) (Lib3MF_Model pModel, Lib3MF_double dUnitFactor, Lib3MF_Toolpath * pToolpathInstance); + /** * Returns the metadata of the model as MetaDataGroup * @@ -3515,6 +4941,40 @@ typedef Lib3MFResult (*PLib3MFModel_SetRandomNumberCallbackPtr) (Lib3MF_Model pM */ typedef Lib3MFResult (*PLib3MFModel_GetKeyStorePtr) (Lib3MF_Model pModel, Lib3MF_KeyStore * pKeyStore); +/** +* Creates an OPC Reader Source from a file. +* +* @param[in] pModel - Model instance. +* @param[in] pFilename - Filename to read from +* @param[out] pInstance - The instance of the created reader source +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_CreatePersistentSourceFromFilePtr) (Lib3MF_Model pModel, const char * pFilename, Lib3MF_PersistentReaderSource * pInstance); + +/** +* Creates an OPC Reader Source from a memory buffer. The memory buffer MUST exist as long as the Source object exists. +* +* @param[in] pModel - Model instance. +* @param[in] nBufferBufferSize - Number of elements in buffer +* @param[in] pBufferBuffer - uint8 buffer of Buffer to read from +* @param[out] pInstance - The instance of the created reader source +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_CreatePersistentSourceFromBufferPtr) (Lib3MF_Model pModel, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer, Lib3MF_PersistentReaderSource * pInstance); + +/** +* Creates an OPC Reader Source from a data provided by a callback function. The callbacks MUST exist as long as the source object exists. +* +* @param[in] pModel - Model instance. +* @param[in] pTheReadCallback - Callback to call for reading a data chunk +* @param[in] nStreamSize - number of bytes the callback returns +* @param[in] pTheSeekCallback - Callback to call for seeking in the stream. +* @param[in] pUserData - Userdata that is passed to the callback function +* @param[out] pInstance - The instance of the created reader source +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_CreatePersistentSourceFromCallbackPtr) (Lib3MF_Model pModel, Lib3MF::ReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MF::SeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData, Lib3MF_PersistentReaderSource * pInstance); + /************************************************************************************************************************* Global functions **************************************************************************************************************************/ @@ -3720,6 +5180,13 @@ typedef Lib3MFResult (*PLib3MFGetTranslationTransformPtr) (Lib3MF_single fVector typedef struct { void * m_LibraryHandle; PLib3MFBase_ClassTypeIdPtr m_Base_ClassTypeId; + PLib3MFBinaryStream_GetBinaryPathPtr m_BinaryStream_GetBinaryPath; + PLib3MFBinaryStream_GetIndexPathPtr m_BinaryStream_GetIndexPath; + PLib3MFBinaryStream_GetUUIDPtr m_BinaryStream_GetUUID; + PLib3MFBinaryStream_DisableDiscretizedArrayCompressionPtr m_BinaryStream_DisableDiscretizedArrayCompression; + PLib3MFBinaryStream_EnableDiscretizedArrayCompressionPtr m_BinaryStream_EnableDiscretizedArrayCompression; + PLib3MFBinaryStream_EnableLZMAPtr m_BinaryStream_EnableLZMA; + PLib3MFBinaryStream_DisableLZMAPtr m_BinaryStream_DisableLZMA; PLib3MFWriter_WriteToFilePtr m_Writer_WriteToFile; PLib3MFWriter_GetStreamSizePtr m_Writer_GetStreamSize; PLib3MFWriter_WriteToBufferPtr m_Writer_WriteToBuffer; @@ -3733,6 +5200,13 @@ typedef struct { PLib3MFWriter_GetWarningCountPtr m_Writer_GetWarningCount; PLib3MFWriter_AddKeyWrappingCallbackPtr m_Writer_AddKeyWrappingCallback; PLib3MFWriter_SetContentEncryptionCallbackPtr m_Writer_SetContentEncryptionCallback; + PLib3MFWriter_CreateBinaryStreamPtr m_Writer_CreateBinaryStream; + PLib3MFWriter_AssignBinaryStreamPtr m_Writer_AssignBinaryStream; + PLib3MFWriter_RegisterCustomNamespacePtr m_Writer_RegisterCustomNamespace; + PLib3MFPersistentReaderSource_GetSourceTypePtr m_PersistentReaderSource_GetSourceType; + PLib3MFPersistentReaderSource_InvalidateSourceDataPtr m_PersistentReaderSource_InvalidateSourceData; + PLib3MFPersistentReaderSource_SourceDataIsValidPtr m_PersistentReaderSource_SourceDataIsValid; + PLib3MFReader_ReadFromPersistentSourcePtr m_Reader_ReadFromPersistentSource; PLib3MFReader_ReadFromFilePtr m_Reader_ReadFromFile; PLib3MFReader_ReadFromBufferPtr m_Reader_ReadFromBuffer; PLib3MFReader_ReadFromCallbackPtr m_Reader_ReadFromCallback; @@ -3757,6 +5231,51 @@ typedef struct { PLib3MFResourceIterator_GetCurrentPtr m_ResourceIterator_GetCurrent; PLib3MFResourceIterator_ClonePtr m_ResourceIterator_Clone; PLib3MFResourceIterator_CountPtr m_ResourceIterator_Count; + PLib3MFCustomXMLAttribute_GetNamePtr m_CustomXMLAttribute_GetName; + PLib3MFCustomXMLAttribute_GetValuePtr m_CustomXMLAttribute_GetValue; + PLib3MFCustomXMLAttribute_IsValidIntegerPtr m_CustomXMLAttribute_IsValidInteger; + PLib3MFCustomXMLAttribute_GetIntegerValuePtr m_CustomXMLAttribute_GetIntegerValue; + PLib3MFCustomXMLAttribute_IsValidDoublePtr m_CustomXMLAttribute_IsValidDouble; + PLib3MFCustomXMLAttribute_GetDoubleValuePtr m_CustomXMLAttribute_GetDoubleValue; + PLib3MFCustomXMLAttribute_IsValidBoolPtr m_CustomXMLAttribute_IsValidBool; + PLib3MFCustomXMLAttribute_GetBoolValuePtr m_CustomXMLAttribute_GetBoolValue; + PLib3MFCustomXMLAttribute_SetValuePtr m_CustomXMLAttribute_SetValue; + PLib3MFCustomXMLAttribute_SetIntegerValuePtr m_CustomXMLAttribute_SetIntegerValue; + PLib3MFCustomXMLAttribute_SetDoubleValuePtr m_CustomXMLAttribute_SetDoubleValue; + PLib3MFCustomXMLAttribute_SetBoolValuePtr m_CustomXMLAttribute_SetBoolValue; + PLib3MFCustomXMLAttribute_RemovePtr m_CustomXMLAttribute_Remove; + PLib3MFCustomXMLNode_GetNamePtr m_CustomXMLNode_GetName; + PLib3MFCustomXMLNode_GetNameSpacePtr m_CustomXMLNode_GetNameSpace; + PLib3MFCustomXMLNode_GetAttributeCountPtr m_CustomXMLNode_GetAttributeCount; + PLib3MFCustomXMLNode_GetAttributePtr m_CustomXMLNode_GetAttribute; + PLib3MFCustomXMLNode_HasAttributePtr m_CustomXMLNode_HasAttribute; + PLib3MFCustomXMLNode_FindAttributePtr m_CustomXMLNode_FindAttribute; + PLib3MFCustomXMLNode_RemoveAttributePtr m_CustomXMLNode_RemoveAttribute; + PLib3MFCustomXMLNode_RemoveAttributeByIndexPtr m_CustomXMLNode_RemoveAttributeByIndex; + PLib3MFCustomXMLNode_AddAttributePtr m_CustomXMLNode_AddAttribute; + PLib3MFCustomXMLNode_AddIntegerAttributePtr m_CustomXMLNode_AddIntegerAttribute; + PLib3MFCustomXMLNode_AddDoubleAttributePtr m_CustomXMLNode_AddDoubleAttribute; + PLib3MFCustomXMLNode_AddBoolAttributePtr m_CustomXMLNode_AddBoolAttribute; + PLib3MFCustomXMLNode_GetChildrenPtr m_CustomXMLNode_GetChildren; + PLib3MFCustomXMLNode_CountChildrenByNamePtr m_CustomXMLNode_CountChildrenByName; + PLib3MFCustomXMLNode_GetChildrenByNamePtr m_CustomXMLNode_GetChildrenByName; + PLib3MFCustomXMLNode_HasChildPtr m_CustomXMLNode_HasChild; + PLib3MFCustomXMLNode_HasUniqueChildPtr m_CustomXMLNode_HasUniqueChild; + PLib3MFCustomXMLNode_FindChildPtr m_CustomXMLNode_FindChild; + PLib3MFCustomXMLNode_AddChildPtr m_CustomXMLNode_AddChild; + PLib3MFCustomXMLNode_RemoveChildPtr m_CustomXMLNode_RemoveChild; + PLib3MFCustomXMLNode_RemoveChildrenWithNamePtr m_CustomXMLNode_RemoveChildrenWithName; + PLib3MFCustomXMLNode_RemovePtr m_CustomXMLNode_Remove; + PLib3MFCustomXMLNodes_GetNodeCountPtr m_CustomXMLNodes_GetNodeCount; + PLib3MFCustomXMLNodes_GetNodePtr m_CustomXMLNodes_GetNode; + PLib3MFCustomXMLNodes_CountNodesByNamePtr m_CustomXMLNodes_CountNodesByName; + PLib3MFCustomXMLNodes_GetNodesByNamePtr m_CustomXMLNodes_GetNodesByName; + PLib3MFCustomXMLNodes_HasNodePtr m_CustomXMLNodes_HasNode; + PLib3MFCustomXMLNodes_HasUniqueNodePtr m_CustomXMLNodes_HasUniqueNode; + PLib3MFCustomXMLNodes_FindNodePtr m_CustomXMLNodes_FindNode; + PLib3MFCustomDOMTree_GetNameSpacePtr m_CustomDOMTree_GetNameSpace; + PLib3MFCustomDOMTree_GetRootNodePtr m_CustomDOMTree_GetRootNode; + PLib3MFCustomDOMTree_SaveToStringPtr m_CustomDOMTree_SaveToString; PLib3MFSliceStackIterator_GetCurrentSliceStackPtr m_SliceStackIterator_GetCurrentSliceStack; PLib3MFObjectIterator_GetCurrentObjectPtr m_ObjectIterator_GetCurrentObject; PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr m_MeshObjectIterator_GetCurrentMeshObject; @@ -3949,6 +5468,78 @@ typedef struct { PLib3MFSlice_GetPolygonIndicesPtr m_Slice_GetPolygonIndices; PLib3MFSlice_GetPolygonIndexCountPtr m_Slice_GetPolygonIndexCount; PLib3MFSlice_GetZTopPtr m_Slice_GetZTop; + PLib3MFToolpathProfile_GetUUIDPtr m_ToolpathProfile_GetUUID; + PLib3MFToolpathProfile_GetNamePtr m_ToolpathProfile_GetName; + PLib3MFToolpathProfile_GetParameterCountPtr m_ToolpathProfile_GetParameterCount; + PLib3MFToolpathProfile_GetParameterNamePtr m_ToolpathProfile_GetParameterName; + PLib3MFToolpathProfile_GetParameterNameSpacePtr m_ToolpathProfile_GetParameterNameSpace; + PLib3MFToolpathProfile_HasParameterValuePtr m_ToolpathProfile_HasParameterValue; + PLib3MFToolpathProfile_GetParameterValuePtr m_ToolpathProfile_GetParameterValue; + PLib3MFToolpathProfile_GetParameterValueDefPtr m_ToolpathProfile_GetParameterValueDef; + PLib3MFToolpathProfile_GetParameterDoubleValuePtr m_ToolpathProfile_GetParameterDoubleValue; + PLib3MFToolpathProfile_GetParameterDoubleValueDefPtr m_ToolpathProfile_GetParameterDoubleValueDef; + PLib3MFToolpathProfile_GetParameterIntegerValuePtr m_ToolpathProfile_GetParameterIntegerValue; + PLib3MFToolpathProfile_GetParameterIntegerValueDefPtr m_ToolpathProfile_GetParameterIntegerValueDef; + PLib3MFToolpathProfile_GetParameterBoolValuePtr m_ToolpathProfile_GetParameterBoolValue; + PLib3MFToolpathProfile_GetParameterBoolValueDefPtr m_ToolpathProfile_GetParameterBoolValueDef; + PLib3MFToolpathProfile_SetNamePtr m_ToolpathProfile_SetName; + PLib3MFToolpathProfile_SetParameterValuePtr m_ToolpathProfile_SetParameterValue; + PLib3MFToolpathProfile_SetParameterDoubleValuePtr m_ToolpathProfile_SetParameterDoubleValue; + PLib3MFToolpathProfile_SetParameterIntegerValuePtr m_ToolpathProfile_SetParameterIntegerValue; + PLib3MFToolpathProfile_SetParameterBoolValuePtr m_ToolpathProfile_SetParameterBoolValue; + PLib3MFToolpathLayerReader_GetLayerDataUUIDPtr m_ToolpathLayerReader_GetLayerDataUUID; + PLib3MFToolpathLayerReader_GetSegmentCountPtr m_ToolpathLayerReader_GetSegmentCount; + PLib3MFToolpathLayerReader_GetSegmentInfoPtr m_ToolpathLayerReader_GetSegmentInfo; + PLib3MFToolpathLayerReader_GetSegmentProfilePtr m_ToolpathLayerReader_GetSegmentProfile; + PLib3MFToolpathLayerReader_GetSegmentProfileUUIDPtr m_ToolpathLayerReader_GetSegmentProfileUUID; + PLib3MFToolpathLayerReader_GetSegmentPartPtr m_ToolpathLayerReader_GetSegmentPart; + PLib3MFToolpathLayerReader_GetSegmentPartUUIDPtr m_ToolpathLayerReader_GetSegmentPartUUID; + PLib3MFToolpathLayerReader_GetSegmentLocalPartIDPtr m_ToolpathLayerReader_GetSegmentLocalPartID; + PLib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDPtr m_ToolpathLayerReader_GetPartUUIDByLocalPartID; + PLib3MFToolpathLayerReader_GetSegmentPointDataPtr m_ToolpathLayerReader_GetSegmentPointData; + PLib3MFToolpathLayerReader_FindAttributeInfoByNamePtr m_ToolpathLayerReader_FindAttributeInfoByName; + PLib3MFToolpathLayerReader_FindAttributeIDByNamePtr m_ToolpathLayerReader_FindAttributeIDByName; + PLib3MFToolpathLayerReader_FindAttributeValueByNamePtr m_ToolpathLayerReader_FindAttributeValueByName; + PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByIDPtr m_ToolpathLayerReader_GetSegmentIntegerAttributeByID; + PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByNamePtr m_ToolpathLayerReader_GetSegmentIntegerAttributeByName; + PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByIDPtr m_ToolpathLayerReader_GetSegmentDoubleAttributeByID; + PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByNamePtr m_ToolpathLayerReader_GetSegmentDoubleAttributeByName; + PLib3MFToolpathLayerReader_GetCustomDataCountPtr m_ToolpathLayerReader_GetCustomDataCount; + PLib3MFToolpathLayerReader_GetCustomDataPtr m_ToolpathLayerReader_GetCustomData; + PLib3MFToolpathLayerReader_GetCustomDataNamePtr m_ToolpathLayerReader_GetCustomDataName; + PLib3MFToolpathLayerData_GetLayerDataUUIDPtr m_ToolpathLayerData_GetLayerDataUUID; + PLib3MFToolpathLayerData_RegisterProfilePtr m_ToolpathLayerData_RegisterProfile; + PLib3MFToolpathLayerData_RegisterBuildItemPtr m_ToolpathLayerData_RegisterBuildItem; + PLib3MFToolpathLayerData_SetSegmentAttributePtr m_ToolpathLayerData_SetSegmentAttribute; + PLib3MFToolpathLayerData_ClearSegmentAttributesPtr m_ToolpathLayerData_ClearSegmentAttributes; + PLib3MFToolpathLayerData_WriteHatchDataPtr m_ToolpathLayerData_WriteHatchData; + PLib3MFToolpathLayerData_WriteLoopPtr m_ToolpathLayerData_WriteLoop; + PLib3MFToolpathLayerData_WritePolylinePtr m_ToolpathLayerData_WritePolyline; + PLib3MFToolpathLayerData_AddCustomDataPtr m_ToolpathLayerData_AddCustomData; + PLib3MFToolpathLayerData_FinishPtr m_ToolpathLayerData_Finish; + PLib3MFToolpath_GetUnitsPtr m_Toolpath_GetUnits; + PLib3MFToolpath_GetLayerCountPtr m_Toolpath_GetLayerCount; + PLib3MFToolpath_GetProfileCountPtr m_Toolpath_GetProfileCount; + PLib3MFToolpath_AddLayerPtr m_Toolpath_AddLayer; + PLib3MFToolpath_GetLayerAttachmentPtr m_Toolpath_GetLayerAttachment; + PLib3MFToolpath_ReadLayerDataPtr m_Toolpath_ReadLayerData; + PLib3MFToolpath_GetLayerPathPtr m_Toolpath_GetLayerPath; + PLib3MFToolpath_GetLayerZMaxPtr m_Toolpath_GetLayerZMax; + PLib3MFToolpath_GetLayerZPtr m_Toolpath_GetLayerZ; + PLib3MFToolpath_AddProfilePtr m_Toolpath_AddProfile; + PLib3MFToolpath_GetProfilePtr m_Toolpath_GetProfile; + PLib3MFToolpath_GetProfileUUIDPtr m_Toolpath_GetProfileUUID; + PLib3MFToolpath_GetCustomDataCountPtr m_Toolpath_GetCustomDataCount; + PLib3MFToolpath_GetCustomDataPtr m_Toolpath_GetCustomData; + PLib3MFToolpath_GetCustomDataNamePtr m_Toolpath_GetCustomDataName; + PLib3MFToolpath_HasUniqueCustomDataPtr m_Toolpath_HasUniqueCustomData; + PLib3MFToolpath_FindUniqueCustomDataPtr m_Toolpath_FindUniqueCustomData; + PLib3MFToolpath_AddCustomDataPtr m_Toolpath_AddCustomData; + PLib3MFToolpath_ClearCustomDataPtr m_Toolpath_ClearCustomData; + PLib3MFToolpath_DeleteCustomDataPtr m_Toolpath_DeleteCustomData; + PLib3MFToolpath_RegisterCustomIntegerAttributePtr m_Toolpath_RegisterCustomIntegerAttribute; + PLib3MFToolpath_RegisterCustomDoubleAttributePtr m_Toolpath_RegisterCustomDoubleAttribute; + PLib3MFToolpathIterator_GetCurrentToolpathPtr m_ToolpathIterator_GetCurrentToolpath; PLib3MFSliceStack_GetBottomZPtr m_SliceStack_GetBottomZ; PLib3MFSliceStack_GetSliceCountPtr m_SliceStack_GetSliceCount; PLib3MFSliceStack_GetSlicePtr m_SliceStack_GetSlice; @@ -4032,6 +5623,7 @@ typedef struct { PLib3MFModel_GetTexture2DGroupsPtr m_Model_GetTexture2DGroups; PLib3MFModel_GetCompositeMaterialsPtr m_Model_GetCompositeMaterials; PLib3MFModel_GetMultiPropertyGroupsPtr m_Model_GetMultiPropertyGroups; + PLib3MFModel_GetToolpathsPtr m_Model_GetToolpaths; PLib3MFModel_GetSliceStacksPtr m_Model_GetSliceStacks; PLib3MFModel_MergeToModelPtr m_Model_MergeToModel; PLib3MFModel_AddMeshObjectPtr m_Model_AddMeshObject; @@ -4045,6 +5637,7 @@ typedef struct { PLib3MFModel_AddMultiPropertyGroupPtr m_Model_AddMultiPropertyGroup; PLib3MFModel_AddBuildItemPtr m_Model_AddBuildItem; PLib3MFModel_RemoveBuildItemPtr m_Model_RemoveBuildItem; + PLib3MFModel_AddToolpathPtr m_Model_AddToolpath; PLib3MFModel_GetMetaDataGroupPtr m_Model_GetMetaDataGroup; PLib3MFModel_AddAttachmentPtr m_Model_AddAttachment; PLib3MFModel_RemoveAttachmentPtr m_Model_RemoveAttachment; @@ -4059,6 +5652,9 @@ typedef struct { PLib3MFModel_RemoveCustomContentTypePtr m_Model_RemoveCustomContentType; PLib3MFModel_SetRandomNumberCallbackPtr m_Model_SetRandomNumberCallback; PLib3MFModel_GetKeyStorePtr m_Model_GetKeyStore; + PLib3MFModel_CreatePersistentSourceFromFilePtr m_Model_CreatePersistentSourceFromFile; + PLib3MFModel_CreatePersistentSourceFromBufferPtr m_Model_CreatePersistentSourceFromBuffer; + PLib3MFModel_CreatePersistentSourceFromCallbackPtr m_Model_CreatePersistentSourceFromCallback; PLib3MFGetLibraryVersionPtr m_GetLibraryVersion; PLib3MFGetPrereleaseInformationPtr m_GetPrereleaseInformation; PLib3MFGetBuildInformationPtr m_GetBuildInformation; diff --git a/Autogenerated/Bindings/CppDynamic/lib3mf_dynamic.hpp b/Autogenerated/Bindings/CppDynamic/lib3mf_dynamic.hpp index a374db4eb..fe8b1c176 100644 --- a/Autogenerated/Bindings/CppDynamic/lib3mf_dynamic.hpp +++ b/Autogenerated/Bindings/CppDynamic/lib3mf_dynamic.hpp @@ -58,11 +58,17 @@ namespace Lib3MF { **************************************************************************************************************************/ class CWrapper; class CBase; +class CBinaryStream; class CWriter; +class CPersistentReaderSource; class CReader; class CPackagePart; class CResource; class CResourceIterator; +class CCustomXMLAttribute; +class CCustomXMLNode; +class CCustomXMLNodes; +class CCustomDOMTree; class CSliceStackIterator; class CObjectIterator; class CMeshObjectIterator; @@ -91,6 +97,11 @@ class CTexture2D; class CBuildItem; class CBuildItemIterator; class CSlice; +class CToolpathProfile; +class CToolpathLayerReader; +class CToolpathLayerData; +class CToolpath; +class CToolpathIterator; class CSliceStack; class CConsumer; class CAccessRight; @@ -105,11 +116,17 @@ class CModel; **************************************************************************************************************************/ typedef CWrapper CLib3MFWrapper; typedef CBase CLib3MFBase; +typedef CBinaryStream CLib3MFBinaryStream; typedef CWriter CLib3MFWriter; +typedef CPersistentReaderSource CLib3MFPersistentReaderSource; typedef CReader CLib3MFReader; typedef CPackagePart CLib3MFPackagePart; typedef CResource CLib3MFResource; typedef CResourceIterator CLib3MFResourceIterator; +typedef CCustomXMLAttribute CLib3MFCustomXMLAttribute; +typedef CCustomXMLNode CLib3MFCustomXMLNode; +typedef CCustomXMLNodes CLib3MFCustomXMLNodes; +typedef CCustomDOMTree CLib3MFCustomDOMTree; typedef CSliceStackIterator CLib3MFSliceStackIterator; typedef CObjectIterator CLib3MFObjectIterator; typedef CMeshObjectIterator CLib3MFMeshObjectIterator; @@ -138,6 +155,11 @@ typedef CTexture2D CLib3MFTexture2D; typedef CBuildItem CLib3MFBuildItem; typedef CBuildItemIterator CLib3MFBuildItemIterator; typedef CSlice CLib3MFSlice; +typedef CToolpathProfile CLib3MFToolpathProfile; +typedef CToolpathLayerReader CLib3MFToolpathLayerReader; +typedef CToolpathLayerData CLib3MFToolpathLayerData; +typedef CToolpath CLib3MFToolpath; +typedef CToolpathIterator CLib3MFToolpathIterator; typedef CSliceStack CLib3MFSliceStack; typedef CConsumer CLib3MFConsumer; typedef CAccessRight CLib3MFAccessRight; @@ -152,11 +174,17 @@ typedef CModel CLib3MFModel; **************************************************************************************************************************/ typedef std::shared_ptr PWrapper; typedef std::shared_ptr PBase; +typedef std::shared_ptr PBinaryStream; typedef std::shared_ptr PWriter; +typedef std::shared_ptr PPersistentReaderSource; typedef std::shared_ptr PReader; typedef std::shared_ptr PPackagePart; typedef std::shared_ptr PResource; typedef std::shared_ptr PResourceIterator; +typedef std::shared_ptr PCustomXMLAttribute; +typedef std::shared_ptr PCustomXMLNode; +typedef std::shared_ptr PCustomXMLNodes; +typedef std::shared_ptr PCustomDOMTree; typedef std::shared_ptr PSliceStackIterator; typedef std::shared_ptr PObjectIterator; typedef std::shared_ptr PMeshObjectIterator; @@ -185,6 +213,11 @@ typedef std::shared_ptr PTexture2D; typedef std::shared_ptr PBuildItem; typedef std::shared_ptr PBuildItemIterator; typedef std::shared_ptr PSlice; +typedef std::shared_ptr PToolpathProfile; +typedef std::shared_ptr PToolpathLayerReader; +typedef std::shared_ptr PToolpathLayerData; +typedef std::shared_ptr PToolpath; +typedef std::shared_ptr PToolpathIterator; typedef std::shared_ptr PSliceStack; typedef std::shared_ptr PConsumer; typedef std::shared_ptr PAccessRight; @@ -199,11 +232,17 @@ typedef std::shared_ptr PModel; **************************************************************************************************************************/ typedef PWrapper PLib3MFWrapper; typedef PBase PLib3MFBase; +typedef PBinaryStream PLib3MFBinaryStream; typedef PWriter PLib3MFWriter; +typedef PPersistentReaderSource PLib3MFPersistentReaderSource; typedef PReader PLib3MFReader; typedef PPackagePart PLib3MFPackagePart; typedef PResource PLib3MFResource; typedef PResourceIterator PLib3MFResourceIterator; +typedef PCustomXMLAttribute PLib3MFCustomXMLAttribute; +typedef PCustomXMLNode PLib3MFCustomXMLNode; +typedef PCustomXMLNodes PLib3MFCustomXMLNodes; +typedef PCustomDOMTree PLib3MFCustomDOMTree; typedef PSliceStackIterator PLib3MFSliceStackIterator; typedef PObjectIterator PLib3MFObjectIterator; typedef PMeshObjectIterator PLib3MFMeshObjectIterator; @@ -232,6 +271,11 @@ typedef PTexture2D PLib3MFTexture2D; typedef PBuildItem PLib3MFBuildItem; typedef PBuildItemIterator PLib3MFBuildItemIterator; typedef PSlice PLib3MFSlice; +typedef PToolpathProfile PLib3MFToolpathProfile; +typedef PToolpathLayerReader PLib3MFToolpathLayerReader; +typedef PToolpathLayerData PLib3MFToolpathLayerData; +typedef PToolpath PLib3MFToolpath; +typedef PToolpathIterator PLib3MFToolpathIterator; typedef PSliceStack PLib3MFSliceStack; typedef PConsumer PLib3MFConsumer; typedef PAccessRight PLib3MFAccessRight; @@ -355,6 +399,10 @@ class ELib3MFException : public std::exception { case LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER: return "UNKOWNPROGRESSIDENTIFIER"; case LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT: return "ELEMENTCOUNTEXCEEDSLIMIT"; case LIB3MF_ERROR_INVALIDRESOURCE: return "INVALIDRESOURCE"; + case LIB3MF_ERROR_INVALIDNODEINDEX: return "INVALIDNODEINDEX"; + case LIB3MF_ERROR_INVALIDATTRIBUTEINDEX: return "INVALIDATTRIBUTEINDEX"; + case LIB3MF_ERROR_DUPLICATECUSTOMDATA: return "DUPLICATECUSTOMDATA"; + case LIB3MF_ERROR_CUSTOMDATANOTFOUND: return "CUSTOMDATANOTFOUND"; case LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE: return "BEAMLATTICE_INVALID_OBJECTTYPE"; case LIB3MF_ERROR_INVALIDKEYSTORE: return "INVALIDKEYSTORE"; case LIB3MF_ERROR_INVALIDKEYSTORECONSUMER: return "INVALIDKEYSTORECONSUMER"; @@ -362,6 +410,16 @@ class ELib3MFException : public std::exception { case LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND: return "KEYSTORERESOURCEDATANOTFOUND"; case LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED: return "SECURECONTEXTNOTREGISTERED"; case LIB3MF_ERROR_INVALIDKEYSIZE: return "INVALIDKEYSIZE"; + case LIB3MF_ERROR_TOOLPATH_NOTWRITINGHEADER: return "TOOLPATH_NOTWRITINGHEADER"; + case LIB3MF_ERROR_TOOLPATH_NOTWRITINGDATA: return "TOOLPATH_NOTWRITINGDATA"; + case LIB3MF_ERROR_TOOLPATH_DATAHASBEENWRITTEN: return "TOOLPATH_DATAHASBEENWRITTEN"; + case LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT: return "TOOLPATH_INVALIDPOINTCOUNT"; + case LIB3MF_ERROR_TOOLPATH_ATTRIBUTEALREADYDEFINED: return "TOOLPATH_ATTRIBUTEALREADYDEFINED"; + case LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE: return "TOOLPATH_INVALIDATTRIBUTETYPE"; + case LIB3MF_ERROR_EMPTYNAMESPACEPREFIX: return "EMPTYNAMESPACEPREFIX"; + case LIB3MF_ERROR_EMPTYNAMESPACE: return "EMPTYNAMESPACE"; + case LIB3MF_ERROR_INVALIDNAMESPACEPREFIX: return "INVALIDNAMESPACEPREFIX"; + case LIB3MF_ERROR_WRITERDOESNOTSUPPORTNAMESPACES: return "WRITERDOESNOTSUPPORTNAMESPACES"; } return "UNKNOWN"; } @@ -406,13 +464,27 @@ class ELib3MFException : public std::exception { case LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER: return "A progress identifier is unknown"; case LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT: return "An element buffer exceeds its spec limit"; case LIB3MF_ERROR_INVALIDRESOURCE: return "A resource is invalid"; + case LIB3MF_ERROR_INVALIDNODEINDEX: return "Invalid node index"; + case LIB3MF_ERROR_INVALIDATTRIBUTEINDEX: return "Invalid attribute index"; + case LIB3MF_ERROR_DUPLICATECUSTOMDATA: return "Duplicate custom data"; + case LIB3MF_ERROR_CUSTOMDATANOTFOUND: return "Custom data not found"; case LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE: return "This object type is not valid for beamlattices"; case LIB3MF_ERROR_INVALIDKEYSTORE: return "The keystore object is invalid"; case LIB3MF_ERROR_INVALIDKEYSTORECONSUMER: return "The consumer keystore object is invalid"; case LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND: return "A consumer has not been found"; case LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND: return "A resource data has not been found"; case LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED: return "A Key or Conentent encryption callback has not been registered"; - case LIB3MF_ERROR_INVALIDKEYSIZE: return "The key siue is invalid"; + case LIB3MF_ERROR_INVALIDKEYSIZE: return "The key size is invalid"; + case LIB3MF_ERROR_TOOLPATH_NOTWRITINGHEADER: return "Not in toolpath header writing mode"; + case LIB3MF_ERROR_TOOLPATH_NOTWRITINGDATA: return "Not in toolpath data writing mode"; + case LIB3MF_ERROR_TOOLPATH_DATAHASBEENWRITTEN: return "Toolpath has already been written out"; + case LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT: return "Toolpath has an invalid number of points"; + case LIB3MF_ERROR_TOOLPATH_ATTRIBUTEALREADYDEFINED: return "Toolpath attribute already defined"; + case LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE: return "Toolpath attribute is of invalid type"; + case LIB3MF_ERROR_EMPTYNAMESPACEPREFIX: return "Empty namespace prefix."; + case LIB3MF_ERROR_EMPTYNAMESPACE: return "Empty namespace."; + case LIB3MF_ERROR_INVALIDNAMESPACEPREFIX: return "Invalid namespace prefix."; + case LIB3MF_ERROR_WRITERDOESNOTSUPPORTNAMESPACES: return "Writer does not support namespaces."; } return "unknown error"; } @@ -546,11 +618,17 @@ class CWrapper { Lib3MFResult loadWrapperTableFromSymbolLookupMethod(sLib3MFDynamicWrapperTable * pWrapperTable, void* pSymbolLookupMethod); friend class CBase; + friend class CBinaryStream; friend class CWriter; + friend class CPersistentReaderSource; friend class CReader; friend class CPackagePart; friend class CResource; friend class CResourceIterator; + friend class CCustomXMLAttribute; + friend class CCustomXMLNode; + friend class CCustomXMLNodes; + friend class CCustomDOMTree; friend class CSliceStackIterator; friend class CObjectIterator; friend class CMeshObjectIterator; @@ -579,6 +657,11 @@ class CWrapper { friend class CBuildItem; friend class CBuildItemIterator; friend class CSlice; + friend class CToolpathProfile; + friend class CToolpathLayerReader; + friend class CToolpathLayerData; + friend class CToolpath; + friend class CToolpathIterator; friend class CSliceStack; friend class CConsumer; friend class CAccessRight; @@ -648,6 +731,29 @@ class CBase { inline Lib3MF_uint64 ClassTypeId(); }; +/************************************************************************************************************************* + Class CBinaryStream +**************************************************************************************************************************/ +class CBinaryStream : public CBase { +public: + + /** + * CBinaryStream::CBinaryStream - Constructor for BinaryStream class. + */ + CBinaryStream(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CBase(pWrapper, pHandle) + { + } + + inline std::string GetBinaryPath(); + inline std::string GetIndexPath(); + inline std::string GetUUID(); + inline void DisableDiscretizedArrayCompression(); + inline void EnableDiscretizedArrayCompression(const Lib3MF_double dUnits, const eBinaryStreamPredictionType ePredictionType); + inline void EnableLZMA(const Lib3MF_uint32 nLZMALevel); + inline void DisableLZMA(); +}; + /************************************************************************************************************************* Class CWriter **************************************************************************************************************************/ @@ -675,6 +781,28 @@ class CWriter : public CBase { inline Lib3MF_uint32 GetWarningCount(); inline void AddKeyWrappingCallback(const std::string & sConsumerID, const KeyWrappingCallback pTheCallback, const Lib3MF_pvoid pUserData); inline void SetContentEncryptionCallback(const ContentEncryptionCallback pTheCallback, const Lib3MF_pvoid pUserData); + inline PBinaryStream CreateBinaryStream(const std::string & sIndexPath, const std::string & sBinaryPath); + inline void AssignBinaryStream(classParam pInstance, classParam pBinaryStream); + inline void RegisterCustomNamespace(const std::string & sPrefix, const std::string & sNameSpace); +}; + +/************************************************************************************************************************* + Class CPersistentReaderSource +**************************************************************************************************************************/ +class CPersistentReaderSource : public CBase { +public: + + /** + * CPersistentReaderSource::CPersistentReaderSource - Constructor for PersistentReaderSource class. + */ + CPersistentReaderSource(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CBase(pWrapper, pHandle) + { + } + + inline ePersistentReaderSourceType GetSourceType(); + inline void InvalidateSourceData(); + inline bool SourceDataIsValid(); }; /************************************************************************************************************************* @@ -691,6 +819,7 @@ class CReader : public CBase { { } + inline void ReadFromPersistentSource(classParam pSource); inline void ReadFromFile(const std::string & sFilename); inline void ReadFromBuffer(const CInputVector & BufferBuffer); inline void ReadFromCallback(const ReadCallback pTheReadCallback, const Lib3MF_uint64 nStreamSize, const SeekCallback pTheSeekCallback, const Lib3MF_pvoid pUserData); @@ -765,6 +894,115 @@ class CResourceIterator : public CBase { inline Lib3MF_uint64 Count(); }; +/************************************************************************************************************************* + Class CCustomXMLAttribute +**************************************************************************************************************************/ +class CCustomXMLAttribute : public CBase { +public: + + /** + * CCustomXMLAttribute::CCustomXMLAttribute - Constructor for CustomXMLAttribute class. + */ + CCustomXMLAttribute(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CBase(pWrapper, pHandle) + { + } + + inline std::string GetName(); + inline std::string GetValue(); + inline bool IsValidInteger(const Lib3MF_int64 nMinValue, const Lib3MF_int64 nMaxValue); + inline Lib3MF_int64 GetIntegerValue(const Lib3MF_int64 nMinValue, const Lib3MF_int64 nMaxValue); + inline bool IsValidDouble(const Lib3MF_double dMinValue, const Lib3MF_double dMaxValue); + inline Lib3MF_double GetDoubleValue(const Lib3MF_double dMinValue, const Lib3MF_double dMaxValue); + inline bool IsValidBool(); + inline bool GetBoolValue(const Lib3MF_double dMinValue, const Lib3MF_double dMaxValue); + inline void SetValue(const std::string & sValue); + inline void SetIntegerValue(const Lib3MF_int64 nValue); + inline void SetDoubleValue(const Lib3MF_double dValue); + inline void SetBoolValue(const bool bValue); + inline void Remove(); +}; + +/************************************************************************************************************************* + Class CCustomXMLNode +**************************************************************************************************************************/ +class CCustomXMLNode : public CBase { +public: + + /** + * CCustomXMLNode::CCustomXMLNode - Constructor for CustomXMLNode class. + */ + CCustomXMLNode(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CBase(pWrapper, pHandle) + { + } + + inline std::string GetName(); + inline std::string GetNameSpace(); + inline Lib3MF_uint64 GetAttributeCount(); + inline PCustomXMLAttribute GetAttribute(const Lib3MF_uint64 nIndex); + inline bool HasAttribute(const std::string & sName); + inline PCustomXMLAttribute FindAttribute(const std::string & sName, const bool bMustExist); + inline bool RemoveAttribute(const std::string & sName); + inline bool RemoveAttributeByIndex(const Lib3MF_uint64 nIndex); + inline void AddAttribute(const std::string & sName, const std::string & sValue); + inline void AddIntegerAttribute(const std::string & sName, const Lib3MF_int64 nValue); + inline void AddDoubleAttribute(const std::string & sName, const Lib3MF_double dValue); + inline void AddBoolAttribute(const std::string & sName, const bool bValue); + inline PCustomXMLNodes GetChildren(); + inline Lib3MF_uint64 CountChildrenByName(const std::string & sName); + inline PCustomXMLNodes GetChildrenByName(const std::string & sName); + inline bool HasChild(const std::string & sName); + inline bool HasUniqueChild(const std::string & sName); + inline PCustomXMLNode FindChild(const std::string & sName, const bool bMustExist); + inline PCustomXMLNode AddChild(const std::string & sName); + inline void RemoveChild(classParam pChildInstance); + inline Lib3MF_uint64 RemoveChildrenWithName(const std::string & sName); + inline void Remove(); +}; + +/************************************************************************************************************************* + Class CCustomXMLNodes +**************************************************************************************************************************/ +class CCustomXMLNodes : public CBase { +public: + + /** + * CCustomXMLNodes::CCustomXMLNodes - Constructor for CustomXMLNodes class. + */ + CCustomXMLNodes(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CBase(pWrapper, pHandle) + { + } + + inline Lib3MF_uint64 GetNodeCount(); + inline PCustomXMLNode GetNode(const Lib3MF_uint64 nIndex); + inline Lib3MF_uint64 CountNodesByName(const std::string & sName); + inline PCustomXMLNodes GetNodesByName(const std::string & sName); + inline bool HasNode(const std::string & sName); + inline bool HasUniqueNode(const std::string & sName); + inline PCustomXMLNode FindNode(const std::string & sName, const bool bMustExist); +}; + +/************************************************************************************************************************* + Class CCustomDOMTree +**************************************************************************************************************************/ +class CCustomDOMTree : public CBase { +public: + + /** + * CCustomDOMTree::CCustomDOMTree - Constructor for CustomDOMTree class. + */ + CCustomDOMTree(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CBase(pWrapper, pHandle) + { + } + + inline std::string GetNameSpace(); + inline PCustomXMLNode GetRootNode(); + inline std::string SaveToString(); +}; + /************************************************************************************************************************* Class CSliceStackIterator **************************************************************************************************************************/ @@ -1405,6 +1643,158 @@ class CSlice : public CBase { inline Lib3MF_double GetZTop(); }; +/************************************************************************************************************************* + Class CToolpathProfile +**************************************************************************************************************************/ +class CToolpathProfile : public CBase { +public: + + /** + * CToolpathProfile::CToolpathProfile - Constructor for ToolpathProfile class. + */ + CToolpathProfile(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CBase(pWrapper, pHandle) + { + } + + inline std::string GetUUID(); + inline std::string GetName(); + inline Lib3MF_uint32 GetParameterCount(); + inline std::string GetParameterName(const Lib3MF_uint32 nIndex); + inline std::string GetParameterNameSpace(const Lib3MF_uint32 nIndex); + inline bool HasParameterValue(const std::string & sNameSpaceName, const std::string & sValueName); + inline std::string GetParameterValue(const std::string & sNameSpaceName, const std::string & sValueName); + inline std::string GetParameterValueDef(const std::string & sNameSpaceName, const std::string & sValueName, const std::string & sDefaultValue); + inline Lib3MF_double GetParameterDoubleValue(const std::string & sNameSpaceName, const std::string & sValueName); + inline Lib3MF_double GetParameterDoubleValueDef(const std::string & sNameSpaceName, const std::string & sValueName, const Lib3MF_double dDefaultValue); + inline Lib3MF_int64 GetParameterIntegerValue(const std::string & sNameSpaceName, const std::string & sValueName); + inline Lib3MF_int64 GetParameterIntegerValueDef(const std::string & sNameSpaceName, const std::string & sValueName, const Lib3MF_int64 nDefaultValue); + inline bool GetParameterBoolValue(const std::string & sNameSpaceName, const std::string & sValueName); + inline bool GetParameterBoolValueDef(const std::string & sNameSpaceName, const std::string & sValueName, const bool bDefaultValue); + inline void SetName(const std::string & sName); + inline void SetParameterValue(const std::string & sNameSpaceName, const std::string & sValueName, const std::string & sValue); + inline void SetParameterDoubleValue(const std::string & sNameSpaceName, const std::string & sValueName, const Lib3MF_double dValue); + inline void SetParameterIntegerValue(const std::string & sNameSpaceName, const std::string & sValueName, const Lib3MF_int64 nValue); + inline void SetParameterBoolValue(const std::string & sNameSpaceName, const std::string & sValueName, const bool bValue); +}; + +/************************************************************************************************************************* + Class CToolpathLayerReader +**************************************************************************************************************************/ +class CToolpathLayerReader : public CBase { +public: + + /** + * CToolpathLayerReader::CToolpathLayerReader - Constructor for ToolpathLayerReader class. + */ + CToolpathLayerReader(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CBase(pWrapper, pHandle) + { + } + + inline std::string GetLayerDataUUID(); + inline Lib3MF_uint32 GetSegmentCount(); + inline void GetSegmentInfo(const Lib3MF_uint32 nIndex, eToolpathSegmentType & eType, Lib3MF_uint32 & nPointCount); + inline PToolpathProfile GetSegmentProfile(const Lib3MF_uint32 nIndex); + inline std::string GetSegmentProfileUUID(const Lib3MF_uint32 nIndex); + inline PBuildItem GetSegmentPart(const Lib3MF_uint32 nIndex); + inline std::string GetSegmentPartUUID(const Lib3MF_uint32 nIndex); + inline Lib3MF_uint32 GetSegmentLocalPartID(const Lib3MF_uint32 nIndex); + inline std::string GetPartUUIDByLocalPartID(const Lib3MF_uint32 nLocalPartID); + inline void GetSegmentPointData(const Lib3MF_uint32 nIndex, std::vector & PointDataBuffer); + inline void FindAttributeInfoByName(const std::string & sNameSpace, const std::string & sAttributeName, Lib3MF_uint32 & nID, eToolpathAttributeType & eAttributeType); + inline Lib3MF_uint32 FindAttributeIDByName(const std::string & sNameSpace, const std::string & sAttributeName); + inline eToolpathAttributeType FindAttributeValueByName(const std::string & sNameSpace, const std::string & sAttributeName); + inline Lib3MF_int64 GetSegmentIntegerAttributeByID(const Lib3MF_uint32 nIndex, const Lib3MF_uint32 nID); + inline Lib3MF_int64 GetSegmentIntegerAttributeByName(const Lib3MF_uint32 nIndex, const std::string & sNameSpace, const std::string & sAttributeName); + inline Lib3MF_double GetSegmentDoubleAttributeByID(const Lib3MF_uint32 nIndex, const Lib3MF_uint32 nID); + inline Lib3MF_double GetSegmentDoubleAttributeByName(const Lib3MF_uint32 nIndex, const std::string & sNameSpace, const std::string & sAttributeName); + inline Lib3MF_uint32 GetCustomDataCount(); + inline PCustomDOMTree GetCustomData(const Lib3MF_uint32 nIndex); + inline void GetCustomDataName(const Lib3MF_uint32 nIndex, std::string & sNameSpace, std::string & sDataName); +}; + +/************************************************************************************************************************* + Class CToolpathLayerData +**************************************************************************************************************************/ +class CToolpathLayerData : public CBase { +public: + + /** + * CToolpathLayerData::CToolpathLayerData - Constructor for ToolpathLayerData class. + */ + CToolpathLayerData(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CBase(pWrapper, pHandle) + { + } + + inline std::string GetLayerDataUUID(); + inline Lib3MF_uint32 RegisterProfile(classParam pProfile); + inline Lib3MF_uint32 RegisterBuildItem(classParam pBuildItem); + inline void SetSegmentAttribute(const std::string & sNameSpace, const std::string & sAttributeName, const std::string & sValue); + inline void ClearSegmentAttributes(); + inline void WriteHatchData(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const CInputVector & PointDataBuffer); + inline void WriteLoop(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const CInputVector & PointDataBuffer); + inline void WritePolyline(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const CInputVector & PointDataBuffer); + inline PCustomDOMTree AddCustomData(const std::string & sNameSpace, const std::string & sDataName); + inline void Finish(); +}; + +/************************************************************************************************************************* + Class CToolpath +**************************************************************************************************************************/ +class CToolpath : public CResource { +public: + + /** + * CToolpath::CToolpath - Constructor for Toolpath class. + */ + CToolpath(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CResource(pWrapper, pHandle) + { + } + + inline Lib3MF_double GetUnits(); + inline Lib3MF_uint32 GetLayerCount(); + inline Lib3MF_uint32 GetProfileCount(); + inline PToolpathLayerData AddLayer(const Lib3MF_uint32 nZMax, const std::string & sPath, classParam pModelWriter); + inline PAttachment GetLayerAttachment(const Lib3MF_uint32 nIndex); + inline PToolpathLayerReader ReadLayerData(const Lib3MF_uint32 nIndex); + inline std::string GetLayerPath(const Lib3MF_uint32 nIndex); + inline Lib3MF_uint32 GetLayerZMax(const Lib3MF_uint32 nIndex); + inline Lib3MF_uint32 GetLayerZ(const Lib3MF_uint32 nLayerIndex); + inline PToolpathProfile AddProfile(const std::string & sName); + inline PToolpathProfile GetProfile(const Lib3MF_uint32 nProfileIndex); + inline PToolpathProfile GetProfileUUID(const std::string & sProfileUUID); + inline Lib3MF_uint32 GetCustomDataCount(); + inline PCustomDOMTree GetCustomData(const Lib3MF_uint32 nIndex); + inline void GetCustomDataName(const Lib3MF_uint32 nIndex, std::string & sNameSpace, std::string & sDataName); + inline bool HasUniqueCustomData(const std::string & sNameSpace, const std::string & sDataName); + inline PCustomDOMTree FindUniqueCustomData(const std::string & sNameSpace, const std::string & sDataName); + inline PCustomDOMTree AddCustomData(const std::string & sNameSpace, const std::string & sDataName); + inline Lib3MF_uint32 ClearCustomData(); + inline bool DeleteCustomData(classParam pData); + inline void RegisterCustomIntegerAttribute(const std::string & sNameSpace, const std::string & sAttributeName); + inline void RegisterCustomDoubleAttribute(const std::string & sNameSpace, const std::string & sAttributeName); +}; + +/************************************************************************************************************************* + Class CToolpathIterator +**************************************************************************************************************************/ +class CToolpathIterator : public CResourceIterator { +public: + + /** + * CToolpathIterator::CToolpathIterator - Constructor for ToolpathIterator class. + */ + CToolpathIterator(CWrapper* pWrapper, Lib3MFHandle pHandle) + : CResourceIterator(pWrapper, pHandle) + { + } + + inline PToolpath GetCurrentToolpath(); +}; + /************************************************************************************************************************* Class CSliceStack **************************************************************************************************************************/ @@ -1614,6 +2004,7 @@ class CModel : public CBase { inline PTexture2DGroupIterator GetTexture2DGroups(); inline PCompositeMaterialsIterator GetCompositeMaterials(); inline PMultiPropertyGroupIterator GetMultiPropertyGroups(); + inline PToolpathIterator GetToolpaths(); inline PSliceStackIterator GetSliceStacks(); inline PModel MergeToModel(); inline PMeshObject AddMeshObject(); @@ -1627,6 +2018,7 @@ class CModel : public CBase { inline PMultiPropertyGroup AddMultiPropertyGroup(); inline PBuildItem AddBuildItem(classParam pObject, const sTransform & Transform); inline void RemoveBuildItem(classParam pBuildItemInstance); + inline PToolpath AddToolpath(const Lib3MF_double dUnitFactor); inline PMetaDataGroup GetMetaDataGroup(); inline PAttachment AddAttachment(const std::string & sURI, const std::string & sRelationShipType); inline void RemoveAttachment(classParam pAttachmentInstance); @@ -1641,6 +2033,9 @@ class CModel : public CBase { inline void RemoveCustomContentType(const std::string & sExtension); inline void SetRandomNumberCallback(const RandomNumberCallback pTheCallback, const Lib3MF_pvoid pUserData); inline PKeyStore GetKeyStore(); + inline PPersistentReaderSource CreatePersistentSourceFromFile(const std::string & sFilename); + inline PPersistentReaderSource CreatePersistentSourceFromBuffer(const CInputVector & BufferBuffer); + inline PPersistentReaderSource CreatePersistentSourceFromCallback(const ReadCallback pTheReadCallback, const Lib3MF_uint64 nStreamSize, const SeekCallback pTheSeekCallback, const Lib3MF_pvoid pUserData); }; /************************************************************************************************************************* @@ -1660,11 +2055,17 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) CheckError(nullptr, m_WrapperTable.m_Base_ClassTypeId(pHandle, &resultClassTypeId)); switch(resultClassTypeId) { case 0x856632D0BAF1D8B7UL: return new CBase(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Base" + case 0xA0EB26254C981E1AUL: return new CBinaryStream(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::BinaryStream" case 0xE76F642F363FD7E9UL: return new CWriter(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Writer" + case 0xBE46884397CE1319UL: return new CPersistentReaderSource(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::PersistentReaderSource" case 0x2D86831DA59FBE72UL: return new CReader(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Reader" case 0x0E55A826D377483EUL: return new CPackagePart(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::PackagePart" case 0xDFE3889D1B269CBBUL: return new CResource(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Resource" case 0x460F3515E2621DBEUL: return new CResourceIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ResourceIterator" + case 0xEA18C54DBD42B5F6UL: return new CCustomXMLAttribute(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::CustomXMLAttribute" + case 0x26B5AD02041EDF96UL: return new CCustomXMLNode(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::CustomXMLNode" + case 0x8C4B47C97D310E89UL: return new CCustomXMLNodes(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::CustomXMLNodes" + case 0x5E0CF70A6DB6256AUL: return new CCustomDOMTree(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::CustomDOMTree" case 0x69684DB99FA813F6UL: return new CSliceStackIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::SliceStackIterator" case 0xDE92510BD2112288UL: return new CObjectIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ObjectIterator" case 0xF4196034E2B9FDE6UL: return new CMeshObjectIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::MeshObjectIterator" @@ -1693,6 +2094,11 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) case 0x68FB2D5FFC4BA12AUL: return new CBuildItem(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::BuildItem" case 0xA7D21BD364910860UL: return new CBuildItemIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::BuildItemIterator" case 0x2198BCF4D8DF9C40UL: return new CSlice(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Slice" + case 0xC869620B90242CA7UL: return new CToolpathProfile(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ToolpathProfile" + case 0x28DD7D3718F0616EUL: return new CToolpathLayerReader(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ToolpathLayerReader" + case 0x28C0E70CC44F931AUL: return new CToolpathLayerData(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ToolpathLayerData" + case 0xF0AAB2C814D9FFB1UL: return new CToolpath(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Toolpath" + case 0xD0F24425A07F2A81UL: return new CToolpathIterator(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::ToolpathIterator" case 0x6594B031B6096238UL: return new CSliceStack(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::SliceStack" case 0xD9E46D5E6D8118EEUL: return new CConsumer(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::Consumer" case 0x385C42FC5609498AUL: return new CAccessRight(this, pHandle); break; // First 64 bits of SHA1 of a string: "Lib3MF::AccessRight" @@ -1988,6 +2394,13 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) pWrapperTable->m_LibraryHandle = nullptr; pWrapperTable->m_Base_ClassTypeId = nullptr; + pWrapperTable->m_BinaryStream_GetBinaryPath = nullptr; + pWrapperTable->m_BinaryStream_GetIndexPath = nullptr; + pWrapperTable->m_BinaryStream_GetUUID = nullptr; + pWrapperTable->m_BinaryStream_DisableDiscretizedArrayCompression = nullptr; + pWrapperTable->m_BinaryStream_EnableDiscretizedArrayCompression = nullptr; + pWrapperTable->m_BinaryStream_EnableLZMA = nullptr; + pWrapperTable->m_BinaryStream_DisableLZMA = nullptr; pWrapperTable->m_Writer_WriteToFile = nullptr; pWrapperTable->m_Writer_GetStreamSize = nullptr; pWrapperTable->m_Writer_WriteToBuffer = nullptr; @@ -2001,6 +2414,13 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) pWrapperTable->m_Writer_GetWarningCount = nullptr; pWrapperTable->m_Writer_AddKeyWrappingCallback = nullptr; pWrapperTable->m_Writer_SetContentEncryptionCallback = nullptr; + pWrapperTable->m_Writer_CreateBinaryStream = nullptr; + pWrapperTable->m_Writer_AssignBinaryStream = nullptr; + pWrapperTable->m_Writer_RegisterCustomNamespace = nullptr; + pWrapperTable->m_PersistentReaderSource_GetSourceType = nullptr; + pWrapperTable->m_PersistentReaderSource_InvalidateSourceData = nullptr; + pWrapperTable->m_PersistentReaderSource_SourceDataIsValid = nullptr; + pWrapperTable->m_Reader_ReadFromPersistentSource = nullptr; pWrapperTable->m_Reader_ReadFromFile = nullptr; pWrapperTable->m_Reader_ReadFromBuffer = nullptr; pWrapperTable->m_Reader_ReadFromCallback = nullptr; @@ -2025,6 +2445,51 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) pWrapperTable->m_ResourceIterator_GetCurrent = nullptr; pWrapperTable->m_ResourceIterator_Clone = nullptr; pWrapperTable->m_ResourceIterator_Count = nullptr; + pWrapperTable->m_CustomXMLAttribute_GetName = nullptr; + pWrapperTable->m_CustomXMLAttribute_GetValue = nullptr; + pWrapperTable->m_CustomXMLAttribute_IsValidInteger = nullptr; + pWrapperTable->m_CustomXMLAttribute_GetIntegerValue = nullptr; + pWrapperTable->m_CustomXMLAttribute_IsValidDouble = nullptr; + pWrapperTable->m_CustomXMLAttribute_GetDoubleValue = nullptr; + pWrapperTable->m_CustomXMLAttribute_IsValidBool = nullptr; + pWrapperTable->m_CustomXMLAttribute_GetBoolValue = nullptr; + pWrapperTable->m_CustomXMLAttribute_SetValue = nullptr; + pWrapperTable->m_CustomXMLAttribute_SetIntegerValue = nullptr; + pWrapperTable->m_CustomXMLAttribute_SetDoubleValue = nullptr; + pWrapperTable->m_CustomXMLAttribute_SetBoolValue = nullptr; + pWrapperTable->m_CustomXMLAttribute_Remove = nullptr; + pWrapperTable->m_CustomXMLNode_GetName = nullptr; + pWrapperTable->m_CustomXMLNode_GetNameSpace = nullptr; + pWrapperTable->m_CustomXMLNode_GetAttributeCount = nullptr; + pWrapperTable->m_CustomXMLNode_GetAttribute = nullptr; + pWrapperTable->m_CustomXMLNode_HasAttribute = nullptr; + pWrapperTable->m_CustomXMLNode_FindAttribute = nullptr; + pWrapperTable->m_CustomXMLNode_RemoveAttribute = nullptr; + pWrapperTable->m_CustomXMLNode_RemoveAttributeByIndex = nullptr; + pWrapperTable->m_CustomXMLNode_AddAttribute = nullptr; + pWrapperTable->m_CustomXMLNode_AddIntegerAttribute = nullptr; + pWrapperTable->m_CustomXMLNode_AddDoubleAttribute = nullptr; + pWrapperTable->m_CustomXMLNode_AddBoolAttribute = nullptr; + pWrapperTable->m_CustomXMLNode_GetChildren = nullptr; + pWrapperTable->m_CustomXMLNode_CountChildrenByName = nullptr; + pWrapperTable->m_CustomXMLNode_GetChildrenByName = nullptr; + pWrapperTable->m_CustomXMLNode_HasChild = nullptr; + pWrapperTable->m_CustomXMLNode_HasUniqueChild = nullptr; + pWrapperTable->m_CustomXMLNode_FindChild = nullptr; + pWrapperTable->m_CustomXMLNode_AddChild = nullptr; + pWrapperTable->m_CustomXMLNode_RemoveChild = nullptr; + pWrapperTable->m_CustomXMLNode_RemoveChildrenWithName = nullptr; + pWrapperTable->m_CustomXMLNode_Remove = nullptr; + pWrapperTable->m_CustomXMLNodes_GetNodeCount = nullptr; + pWrapperTable->m_CustomXMLNodes_GetNode = nullptr; + pWrapperTable->m_CustomXMLNodes_CountNodesByName = nullptr; + pWrapperTable->m_CustomXMLNodes_GetNodesByName = nullptr; + pWrapperTable->m_CustomXMLNodes_HasNode = nullptr; + pWrapperTable->m_CustomXMLNodes_HasUniqueNode = nullptr; + pWrapperTable->m_CustomXMLNodes_FindNode = nullptr; + pWrapperTable->m_CustomDOMTree_GetNameSpace = nullptr; + pWrapperTable->m_CustomDOMTree_GetRootNode = nullptr; + pWrapperTable->m_CustomDOMTree_SaveToString = nullptr; pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack = nullptr; pWrapperTable->m_ObjectIterator_GetCurrentObject = nullptr; pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject = nullptr; @@ -2217,6 +2682,78 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) pWrapperTable->m_Slice_GetPolygonIndices = nullptr; pWrapperTable->m_Slice_GetPolygonIndexCount = nullptr; pWrapperTable->m_Slice_GetZTop = nullptr; + pWrapperTable->m_ToolpathProfile_GetUUID = nullptr; + pWrapperTable->m_ToolpathProfile_GetName = nullptr; + pWrapperTable->m_ToolpathProfile_GetParameterCount = nullptr; + pWrapperTable->m_ToolpathProfile_GetParameterName = nullptr; + pWrapperTable->m_ToolpathProfile_GetParameterNameSpace = nullptr; + pWrapperTable->m_ToolpathProfile_HasParameterValue = nullptr; + pWrapperTable->m_ToolpathProfile_GetParameterValue = nullptr; + pWrapperTable->m_ToolpathProfile_GetParameterValueDef = nullptr; + pWrapperTable->m_ToolpathProfile_GetParameterDoubleValue = nullptr; + pWrapperTable->m_ToolpathProfile_GetParameterDoubleValueDef = nullptr; + pWrapperTable->m_ToolpathProfile_GetParameterIntegerValue = nullptr; + pWrapperTable->m_ToolpathProfile_GetParameterIntegerValueDef = nullptr; + pWrapperTable->m_ToolpathProfile_GetParameterBoolValue = nullptr; + pWrapperTable->m_ToolpathProfile_GetParameterBoolValueDef = nullptr; + pWrapperTable->m_ToolpathProfile_SetName = nullptr; + pWrapperTable->m_ToolpathProfile_SetParameterValue = nullptr; + pWrapperTable->m_ToolpathProfile_SetParameterDoubleValue = nullptr; + pWrapperTable->m_ToolpathProfile_SetParameterIntegerValue = nullptr; + pWrapperTable->m_ToolpathProfile_SetParameterBoolValue = nullptr; + pWrapperTable->m_ToolpathLayerReader_GetLayerDataUUID = nullptr; + pWrapperTable->m_ToolpathLayerReader_GetSegmentCount = nullptr; + pWrapperTable->m_ToolpathLayerReader_GetSegmentInfo = nullptr; + pWrapperTable->m_ToolpathLayerReader_GetSegmentProfile = nullptr; + pWrapperTable->m_ToolpathLayerReader_GetSegmentProfileUUID = nullptr; + pWrapperTable->m_ToolpathLayerReader_GetSegmentPart = nullptr; + pWrapperTable->m_ToolpathLayerReader_GetSegmentPartUUID = nullptr; + pWrapperTable->m_ToolpathLayerReader_GetSegmentLocalPartID = nullptr; + pWrapperTable->m_ToolpathLayerReader_GetPartUUIDByLocalPartID = nullptr; + pWrapperTable->m_ToolpathLayerReader_GetSegmentPointData = nullptr; + pWrapperTable->m_ToolpathLayerReader_FindAttributeInfoByName = nullptr; + pWrapperTable->m_ToolpathLayerReader_FindAttributeIDByName = nullptr; + pWrapperTable->m_ToolpathLayerReader_FindAttributeValueByName = nullptr; + pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByID = nullptr; + pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByName = nullptr; + pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByID = nullptr; + pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByName = nullptr; + pWrapperTable->m_ToolpathLayerReader_GetCustomDataCount = nullptr; + pWrapperTable->m_ToolpathLayerReader_GetCustomData = nullptr; + pWrapperTable->m_ToolpathLayerReader_GetCustomDataName = nullptr; + pWrapperTable->m_ToolpathLayerData_GetLayerDataUUID = nullptr; + pWrapperTable->m_ToolpathLayerData_RegisterProfile = nullptr; + pWrapperTable->m_ToolpathLayerData_RegisterBuildItem = nullptr; + pWrapperTable->m_ToolpathLayerData_SetSegmentAttribute = nullptr; + pWrapperTable->m_ToolpathLayerData_ClearSegmentAttributes = nullptr; + pWrapperTable->m_ToolpathLayerData_WriteHatchData = nullptr; + pWrapperTable->m_ToolpathLayerData_WriteLoop = nullptr; + pWrapperTable->m_ToolpathLayerData_WritePolyline = nullptr; + pWrapperTable->m_ToolpathLayerData_AddCustomData = nullptr; + pWrapperTable->m_ToolpathLayerData_Finish = nullptr; + pWrapperTable->m_Toolpath_GetUnits = nullptr; + pWrapperTable->m_Toolpath_GetLayerCount = nullptr; + pWrapperTable->m_Toolpath_GetProfileCount = nullptr; + pWrapperTable->m_Toolpath_AddLayer = nullptr; + pWrapperTable->m_Toolpath_GetLayerAttachment = nullptr; + pWrapperTable->m_Toolpath_ReadLayerData = nullptr; + pWrapperTable->m_Toolpath_GetLayerPath = nullptr; + pWrapperTable->m_Toolpath_GetLayerZMax = nullptr; + pWrapperTable->m_Toolpath_GetLayerZ = nullptr; + pWrapperTable->m_Toolpath_AddProfile = nullptr; + pWrapperTable->m_Toolpath_GetProfile = nullptr; + pWrapperTable->m_Toolpath_GetProfileUUID = nullptr; + pWrapperTable->m_Toolpath_GetCustomDataCount = nullptr; + pWrapperTable->m_Toolpath_GetCustomData = nullptr; + pWrapperTable->m_Toolpath_GetCustomDataName = nullptr; + pWrapperTable->m_Toolpath_HasUniqueCustomData = nullptr; + pWrapperTable->m_Toolpath_FindUniqueCustomData = nullptr; + pWrapperTable->m_Toolpath_AddCustomData = nullptr; + pWrapperTable->m_Toolpath_ClearCustomData = nullptr; + pWrapperTable->m_Toolpath_DeleteCustomData = nullptr; + pWrapperTable->m_Toolpath_RegisterCustomIntegerAttribute = nullptr; + pWrapperTable->m_Toolpath_RegisterCustomDoubleAttribute = nullptr; + pWrapperTable->m_ToolpathIterator_GetCurrentToolpath = nullptr; pWrapperTable->m_SliceStack_GetBottomZ = nullptr; pWrapperTable->m_SliceStack_GetSliceCount = nullptr; pWrapperTable->m_SliceStack_GetSlice = nullptr; @@ -2300,6 +2837,7 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) pWrapperTable->m_Model_GetTexture2DGroups = nullptr; pWrapperTable->m_Model_GetCompositeMaterials = nullptr; pWrapperTable->m_Model_GetMultiPropertyGroups = nullptr; + pWrapperTable->m_Model_GetToolpaths = nullptr; pWrapperTable->m_Model_GetSliceStacks = nullptr; pWrapperTable->m_Model_MergeToModel = nullptr; pWrapperTable->m_Model_AddMeshObject = nullptr; @@ -2313,6 +2851,7 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) pWrapperTable->m_Model_AddMultiPropertyGroup = nullptr; pWrapperTable->m_Model_AddBuildItem = nullptr; pWrapperTable->m_Model_RemoveBuildItem = nullptr; + pWrapperTable->m_Model_AddToolpath = nullptr; pWrapperTable->m_Model_GetMetaDataGroup = nullptr; pWrapperTable->m_Model_AddAttachment = nullptr; pWrapperTable->m_Model_RemoveAttachment = nullptr; @@ -2327,6 +2866,9 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) pWrapperTable->m_Model_RemoveCustomContentType = nullptr; pWrapperTable->m_Model_SetRandomNumberCallback = nullptr; pWrapperTable->m_Model_GetKeyStore = nullptr; + pWrapperTable->m_Model_CreatePersistentSourceFromFile = nullptr; + pWrapperTable->m_Model_CreatePersistentSourceFromBuffer = nullptr; + pWrapperTable->m_Model_CreatePersistentSourceFromCallback = nullptr; pWrapperTable->m_GetLibraryVersion = nullptr; pWrapperTable->m_GetPrereleaseInformation = nullptr; pWrapperTable->m_GetBuildInformation = nullptr; @@ -2405,6 +2947,69 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) if (pWrapperTable->m_Base_ClassTypeId == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_GetBinaryPath = (PLib3MFBinaryStream_GetBinaryPathPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_getbinarypath"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_GetBinaryPath = (PLib3MFBinaryStream_GetBinaryPathPtr) dlsym(hLibrary, "lib3mf_binarystream_getbinarypath"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_GetBinaryPath == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_GetIndexPath = (PLib3MFBinaryStream_GetIndexPathPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_getindexpath"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_GetIndexPath = (PLib3MFBinaryStream_GetIndexPathPtr) dlsym(hLibrary, "lib3mf_binarystream_getindexpath"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_GetIndexPath == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_GetUUID = (PLib3MFBinaryStream_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_getuuid"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_GetUUID = (PLib3MFBinaryStream_GetUUIDPtr) dlsym(hLibrary, "lib3mf_binarystream_getuuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_GetUUID == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_DisableDiscretizedArrayCompression = (PLib3MFBinaryStream_DisableDiscretizedArrayCompressionPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_disablediscretizedarraycompression"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_DisableDiscretizedArrayCompression = (PLib3MFBinaryStream_DisableDiscretizedArrayCompressionPtr) dlsym(hLibrary, "lib3mf_binarystream_disablediscretizedarraycompression"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_DisableDiscretizedArrayCompression == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_EnableDiscretizedArrayCompression = (PLib3MFBinaryStream_EnableDiscretizedArrayCompressionPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_enablediscretizedarraycompression"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_EnableDiscretizedArrayCompression = (PLib3MFBinaryStream_EnableDiscretizedArrayCompressionPtr) dlsym(hLibrary, "lib3mf_binarystream_enablediscretizedarraycompression"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_EnableDiscretizedArrayCompression == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_EnableLZMA = (PLib3MFBinaryStream_EnableLZMAPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_enablelzma"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_EnableLZMA = (PLib3MFBinaryStream_EnableLZMAPtr) dlsym(hLibrary, "lib3mf_binarystream_enablelzma"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_EnableLZMA == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_DisableLZMA = (PLib3MFBinaryStream_DisableLZMAPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_disablelzma"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_DisableLZMA = (PLib3MFBinaryStream_DisableLZMAPtr) dlsym(hLibrary, "lib3mf_binarystream_disablelzma"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_DisableLZMA == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Writer_WriteToFile = (PLib3MFWriter_WriteToFilePtr) GetProcAddress(hLibrary, "lib3mf_writer_writetofile"); #else // _WIN32 @@ -2522,6 +3127,69 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) if (pWrapperTable->m_Writer_SetContentEncryptionCallback == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Writer_CreateBinaryStream = (PLib3MFWriter_CreateBinaryStreamPtr) GetProcAddress(hLibrary, "lib3mf_writer_createbinarystream"); + #else // _WIN32 + pWrapperTable->m_Writer_CreateBinaryStream = (PLib3MFWriter_CreateBinaryStreamPtr) dlsym(hLibrary, "lib3mf_writer_createbinarystream"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Writer_CreateBinaryStream == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Writer_AssignBinaryStream = (PLib3MFWriter_AssignBinaryStreamPtr) GetProcAddress(hLibrary, "lib3mf_writer_assignbinarystream"); + #else // _WIN32 + pWrapperTable->m_Writer_AssignBinaryStream = (PLib3MFWriter_AssignBinaryStreamPtr) dlsym(hLibrary, "lib3mf_writer_assignbinarystream"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Writer_AssignBinaryStream == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Writer_RegisterCustomNamespace = (PLib3MFWriter_RegisterCustomNamespacePtr) GetProcAddress(hLibrary, "lib3mf_writer_registercustomnamespace"); + #else // _WIN32 + pWrapperTable->m_Writer_RegisterCustomNamespace = (PLib3MFWriter_RegisterCustomNamespacePtr) dlsym(hLibrary, "lib3mf_writer_registercustomnamespace"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Writer_RegisterCustomNamespace == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_PersistentReaderSource_GetSourceType = (PLib3MFPersistentReaderSource_GetSourceTypePtr) GetProcAddress(hLibrary, "lib3mf_persistentreadersource_getsourcetype"); + #else // _WIN32 + pWrapperTable->m_PersistentReaderSource_GetSourceType = (PLib3MFPersistentReaderSource_GetSourceTypePtr) dlsym(hLibrary, "lib3mf_persistentreadersource_getsourcetype"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_PersistentReaderSource_GetSourceType == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_PersistentReaderSource_InvalidateSourceData = (PLib3MFPersistentReaderSource_InvalidateSourceDataPtr) GetProcAddress(hLibrary, "lib3mf_persistentreadersource_invalidatesourcedata"); + #else // _WIN32 + pWrapperTable->m_PersistentReaderSource_InvalidateSourceData = (PLib3MFPersistentReaderSource_InvalidateSourceDataPtr) dlsym(hLibrary, "lib3mf_persistentreadersource_invalidatesourcedata"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_PersistentReaderSource_InvalidateSourceData == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_PersistentReaderSource_SourceDataIsValid = (PLib3MFPersistentReaderSource_SourceDataIsValidPtr) GetProcAddress(hLibrary, "lib3mf_persistentreadersource_sourcedataisvalid"); + #else // _WIN32 + pWrapperTable->m_PersistentReaderSource_SourceDataIsValid = (PLib3MFPersistentReaderSource_SourceDataIsValidPtr) dlsym(hLibrary, "lib3mf_persistentreadersource_sourcedataisvalid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_PersistentReaderSource_SourceDataIsValid == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Reader_ReadFromPersistentSource = (PLib3MFReader_ReadFromPersistentSourcePtr) GetProcAddress(hLibrary, "lib3mf_reader_readfrompersistentsource"); + #else // _WIN32 + pWrapperTable->m_Reader_ReadFromPersistentSource = (PLib3MFReader_ReadFromPersistentSourcePtr) dlsym(hLibrary, "lib3mf_reader_readfrompersistentsource"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Reader_ReadFromPersistentSource == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Reader_ReadFromFile = (PLib3MFReader_ReadFromFilePtr) GetProcAddress(hLibrary, "lib3mf_reader_readfromfile"); #else // _WIN32 @@ -2739,7254 +3407,10701 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack = (PLib3MFSliceStackIterator_GetCurrentSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_slicestackiterator_getcurrentslicestack"); + pWrapperTable->m_CustomXMLAttribute_GetName = (PLib3MFCustomXMLAttribute_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_getname"); #else // _WIN32 - pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack = (PLib3MFSliceStackIterator_GetCurrentSliceStackPtr) dlsym(hLibrary, "lib3mf_slicestackiterator_getcurrentslicestack"); + pWrapperTable->m_CustomXMLAttribute_GetName = (PLib3MFCustomXMLAttribute_GetNamePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_getname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack == nullptr) + if (pWrapperTable->m_CustomXMLAttribute_GetName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ObjectIterator_GetCurrentObject = (PLib3MFObjectIterator_GetCurrentObjectPtr) GetProcAddress(hLibrary, "lib3mf_objectiterator_getcurrentobject"); + pWrapperTable->m_CustomXMLAttribute_GetValue = (PLib3MFCustomXMLAttribute_GetValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_getvalue"); #else // _WIN32 - pWrapperTable->m_ObjectIterator_GetCurrentObject = (PLib3MFObjectIterator_GetCurrentObjectPtr) dlsym(hLibrary, "lib3mf_objectiterator_getcurrentobject"); + pWrapperTable->m_CustomXMLAttribute_GetValue = (PLib3MFCustomXMLAttribute_GetValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_getvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ObjectIterator_GetCurrentObject == nullptr) + if (pWrapperTable->m_CustomXMLAttribute_GetValue == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject = (PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) GetProcAddress(hLibrary, "lib3mf_meshobjectiterator_getcurrentmeshobject"); + pWrapperTable->m_CustomXMLAttribute_IsValidInteger = (PLib3MFCustomXMLAttribute_IsValidIntegerPtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_isvalidinteger"); #else // _WIN32 - pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject = (PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) dlsym(hLibrary, "lib3mf_meshobjectiterator_getcurrentmeshobject"); + pWrapperTable->m_CustomXMLAttribute_IsValidInteger = (PLib3MFCustomXMLAttribute_IsValidIntegerPtr) dlsym(hLibrary, "lib3mf_customxmlattribute_isvalidinteger"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject == nullptr) + if (pWrapperTable->m_CustomXMLAttribute_IsValidInteger == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject = (PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) GetProcAddress(hLibrary, "lib3mf_componentsobjectiterator_getcurrentcomponentsobject"); + pWrapperTable->m_CustomXMLAttribute_GetIntegerValue = (PLib3MFCustomXMLAttribute_GetIntegerValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_getintegervalue"); #else // _WIN32 - pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject = (PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) dlsym(hLibrary, "lib3mf_componentsobjectiterator_getcurrentcomponentsobject"); + pWrapperTable->m_CustomXMLAttribute_GetIntegerValue = (PLib3MFCustomXMLAttribute_GetIntegerValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_getintegervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject == nullptr) + if (pWrapperTable->m_CustomXMLAttribute_GetIntegerValue == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D = (PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) GetProcAddress(hLibrary, "lib3mf_texture2diterator_getcurrenttexture2d"); + pWrapperTable->m_CustomXMLAttribute_IsValidDouble = (PLib3MFCustomXMLAttribute_IsValidDoublePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_isvaliddouble"); #else // _WIN32 - pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D = (PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) dlsym(hLibrary, "lib3mf_texture2diterator_getcurrenttexture2d"); + pWrapperTable->m_CustomXMLAttribute_IsValidDouble = (PLib3MFCustomXMLAttribute_IsValidDoublePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_isvaliddouble"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D == nullptr) + if (pWrapperTable->m_CustomXMLAttribute_IsValidDouble == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup = (PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup"); + pWrapperTable->m_CustomXMLAttribute_GetDoubleValue = (PLib3MFCustomXMLAttribute_GetDoubleValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_getdoublevalue"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup = (PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr) dlsym(hLibrary, "lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup"); + pWrapperTable->m_CustomXMLAttribute_GetDoubleValue = (PLib3MFCustomXMLAttribute_GetDoubleValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_getdoublevalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup == nullptr) + if (pWrapperTable->m_CustomXMLAttribute_GetDoubleValue == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup = (PLib3MFColorGroupIterator_GetCurrentColorGroupPtr) GetProcAddress(hLibrary, "lib3mf_colorgroupiterator_getcurrentcolorgroup"); + pWrapperTable->m_CustomXMLAttribute_IsValidBool = (PLib3MFCustomXMLAttribute_IsValidBoolPtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_isvalidbool"); #else // _WIN32 - pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup = (PLib3MFColorGroupIterator_GetCurrentColorGroupPtr) dlsym(hLibrary, "lib3mf_colorgroupiterator_getcurrentcolorgroup"); + pWrapperTable->m_CustomXMLAttribute_IsValidBool = (PLib3MFCustomXMLAttribute_IsValidBoolPtr) dlsym(hLibrary, "lib3mf_customxmlattribute_isvalidbool"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup == nullptr) + if (pWrapperTable->m_CustomXMLAttribute_IsValidBool == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup = (PLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup"); + pWrapperTable->m_CustomXMLAttribute_GetBoolValue = (PLib3MFCustomXMLAttribute_GetBoolValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_getboolvalue"); #else // _WIN32 - pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup = (PLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupPtr) dlsym(hLibrary, "lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup"); + pWrapperTable->m_CustomXMLAttribute_GetBoolValue = (PLib3MFCustomXMLAttribute_GetBoolValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_getboolvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup == nullptr) + if (pWrapperTable->m_CustomXMLAttribute_GetBoolValue == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials = (PLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsPtr) GetProcAddress(hLibrary, "lib3mf_compositematerialsiterator_getcurrentcompositematerials"); + pWrapperTable->m_CustomXMLAttribute_SetValue = (PLib3MFCustomXMLAttribute_SetValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_setvalue"); #else // _WIN32 - pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials = (PLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsPtr) dlsym(hLibrary, "lib3mf_compositematerialsiterator_getcurrentcompositematerials"); + pWrapperTable->m_CustomXMLAttribute_SetValue = (PLib3MFCustomXMLAttribute_SetValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_setvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials == nullptr) + if (pWrapperTable->m_CustomXMLAttribute_SetValue == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup = (PLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup"); + pWrapperTable->m_CustomXMLAttribute_SetIntegerValue = (PLib3MFCustomXMLAttribute_SetIntegerValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_setintegervalue"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup = (PLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupPtr) dlsym(hLibrary, "lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup"); + pWrapperTable->m_CustomXMLAttribute_SetIntegerValue = (PLib3MFCustomXMLAttribute_SetIntegerValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_setintegervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup == nullptr) + if (pWrapperTable->m_CustomXMLAttribute_SetIntegerValue == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_GetNameSpace = (PLib3MFMetaData_GetNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getnamespace"); + pWrapperTable->m_CustomXMLAttribute_SetDoubleValue = (PLib3MFCustomXMLAttribute_SetDoubleValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_setdoublevalue"); #else // _WIN32 - pWrapperTable->m_MetaData_GetNameSpace = (PLib3MFMetaData_GetNameSpacePtr) dlsym(hLibrary, "lib3mf_metadata_getnamespace"); + pWrapperTable->m_CustomXMLAttribute_SetDoubleValue = (PLib3MFCustomXMLAttribute_SetDoubleValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_setdoublevalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_GetNameSpace == nullptr) + if (pWrapperTable->m_CustomXMLAttribute_SetDoubleValue == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_SetNameSpace = (PLib3MFMetaData_SetNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setnamespace"); + pWrapperTable->m_CustomXMLAttribute_SetBoolValue = (PLib3MFCustomXMLAttribute_SetBoolValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_setboolvalue"); #else // _WIN32 - pWrapperTable->m_MetaData_SetNameSpace = (PLib3MFMetaData_SetNameSpacePtr) dlsym(hLibrary, "lib3mf_metadata_setnamespace"); + pWrapperTable->m_CustomXMLAttribute_SetBoolValue = (PLib3MFCustomXMLAttribute_SetBoolValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_setboolvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_SetNameSpace == nullptr) + if (pWrapperTable->m_CustomXMLAttribute_SetBoolValue == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_GetName = (PLib3MFMetaData_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getname"); + pWrapperTable->m_CustomXMLAttribute_Remove = (PLib3MFCustomXMLAttribute_RemovePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_remove"); #else // _WIN32 - pWrapperTable->m_MetaData_GetName = (PLib3MFMetaData_GetNamePtr) dlsym(hLibrary, "lib3mf_metadata_getname"); + pWrapperTable->m_CustomXMLAttribute_Remove = (PLib3MFCustomXMLAttribute_RemovePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_remove"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_GetName == nullptr) + if (pWrapperTable->m_CustomXMLAttribute_Remove == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_SetName = (PLib3MFMetaData_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setname"); + pWrapperTable->m_CustomXMLNode_GetName = (PLib3MFCustomXMLNode_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_getname"); #else // _WIN32 - pWrapperTable->m_MetaData_SetName = (PLib3MFMetaData_SetNamePtr) dlsym(hLibrary, "lib3mf_metadata_setname"); + pWrapperTable->m_CustomXMLNode_GetName = (PLib3MFCustomXMLNode_GetNamePtr) dlsym(hLibrary, "lib3mf_customxmlnode_getname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_SetName == nullptr) + if (pWrapperTable->m_CustomXMLNode_GetName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_GetKey = (PLib3MFMetaData_GetKeyPtr) GetProcAddress(hLibrary, "lib3mf_metadata_getkey"); + pWrapperTable->m_CustomXMLNode_GetNameSpace = (PLib3MFCustomXMLNode_GetNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_getnamespace"); #else // _WIN32 - pWrapperTable->m_MetaData_GetKey = (PLib3MFMetaData_GetKeyPtr) dlsym(hLibrary, "lib3mf_metadata_getkey"); + pWrapperTable->m_CustomXMLNode_GetNameSpace = (PLib3MFCustomXMLNode_GetNameSpacePtr) dlsym(hLibrary, "lib3mf_customxmlnode_getnamespace"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_GetKey == nullptr) + if (pWrapperTable->m_CustomXMLNode_GetNameSpace == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_GetMustPreserve = (PLib3MFMetaData_GetMustPreservePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getmustpreserve"); + pWrapperTable->m_CustomXMLNode_GetAttributeCount = (PLib3MFCustomXMLNode_GetAttributeCountPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_getattributecount"); #else // _WIN32 - pWrapperTable->m_MetaData_GetMustPreserve = (PLib3MFMetaData_GetMustPreservePtr) dlsym(hLibrary, "lib3mf_metadata_getmustpreserve"); + pWrapperTable->m_CustomXMLNode_GetAttributeCount = (PLib3MFCustomXMLNode_GetAttributeCountPtr) dlsym(hLibrary, "lib3mf_customxmlnode_getattributecount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_GetMustPreserve == nullptr) + if (pWrapperTable->m_CustomXMLNode_GetAttributeCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_SetMustPreserve = (PLib3MFMetaData_SetMustPreservePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setmustpreserve"); + pWrapperTable->m_CustomXMLNode_GetAttribute = (PLib3MFCustomXMLNode_GetAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_getattribute"); #else // _WIN32 - pWrapperTable->m_MetaData_SetMustPreserve = (PLib3MFMetaData_SetMustPreservePtr) dlsym(hLibrary, "lib3mf_metadata_setmustpreserve"); + pWrapperTable->m_CustomXMLNode_GetAttribute = (PLib3MFCustomXMLNode_GetAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_getattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_SetMustPreserve == nullptr) + if (pWrapperTable->m_CustomXMLNode_GetAttribute == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_GetType = (PLib3MFMetaData_GetTypePtr) GetProcAddress(hLibrary, "lib3mf_metadata_gettype"); + pWrapperTable->m_CustomXMLNode_HasAttribute = (PLib3MFCustomXMLNode_HasAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_hasattribute"); #else // _WIN32 - pWrapperTable->m_MetaData_GetType = (PLib3MFMetaData_GetTypePtr) dlsym(hLibrary, "lib3mf_metadata_gettype"); + pWrapperTable->m_CustomXMLNode_HasAttribute = (PLib3MFCustomXMLNode_HasAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_hasattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_GetType == nullptr) + if (pWrapperTable->m_CustomXMLNode_HasAttribute == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_SetType = (PLib3MFMetaData_SetTypePtr) GetProcAddress(hLibrary, "lib3mf_metadata_settype"); + pWrapperTable->m_CustomXMLNode_FindAttribute = (PLib3MFCustomXMLNode_FindAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_findattribute"); #else // _WIN32 - pWrapperTable->m_MetaData_SetType = (PLib3MFMetaData_SetTypePtr) dlsym(hLibrary, "lib3mf_metadata_settype"); + pWrapperTable->m_CustomXMLNode_FindAttribute = (PLib3MFCustomXMLNode_FindAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_findattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_SetType == nullptr) + if (pWrapperTable->m_CustomXMLNode_FindAttribute == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_GetValue = (PLib3MFMetaData_GetValuePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getvalue"); + pWrapperTable->m_CustomXMLNode_RemoveAttribute = (PLib3MFCustomXMLNode_RemoveAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_removeattribute"); #else // _WIN32 - pWrapperTable->m_MetaData_GetValue = (PLib3MFMetaData_GetValuePtr) dlsym(hLibrary, "lib3mf_metadata_getvalue"); + pWrapperTable->m_CustomXMLNode_RemoveAttribute = (PLib3MFCustomXMLNode_RemoveAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_removeattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_GetValue == nullptr) + if (pWrapperTable->m_CustomXMLNode_RemoveAttribute == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_SetValue = (PLib3MFMetaData_SetValuePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setvalue"); + pWrapperTable->m_CustomXMLNode_RemoveAttributeByIndex = (PLib3MFCustomXMLNode_RemoveAttributeByIndexPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_removeattributebyindex"); #else // _WIN32 - pWrapperTable->m_MetaData_SetValue = (PLib3MFMetaData_SetValuePtr) dlsym(hLibrary, "lib3mf_metadata_setvalue"); + pWrapperTable->m_CustomXMLNode_RemoveAttributeByIndex = (PLib3MFCustomXMLNode_RemoveAttributeByIndexPtr) dlsym(hLibrary, "lib3mf_customxmlnode_removeattributebyindex"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_SetValue == nullptr) + if (pWrapperTable->m_CustomXMLNode_RemoveAttributeByIndex == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaDataGroup_GetMetaDataCount = (PLib3MFMetaDataGroup_GetMetaDataCountPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_getmetadatacount"); + pWrapperTable->m_CustomXMLNode_AddAttribute = (PLib3MFCustomXMLNode_AddAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_addattribute"); #else // _WIN32 - pWrapperTable->m_MetaDataGroup_GetMetaDataCount = (PLib3MFMetaDataGroup_GetMetaDataCountPtr) dlsym(hLibrary, "lib3mf_metadatagroup_getmetadatacount"); + pWrapperTable->m_CustomXMLNode_AddAttribute = (PLib3MFCustomXMLNode_AddAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_addattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaDataGroup_GetMetaDataCount == nullptr) + if (pWrapperTable->m_CustomXMLNode_AddAttribute == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaDataGroup_GetMetaData = (PLib3MFMetaDataGroup_GetMetaDataPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_getmetadata"); + pWrapperTable->m_CustomXMLNode_AddIntegerAttribute = (PLib3MFCustomXMLNode_AddIntegerAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_addintegerattribute"); #else // _WIN32 - pWrapperTable->m_MetaDataGroup_GetMetaData = (PLib3MFMetaDataGroup_GetMetaDataPtr) dlsym(hLibrary, "lib3mf_metadatagroup_getmetadata"); + pWrapperTable->m_CustomXMLNode_AddIntegerAttribute = (PLib3MFCustomXMLNode_AddIntegerAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_addintegerattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaDataGroup_GetMetaData == nullptr) + if (pWrapperTable->m_CustomXMLNode_AddIntegerAttribute == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaDataGroup_GetMetaDataByKey = (PLib3MFMetaDataGroup_GetMetaDataByKeyPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_getmetadatabykey"); + pWrapperTable->m_CustomXMLNode_AddDoubleAttribute = (PLib3MFCustomXMLNode_AddDoubleAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_adddoubleattribute"); #else // _WIN32 - pWrapperTable->m_MetaDataGroup_GetMetaDataByKey = (PLib3MFMetaDataGroup_GetMetaDataByKeyPtr) dlsym(hLibrary, "lib3mf_metadatagroup_getmetadatabykey"); + pWrapperTable->m_CustomXMLNode_AddDoubleAttribute = (PLib3MFCustomXMLNode_AddDoubleAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_adddoubleattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaDataGroup_GetMetaDataByKey == nullptr) + if (pWrapperTable->m_CustomXMLNode_AddDoubleAttribute == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex = (PLib3MFMetaDataGroup_RemoveMetaDataByIndexPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_removemetadatabyindex"); + pWrapperTable->m_CustomXMLNode_AddBoolAttribute = (PLib3MFCustomXMLNode_AddBoolAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_addboolattribute"); #else // _WIN32 - pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex = (PLib3MFMetaDataGroup_RemoveMetaDataByIndexPtr) dlsym(hLibrary, "lib3mf_metadatagroup_removemetadatabyindex"); + pWrapperTable->m_CustomXMLNode_AddBoolAttribute = (PLib3MFCustomXMLNode_AddBoolAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_addboolattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex == nullptr) + if (pWrapperTable->m_CustomXMLNode_AddBoolAttribute == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaDataGroup_RemoveMetaData = (PLib3MFMetaDataGroup_RemoveMetaDataPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_removemetadata"); + pWrapperTable->m_CustomXMLNode_GetChildren = (PLib3MFCustomXMLNode_GetChildrenPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_getchildren"); #else // _WIN32 - pWrapperTable->m_MetaDataGroup_RemoveMetaData = (PLib3MFMetaDataGroup_RemoveMetaDataPtr) dlsym(hLibrary, "lib3mf_metadatagroup_removemetadata"); + pWrapperTable->m_CustomXMLNode_GetChildren = (PLib3MFCustomXMLNode_GetChildrenPtr) dlsym(hLibrary, "lib3mf_customxmlnode_getchildren"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaDataGroup_RemoveMetaData == nullptr) + if (pWrapperTable->m_CustomXMLNode_GetChildren == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaDataGroup_AddMetaData = (PLib3MFMetaDataGroup_AddMetaDataPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_addmetadata"); + pWrapperTable->m_CustomXMLNode_CountChildrenByName = (PLib3MFCustomXMLNode_CountChildrenByNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_countchildrenbyname"); #else // _WIN32 - pWrapperTable->m_MetaDataGroup_AddMetaData = (PLib3MFMetaDataGroup_AddMetaDataPtr) dlsym(hLibrary, "lib3mf_metadatagroup_addmetadata"); + pWrapperTable->m_CustomXMLNode_CountChildrenByName = (PLib3MFCustomXMLNode_CountChildrenByNamePtr) dlsym(hLibrary, "lib3mf_customxmlnode_countchildrenbyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaDataGroup_AddMetaData == nullptr) + if (pWrapperTable->m_CustomXMLNode_CountChildrenByName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetType = (PLib3MFObject_GetTypePtr) GetProcAddress(hLibrary, "lib3mf_object_gettype"); + pWrapperTable->m_CustomXMLNode_GetChildrenByName = (PLib3MFCustomXMLNode_GetChildrenByNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_getchildrenbyname"); #else // _WIN32 - pWrapperTable->m_Object_GetType = (PLib3MFObject_GetTypePtr) dlsym(hLibrary, "lib3mf_object_gettype"); + pWrapperTable->m_CustomXMLNode_GetChildrenByName = (PLib3MFCustomXMLNode_GetChildrenByNamePtr) dlsym(hLibrary, "lib3mf_customxmlnode_getchildrenbyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetType == nullptr) + if (pWrapperTable->m_CustomXMLNode_GetChildrenByName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_SetType = (PLib3MFObject_SetTypePtr) GetProcAddress(hLibrary, "lib3mf_object_settype"); + pWrapperTable->m_CustomXMLNode_HasChild = (PLib3MFCustomXMLNode_HasChildPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_haschild"); #else // _WIN32 - pWrapperTable->m_Object_SetType = (PLib3MFObject_SetTypePtr) dlsym(hLibrary, "lib3mf_object_settype"); + pWrapperTable->m_CustomXMLNode_HasChild = (PLib3MFCustomXMLNode_HasChildPtr) dlsym(hLibrary, "lib3mf_customxmlnode_haschild"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_SetType == nullptr) + if (pWrapperTable->m_CustomXMLNode_HasChild == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetName = (PLib3MFObject_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_object_getname"); + pWrapperTable->m_CustomXMLNode_HasUniqueChild = (PLib3MFCustomXMLNode_HasUniqueChildPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_hasuniquechild"); #else // _WIN32 - pWrapperTable->m_Object_GetName = (PLib3MFObject_GetNamePtr) dlsym(hLibrary, "lib3mf_object_getname"); + pWrapperTable->m_CustomXMLNode_HasUniqueChild = (PLib3MFCustomXMLNode_HasUniqueChildPtr) dlsym(hLibrary, "lib3mf_customxmlnode_hasuniquechild"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetName == nullptr) + if (pWrapperTable->m_CustomXMLNode_HasUniqueChild == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_SetName = (PLib3MFObject_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_object_setname"); + pWrapperTable->m_CustomXMLNode_FindChild = (PLib3MFCustomXMLNode_FindChildPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_findchild"); #else // _WIN32 - pWrapperTable->m_Object_SetName = (PLib3MFObject_SetNamePtr) dlsym(hLibrary, "lib3mf_object_setname"); + pWrapperTable->m_CustomXMLNode_FindChild = (PLib3MFCustomXMLNode_FindChildPtr) dlsym(hLibrary, "lib3mf_customxmlnode_findchild"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_SetName == nullptr) + if (pWrapperTable->m_CustomXMLNode_FindChild == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetPartNumber = (PLib3MFObject_GetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_object_getpartnumber"); + pWrapperTable->m_CustomXMLNode_AddChild = (PLib3MFCustomXMLNode_AddChildPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_addchild"); #else // _WIN32 - pWrapperTable->m_Object_GetPartNumber = (PLib3MFObject_GetPartNumberPtr) dlsym(hLibrary, "lib3mf_object_getpartnumber"); + pWrapperTable->m_CustomXMLNode_AddChild = (PLib3MFCustomXMLNode_AddChildPtr) dlsym(hLibrary, "lib3mf_customxmlnode_addchild"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetPartNumber == nullptr) + if (pWrapperTable->m_CustomXMLNode_AddChild == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_SetPartNumber = (PLib3MFObject_SetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_object_setpartnumber"); + pWrapperTable->m_CustomXMLNode_RemoveChild = (PLib3MFCustomXMLNode_RemoveChildPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_removechild"); #else // _WIN32 - pWrapperTable->m_Object_SetPartNumber = (PLib3MFObject_SetPartNumberPtr) dlsym(hLibrary, "lib3mf_object_setpartnumber"); + pWrapperTable->m_CustomXMLNode_RemoveChild = (PLib3MFCustomXMLNode_RemoveChildPtr) dlsym(hLibrary, "lib3mf_customxmlnode_removechild"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_SetPartNumber == nullptr) + if (pWrapperTable->m_CustomXMLNode_RemoveChild == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_IsMeshObject = (PLib3MFObject_IsMeshObjectPtr) GetProcAddress(hLibrary, "lib3mf_object_ismeshobject"); + pWrapperTable->m_CustomXMLNode_RemoveChildrenWithName = (PLib3MFCustomXMLNode_RemoveChildrenWithNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_removechildrenwithname"); #else // _WIN32 - pWrapperTable->m_Object_IsMeshObject = (PLib3MFObject_IsMeshObjectPtr) dlsym(hLibrary, "lib3mf_object_ismeshobject"); + pWrapperTable->m_CustomXMLNode_RemoveChildrenWithName = (PLib3MFCustomXMLNode_RemoveChildrenWithNamePtr) dlsym(hLibrary, "lib3mf_customxmlnode_removechildrenwithname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_IsMeshObject == nullptr) + if (pWrapperTable->m_CustomXMLNode_RemoveChildrenWithName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_IsComponentsObject = (PLib3MFObject_IsComponentsObjectPtr) GetProcAddress(hLibrary, "lib3mf_object_iscomponentsobject"); + pWrapperTable->m_CustomXMLNode_Remove = (PLib3MFCustomXMLNode_RemovePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_remove"); #else // _WIN32 - pWrapperTable->m_Object_IsComponentsObject = (PLib3MFObject_IsComponentsObjectPtr) dlsym(hLibrary, "lib3mf_object_iscomponentsobject"); + pWrapperTable->m_CustomXMLNode_Remove = (PLib3MFCustomXMLNode_RemovePtr) dlsym(hLibrary, "lib3mf_customxmlnode_remove"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_IsComponentsObject == nullptr) + if (pWrapperTable->m_CustomXMLNode_Remove == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_IsValid = (PLib3MFObject_IsValidPtr) GetProcAddress(hLibrary, "lib3mf_object_isvalid"); + pWrapperTable->m_CustomXMLNodes_GetNodeCount = (PLib3MFCustomXMLNodes_GetNodeCountPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_getnodecount"); #else // _WIN32 - pWrapperTable->m_Object_IsValid = (PLib3MFObject_IsValidPtr) dlsym(hLibrary, "lib3mf_object_isvalid"); + pWrapperTable->m_CustomXMLNodes_GetNodeCount = (PLib3MFCustomXMLNodes_GetNodeCountPtr) dlsym(hLibrary, "lib3mf_customxmlnodes_getnodecount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_IsValid == nullptr) + if (pWrapperTable->m_CustomXMLNodes_GetNodeCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_SetAttachmentAsThumbnail = (PLib3MFObject_SetAttachmentAsThumbnailPtr) GetProcAddress(hLibrary, "lib3mf_object_setattachmentasthumbnail"); + pWrapperTable->m_CustomXMLNodes_GetNode = (PLib3MFCustomXMLNodes_GetNodePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_getnode"); #else // _WIN32 - pWrapperTable->m_Object_SetAttachmentAsThumbnail = (PLib3MFObject_SetAttachmentAsThumbnailPtr) dlsym(hLibrary, "lib3mf_object_setattachmentasthumbnail"); + pWrapperTable->m_CustomXMLNodes_GetNode = (PLib3MFCustomXMLNodes_GetNodePtr) dlsym(hLibrary, "lib3mf_customxmlnodes_getnode"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_SetAttachmentAsThumbnail == nullptr) + if (pWrapperTable->m_CustomXMLNodes_GetNode == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetThumbnailAttachment = (PLib3MFObject_GetThumbnailAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_object_getthumbnailattachment"); + pWrapperTable->m_CustomXMLNodes_CountNodesByName = (PLib3MFCustomXMLNodes_CountNodesByNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_countnodesbyname"); #else // _WIN32 - pWrapperTable->m_Object_GetThumbnailAttachment = (PLib3MFObject_GetThumbnailAttachmentPtr) dlsym(hLibrary, "lib3mf_object_getthumbnailattachment"); + pWrapperTable->m_CustomXMLNodes_CountNodesByName = (PLib3MFCustomXMLNodes_CountNodesByNamePtr) dlsym(hLibrary, "lib3mf_customxmlnodes_countnodesbyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetThumbnailAttachment == nullptr) + if (pWrapperTable->m_CustomXMLNodes_CountNodesByName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_ClearThumbnailAttachment = (PLib3MFObject_ClearThumbnailAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_object_clearthumbnailattachment"); + pWrapperTable->m_CustomXMLNodes_GetNodesByName = (PLib3MFCustomXMLNodes_GetNodesByNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_getnodesbyname"); #else // _WIN32 - pWrapperTable->m_Object_ClearThumbnailAttachment = (PLib3MFObject_ClearThumbnailAttachmentPtr) dlsym(hLibrary, "lib3mf_object_clearthumbnailattachment"); + pWrapperTable->m_CustomXMLNodes_GetNodesByName = (PLib3MFCustomXMLNodes_GetNodesByNamePtr) dlsym(hLibrary, "lib3mf_customxmlnodes_getnodesbyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_ClearThumbnailAttachment == nullptr) + if (pWrapperTable->m_CustomXMLNodes_GetNodesByName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetOutbox = (PLib3MFObject_GetOutboxPtr) GetProcAddress(hLibrary, "lib3mf_object_getoutbox"); + pWrapperTable->m_CustomXMLNodes_HasNode = (PLib3MFCustomXMLNodes_HasNodePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_hasnode"); #else // _WIN32 - pWrapperTable->m_Object_GetOutbox = (PLib3MFObject_GetOutboxPtr) dlsym(hLibrary, "lib3mf_object_getoutbox"); + pWrapperTable->m_CustomXMLNodes_HasNode = (PLib3MFCustomXMLNodes_HasNodePtr) dlsym(hLibrary, "lib3mf_customxmlnodes_hasnode"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetOutbox == nullptr) + if (pWrapperTable->m_CustomXMLNodes_HasNode == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetUUID = (PLib3MFObject_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_object_getuuid"); + pWrapperTable->m_CustomXMLNodes_HasUniqueNode = (PLib3MFCustomXMLNodes_HasUniqueNodePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_hasuniquenode"); #else // _WIN32 - pWrapperTable->m_Object_GetUUID = (PLib3MFObject_GetUUIDPtr) dlsym(hLibrary, "lib3mf_object_getuuid"); + pWrapperTable->m_CustomXMLNodes_HasUniqueNode = (PLib3MFCustomXMLNodes_HasUniqueNodePtr) dlsym(hLibrary, "lib3mf_customxmlnodes_hasuniquenode"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetUUID == nullptr) + if (pWrapperTable->m_CustomXMLNodes_HasUniqueNode == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_SetUUID = (PLib3MFObject_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_object_setuuid"); + pWrapperTable->m_CustomXMLNodes_FindNode = (PLib3MFCustomXMLNodes_FindNodePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_findnode"); #else // _WIN32 - pWrapperTable->m_Object_SetUUID = (PLib3MFObject_SetUUIDPtr) dlsym(hLibrary, "lib3mf_object_setuuid"); + pWrapperTable->m_CustomXMLNodes_FindNode = (PLib3MFCustomXMLNodes_FindNodePtr) dlsym(hLibrary, "lib3mf_customxmlnodes_findnode"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_SetUUID == nullptr) + if (pWrapperTable->m_CustomXMLNodes_FindNode == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetMetaDataGroup = (PLib3MFObject_GetMetaDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_object_getmetadatagroup"); + pWrapperTable->m_CustomDOMTree_GetNameSpace = (PLib3MFCustomDOMTree_GetNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_customdomtree_getnamespace"); #else // _WIN32 - pWrapperTable->m_Object_GetMetaDataGroup = (PLib3MFObject_GetMetaDataGroupPtr) dlsym(hLibrary, "lib3mf_object_getmetadatagroup"); + pWrapperTable->m_CustomDOMTree_GetNameSpace = (PLib3MFCustomDOMTree_GetNameSpacePtr) dlsym(hLibrary, "lib3mf_customdomtree_getnamespace"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetMetaDataGroup == nullptr) + if (pWrapperTable->m_CustomDOMTree_GetNameSpace == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_SetSlicesMeshResolution = (PLib3MFObject_SetSlicesMeshResolutionPtr) GetProcAddress(hLibrary, "lib3mf_object_setslicesmeshresolution"); + pWrapperTable->m_CustomDOMTree_GetRootNode = (PLib3MFCustomDOMTree_GetRootNodePtr) GetProcAddress(hLibrary, "lib3mf_customdomtree_getrootnode"); #else // _WIN32 - pWrapperTable->m_Object_SetSlicesMeshResolution = (PLib3MFObject_SetSlicesMeshResolutionPtr) dlsym(hLibrary, "lib3mf_object_setslicesmeshresolution"); + pWrapperTable->m_CustomDOMTree_GetRootNode = (PLib3MFCustomDOMTree_GetRootNodePtr) dlsym(hLibrary, "lib3mf_customdomtree_getrootnode"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_SetSlicesMeshResolution == nullptr) + if (pWrapperTable->m_CustomDOMTree_GetRootNode == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetSlicesMeshResolution = (PLib3MFObject_GetSlicesMeshResolutionPtr) GetProcAddress(hLibrary, "lib3mf_object_getslicesmeshresolution"); + pWrapperTable->m_CustomDOMTree_SaveToString = (PLib3MFCustomDOMTree_SaveToStringPtr) GetProcAddress(hLibrary, "lib3mf_customdomtree_savetostring"); #else // _WIN32 - pWrapperTable->m_Object_GetSlicesMeshResolution = (PLib3MFObject_GetSlicesMeshResolutionPtr) dlsym(hLibrary, "lib3mf_object_getslicesmeshresolution"); + pWrapperTable->m_CustomDOMTree_SaveToString = (PLib3MFCustomDOMTree_SaveToStringPtr) dlsym(hLibrary, "lib3mf_customdomtree_savetostring"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetSlicesMeshResolution == nullptr) + if (pWrapperTable->m_CustomDOMTree_SaveToString == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_HasSlices = (PLib3MFObject_HasSlicesPtr) GetProcAddress(hLibrary, "lib3mf_object_hasslices"); + pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack = (PLib3MFSliceStackIterator_GetCurrentSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_slicestackiterator_getcurrentslicestack"); #else // _WIN32 - pWrapperTable->m_Object_HasSlices = (PLib3MFObject_HasSlicesPtr) dlsym(hLibrary, "lib3mf_object_hasslices"); + pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack = (PLib3MFSliceStackIterator_GetCurrentSliceStackPtr) dlsym(hLibrary, "lib3mf_slicestackiterator_getcurrentslicestack"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_HasSlices == nullptr) + if (pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_ClearSliceStack = (PLib3MFObject_ClearSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_object_clearslicestack"); + pWrapperTable->m_ObjectIterator_GetCurrentObject = (PLib3MFObjectIterator_GetCurrentObjectPtr) GetProcAddress(hLibrary, "lib3mf_objectiterator_getcurrentobject"); #else // _WIN32 - pWrapperTable->m_Object_ClearSliceStack = (PLib3MFObject_ClearSliceStackPtr) dlsym(hLibrary, "lib3mf_object_clearslicestack"); + pWrapperTable->m_ObjectIterator_GetCurrentObject = (PLib3MFObjectIterator_GetCurrentObjectPtr) dlsym(hLibrary, "lib3mf_objectiterator_getcurrentobject"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_ClearSliceStack == nullptr) + if (pWrapperTable->m_ObjectIterator_GetCurrentObject == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetSliceStack = (PLib3MFObject_GetSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_object_getslicestack"); + pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject = (PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) GetProcAddress(hLibrary, "lib3mf_meshobjectiterator_getcurrentmeshobject"); #else // _WIN32 - pWrapperTable->m_Object_GetSliceStack = (PLib3MFObject_GetSliceStackPtr) dlsym(hLibrary, "lib3mf_object_getslicestack"); + pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject = (PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) dlsym(hLibrary, "lib3mf_meshobjectiterator_getcurrentmeshobject"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetSliceStack == nullptr) + if (pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_AssignSliceStack = (PLib3MFObject_AssignSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_object_assignslicestack"); + pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject = (PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) GetProcAddress(hLibrary, "lib3mf_componentsobjectiterator_getcurrentcomponentsobject"); #else // _WIN32 - pWrapperTable->m_Object_AssignSliceStack = (PLib3MFObject_AssignSliceStackPtr) dlsym(hLibrary, "lib3mf_object_assignslicestack"); + pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject = (PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) dlsym(hLibrary, "lib3mf_componentsobjectiterator_getcurrentcomponentsobject"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_AssignSliceStack == nullptr) + if (pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetVertexCount = (PLib3MFMeshObject_GetVertexCountPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getvertexcount"); + pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D = (PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) GetProcAddress(hLibrary, "lib3mf_texture2diterator_getcurrenttexture2d"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetVertexCount = (PLib3MFMeshObject_GetVertexCountPtr) dlsym(hLibrary, "lib3mf_meshobject_getvertexcount"); + pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D = (PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) dlsym(hLibrary, "lib3mf_texture2diterator_getcurrenttexture2d"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetVertexCount == nullptr) + if (pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetTriangleCount = (PLib3MFMeshObject_GetTriangleCountPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettrianglecount"); + pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup = (PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetTriangleCount = (PLib3MFMeshObject_GetTriangleCountPtr) dlsym(hLibrary, "lib3mf_meshobject_gettrianglecount"); + pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup = (PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr) dlsym(hLibrary, "lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetTriangleCount == nullptr) + if (pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetVertex = (PLib3MFMeshObject_GetVertexPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getvertex"); + pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup = (PLib3MFColorGroupIterator_GetCurrentColorGroupPtr) GetProcAddress(hLibrary, "lib3mf_colorgroupiterator_getcurrentcolorgroup"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetVertex = (PLib3MFMeshObject_GetVertexPtr) dlsym(hLibrary, "lib3mf_meshobject_getvertex"); + pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup = (PLib3MFColorGroupIterator_GetCurrentColorGroupPtr) dlsym(hLibrary, "lib3mf_colorgroupiterator_getcurrentcolorgroup"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetVertex == nullptr) + if (pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_SetVertex = (PLib3MFMeshObject_SetVertexPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setvertex"); + pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup = (PLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup"); #else // _WIN32 - pWrapperTable->m_MeshObject_SetVertex = (PLib3MFMeshObject_SetVertexPtr) dlsym(hLibrary, "lib3mf_meshobject_setvertex"); + pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup = (PLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupPtr) dlsym(hLibrary, "lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_SetVertex == nullptr) + if (pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_AddVertex = (PLib3MFMeshObject_AddVertexPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_addvertex"); + pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials = (PLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsPtr) GetProcAddress(hLibrary, "lib3mf_compositematerialsiterator_getcurrentcompositematerials"); #else // _WIN32 - pWrapperTable->m_MeshObject_AddVertex = (PLib3MFMeshObject_AddVertexPtr) dlsym(hLibrary, "lib3mf_meshobject_addvertex"); + pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials = (PLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsPtr) dlsym(hLibrary, "lib3mf_compositematerialsiterator_getcurrentcompositematerials"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_AddVertex == nullptr) + if (pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetVertices = (PLib3MFMeshObject_GetVerticesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getvertices"); + pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup = (PLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetVertices = (PLib3MFMeshObject_GetVerticesPtr) dlsym(hLibrary, "lib3mf_meshobject_getvertices"); + pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup = (PLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupPtr) dlsym(hLibrary, "lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetVertices == nullptr) + if (pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetTriangle = (PLib3MFMeshObject_GetTrianglePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettriangle"); + pWrapperTable->m_MetaData_GetNameSpace = (PLib3MFMetaData_GetNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getnamespace"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetTriangle = (PLib3MFMeshObject_GetTrianglePtr) dlsym(hLibrary, "lib3mf_meshobject_gettriangle"); + pWrapperTable->m_MetaData_GetNameSpace = (PLib3MFMetaData_GetNameSpacePtr) dlsym(hLibrary, "lib3mf_metadata_getnamespace"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetTriangle == nullptr) + if (pWrapperTable->m_MetaData_GetNameSpace == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_SetTriangle = (PLib3MFMeshObject_SetTrianglePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_settriangle"); + pWrapperTable->m_MetaData_SetNameSpace = (PLib3MFMetaData_SetNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setnamespace"); #else // _WIN32 - pWrapperTable->m_MeshObject_SetTriangle = (PLib3MFMeshObject_SetTrianglePtr) dlsym(hLibrary, "lib3mf_meshobject_settriangle"); + pWrapperTable->m_MetaData_SetNameSpace = (PLib3MFMetaData_SetNameSpacePtr) dlsym(hLibrary, "lib3mf_metadata_setnamespace"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_SetTriangle == nullptr) + if (pWrapperTable->m_MetaData_SetNameSpace == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_AddTriangle = (PLib3MFMeshObject_AddTrianglePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_addtriangle"); + pWrapperTable->m_MetaData_GetName = (PLib3MFMetaData_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getname"); #else // _WIN32 - pWrapperTable->m_MeshObject_AddTriangle = (PLib3MFMeshObject_AddTrianglePtr) dlsym(hLibrary, "lib3mf_meshobject_addtriangle"); + pWrapperTable->m_MetaData_GetName = (PLib3MFMetaData_GetNamePtr) dlsym(hLibrary, "lib3mf_metadata_getname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_AddTriangle == nullptr) + if (pWrapperTable->m_MetaData_GetName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetTriangleIndices = (PLib3MFMeshObject_GetTriangleIndicesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettriangleindices"); + pWrapperTable->m_MetaData_SetName = (PLib3MFMetaData_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setname"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetTriangleIndices = (PLib3MFMeshObject_GetTriangleIndicesPtr) dlsym(hLibrary, "lib3mf_meshobject_gettriangleindices"); + pWrapperTable->m_MetaData_SetName = (PLib3MFMetaData_SetNamePtr) dlsym(hLibrary, "lib3mf_metadata_setname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetTriangleIndices == nullptr) + if (pWrapperTable->m_MetaData_SetName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_SetObjectLevelProperty = (PLib3MFMeshObject_SetObjectLevelPropertyPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setobjectlevelproperty"); + pWrapperTable->m_MetaData_GetKey = (PLib3MFMetaData_GetKeyPtr) GetProcAddress(hLibrary, "lib3mf_metadata_getkey"); #else // _WIN32 - pWrapperTable->m_MeshObject_SetObjectLevelProperty = (PLib3MFMeshObject_SetObjectLevelPropertyPtr) dlsym(hLibrary, "lib3mf_meshobject_setobjectlevelproperty"); + pWrapperTable->m_MetaData_GetKey = (PLib3MFMetaData_GetKeyPtr) dlsym(hLibrary, "lib3mf_metadata_getkey"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_SetObjectLevelProperty == nullptr) + if (pWrapperTable->m_MetaData_GetKey == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetObjectLevelProperty = (PLib3MFMeshObject_GetObjectLevelPropertyPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getobjectlevelproperty"); + pWrapperTable->m_MetaData_GetMustPreserve = (PLib3MFMetaData_GetMustPreservePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getmustpreserve"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetObjectLevelProperty = (PLib3MFMeshObject_GetObjectLevelPropertyPtr) dlsym(hLibrary, "lib3mf_meshobject_getobjectlevelproperty"); + pWrapperTable->m_MetaData_GetMustPreserve = (PLib3MFMetaData_GetMustPreservePtr) dlsym(hLibrary, "lib3mf_metadata_getmustpreserve"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetObjectLevelProperty == nullptr) + if (pWrapperTable->m_MetaData_GetMustPreserve == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_SetTriangleProperties = (PLib3MFMeshObject_SetTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_settriangleproperties"); + pWrapperTable->m_MetaData_SetMustPreserve = (PLib3MFMetaData_SetMustPreservePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setmustpreserve"); #else // _WIN32 - pWrapperTable->m_MeshObject_SetTriangleProperties = (PLib3MFMeshObject_SetTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_settriangleproperties"); + pWrapperTable->m_MetaData_SetMustPreserve = (PLib3MFMetaData_SetMustPreservePtr) dlsym(hLibrary, "lib3mf_metadata_setmustpreserve"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_SetTriangleProperties == nullptr) + if (pWrapperTable->m_MetaData_SetMustPreserve == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetTriangleProperties = (PLib3MFMeshObject_GetTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettriangleproperties"); + pWrapperTable->m_MetaData_GetType = (PLib3MFMetaData_GetTypePtr) GetProcAddress(hLibrary, "lib3mf_metadata_gettype"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetTriangleProperties = (PLib3MFMeshObject_GetTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_gettriangleproperties"); + pWrapperTable->m_MetaData_GetType = (PLib3MFMetaData_GetTypePtr) dlsym(hLibrary, "lib3mf_metadata_gettype"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetTriangleProperties == nullptr) + if (pWrapperTable->m_MetaData_GetType == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_SetAllTriangleProperties = (PLib3MFMeshObject_SetAllTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setalltriangleproperties"); + pWrapperTable->m_MetaData_SetType = (PLib3MFMetaData_SetTypePtr) GetProcAddress(hLibrary, "lib3mf_metadata_settype"); #else // _WIN32 - pWrapperTable->m_MeshObject_SetAllTriangleProperties = (PLib3MFMeshObject_SetAllTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_setalltriangleproperties"); + pWrapperTable->m_MetaData_SetType = (PLib3MFMetaData_SetTypePtr) dlsym(hLibrary, "lib3mf_metadata_settype"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_SetAllTriangleProperties == nullptr) + if (pWrapperTable->m_MetaData_SetType == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetAllTriangleProperties = (PLib3MFMeshObject_GetAllTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getalltriangleproperties"); + pWrapperTable->m_MetaData_GetValue = (PLib3MFMetaData_GetValuePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getvalue"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetAllTriangleProperties = (PLib3MFMeshObject_GetAllTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_getalltriangleproperties"); + pWrapperTable->m_MetaData_GetValue = (PLib3MFMetaData_GetValuePtr) dlsym(hLibrary, "lib3mf_metadata_getvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetAllTriangleProperties == nullptr) + if (pWrapperTable->m_MetaData_GetValue == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_ClearAllProperties = (PLib3MFMeshObject_ClearAllPropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_clearallproperties"); + pWrapperTable->m_MetaData_SetValue = (PLib3MFMetaData_SetValuePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setvalue"); #else // _WIN32 - pWrapperTable->m_MeshObject_ClearAllProperties = (PLib3MFMeshObject_ClearAllPropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_clearallproperties"); + pWrapperTable->m_MetaData_SetValue = (PLib3MFMetaData_SetValuePtr) dlsym(hLibrary, "lib3mf_metadata_setvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_ClearAllProperties == nullptr) + if (pWrapperTable->m_MetaData_SetValue == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_SetGeometry = (PLib3MFMeshObject_SetGeometryPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setgeometry"); + pWrapperTable->m_MetaDataGroup_GetMetaDataCount = (PLib3MFMetaDataGroup_GetMetaDataCountPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_getmetadatacount"); #else // _WIN32 - pWrapperTable->m_MeshObject_SetGeometry = (PLib3MFMeshObject_SetGeometryPtr) dlsym(hLibrary, "lib3mf_meshobject_setgeometry"); + pWrapperTable->m_MetaDataGroup_GetMetaDataCount = (PLib3MFMetaDataGroup_GetMetaDataCountPtr) dlsym(hLibrary, "lib3mf_metadatagroup_getmetadatacount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_SetGeometry == nullptr) + if (pWrapperTable->m_MetaDataGroup_GetMetaDataCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_IsManifoldAndOriented = (PLib3MFMeshObject_IsManifoldAndOrientedPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_ismanifoldandoriented"); + pWrapperTable->m_MetaDataGroup_GetMetaData = (PLib3MFMetaDataGroup_GetMetaDataPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_getmetadata"); #else // _WIN32 - pWrapperTable->m_MeshObject_IsManifoldAndOriented = (PLib3MFMeshObject_IsManifoldAndOrientedPtr) dlsym(hLibrary, "lib3mf_meshobject_ismanifoldandoriented"); + pWrapperTable->m_MetaDataGroup_GetMetaData = (PLib3MFMetaDataGroup_GetMetaDataPtr) dlsym(hLibrary, "lib3mf_metadatagroup_getmetadata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_IsManifoldAndOriented == nullptr) + if (pWrapperTable->m_MetaDataGroup_GetMetaData == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_BeamLattice = (PLib3MFMeshObject_BeamLatticePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_beamlattice"); + pWrapperTable->m_MetaDataGroup_GetMetaDataByKey = (PLib3MFMetaDataGroup_GetMetaDataByKeyPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_getmetadatabykey"); #else // _WIN32 - pWrapperTable->m_MeshObject_BeamLattice = (PLib3MFMeshObject_BeamLatticePtr) dlsym(hLibrary, "lib3mf_meshobject_beamlattice"); + pWrapperTable->m_MetaDataGroup_GetMetaDataByKey = (PLib3MFMetaDataGroup_GetMetaDataByKeyPtr) dlsym(hLibrary, "lib3mf_metadatagroup_getmetadatabykey"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_BeamLattice == nullptr) + if (pWrapperTable->m_MetaDataGroup_GetMetaDataByKey == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetMinLength = (PLib3MFBeamLattice_GetMinLengthPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getminlength"); + pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex = (PLib3MFMetaDataGroup_RemoveMetaDataByIndexPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_removemetadatabyindex"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetMinLength = (PLib3MFBeamLattice_GetMinLengthPtr) dlsym(hLibrary, "lib3mf_beamlattice_getminlength"); + pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex = (PLib3MFMetaDataGroup_RemoveMetaDataByIndexPtr) dlsym(hLibrary, "lib3mf_metadatagroup_removemetadatabyindex"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetMinLength == nullptr) + if (pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetMinLength = (PLib3MFBeamLattice_SetMinLengthPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setminlength"); + pWrapperTable->m_MetaDataGroup_RemoveMetaData = (PLib3MFMetaDataGroup_RemoveMetaDataPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_removemetadata"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetMinLength = (PLib3MFBeamLattice_SetMinLengthPtr) dlsym(hLibrary, "lib3mf_beamlattice_setminlength"); + pWrapperTable->m_MetaDataGroup_RemoveMetaData = (PLib3MFMetaDataGroup_RemoveMetaDataPtr) dlsym(hLibrary, "lib3mf_metadatagroup_removemetadata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetMinLength == nullptr) + if (pWrapperTable->m_MetaDataGroup_RemoveMetaData == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetClipping = (PLib3MFBeamLattice_GetClippingPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getclipping"); + pWrapperTable->m_MetaDataGroup_AddMetaData = (PLib3MFMetaDataGroup_AddMetaDataPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_addmetadata"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetClipping = (PLib3MFBeamLattice_GetClippingPtr) dlsym(hLibrary, "lib3mf_beamlattice_getclipping"); + pWrapperTable->m_MetaDataGroup_AddMetaData = (PLib3MFMetaDataGroup_AddMetaDataPtr) dlsym(hLibrary, "lib3mf_metadatagroup_addmetadata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetClipping == nullptr) + if (pWrapperTable->m_MetaDataGroup_AddMetaData == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetClipping = (PLib3MFBeamLattice_SetClippingPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setclipping"); + pWrapperTable->m_Object_GetType = (PLib3MFObject_GetTypePtr) GetProcAddress(hLibrary, "lib3mf_object_gettype"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetClipping = (PLib3MFBeamLattice_SetClippingPtr) dlsym(hLibrary, "lib3mf_beamlattice_setclipping"); + pWrapperTable->m_Object_GetType = (PLib3MFObject_GetTypePtr) dlsym(hLibrary, "lib3mf_object_gettype"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetClipping == nullptr) + if (pWrapperTable->m_Object_GetType == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetRepresentation = (PLib3MFBeamLattice_GetRepresentationPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getrepresentation"); + pWrapperTable->m_Object_SetType = (PLib3MFObject_SetTypePtr) GetProcAddress(hLibrary, "lib3mf_object_settype"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetRepresentation = (PLib3MFBeamLattice_GetRepresentationPtr) dlsym(hLibrary, "lib3mf_beamlattice_getrepresentation"); + pWrapperTable->m_Object_SetType = (PLib3MFObject_SetTypePtr) dlsym(hLibrary, "lib3mf_object_settype"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetRepresentation == nullptr) + if (pWrapperTable->m_Object_SetType == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetRepresentation = (PLib3MFBeamLattice_SetRepresentationPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setrepresentation"); + pWrapperTable->m_Object_GetName = (PLib3MFObject_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_object_getname"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetRepresentation = (PLib3MFBeamLattice_SetRepresentationPtr) dlsym(hLibrary, "lib3mf_beamlattice_setrepresentation"); + pWrapperTable->m_Object_GetName = (PLib3MFObject_GetNamePtr) dlsym(hLibrary, "lib3mf_object_getname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetRepresentation == nullptr) + if (pWrapperTable->m_Object_GetName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBallOptions = (PLib3MFBeamLattice_GetBallOptionsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getballoptions"); + pWrapperTable->m_Object_SetName = (PLib3MFObject_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_object_setname"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBallOptions = (PLib3MFBeamLattice_GetBallOptionsPtr) dlsym(hLibrary, "lib3mf_beamlattice_getballoptions"); + pWrapperTable->m_Object_SetName = (PLib3MFObject_SetNamePtr) dlsym(hLibrary, "lib3mf_object_setname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBallOptions == nullptr) + if (pWrapperTable->m_Object_SetName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetBallOptions = (PLib3MFBeamLattice_SetBallOptionsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setballoptions"); + pWrapperTable->m_Object_GetPartNumber = (PLib3MFObject_GetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_object_getpartnumber"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetBallOptions = (PLib3MFBeamLattice_SetBallOptionsPtr) dlsym(hLibrary, "lib3mf_beamlattice_setballoptions"); + pWrapperTable->m_Object_GetPartNumber = (PLib3MFObject_GetPartNumberPtr) dlsym(hLibrary, "lib3mf_object_getpartnumber"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetBallOptions == nullptr) + if (pWrapperTable->m_Object_GetPartNumber == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBeamCount = (PLib3MFBeamLattice_GetBeamCountPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeamcount"); + pWrapperTable->m_Object_SetPartNumber = (PLib3MFObject_SetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_object_setpartnumber"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBeamCount = (PLib3MFBeamLattice_GetBeamCountPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeamcount"); + pWrapperTable->m_Object_SetPartNumber = (PLib3MFObject_SetPartNumberPtr) dlsym(hLibrary, "lib3mf_object_setpartnumber"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBeamCount == nullptr) + if (pWrapperTable->m_Object_SetPartNumber == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBeam = (PLib3MFBeamLattice_GetBeamPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeam"); + pWrapperTable->m_Object_IsMeshObject = (PLib3MFObject_IsMeshObjectPtr) GetProcAddress(hLibrary, "lib3mf_object_ismeshobject"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBeam = (PLib3MFBeamLattice_GetBeamPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeam"); + pWrapperTable->m_Object_IsMeshObject = (PLib3MFObject_IsMeshObjectPtr) dlsym(hLibrary, "lib3mf_object_ismeshobject"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBeam == nullptr) + if (pWrapperTable->m_Object_IsMeshObject == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_AddBeam = (PLib3MFBeamLattice_AddBeamPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_addbeam"); + pWrapperTable->m_Object_IsComponentsObject = (PLib3MFObject_IsComponentsObjectPtr) GetProcAddress(hLibrary, "lib3mf_object_iscomponentsobject"); #else // _WIN32 - pWrapperTable->m_BeamLattice_AddBeam = (PLib3MFBeamLattice_AddBeamPtr) dlsym(hLibrary, "lib3mf_beamlattice_addbeam"); + pWrapperTable->m_Object_IsComponentsObject = (PLib3MFObject_IsComponentsObjectPtr) dlsym(hLibrary, "lib3mf_object_iscomponentsobject"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_AddBeam == nullptr) + if (pWrapperTable->m_Object_IsComponentsObject == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetBeam = (PLib3MFBeamLattice_SetBeamPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setbeam"); + pWrapperTable->m_Object_IsValid = (PLib3MFObject_IsValidPtr) GetProcAddress(hLibrary, "lib3mf_object_isvalid"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetBeam = (PLib3MFBeamLattice_SetBeamPtr) dlsym(hLibrary, "lib3mf_beamlattice_setbeam"); + pWrapperTable->m_Object_IsValid = (PLib3MFObject_IsValidPtr) dlsym(hLibrary, "lib3mf_object_isvalid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetBeam == nullptr) + if (pWrapperTable->m_Object_IsValid == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetBeams = (PLib3MFBeamLattice_SetBeamsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setbeams"); + pWrapperTable->m_Object_SetAttachmentAsThumbnail = (PLib3MFObject_SetAttachmentAsThumbnailPtr) GetProcAddress(hLibrary, "lib3mf_object_setattachmentasthumbnail"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetBeams = (PLib3MFBeamLattice_SetBeamsPtr) dlsym(hLibrary, "lib3mf_beamlattice_setbeams"); + pWrapperTable->m_Object_SetAttachmentAsThumbnail = (PLib3MFObject_SetAttachmentAsThumbnailPtr) dlsym(hLibrary, "lib3mf_object_setattachmentasthumbnail"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetBeams == nullptr) + if (pWrapperTable->m_Object_SetAttachmentAsThumbnail == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBeams = (PLib3MFBeamLattice_GetBeamsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeams"); + pWrapperTable->m_Object_GetThumbnailAttachment = (PLib3MFObject_GetThumbnailAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_object_getthumbnailattachment"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBeams = (PLib3MFBeamLattice_GetBeamsPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeams"); + pWrapperTable->m_Object_GetThumbnailAttachment = (PLib3MFObject_GetThumbnailAttachmentPtr) dlsym(hLibrary, "lib3mf_object_getthumbnailattachment"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBeams == nullptr) + if (pWrapperTable->m_Object_GetThumbnailAttachment == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBallCount = (PLib3MFBeamLattice_GetBallCountPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getballcount"); + pWrapperTable->m_Object_ClearThumbnailAttachment = (PLib3MFObject_ClearThumbnailAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_object_clearthumbnailattachment"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBallCount = (PLib3MFBeamLattice_GetBallCountPtr) dlsym(hLibrary, "lib3mf_beamlattice_getballcount"); + pWrapperTable->m_Object_ClearThumbnailAttachment = (PLib3MFObject_ClearThumbnailAttachmentPtr) dlsym(hLibrary, "lib3mf_object_clearthumbnailattachment"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBallCount == nullptr) + if (pWrapperTable->m_Object_ClearThumbnailAttachment == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBall = (PLib3MFBeamLattice_GetBallPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getball"); + pWrapperTable->m_Object_GetOutbox = (PLib3MFObject_GetOutboxPtr) GetProcAddress(hLibrary, "lib3mf_object_getoutbox"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBall = (PLib3MFBeamLattice_GetBallPtr) dlsym(hLibrary, "lib3mf_beamlattice_getball"); + pWrapperTable->m_Object_GetOutbox = (PLib3MFObject_GetOutboxPtr) dlsym(hLibrary, "lib3mf_object_getoutbox"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBall == nullptr) + if (pWrapperTable->m_Object_GetOutbox == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_AddBall = (PLib3MFBeamLattice_AddBallPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_addball"); + pWrapperTable->m_Object_GetUUID = (PLib3MFObject_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_object_getuuid"); #else // _WIN32 - pWrapperTable->m_BeamLattice_AddBall = (PLib3MFBeamLattice_AddBallPtr) dlsym(hLibrary, "lib3mf_beamlattice_addball"); + pWrapperTable->m_Object_GetUUID = (PLib3MFObject_GetUUIDPtr) dlsym(hLibrary, "lib3mf_object_getuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_AddBall == nullptr) + if (pWrapperTable->m_Object_GetUUID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetBall = (PLib3MFBeamLattice_SetBallPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setball"); + pWrapperTable->m_Object_SetUUID = (PLib3MFObject_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_object_setuuid"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetBall = (PLib3MFBeamLattice_SetBallPtr) dlsym(hLibrary, "lib3mf_beamlattice_setball"); + pWrapperTable->m_Object_SetUUID = (PLib3MFObject_SetUUIDPtr) dlsym(hLibrary, "lib3mf_object_setuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetBall == nullptr) + if (pWrapperTable->m_Object_SetUUID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetBalls = (PLib3MFBeamLattice_SetBallsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setballs"); + pWrapperTable->m_Object_GetMetaDataGroup = (PLib3MFObject_GetMetaDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_object_getmetadatagroup"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetBalls = (PLib3MFBeamLattice_SetBallsPtr) dlsym(hLibrary, "lib3mf_beamlattice_setballs"); + pWrapperTable->m_Object_GetMetaDataGroup = (PLib3MFObject_GetMetaDataGroupPtr) dlsym(hLibrary, "lib3mf_object_getmetadatagroup"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetBalls == nullptr) + if (pWrapperTable->m_Object_GetMetaDataGroup == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBalls = (PLib3MFBeamLattice_GetBallsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getballs"); + pWrapperTable->m_Object_SetSlicesMeshResolution = (PLib3MFObject_SetSlicesMeshResolutionPtr) GetProcAddress(hLibrary, "lib3mf_object_setslicesmeshresolution"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBalls = (PLib3MFBeamLattice_GetBallsPtr) dlsym(hLibrary, "lib3mf_beamlattice_getballs"); + pWrapperTable->m_Object_SetSlicesMeshResolution = (PLib3MFObject_SetSlicesMeshResolutionPtr) dlsym(hLibrary, "lib3mf_object_setslicesmeshresolution"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBalls == nullptr) + if (pWrapperTable->m_Object_SetSlicesMeshResolution == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBeamSetCount = (PLib3MFBeamLattice_GetBeamSetCountPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeamsetcount"); + pWrapperTable->m_Object_GetSlicesMeshResolution = (PLib3MFObject_GetSlicesMeshResolutionPtr) GetProcAddress(hLibrary, "lib3mf_object_getslicesmeshresolution"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBeamSetCount = (PLib3MFBeamLattice_GetBeamSetCountPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeamsetcount"); + pWrapperTable->m_Object_GetSlicesMeshResolution = (PLib3MFObject_GetSlicesMeshResolutionPtr) dlsym(hLibrary, "lib3mf_object_getslicesmeshresolution"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBeamSetCount == nullptr) + if (pWrapperTable->m_Object_GetSlicesMeshResolution == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_AddBeamSet = (PLib3MFBeamLattice_AddBeamSetPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_addbeamset"); + pWrapperTable->m_Object_HasSlices = (PLib3MFObject_HasSlicesPtr) GetProcAddress(hLibrary, "lib3mf_object_hasslices"); #else // _WIN32 - pWrapperTable->m_BeamLattice_AddBeamSet = (PLib3MFBeamLattice_AddBeamSetPtr) dlsym(hLibrary, "lib3mf_beamlattice_addbeamset"); + pWrapperTable->m_Object_HasSlices = (PLib3MFObject_HasSlicesPtr) dlsym(hLibrary, "lib3mf_object_hasslices"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_AddBeamSet == nullptr) + if (pWrapperTable->m_Object_HasSlices == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBeamSet = (PLib3MFBeamLattice_GetBeamSetPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeamset"); + pWrapperTable->m_Object_ClearSliceStack = (PLib3MFObject_ClearSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_object_clearslicestack"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBeamSet = (PLib3MFBeamLattice_GetBeamSetPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeamset"); + pWrapperTable->m_Object_ClearSliceStack = (PLib3MFObject_ClearSliceStackPtr) dlsym(hLibrary, "lib3mf_object_clearslicestack"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBeamSet == nullptr) + if (pWrapperTable->m_Object_ClearSliceStack == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_GetObjectResource = (PLib3MFComponent_GetObjectResourcePtr) GetProcAddress(hLibrary, "lib3mf_component_getobjectresource"); + pWrapperTable->m_Object_GetSliceStack = (PLib3MFObject_GetSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_object_getslicestack"); #else // _WIN32 - pWrapperTable->m_Component_GetObjectResource = (PLib3MFComponent_GetObjectResourcePtr) dlsym(hLibrary, "lib3mf_component_getobjectresource"); + pWrapperTable->m_Object_GetSliceStack = (PLib3MFObject_GetSliceStackPtr) dlsym(hLibrary, "lib3mf_object_getslicestack"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_GetObjectResource == nullptr) + if (pWrapperTable->m_Object_GetSliceStack == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_GetObjectResourceID = (PLib3MFComponent_GetObjectResourceIDPtr) GetProcAddress(hLibrary, "lib3mf_component_getobjectresourceid"); + pWrapperTable->m_Object_AssignSliceStack = (PLib3MFObject_AssignSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_object_assignslicestack"); #else // _WIN32 - pWrapperTable->m_Component_GetObjectResourceID = (PLib3MFComponent_GetObjectResourceIDPtr) dlsym(hLibrary, "lib3mf_component_getobjectresourceid"); + pWrapperTable->m_Object_AssignSliceStack = (PLib3MFObject_AssignSliceStackPtr) dlsym(hLibrary, "lib3mf_object_assignslicestack"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_GetObjectResourceID == nullptr) + if (pWrapperTable->m_Object_AssignSliceStack == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_GetUUID = (PLib3MFComponent_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_component_getuuid"); + pWrapperTable->m_MeshObject_GetVertexCount = (PLib3MFMeshObject_GetVertexCountPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getvertexcount"); #else // _WIN32 - pWrapperTable->m_Component_GetUUID = (PLib3MFComponent_GetUUIDPtr) dlsym(hLibrary, "lib3mf_component_getuuid"); + pWrapperTable->m_MeshObject_GetVertexCount = (PLib3MFMeshObject_GetVertexCountPtr) dlsym(hLibrary, "lib3mf_meshobject_getvertexcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_GetUUID == nullptr) + if (pWrapperTable->m_MeshObject_GetVertexCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_SetUUID = (PLib3MFComponent_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_component_setuuid"); + pWrapperTable->m_MeshObject_GetTriangleCount = (PLib3MFMeshObject_GetTriangleCountPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettrianglecount"); #else // _WIN32 - pWrapperTable->m_Component_SetUUID = (PLib3MFComponent_SetUUIDPtr) dlsym(hLibrary, "lib3mf_component_setuuid"); + pWrapperTable->m_MeshObject_GetTriangleCount = (PLib3MFMeshObject_GetTriangleCountPtr) dlsym(hLibrary, "lib3mf_meshobject_gettrianglecount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_SetUUID == nullptr) + if (pWrapperTable->m_MeshObject_GetTriangleCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_HasTransform = (PLib3MFComponent_HasTransformPtr) GetProcAddress(hLibrary, "lib3mf_component_hastransform"); + pWrapperTable->m_MeshObject_GetVertex = (PLib3MFMeshObject_GetVertexPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getvertex"); #else // _WIN32 - pWrapperTable->m_Component_HasTransform = (PLib3MFComponent_HasTransformPtr) dlsym(hLibrary, "lib3mf_component_hastransform"); + pWrapperTable->m_MeshObject_GetVertex = (PLib3MFMeshObject_GetVertexPtr) dlsym(hLibrary, "lib3mf_meshobject_getvertex"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_HasTransform == nullptr) + if (pWrapperTable->m_MeshObject_GetVertex == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_GetTransform = (PLib3MFComponent_GetTransformPtr) GetProcAddress(hLibrary, "lib3mf_component_gettransform"); + pWrapperTable->m_MeshObject_SetVertex = (PLib3MFMeshObject_SetVertexPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setvertex"); #else // _WIN32 - pWrapperTable->m_Component_GetTransform = (PLib3MFComponent_GetTransformPtr) dlsym(hLibrary, "lib3mf_component_gettransform"); + pWrapperTable->m_MeshObject_SetVertex = (PLib3MFMeshObject_SetVertexPtr) dlsym(hLibrary, "lib3mf_meshobject_setvertex"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_GetTransform == nullptr) + if (pWrapperTable->m_MeshObject_SetVertex == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_SetTransform = (PLib3MFComponent_SetTransformPtr) GetProcAddress(hLibrary, "lib3mf_component_settransform"); + pWrapperTable->m_MeshObject_AddVertex = (PLib3MFMeshObject_AddVertexPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_addvertex"); #else // _WIN32 - pWrapperTable->m_Component_SetTransform = (PLib3MFComponent_SetTransformPtr) dlsym(hLibrary, "lib3mf_component_settransform"); + pWrapperTable->m_MeshObject_AddVertex = (PLib3MFMeshObject_AddVertexPtr) dlsym(hLibrary, "lib3mf_meshobject_addvertex"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_SetTransform == nullptr) + if (pWrapperTable->m_MeshObject_AddVertex == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ComponentsObject_AddComponent = (PLib3MFComponentsObject_AddComponentPtr) GetProcAddress(hLibrary, "lib3mf_componentsobject_addcomponent"); + pWrapperTable->m_MeshObject_GetVertices = (PLib3MFMeshObject_GetVerticesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getvertices"); #else // _WIN32 - pWrapperTable->m_ComponentsObject_AddComponent = (PLib3MFComponentsObject_AddComponentPtr) dlsym(hLibrary, "lib3mf_componentsobject_addcomponent"); + pWrapperTable->m_MeshObject_GetVertices = (PLib3MFMeshObject_GetVerticesPtr) dlsym(hLibrary, "lib3mf_meshobject_getvertices"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ComponentsObject_AddComponent == nullptr) + if (pWrapperTable->m_MeshObject_GetVertices == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ComponentsObject_GetComponent = (PLib3MFComponentsObject_GetComponentPtr) GetProcAddress(hLibrary, "lib3mf_componentsobject_getcomponent"); + pWrapperTable->m_MeshObject_GetTriangle = (PLib3MFMeshObject_GetTrianglePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettriangle"); #else // _WIN32 - pWrapperTable->m_ComponentsObject_GetComponent = (PLib3MFComponentsObject_GetComponentPtr) dlsym(hLibrary, "lib3mf_componentsobject_getcomponent"); + pWrapperTable->m_MeshObject_GetTriangle = (PLib3MFMeshObject_GetTrianglePtr) dlsym(hLibrary, "lib3mf_meshobject_gettriangle"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ComponentsObject_GetComponent == nullptr) + if (pWrapperTable->m_MeshObject_GetTriangle == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ComponentsObject_GetComponentCount = (PLib3MFComponentsObject_GetComponentCountPtr) GetProcAddress(hLibrary, "lib3mf_componentsobject_getcomponentcount"); + pWrapperTable->m_MeshObject_SetTriangle = (PLib3MFMeshObject_SetTrianglePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_settriangle"); #else // _WIN32 - pWrapperTable->m_ComponentsObject_GetComponentCount = (PLib3MFComponentsObject_GetComponentCountPtr) dlsym(hLibrary, "lib3mf_componentsobject_getcomponentcount"); + pWrapperTable->m_MeshObject_SetTriangle = (PLib3MFMeshObject_SetTrianglePtr) dlsym(hLibrary, "lib3mf_meshobject_settriangle"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ComponentsObject_GetComponentCount == nullptr) + if (pWrapperTable->m_MeshObject_SetTriangle == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_SetName = (PLib3MFBeamSet_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_beamset_setname"); + pWrapperTable->m_MeshObject_AddTriangle = (PLib3MFMeshObject_AddTrianglePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_addtriangle"); #else // _WIN32 - pWrapperTable->m_BeamSet_SetName = (PLib3MFBeamSet_SetNamePtr) dlsym(hLibrary, "lib3mf_beamset_setname"); + pWrapperTable->m_MeshObject_AddTriangle = (PLib3MFMeshObject_AddTrianglePtr) dlsym(hLibrary, "lib3mf_meshobject_addtriangle"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_SetName == nullptr) + if (pWrapperTable->m_MeshObject_AddTriangle == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_GetName = (PLib3MFBeamSet_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_beamset_getname"); + pWrapperTable->m_MeshObject_GetTriangleIndices = (PLib3MFMeshObject_GetTriangleIndicesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettriangleindices"); #else // _WIN32 - pWrapperTable->m_BeamSet_GetName = (PLib3MFBeamSet_GetNamePtr) dlsym(hLibrary, "lib3mf_beamset_getname"); + pWrapperTable->m_MeshObject_GetTriangleIndices = (PLib3MFMeshObject_GetTriangleIndicesPtr) dlsym(hLibrary, "lib3mf_meshobject_gettriangleindices"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_GetName == nullptr) + if (pWrapperTable->m_MeshObject_GetTriangleIndices == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_SetIdentifier = (PLib3MFBeamSet_SetIdentifierPtr) GetProcAddress(hLibrary, "lib3mf_beamset_setidentifier"); + pWrapperTable->m_MeshObject_SetObjectLevelProperty = (PLib3MFMeshObject_SetObjectLevelPropertyPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setobjectlevelproperty"); #else // _WIN32 - pWrapperTable->m_BeamSet_SetIdentifier = (PLib3MFBeamSet_SetIdentifierPtr) dlsym(hLibrary, "lib3mf_beamset_setidentifier"); + pWrapperTable->m_MeshObject_SetObjectLevelProperty = (PLib3MFMeshObject_SetObjectLevelPropertyPtr) dlsym(hLibrary, "lib3mf_meshobject_setobjectlevelproperty"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_SetIdentifier == nullptr) + if (pWrapperTable->m_MeshObject_SetObjectLevelProperty == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_GetIdentifier = (PLib3MFBeamSet_GetIdentifierPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getidentifier"); + pWrapperTable->m_MeshObject_GetObjectLevelProperty = (PLib3MFMeshObject_GetObjectLevelPropertyPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getobjectlevelproperty"); #else // _WIN32 - pWrapperTable->m_BeamSet_GetIdentifier = (PLib3MFBeamSet_GetIdentifierPtr) dlsym(hLibrary, "lib3mf_beamset_getidentifier"); + pWrapperTable->m_MeshObject_GetObjectLevelProperty = (PLib3MFMeshObject_GetObjectLevelPropertyPtr) dlsym(hLibrary, "lib3mf_meshobject_getobjectlevelproperty"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_GetIdentifier == nullptr) + if (pWrapperTable->m_MeshObject_GetObjectLevelProperty == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_GetReferenceCount = (PLib3MFBeamSet_GetReferenceCountPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getreferencecount"); + pWrapperTable->m_MeshObject_SetTriangleProperties = (PLib3MFMeshObject_SetTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_settriangleproperties"); #else // _WIN32 - pWrapperTable->m_BeamSet_GetReferenceCount = (PLib3MFBeamSet_GetReferenceCountPtr) dlsym(hLibrary, "lib3mf_beamset_getreferencecount"); + pWrapperTable->m_MeshObject_SetTriangleProperties = (PLib3MFMeshObject_SetTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_settriangleproperties"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_GetReferenceCount == nullptr) + if (pWrapperTable->m_MeshObject_SetTriangleProperties == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_SetReferences = (PLib3MFBeamSet_SetReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_setreferences"); + pWrapperTable->m_MeshObject_GetTriangleProperties = (PLib3MFMeshObject_GetTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettriangleproperties"); #else // _WIN32 - pWrapperTable->m_BeamSet_SetReferences = (PLib3MFBeamSet_SetReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_setreferences"); + pWrapperTable->m_MeshObject_GetTriangleProperties = (PLib3MFMeshObject_GetTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_gettriangleproperties"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_SetReferences == nullptr) + if (pWrapperTable->m_MeshObject_GetTriangleProperties == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_GetReferences = (PLib3MFBeamSet_GetReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getreferences"); + pWrapperTable->m_MeshObject_SetAllTriangleProperties = (PLib3MFMeshObject_SetAllTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setalltriangleproperties"); #else // _WIN32 - pWrapperTable->m_BeamSet_GetReferences = (PLib3MFBeamSet_GetReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_getreferences"); + pWrapperTable->m_MeshObject_SetAllTriangleProperties = (PLib3MFMeshObject_SetAllTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_setalltriangleproperties"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_GetReferences == nullptr) + if (pWrapperTable->m_MeshObject_SetAllTriangleProperties == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_GetBallReferenceCount = (PLib3MFBeamSet_GetBallReferenceCountPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getballreferencecount"); + pWrapperTable->m_MeshObject_GetAllTriangleProperties = (PLib3MFMeshObject_GetAllTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getalltriangleproperties"); #else // _WIN32 - pWrapperTable->m_BeamSet_GetBallReferenceCount = (PLib3MFBeamSet_GetBallReferenceCountPtr) dlsym(hLibrary, "lib3mf_beamset_getballreferencecount"); + pWrapperTable->m_MeshObject_GetAllTriangleProperties = (PLib3MFMeshObject_GetAllTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_getalltriangleproperties"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_GetBallReferenceCount == nullptr) + if (pWrapperTable->m_MeshObject_GetAllTriangleProperties == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_SetBallReferences = (PLib3MFBeamSet_SetBallReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_setballreferences"); + pWrapperTable->m_MeshObject_ClearAllProperties = (PLib3MFMeshObject_ClearAllPropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_clearallproperties"); #else // _WIN32 - pWrapperTable->m_BeamSet_SetBallReferences = (PLib3MFBeamSet_SetBallReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_setballreferences"); + pWrapperTable->m_MeshObject_ClearAllProperties = (PLib3MFMeshObject_ClearAllPropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_clearallproperties"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_SetBallReferences == nullptr) + if (pWrapperTable->m_MeshObject_ClearAllProperties == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_GetBallReferences = (PLib3MFBeamSet_GetBallReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getballreferences"); + pWrapperTable->m_MeshObject_SetGeometry = (PLib3MFMeshObject_SetGeometryPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setgeometry"); #else // _WIN32 - pWrapperTable->m_BeamSet_GetBallReferences = (PLib3MFBeamSet_GetBallReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_getballreferences"); + pWrapperTable->m_MeshObject_SetGeometry = (PLib3MFMeshObject_SetGeometryPtr) dlsym(hLibrary, "lib3mf_meshobject_setgeometry"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_GetBallReferences == nullptr) + if (pWrapperTable->m_MeshObject_SetGeometry == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetCount = (PLib3MFBaseMaterialGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getcount"); + pWrapperTable->m_MeshObject_IsManifoldAndOriented = (PLib3MFMeshObject_IsManifoldAndOrientedPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_ismanifoldandoriented"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetCount = (PLib3MFBaseMaterialGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getcount"); + pWrapperTable->m_MeshObject_IsManifoldAndOriented = (PLib3MFMeshObject_IsManifoldAndOrientedPtr) dlsym(hLibrary, "lib3mf_meshobject_ismanifoldandoriented"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_GetCount == nullptr) + if (pWrapperTable->m_MeshObject_IsManifoldAndOriented == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs = (PLib3MFBaseMaterialGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getallpropertyids"); + pWrapperTable->m_MeshObject_BeamLattice = (PLib3MFMeshObject_BeamLatticePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_beamlattice"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs = (PLib3MFBaseMaterialGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getallpropertyids"); + pWrapperTable->m_MeshObject_BeamLattice = (PLib3MFMeshObject_BeamLatticePtr) dlsym(hLibrary, "lib3mf_meshobject_beamlattice"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs == nullptr) + if (pWrapperTable->m_MeshObject_BeamLattice == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_AddMaterial = (PLib3MFBaseMaterialGroup_AddMaterialPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_addmaterial"); + pWrapperTable->m_BeamLattice_GetMinLength = (PLib3MFBeamLattice_GetMinLengthPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getminlength"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_AddMaterial = (PLib3MFBaseMaterialGroup_AddMaterialPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_addmaterial"); + pWrapperTable->m_BeamLattice_GetMinLength = (PLib3MFBeamLattice_GetMinLengthPtr) dlsym(hLibrary, "lib3mf_beamlattice_getminlength"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_AddMaterial == nullptr) + if (pWrapperTable->m_BeamLattice_GetMinLength == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_RemoveMaterial = (PLib3MFBaseMaterialGroup_RemoveMaterialPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_removematerial"); + pWrapperTable->m_BeamLattice_SetMinLength = (PLib3MFBeamLattice_SetMinLengthPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setminlength"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_RemoveMaterial = (PLib3MFBaseMaterialGroup_RemoveMaterialPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_removematerial"); + pWrapperTable->m_BeamLattice_SetMinLength = (PLib3MFBeamLattice_SetMinLengthPtr) dlsym(hLibrary, "lib3mf_beamlattice_setminlength"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_RemoveMaterial == nullptr) + if (pWrapperTable->m_BeamLattice_SetMinLength == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetName = (PLib3MFBaseMaterialGroup_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getname"); + pWrapperTable->m_BeamLattice_GetClipping = (PLib3MFBeamLattice_GetClippingPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getclipping"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetName = (PLib3MFBaseMaterialGroup_GetNamePtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getname"); + pWrapperTable->m_BeamLattice_GetClipping = (PLib3MFBeamLattice_GetClippingPtr) dlsym(hLibrary, "lib3mf_beamlattice_getclipping"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_GetName == nullptr) + if (pWrapperTable->m_BeamLattice_GetClipping == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_SetName = (PLib3MFBaseMaterialGroup_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_setname"); + pWrapperTable->m_BeamLattice_SetClipping = (PLib3MFBeamLattice_SetClippingPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setclipping"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_SetName = (PLib3MFBaseMaterialGroup_SetNamePtr) dlsym(hLibrary, "lib3mf_basematerialgroup_setname"); + pWrapperTable->m_BeamLattice_SetClipping = (PLib3MFBeamLattice_SetClippingPtr) dlsym(hLibrary, "lib3mf_beamlattice_setclipping"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_SetName == nullptr) + if (pWrapperTable->m_BeamLattice_SetClipping == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_SetDisplayColor = (PLib3MFBaseMaterialGroup_SetDisplayColorPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_setdisplaycolor"); + pWrapperTable->m_BeamLattice_GetRepresentation = (PLib3MFBeamLattice_GetRepresentationPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getrepresentation"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_SetDisplayColor = (PLib3MFBaseMaterialGroup_SetDisplayColorPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_setdisplaycolor"); + pWrapperTable->m_BeamLattice_GetRepresentation = (PLib3MFBeamLattice_GetRepresentationPtr) dlsym(hLibrary, "lib3mf_beamlattice_getrepresentation"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_SetDisplayColor == nullptr) + if (pWrapperTable->m_BeamLattice_GetRepresentation == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetDisplayColor = (PLib3MFBaseMaterialGroup_GetDisplayColorPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getdisplaycolor"); + pWrapperTable->m_BeamLattice_SetRepresentation = (PLib3MFBeamLattice_SetRepresentationPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setrepresentation"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetDisplayColor = (PLib3MFBaseMaterialGroup_GetDisplayColorPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getdisplaycolor"); + pWrapperTable->m_BeamLattice_SetRepresentation = (PLib3MFBeamLattice_SetRepresentationPtr) dlsym(hLibrary, "lib3mf_beamlattice_setrepresentation"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_GetDisplayColor == nullptr) + if (pWrapperTable->m_BeamLattice_SetRepresentation == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroup_GetCount = (PLib3MFColorGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_getcount"); + pWrapperTable->m_BeamLattice_GetBallOptions = (PLib3MFBeamLattice_GetBallOptionsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getballoptions"); #else // _WIN32 - pWrapperTable->m_ColorGroup_GetCount = (PLib3MFColorGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_colorgroup_getcount"); + pWrapperTable->m_BeamLattice_GetBallOptions = (PLib3MFBeamLattice_GetBallOptionsPtr) dlsym(hLibrary, "lib3mf_beamlattice_getballoptions"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroup_GetCount == nullptr) + if (pWrapperTable->m_BeamLattice_GetBallOptions == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroup_GetAllPropertyIDs = (PLib3MFColorGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_getallpropertyids"); + pWrapperTable->m_BeamLattice_SetBallOptions = (PLib3MFBeamLattice_SetBallOptionsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setballoptions"); #else // _WIN32 - pWrapperTable->m_ColorGroup_GetAllPropertyIDs = (PLib3MFColorGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_colorgroup_getallpropertyids"); + pWrapperTable->m_BeamLattice_SetBallOptions = (PLib3MFBeamLattice_SetBallOptionsPtr) dlsym(hLibrary, "lib3mf_beamlattice_setballoptions"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroup_GetAllPropertyIDs == nullptr) + if (pWrapperTable->m_BeamLattice_SetBallOptions == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroup_AddColor = (PLib3MFColorGroup_AddColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_addcolor"); + pWrapperTable->m_BeamLattice_GetBeamCount = (PLib3MFBeamLattice_GetBeamCountPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeamcount"); #else // _WIN32 - pWrapperTable->m_ColorGroup_AddColor = (PLib3MFColorGroup_AddColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_addcolor"); + pWrapperTable->m_BeamLattice_GetBeamCount = (PLib3MFBeamLattice_GetBeamCountPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeamcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroup_AddColor == nullptr) + if (pWrapperTable->m_BeamLattice_GetBeamCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroup_RemoveColor = (PLib3MFColorGroup_RemoveColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_removecolor"); + pWrapperTable->m_BeamLattice_GetBeam = (PLib3MFBeamLattice_GetBeamPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeam"); #else // _WIN32 - pWrapperTable->m_ColorGroup_RemoveColor = (PLib3MFColorGroup_RemoveColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_removecolor"); + pWrapperTable->m_BeamLattice_GetBeam = (PLib3MFBeamLattice_GetBeamPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeam"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroup_RemoveColor == nullptr) + if (pWrapperTable->m_BeamLattice_GetBeam == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroup_SetColor = (PLib3MFColorGroup_SetColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_setcolor"); + pWrapperTable->m_BeamLattice_AddBeam = (PLib3MFBeamLattice_AddBeamPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_addbeam"); #else // _WIN32 - pWrapperTable->m_ColorGroup_SetColor = (PLib3MFColorGroup_SetColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_setcolor"); + pWrapperTable->m_BeamLattice_AddBeam = (PLib3MFBeamLattice_AddBeamPtr) dlsym(hLibrary, "lib3mf_beamlattice_addbeam"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroup_SetColor == nullptr) + if (pWrapperTable->m_BeamLattice_AddBeam == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroup_GetColor = (PLib3MFColorGroup_GetColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_getcolor"); + pWrapperTable->m_BeamLattice_SetBeam = (PLib3MFBeamLattice_SetBeamPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setbeam"); #else // _WIN32 - pWrapperTable->m_ColorGroup_GetColor = (PLib3MFColorGroup_GetColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_getcolor"); + pWrapperTable->m_BeamLattice_SetBeam = (PLib3MFBeamLattice_SetBeamPtr) dlsym(hLibrary, "lib3mf_beamlattice_setbeam"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroup_GetColor == nullptr) + if (pWrapperTable->m_BeamLattice_SetBeam == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroup_GetCount = (PLib3MFTexture2DGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_getcount"); + pWrapperTable->m_BeamLattice_SetBeams = (PLib3MFBeamLattice_SetBeamsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setbeams"); #else // _WIN32 - pWrapperTable->m_Texture2DGroup_GetCount = (PLib3MFTexture2DGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_getcount"); + pWrapperTable->m_BeamLattice_SetBeams = (PLib3MFBeamLattice_SetBeamsPtr) dlsym(hLibrary, "lib3mf_beamlattice_setbeams"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroup_GetCount == nullptr) + if (pWrapperTable->m_BeamLattice_SetBeams == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs = (PLib3MFTexture2DGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_getallpropertyids"); + pWrapperTable->m_BeamLattice_GetBeams = (PLib3MFBeamLattice_GetBeamsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeams"); #else // _WIN32 - pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs = (PLib3MFTexture2DGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_getallpropertyids"); + pWrapperTable->m_BeamLattice_GetBeams = (PLib3MFBeamLattice_GetBeamsPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeams"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs == nullptr) + if (pWrapperTable->m_BeamLattice_GetBeams == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroup_AddTex2Coord = (PLib3MFTexture2DGroup_AddTex2CoordPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_addtex2coord"); + pWrapperTable->m_BeamLattice_GetBallCount = (PLib3MFBeamLattice_GetBallCountPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getballcount"); #else // _WIN32 - pWrapperTable->m_Texture2DGroup_AddTex2Coord = (PLib3MFTexture2DGroup_AddTex2CoordPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_addtex2coord"); + pWrapperTable->m_BeamLattice_GetBallCount = (PLib3MFBeamLattice_GetBallCountPtr) dlsym(hLibrary, "lib3mf_beamlattice_getballcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroup_AddTex2Coord == nullptr) + if (pWrapperTable->m_BeamLattice_GetBallCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroup_GetTex2Coord = (PLib3MFTexture2DGroup_GetTex2CoordPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_gettex2coord"); + pWrapperTable->m_BeamLattice_GetBall = (PLib3MFBeamLattice_GetBallPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getball"); #else // _WIN32 - pWrapperTable->m_Texture2DGroup_GetTex2Coord = (PLib3MFTexture2DGroup_GetTex2CoordPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_gettex2coord"); + pWrapperTable->m_BeamLattice_GetBall = (PLib3MFBeamLattice_GetBallPtr) dlsym(hLibrary, "lib3mf_beamlattice_getball"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroup_GetTex2Coord == nullptr) + if (pWrapperTable->m_BeamLattice_GetBall == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroup_RemoveTex2Coord = (PLib3MFTexture2DGroup_RemoveTex2CoordPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_removetex2coord"); + pWrapperTable->m_BeamLattice_AddBall = (PLib3MFBeamLattice_AddBallPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_addball"); #else // _WIN32 - pWrapperTable->m_Texture2DGroup_RemoveTex2Coord = (PLib3MFTexture2DGroup_RemoveTex2CoordPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_removetex2coord"); + pWrapperTable->m_BeamLattice_AddBall = (PLib3MFBeamLattice_AddBallPtr) dlsym(hLibrary, "lib3mf_beamlattice_addball"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroup_RemoveTex2Coord == nullptr) + if (pWrapperTable->m_BeamLattice_AddBall == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroup_GetTexture2D = (PLib3MFTexture2DGroup_GetTexture2DPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_gettexture2d"); + pWrapperTable->m_BeamLattice_SetBall = (PLib3MFBeamLattice_SetBallPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setball"); #else // _WIN32 - pWrapperTable->m_Texture2DGroup_GetTexture2D = (PLib3MFTexture2DGroup_GetTexture2DPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_gettexture2d"); + pWrapperTable->m_BeamLattice_SetBall = (PLib3MFBeamLattice_SetBallPtr) dlsym(hLibrary, "lib3mf_beamlattice_setball"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroup_GetTexture2D == nullptr) + if (pWrapperTable->m_BeamLattice_SetBall == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterials_GetCount = (PLib3MFCompositeMaterials_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getcount"); + pWrapperTable->m_BeamLattice_SetBalls = (PLib3MFBeamLattice_SetBallsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setballs"); #else // _WIN32 - pWrapperTable->m_CompositeMaterials_GetCount = (PLib3MFCompositeMaterials_GetCountPtr) dlsym(hLibrary, "lib3mf_compositematerials_getcount"); + pWrapperTable->m_BeamLattice_SetBalls = (PLib3MFBeamLattice_SetBallsPtr) dlsym(hLibrary, "lib3mf_beamlattice_setballs"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterials_GetCount == nullptr) + if (pWrapperTable->m_BeamLattice_SetBalls == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs = (PLib3MFCompositeMaterials_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getallpropertyids"); + pWrapperTable->m_BeamLattice_GetBalls = (PLib3MFBeamLattice_GetBallsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getballs"); #else // _WIN32 - pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs = (PLib3MFCompositeMaterials_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_compositematerials_getallpropertyids"); + pWrapperTable->m_BeamLattice_GetBalls = (PLib3MFBeamLattice_GetBallsPtr) dlsym(hLibrary, "lib3mf_beamlattice_getballs"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs == nullptr) + if (pWrapperTable->m_BeamLattice_GetBalls == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup = (PLib3MFCompositeMaterials_GetBaseMaterialGroupPtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getbasematerialgroup"); + pWrapperTable->m_BeamLattice_GetBeamSetCount = (PLib3MFBeamLattice_GetBeamSetCountPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeamsetcount"); #else // _WIN32 - pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup = (PLib3MFCompositeMaterials_GetBaseMaterialGroupPtr) dlsym(hLibrary, "lib3mf_compositematerials_getbasematerialgroup"); + pWrapperTable->m_BeamLattice_GetBeamSetCount = (PLib3MFBeamLattice_GetBeamSetCountPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeamsetcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup == nullptr) + if (pWrapperTable->m_BeamLattice_GetBeamSetCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterials_AddComposite = (PLib3MFCompositeMaterials_AddCompositePtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_addcomposite"); + pWrapperTable->m_BeamLattice_AddBeamSet = (PLib3MFBeamLattice_AddBeamSetPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_addbeamset"); #else // _WIN32 - pWrapperTable->m_CompositeMaterials_AddComposite = (PLib3MFCompositeMaterials_AddCompositePtr) dlsym(hLibrary, "lib3mf_compositematerials_addcomposite"); + pWrapperTable->m_BeamLattice_AddBeamSet = (PLib3MFBeamLattice_AddBeamSetPtr) dlsym(hLibrary, "lib3mf_beamlattice_addbeamset"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterials_AddComposite == nullptr) + if (pWrapperTable->m_BeamLattice_AddBeamSet == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterials_RemoveComposite = (PLib3MFCompositeMaterials_RemoveCompositePtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_removecomposite"); + pWrapperTable->m_BeamLattice_GetBeamSet = (PLib3MFBeamLattice_GetBeamSetPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeamset"); #else // _WIN32 - pWrapperTable->m_CompositeMaterials_RemoveComposite = (PLib3MFCompositeMaterials_RemoveCompositePtr) dlsym(hLibrary, "lib3mf_compositematerials_removecomposite"); + pWrapperTable->m_BeamLattice_GetBeamSet = (PLib3MFBeamLattice_GetBeamSetPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeamset"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterials_RemoveComposite == nullptr) + if (pWrapperTable->m_BeamLattice_GetBeamSet == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterials_GetComposite = (PLib3MFCompositeMaterials_GetCompositePtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getcomposite"); + pWrapperTable->m_Component_GetObjectResource = (PLib3MFComponent_GetObjectResourcePtr) GetProcAddress(hLibrary, "lib3mf_component_getobjectresource"); #else // _WIN32 - pWrapperTable->m_CompositeMaterials_GetComposite = (PLib3MFCompositeMaterials_GetCompositePtr) dlsym(hLibrary, "lib3mf_compositematerials_getcomposite"); + pWrapperTable->m_Component_GetObjectResource = (PLib3MFComponent_GetObjectResourcePtr) dlsym(hLibrary, "lib3mf_component_getobjectresource"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterials_GetComposite == nullptr) + if (pWrapperTable->m_Component_GetObjectResource == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetCount = (PLib3MFMultiPropertyGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getcount"); + pWrapperTable->m_Component_GetObjectResourceID = (PLib3MFComponent_GetObjectResourceIDPtr) GetProcAddress(hLibrary, "lib3mf_component_getobjectresourceid"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetCount = (PLib3MFMultiPropertyGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getcount"); + pWrapperTable->m_Component_GetObjectResourceID = (PLib3MFComponent_GetObjectResourceIDPtr) dlsym(hLibrary, "lib3mf_component_getobjectresourceid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_GetCount == nullptr) + if (pWrapperTable->m_Component_GetObjectResourceID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs = (PLib3MFMultiPropertyGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getallpropertyids"); + pWrapperTable->m_Component_GetUUID = (PLib3MFComponent_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_component_getuuid"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs = (PLib3MFMultiPropertyGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getallpropertyids"); + pWrapperTable->m_Component_GetUUID = (PLib3MFComponent_GetUUIDPtr) dlsym(hLibrary, "lib3mf_component_getuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs == nullptr) + if (pWrapperTable->m_Component_GetUUID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_AddMultiProperty = (PLib3MFMultiPropertyGroup_AddMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_addmultiproperty"); + pWrapperTable->m_Component_SetUUID = (PLib3MFComponent_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_component_setuuid"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_AddMultiProperty = (PLib3MFMultiPropertyGroup_AddMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_addmultiproperty"); + pWrapperTable->m_Component_SetUUID = (PLib3MFComponent_SetUUIDPtr) dlsym(hLibrary, "lib3mf_component_setuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_AddMultiProperty == nullptr) + if (pWrapperTable->m_Component_SetUUID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_SetMultiProperty = (PLib3MFMultiPropertyGroup_SetMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_setmultiproperty"); + pWrapperTable->m_Component_HasTransform = (PLib3MFComponent_HasTransformPtr) GetProcAddress(hLibrary, "lib3mf_component_hastransform"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_SetMultiProperty = (PLib3MFMultiPropertyGroup_SetMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_setmultiproperty"); + pWrapperTable->m_Component_HasTransform = (PLib3MFComponent_HasTransformPtr) dlsym(hLibrary, "lib3mf_component_hastransform"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_SetMultiProperty == nullptr) + if (pWrapperTable->m_Component_HasTransform == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetMultiProperty = (PLib3MFMultiPropertyGroup_GetMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getmultiproperty"); + pWrapperTable->m_Component_GetTransform = (PLib3MFComponent_GetTransformPtr) GetProcAddress(hLibrary, "lib3mf_component_gettransform"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetMultiProperty = (PLib3MFMultiPropertyGroup_GetMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getmultiproperty"); + pWrapperTable->m_Component_GetTransform = (PLib3MFComponent_GetTransformPtr) dlsym(hLibrary, "lib3mf_component_gettransform"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_GetMultiProperty == nullptr) + if (pWrapperTable->m_Component_GetTransform == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty = (PLib3MFMultiPropertyGroup_RemoveMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_removemultiproperty"); + pWrapperTable->m_Component_SetTransform = (PLib3MFComponent_SetTransformPtr) GetProcAddress(hLibrary, "lib3mf_component_settransform"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty = (PLib3MFMultiPropertyGroup_RemoveMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_removemultiproperty"); + pWrapperTable->m_Component_SetTransform = (PLib3MFComponent_SetTransformPtr) dlsym(hLibrary, "lib3mf_component_settransform"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty == nullptr) + if (pWrapperTable->m_Component_SetTransform == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetLayerCount = (PLib3MFMultiPropertyGroup_GetLayerCountPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getlayercount"); + pWrapperTable->m_ComponentsObject_AddComponent = (PLib3MFComponentsObject_AddComponentPtr) GetProcAddress(hLibrary, "lib3mf_componentsobject_addcomponent"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetLayerCount = (PLib3MFMultiPropertyGroup_GetLayerCountPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getlayercount"); + pWrapperTable->m_ComponentsObject_AddComponent = (PLib3MFComponentsObject_AddComponentPtr) dlsym(hLibrary, "lib3mf_componentsobject_addcomponent"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_GetLayerCount == nullptr) + if (pWrapperTable->m_ComponentsObject_AddComponent == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_AddLayer = (PLib3MFMultiPropertyGroup_AddLayerPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_addlayer"); + pWrapperTable->m_ComponentsObject_GetComponent = (PLib3MFComponentsObject_GetComponentPtr) GetProcAddress(hLibrary, "lib3mf_componentsobject_getcomponent"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_AddLayer = (PLib3MFMultiPropertyGroup_AddLayerPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_addlayer"); + pWrapperTable->m_ComponentsObject_GetComponent = (PLib3MFComponentsObject_GetComponentPtr) dlsym(hLibrary, "lib3mf_componentsobject_getcomponent"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_AddLayer == nullptr) + if (pWrapperTable->m_ComponentsObject_GetComponent == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetLayer = (PLib3MFMultiPropertyGroup_GetLayerPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getlayer"); + pWrapperTable->m_ComponentsObject_GetComponentCount = (PLib3MFComponentsObject_GetComponentCountPtr) GetProcAddress(hLibrary, "lib3mf_componentsobject_getcomponentcount"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetLayer = (PLib3MFMultiPropertyGroup_GetLayerPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getlayer"); + pWrapperTable->m_ComponentsObject_GetComponentCount = (PLib3MFComponentsObject_GetComponentCountPtr) dlsym(hLibrary, "lib3mf_componentsobject_getcomponentcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_GetLayer == nullptr) + if (pWrapperTable->m_ComponentsObject_GetComponentCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_RemoveLayer = (PLib3MFMultiPropertyGroup_RemoveLayerPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_removelayer"); + pWrapperTable->m_BeamSet_SetName = (PLib3MFBeamSet_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_beamset_setname"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_RemoveLayer = (PLib3MFMultiPropertyGroup_RemoveLayerPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_removelayer"); + pWrapperTable->m_BeamSet_SetName = (PLib3MFBeamSet_SetNamePtr) dlsym(hLibrary, "lib3mf_beamset_setname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_RemoveLayer == nullptr) + if (pWrapperTable->m_BeamSet_SetName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_GetPath = (PLib3MFAttachment_GetPathPtr) GetProcAddress(hLibrary, "lib3mf_attachment_getpath"); + pWrapperTable->m_BeamSet_GetName = (PLib3MFBeamSet_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_beamset_getname"); #else // _WIN32 - pWrapperTable->m_Attachment_GetPath = (PLib3MFAttachment_GetPathPtr) dlsym(hLibrary, "lib3mf_attachment_getpath"); + pWrapperTable->m_BeamSet_GetName = (PLib3MFBeamSet_GetNamePtr) dlsym(hLibrary, "lib3mf_beamset_getname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_GetPath == nullptr) + if (pWrapperTable->m_BeamSet_GetName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_SetPath = (PLib3MFAttachment_SetPathPtr) GetProcAddress(hLibrary, "lib3mf_attachment_setpath"); + pWrapperTable->m_BeamSet_SetIdentifier = (PLib3MFBeamSet_SetIdentifierPtr) GetProcAddress(hLibrary, "lib3mf_beamset_setidentifier"); #else // _WIN32 - pWrapperTable->m_Attachment_SetPath = (PLib3MFAttachment_SetPathPtr) dlsym(hLibrary, "lib3mf_attachment_setpath"); + pWrapperTable->m_BeamSet_SetIdentifier = (PLib3MFBeamSet_SetIdentifierPtr) dlsym(hLibrary, "lib3mf_beamset_setidentifier"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_SetPath == nullptr) + if (pWrapperTable->m_BeamSet_SetIdentifier == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_PackagePart = (PLib3MFAttachment_PackagePartPtr) GetProcAddress(hLibrary, "lib3mf_attachment_packagepart"); + pWrapperTable->m_BeamSet_GetIdentifier = (PLib3MFBeamSet_GetIdentifierPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getidentifier"); #else // _WIN32 - pWrapperTable->m_Attachment_PackagePart = (PLib3MFAttachment_PackagePartPtr) dlsym(hLibrary, "lib3mf_attachment_packagepart"); + pWrapperTable->m_BeamSet_GetIdentifier = (PLib3MFBeamSet_GetIdentifierPtr) dlsym(hLibrary, "lib3mf_beamset_getidentifier"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_PackagePart == nullptr) + if (pWrapperTable->m_BeamSet_GetIdentifier == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_GetRelationShipType = (PLib3MFAttachment_GetRelationShipTypePtr) GetProcAddress(hLibrary, "lib3mf_attachment_getrelationshiptype"); + pWrapperTable->m_BeamSet_GetReferenceCount = (PLib3MFBeamSet_GetReferenceCountPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getreferencecount"); #else // _WIN32 - pWrapperTable->m_Attachment_GetRelationShipType = (PLib3MFAttachment_GetRelationShipTypePtr) dlsym(hLibrary, "lib3mf_attachment_getrelationshiptype"); + pWrapperTable->m_BeamSet_GetReferenceCount = (PLib3MFBeamSet_GetReferenceCountPtr) dlsym(hLibrary, "lib3mf_beamset_getreferencecount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_GetRelationShipType == nullptr) + if (pWrapperTable->m_BeamSet_GetReferenceCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_SetRelationShipType = (PLib3MFAttachment_SetRelationShipTypePtr) GetProcAddress(hLibrary, "lib3mf_attachment_setrelationshiptype"); + pWrapperTable->m_BeamSet_SetReferences = (PLib3MFBeamSet_SetReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_setreferences"); #else // _WIN32 - pWrapperTable->m_Attachment_SetRelationShipType = (PLib3MFAttachment_SetRelationShipTypePtr) dlsym(hLibrary, "lib3mf_attachment_setrelationshiptype"); + pWrapperTable->m_BeamSet_SetReferences = (PLib3MFBeamSet_SetReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_setreferences"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_SetRelationShipType == nullptr) + if (pWrapperTable->m_BeamSet_SetReferences == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_WriteToFile = (PLib3MFAttachment_WriteToFilePtr) GetProcAddress(hLibrary, "lib3mf_attachment_writetofile"); + pWrapperTable->m_BeamSet_GetReferences = (PLib3MFBeamSet_GetReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getreferences"); #else // _WIN32 - pWrapperTable->m_Attachment_WriteToFile = (PLib3MFAttachment_WriteToFilePtr) dlsym(hLibrary, "lib3mf_attachment_writetofile"); + pWrapperTable->m_BeamSet_GetReferences = (PLib3MFBeamSet_GetReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_getreferences"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_WriteToFile == nullptr) + if (pWrapperTable->m_BeamSet_GetReferences == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_ReadFromFile = (PLib3MFAttachment_ReadFromFilePtr) GetProcAddress(hLibrary, "lib3mf_attachment_readfromfile"); + pWrapperTable->m_BeamSet_GetBallReferenceCount = (PLib3MFBeamSet_GetBallReferenceCountPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getballreferencecount"); #else // _WIN32 - pWrapperTable->m_Attachment_ReadFromFile = (PLib3MFAttachment_ReadFromFilePtr) dlsym(hLibrary, "lib3mf_attachment_readfromfile"); + pWrapperTable->m_BeamSet_GetBallReferenceCount = (PLib3MFBeamSet_GetBallReferenceCountPtr) dlsym(hLibrary, "lib3mf_beamset_getballreferencecount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_ReadFromFile == nullptr) + if (pWrapperTable->m_BeamSet_GetBallReferenceCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_ReadFromCallback = (PLib3MFAttachment_ReadFromCallbackPtr) GetProcAddress(hLibrary, "lib3mf_attachment_readfromcallback"); + pWrapperTable->m_BeamSet_SetBallReferences = (PLib3MFBeamSet_SetBallReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_setballreferences"); #else // _WIN32 - pWrapperTable->m_Attachment_ReadFromCallback = (PLib3MFAttachment_ReadFromCallbackPtr) dlsym(hLibrary, "lib3mf_attachment_readfromcallback"); + pWrapperTable->m_BeamSet_SetBallReferences = (PLib3MFBeamSet_SetBallReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_setballreferences"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_ReadFromCallback == nullptr) + if (pWrapperTable->m_BeamSet_SetBallReferences == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_GetStreamSize = (PLib3MFAttachment_GetStreamSizePtr) GetProcAddress(hLibrary, "lib3mf_attachment_getstreamsize"); + pWrapperTable->m_BeamSet_GetBallReferences = (PLib3MFBeamSet_GetBallReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getballreferences"); #else // _WIN32 - pWrapperTable->m_Attachment_GetStreamSize = (PLib3MFAttachment_GetStreamSizePtr) dlsym(hLibrary, "lib3mf_attachment_getstreamsize"); + pWrapperTable->m_BeamSet_GetBallReferences = (PLib3MFBeamSet_GetBallReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_getballreferences"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_GetStreamSize == nullptr) + if (pWrapperTable->m_BeamSet_GetBallReferences == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_WriteToBuffer = (PLib3MFAttachment_WriteToBufferPtr) GetProcAddress(hLibrary, "lib3mf_attachment_writetobuffer"); + pWrapperTable->m_BaseMaterialGroup_GetCount = (PLib3MFBaseMaterialGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getcount"); #else // _WIN32 - pWrapperTable->m_Attachment_WriteToBuffer = (PLib3MFAttachment_WriteToBufferPtr) dlsym(hLibrary, "lib3mf_attachment_writetobuffer"); + pWrapperTable->m_BaseMaterialGroup_GetCount = (PLib3MFBaseMaterialGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_WriteToBuffer == nullptr) + if (pWrapperTable->m_BaseMaterialGroup_GetCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_ReadFromBuffer = (PLib3MFAttachment_ReadFromBufferPtr) GetProcAddress(hLibrary, "lib3mf_attachment_readfrombuffer"); + pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs = (PLib3MFBaseMaterialGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getallpropertyids"); #else // _WIN32 - pWrapperTable->m_Attachment_ReadFromBuffer = (PLib3MFAttachment_ReadFromBufferPtr) dlsym(hLibrary, "lib3mf_attachment_readfrombuffer"); + pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs = (PLib3MFBaseMaterialGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getallpropertyids"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_ReadFromBuffer == nullptr) + if (pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_GetAttachment = (PLib3MFTexture2D_GetAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_getattachment"); + pWrapperTable->m_BaseMaterialGroup_AddMaterial = (PLib3MFBaseMaterialGroup_AddMaterialPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_addmaterial"); #else // _WIN32 - pWrapperTable->m_Texture2D_GetAttachment = (PLib3MFTexture2D_GetAttachmentPtr) dlsym(hLibrary, "lib3mf_texture2d_getattachment"); + pWrapperTable->m_BaseMaterialGroup_AddMaterial = (PLib3MFBaseMaterialGroup_AddMaterialPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_addmaterial"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_GetAttachment == nullptr) + if (pWrapperTable->m_BaseMaterialGroup_AddMaterial == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_SetAttachment = (PLib3MFTexture2D_SetAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_setattachment"); + pWrapperTable->m_BaseMaterialGroup_RemoveMaterial = (PLib3MFBaseMaterialGroup_RemoveMaterialPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_removematerial"); #else // _WIN32 - pWrapperTable->m_Texture2D_SetAttachment = (PLib3MFTexture2D_SetAttachmentPtr) dlsym(hLibrary, "lib3mf_texture2d_setattachment"); + pWrapperTable->m_BaseMaterialGroup_RemoveMaterial = (PLib3MFBaseMaterialGroup_RemoveMaterialPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_removematerial"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_SetAttachment == nullptr) + if (pWrapperTable->m_BaseMaterialGroup_RemoveMaterial == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_GetContentType = (PLib3MFTexture2D_GetContentTypePtr) GetProcAddress(hLibrary, "lib3mf_texture2d_getcontenttype"); + pWrapperTable->m_BaseMaterialGroup_GetName = (PLib3MFBaseMaterialGroup_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getname"); #else // _WIN32 - pWrapperTable->m_Texture2D_GetContentType = (PLib3MFTexture2D_GetContentTypePtr) dlsym(hLibrary, "lib3mf_texture2d_getcontenttype"); + pWrapperTable->m_BaseMaterialGroup_GetName = (PLib3MFBaseMaterialGroup_GetNamePtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_GetContentType == nullptr) + if (pWrapperTable->m_BaseMaterialGroup_GetName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_SetContentType = (PLib3MFTexture2D_SetContentTypePtr) GetProcAddress(hLibrary, "lib3mf_texture2d_setcontenttype"); + pWrapperTable->m_BaseMaterialGroup_SetName = (PLib3MFBaseMaterialGroup_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_setname"); #else // _WIN32 - pWrapperTable->m_Texture2D_SetContentType = (PLib3MFTexture2D_SetContentTypePtr) dlsym(hLibrary, "lib3mf_texture2d_setcontenttype"); + pWrapperTable->m_BaseMaterialGroup_SetName = (PLib3MFBaseMaterialGroup_SetNamePtr) dlsym(hLibrary, "lib3mf_basematerialgroup_setname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_SetContentType == nullptr) + if (pWrapperTable->m_BaseMaterialGroup_SetName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_GetTileStyleUV = (PLib3MFTexture2D_GetTileStyleUVPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_gettilestyleuv"); + pWrapperTable->m_BaseMaterialGroup_SetDisplayColor = (PLib3MFBaseMaterialGroup_SetDisplayColorPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_setdisplaycolor"); #else // _WIN32 - pWrapperTable->m_Texture2D_GetTileStyleUV = (PLib3MFTexture2D_GetTileStyleUVPtr) dlsym(hLibrary, "lib3mf_texture2d_gettilestyleuv"); + pWrapperTable->m_BaseMaterialGroup_SetDisplayColor = (PLib3MFBaseMaterialGroup_SetDisplayColorPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_setdisplaycolor"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_GetTileStyleUV == nullptr) + if (pWrapperTable->m_BaseMaterialGroup_SetDisplayColor == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_SetTileStyleUV = (PLib3MFTexture2D_SetTileStyleUVPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_settilestyleuv"); + pWrapperTable->m_BaseMaterialGroup_GetDisplayColor = (PLib3MFBaseMaterialGroup_GetDisplayColorPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getdisplaycolor"); #else // _WIN32 - pWrapperTable->m_Texture2D_SetTileStyleUV = (PLib3MFTexture2D_SetTileStyleUVPtr) dlsym(hLibrary, "lib3mf_texture2d_settilestyleuv"); + pWrapperTable->m_BaseMaterialGroup_GetDisplayColor = (PLib3MFBaseMaterialGroup_GetDisplayColorPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getdisplaycolor"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_SetTileStyleUV == nullptr) + if (pWrapperTable->m_BaseMaterialGroup_GetDisplayColor == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_GetFilter = (PLib3MFTexture2D_GetFilterPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_getfilter"); + pWrapperTable->m_ColorGroup_GetCount = (PLib3MFColorGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_getcount"); #else // _WIN32 - pWrapperTable->m_Texture2D_GetFilter = (PLib3MFTexture2D_GetFilterPtr) dlsym(hLibrary, "lib3mf_texture2d_getfilter"); + pWrapperTable->m_ColorGroup_GetCount = (PLib3MFColorGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_colorgroup_getcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_GetFilter == nullptr) + if (pWrapperTable->m_ColorGroup_GetCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_SetFilter = (PLib3MFTexture2D_SetFilterPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_setfilter"); + pWrapperTable->m_ColorGroup_GetAllPropertyIDs = (PLib3MFColorGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_getallpropertyids"); #else // _WIN32 - pWrapperTable->m_Texture2D_SetFilter = (PLib3MFTexture2D_SetFilterPtr) dlsym(hLibrary, "lib3mf_texture2d_setfilter"); + pWrapperTable->m_ColorGroup_GetAllPropertyIDs = (PLib3MFColorGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_colorgroup_getallpropertyids"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_SetFilter == nullptr) + if (pWrapperTable->m_ColorGroup_GetAllPropertyIDs == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetObjectResource = (PLib3MFBuildItem_GetObjectResourcePtr) GetProcAddress(hLibrary, "lib3mf_builditem_getobjectresource"); + pWrapperTable->m_ColorGroup_AddColor = (PLib3MFColorGroup_AddColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_addcolor"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetObjectResource = (PLib3MFBuildItem_GetObjectResourcePtr) dlsym(hLibrary, "lib3mf_builditem_getobjectresource"); + pWrapperTable->m_ColorGroup_AddColor = (PLib3MFColorGroup_AddColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_addcolor"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetObjectResource == nullptr) + if (pWrapperTable->m_ColorGroup_AddColor == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetUUID = (PLib3MFBuildItem_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getuuid"); + pWrapperTable->m_ColorGroup_RemoveColor = (PLib3MFColorGroup_RemoveColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_removecolor"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetUUID = (PLib3MFBuildItem_GetUUIDPtr) dlsym(hLibrary, "lib3mf_builditem_getuuid"); + pWrapperTable->m_ColorGroup_RemoveColor = (PLib3MFColorGroup_RemoveColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_removecolor"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetUUID == nullptr) + if (pWrapperTable->m_ColorGroup_RemoveColor == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_SetUUID = (PLib3MFBuildItem_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_builditem_setuuid"); + pWrapperTable->m_ColorGroup_SetColor = (PLib3MFColorGroup_SetColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_setcolor"); #else // _WIN32 - pWrapperTable->m_BuildItem_SetUUID = (PLib3MFBuildItem_SetUUIDPtr) dlsym(hLibrary, "lib3mf_builditem_setuuid"); + pWrapperTable->m_ColorGroup_SetColor = (PLib3MFColorGroup_SetColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_setcolor"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_SetUUID == nullptr) + if (pWrapperTable->m_ColorGroup_SetColor == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetObjectResourceID = (PLib3MFBuildItem_GetObjectResourceIDPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getobjectresourceid"); + pWrapperTable->m_ColorGroup_GetColor = (PLib3MFColorGroup_GetColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_getcolor"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetObjectResourceID = (PLib3MFBuildItem_GetObjectResourceIDPtr) dlsym(hLibrary, "lib3mf_builditem_getobjectresourceid"); + pWrapperTable->m_ColorGroup_GetColor = (PLib3MFColorGroup_GetColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_getcolor"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetObjectResourceID == nullptr) + if (pWrapperTable->m_ColorGroup_GetColor == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_HasObjectTransform = (PLib3MFBuildItem_HasObjectTransformPtr) GetProcAddress(hLibrary, "lib3mf_builditem_hasobjecttransform"); + pWrapperTable->m_Texture2DGroup_GetCount = (PLib3MFTexture2DGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_getcount"); #else // _WIN32 - pWrapperTable->m_BuildItem_HasObjectTransform = (PLib3MFBuildItem_HasObjectTransformPtr) dlsym(hLibrary, "lib3mf_builditem_hasobjecttransform"); + pWrapperTable->m_Texture2DGroup_GetCount = (PLib3MFTexture2DGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_getcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_HasObjectTransform == nullptr) + if (pWrapperTable->m_Texture2DGroup_GetCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetObjectTransform = (PLib3MFBuildItem_GetObjectTransformPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getobjecttransform"); + pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs = (PLib3MFTexture2DGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_getallpropertyids"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetObjectTransform = (PLib3MFBuildItem_GetObjectTransformPtr) dlsym(hLibrary, "lib3mf_builditem_getobjecttransform"); + pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs = (PLib3MFTexture2DGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_getallpropertyids"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetObjectTransform == nullptr) + if (pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_SetObjectTransform = (PLib3MFBuildItem_SetObjectTransformPtr) GetProcAddress(hLibrary, "lib3mf_builditem_setobjecttransform"); + pWrapperTable->m_Texture2DGroup_AddTex2Coord = (PLib3MFTexture2DGroup_AddTex2CoordPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_addtex2coord"); #else // _WIN32 - pWrapperTable->m_BuildItem_SetObjectTransform = (PLib3MFBuildItem_SetObjectTransformPtr) dlsym(hLibrary, "lib3mf_builditem_setobjecttransform"); + pWrapperTable->m_Texture2DGroup_AddTex2Coord = (PLib3MFTexture2DGroup_AddTex2CoordPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_addtex2coord"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_SetObjectTransform == nullptr) + if (pWrapperTable->m_Texture2DGroup_AddTex2Coord == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetPartNumber = (PLib3MFBuildItem_GetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getpartnumber"); + pWrapperTable->m_Texture2DGroup_GetTex2Coord = (PLib3MFTexture2DGroup_GetTex2CoordPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_gettex2coord"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetPartNumber = (PLib3MFBuildItem_GetPartNumberPtr) dlsym(hLibrary, "lib3mf_builditem_getpartnumber"); + pWrapperTable->m_Texture2DGroup_GetTex2Coord = (PLib3MFTexture2DGroup_GetTex2CoordPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_gettex2coord"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetPartNumber == nullptr) + if (pWrapperTable->m_Texture2DGroup_GetTex2Coord == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_SetPartNumber = (PLib3MFBuildItem_SetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_builditem_setpartnumber"); + pWrapperTable->m_Texture2DGroup_RemoveTex2Coord = (PLib3MFTexture2DGroup_RemoveTex2CoordPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_removetex2coord"); #else // _WIN32 - pWrapperTable->m_BuildItem_SetPartNumber = (PLib3MFBuildItem_SetPartNumberPtr) dlsym(hLibrary, "lib3mf_builditem_setpartnumber"); + pWrapperTable->m_Texture2DGroup_RemoveTex2Coord = (PLib3MFTexture2DGroup_RemoveTex2CoordPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_removetex2coord"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_SetPartNumber == nullptr) + if (pWrapperTable->m_Texture2DGroup_RemoveTex2Coord == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetMetaDataGroup = (PLib3MFBuildItem_GetMetaDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getmetadatagroup"); + pWrapperTable->m_Texture2DGroup_GetTexture2D = (PLib3MFTexture2DGroup_GetTexture2DPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_gettexture2d"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetMetaDataGroup = (PLib3MFBuildItem_GetMetaDataGroupPtr) dlsym(hLibrary, "lib3mf_builditem_getmetadatagroup"); + pWrapperTable->m_Texture2DGroup_GetTexture2D = (PLib3MFTexture2DGroup_GetTexture2DPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_gettexture2d"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetMetaDataGroup == nullptr) + if (pWrapperTable->m_Texture2DGroup_GetTexture2D == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetOutbox = (PLib3MFBuildItem_GetOutboxPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getoutbox"); + pWrapperTable->m_CompositeMaterials_GetCount = (PLib3MFCompositeMaterials_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getcount"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetOutbox = (PLib3MFBuildItem_GetOutboxPtr) dlsym(hLibrary, "lib3mf_builditem_getoutbox"); + pWrapperTable->m_CompositeMaterials_GetCount = (PLib3MFCompositeMaterials_GetCountPtr) dlsym(hLibrary, "lib3mf_compositematerials_getcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetOutbox == nullptr) + if (pWrapperTable->m_CompositeMaterials_GetCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItemIterator_MoveNext = (PLib3MFBuildItemIterator_MoveNextPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_movenext"); + pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs = (PLib3MFCompositeMaterials_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getallpropertyids"); #else // _WIN32 - pWrapperTable->m_BuildItemIterator_MoveNext = (PLib3MFBuildItemIterator_MoveNextPtr) dlsym(hLibrary, "lib3mf_builditemiterator_movenext"); + pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs = (PLib3MFCompositeMaterials_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_compositematerials_getallpropertyids"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItemIterator_MoveNext == nullptr) + if (pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItemIterator_MovePrevious = (PLib3MFBuildItemIterator_MovePreviousPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_moveprevious"); + pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup = (PLib3MFCompositeMaterials_GetBaseMaterialGroupPtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getbasematerialgroup"); #else // _WIN32 - pWrapperTable->m_BuildItemIterator_MovePrevious = (PLib3MFBuildItemIterator_MovePreviousPtr) dlsym(hLibrary, "lib3mf_builditemiterator_moveprevious"); + pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup = (PLib3MFCompositeMaterials_GetBaseMaterialGroupPtr) dlsym(hLibrary, "lib3mf_compositematerials_getbasematerialgroup"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItemIterator_MovePrevious == nullptr) + if (pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItemIterator_GetCurrent = (PLib3MFBuildItemIterator_GetCurrentPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_getcurrent"); + pWrapperTable->m_CompositeMaterials_AddComposite = (PLib3MFCompositeMaterials_AddCompositePtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_addcomposite"); #else // _WIN32 - pWrapperTable->m_BuildItemIterator_GetCurrent = (PLib3MFBuildItemIterator_GetCurrentPtr) dlsym(hLibrary, "lib3mf_builditemiterator_getcurrent"); + pWrapperTable->m_CompositeMaterials_AddComposite = (PLib3MFCompositeMaterials_AddCompositePtr) dlsym(hLibrary, "lib3mf_compositematerials_addcomposite"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItemIterator_GetCurrent == nullptr) + if (pWrapperTable->m_CompositeMaterials_AddComposite == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItemIterator_Clone = (PLib3MFBuildItemIterator_ClonePtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_clone"); + pWrapperTable->m_CompositeMaterials_RemoveComposite = (PLib3MFCompositeMaterials_RemoveCompositePtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_removecomposite"); #else // _WIN32 - pWrapperTable->m_BuildItemIterator_Clone = (PLib3MFBuildItemIterator_ClonePtr) dlsym(hLibrary, "lib3mf_builditemiterator_clone"); + pWrapperTable->m_CompositeMaterials_RemoveComposite = (PLib3MFCompositeMaterials_RemoveCompositePtr) dlsym(hLibrary, "lib3mf_compositematerials_removecomposite"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItemIterator_Clone == nullptr) + if (pWrapperTable->m_CompositeMaterials_RemoveComposite == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItemIterator_Count = (PLib3MFBuildItemIterator_CountPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_count"); + pWrapperTable->m_CompositeMaterials_GetComposite = (PLib3MFCompositeMaterials_GetCompositePtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getcomposite"); #else // _WIN32 - pWrapperTable->m_BuildItemIterator_Count = (PLib3MFBuildItemIterator_CountPtr) dlsym(hLibrary, "lib3mf_builditemiterator_count"); + pWrapperTable->m_CompositeMaterials_GetComposite = (PLib3MFCompositeMaterials_GetCompositePtr) dlsym(hLibrary, "lib3mf_compositematerials_getcomposite"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItemIterator_Count == nullptr) + if (pWrapperTable->m_CompositeMaterials_GetComposite == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_SetVertices = (PLib3MFSlice_SetVerticesPtr) GetProcAddress(hLibrary, "lib3mf_slice_setvertices"); + pWrapperTable->m_MultiPropertyGroup_GetCount = (PLib3MFMultiPropertyGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getcount"); #else // _WIN32 - pWrapperTable->m_Slice_SetVertices = (PLib3MFSlice_SetVerticesPtr) dlsym(hLibrary, "lib3mf_slice_setvertices"); + pWrapperTable->m_MultiPropertyGroup_GetCount = (PLib3MFMultiPropertyGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_SetVertices == nullptr) + if (pWrapperTable->m_MultiPropertyGroup_GetCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_GetVertices = (PLib3MFSlice_GetVerticesPtr) GetProcAddress(hLibrary, "lib3mf_slice_getvertices"); + pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs = (PLib3MFMultiPropertyGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getallpropertyids"); #else // _WIN32 - pWrapperTable->m_Slice_GetVertices = (PLib3MFSlice_GetVerticesPtr) dlsym(hLibrary, "lib3mf_slice_getvertices"); + pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs = (PLib3MFMultiPropertyGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getallpropertyids"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_GetVertices == nullptr) + if (pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_GetVertexCount = (PLib3MFSlice_GetVertexCountPtr) GetProcAddress(hLibrary, "lib3mf_slice_getvertexcount"); + pWrapperTable->m_MultiPropertyGroup_AddMultiProperty = (PLib3MFMultiPropertyGroup_AddMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_addmultiproperty"); #else // _WIN32 - pWrapperTable->m_Slice_GetVertexCount = (PLib3MFSlice_GetVertexCountPtr) dlsym(hLibrary, "lib3mf_slice_getvertexcount"); + pWrapperTable->m_MultiPropertyGroup_AddMultiProperty = (PLib3MFMultiPropertyGroup_AddMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_addmultiproperty"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_GetVertexCount == nullptr) + if (pWrapperTable->m_MultiPropertyGroup_AddMultiProperty == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_AddPolygon = (PLib3MFSlice_AddPolygonPtr) GetProcAddress(hLibrary, "lib3mf_slice_addpolygon"); + pWrapperTable->m_MultiPropertyGroup_SetMultiProperty = (PLib3MFMultiPropertyGroup_SetMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_setmultiproperty"); #else // _WIN32 - pWrapperTable->m_Slice_AddPolygon = (PLib3MFSlice_AddPolygonPtr) dlsym(hLibrary, "lib3mf_slice_addpolygon"); + pWrapperTable->m_MultiPropertyGroup_SetMultiProperty = (PLib3MFMultiPropertyGroup_SetMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_setmultiproperty"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_AddPolygon == nullptr) + if (pWrapperTable->m_MultiPropertyGroup_SetMultiProperty == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_GetPolygonCount = (PLib3MFSlice_GetPolygonCountPtr) GetProcAddress(hLibrary, "lib3mf_slice_getpolygoncount"); + pWrapperTable->m_MultiPropertyGroup_GetMultiProperty = (PLib3MFMultiPropertyGroup_GetMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getmultiproperty"); #else // _WIN32 - pWrapperTable->m_Slice_GetPolygonCount = (PLib3MFSlice_GetPolygonCountPtr) dlsym(hLibrary, "lib3mf_slice_getpolygoncount"); + pWrapperTable->m_MultiPropertyGroup_GetMultiProperty = (PLib3MFMultiPropertyGroup_GetMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getmultiproperty"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_GetPolygonCount == nullptr) + if (pWrapperTable->m_MultiPropertyGroup_GetMultiProperty == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_SetPolygonIndices = (PLib3MFSlice_SetPolygonIndicesPtr) GetProcAddress(hLibrary, "lib3mf_slice_setpolygonindices"); + pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty = (PLib3MFMultiPropertyGroup_RemoveMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_removemultiproperty"); #else // _WIN32 - pWrapperTable->m_Slice_SetPolygonIndices = (PLib3MFSlice_SetPolygonIndicesPtr) dlsym(hLibrary, "lib3mf_slice_setpolygonindices"); + pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty = (PLib3MFMultiPropertyGroup_RemoveMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_removemultiproperty"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_SetPolygonIndices == nullptr) + if (pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_GetPolygonIndices = (PLib3MFSlice_GetPolygonIndicesPtr) GetProcAddress(hLibrary, "lib3mf_slice_getpolygonindices"); + pWrapperTable->m_MultiPropertyGroup_GetLayerCount = (PLib3MFMultiPropertyGroup_GetLayerCountPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getlayercount"); #else // _WIN32 - pWrapperTable->m_Slice_GetPolygonIndices = (PLib3MFSlice_GetPolygonIndicesPtr) dlsym(hLibrary, "lib3mf_slice_getpolygonindices"); + pWrapperTable->m_MultiPropertyGroup_GetLayerCount = (PLib3MFMultiPropertyGroup_GetLayerCountPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getlayercount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_GetPolygonIndices == nullptr) + if (pWrapperTable->m_MultiPropertyGroup_GetLayerCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_GetPolygonIndexCount = (PLib3MFSlice_GetPolygonIndexCountPtr) GetProcAddress(hLibrary, "lib3mf_slice_getpolygonindexcount"); + pWrapperTable->m_MultiPropertyGroup_AddLayer = (PLib3MFMultiPropertyGroup_AddLayerPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_addlayer"); #else // _WIN32 - pWrapperTable->m_Slice_GetPolygonIndexCount = (PLib3MFSlice_GetPolygonIndexCountPtr) dlsym(hLibrary, "lib3mf_slice_getpolygonindexcount"); + pWrapperTable->m_MultiPropertyGroup_AddLayer = (PLib3MFMultiPropertyGroup_AddLayerPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_addlayer"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_GetPolygonIndexCount == nullptr) + if (pWrapperTable->m_MultiPropertyGroup_AddLayer == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_GetZTop = (PLib3MFSlice_GetZTopPtr) GetProcAddress(hLibrary, "lib3mf_slice_getztop"); + pWrapperTable->m_MultiPropertyGroup_GetLayer = (PLib3MFMultiPropertyGroup_GetLayerPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getlayer"); #else // _WIN32 - pWrapperTable->m_Slice_GetZTop = (PLib3MFSlice_GetZTopPtr) dlsym(hLibrary, "lib3mf_slice_getztop"); + pWrapperTable->m_MultiPropertyGroup_GetLayer = (PLib3MFMultiPropertyGroup_GetLayerPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getlayer"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_GetZTop == nullptr) + if (pWrapperTable->m_MultiPropertyGroup_GetLayer == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_SliceStack_GetBottomZ = (PLib3MFSliceStack_GetBottomZPtr) GetProcAddress(hLibrary, "lib3mf_slicestack_getbottomz"); + pWrapperTable->m_MultiPropertyGroup_RemoveLayer = (PLib3MFMultiPropertyGroup_RemoveLayerPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_removelayer"); #else // _WIN32 - pWrapperTable->m_SliceStack_GetBottomZ = (PLib3MFSliceStack_GetBottomZPtr) dlsym(hLibrary, "lib3mf_slicestack_getbottomz"); + pWrapperTable->m_MultiPropertyGroup_RemoveLayer = (PLib3MFMultiPropertyGroup_RemoveLayerPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_removelayer"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_SliceStack_GetBottomZ == nullptr) + if (pWrapperTable->m_MultiPropertyGroup_RemoveLayer == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_SliceStack_GetSliceCount = (PLib3MFSliceStack_GetSliceCountPtr) GetProcAddress(hLibrary, "lib3mf_slicestack_getslicecount"); + pWrapperTable->m_Attachment_GetPath = (PLib3MFAttachment_GetPathPtr) GetProcAddress(hLibrary, "lib3mf_attachment_getpath"); #else // _WIN32 - pWrapperTable->m_SliceStack_GetSliceCount = (PLib3MFSliceStack_GetSliceCountPtr) dlsym(hLibrary, "lib3mf_slicestack_getslicecount"); + pWrapperTable->m_Attachment_GetPath = (PLib3MFAttachment_GetPathPtr) dlsym(hLibrary, "lib3mf_attachment_getpath"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_SliceStack_GetSliceCount == nullptr) + if (pWrapperTable->m_Attachment_GetPath == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_SliceStack_GetSlice = (PLib3MFSliceStack_GetSlicePtr) GetProcAddress(hLibrary, "lib3mf_slicestack_getslice"); + pWrapperTable->m_Attachment_SetPath = (PLib3MFAttachment_SetPathPtr) GetProcAddress(hLibrary, "lib3mf_attachment_setpath"); #else // _WIN32 - pWrapperTable->m_SliceStack_GetSlice = (PLib3MFSliceStack_GetSlicePtr) dlsym(hLibrary, "lib3mf_slicestack_getslice"); + pWrapperTable->m_Attachment_SetPath = (PLib3MFAttachment_SetPathPtr) dlsym(hLibrary, "lib3mf_attachment_setpath"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_SliceStack_GetSlice == nullptr) + if (pWrapperTable->m_Attachment_SetPath == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_SliceStack_AddSlice = (PLib3MFSliceStack_AddSlicePtr) GetProcAddress(hLibrary, "lib3mf_slicestack_addslice"); + pWrapperTable->m_Attachment_PackagePart = (PLib3MFAttachment_PackagePartPtr) GetProcAddress(hLibrary, "lib3mf_attachment_packagepart"); #else // _WIN32 - pWrapperTable->m_SliceStack_AddSlice = (PLib3MFSliceStack_AddSlicePtr) dlsym(hLibrary, "lib3mf_slicestack_addslice"); + pWrapperTable->m_Attachment_PackagePart = (PLib3MFAttachment_PackagePartPtr) dlsym(hLibrary, "lib3mf_attachment_packagepart"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_SliceStack_AddSlice == nullptr) + if (pWrapperTable->m_Attachment_PackagePart == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_SliceStack_GetSliceRefCount = (PLib3MFSliceStack_GetSliceRefCountPtr) GetProcAddress(hLibrary, "lib3mf_slicestack_getslicerefcount"); + pWrapperTable->m_Attachment_GetRelationShipType = (PLib3MFAttachment_GetRelationShipTypePtr) GetProcAddress(hLibrary, "lib3mf_attachment_getrelationshiptype"); #else // _WIN32 - pWrapperTable->m_SliceStack_GetSliceRefCount = (PLib3MFSliceStack_GetSliceRefCountPtr) dlsym(hLibrary, "lib3mf_slicestack_getslicerefcount"); + pWrapperTable->m_Attachment_GetRelationShipType = (PLib3MFAttachment_GetRelationShipTypePtr) dlsym(hLibrary, "lib3mf_attachment_getrelationshiptype"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_SliceStack_GetSliceRefCount == nullptr) + if (pWrapperTable->m_Attachment_GetRelationShipType == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_SliceStack_AddSliceStackReference = (PLib3MFSliceStack_AddSliceStackReferencePtr) GetProcAddress(hLibrary, "lib3mf_slicestack_addslicestackreference"); + pWrapperTable->m_Attachment_SetRelationShipType = (PLib3MFAttachment_SetRelationShipTypePtr) GetProcAddress(hLibrary, "lib3mf_attachment_setrelationshiptype"); #else // _WIN32 - pWrapperTable->m_SliceStack_AddSliceStackReference = (PLib3MFSliceStack_AddSliceStackReferencePtr) dlsym(hLibrary, "lib3mf_slicestack_addslicestackreference"); + pWrapperTable->m_Attachment_SetRelationShipType = (PLib3MFAttachment_SetRelationShipTypePtr) dlsym(hLibrary, "lib3mf_attachment_setrelationshiptype"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_SliceStack_AddSliceStackReference == nullptr) + if (pWrapperTable->m_Attachment_SetRelationShipType == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_SliceStack_GetSliceStackReference = (PLib3MFSliceStack_GetSliceStackReferencePtr) GetProcAddress(hLibrary, "lib3mf_slicestack_getslicestackreference"); + pWrapperTable->m_Attachment_WriteToFile = (PLib3MFAttachment_WriteToFilePtr) GetProcAddress(hLibrary, "lib3mf_attachment_writetofile"); #else // _WIN32 - pWrapperTable->m_SliceStack_GetSliceStackReference = (PLib3MFSliceStack_GetSliceStackReferencePtr) dlsym(hLibrary, "lib3mf_slicestack_getslicestackreference"); + pWrapperTable->m_Attachment_WriteToFile = (PLib3MFAttachment_WriteToFilePtr) dlsym(hLibrary, "lib3mf_attachment_writetofile"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_SliceStack_GetSliceStackReference == nullptr) + if (pWrapperTable->m_Attachment_WriteToFile == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_SliceStack_CollapseSliceReferences = (PLib3MFSliceStack_CollapseSliceReferencesPtr) GetProcAddress(hLibrary, "lib3mf_slicestack_collapseslicereferences"); + pWrapperTable->m_Attachment_ReadFromFile = (PLib3MFAttachment_ReadFromFilePtr) GetProcAddress(hLibrary, "lib3mf_attachment_readfromfile"); #else // _WIN32 - pWrapperTable->m_SliceStack_CollapseSliceReferences = (PLib3MFSliceStack_CollapseSliceReferencesPtr) dlsym(hLibrary, "lib3mf_slicestack_collapseslicereferences"); + pWrapperTable->m_Attachment_ReadFromFile = (PLib3MFAttachment_ReadFromFilePtr) dlsym(hLibrary, "lib3mf_attachment_readfromfile"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_SliceStack_CollapseSliceReferences == nullptr) + if (pWrapperTable->m_Attachment_ReadFromFile == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_SliceStack_SetOwnPath = (PLib3MFSliceStack_SetOwnPathPtr) GetProcAddress(hLibrary, "lib3mf_slicestack_setownpath"); + pWrapperTable->m_Attachment_ReadFromCallback = (PLib3MFAttachment_ReadFromCallbackPtr) GetProcAddress(hLibrary, "lib3mf_attachment_readfromcallback"); #else // _WIN32 - pWrapperTable->m_SliceStack_SetOwnPath = (PLib3MFSliceStack_SetOwnPathPtr) dlsym(hLibrary, "lib3mf_slicestack_setownpath"); + pWrapperTable->m_Attachment_ReadFromCallback = (PLib3MFAttachment_ReadFromCallbackPtr) dlsym(hLibrary, "lib3mf_attachment_readfromcallback"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_SliceStack_SetOwnPath == nullptr) + if (pWrapperTable->m_Attachment_ReadFromCallback == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_SliceStack_GetOwnPath = (PLib3MFSliceStack_GetOwnPathPtr) GetProcAddress(hLibrary, "lib3mf_slicestack_getownpath"); + pWrapperTable->m_Attachment_GetStreamSize = (PLib3MFAttachment_GetStreamSizePtr) GetProcAddress(hLibrary, "lib3mf_attachment_getstreamsize"); #else // _WIN32 - pWrapperTable->m_SliceStack_GetOwnPath = (PLib3MFSliceStack_GetOwnPathPtr) dlsym(hLibrary, "lib3mf_slicestack_getownpath"); + pWrapperTable->m_Attachment_GetStreamSize = (PLib3MFAttachment_GetStreamSizePtr) dlsym(hLibrary, "lib3mf_attachment_getstreamsize"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_SliceStack_GetOwnPath == nullptr) + if (pWrapperTable->m_Attachment_GetStreamSize == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Consumer_GetConsumerID = (PLib3MFConsumer_GetConsumerIDPtr) GetProcAddress(hLibrary, "lib3mf_consumer_getconsumerid"); + pWrapperTable->m_Attachment_WriteToBuffer = (PLib3MFAttachment_WriteToBufferPtr) GetProcAddress(hLibrary, "lib3mf_attachment_writetobuffer"); #else // _WIN32 - pWrapperTable->m_Consumer_GetConsumerID = (PLib3MFConsumer_GetConsumerIDPtr) dlsym(hLibrary, "lib3mf_consumer_getconsumerid"); + pWrapperTable->m_Attachment_WriteToBuffer = (PLib3MFAttachment_WriteToBufferPtr) dlsym(hLibrary, "lib3mf_attachment_writetobuffer"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Consumer_GetConsumerID == nullptr) + if (pWrapperTable->m_Attachment_WriteToBuffer == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Consumer_GetKeyID = (PLib3MFConsumer_GetKeyIDPtr) GetProcAddress(hLibrary, "lib3mf_consumer_getkeyid"); + pWrapperTable->m_Attachment_ReadFromBuffer = (PLib3MFAttachment_ReadFromBufferPtr) GetProcAddress(hLibrary, "lib3mf_attachment_readfrombuffer"); #else // _WIN32 - pWrapperTable->m_Consumer_GetKeyID = (PLib3MFConsumer_GetKeyIDPtr) dlsym(hLibrary, "lib3mf_consumer_getkeyid"); + pWrapperTable->m_Attachment_ReadFromBuffer = (PLib3MFAttachment_ReadFromBufferPtr) dlsym(hLibrary, "lib3mf_attachment_readfrombuffer"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Consumer_GetKeyID == nullptr) + if (pWrapperTable->m_Attachment_ReadFromBuffer == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Consumer_GetKeyValue = (PLib3MFConsumer_GetKeyValuePtr) GetProcAddress(hLibrary, "lib3mf_consumer_getkeyvalue"); + pWrapperTable->m_Texture2D_GetAttachment = (PLib3MFTexture2D_GetAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_getattachment"); #else // _WIN32 - pWrapperTable->m_Consumer_GetKeyValue = (PLib3MFConsumer_GetKeyValuePtr) dlsym(hLibrary, "lib3mf_consumer_getkeyvalue"); + pWrapperTable->m_Texture2D_GetAttachment = (PLib3MFTexture2D_GetAttachmentPtr) dlsym(hLibrary, "lib3mf_texture2d_getattachment"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Consumer_GetKeyValue == nullptr) + if (pWrapperTable->m_Texture2D_GetAttachment == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_AccessRight_GetConsumer = (PLib3MFAccessRight_GetConsumerPtr) GetProcAddress(hLibrary, "lib3mf_accessright_getconsumer"); + pWrapperTable->m_Texture2D_SetAttachment = (PLib3MFTexture2D_SetAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_setattachment"); #else // _WIN32 - pWrapperTable->m_AccessRight_GetConsumer = (PLib3MFAccessRight_GetConsumerPtr) dlsym(hLibrary, "lib3mf_accessright_getconsumer"); + pWrapperTable->m_Texture2D_SetAttachment = (PLib3MFTexture2D_SetAttachmentPtr) dlsym(hLibrary, "lib3mf_texture2d_setattachment"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_AccessRight_GetConsumer == nullptr) + if (pWrapperTable->m_Texture2D_SetAttachment == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_AccessRight_GetWrappingAlgorithm = (PLib3MFAccessRight_GetWrappingAlgorithmPtr) GetProcAddress(hLibrary, "lib3mf_accessright_getwrappingalgorithm"); + pWrapperTable->m_Texture2D_GetContentType = (PLib3MFTexture2D_GetContentTypePtr) GetProcAddress(hLibrary, "lib3mf_texture2d_getcontenttype"); #else // _WIN32 - pWrapperTable->m_AccessRight_GetWrappingAlgorithm = (PLib3MFAccessRight_GetWrappingAlgorithmPtr) dlsym(hLibrary, "lib3mf_accessright_getwrappingalgorithm"); + pWrapperTable->m_Texture2D_GetContentType = (PLib3MFTexture2D_GetContentTypePtr) dlsym(hLibrary, "lib3mf_texture2d_getcontenttype"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_AccessRight_GetWrappingAlgorithm == nullptr) + if (pWrapperTable->m_Texture2D_GetContentType == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_AccessRight_GetMgfAlgorithm = (PLib3MFAccessRight_GetMgfAlgorithmPtr) GetProcAddress(hLibrary, "lib3mf_accessright_getmgfalgorithm"); + pWrapperTable->m_Texture2D_SetContentType = (PLib3MFTexture2D_SetContentTypePtr) GetProcAddress(hLibrary, "lib3mf_texture2d_setcontenttype"); #else // _WIN32 - pWrapperTable->m_AccessRight_GetMgfAlgorithm = (PLib3MFAccessRight_GetMgfAlgorithmPtr) dlsym(hLibrary, "lib3mf_accessright_getmgfalgorithm"); + pWrapperTable->m_Texture2D_SetContentType = (PLib3MFTexture2D_SetContentTypePtr) dlsym(hLibrary, "lib3mf_texture2d_setcontenttype"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_AccessRight_GetMgfAlgorithm == nullptr) + if (pWrapperTable->m_Texture2D_SetContentType == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_AccessRight_GetDigestMethod = (PLib3MFAccessRight_GetDigestMethodPtr) GetProcAddress(hLibrary, "lib3mf_accessright_getdigestmethod"); + pWrapperTable->m_Texture2D_GetTileStyleUV = (PLib3MFTexture2D_GetTileStyleUVPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_gettilestyleuv"); #else // _WIN32 - pWrapperTable->m_AccessRight_GetDigestMethod = (PLib3MFAccessRight_GetDigestMethodPtr) dlsym(hLibrary, "lib3mf_accessright_getdigestmethod"); + pWrapperTable->m_Texture2D_GetTileStyleUV = (PLib3MFTexture2D_GetTileStyleUVPtr) dlsym(hLibrary, "lib3mf_texture2d_gettilestyleuv"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_AccessRight_GetDigestMethod == nullptr) + if (pWrapperTable->m_Texture2D_GetTileStyleUV == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ContentEncryptionParams_GetEncryptionAlgorithm = (PLib3MFContentEncryptionParams_GetEncryptionAlgorithmPtr) GetProcAddress(hLibrary, "lib3mf_contentencryptionparams_getencryptionalgorithm"); + pWrapperTable->m_Texture2D_SetTileStyleUV = (PLib3MFTexture2D_SetTileStyleUVPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_settilestyleuv"); #else // _WIN32 - pWrapperTable->m_ContentEncryptionParams_GetEncryptionAlgorithm = (PLib3MFContentEncryptionParams_GetEncryptionAlgorithmPtr) dlsym(hLibrary, "lib3mf_contentencryptionparams_getencryptionalgorithm"); + pWrapperTable->m_Texture2D_SetTileStyleUV = (PLib3MFTexture2D_SetTileStyleUVPtr) dlsym(hLibrary, "lib3mf_texture2d_settilestyleuv"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ContentEncryptionParams_GetEncryptionAlgorithm == nullptr) + if (pWrapperTable->m_Texture2D_SetTileStyleUV == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ContentEncryptionParams_GetKey = (PLib3MFContentEncryptionParams_GetKeyPtr) GetProcAddress(hLibrary, "lib3mf_contentencryptionparams_getkey"); + pWrapperTable->m_Texture2D_GetFilter = (PLib3MFTexture2D_GetFilterPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_getfilter"); #else // _WIN32 - pWrapperTable->m_ContentEncryptionParams_GetKey = (PLib3MFContentEncryptionParams_GetKeyPtr) dlsym(hLibrary, "lib3mf_contentencryptionparams_getkey"); + pWrapperTable->m_Texture2D_GetFilter = (PLib3MFTexture2D_GetFilterPtr) dlsym(hLibrary, "lib3mf_texture2d_getfilter"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ContentEncryptionParams_GetKey == nullptr) + if (pWrapperTable->m_Texture2D_GetFilter == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ContentEncryptionParams_GetInitializationVector = (PLib3MFContentEncryptionParams_GetInitializationVectorPtr) GetProcAddress(hLibrary, "lib3mf_contentencryptionparams_getinitializationvector"); + pWrapperTable->m_Texture2D_SetFilter = (PLib3MFTexture2D_SetFilterPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_setfilter"); #else // _WIN32 - pWrapperTable->m_ContentEncryptionParams_GetInitializationVector = (PLib3MFContentEncryptionParams_GetInitializationVectorPtr) dlsym(hLibrary, "lib3mf_contentencryptionparams_getinitializationvector"); + pWrapperTable->m_Texture2D_SetFilter = (PLib3MFTexture2D_SetFilterPtr) dlsym(hLibrary, "lib3mf_texture2d_setfilter"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ContentEncryptionParams_GetInitializationVector == nullptr) + if (pWrapperTable->m_Texture2D_SetFilter == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ContentEncryptionParams_GetAuthenticationTag = (PLib3MFContentEncryptionParams_GetAuthenticationTagPtr) GetProcAddress(hLibrary, "lib3mf_contentencryptionparams_getauthenticationtag"); + pWrapperTable->m_BuildItem_GetObjectResource = (PLib3MFBuildItem_GetObjectResourcePtr) GetProcAddress(hLibrary, "lib3mf_builditem_getobjectresource"); #else // _WIN32 - pWrapperTable->m_ContentEncryptionParams_GetAuthenticationTag = (PLib3MFContentEncryptionParams_GetAuthenticationTagPtr) dlsym(hLibrary, "lib3mf_contentencryptionparams_getauthenticationtag"); + pWrapperTable->m_BuildItem_GetObjectResource = (PLib3MFBuildItem_GetObjectResourcePtr) dlsym(hLibrary, "lib3mf_builditem_getobjectresource"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ContentEncryptionParams_GetAuthenticationTag == nullptr) + if (pWrapperTable->m_BuildItem_GetObjectResource == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ContentEncryptionParams_SetAuthenticationTag = (PLib3MFContentEncryptionParams_SetAuthenticationTagPtr) GetProcAddress(hLibrary, "lib3mf_contentencryptionparams_setauthenticationtag"); + pWrapperTable->m_BuildItem_GetUUID = (PLib3MFBuildItem_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getuuid"); #else // _WIN32 - pWrapperTable->m_ContentEncryptionParams_SetAuthenticationTag = (PLib3MFContentEncryptionParams_SetAuthenticationTagPtr) dlsym(hLibrary, "lib3mf_contentencryptionparams_setauthenticationtag"); + pWrapperTable->m_BuildItem_GetUUID = (PLib3MFBuildItem_GetUUIDPtr) dlsym(hLibrary, "lib3mf_builditem_getuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ContentEncryptionParams_SetAuthenticationTag == nullptr) + if (pWrapperTable->m_BuildItem_GetUUID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ContentEncryptionParams_GetAdditionalAuthenticationData = (PLib3MFContentEncryptionParams_GetAdditionalAuthenticationDataPtr) GetProcAddress(hLibrary, "lib3mf_contentencryptionparams_getadditionalauthenticationdata"); + pWrapperTable->m_BuildItem_SetUUID = (PLib3MFBuildItem_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_builditem_setuuid"); #else // _WIN32 - pWrapperTable->m_ContentEncryptionParams_GetAdditionalAuthenticationData = (PLib3MFContentEncryptionParams_GetAdditionalAuthenticationDataPtr) dlsym(hLibrary, "lib3mf_contentencryptionparams_getadditionalauthenticationdata"); + pWrapperTable->m_BuildItem_SetUUID = (PLib3MFBuildItem_SetUUIDPtr) dlsym(hLibrary, "lib3mf_builditem_setuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ContentEncryptionParams_GetAdditionalAuthenticationData == nullptr) + if (pWrapperTable->m_BuildItem_SetUUID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ContentEncryptionParams_GetDescriptor = (PLib3MFContentEncryptionParams_GetDescriptorPtr) GetProcAddress(hLibrary, "lib3mf_contentencryptionparams_getdescriptor"); + pWrapperTable->m_BuildItem_GetObjectResourceID = (PLib3MFBuildItem_GetObjectResourceIDPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getobjectresourceid"); #else // _WIN32 - pWrapperTable->m_ContentEncryptionParams_GetDescriptor = (PLib3MFContentEncryptionParams_GetDescriptorPtr) dlsym(hLibrary, "lib3mf_contentencryptionparams_getdescriptor"); + pWrapperTable->m_BuildItem_GetObjectResourceID = (PLib3MFBuildItem_GetObjectResourceIDPtr) dlsym(hLibrary, "lib3mf_builditem_getobjectresourceid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ContentEncryptionParams_GetDescriptor == nullptr) + if (pWrapperTable->m_BuildItem_GetObjectResourceID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ContentEncryptionParams_GetKeyUUID = (PLib3MFContentEncryptionParams_GetKeyUUIDPtr) GetProcAddress(hLibrary, "lib3mf_contentencryptionparams_getkeyuuid"); + pWrapperTable->m_BuildItem_HasObjectTransform = (PLib3MFBuildItem_HasObjectTransformPtr) GetProcAddress(hLibrary, "lib3mf_builditem_hasobjecttransform"); #else // _WIN32 - pWrapperTable->m_ContentEncryptionParams_GetKeyUUID = (PLib3MFContentEncryptionParams_GetKeyUUIDPtr) dlsym(hLibrary, "lib3mf_contentencryptionparams_getkeyuuid"); + pWrapperTable->m_BuildItem_HasObjectTransform = (PLib3MFBuildItem_HasObjectTransformPtr) dlsym(hLibrary, "lib3mf_builditem_hasobjecttransform"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ContentEncryptionParams_GetKeyUUID == nullptr) + if (pWrapperTable->m_BuildItem_HasObjectTransform == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ResourceData_GetPath = (PLib3MFResourceData_GetPathPtr) GetProcAddress(hLibrary, "lib3mf_resourcedata_getpath"); + pWrapperTable->m_BuildItem_GetObjectTransform = (PLib3MFBuildItem_GetObjectTransformPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getobjecttransform"); #else // _WIN32 - pWrapperTable->m_ResourceData_GetPath = (PLib3MFResourceData_GetPathPtr) dlsym(hLibrary, "lib3mf_resourcedata_getpath"); + pWrapperTable->m_BuildItem_GetObjectTransform = (PLib3MFBuildItem_GetObjectTransformPtr) dlsym(hLibrary, "lib3mf_builditem_getobjecttransform"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ResourceData_GetPath == nullptr) + if (pWrapperTable->m_BuildItem_GetObjectTransform == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ResourceData_GetEncryptionAlgorithm = (PLib3MFResourceData_GetEncryptionAlgorithmPtr) GetProcAddress(hLibrary, "lib3mf_resourcedata_getencryptionalgorithm"); + pWrapperTable->m_BuildItem_SetObjectTransform = (PLib3MFBuildItem_SetObjectTransformPtr) GetProcAddress(hLibrary, "lib3mf_builditem_setobjecttransform"); #else // _WIN32 - pWrapperTable->m_ResourceData_GetEncryptionAlgorithm = (PLib3MFResourceData_GetEncryptionAlgorithmPtr) dlsym(hLibrary, "lib3mf_resourcedata_getencryptionalgorithm"); + pWrapperTable->m_BuildItem_SetObjectTransform = (PLib3MFBuildItem_SetObjectTransformPtr) dlsym(hLibrary, "lib3mf_builditem_setobjecttransform"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ResourceData_GetEncryptionAlgorithm == nullptr) + if (pWrapperTable->m_BuildItem_SetObjectTransform == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ResourceData_GetCompression = (PLib3MFResourceData_GetCompressionPtr) GetProcAddress(hLibrary, "lib3mf_resourcedata_getcompression"); + pWrapperTable->m_BuildItem_GetPartNumber = (PLib3MFBuildItem_GetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getpartnumber"); #else // _WIN32 - pWrapperTable->m_ResourceData_GetCompression = (PLib3MFResourceData_GetCompressionPtr) dlsym(hLibrary, "lib3mf_resourcedata_getcompression"); + pWrapperTable->m_BuildItem_GetPartNumber = (PLib3MFBuildItem_GetPartNumberPtr) dlsym(hLibrary, "lib3mf_builditem_getpartnumber"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ResourceData_GetCompression == nullptr) + if (pWrapperTable->m_BuildItem_GetPartNumber == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ResourceData_GetAdditionalAuthenticationData = (PLib3MFResourceData_GetAdditionalAuthenticationDataPtr) GetProcAddress(hLibrary, "lib3mf_resourcedata_getadditionalauthenticationdata"); + pWrapperTable->m_BuildItem_SetPartNumber = (PLib3MFBuildItem_SetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_builditem_setpartnumber"); #else // _WIN32 - pWrapperTable->m_ResourceData_GetAdditionalAuthenticationData = (PLib3MFResourceData_GetAdditionalAuthenticationDataPtr) dlsym(hLibrary, "lib3mf_resourcedata_getadditionalauthenticationdata"); + pWrapperTable->m_BuildItem_SetPartNumber = (PLib3MFBuildItem_SetPartNumberPtr) dlsym(hLibrary, "lib3mf_builditem_setpartnumber"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ResourceData_GetAdditionalAuthenticationData == nullptr) + if (pWrapperTable->m_BuildItem_SetPartNumber == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ResourceDataGroup_GetKeyUUID = (PLib3MFResourceDataGroup_GetKeyUUIDPtr) GetProcAddress(hLibrary, "lib3mf_resourcedatagroup_getkeyuuid"); + pWrapperTable->m_BuildItem_GetMetaDataGroup = (PLib3MFBuildItem_GetMetaDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getmetadatagroup"); #else // _WIN32 - pWrapperTable->m_ResourceDataGroup_GetKeyUUID = (PLib3MFResourceDataGroup_GetKeyUUIDPtr) dlsym(hLibrary, "lib3mf_resourcedatagroup_getkeyuuid"); + pWrapperTable->m_BuildItem_GetMetaDataGroup = (PLib3MFBuildItem_GetMetaDataGroupPtr) dlsym(hLibrary, "lib3mf_builditem_getmetadatagroup"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ResourceDataGroup_GetKeyUUID == nullptr) + if (pWrapperTable->m_BuildItem_GetMetaDataGroup == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ResourceDataGroup_AddAccessRight = (PLib3MFResourceDataGroup_AddAccessRightPtr) GetProcAddress(hLibrary, "lib3mf_resourcedatagroup_addaccessright"); + pWrapperTable->m_BuildItem_GetOutbox = (PLib3MFBuildItem_GetOutboxPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getoutbox"); #else // _WIN32 - pWrapperTable->m_ResourceDataGroup_AddAccessRight = (PLib3MFResourceDataGroup_AddAccessRightPtr) dlsym(hLibrary, "lib3mf_resourcedatagroup_addaccessright"); + pWrapperTable->m_BuildItem_GetOutbox = (PLib3MFBuildItem_GetOutboxPtr) dlsym(hLibrary, "lib3mf_builditem_getoutbox"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ResourceDataGroup_AddAccessRight == nullptr) + if (pWrapperTable->m_BuildItem_GetOutbox == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ResourceDataGroup_FindAccessRightByConsumer = (PLib3MFResourceDataGroup_FindAccessRightByConsumerPtr) GetProcAddress(hLibrary, "lib3mf_resourcedatagroup_findaccessrightbyconsumer"); + pWrapperTable->m_BuildItemIterator_MoveNext = (PLib3MFBuildItemIterator_MoveNextPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_movenext"); #else // _WIN32 - pWrapperTable->m_ResourceDataGroup_FindAccessRightByConsumer = (PLib3MFResourceDataGroup_FindAccessRightByConsumerPtr) dlsym(hLibrary, "lib3mf_resourcedatagroup_findaccessrightbyconsumer"); + pWrapperTable->m_BuildItemIterator_MoveNext = (PLib3MFBuildItemIterator_MoveNextPtr) dlsym(hLibrary, "lib3mf_builditemiterator_movenext"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ResourceDataGroup_FindAccessRightByConsumer == nullptr) + if (pWrapperTable->m_BuildItemIterator_MoveNext == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ResourceDataGroup_RemoveAccessRight = (PLib3MFResourceDataGroup_RemoveAccessRightPtr) GetProcAddress(hLibrary, "lib3mf_resourcedatagroup_removeaccessright"); + pWrapperTable->m_BuildItemIterator_MovePrevious = (PLib3MFBuildItemIterator_MovePreviousPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_moveprevious"); #else // _WIN32 - pWrapperTable->m_ResourceDataGroup_RemoveAccessRight = (PLib3MFResourceDataGroup_RemoveAccessRightPtr) dlsym(hLibrary, "lib3mf_resourcedatagroup_removeaccessright"); + pWrapperTable->m_BuildItemIterator_MovePrevious = (PLib3MFBuildItemIterator_MovePreviousPtr) dlsym(hLibrary, "lib3mf_builditemiterator_moveprevious"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ResourceDataGroup_RemoveAccessRight == nullptr) + if (pWrapperTable->m_BuildItemIterator_MovePrevious == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_KeyStore_AddConsumer = (PLib3MFKeyStore_AddConsumerPtr) GetProcAddress(hLibrary, "lib3mf_keystore_addconsumer"); + pWrapperTable->m_BuildItemIterator_GetCurrent = (PLib3MFBuildItemIterator_GetCurrentPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_getcurrent"); #else // _WIN32 - pWrapperTable->m_KeyStore_AddConsumer = (PLib3MFKeyStore_AddConsumerPtr) dlsym(hLibrary, "lib3mf_keystore_addconsumer"); + pWrapperTable->m_BuildItemIterator_GetCurrent = (PLib3MFBuildItemIterator_GetCurrentPtr) dlsym(hLibrary, "lib3mf_builditemiterator_getcurrent"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_KeyStore_AddConsumer == nullptr) + if (pWrapperTable->m_BuildItemIterator_GetCurrent == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_KeyStore_GetConsumerCount = (PLib3MFKeyStore_GetConsumerCountPtr) GetProcAddress(hLibrary, "lib3mf_keystore_getconsumercount"); + pWrapperTable->m_BuildItemIterator_Clone = (PLib3MFBuildItemIterator_ClonePtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_clone"); #else // _WIN32 - pWrapperTable->m_KeyStore_GetConsumerCount = (PLib3MFKeyStore_GetConsumerCountPtr) dlsym(hLibrary, "lib3mf_keystore_getconsumercount"); + pWrapperTable->m_BuildItemIterator_Clone = (PLib3MFBuildItemIterator_ClonePtr) dlsym(hLibrary, "lib3mf_builditemiterator_clone"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_KeyStore_GetConsumerCount == nullptr) + if (pWrapperTable->m_BuildItemIterator_Clone == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_KeyStore_GetConsumer = (PLib3MFKeyStore_GetConsumerPtr) GetProcAddress(hLibrary, "lib3mf_keystore_getconsumer"); + pWrapperTable->m_BuildItemIterator_Count = (PLib3MFBuildItemIterator_CountPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_count"); #else // _WIN32 - pWrapperTable->m_KeyStore_GetConsumer = (PLib3MFKeyStore_GetConsumerPtr) dlsym(hLibrary, "lib3mf_keystore_getconsumer"); + pWrapperTable->m_BuildItemIterator_Count = (PLib3MFBuildItemIterator_CountPtr) dlsym(hLibrary, "lib3mf_builditemiterator_count"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_KeyStore_GetConsumer == nullptr) + if (pWrapperTable->m_BuildItemIterator_Count == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_KeyStore_RemoveConsumer = (PLib3MFKeyStore_RemoveConsumerPtr) GetProcAddress(hLibrary, "lib3mf_keystore_removeconsumer"); + pWrapperTable->m_Slice_SetVertices = (PLib3MFSlice_SetVerticesPtr) GetProcAddress(hLibrary, "lib3mf_slice_setvertices"); #else // _WIN32 - pWrapperTable->m_KeyStore_RemoveConsumer = (PLib3MFKeyStore_RemoveConsumerPtr) dlsym(hLibrary, "lib3mf_keystore_removeconsumer"); + pWrapperTable->m_Slice_SetVertices = (PLib3MFSlice_SetVerticesPtr) dlsym(hLibrary, "lib3mf_slice_setvertices"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_KeyStore_RemoveConsumer == nullptr) + if (pWrapperTable->m_Slice_SetVertices == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_KeyStore_FindConsumer = (PLib3MFKeyStore_FindConsumerPtr) GetProcAddress(hLibrary, "lib3mf_keystore_findconsumer"); + pWrapperTable->m_Slice_GetVertices = (PLib3MFSlice_GetVerticesPtr) GetProcAddress(hLibrary, "lib3mf_slice_getvertices"); #else // _WIN32 - pWrapperTable->m_KeyStore_FindConsumer = (PLib3MFKeyStore_FindConsumerPtr) dlsym(hLibrary, "lib3mf_keystore_findconsumer"); + pWrapperTable->m_Slice_GetVertices = (PLib3MFSlice_GetVerticesPtr) dlsym(hLibrary, "lib3mf_slice_getvertices"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_KeyStore_FindConsumer == nullptr) + if (pWrapperTable->m_Slice_GetVertices == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_KeyStore_GetResourceDataGroupCount = (PLib3MFKeyStore_GetResourceDataGroupCountPtr) GetProcAddress(hLibrary, "lib3mf_keystore_getresourcedatagroupcount"); + pWrapperTable->m_Slice_GetVertexCount = (PLib3MFSlice_GetVertexCountPtr) GetProcAddress(hLibrary, "lib3mf_slice_getvertexcount"); #else // _WIN32 - pWrapperTable->m_KeyStore_GetResourceDataGroupCount = (PLib3MFKeyStore_GetResourceDataGroupCountPtr) dlsym(hLibrary, "lib3mf_keystore_getresourcedatagroupcount"); + pWrapperTable->m_Slice_GetVertexCount = (PLib3MFSlice_GetVertexCountPtr) dlsym(hLibrary, "lib3mf_slice_getvertexcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_KeyStore_GetResourceDataGroupCount == nullptr) + if (pWrapperTable->m_Slice_GetVertexCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_KeyStore_AddResourceDataGroup = (PLib3MFKeyStore_AddResourceDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_keystore_addresourcedatagroup"); + pWrapperTable->m_Slice_AddPolygon = (PLib3MFSlice_AddPolygonPtr) GetProcAddress(hLibrary, "lib3mf_slice_addpolygon"); #else // _WIN32 - pWrapperTable->m_KeyStore_AddResourceDataGroup = (PLib3MFKeyStore_AddResourceDataGroupPtr) dlsym(hLibrary, "lib3mf_keystore_addresourcedatagroup"); + pWrapperTable->m_Slice_AddPolygon = (PLib3MFSlice_AddPolygonPtr) dlsym(hLibrary, "lib3mf_slice_addpolygon"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_KeyStore_AddResourceDataGroup == nullptr) + if (pWrapperTable->m_Slice_AddPolygon == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_KeyStore_GetResourceDataGroup = (PLib3MFKeyStore_GetResourceDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_keystore_getresourcedatagroup"); + pWrapperTable->m_Slice_GetPolygonCount = (PLib3MFSlice_GetPolygonCountPtr) GetProcAddress(hLibrary, "lib3mf_slice_getpolygoncount"); #else // _WIN32 - pWrapperTable->m_KeyStore_GetResourceDataGroup = (PLib3MFKeyStore_GetResourceDataGroupPtr) dlsym(hLibrary, "lib3mf_keystore_getresourcedatagroup"); + pWrapperTable->m_Slice_GetPolygonCount = (PLib3MFSlice_GetPolygonCountPtr) dlsym(hLibrary, "lib3mf_slice_getpolygoncount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_KeyStore_GetResourceDataGroup == nullptr) + if (pWrapperTable->m_Slice_GetPolygonCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_KeyStore_RemoveResourceDataGroup = (PLib3MFKeyStore_RemoveResourceDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_keystore_removeresourcedatagroup"); + pWrapperTable->m_Slice_SetPolygonIndices = (PLib3MFSlice_SetPolygonIndicesPtr) GetProcAddress(hLibrary, "lib3mf_slice_setpolygonindices"); #else // _WIN32 - pWrapperTable->m_KeyStore_RemoveResourceDataGroup = (PLib3MFKeyStore_RemoveResourceDataGroupPtr) dlsym(hLibrary, "lib3mf_keystore_removeresourcedatagroup"); + pWrapperTable->m_Slice_SetPolygonIndices = (PLib3MFSlice_SetPolygonIndicesPtr) dlsym(hLibrary, "lib3mf_slice_setpolygonindices"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_KeyStore_RemoveResourceDataGroup == nullptr) + if (pWrapperTable->m_Slice_SetPolygonIndices == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_KeyStore_FindResourceDataGroup = (PLib3MFKeyStore_FindResourceDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_keystore_findresourcedatagroup"); + pWrapperTable->m_Slice_GetPolygonIndices = (PLib3MFSlice_GetPolygonIndicesPtr) GetProcAddress(hLibrary, "lib3mf_slice_getpolygonindices"); #else // _WIN32 - pWrapperTable->m_KeyStore_FindResourceDataGroup = (PLib3MFKeyStore_FindResourceDataGroupPtr) dlsym(hLibrary, "lib3mf_keystore_findresourcedatagroup"); + pWrapperTable->m_Slice_GetPolygonIndices = (PLib3MFSlice_GetPolygonIndicesPtr) dlsym(hLibrary, "lib3mf_slice_getpolygonindices"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_KeyStore_FindResourceDataGroup == nullptr) + if (pWrapperTable->m_Slice_GetPolygonIndices == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_KeyStore_AddResourceData = (PLib3MFKeyStore_AddResourceDataPtr) GetProcAddress(hLibrary, "lib3mf_keystore_addresourcedata"); + pWrapperTable->m_Slice_GetPolygonIndexCount = (PLib3MFSlice_GetPolygonIndexCountPtr) GetProcAddress(hLibrary, "lib3mf_slice_getpolygonindexcount"); #else // _WIN32 - pWrapperTable->m_KeyStore_AddResourceData = (PLib3MFKeyStore_AddResourceDataPtr) dlsym(hLibrary, "lib3mf_keystore_addresourcedata"); + pWrapperTable->m_Slice_GetPolygonIndexCount = (PLib3MFSlice_GetPolygonIndexCountPtr) dlsym(hLibrary, "lib3mf_slice_getpolygonindexcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_KeyStore_AddResourceData == nullptr) + if (pWrapperTable->m_Slice_GetPolygonIndexCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_KeyStore_RemoveResourceData = (PLib3MFKeyStore_RemoveResourceDataPtr) GetProcAddress(hLibrary, "lib3mf_keystore_removeresourcedata"); + pWrapperTable->m_Slice_GetZTop = (PLib3MFSlice_GetZTopPtr) GetProcAddress(hLibrary, "lib3mf_slice_getztop"); #else // _WIN32 - pWrapperTable->m_KeyStore_RemoveResourceData = (PLib3MFKeyStore_RemoveResourceDataPtr) dlsym(hLibrary, "lib3mf_keystore_removeresourcedata"); + pWrapperTable->m_Slice_GetZTop = (PLib3MFSlice_GetZTopPtr) dlsym(hLibrary, "lib3mf_slice_getztop"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_KeyStore_RemoveResourceData == nullptr) + if (pWrapperTable->m_Slice_GetZTop == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_KeyStore_FindResourceData = (PLib3MFKeyStore_FindResourceDataPtr) GetProcAddress(hLibrary, "lib3mf_keystore_findresourcedata"); + pWrapperTable->m_ToolpathProfile_GetUUID = (PLib3MFToolpathProfile_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getuuid"); #else // _WIN32 - pWrapperTable->m_KeyStore_FindResourceData = (PLib3MFKeyStore_FindResourceDataPtr) dlsym(hLibrary, "lib3mf_keystore_findresourcedata"); + pWrapperTable->m_ToolpathProfile_GetUUID = (PLib3MFToolpathProfile_GetUUIDPtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_KeyStore_FindResourceData == nullptr) + if (pWrapperTable->m_ToolpathProfile_GetUUID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_KeyStore_GetResourceDataCount = (PLib3MFKeyStore_GetResourceDataCountPtr) GetProcAddress(hLibrary, "lib3mf_keystore_getresourcedatacount"); + pWrapperTable->m_ToolpathProfile_GetName = (PLib3MFToolpathProfile_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getname"); #else // _WIN32 - pWrapperTable->m_KeyStore_GetResourceDataCount = (PLib3MFKeyStore_GetResourceDataCountPtr) dlsym(hLibrary, "lib3mf_keystore_getresourcedatacount"); + pWrapperTable->m_ToolpathProfile_GetName = (PLib3MFToolpathProfile_GetNamePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_KeyStore_GetResourceDataCount == nullptr) + if (pWrapperTable->m_ToolpathProfile_GetName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_KeyStore_GetResourceData = (PLib3MFKeyStore_GetResourceDataPtr) GetProcAddress(hLibrary, "lib3mf_keystore_getresourcedata"); + pWrapperTable->m_ToolpathProfile_GetParameterCount = (PLib3MFToolpathProfile_GetParameterCountPtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparametercount"); #else // _WIN32 - pWrapperTable->m_KeyStore_GetResourceData = (PLib3MFKeyStore_GetResourceDataPtr) dlsym(hLibrary, "lib3mf_keystore_getresourcedata"); + pWrapperTable->m_ToolpathProfile_GetParameterCount = (PLib3MFToolpathProfile_GetParameterCountPtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparametercount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_KeyStore_GetResourceData == nullptr) + if (pWrapperTable->m_ToolpathProfile_GetParameterCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_KeyStore_GetUUID = (PLib3MFKeyStore_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_keystore_getuuid"); + pWrapperTable->m_ToolpathProfile_GetParameterName = (PLib3MFToolpathProfile_GetParameterNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparametername"); #else // _WIN32 - pWrapperTable->m_KeyStore_GetUUID = (PLib3MFKeyStore_GetUUIDPtr) dlsym(hLibrary, "lib3mf_keystore_getuuid"); + pWrapperTable->m_ToolpathProfile_GetParameterName = (PLib3MFToolpathProfile_GetParameterNamePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparametername"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_KeyStore_GetUUID == nullptr) + if (pWrapperTable->m_ToolpathProfile_GetParameterName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_KeyStore_SetUUID = (PLib3MFKeyStore_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_keystore_setuuid"); + pWrapperTable->m_ToolpathProfile_GetParameterNameSpace = (PLib3MFToolpathProfile_GetParameterNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameternamespace"); #else // _WIN32 - pWrapperTable->m_KeyStore_SetUUID = (PLib3MFKeyStore_SetUUIDPtr) dlsym(hLibrary, "lib3mf_keystore_setuuid"); + pWrapperTable->m_ToolpathProfile_GetParameterNameSpace = (PLib3MFToolpathProfile_GetParameterNameSpacePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameternamespace"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_KeyStore_SetUUID == nullptr) + if (pWrapperTable->m_ToolpathProfile_GetParameterNameSpace == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_RootModelPart = (PLib3MFModel_RootModelPartPtr) GetProcAddress(hLibrary, "lib3mf_model_rootmodelpart"); + pWrapperTable->m_ToolpathProfile_HasParameterValue = (PLib3MFToolpathProfile_HasParameterValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_hasparametervalue"); #else // _WIN32 - pWrapperTable->m_Model_RootModelPart = (PLib3MFModel_RootModelPartPtr) dlsym(hLibrary, "lib3mf_model_rootmodelpart"); + pWrapperTable->m_ToolpathProfile_HasParameterValue = (PLib3MFToolpathProfile_HasParameterValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_hasparametervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_RootModelPart == nullptr) + if (pWrapperTable->m_ToolpathProfile_HasParameterValue == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_FindOrCreatePackagePart = (PLib3MFModel_FindOrCreatePackagePartPtr) GetProcAddress(hLibrary, "lib3mf_model_findorcreatepackagepart"); + pWrapperTable->m_ToolpathProfile_GetParameterValue = (PLib3MFToolpathProfile_GetParameterValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparametervalue"); #else // _WIN32 - pWrapperTable->m_Model_FindOrCreatePackagePart = (PLib3MFModel_FindOrCreatePackagePartPtr) dlsym(hLibrary, "lib3mf_model_findorcreatepackagepart"); + pWrapperTable->m_ToolpathProfile_GetParameterValue = (PLib3MFToolpathProfile_GetParameterValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparametervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_FindOrCreatePackagePart == nullptr) + if (pWrapperTable->m_ToolpathProfile_GetParameterValue == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_SetUnit = (PLib3MFModel_SetUnitPtr) GetProcAddress(hLibrary, "lib3mf_model_setunit"); + pWrapperTable->m_ToolpathProfile_GetParameterValueDef = (PLib3MFToolpathProfile_GetParameterValueDefPtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparametervaluedef"); #else // _WIN32 - pWrapperTable->m_Model_SetUnit = (PLib3MFModel_SetUnitPtr) dlsym(hLibrary, "lib3mf_model_setunit"); + pWrapperTable->m_ToolpathProfile_GetParameterValueDef = (PLib3MFToolpathProfile_GetParameterValueDefPtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparametervaluedef"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_SetUnit == nullptr) + if (pWrapperTable->m_ToolpathProfile_GetParameterValueDef == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetUnit = (PLib3MFModel_GetUnitPtr) GetProcAddress(hLibrary, "lib3mf_model_getunit"); + pWrapperTable->m_ToolpathProfile_GetParameterDoubleValue = (PLib3MFToolpathProfile_GetParameterDoubleValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameterdoublevalue"); #else // _WIN32 - pWrapperTable->m_Model_GetUnit = (PLib3MFModel_GetUnitPtr) dlsym(hLibrary, "lib3mf_model_getunit"); + pWrapperTable->m_ToolpathProfile_GetParameterDoubleValue = (PLib3MFToolpathProfile_GetParameterDoubleValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameterdoublevalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetUnit == nullptr) + if (pWrapperTable->m_ToolpathProfile_GetParameterDoubleValue == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetLanguage = (PLib3MFModel_GetLanguagePtr) GetProcAddress(hLibrary, "lib3mf_model_getlanguage"); + pWrapperTable->m_ToolpathProfile_GetParameterDoubleValueDef = (PLib3MFToolpathProfile_GetParameterDoubleValueDefPtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameterdoublevaluedef"); #else // _WIN32 - pWrapperTable->m_Model_GetLanguage = (PLib3MFModel_GetLanguagePtr) dlsym(hLibrary, "lib3mf_model_getlanguage"); + pWrapperTable->m_ToolpathProfile_GetParameterDoubleValueDef = (PLib3MFToolpathProfile_GetParameterDoubleValueDefPtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameterdoublevaluedef"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetLanguage == nullptr) + if (pWrapperTable->m_ToolpathProfile_GetParameterDoubleValueDef == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_SetLanguage = (PLib3MFModel_SetLanguagePtr) GetProcAddress(hLibrary, "lib3mf_model_setlanguage"); + pWrapperTable->m_ToolpathProfile_GetParameterIntegerValue = (PLib3MFToolpathProfile_GetParameterIntegerValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameterintegervalue"); #else // _WIN32 - pWrapperTable->m_Model_SetLanguage = (PLib3MFModel_SetLanguagePtr) dlsym(hLibrary, "lib3mf_model_setlanguage"); + pWrapperTable->m_ToolpathProfile_GetParameterIntegerValue = (PLib3MFToolpathProfile_GetParameterIntegerValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameterintegervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_SetLanguage == nullptr) + if (pWrapperTable->m_ToolpathProfile_GetParameterIntegerValue == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_QueryWriter = (PLib3MFModel_QueryWriterPtr) GetProcAddress(hLibrary, "lib3mf_model_querywriter"); + pWrapperTable->m_ToolpathProfile_GetParameterIntegerValueDef = (PLib3MFToolpathProfile_GetParameterIntegerValueDefPtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameterintegervaluedef"); #else // _WIN32 - pWrapperTable->m_Model_QueryWriter = (PLib3MFModel_QueryWriterPtr) dlsym(hLibrary, "lib3mf_model_querywriter"); + pWrapperTable->m_ToolpathProfile_GetParameterIntegerValueDef = (PLib3MFToolpathProfile_GetParameterIntegerValueDefPtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameterintegervaluedef"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_QueryWriter == nullptr) + if (pWrapperTable->m_ToolpathProfile_GetParameterIntegerValueDef == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_QueryReader = (PLib3MFModel_QueryReaderPtr) GetProcAddress(hLibrary, "lib3mf_model_queryreader"); + pWrapperTable->m_ToolpathProfile_GetParameterBoolValue = (PLib3MFToolpathProfile_GetParameterBoolValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameterboolvalue"); #else // _WIN32 - pWrapperTable->m_Model_QueryReader = (PLib3MFModel_QueryReaderPtr) dlsym(hLibrary, "lib3mf_model_queryreader"); + pWrapperTable->m_ToolpathProfile_GetParameterBoolValue = (PLib3MFToolpathProfile_GetParameterBoolValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameterboolvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_QueryReader == nullptr) + if (pWrapperTable->m_ToolpathProfile_GetParameterBoolValue == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetResourceByID = (PLib3MFModel_GetResourceByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getresourcebyid"); + pWrapperTable->m_ToolpathProfile_GetParameterBoolValueDef = (PLib3MFToolpathProfile_GetParameterBoolValueDefPtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameterboolvaluedef"); #else // _WIN32 - pWrapperTable->m_Model_GetResourceByID = (PLib3MFModel_GetResourceByIDPtr) dlsym(hLibrary, "lib3mf_model_getresourcebyid"); + pWrapperTable->m_ToolpathProfile_GetParameterBoolValueDef = (PLib3MFToolpathProfile_GetParameterBoolValueDefPtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameterboolvaluedef"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetResourceByID == nullptr) + if (pWrapperTable->m_ToolpathProfile_GetParameterBoolValueDef == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetTexture2DByID = (PLib3MFModel_GetTexture2DByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_gettexture2dbyid"); + pWrapperTable->m_ToolpathProfile_SetName = (PLib3MFToolpathProfile_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_setname"); #else // _WIN32 - pWrapperTable->m_Model_GetTexture2DByID = (PLib3MFModel_GetTexture2DByIDPtr) dlsym(hLibrary, "lib3mf_model_gettexture2dbyid"); + pWrapperTable->m_ToolpathProfile_SetName = (PLib3MFToolpathProfile_SetNamePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_setname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetTexture2DByID == nullptr) + if (pWrapperTable->m_ToolpathProfile_SetName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetPropertyTypeByID = (PLib3MFModel_GetPropertyTypeByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getpropertytypebyid"); + pWrapperTable->m_ToolpathProfile_SetParameterValue = (PLib3MFToolpathProfile_SetParameterValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_setparametervalue"); #else // _WIN32 - pWrapperTable->m_Model_GetPropertyTypeByID = (PLib3MFModel_GetPropertyTypeByIDPtr) dlsym(hLibrary, "lib3mf_model_getpropertytypebyid"); + pWrapperTable->m_ToolpathProfile_SetParameterValue = (PLib3MFToolpathProfile_SetParameterValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_setparametervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetPropertyTypeByID == nullptr) + if (pWrapperTable->m_ToolpathProfile_SetParameterValue == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetBaseMaterialGroupByID = (PLib3MFModel_GetBaseMaterialGroupByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getbasematerialgroupbyid"); + pWrapperTable->m_ToolpathProfile_SetParameterDoubleValue = (PLib3MFToolpathProfile_SetParameterDoubleValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_setparameterdoublevalue"); #else // _WIN32 - pWrapperTable->m_Model_GetBaseMaterialGroupByID = (PLib3MFModel_GetBaseMaterialGroupByIDPtr) dlsym(hLibrary, "lib3mf_model_getbasematerialgroupbyid"); + pWrapperTable->m_ToolpathProfile_SetParameterDoubleValue = (PLib3MFToolpathProfile_SetParameterDoubleValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_setparameterdoublevalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetBaseMaterialGroupByID == nullptr) + if (pWrapperTable->m_ToolpathProfile_SetParameterDoubleValue == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetTexture2DGroupByID = (PLib3MFModel_GetTexture2DGroupByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_gettexture2dgroupbyid"); + pWrapperTable->m_ToolpathProfile_SetParameterIntegerValue = (PLib3MFToolpathProfile_SetParameterIntegerValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_setparameterintegervalue"); #else // _WIN32 - pWrapperTable->m_Model_GetTexture2DGroupByID = (PLib3MFModel_GetTexture2DGroupByIDPtr) dlsym(hLibrary, "lib3mf_model_gettexture2dgroupbyid"); + pWrapperTable->m_ToolpathProfile_SetParameterIntegerValue = (PLib3MFToolpathProfile_SetParameterIntegerValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_setparameterintegervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetTexture2DGroupByID == nullptr) + if (pWrapperTable->m_ToolpathProfile_SetParameterIntegerValue == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetCompositeMaterialsByID = (PLib3MFModel_GetCompositeMaterialsByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getcompositematerialsbyid"); + pWrapperTable->m_ToolpathProfile_SetParameterBoolValue = (PLib3MFToolpathProfile_SetParameterBoolValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_setparameterboolvalue"); #else // _WIN32 - pWrapperTable->m_Model_GetCompositeMaterialsByID = (PLib3MFModel_GetCompositeMaterialsByIDPtr) dlsym(hLibrary, "lib3mf_model_getcompositematerialsbyid"); + pWrapperTable->m_ToolpathProfile_SetParameterBoolValue = (PLib3MFToolpathProfile_SetParameterBoolValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_setparameterboolvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetCompositeMaterialsByID == nullptr) + if (pWrapperTable->m_ToolpathProfile_SetParameterBoolValue == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetMultiPropertyGroupByID = (PLib3MFModel_GetMultiPropertyGroupByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getmultipropertygroupbyid"); + pWrapperTable->m_ToolpathLayerReader_GetLayerDataUUID = (PLib3MFToolpathLayerReader_GetLayerDataUUIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getlayerdatauuid"); #else // _WIN32 - pWrapperTable->m_Model_GetMultiPropertyGroupByID = (PLib3MFModel_GetMultiPropertyGroupByIDPtr) dlsym(hLibrary, "lib3mf_model_getmultipropertygroupbyid"); + pWrapperTable->m_ToolpathLayerReader_GetLayerDataUUID = (PLib3MFToolpathLayerReader_GetLayerDataUUIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getlayerdatauuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetMultiPropertyGroupByID == nullptr) + if (pWrapperTable->m_ToolpathLayerReader_GetLayerDataUUID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetMeshObjectByID = (PLib3MFModel_GetMeshObjectByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getmeshobjectbyid"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentCount = (PLib3MFToolpathLayerReader_GetSegmentCountPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentcount"); #else // _WIN32 - pWrapperTable->m_Model_GetMeshObjectByID = (PLib3MFModel_GetMeshObjectByIDPtr) dlsym(hLibrary, "lib3mf_model_getmeshobjectbyid"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentCount = (PLib3MFToolpathLayerReader_GetSegmentCountPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetMeshObjectByID == nullptr) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetComponentsObjectByID = (PLib3MFModel_GetComponentsObjectByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getcomponentsobjectbyid"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentInfo = (PLib3MFToolpathLayerReader_GetSegmentInfoPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentinfo"); #else // _WIN32 - pWrapperTable->m_Model_GetComponentsObjectByID = (PLib3MFModel_GetComponentsObjectByIDPtr) dlsym(hLibrary, "lib3mf_model_getcomponentsobjectbyid"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentInfo = (PLib3MFToolpathLayerReader_GetSegmentInfoPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentinfo"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetComponentsObjectByID == nullptr) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentInfo == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetColorGroupByID = (PLib3MFModel_GetColorGroupByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getcolorgroupbyid"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentProfile = (PLib3MFToolpathLayerReader_GetSegmentProfilePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentprofile"); #else // _WIN32 - pWrapperTable->m_Model_GetColorGroupByID = (PLib3MFModel_GetColorGroupByIDPtr) dlsym(hLibrary, "lib3mf_model_getcolorgroupbyid"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentProfile = (PLib3MFToolpathLayerReader_GetSegmentProfilePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentprofile"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetColorGroupByID == nullptr) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentProfile == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetSliceStackByID = (PLib3MFModel_GetSliceStackByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getslicestackbyid"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentProfileUUID = (PLib3MFToolpathLayerReader_GetSegmentProfileUUIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentprofileuuid"); #else // _WIN32 - pWrapperTable->m_Model_GetSliceStackByID = (PLib3MFModel_GetSliceStackByIDPtr) dlsym(hLibrary, "lib3mf_model_getslicestackbyid"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentProfileUUID = (PLib3MFToolpathLayerReader_GetSegmentProfileUUIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentprofileuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetSliceStackByID == nullptr) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentProfileUUID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetBuildUUID = (PLib3MFModel_GetBuildUUIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getbuilduuid"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentPart = (PLib3MFToolpathLayerReader_GetSegmentPartPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpart"); #else // _WIN32 - pWrapperTable->m_Model_GetBuildUUID = (PLib3MFModel_GetBuildUUIDPtr) dlsym(hLibrary, "lib3mf_model_getbuilduuid"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentPart = (PLib3MFToolpathLayerReader_GetSegmentPartPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpart"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetBuildUUID == nullptr) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentPart == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_SetBuildUUID = (PLib3MFModel_SetBuildUUIDPtr) GetProcAddress(hLibrary, "lib3mf_model_setbuilduuid"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentPartUUID = (PLib3MFToolpathLayerReader_GetSegmentPartUUIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpartuuid"); #else // _WIN32 - pWrapperTable->m_Model_SetBuildUUID = (PLib3MFModel_SetBuildUUIDPtr) dlsym(hLibrary, "lib3mf_model_setbuilduuid"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentPartUUID = (PLib3MFToolpathLayerReader_GetSegmentPartUUIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpartuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_SetBuildUUID == nullptr) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentPartUUID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetBuildItems = (PLib3MFModel_GetBuildItemsPtr) GetProcAddress(hLibrary, "lib3mf_model_getbuilditems"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentLocalPartID = (PLib3MFToolpathLayerReader_GetSegmentLocalPartIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentlocalpartid"); #else // _WIN32 - pWrapperTable->m_Model_GetBuildItems = (PLib3MFModel_GetBuildItemsPtr) dlsym(hLibrary, "lib3mf_model_getbuilditems"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentLocalPartID = (PLib3MFToolpathLayerReader_GetSegmentLocalPartIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentlocalpartid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetBuildItems == nullptr) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentLocalPartID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetOutbox = (PLib3MFModel_GetOutboxPtr) GetProcAddress(hLibrary, "lib3mf_model_getoutbox"); + pWrapperTable->m_ToolpathLayerReader_GetPartUUIDByLocalPartID = (PLib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getpartuuidbylocalpartid"); #else // _WIN32 - pWrapperTable->m_Model_GetOutbox = (PLib3MFModel_GetOutboxPtr) dlsym(hLibrary, "lib3mf_model_getoutbox"); + pWrapperTable->m_ToolpathLayerReader_GetPartUUIDByLocalPartID = (PLib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getpartuuidbylocalpartid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetOutbox == nullptr) + if (pWrapperTable->m_ToolpathLayerReader_GetPartUUIDByLocalPartID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetResources = (PLib3MFModel_GetResourcesPtr) GetProcAddress(hLibrary, "lib3mf_model_getresources"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentPointData = (PLib3MFToolpathLayerReader_GetSegmentPointDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpointdata"); #else // _WIN32 - pWrapperTable->m_Model_GetResources = (PLib3MFModel_GetResourcesPtr) dlsym(hLibrary, "lib3mf_model_getresources"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentPointData = (PLib3MFToolpathLayerReader_GetSegmentPointDataPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpointdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetResources == nullptr) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentPointData == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetObjects = (PLib3MFModel_GetObjectsPtr) GetProcAddress(hLibrary, "lib3mf_model_getobjects"); + pWrapperTable->m_ToolpathLayerReader_FindAttributeInfoByName = (PLib3MFToolpathLayerReader_FindAttributeInfoByNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_findattributeinfobyname"); #else // _WIN32 - pWrapperTable->m_Model_GetObjects = (PLib3MFModel_GetObjectsPtr) dlsym(hLibrary, "lib3mf_model_getobjects"); + pWrapperTable->m_ToolpathLayerReader_FindAttributeInfoByName = (PLib3MFToolpathLayerReader_FindAttributeInfoByNamePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_findattributeinfobyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetObjects == nullptr) + if (pWrapperTable->m_ToolpathLayerReader_FindAttributeInfoByName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetMeshObjects = (PLib3MFModel_GetMeshObjectsPtr) GetProcAddress(hLibrary, "lib3mf_model_getmeshobjects"); + pWrapperTable->m_ToolpathLayerReader_FindAttributeIDByName = (PLib3MFToolpathLayerReader_FindAttributeIDByNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_findattributeidbyname"); #else // _WIN32 - pWrapperTable->m_Model_GetMeshObjects = (PLib3MFModel_GetMeshObjectsPtr) dlsym(hLibrary, "lib3mf_model_getmeshobjects"); + pWrapperTable->m_ToolpathLayerReader_FindAttributeIDByName = (PLib3MFToolpathLayerReader_FindAttributeIDByNamePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_findattributeidbyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetMeshObjects == nullptr) + if (pWrapperTable->m_ToolpathLayerReader_FindAttributeIDByName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetComponentsObjects = (PLib3MFModel_GetComponentsObjectsPtr) GetProcAddress(hLibrary, "lib3mf_model_getcomponentsobjects"); + pWrapperTable->m_ToolpathLayerReader_FindAttributeValueByName = (PLib3MFToolpathLayerReader_FindAttributeValueByNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_findattributevaluebyname"); #else // _WIN32 - pWrapperTable->m_Model_GetComponentsObjects = (PLib3MFModel_GetComponentsObjectsPtr) dlsym(hLibrary, "lib3mf_model_getcomponentsobjects"); + pWrapperTable->m_ToolpathLayerReader_FindAttributeValueByName = (PLib3MFToolpathLayerReader_FindAttributeValueByNamePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_findattributevaluebyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetComponentsObjects == nullptr) + if (pWrapperTable->m_ToolpathLayerReader_FindAttributeValueByName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetTexture2Ds = (PLib3MFModel_GetTexture2DsPtr) GetProcAddress(hLibrary, "lib3mf_model_gettexture2ds"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByID = (PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentintegerattributebyid"); #else // _WIN32 - pWrapperTable->m_Model_GetTexture2Ds = (PLib3MFModel_GetTexture2DsPtr) dlsym(hLibrary, "lib3mf_model_gettexture2ds"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByID = (PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentintegerattributebyid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetTexture2Ds == nullptr) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetBaseMaterialGroups = (PLib3MFModel_GetBaseMaterialGroupsPtr) GetProcAddress(hLibrary, "lib3mf_model_getbasematerialgroups"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByName = (PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentintegerattributebyname"); #else // _WIN32 - pWrapperTable->m_Model_GetBaseMaterialGroups = (PLib3MFModel_GetBaseMaterialGroupsPtr) dlsym(hLibrary, "lib3mf_model_getbasematerialgroups"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByName = (PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByNamePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentintegerattributebyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetBaseMaterialGroups == nullptr) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetColorGroups = (PLib3MFModel_GetColorGroupsPtr) GetProcAddress(hLibrary, "lib3mf_model_getcolorgroups"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByID = (PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid"); #else // _WIN32 - pWrapperTable->m_Model_GetColorGroups = (PLib3MFModel_GetColorGroupsPtr) dlsym(hLibrary, "lib3mf_model_getcolorgroups"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByID = (PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetColorGroups == nullptr) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetTexture2DGroups = (PLib3MFModel_GetTexture2DGroupsPtr) GetProcAddress(hLibrary, "lib3mf_model_gettexture2dgroups"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByName = (PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname"); #else // _WIN32 - pWrapperTable->m_Model_GetTexture2DGroups = (PLib3MFModel_GetTexture2DGroupsPtr) dlsym(hLibrary, "lib3mf_model_gettexture2dgroups"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByName = (PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByNamePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetTexture2DGroups == nullptr) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetCompositeMaterials = (PLib3MFModel_GetCompositeMaterialsPtr) GetProcAddress(hLibrary, "lib3mf_model_getcompositematerials"); + pWrapperTable->m_ToolpathLayerReader_GetCustomDataCount = (PLib3MFToolpathLayerReader_GetCustomDataCountPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getcustomdatacount"); #else // _WIN32 - pWrapperTable->m_Model_GetCompositeMaterials = (PLib3MFModel_GetCompositeMaterialsPtr) dlsym(hLibrary, "lib3mf_model_getcompositematerials"); + pWrapperTable->m_ToolpathLayerReader_GetCustomDataCount = (PLib3MFToolpathLayerReader_GetCustomDataCountPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getcustomdatacount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetCompositeMaterials == nullptr) + if (pWrapperTable->m_ToolpathLayerReader_GetCustomDataCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetMultiPropertyGroups = (PLib3MFModel_GetMultiPropertyGroupsPtr) GetProcAddress(hLibrary, "lib3mf_model_getmultipropertygroups"); + pWrapperTable->m_ToolpathLayerReader_GetCustomData = (PLib3MFToolpathLayerReader_GetCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getcustomdata"); #else // _WIN32 - pWrapperTable->m_Model_GetMultiPropertyGroups = (PLib3MFModel_GetMultiPropertyGroupsPtr) dlsym(hLibrary, "lib3mf_model_getmultipropertygroups"); + pWrapperTable->m_ToolpathLayerReader_GetCustomData = (PLib3MFToolpathLayerReader_GetCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getcustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetMultiPropertyGroups == nullptr) + if (pWrapperTable->m_ToolpathLayerReader_GetCustomData == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetSliceStacks = (PLib3MFModel_GetSliceStacksPtr) GetProcAddress(hLibrary, "lib3mf_model_getslicestacks"); + pWrapperTable->m_ToolpathLayerReader_GetCustomDataName = (PLib3MFToolpathLayerReader_GetCustomDataNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getcustomdataname"); #else // _WIN32 - pWrapperTable->m_Model_GetSliceStacks = (PLib3MFModel_GetSliceStacksPtr) dlsym(hLibrary, "lib3mf_model_getslicestacks"); + pWrapperTable->m_ToolpathLayerReader_GetCustomDataName = (PLib3MFToolpathLayerReader_GetCustomDataNamePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getcustomdataname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetSliceStacks == nullptr) + if (pWrapperTable->m_ToolpathLayerReader_GetCustomDataName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_MergeToModel = (PLib3MFModel_MergeToModelPtr) GetProcAddress(hLibrary, "lib3mf_model_mergetomodel"); + pWrapperTable->m_ToolpathLayerData_GetLayerDataUUID = (PLib3MFToolpathLayerData_GetLayerDataUUIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_getlayerdatauuid"); #else // _WIN32 - pWrapperTable->m_Model_MergeToModel = (PLib3MFModel_MergeToModelPtr) dlsym(hLibrary, "lib3mf_model_mergetomodel"); + pWrapperTable->m_ToolpathLayerData_GetLayerDataUUID = (PLib3MFToolpathLayerData_GetLayerDataUUIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_getlayerdatauuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_MergeToModel == nullptr) + if (pWrapperTable->m_ToolpathLayerData_GetLayerDataUUID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_AddMeshObject = (PLib3MFModel_AddMeshObjectPtr) GetProcAddress(hLibrary, "lib3mf_model_addmeshobject"); + pWrapperTable->m_ToolpathLayerData_RegisterProfile = (PLib3MFToolpathLayerData_RegisterProfilePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_registerprofile"); #else // _WIN32 - pWrapperTable->m_Model_AddMeshObject = (PLib3MFModel_AddMeshObjectPtr) dlsym(hLibrary, "lib3mf_model_addmeshobject"); + pWrapperTable->m_ToolpathLayerData_RegisterProfile = (PLib3MFToolpathLayerData_RegisterProfilePtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_registerprofile"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_AddMeshObject == nullptr) + if (pWrapperTable->m_ToolpathLayerData_RegisterProfile == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_AddComponentsObject = (PLib3MFModel_AddComponentsObjectPtr) GetProcAddress(hLibrary, "lib3mf_model_addcomponentsobject"); + pWrapperTable->m_ToolpathLayerData_RegisterBuildItem = (PLib3MFToolpathLayerData_RegisterBuildItemPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_registerbuilditem"); #else // _WIN32 - pWrapperTable->m_Model_AddComponentsObject = (PLib3MFModel_AddComponentsObjectPtr) dlsym(hLibrary, "lib3mf_model_addcomponentsobject"); + pWrapperTable->m_ToolpathLayerData_RegisterBuildItem = (PLib3MFToolpathLayerData_RegisterBuildItemPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_registerbuilditem"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_AddComponentsObject == nullptr) + if (pWrapperTable->m_ToolpathLayerData_RegisterBuildItem == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_AddSliceStack = (PLib3MFModel_AddSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_model_addslicestack"); + pWrapperTable->m_ToolpathLayerData_SetSegmentAttribute = (PLib3MFToolpathLayerData_SetSegmentAttributePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_setsegmentattribute"); #else // _WIN32 - pWrapperTable->m_Model_AddSliceStack = (PLib3MFModel_AddSliceStackPtr) dlsym(hLibrary, "lib3mf_model_addslicestack"); + pWrapperTable->m_ToolpathLayerData_SetSegmentAttribute = (PLib3MFToolpathLayerData_SetSegmentAttributePtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_setsegmentattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_AddSliceStack == nullptr) + if (pWrapperTable->m_ToolpathLayerData_SetSegmentAttribute == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_AddTexture2DFromAttachment = (PLib3MFModel_AddTexture2DFromAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_model_addtexture2dfromattachment"); + pWrapperTable->m_ToolpathLayerData_ClearSegmentAttributes = (PLib3MFToolpathLayerData_ClearSegmentAttributesPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_clearsegmentattributes"); #else // _WIN32 - pWrapperTable->m_Model_AddTexture2DFromAttachment = (PLib3MFModel_AddTexture2DFromAttachmentPtr) dlsym(hLibrary, "lib3mf_model_addtexture2dfromattachment"); + pWrapperTable->m_ToolpathLayerData_ClearSegmentAttributes = (PLib3MFToolpathLayerData_ClearSegmentAttributesPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_clearsegmentattributes"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_AddTexture2DFromAttachment == nullptr) + if (pWrapperTable->m_ToolpathLayerData_ClearSegmentAttributes == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_AddBaseMaterialGroup = (PLib3MFModel_AddBaseMaterialGroupPtr) GetProcAddress(hLibrary, "lib3mf_model_addbasematerialgroup"); + pWrapperTable->m_ToolpathLayerData_WriteHatchData = (PLib3MFToolpathLayerData_WriteHatchDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_writehatchdata"); #else // _WIN32 - pWrapperTable->m_Model_AddBaseMaterialGroup = (PLib3MFModel_AddBaseMaterialGroupPtr) dlsym(hLibrary, "lib3mf_model_addbasematerialgroup"); + pWrapperTable->m_ToolpathLayerData_WriteHatchData = (PLib3MFToolpathLayerData_WriteHatchDataPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_writehatchdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_AddBaseMaterialGroup == nullptr) + if (pWrapperTable->m_ToolpathLayerData_WriteHatchData == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_AddColorGroup = (PLib3MFModel_AddColorGroupPtr) GetProcAddress(hLibrary, "lib3mf_model_addcolorgroup"); + pWrapperTable->m_ToolpathLayerData_WriteLoop = (PLib3MFToolpathLayerData_WriteLoopPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_writeloop"); #else // _WIN32 - pWrapperTable->m_Model_AddColorGroup = (PLib3MFModel_AddColorGroupPtr) dlsym(hLibrary, "lib3mf_model_addcolorgroup"); + pWrapperTable->m_ToolpathLayerData_WriteLoop = (PLib3MFToolpathLayerData_WriteLoopPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_writeloop"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_AddColorGroup == nullptr) + if (pWrapperTable->m_ToolpathLayerData_WriteLoop == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_AddTexture2DGroup = (PLib3MFModel_AddTexture2DGroupPtr) GetProcAddress(hLibrary, "lib3mf_model_addtexture2dgroup"); + pWrapperTable->m_ToolpathLayerData_WritePolyline = (PLib3MFToolpathLayerData_WritePolylinePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_writepolyline"); #else // _WIN32 - pWrapperTable->m_Model_AddTexture2DGroup = (PLib3MFModel_AddTexture2DGroupPtr) dlsym(hLibrary, "lib3mf_model_addtexture2dgroup"); + pWrapperTable->m_ToolpathLayerData_WritePolyline = (PLib3MFToolpathLayerData_WritePolylinePtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_writepolyline"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_AddTexture2DGroup == nullptr) + if (pWrapperTable->m_ToolpathLayerData_WritePolyline == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_AddCompositeMaterials = (PLib3MFModel_AddCompositeMaterialsPtr) GetProcAddress(hLibrary, "lib3mf_model_addcompositematerials"); + pWrapperTable->m_ToolpathLayerData_AddCustomData = (PLib3MFToolpathLayerData_AddCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_addcustomdata"); #else // _WIN32 - pWrapperTable->m_Model_AddCompositeMaterials = (PLib3MFModel_AddCompositeMaterialsPtr) dlsym(hLibrary, "lib3mf_model_addcompositematerials"); + pWrapperTable->m_ToolpathLayerData_AddCustomData = (PLib3MFToolpathLayerData_AddCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_addcustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_AddCompositeMaterials == nullptr) + if (pWrapperTable->m_ToolpathLayerData_AddCustomData == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_AddMultiPropertyGroup = (PLib3MFModel_AddMultiPropertyGroupPtr) GetProcAddress(hLibrary, "lib3mf_model_addmultipropertygroup"); + pWrapperTable->m_ToolpathLayerData_Finish = (PLib3MFToolpathLayerData_FinishPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_finish"); #else // _WIN32 - pWrapperTable->m_Model_AddMultiPropertyGroup = (PLib3MFModel_AddMultiPropertyGroupPtr) dlsym(hLibrary, "lib3mf_model_addmultipropertygroup"); + pWrapperTable->m_ToolpathLayerData_Finish = (PLib3MFToolpathLayerData_FinishPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_finish"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_AddMultiPropertyGroup == nullptr) + if (pWrapperTable->m_ToolpathLayerData_Finish == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_AddBuildItem = (PLib3MFModel_AddBuildItemPtr) GetProcAddress(hLibrary, "lib3mf_model_addbuilditem"); + pWrapperTable->m_Toolpath_GetUnits = (PLib3MFToolpath_GetUnitsPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getunits"); #else // _WIN32 - pWrapperTable->m_Model_AddBuildItem = (PLib3MFModel_AddBuildItemPtr) dlsym(hLibrary, "lib3mf_model_addbuilditem"); + pWrapperTable->m_Toolpath_GetUnits = (PLib3MFToolpath_GetUnitsPtr) dlsym(hLibrary, "lib3mf_toolpath_getunits"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_AddBuildItem == nullptr) + if (pWrapperTable->m_Toolpath_GetUnits == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_RemoveBuildItem = (PLib3MFModel_RemoveBuildItemPtr) GetProcAddress(hLibrary, "lib3mf_model_removebuilditem"); + pWrapperTable->m_Toolpath_GetLayerCount = (PLib3MFToolpath_GetLayerCountPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getlayercount"); #else // _WIN32 - pWrapperTable->m_Model_RemoveBuildItem = (PLib3MFModel_RemoveBuildItemPtr) dlsym(hLibrary, "lib3mf_model_removebuilditem"); + pWrapperTable->m_Toolpath_GetLayerCount = (PLib3MFToolpath_GetLayerCountPtr) dlsym(hLibrary, "lib3mf_toolpath_getlayercount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_RemoveBuildItem == nullptr) + if (pWrapperTable->m_Toolpath_GetLayerCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetMetaDataGroup = (PLib3MFModel_GetMetaDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_model_getmetadatagroup"); + pWrapperTable->m_Toolpath_GetProfileCount = (PLib3MFToolpath_GetProfileCountPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getprofilecount"); #else // _WIN32 - pWrapperTable->m_Model_GetMetaDataGroup = (PLib3MFModel_GetMetaDataGroupPtr) dlsym(hLibrary, "lib3mf_model_getmetadatagroup"); + pWrapperTable->m_Toolpath_GetProfileCount = (PLib3MFToolpath_GetProfileCountPtr) dlsym(hLibrary, "lib3mf_toolpath_getprofilecount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetMetaDataGroup == nullptr) + if (pWrapperTable->m_Toolpath_GetProfileCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_AddAttachment = (PLib3MFModel_AddAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_model_addattachment"); + pWrapperTable->m_Toolpath_AddLayer = (PLib3MFToolpath_AddLayerPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_addlayer"); #else // _WIN32 - pWrapperTable->m_Model_AddAttachment = (PLib3MFModel_AddAttachmentPtr) dlsym(hLibrary, "lib3mf_model_addattachment"); + pWrapperTable->m_Toolpath_AddLayer = (PLib3MFToolpath_AddLayerPtr) dlsym(hLibrary, "lib3mf_toolpath_addlayer"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_AddAttachment == nullptr) + if (pWrapperTable->m_Toolpath_AddLayer == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_RemoveAttachment = (PLib3MFModel_RemoveAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_model_removeattachment"); + pWrapperTable->m_Toolpath_GetLayerAttachment = (PLib3MFToolpath_GetLayerAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getlayerattachment"); #else // _WIN32 - pWrapperTable->m_Model_RemoveAttachment = (PLib3MFModel_RemoveAttachmentPtr) dlsym(hLibrary, "lib3mf_model_removeattachment"); + pWrapperTable->m_Toolpath_GetLayerAttachment = (PLib3MFToolpath_GetLayerAttachmentPtr) dlsym(hLibrary, "lib3mf_toolpath_getlayerattachment"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_RemoveAttachment == nullptr) + if (pWrapperTable->m_Toolpath_GetLayerAttachment == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetAttachment = (PLib3MFModel_GetAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_model_getattachment"); + pWrapperTable->m_Toolpath_ReadLayerData = (PLib3MFToolpath_ReadLayerDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_readlayerdata"); #else // _WIN32 - pWrapperTable->m_Model_GetAttachment = (PLib3MFModel_GetAttachmentPtr) dlsym(hLibrary, "lib3mf_model_getattachment"); + pWrapperTable->m_Toolpath_ReadLayerData = (PLib3MFToolpath_ReadLayerDataPtr) dlsym(hLibrary, "lib3mf_toolpath_readlayerdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetAttachment == nullptr) + if (pWrapperTable->m_Toolpath_ReadLayerData == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_FindAttachment = (PLib3MFModel_FindAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_model_findattachment"); + pWrapperTable->m_Toolpath_GetLayerPath = (PLib3MFToolpath_GetLayerPathPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getlayerpath"); #else // _WIN32 - pWrapperTable->m_Model_FindAttachment = (PLib3MFModel_FindAttachmentPtr) dlsym(hLibrary, "lib3mf_model_findattachment"); + pWrapperTable->m_Toolpath_GetLayerPath = (PLib3MFToolpath_GetLayerPathPtr) dlsym(hLibrary, "lib3mf_toolpath_getlayerpath"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_FindAttachment == nullptr) + if (pWrapperTable->m_Toolpath_GetLayerPath == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetAttachmentCount = (PLib3MFModel_GetAttachmentCountPtr) GetProcAddress(hLibrary, "lib3mf_model_getattachmentcount"); + pWrapperTable->m_Toolpath_GetLayerZMax = (PLib3MFToolpath_GetLayerZMaxPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getlayerzmax"); #else // _WIN32 - pWrapperTable->m_Model_GetAttachmentCount = (PLib3MFModel_GetAttachmentCountPtr) dlsym(hLibrary, "lib3mf_model_getattachmentcount"); + pWrapperTable->m_Toolpath_GetLayerZMax = (PLib3MFToolpath_GetLayerZMaxPtr) dlsym(hLibrary, "lib3mf_toolpath_getlayerzmax"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetAttachmentCount == nullptr) + if (pWrapperTable->m_Toolpath_GetLayerZMax == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_HasPackageThumbnailAttachment = (PLib3MFModel_HasPackageThumbnailAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_model_haspackagethumbnailattachment"); + pWrapperTable->m_Toolpath_GetLayerZ = (PLib3MFToolpath_GetLayerZPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getlayerz"); #else // _WIN32 - pWrapperTable->m_Model_HasPackageThumbnailAttachment = (PLib3MFModel_HasPackageThumbnailAttachmentPtr) dlsym(hLibrary, "lib3mf_model_haspackagethumbnailattachment"); + pWrapperTable->m_Toolpath_GetLayerZ = (PLib3MFToolpath_GetLayerZPtr) dlsym(hLibrary, "lib3mf_toolpath_getlayerz"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_HasPackageThumbnailAttachment == nullptr) + if (pWrapperTable->m_Toolpath_GetLayerZ == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_CreatePackageThumbnailAttachment = (PLib3MFModel_CreatePackageThumbnailAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_model_createpackagethumbnailattachment"); + pWrapperTable->m_Toolpath_AddProfile = (PLib3MFToolpath_AddProfilePtr) GetProcAddress(hLibrary, "lib3mf_toolpath_addprofile"); #else // _WIN32 - pWrapperTable->m_Model_CreatePackageThumbnailAttachment = (PLib3MFModel_CreatePackageThumbnailAttachmentPtr) dlsym(hLibrary, "lib3mf_model_createpackagethumbnailattachment"); + pWrapperTable->m_Toolpath_AddProfile = (PLib3MFToolpath_AddProfilePtr) dlsym(hLibrary, "lib3mf_toolpath_addprofile"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_CreatePackageThumbnailAttachment == nullptr) + if (pWrapperTable->m_Toolpath_AddProfile == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetPackageThumbnailAttachment = (PLib3MFModel_GetPackageThumbnailAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_model_getpackagethumbnailattachment"); + pWrapperTable->m_Toolpath_GetProfile = (PLib3MFToolpath_GetProfilePtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getprofile"); #else // _WIN32 - pWrapperTable->m_Model_GetPackageThumbnailAttachment = (PLib3MFModel_GetPackageThumbnailAttachmentPtr) dlsym(hLibrary, "lib3mf_model_getpackagethumbnailattachment"); + pWrapperTable->m_Toolpath_GetProfile = (PLib3MFToolpath_GetProfilePtr) dlsym(hLibrary, "lib3mf_toolpath_getprofile"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetPackageThumbnailAttachment == nullptr) + if (pWrapperTable->m_Toolpath_GetProfile == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_RemovePackageThumbnailAttachment = (PLib3MFModel_RemovePackageThumbnailAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_model_removepackagethumbnailattachment"); + pWrapperTable->m_Toolpath_GetProfileUUID = (PLib3MFToolpath_GetProfileUUIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getprofileuuid"); #else // _WIN32 - pWrapperTable->m_Model_RemovePackageThumbnailAttachment = (PLib3MFModel_RemovePackageThumbnailAttachmentPtr) dlsym(hLibrary, "lib3mf_model_removepackagethumbnailattachment"); + pWrapperTable->m_Toolpath_GetProfileUUID = (PLib3MFToolpath_GetProfileUUIDPtr) dlsym(hLibrary, "lib3mf_toolpath_getprofileuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_RemovePackageThumbnailAttachment == nullptr) + if (pWrapperTable->m_Toolpath_GetProfileUUID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_AddCustomContentType = (PLib3MFModel_AddCustomContentTypePtr) GetProcAddress(hLibrary, "lib3mf_model_addcustomcontenttype"); + pWrapperTable->m_Toolpath_GetCustomDataCount = (PLib3MFToolpath_GetCustomDataCountPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getcustomdatacount"); #else // _WIN32 - pWrapperTable->m_Model_AddCustomContentType = (PLib3MFModel_AddCustomContentTypePtr) dlsym(hLibrary, "lib3mf_model_addcustomcontenttype"); + pWrapperTable->m_Toolpath_GetCustomDataCount = (PLib3MFToolpath_GetCustomDataCountPtr) dlsym(hLibrary, "lib3mf_toolpath_getcustomdatacount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_AddCustomContentType == nullptr) + if (pWrapperTable->m_Toolpath_GetCustomDataCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_RemoveCustomContentType = (PLib3MFModel_RemoveCustomContentTypePtr) GetProcAddress(hLibrary, "lib3mf_model_removecustomcontenttype"); + pWrapperTable->m_Toolpath_GetCustomData = (PLib3MFToolpath_GetCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getcustomdata"); #else // _WIN32 - pWrapperTable->m_Model_RemoveCustomContentType = (PLib3MFModel_RemoveCustomContentTypePtr) dlsym(hLibrary, "lib3mf_model_removecustomcontenttype"); + pWrapperTable->m_Toolpath_GetCustomData = (PLib3MFToolpath_GetCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpath_getcustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_RemoveCustomContentType == nullptr) + if (pWrapperTable->m_Toolpath_GetCustomData == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_SetRandomNumberCallback = (PLib3MFModel_SetRandomNumberCallbackPtr) GetProcAddress(hLibrary, "lib3mf_model_setrandomnumbercallback"); + pWrapperTable->m_Toolpath_GetCustomDataName = (PLib3MFToolpath_GetCustomDataNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getcustomdataname"); #else // _WIN32 - pWrapperTable->m_Model_SetRandomNumberCallback = (PLib3MFModel_SetRandomNumberCallbackPtr) dlsym(hLibrary, "lib3mf_model_setrandomnumbercallback"); + pWrapperTable->m_Toolpath_GetCustomDataName = (PLib3MFToolpath_GetCustomDataNamePtr) dlsym(hLibrary, "lib3mf_toolpath_getcustomdataname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_SetRandomNumberCallback == nullptr) + if (pWrapperTable->m_Toolpath_GetCustomDataName == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Model_GetKeyStore = (PLib3MFModel_GetKeyStorePtr) GetProcAddress(hLibrary, "lib3mf_model_getkeystore"); + pWrapperTable->m_Toolpath_HasUniqueCustomData = (PLib3MFToolpath_HasUniqueCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_hasuniquecustomdata"); #else // _WIN32 - pWrapperTable->m_Model_GetKeyStore = (PLib3MFModel_GetKeyStorePtr) dlsym(hLibrary, "lib3mf_model_getkeystore"); + pWrapperTable->m_Toolpath_HasUniqueCustomData = (PLib3MFToolpath_HasUniqueCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpath_hasuniquecustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Model_GetKeyStore == nullptr) + if (pWrapperTable->m_Toolpath_HasUniqueCustomData == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_GetLibraryVersion = (PLib3MFGetLibraryVersionPtr) GetProcAddress(hLibrary, "lib3mf_getlibraryversion"); + pWrapperTable->m_Toolpath_FindUniqueCustomData = (PLib3MFToolpath_FindUniqueCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_finduniquecustomdata"); #else // _WIN32 - pWrapperTable->m_GetLibraryVersion = (PLib3MFGetLibraryVersionPtr) dlsym(hLibrary, "lib3mf_getlibraryversion"); + pWrapperTable->m_Toolpath_FindUniqueCustomData = (PLib3MFToolpath_FindUniqueCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpath_finduniquecustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_GetLibraryVersion == nullptr) + if (pWrapperTable->m_Toolpath_FindUniqueCustomData == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_GetPrereleaseInformation = (PLib3MFGetPrereleaseInformationPtr) GetProcAddress(hLibrary, "lib3mf_getprereleaseinformation"); + pWrapperTable->m_Toolpath_AddCustomData = (PLib3MFToolpath_AddCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_addcustomdata"); #else // _WIN32 - pWrapperTable->m_GetPrereleaseInformation = (PLib3MFGetPrereleaseInformationPtr) dlsym(hLibrary, "lib3mf_getprereleaseinformation"); + pWrapperTable->m_Toolpath_AddCustomData = (PLib3MFToolpath_AddCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpath_addcustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_GetPrereleaseInformation == nullptr) + if (pWrapperTable->m_Toolpath_AddCustomData == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_GetBuildInformation = (PLib3MFGetBuildInformationPtr) GetProcAddress(hLibrary, "lib3mf_getbuildinformation"); + pWrapperTable->m_Toolpath_ClearCustomData = (PLib3MFToolpath_ClearCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_clearcustomdata"); #else // _WIN32 - pWrapperTable->m_GetBuildInformation = (PLib3MFGetBuildInformationPtr) dlsym(hLibrary, "lib3mf_getbuildinformation"); + pWrapperTable->m_Toolpath_ClearCustomData = (PLib3MFToolpath_ClearCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpath_clearcustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_GetBuildInformation == nullptr) + if (pWrapperTable->m_Toolpath_ClearCustomData == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_GetSpecificationVersion = (PLib3MFGetSpecificationVersionPtr) GetProcAddress(hLibrary, "lib3mf_getspecificationversion"); + pWrapperTable->m_Toolpath_DeleteCustomData = (PLib3MFToolpath_DeleteCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_deletecustomdata"); #else // _WIN32 - pWrapperTable->m_GetSpecificationVersion = (PLib3MFGetSpecificationVersionPtr) dlsym(hLibrary, "lib3mf_getspecificationversion"); + pWrapperTable->m_Toolpath_DeleteCustomData = (PLib3MFToolpath_DeleteCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpath_deletecustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_GetSpecificationVersion == nullptr) + if (pWrapperTable->m_Toolpath_DeleteCustomData == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CreateModel = (PLib3MFCreateModelPtr) GetProcAddress(hLibrary, "lib3mf_createmodel"); + pWrapperTable->m_Toolpath_RegisterCustomIntegerAttribute = (PLib3MFToolpath_RegisterCustomIntegerAttributePtr) GetProcAddress(hLibrary, "lib3mf_toolpath_registercustomintegerattribute"); #else // _WIN32 - pWrapperTable->m_CreateModel = (PLib3MFCreateModelPtr) dlsym(hLibrary, "lib3mf_createmodel"); + pWrapperTable->m_Toolpath_RegisterCustomIntegerAttribute = (PLib3MFToolpath_RegisterCustomIntegerAttributePtr) dlsym(hLibrary, "lib3mf_toolpath_registercustomintegerattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CreateModel == nullptr) + if (pWrapperTable->m_Toolpath_RegisterCustomIntegerAttribute == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Release = (PLib3MFReleasePtr) GetProcAddress(hLibrary, "lib3mf_release"); + pWrapperTable->m_Toolpath_RegisterCustomDoubleAttribute = (PLib3MFToolpath_RegisterCustomDoubleAttributePtr) GetProcAddress(hLibrary, "lib3mf_toolpath_registercustomdoubleattribute"); #else // _WIN32 - pWrapperTable->m_Release = (PLib3MFReleasePtr) dlsym(hLibrary, "lib3mf_release"); + pWrapperTable->m_Toolpath_RegisterCustomDoubleAttribute = (PLib3MFToolpath_RegisterCustomDoubleAttributePtr) dlsym(hLibrary, "lib3mf_toolpath_registercustomdoubleattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Release == nullptr) + if (pWrapperTable->m_Toolpath_RegisterCustomDoubleAttribute == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Acquire = (PLib3MFAcquirePtr) GetProcAddress(hLibrary, "lib3mf_acquire"); + pWrapperTable->m_ToolpathIterator_GetCurrentToolpath = (PLib3MFToolpathIterator_GetCurrentToolpathPtr) GetProcAddress(hLibrary, "lib3mf_toolpathiterator_getcurrenttoolpath"); #else // _WIN32 - pWrapperTable->m_Acquire = (PLib3MFAcquirePtr) dlsym(hLibrary, "lib3mf_acquire"); + pWrapperTable->m_ToolpathIterator_GetCurrentToolpath = (PLib3MFToolpathIterator_GetCurrentToolpathPtr) dlsym(hLibrary, "lib3mf_toolpathiterator_getcurrenttoolpath"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Acquire == nullptr) + if (pWrapperTable->m_ToolpathIterator_GetCurrentToolpath == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_SetJournal = (PLib3MFSetJournalPtr) GetProcAddress(hLibrary, "lib3mf_setjournal"); + pWrapperTable->m_SliceStack_GetBottomZ = (PLib3MFSliceStack_GetBottomZPtr) GetProcAddress(hLibrary, "lib3mf_slicestack_getbottomz"); #else // _WIN32 - pWrapperTable->m_SetJournal = (PLib3MFSetJournalPtr) dlsym(hLibrary, "lib3mf_setjournal"); + pWrapperTable->m_SliceStack_GetBottomZ = (PLib3MFSliceStack_GetBottomZPtr) dlsym(hLibrary, "lib3mf_slicestack_getbottomz"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_SetJournal == nullptr) + if (pWrapperTable->m_SliceStack_GetBottomZ == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_GetLastError = (PLib3MFGetLastErrorPtr) GetProcAddress(hLibrary, "lib3mf_getlasterror"); + pWrapperTable->m_SliceStack_GetSliceCount = (PLib3MFSliceStack_GetSliceCountPtr) GetProcAddress(hLibrary, "lib3mf_slicestack_getslicecount"); #else // _WIN32 - pWrapperTable->m_GetLastError = (PLib3MFGetLastErrorPtr) dlsym(hLibrary, "lib3mf_getlasterror"); + pWrapperTable->m_SliceStack_GetSliceCount = (PLib3MFSliceStack_GetSliceCountPtr) dlsym(hLibrary, "lib3mf_slicestack_getslicecount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_GetLastError == nullptr) + if (pWrapperTable->m_SliceStack_GetSliceCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_GetSymbolLookupMethod = (PLib3MFGetSymbolLookupMethodPtr) GetProcAddress(hLibrary, "lib3mf_getsymbollookupmethod"); + pWrapperTable->m_SliceStack_GetSlice = (PLib3MFSliceStack_GetSlicePtr) GetProcAddress(hLibrary, "lib3mf_slicestack_getslice"); #else // _WIN32 - pWrapperTable->m_GetSymbolLookupMethod = (PLib3MFGetSymbolLookupMethodPtr) dlsym(hLibrary, "lib3mf_getsymbollookupmethod"); + pWrapperTable->m_SliceStack_GetSlice = (PLib3MFSliceStack_GetSlicePtr) dlsym(hLibrary, "lib3mf_slicestack_getslice"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_GetSymbolLookupMethod == nullptr) + if (pWrapperTable->m_SliceStack_GetSlice == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_RetrieveProgressMessage = (PLib3MFRetrieveProgressMessagePtr) GetProcAddress(hLibrary, "lib3mf_retrieveprogressmessage"); + pWrapperTable->m_SliceStack_AddSlice = (PLib3MFSliceStack_AddSlicePtr) GetProcAddress(hLibrary, "lib3mf_slicestack_addslice"); #else // _WIN32 - pWrapperTable->m_RetrieveProgressMessage = (PLib3MFRetrieveProgressMessagePtr) dlsym(hLibrary, "lib3mf_retrieveprogressmessage"); + pWrapperTable->m_SliceStack_AddSlice = (PLib3MFSliceStack_AddSlicePtr) dlsym(hLibrary, "lib3mf_slicestack_addslice"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_RetrieveProgressMessage == nullptr) + if (pWrapperTable->m_SliceStack_AddSlice == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_RGBAToColor = (PLib3MFRGBAToColorPtr) GetProcAddress(hLibrary, "lib3mf_rgbatocolor"); + pWrapperTable->m_SliceStack_GetSliceRefCount = (PLib3MFSliceStack_GetSliceRefCountPtr) GetProcAddress(hLibrary, "lib3mf_slicestack_getslicerefcount"); #else // _WIN32 - pWrapperTable->m_RGBAToColor = (PLib3MFRGBAToColorPtr) dlsym(hLibrary, "lib3mf_rgbatocolor"); + pWrapperTable->m_SliceStack_GetSliceRefCount = (PLib3MFSliceStack_GetSliceRefCountPtr) dlsym(hLibrary, "lib3mf_slicestack_getslicerefcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_RGBAToColor == nullptr) + if (pWrapperTable->m_SliceStack_GetSliceRefCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_FloatRGBAToColor = (PLib3MFFloatRGBAToColorPtr) GetProcAddress(hLibrary, "lib3mf_floatrgbatocolor"); + pWrapperTable->m_SliceStack_AddSliceStackReference = (PLib3MFSliceStack_AddSliceStackReferencePtr) GetProcAddress(hLibrary, "lib3mf_slicestack_addslicestackreference"); #else // _WIN32 - pWrapperTable->m_FloatRGBAToColor = (PLib3MFFloatRGBAToColorPtr) dlsym(hLibrary, "lib3mf_floatrgbatocolor"); + pWrapperTable->m_SliceStack_AddSliceStackReference = (PLib3MFSliceStack_AddSliceStackReferencePtr) dlsym(hLibrary, "lib3mf_slicestack_addslicestackreference"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_FloatRGBAToColor == nullptr) + if (pWrapperTable->m_SliceStack_AddSliceStackReference == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorToRGBA = (PLib3MFColorToRGBAPtr) GetProcAddress(hLibrary, "lib3mf_colortorgba"); + pWrapperTable->m_SliceStack_GetSliceStackReference = (PLib3MFSliceStack_GetSliceStackReferencePtr) GetProcAddress(hLibrary, "lib3mf_slicestack_getslicestackreference"); #else // _WIN32 - pWrapperTable->m_ColorToRGBA = (PLib3MFColorToRGBAPtr) dlsym(hLibrary, "lib3mf_colortorgba"); + pWrapperTable->m_SliceStack_GetSliceStackReference = (PLib3MFSliceStack_GetSliceStackReferencePtr) dlsym(hLibrary, "lib3mf_slicestack_getslicestackreference"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorToRGBA == nullptr) + if (pWrapperTable->m_SliceStack_GetSliceStackReference == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorToFloatRGBA = (PLib3MFColorToFloatRGBAPtr) GetProcAddress(hLibrary, "lib3mf_colortofloatrgba"); + pWrapperTable->m_SliceStack_CollapseSliceReferences = (PLib3MFSliceStack_CollapseSliceReferencesPtr) GetProcAddress(hLibrary, "lib3mf_slicestack_collapseslicereferences"); #else // _WIN32 - pWrapperTable->m_ColorToFloatRGBA = (PLib3MFColorToFloatRGBAPtr) dlsym(hLibrary, "lib3mf_colortofloatrgba"); + pWrapperTable->m_SliceStack_CollapseSliceReferences = (PLib3MFSliceStack_CollapseSliceReferencesPtr) dlsym(hLibrary, "lib3mf_slicestack_collapseslicereferences"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorToFloatRGBA == nullptr) + if (pWrapperTable->m_SliceStack_CollapseSliceReferences == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_GetIdentityTransform = (PLib3MFGetIdentityTransformPtr) GetProcAddress(hLibrary, "lib3mf_getidentitytransform"); + pWrapperTable->m_SliceStack_SetOwnPath = (PLib3MFSliceStack_SetOwnPathPtr) GetProcAddress(hLibrary, "lib3mf_slicestack_setownpath"); #else // _WIN32 - pWrapperTable->m_GetIdentityTransform = (PLib3MFGetIdentityTransformPtr) dlsym(hLibrary, "lib3mf_getidentitytransform"); + pWrapperTable->m_SliceStack_SetOwnPath = (PLib3MFSliceStack_SetOwnPathPtr) dlsym(hLibrary, "lib3mf_slicestack_setownpath"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_GetIdentityTransform == nullptr) + if (pWrapperTable->m_SliceStack_SetOwnPath == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_GetUniformScaleTransform = (PLib3MFGetUniformScaleTransformPtr) GetProcAddress(hLibrary, "lib3mf_getuniformscaletransform"); + pWrapperTable->m_SliceStack_GetOwnPath = (PLib3MFSliceStack_GetOwnPathPtr) GetProcAddress(hLibrary, "lib3mf_slicestack_getownpath"); #else // _WIN32 - pWrapperTable->m_GetUniformScaleTransform = (PLib3MFGetUniformScaleTransformPtr) dlsym(hLibrary, "lib3mf_getuniformscaletransform"); + pWrapperTable->m_SliceStack_GetOwnPath = (PLib3MFSliceStack_GetOwnPathPtr) dlsym(hLibrary, "lib3mf_slicestack_getownpath"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_GetUniformScaleTransform == nullptr) + if (pWrapperTable->m_SliceStack_GetOwnPath == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_GetScaleTransform = (PLib3MFGetScaleTransformPtr) GetProcAddress(hLibrary, "lib3mf_getscaletransform"); + pWrapperTable->m_Consumer_GetConsumerID = (PLib3MFConsumer_GetConsumerIDPtr) GetProcAddress(hLibrary, "lib3mf_consumer_getconsumerid"); #else // _WIN32 - pWrapperTable->m_GetScaleTransform = (PLib3MFGetScaleTransformPtr) dlsym(hLibrary, "lib3mf_getscaletransform"); + pWrapperTable->m_Consumer_GetConsumerID = (PLib3MFConsumer_GetConsumerIDPtr) dlsym(hLibrary, "lib3mf_consumer_getconsumerid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_GetScaleTransform == nullptr) + if (pWrapperTable->m_Consumer_GetConsumerID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_GetTranslationTransform = (PLib3MFGetTranslationTransformPtr) GetProcAddress(hLibrary, "lib3mf_gettranslationtransform"); + pWrapperTable->m_Consumer_GetKeyID = (PLib3MFConsumer_GetKeyIDPtr) GetProcAddress(hLibrary, "lib3mf_consumer_getkeyid"); #else // _WIN32 - pWrapperTable->m_GetTranslationTransform = (PLib3MFGetTranslationTransformPtr) dlsym(hLibrary, "lib3mf_gettranslationtransform"); + pWrapperTable->m_Consumer_GetKeyID = (PLib3MFConsumer_GetKeyIDPtr) dlsym(hLibrary, "lib3mf_consumer_getkeyid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_GetTranslationTransform == nullptr) + if (pWrapperTable->m_Consumer_GetKeyID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - pWrapperTable->m_LibraryHandle = hLibrary; - return LIB3MF_SUCCESS; - } - - inline Lib3MFResult CWrapper::loadWrapperTableFromSymbolLookupMethod(sLib3MFDynamicWrapperTable * pWrapperTable, void* pSymbolLookupMethod) -{ - if (pWrapperTable == nullptr) - return LIB3MF_ERROR_INVALIDPARAM; - if (pSymbolLookupMethod == nullptr) - return LIB3MF_ERROR_INVALIDPARAM; - - typedef Lib3MFResult(*SymbolLookupType)(const char*, void**); - - SymbolLookupType pLookup = (SymbolLookupType)pSymbolLookupMethod; + #ifdef _WIN32 + pWrapperTable->m_Consumer_GetKeyValue = (PLib3MFConsumer_GetKeyValuePtr) GetProcAddress(hLibrary, "lib3mf_consumer_getkeyvalue"); + #else // _WIN32 + pWrapperTable->m_Consumer_GetKeyValue = (PLib3MFConsumer_GetKeyValuePtr) dlsym(hLibrary, "lib3mf_consumer_getkeyvalue"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Consumer_GetKeyValue == nullptr) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - Lib3MFResult eLookupError = LIB3MF_SUCCESS; - eLookupError = (*pLookup)("lib3mf_base_classtypeid", (void**)&(pWrapperTable->m_Base_ClassTypeId)); - if ( (eLookupError != 0) || (pWrapperTable->m_Base_ClassTypeId == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_AccessRight_GetConsumer = (PLib3MFAccessRight_GetConsumerPtr) GetProcAddress(hLibrary, "lib3mf_accessright_getconsumer"); + #else // _WIN32 + pWrapperTable->m_AccessRight_GetConsumer = (PLib3MFAccessRight_GetConsumerPtr) dlsym(hLibrary, "lib3mf_accessright_getconsumer"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_AccessRight_GetConsumer == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_writer_writetofile", (void**)&(pWrapperTable->m_Writer_WriteToFile)); - if ( (eLookupError != 0) || (pWrapperTable->m_Writer_WriteToFile == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_AccessRight_GetWrappingAlgorithm = (PLib3MFAccessRight_GetWrappingAlgorithmPtr) GetProcAddress(hLibrary, "lib3mf_accessright_getwrappingalgorithm"); + #else // _WIN32 + pWrapperTable->m_AccessRight_GetWrappingAlgorithm = (PLib3MFAccessRight_GetWrappingAlgorithmPtr) dlsym(hLibrary, "lib3mf_accessright_getwrappingalgorithm"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_AccessRight_GetWrappingAlgorithm == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_writer_getstreamsize", (void**)&(pWrapperTable->m_Writer_GetStreamSize)); - if ( (eLookupError != 0) || (pWrapperTable->m_Writer_GetStreamSize == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_AccessRight_GetMgfAlgorithm = (PLib3MFAccessRight_GetMgfAlgorithmPtr) GetProcAddress(hLibrary, "lib3mf_accessright_getmgfalgorithm"); + #else // _WIN32 + pWrapperTable->m_AccessRight_GetMgfAlgorithm = (PLib3MFAccessRight_GetMgfAlgorithmPtr) dlsym(hLibrary, "lib3mf_accessright_getmgfalgorithm"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_AccessRight_GetMgfAlgorithm == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_writer_writetobuffer", (void**)&(pWrapperTable->m_Writer_WriteToBuffer)); - if ( (eLookupError != 0) || (pWrapperTable->m_Writer_WriteToBuffer == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_AccessRight_GetDigestMethod = (PLib3MFAccessRight_GetDigestMethodPtr) GetProcAddress(hLibrary, "lib3mf_accessright_getdigestmethod"); + #else // _WIN32 + pWrapperTable->m_AccessRight_GetDigestMethod = (PLib3MFAccessRight_GetDigestMethodPtr) dlsym(hLibrary, "lib3mf_accessright_getdigestmethod"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_AccessRight_GetDigestMethod == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_writer_writetocallback", (void**)&(pWrapperTable->m_Writer_WriteToCallback)); - if ( (eLookupError != 0) || (pWrapperTable->m_Writer_WriteToCallback == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_ContentEncryptionParams_GetEncryptionAlgorithm = (PLib3MFContentEncryptionParams_GetEncryptionAlgorithmPtr) GetProcAddress(hLibrary, "lib3mf_contentencryptionparams_getencryptionalgorithm"); + #else // _WIN32 + pWrapperTable->m_ContentEncryptionParams_GetEncryptionAlgorithm = (PLib3MFContentEncryptionParams_GetEncryptionAlgorithmPtr) dlsym(hLibrary, "lib3mf_contentencryptionparams_getencryptionalgorithm"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ContentEncryptionParams_GetEncryptionAlgorithm == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_writer_setprogresscallback", (void**)&(pWrapperTable->m_Writer_SetProgressCallback)); - if ( (eLookupError != 0) || (pWrapperTable->m_Writer_SetProgressCallback == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_ContentEncryptionParams_GetKey = (PLib3MFContentEncryptionParams_GetKeyPtr) GetProcAddress(hLibrary, "lib3mf_contentencryptionparams_getkey"); + #else // _WIN32 + pWrapperTable->m_ContentEncryptionParams_GetKey = (PLib3MFContentEncryptionParams_GetKeyPtr) dlsym(hLibrary, "lib3mf_contentencryptionparams_getkey"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ContentEncryptionParams_GetKey == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_writer_getdecimalprecision", (void**)&(pWrapperTable->m_Writer_GetDecimalPrecision)); - if ( (eLookupError != 0) || (pWrapperTable->m_Writer_GetDecimalPrecision == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_ContentEncryptionParams_GetInitializationVector = (PLib3MFContentEncryptionParams_GetInitializationVectorPtr) GetProcAddress(hLibrary, "lib3mf_contentencryptionparams_getinitializationvector"); + #else // _WIN32 + pWrapperTable->m_ContentEncryptionParams_GetInitializationVector = (PLib3MFContentEncryptionParams_GetInitializationVectorPtr) dlsym(hLibrary, "lib3mf_contentencryptionparams_getinitializationvector"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ContentEncryptionParams_GetInitializationVector == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_writer_setdecimalprecision", (void**)&(pWrapperTable->m_Writer_SetDecimalPrecision)); - if ( (eLookupError != 0) || (pWrapperTable->m_Writer_SetDecimalPrecision == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_ContentEncryptionParams_GetAuthenticationTag = (PLib3MFContentEncryptionParams_GetAuthenticationTagPtr) GetProcAddress(hLibrary, "lib3mf_contentencryptionparams_getauthenticationtag"); + #else // _WIN32 + pWrapperTable->m_ContentEncryptionParams_GetAuthenticationTag = (PLib3MFContentEncryptionParams_GetAuthenticationTagPtr) dlsym(hLibrary, "lib3mf_contentencryptionparams_getauthenticationtag"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ContentEncryptionParams_GetAuthenticationTag == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_writer_setstrictmodeactive", (void**)&(pWrapperTable->m_Writer_SetStrictModeActive)); - if ( (eLookupError != 0) || (pWrapperTable->m_Writer_SetStrictModeActive == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_ContentEncryptionParams_SetAuthenticationTag = (PLib3MFContentEncryptionParams_SetAuthenticationTagPtr) GetProcAddress(hLibrary, "lib3mf_contentencryptionparams_setauthenticationtag"); + #else // _WIN32 + pWrapperTable->m_ContentEncryptionParams_SetAuthenticationTag = (PLib3MFContentEncryptionParams_SetAuthenticationTagPtr) dlsym(hLibrary, "lib3mf_contentencryptionparams_setauthenticationtag"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ContentEncryptionParams_SetAuthenticationTag == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_writer_getstrictmodeactive", (void**)&(pWrapperTable->m_Writer_GetStrictModeActive)); - if ( (eLookupError != 0) || (pWrapperTable->m_Writer_GetStrictModeActive == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_ContentEncryptionParams_GetAdditionalAuthenticationData = (PLib3MFContentEncryptionParams_GetAdditionalAuthenticationDataPtr) GetProcAddress(hLibrary, "lib3mf_contentencryptionparams_getadditionalauthenticationdata"); + #else // _WIN32 + pWrapperTable->m_ContentEncryptionParams_GetAdditionalAuthenticationData = (PLib3MFContentEncryptionParams_GetAdditionalAuthenticationDataPtr) dlsym(hLibrary, "lib3mf_contentencryptionparams_getadditionalauthenticationdata"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ContentEncryptionParams_GetAdditionalAuthenticationData == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_writer_getwarning", (void**)&(pWrapperTable->m_Writer_GetWarning)); - if ( (eLookupError != 0) || (pWrapperTable->m_Writer_GetWarning == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_ContentEncryptionParams_GetDescriptor = (PLib3MFContentEncryptionParams_GetDescriptorPtr) GetProcAddress(hLibrary, "lib3mf_contentencryptionparams_getdescriptor"); + #else // _WIN32 + pWrapperTable->m_ContentEncryptionParams_GetDescriptor = (PLib3MFContentEncryptionParams_GetDescriptorPtr) dlsym(hLibrary, "lib3mf_contentencryptionparams_getdescriptor"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ContentEncryptionParams_GetDescriptor == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_writer_getwarningcount", (void**)&(pWrapperTable->m_Writer_GetWarningCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_Writer_GetWarningCount == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_ContentEncryptionParams_GetKeyUUID = (PLib3MFContentEncryptionParams_GetKeyUUIDPtr) GetProcAddress(hLibrary, "lib3mf_contentencryptionparams_getkeyuuid"); + #else // _WIN32 + pWrapperTable->m_ContentEncryptionParams_GetKeyUUID = (PLib3MFContentEncryptionParams_GetKeyUUIDPtr) dlsym(hLibrary, "lib3mf_contentencryptionparams_getkeyuuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ContentEncryptionParams_GetKeyUUID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_writer_addkeywrappingcallback", (void**)&(pWrapperTable->m_Writer_AddKeyWrappingCallback)); - if ( (eLookupError != 0) || (pWrapperTable->m_Writer_AddKeyWrappingCallback == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_ResourceData_GetPath = (PLib3MFResourceData_GetPathPtr) GetProcAddress(hLibrary, "lib3mf_resourcedata_getpath"); + #else // _WIN32 + pWrapperTable->m_ResourceData_GetPath = (PLib3MFResourceData_GetPathPtr) dlsym(hLibrary, "lib3mf_resourcedata_getpath"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ResourceData_GetPath == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_writer_setcontentencryptioncallback", (void**)&(pWrapperTable->m_Writer_SetContentEncryptionCallback)); - if ( (eLookupError != 0) || (pWrapperTable->m_Writer_SetContentEncryptionCallback == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_ResourceData_GetEncryptionAlgorithm = (PLib3MFResourceData_GetEncryptionAlgorithmPtr) GetProcAddress(hLibrary, "lib3mf_resourcedata_getencryptionalgorithm"); + #else // _WIN32 + pWrapperTable->m_ResourceData_GetEncryptionAlgorithm = (PLib3MFResourceData_GetEncryptionAlgorithmPtr) dlsym(hLibrary, "lib3mf_resourcedata_getencryptionalgorithm"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ResourceData_GetEncryptionAlgorithm == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_reader_readfromfile", (void**)&(pWrapperTable->m_Reader_ReadFromFile)); - if ( (eLookupError != 0) || (pWrapperTable->m_Reader_ReadFromFile == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_ResourceData_GetCompression = (PLib3MFResourceData_GetCompressionPtr) GetProcAddress(hLibrary, "lib3mf_resourcedata_getcompression"); + #else // _WIN32 + pWrapperTable->m_ResourceData_GetCompression = (PLib3MFResourceData_GetCompressionPtr) dlsym(hLibrary, "lib3mf_resourcedata_getcompression"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ResourceData_GetCompression == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_reader_readfrombuffer", (void**)&(pWrapperTable->m_Reader_ReadFromBuffer)); - if ( (eLookupError != 0) || (pWrapperTable->m_Reader_ReadFromBuffer == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_ResourceData_GetAdditionalAuthenticationData = (PLib3MFResourceData_GetAdditionalAuthenticationDataPtr) GetProcAddress(hLibrary, "lib3mf_resourcedata_getadditionalauthenticationdata"); + #else // _WIN32 + pWrapperTable->m_ResourceData_GetAdditionalAuthenticationData = (PLib3MFResourceData_GetAdditionalAuthenticationDataPtr) dlsym(hLibrary, "lib3mf_resourcedata_getadditionalauthenticationdata"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ResourceData_GetAdditionalAuthenticationData == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_reader_readfromcallback", (void**)&(pWrapperTable->m_Reader_ReadFromCallback)); - if ( (eLookupError != 0) || (pWrapperTable->m_Reader_ReadFromCallback == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_ResourceDataGroup_GetKeyUUID = (PLib3MFResourceDataGroup_GetKeyUUIDPtr) GetProcAddress(hLibrary, "lib3mf_resourcedatagroup_getkeyuuid"); + #else // _WIN32 + pWrapperTable->m_ResourceDataGroup_GetKeyUUID = (PLib3MFResourceDataGroup_GetKeyUUIDPtr) dlsym(hLibrary, "lib3mf_resourcedatagroup_getkeyuuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ResourceDataGroup_GetKeyUUID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_reader_setprogresscallback", (void**)&(pWrapperTable->m_Reader_SetProgressCallback)); - if ( (eLookupError != 0) || (pWrapperTable->m_Reader_SetProgressCallback == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_ResourceDataGroup_AddAccessRight = (PLib3MFResourceDataGroup_AddAccessRightPtr) GetProcAddress(hLibrary, "lib3mf_resourcedatagroup_addaccessright"); + #else // _WIN32 + pWrapperTable->m_ResourceDataGroup_AddAccessRight = (PLib3MFResourceDataGroup_AddAccessRightPtr) dlsym(hLibrary, "lib3mf_resourcedatagroup_addaccessright"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ResourceDataGroup_AddAccessRight == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_reader_addrelationtoread", (void**)&(pWrapperTable->m_Reader_AddRelationToRead)); - if ( (eLookupError != 0) || (pWrapperTable->m_Reader_AddRelationToRead == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_ResourceDataGroup_FindAccessRightByConsumer = (PLib3MFResourceDataGroup_FindAccessRightByConsumerPtr) GetProcAddress(hLibrary, "lib3mf_resourcedatagroup_findaccessrightbyconsumer"); + #else // _WIN32 + pWrapperTable->m_ResourceDataGroup_FindAccessRightByConsumer = (PLib3MFResourceDataGroup_FindAccessRightByConsumerPtr) dlsym(hLibrary, "lib3mf_resourcedatagroup_findaccessrightbyconsumer"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ResourceDataGroup_FindAccessRightByConsumer == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_reader_removerelationtoread", (void**)&(pWrapperTable->m_Reader_RemoveRelationToRead)); - if ( (eLookupError != 0) || (pWrapperTable->m_Reader_RemoveRelationToRead == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_ResourceDataGroup_RemoveAccessRight = (PLib3MFResourceDataGroup_RemoveAccessRightPtr) GetProcAddress(hLibrary, "lib3mf_resourcedatagroup_removeaccessright"); + #else // _WIN32 + pWrapperTable->m_ResourceDataGroup_RemoveAccessRight = (PLib3MFResourceDataGroup_RemoveAccessRightPtr) dlsym(hLibrary, "lib3mf_resourcedatagroup_removeaccessright"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ResourceDataGroup_RemoveAccessRight == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_reader_setstrictmodeactive", (void**)&(pWrapperTable->m_Reader_SetStrictModeActive)); - if ( (eLookupError != 0) || (pWrapperTable->m_Reader_SetStrictModeActive == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_KeyStore_AddConsumer = (PLib3MFKeyStore_AddConsumerPtr) GetProcAddress(hLibrary, "lib3mf_keystore_addconsumer"); + #else // _WIN32 + pWrapperTable->m_KeyStore_AddConsumer = (PLib3MFKeyStore_AddConsumerPtr) dlsym(hLibrary, "lib3mf_keystore_addconsumer"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_KeyStore_AddConsumer == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_reader_getstrictmodeactive", (void**)&(pWrapperTable->m_Reader_GetStrictModeActive)); - if ( (eLookupError != 0) || (pWrapperTable->m_Reader_GetStrictModeActive == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_KeyStore_GetConsumerCount = (PLib3MFKeyStore_GetConsumerCountPtr) GetProcAddress(hLibrary, "lib3mf_keystore_getconsumercount"); + #else // _WIN32 + pWrapperTable->m_KeyStore_GetConsumerCount = (PLib3MFKeyStore_GetConsumerCountPtr) dlsym(hLibrary, "lib3mf_keystore_getconsumercount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_KeyStore_GetConsumerCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_reader_getwarning", (void**)&(pWrapperTable->m_Reader_GetWarning)); - if ( (eLookupError != 0) || (pWrapperTable->m_Reader_GetWarning == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_KeyStore_GetConsumer = (PLib3MFKeyStore_GetConsumerPtr) GetProcAddress(hLibrary, "lib3mf_keystore_getconsumer"); + #else // _WIN32 + pWrapperTable->m_KeyStore_GetConsumer = (PLib3MFKeyStore_GetConsumerPtr) dlsym(hLibrary, "lib3mf_keystore_getconsumer"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_KeyStore_GetConsumer == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_reader_getwarningcount", (void**)&(pWrapperTable->m_Reader_GetWarningCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_Reader_GetWarningCount == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_KeyStore_RemoveConsumer = (PLib3MFKeyStore_RemoveConsumerPtr) GetProcAddress(hLibrary, "lib3mf_keystore_removeconsumer"); + #else // _WIN32 + pWrapperTable->m_KeyStore_RemoveConsumer = (PLib3MFKeyStore_RemoveConsumerPtr) dlsym(hLibrary, "lib3mf_keystore_removeconsumer"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_KeyStore_RemoveConsumer == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_reader_addkeywrappingcallback", (void**)&(pWrapperTable->m_Reader_AddKeyWrappingCallback)); - if ( (eLookupError != 0) || (pWrapperTable->m_Reader_AddKeyWrappingCallback == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_KeyStore_FindConsumer = (PLib3MFKeyStore_FindConsumerPtr) GetProcAddress(hLibrary, "lib3mf_keystore_findconsumer"); + #else // _WIN32 + pWrapperTable->m_KeyStore_FindConsumer = (PLib3MFKeyStore_FindConsumerPtr) dlsym(hLibrary, "lib3mf_keystore_findconsumer"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_KeyStore_FindConsumer == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_reader_setcontentencryptioncallback", (void**)&(pWrapperTable->m_Reader_SetContentEncryptionCallback)); - if ( (eLookupError != 0) || (pWrapperTable->m_Reader_SetContentEncryptionCallback == nullptr) ) - return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - - eLookupError = (*pLookup)("lib3mf_packagepart_getpath", (void**)&(pWrapperTable->m_PackagePart_GetPath)); - if ( (eLookupError != 0) || (pWrapperTable->m_PackagePart_GetPath == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_KeyStore_GetResourceDataGroupCount = (PLib3MFKeyStore_GetResourceDataGroupCountPtr) GetProcAddress(hLibrary, "lib3mf_keystore_getresourcedatagroupcount"); + #else // _WIN32 + pWrapperTable->m_KeyStore_GetResourceDataGroupCount = (PLib3MFKeyStore_GetResourceDataGroupCountPtr) dlsym(hLibrary, "lib3mf_keystore_getresourcedatagroupcount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_KeyStore_GetResourceDataGroupCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_packagepart_setpath", (void**)&(pWrapperTable->m_PackagePart_SetPath)); - if ( (eLookupError != 0) || (pWrapperTable->m_PackagePart_SetPath == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_KeyStore_AddResourceDataGroup = (PLib3MFKeyStore_AddResourceDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_keystore_addresourcedatagroup"); + #else // _WIN32 + pWrapperTable->m_KeyStore_AddResourceDataGroup = (PLib3MFKeyStore_AddResourceDataGroupPtr) dlsym(hLibrary, "lib3mf_keystore_addresourcedatagroup"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_KeyStore_AddResourceDataGroup == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_resource_getresourceid", (void**)&(pWrapperTable->m_Resource_GetResourceID)); - if ( (eLookupError != 0) || (pWrapperTable->m_Resource_GetResourceID == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_KeyStore_GetResourceDataGroup = (PLib3MFKeyStore_GetResourceDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_keystore_getresourcedatagroup"); + #else // _WIN32 + pWrapperTable->m_KeyStore_GetResourceDataGroup = (PLib3MFKeyStore_GetResourceDataGroupPtr) dlsym(hLibrary, "lib3mf_keystore_getresourcedatagroup"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_KeyStore_GetResourceDataGroup == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_resource_getuniqueresourceid", (void**)&(pWrapperTable->m_Resource_GetUniqueResourceID)); - if ( (eLookupError != 0) || (pWrapperTable->m_Resource_GetUniqueResourceID == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_KeyStore_RemoveResourceDataGroup = (PLib3MFKeyStore_RemoveResourceDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_keystore_removeresourcedatagroup"); + #else // _WIN32 + pWrapperTable->m_KeyStore_RemoveResourceDataGroup = (PLib3MFKeyStore_RemoveResourceDataGroupPtr) dlsym(hLibrary, "lib3mf_keystore_removeresourcedatagroup"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_KeyStore_RemoveResourceDataGroup == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_resource_packagepart", (void**)&(pWrapperTable->m_Resource_PackagePart)); - if ( (eLookupError != 0) || (pWrapperTable->m_Resource_PackagePart == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_KeyStore_FindResourceDataGroup = (PLib3MFKeyStore_FindResourceDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_keystore_findresourcedatagroup"); + #else // _WIN32 + pWrapperTable->m_KeyStore_FindResourceDataGroup = (PLib3MFKeyStore_FindResourceDataGroupPtr) dlsym(hLibrary, "lib3mf_keystore_findresourcedatagroup"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_KeyStore_FindResourceDataGroup == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_resource_setpackagepart", (void**)&(pWrapperTable->m_Resource_SetPackagePart)); - if ( (eLookupError != 0) || (pWrapperTable->m_Resource_SetPackagePart == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_KeyStore_AddResourceData = (PLib3MFKeyStore_AddResourceDataPtr) GetProcAddress(hLibrary, "lib3mf_keystore_addresourcedata"); + #else // _WIN32 + pWrapperTable->m_KeyStore_AddResourceData = (PLib3MFKeyStore_AddResourceDataPtr) dlsym(hLibrary, "lib3mf_keystore_addresourcedata"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_KeyStore_AddResourceData == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_resource_getmodelresourceid", (void**)&(pWrapperTable->m_Resource_GetModelResourceID)); - if ( (eLookupError != 0) || (pWrapperTable->m_Resource_GetModelResourceID == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_KeyStore_RemoveResourceData = (PLib3MFKeyStore_RemoveResourceDataPtr) GetProcAddress(hLibrary, "lib3mf_keystore_removeresourcedata"); + #else // _WIN32 + pWrapperTable->m_KeyStore_RemoveResourceData = (PLib3MFKeyStore_RemoveResourceDataPtr) dlsym(hLibrary, "lib3mf_keystore_removeresourcedata"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_KeyStore_RemoveResourceData == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_resourceiterator_movenext", (void**)&(pWrapperTable->m_ResourceIterator_MoveNext)); - if ( (eLookupError != 0) || (pWrapperTable->m_ResourceIterator_MoveNext == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_KeyStore_FindResourceData = (PLib3MFKeyStore_FindResourceDataPtr) GetProcAddress(hLibrary, "lib3mf_keystore_findresourcedata"); + #else // _WIN32 + pWrapperTable->m_KeyStore_FindResourceData = (PLib3MFKeyStore_FindResourceDataPtr) dlsym(hLibrary, "lib3mf_keystore_findresourcedata"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_KeyStore_FindResourceData == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_resourceiterator_moveprevious", (void**)&(pWrapperTable->m_ResourceIterator_MovePrevious)); - if ( (eLookupError != 0) || (pWrapperTable->m_ResourceIterator_MovePrevious == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_KeyStore_GetResourceDataCount = (PLib3MFKeyStore_GetResourceDataCountPtr) GetProcAddress(hLibrary, "lib3mf_keystore_getresourcedatacount"); + #else // _WIN32 + pWrapperTable->m_KeyStore_GetResourceDataCount = (PLib3MFKeyStore_GetResourceDataCountPtr) dlsym(hLibrary, "lib3mf_keystore_getresourcedatacount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_KeyStore_GetResourceDataCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_resourceiterator_getcurrent", (void**)&(pWrapperTable->m_ResourceIterator_GetCurrent)); - if ( (eLookupError != 0) || (pWrapperTable->m_ResourceIterator_GetCurrent == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_KeyStore_GetResourceData = (PLib3MFKeyStore_GetResourceDataPtr) GetProcAddress(hLibrary, "lib3mf_keystore_getresourcedata"); + #else // _WIN32 + pWrapperTable->m_KeyStore_GetResourceData = (PLib3MFKeyStore_GetResourceDataPtr) dlsym(hLibrary, "lib3mf_keystore_getresourcedata"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_KeyStore_GetResourceData == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_resourceiterator_clone", (void**)&(pWrapperTable->m_ResourceIterator_Clone)); - if ( (eLookupError != 0) || (pWrapperTable->m_ResourceIterator_Clone == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_KeyStore_GetUUID = (PLib3MFKeyStore_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_keystore_getuuid"); + #else // _WIN32 + pWrapperTable->m_KeyStore_GetUUID = (PLib3MFKeyStore_GetUUIDPtr) dlsym(hLibrary, "lib3mf_keystore_getuuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_KeyStore_GetUUID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_resourceiterator_count", (void**)&(pWrapperTable->m_ResourceIterator_Count)); - if ( (eLookupError != 0) || (pWrapperTable->m_ResourceIterator_Count == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_KeyStore_SetUUID = (PLib3MFKeyStore_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_keystore_setuuid"); + #else // _WIN32 + pWrapperTable->m_KeyStore_SetUUID = (PLib3MFKeyStore_SetUUIDPtr) dlsym(hLibrary, "lib3mf_keystore_setuuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_KeyStore_SetUUID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_slicestackiterator_getcurrentslicestack", (void**)&(pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack)); - if ( (eLookupError != 0) || (pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_RootModelPart = (PLib3MFModel_RootModelPartPtr) GetProcAddress(hLibrary, "lib3mf_model_rootmodelpart"); + #else // _WIN32 + pWrapperTable->m_Model_RootModelPart = (PLib3MFModel_RootModelPartPtr) dlsym(hLibrary, "lib3mf_model_rootmodelpart"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_RootModelPart == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_objectiterator_getcurrentobject", (void**)&(pWrapperTable->m_ObjectIterator_GetCurrentObject)); - if ( (eLookupError != 0) || (pWrapperTable->m_ObjectIterator_GetCurrentObject == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_FindOrCreatePackagePart = (PLib3MFModel_FindOrCreatePackagePartPtr) GetProcAddress(hLibrary, "lib3mf_model_findorcreatepackagepart"); + #else // _WIN32 + pWrapperTable->m_Model_FindOrCreatePackagePart = (PLib3MFModel_FindOrCreatePackagePartPtr) dlsym(hLibrary, "lib3mf_model_findorcreatepackagepart"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_FindOrCreatePackagePart == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_meshobjectiterator_getcurrentmeshobject", (void**)&(pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject)); - if ( (eLookupError != 0) || (pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_SetUnit = (PLib3MFModel_SetUnitPtr) GetProcAddress(hLibrary, "lib3mf_model_setunit"); + #else // _WIN32 + pWrapperTable->m_Model_SetUnit = (PLib3MFModel_SetUnitPtr) dlsym(hLibrary, "lib3mf_model_setunit"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_SetUnit == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_componentsobjectiterator_getcurrentcomponentsobject", (void**)&(pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject)); - if ( (eLookupError != 0) || (pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetUnit = (PLib3MFModel_GetUnitPtr) GetProcAddress(hLibrary, "lib3mf_model_getunit"); + #else // _WIN32 + pWrapperTable->m_Model_GetUnit = (PLib3MFModel_GetUnitPtr) dlsym(hLibrary, "lib3mf_model_getunit"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetUnit == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_texture2diterator_getcurrenttexture2d", (void**)&(pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D)); - if ( (eLookupError != 0) || (pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetLanguage = (PLib3MFModel_GetLanguagePtr) GetProcAddress(hLibrary, "lib3mf_model_getlanguage"); + #else // _WIN32 + pWrapperTable->m_Model_GetLanguage = (PLib3MFModel_GetLanguagePtr) dlsym(hLibrary, "lib3mf_model_getlanguage"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetLanguage == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup", (void**)&(pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup)); - if ( (eLookupError != 0) || (pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_SetLanguage = (PLib3MFModel_SetLanguagePtr) GetProcAddress(hLibrary, "lib3mf_model_setlanguage"); + #else // _WIN32 + pWrapperTable->m_Model_SetLanguage = (PLib3MFModel_SetLanguagePtr) dlsym(hLibrary, "lib3mf_model_setlanguage"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_SetLanguage == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_colorgroupiterator_getcurrentcolorgroup", (void**)&(pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup)); - if ( (eLookupError != 0) || (pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_QueryWriter = (PLib3MFModel_QueryWriterPtr) GetProcAddress(hLibrary, "lib3mf_model_querywriter"); + #else // _WIN32 + pWrapperTable->m_Model_QueryWriter = (PLib3MFModel_QueryWriterPtr) dlsym(hLibrary, "lib3mf_model_querywriter"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_QueryWriter == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup", (void**)&(pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup)); - if ( (eLookupError != 0) || (pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_QueryReader = (PLib3MFModel_QueryReaderPtr) GetProcAddress(hLibrary, "lib3mf_model_queryreader"); + #else // _WIN32 + pWrapperTable->m_Model_QueryReader = (PLib3MFModel_QueryReaderPtr) dlsym(hLibrary, "lib3mf_model_queryreader"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_QueryReader == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_compositematerialsiterator_getcurrentcompositematerials", (void**)&(pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials)); - if ( (eLookupError != 0) || (pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetResourceByID = (PLib3MFModel_GetResourceByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getresourcebyid"); + #else // _WIN32 + pWrapperTable->m_Model_GetResourceByID = (PLib3MFModel_GetResourceByIDPtr) dlsym(hLibrary, "lib3mf_model_getresourcebyid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetResourceByID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup", (void**)&(pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup)); - if ( (eLookupError != 0) || (pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetTexture2DByID = (PLib3MFModel_GetTexture2DByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_gettexture2dbyid"); + #else // _WIN32 + pWrapperTable->m_Model_GetTexture2DByID = (PLib3MFModel_GetTexture2DByIDPtr) dlsym(hLibrary, "lib3mf_model_gettexture2dbyid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetTexture2DByID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_metadata_getnamespace", (void**)&(pWrapperTable->m_MetaData_GetNameSpace)); - if ( (eLookupError != 0) || (pWrapperTable->m_MetaData_GetNameSpace == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetPropertyTypeByID = (PLib3MFModel_GetPropertyTypeByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getpropertytypebyid"); + #else // _WIN32 + pWrapperTable->m_Model_GetPropertyTypeByID = (PLib3MFModel_GetPropertyTypeByIDPtr) dlsym(hLibrary, "lib3mf_model_getpropertytypebyid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetPropertyTypeByID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_metadata_setnamespace", (void**)&(pWrapperTable->m_MetaData_SetNameSpace)); - if ( (eLookupError != 0) || (pWrapperTable->m_MetaData_SetNameSpace == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetBaseMaterialGroupByID = (PLib3MFModel_GetBaseMaterialGroupByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getbasematerialgroupbyid"); + #else // _WIN32 + pWrapperTable->m_Model_GetBaseMaterialGroupByID = (PLib3MFModel_GetBaseMaterialGroupByIDPtr) dlsym(hLibrary, "lib3mf_model_getbasematerialgroupbyid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetBaseMaterialGroupByID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_metadata_getname", (void**)&(pWrapperTable->m_MetaData_GetName)); - if ( (eLookupError != 0) || (pWrapperTable->m_MetaData_GetName == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetTexture2DGroupByID = (PLib3MFModel_GetTexture2DGroupByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_gettexture2dgroupbyid"); + #else // _WIN32 + pWrapperTable->m_Model_GetTexture2DGroupByID = (PLib3MFModel_GetTexture2DGroupByIDPtr) dlsym(hLibrary, "lib3mf_model_gettexture2dgroupbyid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetTexture2DGroupByID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_metadata_setname", (void**)&(pWrapperTable->m_MetaData_SetName)); - if ( (eLookupError != 0) || (pWrapperTable->m_MetaData_SetName == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetCompositeMaterialsByID = (PLib3MFModel_GetCompositeMaterialsByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getcompositematerialsbyid"); + #else // _WIN32 + pWrapperTable->m_Model_GetCompositeMaterialsByID = (PLib3MFModel_GetCompositeMaterialsByIDPtr) dlsym(hLibrary, "lib3mf_model_getcompositematerialsbyid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetCompositeMaterialsByID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_metadata_getkey", (void**)&(pWrapperTable->m_MetaData_GetKey)); - if ( (eLookupError != 0) || (pWrapperTable->m_MetaData_GetKey == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetMultiPropertyGroupByID = (PLib3MFModel_GetMultiPropertyGroupByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getmultipropertygroupbyid"); + #else // _WIN32 + pWrapperTable->m_Model_GetMultiPropertyGroupByID = (PLib3MFModel_GetMultiPropertyGroupByIDPtr) dlsym(hLibrary, "lib3mf_model_getmultipropertygroupbyid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetMultiPropertyGroupByID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_metadata_getmustpreserve", (void**)&(pWrapperTable->m_MetaData_GetMustPreserve)); - if ( (eLookupError != 0) || (pWrapperTable->m_MetaData_GetMustPreserve == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetMeshObjectByID = (PLib3MFModel_GetMeshObjectByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getmeshobjectbyid"); + #else // _WIN32 + pWrapperTable->m_Model_GetMeshObjectByID = (PLib3MFModel_GetMeshObjectByIDPtr) dlsym(hLibrary, "lib3mf_model_getmeshobjectbyid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetMeshObjectByID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_metadata_setmustpreserve", (void**)&(pWrapperTable->m_MetaData_SetMustPreserve)); - if ( (eLookupError != 0) || (pWrapperTable->m_MetaData_SetMustPreserve == nullptr) ) - return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - - eLookupError = (*pLookup)("lib3mf_metadata_gettype", (void**)&(pWrapperTable->m_MetaData_GetType)); - if ( (eLookupError != 0) || (pWrapperTable->m_MetaData_GetType == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetComponentsObjectByID = (PLib3MFModel_GetComponentsObjectByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getcomponentsobjectbyid"); + #else // _WIN32 + pWrapperTable->m_Model_GetComponentsObjectByID = (PLib3MFModel_GetComponentsObjectByIDPtr) dlsym(hLibrary, "lib3mf_model_getcomponentsobjectbyid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetComponentsObjectByID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_metadata_settype", (void**)&(pWrapperTable->m_MetaData_SetType)); - if ( (eLookupError != 0) || (pWrapperTable->m_MetaData_SetType == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetColorGroupByID = (PLib3MFModel_GetColorGroupByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getcolorgroupbyid"); + #else // _WIN32 + pWrapperTable->m_Model_GetColorGroupByID = (PLib3MFModel_GetColorGroupByIDPtr) dlsym(hLibrary, "lib3mf_model_getcolorgroupbyid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetColorGroupByID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_metadata_getvalue", (void**)&(pWrapperTable->m_MetaData_GetValue)); - if ( (eLookupError != 0) || (pWrapperTable->m_MetaData_GetValue == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetSliceStackByID = (PLib3MFModel_GetSliceStackByIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getslicestackbyid"); + #else // _WIN32 + pWrapperTable->m_Model_GetSliceStackByID = (PLib3MFModel_GetSliceStackByIDPtr) dlsym(hLibrary, "lib3mf_model_getslicestackbyid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetSliceStackByID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_metadata_setvalue", (void**)&(pWrapperTable->m_MetaData_SetValue)); - if ( (eLookupError != 0) || (pWrapperTable->m_MetaData_SetValue == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetBuildUUID = (PLib3MFModel_GetBuildUUIDPtr) GetProcAddress(hLibrary, "lib3mf_model_getbuilduuid"); + #else // _WIN32 + pWrapperTable->m_Model_GetBuildUUID = (PLib3MFModel_GetBuildUUIDPtr) dlsym(hLibrary, "lib3mf_model_getbuilduuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetBuildUUID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_metadatagroup_getmetadatacount", (void**)&(pWrapperTable->m_MetaDataGroup_GetMetaDataCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_MetaDataGroup_GetMetaDataCount == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_SetBuildUUID = (PLib3MFModel_SetBuildUUIDPtr) GetProcAddress(hLibrary, "lib3mf_model_setbuilduuid"); + #else // _WIN32 + pWrapperTable->m_Model_SetBuildUUID = (PLib3MFModel_SetBuildUUIDPtr) dlsym(hLibrary, "lib3mf_model_setbuilduuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_SetBuildUUID == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_metadatagroup_getmetadata", (void**)&(pWrapperTable->m_MetaDataGroup_GetMetaData)); - if ( (eLookupError != 0) || (pWrapperTable->m_MetaDataGroup_GetMetaData == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetBuildItems = (PLib3MFModel_GetBuildItemsPtr) GetProcAddress(hLibrary, "lib3mf_model_getbuilditems"); + #else // _WIN32 + pWrapperTable->m_Model_GetBuildItems = (PLib3MFModel_GetBuildItemsPtr) dlsym(hLibrary, "lib3mf_model_getbuilditems"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetBuildItems == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_metadatagroup_getmetadatabykey", (void**)&(pWrapperTable->m_MetaDataGroup_GetMetaDataByKey)); - if ( (eLookupError != 0) || (pWrapperTable->m_MetaDataGroup_GetMetaDataByKey == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetOutbox = (PLib3MFModel_GetOutboxPtr) GetProcAddress(hLibrary, "lib3mf_model_getoutbox"); + #else // _WIN32 + pWrapperTable->m_Model_GetOutbox = (PLib3MFModel_GetOutboxPtr) dlsym(hLibrary, "lib3mf_model_getoutbox"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetOutbox == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_metadatagroup_removemetadatabyindex", (void**)&(pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex)); - if ( (eLookupError != 0) || (pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetResources = (PLib3MFModel_GetResourcesPtr) GetProcAddress(hLibrary, "lib3mf_model_getresources"); + #else // _WIN32 + pWrapperTable->m_Model_GetResources = (PLib3MFModel_GetResourcesPtr) dlsym(hLibrary, "lib3mf_model_getresources"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetResources == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_metadatagroup_removemetadata", (void**)&(pWrapperTable->m_MetaDataGroup_RemoveMetaData)); - if ( (eLookupError != 0) || (pWrapperTable->m_MetaDataGroup_RemoveMetaData == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetObjects = (PLib3MFModel_GetObjectsPtr) GetProcAddress(hLibrary, "lib3mf_model_getobjects"); + #else // _WIN32 + pWrapperTable->m_Model_GetObjects = (PLib3MFModel_GetObjectsPtr) dlsym(hLibrary, "lib3mf_model_getobjects"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetObjects == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_metadatagroup_addmetadata", (void**)&(pWrapperTable->m_MetaDataGroup_AddMetaData)); - if ( (eLookupError != 0) || (pWrapperTable->m_MetaDataGroup_AddMetaData == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetMeshObjects = (PLib3MFModel_GetMeshObjectsPtr) GetProcAddress(hLibrary, "lib3mf_model_getmeshobjects"); + #else // _WIN32 + pWrapperTable->m_Model_GetMeshObjects = (PLib3MFModel_GetMeshObjectsPtr) dlsym(hLibrary, "lib3mf_model_getmeshobjects"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetMeshObjects == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_object_gettype", (void**)&(pWrapperTable->m_Object_GetType)); - if ( (eLookupError != 0) || (pWrapperTable->m_Object_GetType == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetComponentsObjects = (PLib3MFModel_GetComponentsObjectsPtr) GetProcAddress(hLibrary, "lib3mf_model_getcomponentsobjects"); + #else // _WIN32 + pWrapperTable->m_Model_GetComponentsObjects = (PLib3MFModel_GetComponentsObjectsPtr) dlsym(hLibrary, "lib3mf_model_getcomponentsobjects"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetComponentsObjects == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_object_settype", (void**)&(pWrapperTable->m_Object_SetType)); - if ( (eLookupError != 0) || (pWrapperTable->m_Object_SetType == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetTexture2Ds = (PLib3MFModel_GetTexture2DsPtr) GetProcAddress(hLibrary, "lib3mf_model_gettexture2ds"); + #else // _WIN32 + pWrapperTable->m_Model_GetTexture2Ds = (PLib3MFModel_GetTexture2DsPtr) dlsym(hLibrary, "lib3mf_model_gettexture2ds"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetTexture2Ds == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_object_getname", (void**)&(pWrapperTable->m_Object_GetName)); - if ( (eLookupError != 0) || (pWrapperTable->m_Object_GetName == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetBaseMaterialGroups = (PLib3MFModel_GetBaseMaterialGroupsPtr) GetProcAddress(hLibrary, "lib3mf_model_getbasematerialgroups"); + #else // _WIN32 + pWrapperTable->m_Model_GetBaseMaterialGroups = (PLib3MFModel_GetBaseMaterialGroupsPtr) dlsym(hLibrary, "lib3mf_model_getbasematerialgroups"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetBaseMaterialGroups == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_object_setname", (void**)&(pWrapperTable->m_Object_SetName)); - if ( (eLookupError != 0) || (pWrapperTable->m_Object_SetName == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetColorGroups = (PLib3MFModel_GetColorGroupsPtr) GetProcAddress(hLibrary, "lib3mf_model_getcolorgroups"); + #else // _WIN32 + pWrapperTable->m_Model_GetColorGroups = (PLib3MFModel_GetColorGroupsPtr) dlsym(hLibrary, "lib3mf_model_getcolorgroups"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetColorGroups == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_object_getpartnumber", (void**)&(pWrapperTable->m_Object_GetPartNumber)); - if ( (eLookupError != 0) || (pWrapperTable->m_Object_GetPartNumber == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetTexture2DGroups = (PLib3MFModel_GetTexture2DGroupsPtr) GetProcAddress(hLibrary, "lib3mf_model_gettexture2dgroups"); + #else // _WIN32 + pWrapperTable->m_Model_GetTexture2DGroups = (PLib3MFModel_GetTexture2DGroupsPtr) dlsym(hLibrary, "lib3mf_model_gettexture2dgroups"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetTexture2DGroups == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_object_setpartnumber", (void**)&(pWrapperTable->m_Object_SetPartNumber)); - if ( (eLookupError != 0) || (pWrapperTable->m_Object_SetPartNumber == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetCompositeMaterials = (PLib3MFModel_GetCompositeMaterialsPtr) GetProcAddress(hLibrary, "lib3mf_model_getcompositematerials"); + #else // _WIN32 + pWrapperTable->m_Model_GetCompositeMaterials = (PLib3MFModel_GetCompositeMaterialsPtr) dlsym(hLibrary, "lib3mf_model_getcompositematerials"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetCompositeMaterials == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_object_ismeshobject", (void**)&(pWrapperTable->m_Object_IsMeshObject)); - if ( (eLookupError != 0) || (pWrapperTable->m_Object_IsMeshObject == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetMultiPropertyGroups = (PLib3MFModel_GetMultiPropertyGroupsPtr) GetProcAddress(hLibrary, "lib3mf_model_getmultipropertygroups"); + #else // _WIN32 + pWrapperTable->m_Model_GetMultiPropertyGroups = (PLib3MFModel_GetMultiPropertyGroupsPtr) dlsym(hLibrary, "lib3mf_model_getmultipropertygroups"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetMultiPropertyGroups == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_object_iscomponentsobject", (void**)&(pWrapperTable->m_Object_IsComponentsObject)); - if ( (eLookupError != 0) || (pWrapperTable->m_Object_IsComponentsObject == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetToolpaths = (PLib3MFModel_GetToolpathsPtr) GetProcAddress(hLibrary, "lib3mf_model_gettoolpaths"); + #else // _WIN32 + pWrapperTable->m_Model_GetToolpaths = (PLib3MFModel_GetToolpathsPtr) dlsym(hLibrary, "lib3mf_model_gettoolpaths"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetToolpaths == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_object_isvalid", (void**)&(pWrapperTable->m_Object_IsValid)); - if ( (eLookupError != 0) || (pWrapperTable->m_Object_IsValid == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetSliceStacks = (PLib3MFModel_GetSliceStacksPtr) GetProcAddress(hLibrary, "lib3mf_model_getslicestacks"); + #else // _WIN32 + pWrapperTable->m_Model_GetSliceStacks = (PLib3MFModel_GetSliceStacksPtr) dlsym(hLibrary, "lib3mf_model_getslicestacks"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetSliceStacks == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_object_setattachmentasthumbnail", (void**)&(pWrapperTable->m_Object_SetAttachmentAsThumbnail)); - if ( (eLookupError != 0) || (pWrapperTable->m_Object_SetAttachmentAsThumbnail == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_MergeToModel = (PLib3MFModel_MergeToModelPtr) GetProcAddress(hLibrary, "lib3mf_model_mergetomodel"); + #else // _WIN32 + pWrapperTable->m_Model_MergeToModel = (PLib3MFModel_MergeToModelPtr) dlsym(hLibrary, "lib3mf_model_mergetomodel"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_MergeToModel == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_object_getthumbnailattachment", (void**)&(pWrapperTable->m_Object_GetThumbnailAttachment)); - if ( (eLookupError != 0) || (pWrapperTable->m_Object_GetThumbnailAttachment == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_AddMeshObject = (PLib3MFModel_AddMeshObjectPtr) GetProcAddress(hLibrary, "lib3mf_model_addmeshobject"); + #else // _WIN32 + pWrapperTable->m_Model_AddMeshObject = (PLib3MFModel_AddMeshObjectPtr) dlsym(hLibrary, "lib3mf_model_addmeshobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_AddMeshObject == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_object_clearthumbnailattachment", (void**)&(pWrapperTable->m_Object_ClearThumbnailAttachment)); - if ( (eLookupError != 0) || (pWrapperTable->m_Object_ClearThumbnailAttachment == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_AddComponentsObject = (PLib3MFModel_AddComponentsObjectPtr) GetProcAddress(hLibrary, "lib3mf_model_addcomponentsobject"); + #else // _WIN32 + pWrapperTable->m_Model_AddComponentsObject = (PLib3MFModel_AddComponentsObjectPtr) dlsym(hLibrary, "lib3mf_model_addcomponentsobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_AddComponentsObject == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_object_getoutbox", (void**)&(pWrapperTable->m_Object_GetOutbox)); - if ( (eLookupError != 0) || (pWrapperTable->m_Object_GetOutbox == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_AddSliceStack = (PLib3MFModel_AddSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_model_addslicestack"); + #else // _WIN32 + pWrapperTable->m_Model_AddSliceStack = (PLib3MFModel_AddSliceStackPtr) dlsym(hLibrary, "lib3mf_model_addslicestack"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_AddSliceStack == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_object_getuuid", (void**)&(pWrapperTable->m_Object_GetUUID)); - if ( (eLookupError != 0) || (pWrapperTable->m_Object_GetUUID == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_AddTexture2DFromAttachment = (PLib3MFModel_AddTexture2DFromAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_model_addtexture2dfromattachment"); + #else // _WIN32 + pWrapperTable->m_Model_AddTexture2DFromAttachment = (PLib3MFModel_AddTexture2DFromAttachmentPtr) dlsym(hLibrary, "lib3mf_model_addtexture2dfromattachment"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_AddTexture2DFromAttachment == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_object_setuuid", (void**)&(pWrapperTable->m_Object_SetUUID)); - if ( (eLookupError != 0) || (pWrapperTable->m_Object_SetUUID == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_AddBaseMaterialGroup = (PLib3MFModel_AddBaseMaterialGroupPtr) GetProcAddress(hLibrary, "lib3mf_model_addbasematerialgroup"); + #else // _WIN32 + pWrapperTable->m_Model_AddBaseMaterialGroup = (PLib3MFModel_AddBaseMaterialGroupPtr) dlsym(hLibrary, "lib3mf_model_addbasematerialgroup"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_AddBaseMaterialGroup == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_object_getmetadatagroup", (void**)&(pWrapperTable->m_Object_GetMetaDataGroup)); - if ( (eLookupError != 0) || (pWrapperTable->m_Object_GetMetaDataGroup == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_AddColorGroup = (PLib3MFModel_AddColorGroupPtr) GetProcAddress(hLibrary, "lib3mf_model_addcolorgroup"); + #else // _WIN32 + pWrapperTable->m_Model_AddColorGroup = (PLib3MFModel_AddColorGroupPtr) dlsym(hLibrary, "lib3mf_model_addcolorgroup"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_AddColorGroup == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_object_setslicesmeshresolution", (void**)&(pWrapperTable->m_Object_SetSlicesMeshResolution)); - if ( (eLookupError != 0) || (pWrapperTable->m_Object_SetSlicesMeshResolution == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_AddTexture2DGroup = (PLib3MFModel_AddTexture2DGroupPtr) GetProcAddress(hLibrary, "lib3mf_model_addtexture2dgroup"); + #else // _WIN32 + pWrapperTable->m_Model_AddTexture2DGroup = (PLib3MFModel_AddTexture2DGroupPtr) dlsym(hLibrary, "lib3mf_model_addtexture2dgroup"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_AddTexture2DGroup == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_object_getslicesmeshresolution", (void**)&(pWrapperTable->m_Object_GetSlicesMeshResolution)); - if ( (eLookupError != 0) || (pWrapperTable->m_Object_GetSlicesMeshResolution == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_AddCompositeMaterials = (PLib3MFModel_AddCompositeMaterialsPtr) GetProcAddress(hLibrary, "lib3mf_model_addcompositematerials"); + #else // _WIN32 + pWrapperTable->m_Model_AddCompositeMaterials = (PLib3MFModel_AddCompositeMaterialsPtr) dlsym(hLibrary, "lib3mf_model_addcompositematerials"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_AddCompositeMaterials == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_object_hasslices", (void**)&(pWrapperTable->m_Object_HasSlices)); - if ( (eLookupError != 0) || (pWrapperTable->m_Object_HasSlices == nullptr) ) - return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - - eLookupError = (*pLookup)("lib3mf_object_clearslicestack", (void**)&(pWrapperTable->m_Object_ClearSliceStack)); - if ( (eLookupError != 0) || (pWrapperTable->m_Object_ClearSliceStack == nullptr) ) - return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - - eLookupError = (*pLookup)("lib3mf_object_getslicestack", (void**)&(pWrapperTable->m_Object_GetSliceStack)); - if ( (eLookupError != 0) || (pWrapperTable->m_Object_GetSliceStack == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_AddMultiPropertyGroup = (PLib3MFModel_AddMultiPropertyGroupPtr) GetProcAddress(hLibrary, "lib3mf_model_addmultipropertygroup"); + #else // _WIN32 + pWrapperTable->m_Model_AddMultiPropertyGroup = (PLib3MFModel_AddMultiPropertyGroupPtr) dlsym(hLibrary, "lib3mf_model_addmultipropertygroup"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_AddMultiPropertyGroup == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_object_assignslicestack", (void**)&(pWrapperTable->m_Object_AssignSliceStack)); - if ( (eLookupError != 0) || (pWrapperTable->m_Object_AssignSliceStack == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_AddBuildItem = (PLib3MFModel_AddBuildItemPtr) GetProcAddress(hLibrary, "lib3mf_model_addbuilditem"); + #else // _WIN32 + pWrapperTable->m_Model_AddBuildItem = (PLib3MFModel_AddBuildItemPtr) dlsym(hLibrary, "lib3mf_model_addbuilditem"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_AddBuildItem == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_meshobject_getvertexcount", (void**)&(pWrapperTable->m_MeshObject_GetVertexCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_GetVertexCount == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_RemoveBuildItem = (PLib3MFModel_RemoveBuildItemPtr) GetProcAddress(hLibrary, "lib3mf_model_removebuilditem"); + #else // _WIN32 + pWrapperTable->m_Model_RemoveBuildItem = (PLib3MFModel_RemoveBuildItemPtr) dlsym(hLibrary, "lib3mf_model_removebuilditem"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_RemoveBuildItem == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_meshobject_gettrianglecount", (void**)&(pWrapperTable->m_MeshObject_GetTriangleCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_GetTriangleCount == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_AddToolpath = (PLib3MFModel_AddToolpathPtr) GetProcAddress(hLibrary, "lib3mf_model_addtoolpath"); + #else // _WIN32 + pWrapperTable->m_Model_AddToolpath = (PLib3MFModel_AddToolpathPtr) dlsym(hLibrary, "lib3mf_model_addtoolpath"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_AddToolpath == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_meshobject_getvertex", (void**)&(pWrapperTable->m_MeshObject_GetVertex)); - if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_GetVertex == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetMetaDataGroup = (PLib3MFModel_GetMetaDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_model_getmetadatagroup"); + #else // _WIN32 + pWrapperTable->m_Model_GetMetaDataGroup = (PLib3MFModel_GetMetaDataGroupPtr) dlsym(hLibrary, "lib3mf_model_getmetadatagroup"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetMetaDataGroup == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_meshobject_setvertex", (void**)&(pWrapperTable->m_MeshObject_SetVertex)); - if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_SetVertex == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_AddAttachment = (PLib3MFModel_AddAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_model_addattachment"); + #else // _WIN32 + pWrapperTable->m_Model_AddAttachment = (PLib3MFModel_AddAttachmentPtr) dlsym(hLibrary, "lib3mf_model_addattachment"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_AddAttachment == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_meshobject_addvertex", (void**)&(pWrapperTable->m_MeshObject_AddVertex)); - if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_AddVertex == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_RemoveAttachment = (PLib3MFModel_RemoveAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_model_removeattachment"); + #else // _WIN32 + pWrapperTable->m_Model_RemoveAttachment = (PLib3MFModel_RemoveAttachmentPtr) dlsym(hLibrary, "lib3mf_model_removeattachment"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_RemoveAttachment == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_meshobject_getvertices", (void**)&(pWrapperTable->m_MeshObject_GetVertices)); - if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_GetVertices == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetAttachment = (PLib3MFModel_GetAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_model_getattachment"); + #else // _WIN32 + pWrapperTable->m_Model_GetAttachment = (PLib3MFModel_GetAttachmentPtr) dlsym(hLibrary, "lib3mf_model_getattachment"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetAttachment == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_meshobject_gettriangle", (void**)&(pWrapperTable->m_MeshObject_GetTriangle)); - if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_GetTriangle == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_FindAttachment = (PLib3MFModel_FindAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_model_findattachment"); + #else // _WIN32 + pWrapperTable->m_Model_FindAttachment = (PLib3MFModel_FindAttachmentPtr) dlsym(hLibrary, "lib3mf_model_findattachment"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_FindAttachment == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_meshobject_settriangle", (void**)&(pWrapperTable->m_MeshObject_SetTriangle)); - if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_SetTriangle == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetAttachmentCount = (PLib3MFModel_GetAttachmentCountPtr) GetProcAddress(hLibrary, "lib3mf_model_getattachmentcount"); + #else // _WIN32 + pWrapperTable->m_Model_GetAttachmentCount = (PLib3MFModel_GetAttachmentCountPtr) dlsym(hLibrary, "lib3mf_model_getattachmentcount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetAttachmentCount == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_meshobject_addtriangle", (void**)&(pWrapperTable->m_MeshObject_AddTriangle)); - if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_AddTriangle == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_HasPackageThumbnailAttachment = (PLib3MFModel_HasPackageThumbnailAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_model_haspackagethumbnailattachment"); + #else // _WIN32 + pWrapperTable->m_Model_HasPackageThumbnailAttachment = (PLib3MFModel_HasPackageThumbnailAttachmentPtr) dlsym(hLibrary, "lib3mf_model_haspackagethumbnailattachment"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_HasPackageThumbnailAttachment == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_meshobject_gettriangleindices", (void**)&(pWrapperTable->m_MeshObject_GetTriangleIndices)); - if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_GetTriangleIndices == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_CreatePackageThumbnailAttachment = (PLib3MFModel_CreatePackageThumbnailAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_model_createpackagethumbnailattachment"); + #else // _WIN32 + pWrapperTable->m_Model_CreatePackageThumbnailAttachment = (PLib3MFModel_CreatePackageThumbnailAttachmentPtr) dlsym(hLibrary, "lib3mf_model_createpackagethumbnailattachment"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_CreatePackageThumbnailAttachment == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_meshobject_setobjectlevelproperty", (void**)&(pWrapperTable->m_MeshObject_SetObjectLevelProperty)); - if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_SetObjectLevelProperty == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetPackageThumbnailAttachment = (PLib3MFModel_GetPackageThumbnailAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_model_getpackagethumbnailattachment"); + #else // _WIN32 + pWrapperTable->m_Model_GetPackageThumbnailAttachment = (PLib3MFModel_GetPackageThumbnailAttachmentPtr) dlsym(hLibrary, "lib3mf_model_getpackagethumbnailattachment"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetPackageThumbnailAttachment == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_meshobject_getobjectlevelproperty", (void**)&(pWrapperTable->m_MeshObject_GetObjectLevelProperty)); - if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_GetObjectLevelProperty == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_RemovePackageThumbnailAttachment = (PLib3MFModel_RemovePackageThumbnailAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_model_removepackagethumbnailattachment"); + #else // _WIN32 + pWrapperTable->m_Model_RemovePackageThumbnailAttachment = (PLib3MFModel_RemovePackageThumbnailAttachmentPtr) dlsym(hLibrary, "lib3mf_model_removepackagethumbnailattachment"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_RemovePackageThumbnailAttachment == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_meshobject_settriangleproperties", (void**)&(pWrapperTable->m_MeshObject_SetTriangleProperties)); - if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_SetTriangleProperties == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_AddCustomContentType = (PLib3MFModel_AddCustomContentTypePtr) GetProcAddress(hLibrary, "lib3mf_model_addcustomcontenttype"); + #else // _WIN32 + pWrapperTable->m_Model_AddCustomContentType = (PLib3MFModel_AddCustomContentTypePtr) dlsym(hLibrary, "lib3mf_model_addcustomcontenttype"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_AddCustomContentType == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_meshobject_gettriangleproperties", (void**)&(pWrapperTable->m_MeshObject_GetTriangleProperties)); - if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_GetTriangleProperties == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_RemoveCustomContentType = (PLib3MFModel_RemoveCustomContentTypePtr) GetProcAddress(hLibrary, "lib3mf_model_removecustomcontenttype"); + #else // _WIN32 + pWrapperTable->m_Model_RemoveCustomContentType = (PLib3MFModel_RemoveCustomContentTypePtr) dlsym(hLibrary, "lib3mf_model_removecustomcontenttype"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_RemoveCustomContentType == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_meshobject_setalltriangleproperties", (void**)&(pWrapperTable->m_MeshObject_SetAllTriangleProperties)); - if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_SetAllTriangleProperties == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_SetRandomNumberCallback = (PLib3MFModel_SetRandomNumberCallbackPtr) GetProcAddress(hLibrary, "lib3mf_model_setrandomnumbercallback"); + #else // _WIN32 + pWrapperTable->m_Model_SetRandomNumberCallback = (PLib3MFModel_SetRandomNumberCallbackPtr) dlsym(hLibrary, "lib3mf_model_setrandomnumbercallback"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_SetRandomNumberCallback == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_meshobject_getalltriangleproperties", (void**)&(pWrapperTable->m_MeshObject_GetAllTriangleProperties)); - if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_GetAllTriangleProperties == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_GetKeyStore = (PLib3MFModel_GetKeyStorePtr) GetProcAddress(hLibrary, "lib3mf_model_getkeystore"); + #else // _WIN32 + pWrapperTable->m_Model_GetKeyStore = (PLib3MFModel_GetKeyStorePtr) dlsym(hLibrary, "lib3mf_model_getkeystore"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetKeyStore == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_meshobject_clearallproperties", (void**)&(pWrapperTable->m_MeshObject_ClearAllProperties)); - if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_ClearAllProperties == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_CreatePersistentSourceFromFile = (PLib3MFModel_CreatePersistentSourceFromFilePtr) GetProcAddress(hLibrary, "lib3mf_model_createpersistentsourcefromfile"); + #else // _WIN32 + pWrapperTable->m_Model_CreatePersistentSourceFromFile = (PLib3MFModel_CreatePersistentSourceFromFilePtr) dlsym(hLibrary, "lib3mf_model_createpersistentsourcefromfile"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_CreatePersistentSourceFromFile == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_meshobject_setgeometry", (void**)&(pWrapperTable->m_MeshObject_SetGeometry)); - if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_SetGeometry == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_CreatePersistentSourceFromBuffer = (PLib3MFModel_CreatePersistentSourceFromBufferPtr) GetProcAddress(hLibrary, "lib3mf_model_createpersistentsourcefrombuffer"); + #else // _WIN32 + pWrapperTable->m_Model_CreatePersistentSourceFromBuffer = (PLib3MFModel_CreatePersistentSourceFromBufferPtr) dlsym(hLibrary, "lib3mf_model_createpersistentsourcefrombuffer"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_CreatePersistentSourceFromBuffer == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_meshobject_ismanifoldandoriented", (void**)&(pWrapperTable->m_MeshObject_IsManifoldAndOriented)); - if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_IsManifoldAndOriented == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Model_CreatePersistentSourceFromCallback = (PLib3MFModel_CreatePersistentSourceFromCallbackPtr) GetProcAddress(hLibrary, "lib3mf_model_createpersistentsourcefromcallback"); + #else // _WIN32 + pWrapperTable->m_Model_CreatePersistentSourceFromCallback = (PLib3MFModel_CreatePersistentSourceFromCallbackPtr) dlsym(hLibrary, "lib3mf_model_createpersistentsourcefromcallback"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_CreatePersistentSourceFromCallback == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_meshobject_beamlattice", (void**)&(pWrapperTable->m_MeshObject_BeamLattice)); - if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_BeamLattice == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_GetLibraryVersion = (PLib3MFGetLibraryVersionPtr) GetProcAddress(hLibrary, "lib3mf_getlibraryversion"); + #else // _WIN32 + pWrapperTable->m_GetLibraryVersion = (PLib3MFGetLibraryVersionPtr) dlsym(hLibrary, "lib3mf_getlibraryversion"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_GetLibraryVersion == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamlattice_getminlength", (void**)&(pWrapperTable->m_BeamLattice_GetMinLength)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetMinLength == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_GetPrereleaseInformation = (PLib3MFGetPrereleaseInformationPtr) GetProcAddress(hLibrary, "lib3mf_getprereleaseinformation"); + #else // _WIN32 + pWrapperTable->m_GetPrereleaseInformation = (PLib3MFGetPrereleaseInformationPtr) dlsym(hLibrary, "lib3mf_getprereleaseinformation"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_GetPrereleaseInformation == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamlattice_setminlength", (void**)&(pWrapperTable->m_BeamLattice_SetMinLength)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_SetMinLength == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_GetBuildInformation = (PLib3MFGetBuildInformationPtr) GetProcAddress(hLibrary, "lib3mf_getbuildinformation"); + #else // _WIN32 + pWrapperTable->m_GetBuildInformation = (PLib3MFGetBuildInformationPtr) dlsym(hLibrary, "lib3mf_getbuildinformation"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_GetBuildInformation == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamlattice_getclipping", (void**)&(pWrapperTable->m_BeamLattice_GetClipping)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetClipping == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_GetSpecificationVersion = (PLib3MFGetSpecificationVersionPtr) GetProcAddress(hLibrary, "lib3mf_getspecificationversion"); + #else // _WIN32 + pWrapperTable->m_GetSpecificationVersion = (PLib3MFGetSpecificationVersionPtr) dlsym(hLibrary, "lib3mf_getspecificationversion"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_GetSpecificationVersion == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamlattice_setclipping", (void**)&(pWrapperTable->m_BeamLattice_SetClipping)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_SetClipping == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_CreateModel = (PLib3MFCreateModelPtr) GetProcAddress(hLibrary, "lib3mf_createmodel"); + #else // _WIN32 + pWrapperTable->m_CreateModel = (PLib3MFCreateModelPtr) dlsym(hLibrary, "lib3mf_createmodel"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_CreateModel == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamlattice_getrepresentation", (void**)&(pWrapperTable->m_BeamLattice_GetRepresentation)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetRepresentation == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Release = (PLib3MFReleasePtr) GetProcAddress(hLibrary, "lib3mf_release"); + #else // _WIN32 + pWrapperTable->m_Release = (PLib3MFReleasePtr) dlsym(hLibrary, "lib3mf_release"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Release == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamlattice_setrepresentation", (void**)&(pWrapperTable->m_BeamLattice_SetRepresentation)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_SetRepresentation == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_Acquire = (PLib3MFAcquirePtr) GetProcAddress(hLibrary, "lib3mf_acquire"); + #else // _WIN32 + pWrapperTable->m_Acquire = (PLib3MFAcquirePtr) dlsym(hLibrary, "lib3mf_acquire"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Acquire == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamlattice_getballoptions", (void**)&(pWrapperTable->m_BeamLattice_GetBallOptions)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetBallOptions == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_SetJournal = (PLib3MFSetJournalPtr) GetProcAddress(hLibrary, "lib3mf_setjournal"); + #else // _WIN32 + pWrapperTable->m_SetJournal = (PLib3MFSetJournalPtr) dlsym(hLibrary, "lib3mf_setjournal"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_SetJournal == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamlattice_setballoptions", (void**)&(pWrapperTable->m_BeamLattice_SetBallOptions)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_SetBallOptions == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_GetLastError = (PLib3MFGetLastErrorPtr) GetProcAddress(hLibrary, "lib3mf_getlasterror"); + #else // _WIN32 + pWrapperTable->m_GetLastError = (PLib3MFGetLastErrorPtr) dlsym(hLibrary, "lib3mf_getlasterror"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_GetLastError == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamlattice_getbeamcount", (void**)&(pWrapperTable->m_BeamLattice_GetBeamCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetBeamCount == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_GetSymbolLookupMethod = (PLib3MFGetSymbolLookupMethodPtr) GetProcAddress(hLibrary, "lib3mf_getsymbollookupmethod"); + #else // _WIN32 + pWrapperTable->m_GetSymbolLookupMethod = (PLib3MFGetSymbolLookupMethodPtr) dlsym(hLibrary, "lib3mf_getsymbollookupmethod"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_GetSymbolLookupMethod == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamlattice_getbeam", (void**)&(pWrapperTable->m_BeamLattice_GetBeam)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetBeam == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_RetrieveProgressMessage = (PLib3MFRetrieveProgressMessagePtr) GetProcAddress(hLibrary, "lib3mf_retrieveprogressmessage"); + #else // _WIN32 + pWrapperTable->m_RetrieveProgressMessage = (PLib3MFRetrieveProgressMessagePtr) dlsym(hLibrary, "lib3mf_retrieveprogressmessage"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_RetrieveProgressMessage == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamlattice_addbeam", (void**)&(pWrapperTable->m_BeamLattice_AddBeam)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_AddBeam == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_RGBAToColor = (PLib3MFRGBAToColorPtr) GetProcAddress(hLibrary, "lib3mf_rgbatocolor"); + #else // _WIN32 + pWrapperTable->m_RGBAToColor = (PLib3MFRGBAToColorPtr) dlsym(hLibrary, "lib3mf_rgbatocolor"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_RGBAToColor == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamlattice_setbeam", (void**)&(pWrapperTable->m_BeamLattice_SetBeam)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_SetBeam == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_FloatRGBAToColor = (PLib3MFFloatRGBAToColorPtr) GetProcAddress(hLibrary, "lib3mf_floatrgbatocolor"); + #else // _WIN32 + pWrapperTable->m_FloatRGBAToColor = (PLib3MFFloatRGBAToColorPtr) dlsym(hLibrary, "lib3mf_floatrgbatocolor"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_FloatRGBAToColor == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamlattice_setbeams", (void**)&(pWrapperTable->m_BeamLattice_SetBeams)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_SetBeams == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_ColorToRGBA = (PLib3MFColorToRGBAPtr) GetProcAddress(hLibrary, "lib3mf_colortorgba"); + #else // _WIN32 + pWrapperTable->m_ColorToRGBA = (PLib3MFColorToRGBAPtr) dlsym(hLibrary, "lib3mf_colortorgba"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ColorToRGBA == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamlattice_getbeams", (void**)&(pWrapperTable->m_BeamLattice_GetBeams)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetBeams == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_ColorToFloatRGBA = (PLib3MFColorToFloatRGBAPtr) GetProcAddress(hLibrary, "lib3mf_colortofloatrgba"); + #else // _WIN32 + pWrapperTable->m_ColorToFloatRGBA = (PLib3MFColorToFloatRGBAPtr) dlsym(hLibrary, "lib3mf_colortofloatrgba"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ColorToFloatRGBA == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamlattice_getballcount", (void**)&(pWrapperTable->m_BeamLattice_GetBallCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetBallCount == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_GetIdentityTransform = (PLib3MFGetIdentityTransformPtr) GetProcAddress(hLibrary, "lib3mf_getidentitytransform"); + #else // _WIN32 + pWrapperTable->m_GetIdentityTransform = (PLib3MFGetIdentityTransformPtr) dlsym(hLibrary, "lib3mf_getidentitytransform"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_GetIdentityTransform == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamlattice_getball", (void**)&(pWrapperTable->m_BeamLattice_GetBall)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetBall == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_GetUniformScaleTransform = (PLib3MFGetUniformScaleTransformPtr) GetProcAddress(hLibrary, "lib3mf_getuniformscaletransform"); + #else // _WIN32 + pWrapperTable->m_GetUniformScaleTransform = (PLib3MFGetUniformScaleTransformPtr) dlsym(hLibrary, "lib3mf_getuniformscaletransform"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_GetUniformScaleTransform == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamlattice_addball", (void**)&(pWrapperTable->m_BeamLattice_AddBall)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_AddBall == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_GetScaleTransform = (PLib3MFGetScaleTransformPtr) GetProcAddress(hLibrary, "lib3mf_getscaletransform"); + #else // _WIN32 + pWrapperTable->m_GetScaleTransform = (PLib3MFGetScaleTransformPtr) dlsym(hLibrary, "lib3mf_getscaletransform"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_GetScaleTransform == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamlattice_setball", (void**)&(pWrapperTable->m_BeamLattice_SetBall)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_SetBall == nullptr) ) + #ifdef _WIN32 + pWrapperTable->m_GetTranslationTransform = (PLib3MFGetTranslationTransformPtr) GetProcAddress(hLibrary, "lib3mf_gettranslationtransform"); + #else // _WIN32 + pWrapperTable->m_GetTranslationTransform = (PLib3MFGetTranslationTransformPtr) dlsym(hLibrary, "lib3mf_gettranslationtransform"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_GetTranslationTransform == nullptr) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamlattice_setballs", (void**)&(pWrapperTable->m_BeamLattice_SetBalls)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_SetBalls == nullptr) ) - return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + pWrapperTable->m_LibraryHandle = hLibrary; + return LIB3MF_SUCCESS; + } + + inline Lib3MFResult CWrapper::loadWrapperTableFromSymbolLookupMethod(sLib3MFDynamicWrapperTable * pWrapperTable, void* pSymbolLookupMethod) +{ + if (pWrapperTable == nullptr) + return LIB3MF_ERROR_INVALIDPARAM; + if (pSymbolLookupMethod == nullptr) + return LIB3MF_ERROR_INVALIDPARAM; - eLookupError = (*pLookup)("lib3mf_beamlattice_getballs", (void**)&(pWrapperTable->m_BeamLattice_GetBalls)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetBalls == nullptr) ) - return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + typedef Lib3MFResult(*SymbolLookupType)(const char*, void**); - eLookupError = (*pLookup)("lib3mf_beamlattice_getbeamsetcount", (void**)&(pWrapperTable->m_BeamLattice_GetBeamSetCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetBeamSetCount == nullptr) ) - return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + SymbolLookupType pLookup = (SymbolLookupType)pSymbolLookupMethod; - eLookupError = (*pLookup)("lib3mf_beamlattice_addbeamset", (void**)&(pWrapperTable->m_BeamLattice_AddBeamSet)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_AddBeamSet == nullptr) ) + Lib3MFResult eLookupError = LIB3MF_SUCCESS; + eLookupError = (*pLookup)("lib3mf_base_classtypeid", (void**)&(pWrapperTable->m_Base_ClassTypeId)); + if ( (eLookupError != 0) || (pWrapperTable->m_Base_ClassTypeId == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamlattice_getbeamset", (void**)&(pWrapperTable->m_BeamLattice_GetBeamSet)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetBeamSet == nullptr) ) + eLookupError = (*pLookup)("lib3mf_binarystream_getbinarypath", (void**)&(pWrapperTable->m_BinaryStream_GetBinaryPath)); + if ( (eLookupError != 0) || (pWrapperTable->m_BinaryStream_GetBinaryPath == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_component_getobjectresource", (void**)&(pWrapperTable->m_Component_GetObjectResource)); - if ( (eLookupError != 0) || (pWrapperTable->m_Component_GetObjectResource == nullptr) ) + eLookupError = (*pLookup)("lib3mf_binarystream_getindexpath", (void**)&(pWrapperTable->m_BinaryStream_GetIndexPath)); + if ( (eLookupError != 0) || (pWrapperTable->m_BinaryStream_GetIndexPath == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_component_getobjectresourceid", (void**)&(pWrapperTable->m_Component_GetObjectResourceID)); - if ( (eLookupError != 0) || (pWrapperTable->m_Component_GetObjectResourceID == nullptr) ) + eLookupError = (*pLookup)("lib3mf_binarystream_getuuid", (void**)&(pWrapperTable->m_BinaryStream_GetUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_BinaryStream_GetUUID == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_component_getuuid", (void**)&(pWrapperTable->m_Component_GetUUID)); - if ( (eLookupError != 0) || (pWrapperTable->m_Component_GetUUID == nullptr) ) + eLookupError = (*pLookup)("lib3mf_binarystream_disablediscretizedarraycompression", (void**)&(pWrapperTable->m_BinaryStream_DisableDiscretizedArrayCompression)); + if ( (eLookupError != 0) || (pWrapperTable->m_BinaryStream_DisableDiscretizedArrayCompression == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_component_setuuid", (void**)&(pWrapperTable->m_Component_SetUUID)); - if ( (eLookupError != 0) || (pWrapperTable->m_Component_SetUUID == nullptr) ) + eLookupError = (*pLookup)("lib3mf_binarystream_enablediscretizedarraycompression", (void**)&(pWrapperTable->m_BinaryStream_EnableDiscretizedArrayCompression)); + if ( (eLookupError != 0) || (pWrapperTable->m_BinaryStream_EnableDiscretizedArrayCompression == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_component_hastransform", (void**)&(pWrapperTable->m_Component_HasTransform)); - if ( (eLookupError != 0) || (pWrapperTable->m_Component_HasTransform == nullptr) ) + eLookupError = (*pLookup)("lib3mf_binarystream_enablelzma", (void**)&(pWrapperTable->m_BinaryStream_EnableLZMA)); + if ( (eLookupError != 0) || (pWrapperTable->m_BinaryStream_EnableLZMA == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_component_gettransform", (void**)&(pWrapperTable->m_Component_GetTransform)); - if ( (eLookupError != 0) || (pWrapperTable->m_Component_GetTransform == nullptr) ) + eLookupError = (*pLookup)("lib3mf_binarystream_disablelzma", (void**)&(pWrapperTable->m_BinaryStream_DisableLZMA)); + if ( (eLookupError != 0) || (pWrapperTable->m_BinaryStream_DisableLZMA == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_component_settransform", (void**)&(pWrapperTable->m_Component_SetTransform)); - if ( (eLookupError != 0) || (pWrapperTable->m_Component_SetTransform == nullptr) ) + eLookupError = (*pLookup)("lib3mf_writer_writetofile", (void**)&(pWrapperTable->m_Writer_WriteToFile)); + if ( (eLookupError != 0) || (pWrapperTable->m_Writer_WriteToFile == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_componentsobject_addcomponent", (void**)&(pWrapperTable->m_ComponentsObject_AddComponent)); - if ( (eLookupError != 0) || (pWrapperTable->m_ComponentsObject_AddComponent == nullptr) ) + eLookupError = (*pLookup)("lib3mf_writer_getstreamsize", (void**)&(pWrapperTable->m_Writer_GetStreamSize)); + if ( (eLookupError != 0) || (pWrapperTable->m_Writer_GetStreamSize == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_componentsobject_getcomponent", (void**)&(pWrapperTable->m_ComponentsObject_GetComponent)); - if ( (eLookupError != 0) || (pWrapperTable->m_ComponentsObject_GetComponent == nullptr) ) + eLookupError = (*pLookup)("lib3mf_writer_writetobuffer", (void**)&(pWrapperTable->m_Writer_WriteToBuffer)); + if ( (eLookupError != 0) || (pWrapperTable->m_Writer_WriteToBuffer == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_componentsobject_getcomponentcount", (void**)&(pWrapperTable->m_ComponentsObject_GetComponentCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_ComponentsObject_GetComponentCount == nullptr) ) + eLookupError = (*pLookup)("lib3mf_writer_writetocallback", (void**)&(pWrapperTable->m_Writer_WriteToCallback)); + if ( (eLookupError != 0) || (pWrapperTable->m_Writer_WriteToCallback == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamset_setname", (void**)&(pWrapperTable->m_BeamSet_SetName)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamSet_SetName == nullptr) ) + eLookupError = (*pLookup)("lib3mf_writer_setprogresscallback", (void**)&(pWrapperTable->m_Writer_SetProgressCallback)); + if ( (eLookupError != 0) || (pWrapperTable->m_Writer_SetProgressCallback == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamset_getname", (void**)&(pWrapperTable->m_BeamSet_GetName)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamSet_GetName == nullptr) ) + eLookupError = (*pLookup)("lib3mf_writer_getdecimalprecision", (void**)&(pWrapperTable->m_Writer_GetDecimalPrecision)); + if ( (eLookupError != 0) || (pWrapperTable->m_Writer_GetDecimalPrecision == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamset_setidentifier", (void**)&(pWrapperTable->m_BeamSet_SetIdentifier)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamSet_SetIdentifier == nullptr) ) + eLookupError = (*pLookup)("lib3mf_writer_setdecimalprecision", (void**)&(pWrapperTable->m_Writer_SetDecimalPrecision)); + if ( (eLookupError != 0) || (pWrapperTable->m_Writer_SetDecimalPrecision == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamset_getidentifier", (void**)&(pWrapperTable->m_BeamSet_GetIdentifier)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamSet_GetIdentifier == nullptr) ) + eLookupError = (*pLookup)("lib3mf_writer_setstrictmodeactive", (void**)&(pWrapperTable->m_Writer_SetStrictModeActive)); + if ( (eLookupError != 0) || (pWrapperTable->m_Writer_SetStrictModeActive == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamset_getreferencecount", (void**)&(pWrapperTable->m_BeamSet_GetReferenceCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamSet_GetReferenceCount == nullptr) ) + eLookupError = (*pLookup)("lib3mf_writer_getstrictmodeactive", (void**)&(pWrapperTable->m_Writer_GetStrictModeActive)); + if ( (eLookupError != 0) || (pWrapperTable->m_Writer_GetStrictModeActive == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamset_setreferences", (void**)&(pWrapperTable->m_BeamSet_SetReferences)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamSet_SetReferences == nullptr) ) + eLookupError = (*pLookup)("lib3mf_writer_getwarning", (void**)&(pWrapperTable->m_Writer_GetWarning)); + if ( (eLookupError != 0) || (pWrapperTable->m_Writer_GetWarning == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamset_getreferences", (void**)&(pWrapperTable->m_BeamSet_GetReferences)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamSet_GetReferences == nullptr) ) + eLookupError = (*pLookup)("lib3mf_writer_getwarningcount", (void**)&(pWrapperTable->m_Writer_GetWarningCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_Writer_GetWarningCount == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamset_getballreferencecount", (void**)&(pWrapperTable->m_BeamSet_GetBallReferenceCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamSet_GetBallReferenceCount == nullptr) ) + eLookupError = (*pLookup)("lib3mf_writer_addkeywrappingcallback", (void**)&(pWrapperTable->m_Writer_AddKeyWrappingCallback)); + if ( (eLookupError != 0) || (pWrapperTable->m_Writer_AddKeyWrappingCallback == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamset_setballreferences", (void**)&(pWrapperTable->m_BeamSet_SetBallReferences)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamSet_SetBallReferences == nullptr) ) + eLookupError = (*pLookup)("lib3mf_writer_setcontentencryptioncallback", (void**)&(pWrapperTable->m_Writer_SetContentEncryptionCallback)); + if ( (eLookupError != 0) || (pWrapperTable->m_Writer_SetContentEncryptionCallback == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_beamset_getballreferences", (void**)&(pWrapperTable->m_BeamSet_GetBallReferences)); - if ( (eLookupError != 0) || (pWrapperTable->m_BeamSet_GetBallReferences == nullptr) ) + eLookupError = (*pLookup)("lib3mf_writer_createbinarystream", (void**)&(pWrapperTable->m_Writer_CreateBinaryStream)); + if ( (eLookupError != 0) || (pWrapperTable->m_Writer_CreateBinaryStream == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_basematerialgroup_getcount", (void**)&(pWrapperTable->m_BaseMaterialGroup_GetCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_BaseMaterialGroup_GetCount == nullptr) ) + eLookupError = (*pLookup)("lib3mf_writer_assignbinarystream", (void**)&(pWrapperTable->m_Writer_AssignBinaryStream)); + if ( (eLookupError != 0) || (pWrapperTable->m_Writer_AssignBinaryStream == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_basematerialgroup_getallpropertyids", (void**)&(pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs)); - if ( (eLookupError != 0) || (pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs == nullptr) ) + eLookupError = (*pLookup)("lib3mf_writer_registercustomnamespace", (void**)&(pWrapperTable->m_Writer_RegisterCustomNamespace)); + if ( (eLookupError != 0) || (pWrapperTable->m_Writer_RegisterCustomNamespace == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_basematerialgroup_addmaterial", (void**)&(pWrapperTable->m_BaseMaterialGroup_AddMaterial)); - if ( (eLookupError != 0) || (pWrapperTable->m_BaseMaterialGroup_AddMaterial == nullptr) ) + eLookupError = (*pLookup)("lib3mf_persistentreadersource_getsourcetype", (void**)&(pWrapperTable->m_PersistentReaderSource_GetSourceType)); + if ( (eLookupError != 0) || (pWrapperTable->m_PersistentReaderSource_GetSourceType == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_basematerialgroup_removematerial", (void**)&(pWrapperTable->m_BaseMaterialGroup_RemoveMaterial)); - if ( (eLookupError != 0) || (pWrapperTable->m_BaseMaterialGroup_RemoveMaterial == nullptr) ) + eLookupError = (*pLookup)("lib3mf_persistentreadersource_invalidatesourcedata", (void**)&(pWrapperTable->m_PersistentReaderSource_InvalidateSourceData)); + if ( (eLookupError != 0) || (pWrapperTable->m_PersistentReaderSource_InvalidateSourceData == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_basematerialgroup_getname", (void**)&(pWrapperTable->m_BaseMaterialGroup_GetName)); - if ( (eLookupError != 0) || (pWrapperTable->m_BaseMaterialGroup_GetName == nullptr) ) + eLookupError = (*pLookup)("lib3mf_persistentreadersource_sourcedataisvalid", (void**)&(pWrapperTable->m_PersistentReaderSource_SourceDataIsValid)); + if ( (eLookupError != 0) || (pWrapperTable->m_PersistentReaderSource_SourceDataIsValid == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_basematerialgroup_setname", (void**)&(pWrapperTable->m_BaseMaterialGroup_SetName)); - if ( (eLookupError != 0) || (pWrapperTable->m_BaseMaterialGroup_SetName == nullptr) ) + eLookupError = (*pLookup)("lib3mf_reader_readfrompersistentsource", (void**)&(pWrapperTable->m_Reader_ReadFromPersistentSource)); + if ( (eLookupError != 0) || (pWrapperTable->m_Reader_ReadFromPersistentSource == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_basematerialgroup_setdisplaycolor", (void**)&(pWrapperTable->m_BaseMaterialGroup_SetDisplayColor)); - if ( (eLookupError != 0) || (pWrapperTable->m_BaseMaterialGroup_SetDisplayColor == nullptr) ) + eLookupError = (*pLookup)("lib3mf_reader_readfromfile", (void**)&(pWrapperTable->m_Reader_ReadFromFile)); + if ( (eLookupError != 0) || (pWrapperTable->m_Reader_ReadFromFile == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_basematerialgroup_getdisplaycolor", (void**)&(pWrapperTable->m_BaseMaterialGroup_GetDisplayColor)); - if ( (eLookupError != 0) || (pWrapperTable->m_BaseMaterialGroup_GetDisplayColor == nullptr) ) + eLookupError = (*pLookup)("lib3mf_reader_readfrombuffer", (void**)&(pWrapperTable->m_Reader_ReadFromBuffer)); + if ( (eLookupError != 0) || (pWrapperTable->m_Reader_ReadFromBuffer == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_colorgroup_getcount", (void**)&(pWrapperTable->m_ColorGroup_GetCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_ColorGroup_GetCount == nullptr) ) + eLookupError = (*pLookup)("lib3mf_reader_readfromcallback", (void**)&(pWrapperTable->m_Reader_ReadFromCallback)); + if ( (eLookupError != 0) || (pWrapperTable->m_Reader_ReadFromCallback == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_colorgroup_getallpropertyids", (void**)&(pWrapperTable->m_ColorGroup_GetAllPropertyIDs)); - if ( (eLookupError != 0) || (pWrapperTable->m_ColorGroup_GetAllPropertyIDs == nullptr) ) + eLookupError = (*pLookup)("lib3mf_reader_setprogresscallback", (void**)&(pWrapperTable->m_Reader_SetProgressCallback)); + if ( (eLookupError != 0) || (pWrapperTable->m_Reader_SetProgressCallback == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_colorgroup_addcolor", (void**)&(pWrapperTable->m_ColorGroup_AddColor)); - if ( (eLookupError != 0) || (pWrapperTable->m_ColorGroup_AddColor == nullptr) ) + eLookupError = (*pLookup)("lib3mf_reader_addrelationtoread", (void**)&(pWrapperTable->m_Reader_AddRelationToRead)); + if ( (eLookupError != 0) || (pWrapperTable->m_Reader_AddRelationToRead == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_colorgroup_removecolor", (void**)&(pWrapperTable->m_ColorGroup_RemoveColor)); - if ( (eLookupError != 0) || (pWrapperTable->m_ColorGroup_RemoveColor == nullptr) ) + eLookupError = (*pLookup)("lib3mf_reader_removerelationtoread", (void**)&(pWrapperTable->m_Reader_RemoveRelationToRead)); + if ( (eLookupError != 0) || (pWrapperTable->m_Reader_RemoveRelationToRead == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_colorgroup_setcolor", (void**)&(pWrapperTable->m_ColorGroup_SetColor)); - if ( (eLookupError != 0) || (pWrapperTable->m_ColorGroup_SetColor == nullptr) ) + eLookupError = (*pLookup)("lib3mf_reader_setstrictmodeactive", (void**)&(pWrapperTable->m_Reader_SetStrictModeActive)); + if ( (eLookupError != 0) || (pWrapperTable->m_Reader_SetStrictModeActive == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_colorgroup_getcolor", (void**)&(pWrapperTable->m_ColorGroup_GetColor)); - if ( (eLookupError != 0) || (pWrapperTable->m_ColorGroup_GetColor == nullptr) ) + eLookupError = (*pLookup)("lib3mf_reader_getstrictmodeactive", (void**)&(pWrapperTable->m_Reader_GetStrictModeActive)); + if ( (eLookupError != 0) || (pWrapperTable->m_Reader_GetStrictModeActive == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_texture2dgroup_getcount", (void**)&(pWrapperTable->m_Texture2DGroup_GetCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_Texture2DGroup_GetCount == nullptr) ) + eLookupError = (*pLookup)("lib3mf_reader_getwarning", (void**)&(pWrapperTable->m_Reader_GetWarning)); + if ( (eLookupError != 0) || (pWrapperTable->m_Reader_GetWarning == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_texture2dgroup_getallpropertyids", (void**)&(pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs)); - if ( (eLookupError != 0) || (pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs == nullptr) ) + eLookupError = (*pLookup)("lib3mf_reader_getwarningcount", (void**)&(pWrapperTable->m_Reader_GetWarningCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_Reader_GetWarningCount == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_texture2dgroup_addtex2coord", (void**)&(pWrapperTable->m_Texture2DGroup_AddTex2Coord)); - if ( (eLookupError != 0) || (pWrapperTable->m_Texture2DGroup_AddTex2Coord == nullptr) ) + eLookupError = (*pLookup)("lib3mf_reader_addkeywrappingcallback", (void**)&(pWrapperTable->m_Reader_AddKeyWrappingCallback)); + if ( (eLookupError != 0) || (pWrapperTable->m_Reader_AddKeyWrappingCallback == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_texture2dgroup_gettex2coord", (void**)&(pWrapperTable->m_Texture2DGroup_GetTex2Coord)); - if ( (eLookupError != 0) || (pWrapperTable->m_Texture2DGroup_GetTex2Coord == nullptr) ) + eLookupError = (*pLookup)("lib3mf_reader_setcontentencryptioncallback", (void**)&(pWrapperTable->m_Reader_SetContentEncryptionCallback)); + if ( (eLookupError != 0) || (pWrapperTable->m_Reader_SetContentEncryptionCallback == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_texture2dgroup_removetex2coord", (void**)&(pWrapperTable->m_Texture2DGroup_RemoveTex2Coord)); - if ( (eLookupError != 0) || (pWrapperTable->m_Texture2DGroup_RemoveTex2Coord == nullptr) ) + eLookupError = (*pLookup)("lib3mf_packagepart_getpath", (void**)&(pWrapperTable->m_PackagePart_GetPath)); + if ( (eLookupError != 0) || (pWrapperTable->m_PackagePart_GetPath == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_texture2dgroup_gettexture2d", (void**)&(pWrapperTable->m_Texture2DGroup_GetTexture2D)); - if ( (eLookupError != 0) || (pWrapperTable->m_Texture2DGroup_GetTexture2D == nullptr) ) + eLookupError = (*pLookup)("lib3mf_packagepart_setpath", (void**)&(pWrapperTable->m_PackagePart_SetPath)); + if ( (eLookupError != 0) || (pWrapperTable->m_PackagePart_SetPath == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_compositematerials_getcount", (void**)&(pWrapperTable->m_CompositeMaterials_GetCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_CompositeMaterials_GetCount == nullptr) ) + eLookupError = (*pLookup)("lib3mf_resource_getresourceid", (void**)&(pWrapperTable->m_Resource_GetResourceID)); + if ( (eLookupError != 0) || (pWrapperTable->m_Resource_GetResourceID == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_compositematerials_getallpropertyids", (void**)&(pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs)); - if ( (eLookupError != 0) || (pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs == nullptr) ) + eLookupError = (*pLookup)("lib3mf_resource_getuniqueresourceid", (void**)&(pWrapperTable->m_Resource_GetUniqueResourceID)); + if ( (eLookupError != 0) || (pWrapperTable->m_Resource_GetUniqueResourceID == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_compositematerials_getbasematerialgroup", (void**)&(pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup)); - if ( (eLookupError != 0) || (pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup == nullptr) ) + eLookupError = (*pLookup)("lib3mf_resource_packagepart", (void**)&(pWrapperTable->m_Resource_PackagePart)); + if ( (eLookupError != 0) || (pWrapperTable->m_Resource_PackagePart == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_compositematerials_addcomposite", (void**)&(pWrapperTable->m_CompositeMaterials_AddComposite)); - if ( (eLookupError != 0) || (pWrapperTable->m_CompositeMaterials_AddComposite == nullptr) ) + eLookupError = (*pLookup)("lib3mf_resource_setpackagepart", (void**)&(pWrapperTable->m_Resource_SetPackagePart)); + if ( (eLookupError != 0) || (pWrapperTable->m_Resource_SetPackagePart == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_compositematerials_removecomposite", (void**)&(pWrapperTable->m_CompositeMaterials_RemoveComposite)); - if ( (eLookupError != 0) || (pWrapperTable->m_CompositeMaterials_RemoveComposite == nullptr) ) + eLookupError = (*pLookup)("lib3mf_resource_getmodelresourceid", (void**)&(pWrapperTable->m_Resource_GetModelResourceID)); + if ( (eLookupError != 0) || (pWrapperTable->m_Resource_GetModelResourceID == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_compositematerials_getcomposite", (void**)&(pWrapperTable->m_CompositeMaterials_GetComposite)); - if ( (eLookupError != 0) || (pWrapperTable->m_CompositeMaterials_GetComposite == nullptr) ) + eLookupError = (*pLookup)("lib3mf_resourceiterator_movenext", (void**)&(pWrapperTable->m_ResourceIterator_MoveNext)); + if ( (eLookupError != 0) || (pWrapperTable->m_ResourceIterator_MoveNext == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_multipropertygroup_getcount", (void**)&(pWrapperTable->m_MultiPropertyGroup_GetCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_MultiPropertyGroup_GetCount == nullptr) ) + eLookupError = (*pLookup)("lib3mf_resourceiterator_moveprevious", (void**)&(pWrapperTable->m_ResourceIterator_MovePrevious)); + if ( (eLookupError != 0) || (pWrapperTable->m_ResourceIterator_MovePrevious == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_multipropertygroup_getallpropertyids", (void**)&(pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs)); - if ( (eLookupError != 0) || (pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs == nullptr) ) + eLookupError = (*pLookup)("lib3mf_resourceiterator_getcurrent", (void**)&(pWrapperTable->m_ResourceIterator_GetCurrent)); + if ( (eLookupError != 0) || (pWrapperTable->m_ResourceIterator_GetCurrent == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_multipropertygroup_addmultiproperty", (void**)&(pWrapperTable->m_MultiPropertyGroup_AddMultiProperty)); - if ( (eLookupError != 0) || (pWrapperTable->m_MultiPropertyGroup_AddMultiProperty == nullptr) ) + eLookupError = (*pLookup)("lib3mf_resourceiterator_clone", (void**)&(pWrapperTable->m_ResourceIterator_Clone)); + if ( (eLookupError != 0) || (pWrapperTable->m_ResourceIterator_Clone == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_multipropertygroup_setmultiproperty", (void**)&(pWrapperTable->m_MultiPropertyGroup_SetMultiProperty)); - if ( (eLookupError != 0) || (pWrapperTable->m_MultiPropertyGroup_SetMultiProperty == nullptr) ) + eLookupError = (*pLookup)("lib3mf_resourceiterator_count", (void**)&(pWrapperTable->m_ResourceIterator_Count)); + if ( (eLookupError != 0) || (pWrapperTable->m_ResourceIterator_Count == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_multipropertygroup_getmultiproperty", (void**)&(pWrapperTable->m_MultiPropertyGroup_GetMultiProperty)); - if ( (eLookupError != 0) || (pWrapperTable->m_MultiPropertyGroup_GetMultiProperty == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlattribute_getname", (void**)&(pWrapperTable->m_CustomXMLAttribute_GetName)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLAttribute_GetName == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_multipropertygroup_removemultiproperty", (void**)&(pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty)); - if ( (eLookupError != 0) || (pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlattribute_getvalue", (void**)&(pWrapperTable->m_CustomXMLAttribute_GetValue)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLAttribute_GetValue == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_multipropertygroup_getlayercount", (void**)&(pWrapperTable->m_MultiPropertyGroup_GetLayerCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_MultiPropertyGroup_GetLayerCount == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlattribute_isvalidinteger", (void**)&(pWrapperTable->m_CustomXMLAttribute_IsValidInteger)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLAttribute_IsValidInteger == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_multipropertygroup_addlayer", (void**)&(pWrapperTable->m_MultiPropertyGroup_AddLayer)); - if ( (eLookupError != 0) || (pWrapperTable->m_MultiPropertyGroup_AddLayer == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlattribute_getintegervalue", (void**)&(pWrapperTable->m_CustomXMLAttribute_GetIntegerValue)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLAttribute_GetIntegerValue == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_multipropertygroup_getlayer", (void**)&(pWrapperTable->m_MultiPropertyGroup_GetLayer)); - if ( (eLookupError != 0) || (pWrapperTable->m_MultiPropertyGroup_GetLayer == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlattribute_isvaliddouble", (void**)&(pWrapperTable->m_CustomXMLAttribute_IsValidDouble)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLAttribute_IsValidDouble == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_multipropertygroup_removelayer", (void**)&(pWrapperTable->m_MultiPropertyGroup_RemoveLayer)); - if ( (eLookupError != 0) || (pWrapperTable->m_MultiPropertyGroup_RemoveLayer == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlattribute_getdoublevalue", (void**)&(pWrapperTable->m_CustomXMLAttribute_GetDoubleValue)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLAttribute_GetDoubleValue == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_attachment_getpath", (void**)&(pWrapperTable->m_Attachment_GetPath)); - if ( (eLookupError != 0) || (pWrapperTable->m_Attachment_GetPath == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlattribute_isvalidbool", (void**)&(pWrapperTable->m_CustomXMLAttribute_IsValidBool)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLAttribute_IsValidBool == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_attachment_setpath", (void**)&(pWrapperTable->m_Attachment_SetPath)); - if ( (eLookupError != 0) || (pWrapperTable->m_Attachment_SetPath == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlattribute_getboolvalue", (void**)&(pWrapperTable->m_CustomXMLAttribute_GetBoolValue)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLAttribute_GetBoolValue == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_attachment_packagepart", (void**)&(pWrapperTable->m_Attachment_PackagePart)); - if ( (eLookupError != 0) || (pWrapperTable->m_Attachment_PackagePart == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlattribute_setvalue", (void**)&(pWrapperTable->m_CustomXMLAttribute_SetValue)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLAttribute_SetValue == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_attachment_getrelationshiptype", (void**)&(pWrapperTable->m_Attachment_GetRelationShipType)); - if ( (eLookupError != 0) || (pWrapperTable->m_Attachment_GetRelationShipType == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlattribute_setintegervalue", (void**)&(pWrapperTable->m_CustomXMLAttribute_SetIntegerValue)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLAttribute_SetIntegerValue == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_attachment_setrelationshiptype", (void**)&(pWrapperTable->m_Attachment_SetRelationShipType)); - if ( (eLookupError != 0) || (pWrapperTable->m_Attachment_SetRelationShipType == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlattribute_setdoublevalue", (void**)&(pWrapperTable->m_CustomXMLAttribute_SetDoubleValue)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLAttribute_SetDoubleValue == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_attachment_writetofile", (void**)&(pWrapperTable->m_Attachment_WriteToFile)); - if ( (eLookupError != 0) || (pWrapperTable->m_Attachment_WriteToFile == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlattribute_setboolvalue", (void**)&(pWrapperTable->m_CustomXMLAttribute_SetBoolValue)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLAttribute_SetBoolValue == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_attachment_readfromfile", (void**)&(pWrapperTable->m_Attachment_ReadFromFile)); - if ( (eLookupError != 0) || (pWrapperTable->m_Attachment_ReadFromFile == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlattribute_remove", (void**)&(pWrapperTable->m_CustomXMLAttribute_Remove)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLAttribute_Remove == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_attachment_readfromcallback", (void**)&(pWrapperTable->m_Attachment_ReadFromCallback)); - if ( (eLookupError != 0) || (pWrapperTable->m_Attachment_ReadFromCallback == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnode_getname", (void**)&(pWrapperTable->m_CustomXMLNode_GetName)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNode_GetName == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_attachment_getstreamsize", (void**)&(pWrapperTable->m_Attachment_GetStreamSize)); - if ( (eLookupError != 0) || (pWrapperTable->m_Attachment_GetStreamSize == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnode_getnamespace", (void**)&(pWrapperTable->m_CustomXMLNode_GetNameSpace)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNode_GetNameSpace == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_attachment_writetobuffer", (void**)&(pWrapperTable->m_Attachment_WriteToBuffer)); - if ( (eLookupError != 0) || (pWrapperTable->m_Attachment_WriteToBuffer == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnode_getattributecount", (void**)&(pWrapperTable->m_CustomXMLNode_GetAttributeCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNode_GetAttributeCount == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_attachment_readfrombuffer", (void**)&(pWrapperTable->m_Attachment_ReadFromBuffer)); - if ( (eLookupError != 0) || (pWrapperTable->m_Attachment_ReadFromBuffer == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnode_getattribute", (void**)&(pWrapperTable->m_CustomXMLNode_GetAttribute)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNode_GetAttribute == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_texture2d_getattachment", (void**)&(pWrapperTable->m_Texture2D_GetAttachment)); - if ( (eLookupError != 0) || (pWrapperTable->m_Texture2D_GetAttachment == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnode_hasattribute", (void**)&(pWrapperTable->m_CustomXMLNode_HasAttribute)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNode_HasAttribute == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_texture2d_setattachment", (void**)&(pWrapperTable->m_Texture2D_SetAttachment)); - if ( (eLookupError != 0) || (pWrapperTable->m_Texture2D_SetAttachment == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnode_findattribute", (void**)&(pWrapperTable->m_CustomXMLNode_FindAttribute)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNode_FindAttribute == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_texture2d_getcontenttype", (void**)&(pWrapperTable->m_Texture2D_GetContentType)); - if ( (eLookupError != 0) || (pWrapperTable->m_Texture2D_GetContentType == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnode_removeattribute", (void**)&(pWrapperTable->m_CustomXMLNode_RemoveAttribute)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNode_RemoveAttribute == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_texture2d_setcontenttype", (void**)&(pWrapperTable->m_Texture2D_SetContentType)); - if ( (eLookupError != 0) || (pWrapperTable->m_Texture2D_SetContentType == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnode_removeattributebyindex", (void**)&(pWrapperTable->m_CustomXMLNode_RemoveAttributeByIndex)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNode_RemoveAttributeByIndex == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_texture2d_gettilestyleuv", (void**)&(pWrapperTable->m_Texture2D_GetTileStyleUV)); - if ( (eLookupError != 0) || (pWrapperTable->m_Texture2D_GetTileStyleUV == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnode_addattribute", (void**)&(pWrapperTable->m_CustomXMLNode_AddAttribute)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNode_AddAttribute == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_texture2d_settilestyleuv", (void**)&(pWrapperTable->m_Texture2D_SetTileStyleUV)); - if ( (eLookupError != 0) || (pWrapperTable->m_Texture2D_SetTileStyleUV == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnode_addintegerattribute", (void**)&(pWrapperTable->m_CustomXMLNode_AddIntegerAttribute)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNode_AddIntegerAttribute == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_texture2d_getfilter", (void**)&(pWrapperTable->m_Texture2D_GetFilter)); - if ( (eLookupError != 0) || (pWrapperTable->m_Texture2D_GetFilter == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnode_adddoubleattribute", (void**)&(pWrapperTable->m_CustomXMLNode_AddDoubleAttribute)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNode_AddDoubleAttribute == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_texture2d_setfilter", (void**)&(pWrapperTable->m_Texture2D_SetFilter)); - if ( (eLookupError != 0) || (pWrapperTable->m_Texture2D_SetFilter == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnode_addboolattribute", (void**)&(pWrapperTable->m_CustomXMLNode_AddBoolAttribute)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNode_AddBoolAttribute == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_builditem_getobjectresource", (void**)&(pWrapperTable->m_BuildItem_GetObjectResource)); - if ( (eLookupError != 0) || (pWrapperTable->m_BuildItem_GetObjectResource == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnode_getchildren", (void**)&(pWrapperTable->m_CustomXMLNode_GetChildren)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNode_GetChildren == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_builditem_getuuid", (void**)&(pWrapperTable->m_BuildItem_GetUUID)); - if ( (eLookupError != 0) || (pWrapperTable->m_BuildItem_GetUUID == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnode_countchildrenbyname", (void**)&(pWrapperTable->m_CustomXMLNode_CountChildrenByName)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNode_CountChildrenByName == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_builditem_setuuid", (void**)&(pWrapperTable->m_BuildItem_SetUUID)); - if ( (eLookupError != 0) || (pWrapperTable->m_BuildItem_SetUUID == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnode_getchildrenbyname", (void**)&(pWrapperTable->m_CustomXMLNode_GetChildrenByName)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNode_GetChildrenByName == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_builditem_getobjectresourceid", (void**)&(pWrapperTable->m_BuildItem_GetObjectResourceID)); - if ( (eLookupError != 0) || (pWrapperTable->m_BuildItem_GetObjectResourceID == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnode_haschild", (void**)&(pWrapperTable->m_CustomXMLNode_HasChild)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNode_HasChild == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_builditem_hasobjecttransform", (void**)&(pWrapperTable->m_BuildItem_HasObjectTransform)); - if ( (eLookupError != 0) || (pWrapperTable->m_BuildItem_HasObjectTransform == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnode_hasuniquechild", (void**)&(pWrapperTable->m_CustomXMLNode_HasUniqueChild)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNode_HasUniqueChild == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_builditem_getobjecttransform", (void**)&(pWrapperTable->m_BuildItem_GetObjectTransform)); - if ( (eLookupError != 0) || (pWrapperTable->m_BuildItem_GetObjectTransform == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnode_findchild", (void**)&(pWrapperTable->m_CustomXMLNode_FindChild)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNode_FindChild == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_builditem_setobjecttransform", (void**)&(pWrapperTable->m_BuildItem_SetObjectTransform)); - if ( (eLookupError != 0) || (pWrapperTable->m_BuildItem_SetObjectTransform == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnode_addchild", (void**)&(pWrapperTable->m_CustomXMLNode_AddChild)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNode_AddChild == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_builditem_getpartnumber", (void**)&(pWrapperTable->m_BuildItem_GetPartNumber)); - if ( (eLookupError != 0) || (pWrapperTable->m_BuildItem_GetPartNumber == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnode_removechild", (void**)&(pWrapperTable->m_CustomXMLNode_RemoveChild)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNode_RemoveChild == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_builditem_setpartnumber", (void**)&(pWrapperTable->m_BuildItem_SetPartNumber)); - if ( (eLookupError != 0) || (pWrapperTable->m_BuildItem_SetPartNumber == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnode_removechildrenwithname", (void**)&(pWrapperTable->m_CustomXMLNode_RemoveChildrenWithName)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNode_RemoveChildrenWithName == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_builditem_getmetadatagroup", (void**)&(pWrapperTable->m_BuildItem_GetMetaDataGroup)); - if ( (eLookupError != 0) || (pWrapperTable->m_BuildItem_GetMetaDataGroup == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnode_remove", (void**)&(pWrapperTable->m_CustomXMLNode_Remove)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNode_Remove == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_builditem_getoutbox", (void**)&(pWrapperTable->m_BuildItem_GetOutbox)); - if ( (eLookupError != 0) || (pWrapperTable->m_BuildItem_GetOutbox == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnodes_getnodecount", (void**)&(pWrapperTable->m_CustomXMLNodes_GetNodeCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNodes_GetNodeCount == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_builditemiterator_movenext", (void**)&(pWrapperTable->m_BuildItemIterator_MoveNext)); - if ( (eLookupError != 0) || (pWrapperTable->m_BuildItemIterator_MoveNext == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnodes_getnode", (void**)&(pWrapperTable->m_CustomXMLNodes_GetNode)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNodes_GetNode == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_builditemiterator_moveprevious", (void**)&(pWrapperTable->m_BuildItemIterator_MovePrevious)); - if ( (eLookupError != 0) || (pWrapperTable->m_BuildItemIterator_MovePrevious == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnodes_countnodesbyname", (void**)&(pWrapperTable->m_CustomXMLNodes_CountNodesByName)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNodes_CountNodesByName == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_builditemiterator_getcurrent", (void**)&(pWrapperTable->m_BuildItemIterator_GetCurrent)); - if ( (eLookupError != 0) || (pWrapperTable->m_BuildItemIterator_GetCurrent == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnodes_getnodesbyname", (void**)&(pWrapperTable->m_CustomXMLNodes_GetNodesByName)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNodes_GetNodesByName == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_builditemiterator_clone", (void**)&(pWrapperTable->m_BuildItemIterator_Clone)); - if ( (eLookupError != 0) || (pWrapperTable->m_BuildItemIterator_Clone == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnodes_hasnode", (void**)&(pWrapperTable->m_CustomXMLNodes_HasNode)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNodes_HasNode == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_builditemiterator_count", (void**)&(pWrapperTable->m_BuildItemIterator_Count)); - if ( (eLookupError != 0) || (pWrapperTable->m_BuildItemIterator_Count == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnodes_hasuniquenode", (void**)&(pWrapperTable->m_CustomXMLNodes_HasUniqueNode)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNodes_HasUniqueNode == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_slice_setvertices", (void**)&(pWrapperTable->m_Slice_SetVertices)); - if ( (eLookupError != 0) || (pWrapperTable->m_Slice_SetVertices == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customxmlnodes_findnode", (void**)&(pWrapperTable->m_CustomXMLNodes_FindNode)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomXMLNodes_FindNode == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_slice_getvertices", (void**)&(pWrapperTable->m_Slice_GetVertices)); - if ( (eLookupError != 0) || (pWrapperTable->m_Slice_GetVertices == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customdomtree_getnamespace", (void**)&(pWrapperTable->m_CustomDOMTree_GetNameSpace)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomDOMTree_GetNameSpace == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_slice_getvertexcount", (void**)&(pWrapperTable->m_Slice_GetVertexCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_Slice_GetVertexCount == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customdomtree_getrootnode", (void**)&(pWrapperTable->m_CustomDOMTree_GetRootNode)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomDOMTree_GetRootNode == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_slice_addpolygon", (void**)&(pWrapperTable->m_Slice_AddPolygon)); - if ( (eLookupError != 0) || (pWrapperTable->m_Slice_AddPolygon == nullptr) ) + eLookupError = (*pLookup)("lib3mf_customdomtree_savetostring", (void**)&(pWrapperTable->m_CustomDOMTree_SaveToString)); + if ( (eLookupError != 0) || (pWrapperTable->m_CustomDOMTree_SaveToString == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_slice_getpolygoncount", (void**)&(pWrapperTable->m_Slice_GetPolygonCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_Slice_GetPolygonCount == nullptr) ) + eLookupError = (*pLookup)("lib3mf_slicestackiterator_getcurrentslicestack", (void**)&(pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack)); + if ( (eLookupError != 0) || (pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_slice_setpolygonindices", (void**)&(pWrapperTable->m_Slice_SetPolygonIndices)); - if ( (eLookupError != 0) || (pWrapperTable->m_Slice_SetPolygonIndices == nullptr) ) + eLookupError = (*pLookup)("lib3mf_objectiterator_getcurrentobject", (void**)&(pWrapperTable->m_ObjectIterator_GetCurrentObject)); + if ( (eLookupError != 0) || (pWrapperTable->m_ObjectIterator_GetCurrentObject == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_slice_getpolygonindices", (void**)&(pWrapperTable->m_Slice_GetPolygonIndices)); - if ( (eLookupError != 0) || (pWrapperTable->m_Slice_GetPolygonIndices == nullptr) ) + eLookupError = (*pLookup)("lib3mf_meshobjectiterator_getcurrentmeshobject", (void**)&(pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject)); + if ( (eLookupError != 0) || (pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_slice_getpolygonindexcount", (void**)&(pWrapperTable->m_Slice_GetPolygonIndexCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_Slice_GetPolygonIndexCount == nullptr) ) + eLookupError = (*pLookup)("lib3mf_componentsobjectiterator_getcurrentcomponentsobject", (void**)&(pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject)); + if ( (eLookupError != 0) || (pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_slice_getztop", (void**)&(pWrapperTable->m_Slice_GetZTop)); - if ( (eLookupError != 0) || (pWrapperTable->m_Slice_GetZTop == nullptr) ) + eLookupError = (*pLookup)("lib3mf_texture2diterator_getcurrenttexture2d", (void**)&(pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D)); + if ( (eLookupError != 0) || (pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_slicestack_getbottomz", (void**)&(pWrapperTable->m_SliceStack_GetBottomZ)); - if ( (eLookupError != 0) || (pWrapperTable->m_SliceStack_GetBottomZ == nullptr) ) + eLookupError = (*pLookup)("lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup", (void**)&(pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup)); + if ( (eLookupError != 0) || (pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_slicestack_getslicecount", (void**)&(pWrapperTable->m_SliceStack_GetSliceCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_SliceStack_GetSliceCount == nullptr) ) + eLookupError = (*pLookup)("lib3mf_colorgroupiterator_getcurrentcolorgroup", (void**)&(pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup)); + if ( (eLookupError != 0) || (pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_slicestack_getslice", (void**)&(pWrapperTable->m_SliceStack_GetSlice)); - if ( (eLookupError != 0) || (pWrapperTable->m_SliceStack_GetSlice == nullptr) ) + eLookupError = (*pLookup)("lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup", (void**)&(pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup)); + if ( (eLookupError != 0) || (pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_slicestack_addslice", (void**)&(pWrapperTable->m_SliceStack_AddSlice)); - if ( (eLookupError != 0) || (pWrapperTable->m_SliceStack_AddSlice == nullptr) ) + eLookupError = (*pLookup)("lib3mf_compositematerialsiterator_getcurrentcompositematerials", (void**)&(pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials)); + if ( (eLookupError != 0) || (pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_slicestack_getslicerefcount", (void**)&(pWrapperTable->m_SliceStack_GetSliceRefCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_SliceStack_GetSliceRefCount == nullptr) ) + eLookupError = (*pLookup)("lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup", (void**)&(pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup)); + if ( (eLookupError != 0) || (pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_slicestack_addslicestackreference", (void**)&(pWrapperTable->m_SliceStack_AddSliceStackReference)); - if ( (eLookupError != 0) || (pWrapperTable->m_SliceStack_AddSliceStackReference == nullptr) ) + eLookupError = (*pLookup)("lib3mf_metadata_getnamespace", (void**)&(pWrapperTable->m_MetaData_GetNameSpace)); + if ( (eLookupError != 0) || (pWrapperTable->m_MetaData_GetNameSpace == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_slicestack_getslicestackreference", (void**)&(pWrapperTable->m_SliceStack_GetSliceStackReference)); - if ( (eLookupError != 0) || (pWrapperTable->m_SliceStack_GetSliceStackReference == nullptr) ) + eLookupError = (*pLookup)("lib3mf_metadata_setnamespace", (void**)&(pWrapperTable->m_MetaData_SetNameSpace)); + if ( (eLookupError != 0) || (pWrapperTable->m_MetaData_SetNameSpace == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_slicestack_collapseslicereferences", (void**)&(pWrapperTable->m_SliceStack_CollapseSliceReferences)); - if ( (eLookupError != 0) || (pWrapperTable->m_SliceStack_CollapseSliceReferences == nullptr) ) + eLookupError = (*pLookup)("lib3mf_metadata_getname", (void**)&(pWrapperTable->m_MetaData_GetName)); + if ( (eLookupError != 0) || (pWrapperTable->m_MetaData_GetName == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_slicestack_setownpath", (void**)&(pWrapperTable->m_SliceStack_SetOwnPath)); - if ( (eLookupError != 0) || (pWrapperTable->m_SliceStack_SetOwnPath == nullptr) ) + eLookupError = (*pLookup)("lib3mf_metadata_setname", (void**)&(pWrapperTable->m_MetaData_SetName)); + if ( (eLookupError != 0) || (pWrapperTable->m_MetaData_SetName == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_slicestack_getownpath", (void**)&(pWrapperTable->m_SliceStack_GetOwnPath)); - if ( (eLookupError != 0) || (pWrapperTable->m_SliceStack_GetOwnPath == nullptr) ) + eLookupError = (*pLookup)("lib3mf_metadata_getkey", (void**)&(pWrapperTable->m_MetaData_GetKey)); + if ( (eLookupError != 0) || (pWrapperTable->m_MetaData_GetKey == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_consumer_getconsumerid", (void**)&(pWrapperTable->m_Consumer_GetConsumerID)); - if ( (eLookupError != 0) || (pWrapperTable->m_Consumer_GetConsumerID == nullptr) ) + eLookupError = (*pLookup)("lib3mf_metadata_getmustpreserve", (void**)&(pWrapperTable->m_MetaData_GetMustPreserve)); + if ( (eLookupError != 0) || (pWrapperTable->m_MetaData_GetMustPreserve == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_consumer_getkeyid", (void**)&(pWrapperTable->m_Consumer_GetKeyID)); - if ( (eLookupError != 0) || (pWrapperTable->m_Consumer_GetKeyID == nullptr) ) + eLookupError = (*pLookup)("lib3mf_metadata_setmustpreserve", (void**)&(pWrapperTable->m_MetaData_SetMustPreserve)); + if ( (eLookupError != 0) || (pWrapperTable->m_MetaData_SetMustPreserve == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_consumer_getkeyvalue", (void**)&(pWrapperTable->m_Consumer_GetKeyValue)); - if ( (eLookupError != 0) || (pWrapperTable->m_Consumer_GetKeyValue == nullptr) ) + eLookupError = (*pLookup)("lib3mf_metadata_gettype", (void**)&(pWrapperTable->m_MetaData_GetType)); + if ( (eLookupError != 0) || (pWrapperTable->m_MetaData_GetType == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_accessright_getconsumer", (void**)&(pWrapperTable->m_AccessRight_GetConsumer)); - if ( (eLookupError != 0) || (pWrapperTable->m_AccessRight_GetConsumer == nullptr) ) + eLookupError = (*pLookup)("lib3mf_metadata_settype", (void**)&(pWrapperTable->m_MetaData_SetType)); + if ( (eLookupError != 0) || (pWrapperTable->m_MetaData_SetType == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_accessright_getwrappingalgorithm", (void**)&(pWrapperTable->m_AccessRight_GetWrappingAlgorithm)); - if ( (eLookupError != 0) || (pWrapperTable->m_AccessRight_GetWrappingAlgorithm == nullptr) ) + eLookupError = (*pLookup)("lib3mf_metadata_getvalue", (void**)&(pWrapperTable->m_MetaData_GetValue)); + if ( (eLookupError != 0) || (pWrapperTable->m_MetaData_GetValue == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_accessright_getmgfalgorithm", (void**)&(pWrapperTable->m_AccessRight_GetMgfAlgorithm)); - if ( (eLookupError != 0) || (pWrapperTable->m_AccessRight_GetMgfAlgorithm == nullptr) ) + eLookupError = (*pLookup)("lib3mf_metadata_setvalue", (void**)&(pWrapperTable->m_MetaData_SetValue)); + if ( (eLookupError != 0) || (pWrapperTable->m_MetaData_SetValue == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_accessright_getdigestmethod", (void**)&(pWrapperTable->m_AccessRight_GetDigestMethod)); - if ( (eLookupError != 0) || (pWrapperTable->m_AccessRight_GetDigestMethod == nullptr) ) + eLookupError = (*pLookup)("lib3mf_metadatagroup_getmetadatacount", (void**)&(pWrapperTable->m_MetaDataGroup_GetMetaDataCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_MetaDataGroup_GetMetaDataCount == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_contentencryptionparams_getencryptionalgorithm", (void**)&(pWrapperTable->m_ContentEncryptionParams_GetEncryptionAlgorithm)); - if ( (eLookupError != 0) || (pWrapperTable->m_ContentEncryptionParams_GetEncryptionAlgorithm == nullptr) ) + eLookupError = (*pLookup)("lib3mf_metadatagroup_getmetadata", (void**)&(pWrapperTable->m_MetaDataGroup_GetMetaData)); + if ( (eLookupError != 0) || (pWrapperTable->m_MetaDataGroup_GetMetaData == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_contentencryptionparams_getkey", (void**)&(pWrapperTable->m_ContentEncryptionParams_GetKey)); - if ( (eLookupError != 0) || (pWrapperTable->m_ContentEncryptionParams_GetKey == nullptr) ) + eLookupError = (*pLookup)("lib3mf_metadatagroup_getmetadatabykey", (void**)&(pWrapperTable->m_MetaDataGroup_GetMetaDataByKey)); + if ( (eLookupError != 0) || (pWrapperTable->m_MetaDataGroup_GetMetaDataByKey == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_contentencryptionparams_getinitializationvector", (void**)&(pWrapperTable->m_ContentEncryptionParams_GetInitializationVector)); - if ( (eLookupError != 0) || (pWrapperTable->m_ContentEncryptionParams_GetInitializationVector == nullptr) ) + eLookupError = (*pLookup)("lib3mf_metadatagroup_removemetadatabyindex", (void**)&(pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex)); + if ( (eLookupError != 0) || (pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_contentencryptionparams_getauthenticationtag", (void**)&(pWrapperTable->m_ContentEncryptionParams_GetAuthenticationTag)); - if ( (eLookupError != 0) || (pWrapperTable->m_ContentEncryptionParams_GetAuthenticationTag == nullptr) ) + eLookupError = (*pLookup)("lib3mf_metadatagroup_removemetadata", (void**)&(pWrapperTable->m_MetaDataGroup_RemoveMetaData)); + if ( (eLookupError != 0) || (pWrapperTable->m_MetaDataGroup_RemoveMetaData == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_contentencryptionparams_setauthenticationtag", (void**)&(pWrapperTable->m_ContentEncryptionParams_SetAuthenticationTag)); - if ( (eLookupError != 0) || (pWrapperTable->m_ContentEncryptionParams_SetAuthenticationTag == nullptr) ) + eLookupError = (*pLookup)("lib3mf_metadatagroup_addmetadata", (void**)&(pWrapperTable->m_MetaDataGroup_AddMetaData)); + if ( (eLookupError != 0) || (pWrapperTable->m_MetaDataGroup_AddMetaData == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_contentencryptionparams_getadditionalauthenticationdata", (void**)&(pWrapperTable->m_ContentEncryptionParams_GetAdditionalAuthenticationData)); - if ( (eLookupError != 0) || (pWrapperTable->m_ContentEncryptionParams_GetAdditionalAuthenticationData == nullptr) ) + eLookupError = (*pLookup)("lib3mf_object_gettype", (void**)&(pWrapperTable->m_Object_GetType)); + if ( (eLookupError != 0) || (pWrapperTable->m_Object_GetType == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_contentencryptionparams_getdescriptor", (void**)&(pWrapperTable->m_ContentEncryptionParams_GetDescriptor)); - if ( (eLookupError != 0) || (pWrapperTable->m_ContentEncryptionParams_GetDescriptor == nullptr) ) + eLookupError = (*pLookup)("lib3mf_object_settype", (void**)&(pWrapperTable->m_Object_SetType)); + if ( (eLookupError != 0) || (pWrapperTable->m_Object_SetType == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_contentencryptionparams_getkeyuuid", (void**)&(pWrapperTable->m_ContentEncryptionParams_GetKeyUUID)); - if ( (eLookupError != 0) || (pWrapperTable->m_ContentEncryptionParams_GetKeyUUID == nullptr) ) + eLookupError = (*pLookup)("lib3mf_object_getname", (void**)&(pWrapperTable->m_Object_GetName)); + if ( (eLookupError != 0) || (pWrapperTable->m_Object_GetName == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_resourcedata_getpath", (void**)&(pWrapperTable->m_ResourceData_GetPath)); - if ( (eLookupError != 0) || (pWrapperTable->m_ResourceData_GetPath == nullptr) ) - return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + eLookupError = (*pLookup)("lib3mf_object_setname", (void**)&(pWrapperTable->m_Object_SetName)); + if ( (eLookupError != 0) || (pWrapperTable->m_Object_SetName == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_resourcedata_getencryptionalgorithm", (void**)&(pWrapperTable->m_ResourceData_GetEncryptionAlgorithm)); - if ( (eLookupError != 0) || (pWrapperTable->m_ResourceData_GetEncryptionAlgorithm == nullptr) ) + eLookupError = (*pLookup)("lib3mf_object_getpartnumber", (void**)&(pWrapperTable->m_Object_GetPartNumber)); + if ( (eLookupError != 0) || (pWrapperTable->m_Object_GetPartNumber == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_resourcedata_getcompression", (void**)&(pWrapperTable->m_ResourceData_GetCompression)); - if ( (eLookupError != 0) || (pWrapperTable->m_ResourceData_GetCompression == nullptr) ) + eLookupError = (*pLookup)("lib3mf_object_setpartnumber", (void**)&(pWrapperTable->m_Object_SetPartNumber)); + if ( (eLookupError != 0) || (pWrapperTable->m_Object_SetPartNumber == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_resourcedata_getadditionalauthenticationdata", (void**)&(pWrapperTable->m_ResourceData_GetAdditionalAuthenticationData)); - if ( (eLookupError != 0) || (pWrapperTable->m_ResourceData_GetAdditionalAuthenticationData == nullptr) ) + eLookupError = (*pLookup)("lib3mf_object_ismeshobject", (void**)&(pWrapperTable->m_Object_IsMeshObject)); + if ( (eLookupError != 0) || (pWrapperTable->m_Object_IsMeshObject == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_resourcedatagroup_getkeyuuid", (void**)&(pWrapperTable->m_ResourceDataGroup_GetKeyUUID)); - if ( (eLookupError != 0) || (pWrapperTable->m_ResourceDataGroup_GetKeyUUID == nullptr) ) + eLookupError = (*pLookup)("lib3mf_object_iscomponentsobject", (void**)&(pWrapperTable->m_Object_IsComponentsObject)); + if ( (eLookupError != 0) || (pWrapperTable->m_Object_IsComponentsObject == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_resourcedatagroup_addaccessright", (void**)&(pWrapperTable->m_ResourceDataGroup_AddAccessRight)); - if ( (eLookupError != 0) || (pWrapperTable->m_ResourceDataGroup_AddAccessRight == nullptr) ) + eLookupError = (*pLookup)("lib3mf_object_isvalid", (void**)&(pWrapperTable->m_Object_IsValid)); + if ( (eLookupError != 0) || (pWrapperTable->m_Object_IsValid == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_resourcedatagroup_findaccessrightbyconsumer", (void**)&(pWrapperTable->m_ResourceDataGroup_FindAccessRightByConsumer)); - if ( (eLookupError != 0) || (pWrapperTable->m_ResourceDataGroup_FindAccessRightByConsumer == nullptr) ) + eLookupError = (*pLookup)("lib3mf_object_setattachmentasthumbnail", (void**)&(pWrapperTable->m_Object_SetAttachmentAsThumbnail)); + if ( (eLookupError != 0) || (pWrapperTable->m_Object_SetAttachmentAsThumbnail == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_resourcedatagroup_removeaccessright", (void**)&(pWrapperTable->m_ResourceDataGroup_RemoveAccessRight)); - if ( (eLookupError != 0) || (pWrapperTable->m_ResourceDataGroup_RemoveAccessRight == nullptr) ) + eLookupError = (*pLookup)("lib3mf_object_getthumbnailattachment", (void**)&(pWrapperTable->m_Object_GetThumbnailAttachment)); + if ( (eLookupError != 0) || (pWrapperTable->m_Object_GetThumbnailAttachment == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_keystore_addconsumer", (void**)&(pWrapperTable->m_KeyStore_AddConsumer)); - if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_AddConsumer == nullptr) ) + eLookupError = (*pLookup)("lib3mf_object_clearthumbnailattachment", (void**)&(pWrapperTable->m_Object_ClearThumbnailAttachment)); + if ( (eLookupError != 0) || (pWrapperTable->m_Object_ClearThumbnailAttachment == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_keystore_getconsumercount", (void**)&(pWrapperTable->m_KeyStore_GetConsumerCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_GetConsumerCount == nullptr) ) + eLookupError = (*pLookup)("lib3mf_object_getoutbox", (void**)&(pWrapperTable->m_Object_GetOutbox)); + if ( (eLookupError != 0) || (pWrapperTable->m_Object_GetOutbox == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_keystore_getconsumer", (void**)&(pWrapperTable->m_KeyStore_GetConsumer)); - if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_GetConsumer == nullptr) ) + eLookupError = (*pLookup)("lib3mf_object_getuuid", (void**)&(pWrapperTable->m_Object_GetUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_Object_GetUUID == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_keystore_removeconsumer", (void**)&(pWrapperTable->m_KeyStore_RemoveConsumer)); - if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_RemoveConsumer == nullptr) ) + eLookupError = (*pLookup)("lib3mf_object_setuuid", (void**)&(pWrapperTable->m_Object_SetUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_Object_SetUUID == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_keystore_findconsumer", (void**)&(pWrapperTable->m_KeyStore_FindConsumer)); - if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_FindConsumer == nullptr) ) + eLookupError = (*pLookup)("lib3mf_object_getmetadatagroup", (void**)&(pWrapperTable->m_Object_GetMetaDataGroup)); + if ( (eLookupError != 0) || (pWrapperTable->m_Object_GetMetaDataGroup == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_keystore_getresourcedatagroupcount", (void**)&(pWrapperTable->m_KeyStore_GetResourceDataGroupCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_GetResourceDataGroupCount == nullptr) ) + eLookupError = (*pLookup)("lib3mf_object_setslicesmeshresolution", (void**)&(pWrapperTable->m_Object_SetSlicesMeshResolution)); + if ( (eLookupError != 0) || (pWrapperTable->m_Object_SetSlicesMeshResolution == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_keystore_addresourcedatagroup", (void**)&(pWrapperTable->m_KeyStore_AddResourceDataGroup)); - if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_AddResourceDataGroup == nullptr) ) + eLookupError = (*pLookup)("lib3mf_object_getslicesmeshresolution", (void**)&(pWrapperTable->m_Object_GetSlicesMeshResolution)); + if ( (eLookupError != 0) || (pWrapperTable->m_Object_GetSlicesMeshResolution == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_keystore_getresourcedatagroup", (void**)&(pWrapperTable->m_KeyStore_GetResourceDataGroup)); - if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_GetResourceDataGroup == nullptr) ) + eLookupError = (*pLookup)("lib3mf_object_hasslices", (void**)&(pWrapperTable->m_Object_HasSlices)); + if ( (eLookupError != 0) || (pWrapperTable->m_Object_HasSlices == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_keystore_removeresourcedatagroup", (void**)&(pWrapperTable->m_KeyStore_RemoveResourceDataGroup)); - if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_RemoveResourceDataGroup == nullptr) ) + eLookupError = (*pLookup)("lib3mf_object_clearslicestack", (void**)&(pWrapperTable->m_Object_ClearSliceStack)); + if ( (eLookupError != 0) || (pWrapperTable->m_Object_ClearSliceStack == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_keystore_findresourcedatagroup", (void**)&(pWrapperTable->m_KeyStore_FindResourceDataGroup)); - if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_FindResourceDataGroup == nullptr) ) + eLookupError = (*pLookup)("lib3mf_object_getslicestack", (void**)&(pWrapperTable->m_Object_GetSliceStack)); + if ( (eLookupError != 0) || (pWrapperTable->m_Object_GetSliceStack == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_keystore_addresourcedata", (void**)&(pWrapperTable->m_KeyStore_AddResourceData)); - if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_AddResourceData == nullptr) ) + eLookupError = (*pLookup)("lib3mf_object_assignslicestack", (void**)&(pWrapperTable->m_Object_AssignSliceStack)); + if ( (eLookupError != 0) || (pWrapperTable->m_Object_AssignSliceStack == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_keystore_removeresourcedata", (void**)&(pWrapperTable->m_KeyStore_RemoveResourceData)); - if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_RemoveResourceData == nullptr) ) + eLookupError = (*pLookup)("lib3mf_meshobject_getvertexcount", (void**)&(pWrapperTable->m_MeshObject_GetVertexCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_GetVertexCount == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_keystore_findresourcedata", (void**)&(pWrapperTable->m_KeyStore_FindResourceData)); - if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_FindResourceData == nullptr) ) + eLookupError = (*pLookup)("lib3mf_meshobject_gettrianglecount", (void**)&(pWrapperTable->m_MeshObject_GetTriangleCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_GetTriangleCount == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_keystore_getresourcedatacount", (void**)&(pWrapperTable->m_KeyStore_GetResourceDataCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_GetResourceDataCount == nullptr) ) + eLookupError = (*pLookup)("lib3mf_meshobject_getvertex", (void**)&(pWrapperTable->m_MeshObject_GetVertex)); + if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_GetVertex == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_keystore_getresourcedata", (void**)&(pWrapperTable->m_KeyStore_GetResourceData)); - if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_GetResourceData == nullptr) ) + eLookupError = (*pLookup)("lib3mf_meshobject_setvertex", (void**)&(pWrapperTable->m_MeshObject_SetVertex)); + if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_SetVertex == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_keystore_getuuid", (void**)&(pWrapperTable->m_KeyStore_GetUUID)); - if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_GetUUID == nullptr) ) + eLookupError = (*pLookup)("lib3mf_meshobject_addvertex", (void**)&(pWrapperTable->m_MeshObject_AddVertex)); + if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_AddVertex == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_keystore_setuuid", (void**)&(pWrapperTable->m_KeyStore_SetUUID)); - if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_SetUUID == nullptr) ) + eLookupError = (*pLookup)("lib3mf_meshobject_getvertices", (void**)&(pWrapperTable->m_MeshObject_GetVertices)); + if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_GetVertices == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_rootmodelpart", (void**)&(pWrapperTable->m_Model_RootModelPart)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_RootModelPart == nullptr) ) + eLookupError = (*pLookup)("lib3mf_meshobject_gettriangle", (void**)&(pWrapperTable->m_MeshObject_GetTriangle)); + if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_GetTriangle == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_findorcreatepackagepart", (void**)&(pWrapperTable->m_Model_FindOrCreatePackagePart)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_FindOrCreatePackagePart == nullptr) ) + eLookupError = (*pLookup)("lib3mf_meshobject_settriangle", (void**)&(pWrapperTable->m_MeshObject_SetTriangle)); + if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_SetTriangle == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_setunit", (void**)&(pWrapperTable->m_Model_SetUnit)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_SetUnit == nullptr) ) + eLookupError = (*pLookup)("lib3mf_meshobject_addtriangle", (void**)&(pWrapperTable->m_MeshObject_AddTriangle)); + if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_AddTriangle == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getunit", (void**)&(pWrapperTable->m_Model_GetUnit)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetUnit == nullptr) ) + eLookupError = (*pLookup)("lib3mf_meshobject_gettriangleindices", (void**)&(pWrapperTable->m_MeshObject_GetTriangleIndices)); + if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_GetTriangleIndices == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getlanguage", (void**)&(pWrapperTable->m_Model_GetLanguage)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetLanguage == nullptr) ) + eLookupError = (*pLookup)("lib3mf_meshobject_setobjectlevelproperty", (void**)&(pWrapperTable->m_MeshObject_SetObjectLevelProperty)); + if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_SetObjectLevelProperty == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_setlanguage", (void**)&(pWrapperTable->m_Model_SetLanguage)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_SetLanguage == nullptr) ) + eLookupError = (*pLookup)("lib3mf_meshobject_getobjectlevelproperty", (void**)&(pWrapperTable->m_MeshObject_GetObjectLevelProperty)); + if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_GetObjectLevelProperty == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_querywriter", (void**)&(pWrapperTable->m_Model_QueryWriter)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_QueryWriter == nullptr) ) + eLookupError = (*pLookup)("lib3mf_meshobject_settriangleproperties", (void**)&(pWrapperTable->m_MeshObject_SetTriangleProperties)); + if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_SetTriangleProperties == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_queryreader", (void**)&(pWrapperTable->m_Model_QueryReader)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_QueryReader == nullptr) ) + eLookupError = (*pLookup)("lib3mf_meshobject_gettriangleproperties", (void**)&(pWrapperTable->m_MeshObject_GetTriangleProperties)); + if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_GetTriangleProperties == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getresourcebyid", (void**)&(pWrapperTable->m_Model_GetResourceByID)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetResourceByID == nullptr) ) + eLookupError = (*pLookup)("lib3mf_meshobject_setalltriangleproperties", (void**)&(pWrapperTable->m_MeshObject_SetAllTriangleProperties)); + if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_SetAllTriangleProperties == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_gettexture2dbyid", (void**)&(pWrapperTable->m_Model_GetTexture2DByID)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetTexture2DByID == nullptr) ) + eLookupError = (*pLookup)("lib3mf_meshobject_getalltriangleproperties", (void**)&(pWrapperTable->m_MeshObject_GetAllTriangleProperties)); + if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_GetAllTriangleProperties == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getpropertytypebyid", (void**)&(pWrapperTable->m_Model_GetPropertyTypeByID)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetPropertyTypeByID == nullptr) ) + eLookupError = (*pLookup)("lib3mf_meshobject_clearallproperties", (void**)&(pWrapperTable->m_MeshObject_ClearAllProperties)); + if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_ClearAllProperties == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getbasematerialgroupbyid", (void**)&(pWrapperTable->m_Model_GetBaseMaterialGroupByID)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetBaseMaterialGroupByID == nullptr) ) + eLookupError = (*pLookup)("lib3mf_meshobject_setgeometry", (void**)&(pWrapperTable->m_MeshObject_SetGeometry)); + if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_SetGeometry == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_gettexture2dgroupbyid", (void**)&(pWrapperTable->m_Model_GetTexture2DGroupByID)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetTexture2DGroupByID == nullptr) ) + eLookupError = (*pLookup)("lib3mf_meshobject_ismanifoldandoriented", (void**)&(pWrapperTable->m_MeshObject_IsManifoldAndOriented)); + if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_IsManifoldAndOriented == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getcompositematerialsbyid", (void**)&(pWrapperTable->m_Model_GetCompositeMaterialsByID)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetCompositeMaterialsByID == nullptr) ) + eLookupError = (*pLookup)("lib3mf_meshobject_beamlattice", (void**)&(pWrapperTable->m_MeshObject_BeamLattice)); + if ( (eLookupError != 0) || (pWrapperTable->m_MeshObject_BeamLattice == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getmultipropertygroupbyid", (void**)&(pWrapperTable->m_Model_GetMultiPropertyGroupByID)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetMultiPropertyGroupByID == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamlattice_getminlength", (void**)&(pWrapperTable->m_BeamLattice_GetMinLength)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetMinLength == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getmeshobjectbyid", (void**)&(pWrapperTable->m_Model_GetMeshObjectByID)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetMeshObjectByID == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamlattice_setminlength", (void**)&(pWrapperTable->m_BeamLattice_SetMinLength)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_SetMinLength == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getcomponentsobjectbyid", (void**)&(pWrapperTable->m_Model_GetComponentsObjectByID)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetComponentsObjectByID == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamlattice_getclipping", (void**)&(pWrapperTable->m_BeamLattice_GetClipping)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetClipping == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getcolorgroupbyid", (void**)&(pWrapperTable->m_Model_GetColorGroupByID)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetColorGroupByID == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamlattice_setclipping", (void**)&(pWrapperTable->m_BeamLattice_SetClipping)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_SetClipping == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getslicestackbyid", (void**)&(pWrapperTable->m_Model_GetSliceStackByID)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetSliceStackByID == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamlattice_getrepresentation", (void**)&(pWrapperTable->m_BeamLattice_GetRepresentation)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetRepresentation == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getbuilduuid", (void**)&(pWrapperTable->m_Model_GetBuildUUID)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetBuildUUID == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamlattice_setrepresentation", (void**)&(pWrapperTable->m_BeamLattice_SetRepresentation)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_SetRepresentation == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_setbuilduuid", (void**)&(pWrapperTable->m_Model_SetBuildUUID)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_SetBuildUUID == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamlattice_getballoptions", (void**)&(pWrapperTable->m_BeamLattice_GetBallOptions)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetBallOptions == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getbuilditems", (void**)&(pWrapperTable->m_Model_GetBuildItems)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetBuildItems == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamlattice_setballoptions", (void**)&(pWrapperTable->m_BeamLattice_SetBallOptions)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_SetBallOptions == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getoutbox", (void**)&(pWrapperTable->m_Model_GetOutbox)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetOutbox == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamlattice_getbeamcount", (void**)&(pWrapperTable->m_BeamLattice_GetBeamCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetBeamCount == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getresources", (void**)&(pWrapperTable->m_Model_GetResources)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetResources == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamlattice_getbeam", (void**)&(pWrapperTable->m_BeamLattice_GetBeam)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetBeam == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getobjects", (void**)&(pWrapperTable->m_Model_GetObjects)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetObjects == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamlattice_addbeam", (void**)&(pWrapperTable->m_BeamLattice_AddBeam)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_AddBeam == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getmeshobjects", (void**)&(pWrapperTable->m_Model_GetMeshObjects)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetMeshObjects == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamlattice_setbeam", (void**)&(pWrapperTable->m_BeamLattice_SetBeam)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_SetBeam == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getcomponentsobjects", (void**)&(pWrapperTable->m_Model_GetComponentsObjects)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetComponentsObjects == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamlattice_setbeams", (void**)&(pWrapperTable->m_BeamLattice_SetBeams)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_SetBeams == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_gettexture2ds", (void**)&(pWrapperTable->m_Model_GetTexture2Ds)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetTexture2Ds == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamlattice_getbeams", (void**)&(pWrapperTable->m_BeamLattice_GetBeams)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetBeams == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getbasematerialgroups", (void**)&(pWrapperTable->m_Model_GetBaseMaterialGroups)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetBaseMaterialGroups == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamlattice_getballcount", (void**)&(pWrapperTable->m_BeamLattice_GetBallCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetBallCount == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getcolorgroups", (void**)&(pWrapperTable->m_Model_GetColorGroups)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetColorGroups == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamlattice_getball", (void**)&(pWrapperTable->m_BeamLattice_GetBall)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetBall == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_gettexture2dgroups", (void**)&(pWrapperTable->m_Model_GetTexture2DGroups)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetTexture2DGroups == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamlattice_addball", (void**)&(pWrapperTable->m_BeamLattice_AddBall)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_AddBall == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getcompositematerials", (void**)&(pWrapperTable->m_Model_GetCompositeMaterials)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetCompositeMaterials == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamlattice_setball", (void**)&(pWrapperTable->m_BeamLattice_SetBall)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_SetBall == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getmultipropertygroups", (void**)&(pWrapperTable->m_Model_GetMultiPropertyGroups)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetMultiPropertyGroups == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamlattice_setballs", (void**)&(pWrapperTable->m_BeamLattice_SetBalls)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_SetBalls == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getslicestacks", (void**)&(pWrapperTable->m_Model_GetSliceStacks)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetSliceStacks == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamlattice_getballs", (void**)&(pWrapperTable->m_BeamLattice_GetBalls)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetBalls == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_mergetomodel", (void**)&(pWrapperTable->m_Model_MergeToModel)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_MergeToModel == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamlattice_getbeamsetcount", (void**)&(pWrapperTable->m_BeamLattice_GetBeamSetCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetBeamSetCount == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_addmeshobject", (void**)&(pWrapperTable->m_Model_AddMeshObject)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddMeshObject == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamlattice_addbeamset", (void**)&(pWrapperTable->m_BeamLattice_AddBeamSet)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_AddBeamSet == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_addcomponentsobject", (void**)&(pWrapperTable->m_Model_AddComponentsObject)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddComponentsObject == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamlattice_getbeamset", (void**)&(pWrapperTable->m_BeamLattice_GetBeamSet)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetBeamSet == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_addslicestack", (void**)&(pWrapperTable->m_Model_AddSliceStack)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddSliceStack == nullptr) ) + eLookupError = (*pLookup)("lib3mf_component_getobjectresource", (void**)&(pWrapperTable->m_Component_GetObjectResource)); + if ( (eLookupError != 0) || (pWrapperTable->m_Component_GetObjectResource == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_addtexture2dfromattachment", (void**)&(pWrapperTable->m_Model_AddTexture2DFromAttachment)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddTexture2DFromAttachment == nullptr) ) + eLookupError = (*pLookup)("lib3mf_component_getobjectresourceid", (void**)&(pWrapperTable->m_Component_GetObjectResourceID)); + if ( (eLookupError != 0) || (pWrapperTable->m_Component_GetObjectResourceID == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_addbasematerialgroup", (void**)&(pWrapperTable->m_Model_AddBaseMaterialGroup)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddBaseMaterialGroup == nullptr) ) + eLookupError = (*pLookup)("lib3mf_component_getuuid", (void**)&(pWrapperTable->m_Component_GetUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_Component_GetUUID == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_addcolorgroup", (void**)&(pWrapperTable->m_Model_AddColorGroup)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddColorGroup == nullptr) ) + eLookupError = (*pLookup)("lib3mf_component_setuuid", (void**)&(pWrapperTable->m_Component_SetUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_Component_SetUUID == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_addtexture2dgroup", (void**)&(pWrapperTable->m_Model_AddTexture2DGroup)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddTexture2DGroup == nullptr) ) + eLookupError = (*pLookup)("lib3mf_component_hastransform", (void**)&(pWrapperTable->m_Component_HasTransform)); + if ( (eLookupError != 0) || (pWrapperTable->m_Component_HasTransform == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_addcompositematerials", (void**)&(pWrapperTable->m_Model_AddCompositeMaterials)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddCompositeMaterials == nullptr) ) + eLookupError = (*pLookup)("lib3mf_component_gettransform", (void**)&(pWrapperTable->m_Component_GetTransform)); + if ( (eLookupError != 0) || (pWrapperTable->m_Component_GetTransform == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_addmultipropertygroup", (void**)&(pWrapperTable->m_Model_AddMultiPropertyGroup)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddMultiPropertyGroup == nullptr) ) + eLookupError = (*pLookup)("lib3mf_component_settransform", (void**)&(pWrapperTable->m_Component_SetTransform)); + if ( (eLookupError != 0) || (pWrapperTable->m_Component_SetTransform == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_addbuilditem", (void**)&(pWrapperTable->m_Model_AddBuildItem)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddBuildItem == nullptr) ) + eLookupError = (*pLookup)("lib3mf_componentsobject_addcomponent", (void**)&(pWrapperTable->m_ComponentsObject_AddComponent)); + if ( (eLookupError != 0) || (pWrapperTable->m_ComponentsObject_AddComponent == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_removebuilditem", (void**)&(pWrapperTable->m_Model_RemoveBuildItem)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_RemoveBuildItem == nullptr) ) + eLookupError = (*pLookup)("lib3mf_componentsobject_getcomponent", (void**)&(pWrapperTable->m_ComponentsObject_GetComponent)); + if ( (eLookupError != 0) || (pWrapperTable->m_ComponentsObject_GetComponent == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getmetadatagroup", (void**)&(pWrapperTable->m_Model_GetMetaDataGroup)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetMetaDataGroup == nullptr) ) + eLookupError = (*pLookup)("lib3mf_componentsobject_getcomponentcount", (void**)&(pWrapperTable->m_ComponentsObject_GetComponentCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_ComponentsObject_GetComponentCount == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_addattachment", (void**)&(pWrapperTable->m_Model_AddAttachment)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddAttachment == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamset_setname", (void**)&(pWrapperTable->m_BeamSet_SetName)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamSet_SetName == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_removeattachment", (void**)&(pWrapperTable->m_Model_RemoveAttachment)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_RemoveAttachment == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamset_getname", (void**)&(pWrapperTable->m_BeamSet_GetName)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamSet_GetName == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getattachment", (void**)&(pWrapperTable->m_Model_GetAttachment)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetAttachment == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamset_setidentifier", (void**)&(pWrapperTable->m_BeamSet_SetIdentifier)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamSet_SetIdentifier == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_findattachment", (void**)&(pWrapperTable->m_Model_FindAttachment)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_FindAttachment == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamset_getidentifier", (void**)&(pWrapperTable->m_BeamSet_GetIdentifier)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamSet_GetIdentifier == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getattachmentcount", (void**)&(pWrapperTable->m_Model_GetAttachmentCount)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetAttachmentCount == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamset_getreferencecount", (void**)&(pWrapperTable->m_BeamSet_GetReferenceCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamSet_GetReferenceCount == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_haspackagethumbnailattachment", (void**)&(pWrapperTable->m_Model_HasPackageThumbnailAttachment)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_HasPackageThumbnailAttachment == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamset_setreferences", (void**)&(pWrapperTable->m_BeamSet_SetReferences)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamSet_SetReferences == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_createpackagethumbnailattachment", (void**)&(pWrapperTable->m_Model_CreatePackageThumbnailAttachment)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_CreatePackageThumbnailAttachment == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamset_getreferences", (void**)&(pWrapperTable->m_BeamSet_GetReferences)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamSet_GetReferences == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getpackagethumbnailattachment", (void**)&(pWrapperTable->m_Model_GetPackageThumbnailAttachment)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetPackageThumbnailAttachment == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamset_getballreferencecount", (void**)&(pWrapperTable->m_BeamSet_GetBallReferenceCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamSet_GetBallReferenceCount == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_removepackagethumbnailattachment", (void**)&(pWrapperTable->m_Model_RemovePackageThumbnailAttachment)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_RemovePackageThumbnailAttachment == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamset_setballreferences", (void**)&(pWrapperTable->m_BeamSet_SetBallReferences)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamSet_SetBallReferences == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_addcustomcontenttype", (void**)&(pWrapperTable->m_Model_AddCustomContentType)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddCustomContentType == nullptr) ) + eLookupError = (*pLookup)("lib3mf_beamset_getballreferences", (void**)&(pWrapperTable->m_BeamSet_GetBallReferences)); + if ( (eLookupError != 0) || (pWrapperTable->m_BeamSet_GetBallReferences == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_removecustomcontenttype", (void**)&(pWrapperTable->m_Model_RemoveCustomContentType)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_RemoveCustomContentType == nullptr) ) + eLookupError = (*pLookup)("lib3mf_basematerialgroup_getcount", (void**)&(pWrapperTable->m_BaseMaterialGroup_GetCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_BaseMaterialGroup_GetCount == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_setrandomnumbercallback", (void**)&(pWrapperTable->m_Model_SetRandomNumberCallback)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_SetRandomNumberCallback == nullptr) ) + eLookupError = (*pLookup)("lib3mf_basematerialgroup_getallpropertyids", (void**)&(pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs)); + if ( (eLookupError != 0) || (pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_model_getkeystore", (void**)&(pWrapperTable->m_Model_GetKeyStore)); - if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetKeyStore == nullptr) ) + eLookupError = (*pLookup)("lib3mf_basematerialgroup_addmaterial", (void**)&(pWrapperTable->m_BaseMaterialGroup_AddMaterial)); + if ( (eLookupError != 0) || (pWrapperTable->m_BaseMaterialGroup_AddMaterial == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_getlibraryversion", (void**)&(pWrapperTable->m_GetLibraryVersion)); - if ( (eLookupError != 0) || (pWrapperTable->m_GetLibraryVersion == nullptr) ) + eLookupError = (*pLookup)("lib3mf_basematerialgroup_removematerial", (void**)&(pWrapperTable->m_BaseMaterialGroup_RemoveMaterial)); + if ( (eLookupError != 0) || (pWrapperTable->m_BaseMaterialGroup_RemoveMaterial == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_getprereleaseinformation", (void**)&(pWrapperTable->m_GetPrereleaseInformation)); - if ( (eLookupError != 0) || (pWrapperTable->m_GetPrereleaseInformation == nullptr) ) + eLookupError = (*pLookup)("lib3mf_basematerialgroup_getname", (void**)&(pWrapperTable->m_BaseMaterialGroup_GetName)); + if ( (eLookupError != 0) || (pWrapperTable->m_BaseMaterialGroup_GetName == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_getbuildinformation", (void**)&(pWrapperTable->m_GetBuildInformation)); - if ( (eLookupError != 0) || (pWrapperTable->m_GetBuildInformation == nullptr) ) + eLookupError = (*pLookup)("lib3mf_basematerialgroup_setname", (void**)&(pWrapperTable->m_BaseMaterialGroup_SetName)); + if ( (eLookupError != 0) || (pWrapperTable->m_BaseMaterialGroup_SetName == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_getspecificationversion", (void**)&(pWrapperTable->m_GetSpecificationVersion)); - if ( (eLookupError != 0) || (pWrapperTable->m_GetSpecificationVersion == nullptr) ) + eLookupError = (*pLookup)("lib3mf_basematerialgroup_setdisplaycolor", (void**)&(pWrapperTable->m_BaseMaterialGroup_SetDisplayColor)); + if ( (eLookupError != 0) || (pWrapperTable->m_BaseMaterialGroup_SetDisplayColor == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_createmodel", (void**)&(pWrapperTable->m_CreateModel)); - if ( (eLookupError != 0) || (pWrapperTable->m_CreateModel == nullptr) ) + eLookupError = (*pLookup)("lib3mf_basematerialgroup_getdisplaycolor", (void**)&(pWrapperTable->m_BaseMaterialGroup_GetDisplayColor)); + if ( (eLookupError != 0) || (pWrapperTable->m_BaseMaterialGroup_GetDisplayColor == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_release", (void**)&(pWrapperTable->m_Release)); - if ( (eLookupError != 0) || (pWrapperTable->m_Release == nullptr) ) + eLookupError = (*pLookup)("lib3mf_colorgroup_getcount", (void**)&(pWrapperTable->m_ColorGroup_GetCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_ColorGroup_GetCount == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_acquire", (void**)&(pWrapperTable->m_Acquire)); - if ( (eLookupError != 0) || (pWrapperTable->m_Acquire == nullptr) ) + eLookupError = (*pLookup)("lib3mf_colorgroup_getallpropertyids", (void**)&(pWrapperTable->m_ColorGroup_GetAllPropertyIDs)); + if ( (eLookupError != 0) || (pWrapperTable->m_ColorGroup_GetAllPropertyIDs == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_setjournal", (void**)&(pWrapperTable->m_SetJournal)); - if ( (eLookupError != 0) || (pWrapperTable->m_SetJournal == nullptr) ) + eLookupError = (*pLookup)("lib3mf_colorgroup_addcolor", (void**)&(pWrapperTable->m_ColorGroup_AddColor)); + if ( (eLookupError != 0) || (pWrapperTable->m_ColorGroup_AddColor == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_getlasterror", (void**)&(pWrapperTable->m_GetLastError)); - if ( (eLookupError != 0) || (pWrapperTable->m_GetLastError == nullptr) ) + eLookupError = (*pLookup)("lib3mf_colorgroup_removecolor", (void**)&(pWrapperTable->m_ColorGroup_RemoveColor)); + if ( (eLookupError != 0) || (pWrapperTable->m_ColorGroup_RemoveColor == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_getsymbollookupmethod", (void**)&(pWrapperTable->m_GetSymbolLookupMethod)); - if ( (eLookupError != 0) || (pWrapperTable->m_GetSymbolLookupMethod == nullptr) ) + eLookupError = (*pLookup)("lib3mf_colorgroup_setcolor", (void**)&(pWrapperTable->m_ColorGroup_SetColor)); + if ( (eLookupError != 0) || (pWrapperTable->m_ColorGroup_SetColor == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_retrieveprogressmessage", (void**)&(pWrapperTable->m_RetrieveProgressMessage)); - if ( (eLookupError != 0) || (pWrapperTable->m_RetrieveProgressMessage == nullptr) ) + eLookupError = (*pLookup)("lib3mf_colorgroup_getcolor", (void**)&(pWrapperTable->m_ColorGroup_GetColor)); + if ( (eLookupError != 0) || (pWrapperTable->m_ColorGroup_GetColor == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_rgbatocolor", (void**)&(pWrapperTable->m_RGBAToColor)); - if ( (eLookupError != 0) || (pWrapperTable->m_RGBAToColor == nullptr) ) + eLookupError = (*pLookup)("lib3mf_texture2dgroup_getcount", (void**)&(pWrapperTable->m_Texture2DGroup_GetCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_Texture2DGroup_GetCount == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_floatrgbatocolor", (void**)&(pWrapperTable->m_FloatRGBAToColor)); - if ( (eLookupError != 0) || (pWrapperTable->m_FloatRGBAToColor == nullptr) ) + eLookupError = (*pLookup)("lib3mf_texture2dgroup_getallpropertyids", (void**)&(pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs)); + if ( (eLookupError != 0) || (pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_colortorgba", (void**)&(pWrapperTable->m_ColorToRGBA)); - if ( (eLookupError != 0) || (pWrapperTable->m_ColorToRGBA == nullptr) ) + eLookupError = (*pLookup)("lib3mf_texture2dgroup_addtex2coord", (void**)&(pWrapperTable->m_Texture2DGroup_AddTex2Coord)); + if ( (eLookupError != 0) || (pWrapperTable->m_Texture2DGroup_AddTex2Coord == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_colortofloatrgba", (void**)&(pWrapperTable->m_ColorToFloatRGBA)); - if ( (eLookupError != 0) || (pWrapperTable->m_ColorToFloatRGBA == nullptr) ) + eLookupError = (*pLookup)("lib3mf_texture2dgroup_gettex2coord", (void**)&(pWrapperTable->m_Texture2DGroup_GetTex2Coord)); + if ( (eLookupError != 0) || (pWrapperTable->m_Texture2DGroup_GetTex2Coord == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_getidentitytransform", (void**)&(pWrapperTable->m_GetIdentityTransform)); - if ( (eLookupError != 0) || (pWrapperTable->m_GetIdentityTransform == nullptr) ) + eLookupError = (*pLookup)("lib3mf_texture2dgroup_removetex2coord", (void**)&(pWrapperTable->m_Texture2DGroup_RemoveTex2Coord)); + if ( (eLookupError != 0) || (pWrapperTable->m_Texture2DGroup_RemoveTex2Coord == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_getuniformscaletransform", (void**)&(pWrapperTable->m_GetUniformScaleTransform)); - if ( (eLookupError != 0) || (pWrapperTable->m_GetUniformScaleTransform == nullptr) ) + eLookupError = (*pLookup)("lib3mf_texture2dgroup_gettexture2d", (void**)&(pWrapperTable->m_Texture2DGroup_GetTexture2D)); + if ( (eLookupError != 0) || (pWrapperTable->m_Texture2DGroup_GetTexture2D == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_getscaletransform", (void**)&(pWrapperTable->m_GetScaleTransform)); - if ( (eLookupError != 0) || (pWrapperTable->m_GetScaleTransform == nullptr) ) + eLookupError = (*pLookup)("lib3mf_compositematerials_getcount", (void**)&(pWrapperTable->m_CompositeMaterials_GetCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_CompositeMaterials_GetCount == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("lib3mf_gettranslationtransform", (void**)&(pWrapperTable->m_GetTranslationTransform)); - if ( (eLookupError != 0) || (pWrapperTable->m_GetTranslationTransform == nullptr) ) + eLookupError = (*pLookup)("lib3mf_compositematerials_getallpropertyids", (void**)&(pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs)); + if ( (eLookupError != 0) || (pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_compositematerials_getbasematerialgroup", (void**)&(pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup)); + if ( (eLookupError != 0) || (pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_compositematerials_addcomposite", (void**)&(pWrapperTable->m_CompositeMaterials_AddComposite)); + if ( (eLookupError != 0) || (pWrapperTable->m_CompositeMaterials_AddComposite == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_compositematerials_removecomposite", (void**)&(pWrapperTable->m_CompositeMaterials_RemoveComposite)); + if ( (eLookupError != 0) || (pWrapperTable->m_CompositeMaterials_RemoveComposite == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_compositematerials_getcomposite", (void**)&(pWrapperTable->m_CompositeMaterials_GetComposite)); + if ( (eLookupError != 0) || (pWrapperTable->m_CompositeMaterials_GetComposite == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_multipropertygroup_getcount", (void**)&(pWrapperTable->m_MultiPropertyGroup_GetCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_MultiPropertyGroup_GetCount == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_multipropertygroup_getallpropertyids", (void**)&(pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs)); + if ( (eLookupError != 0) || (pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_multipropertygroup_addmultiproperty", (void**)&(pWrapperTable->m_MultiPropertyGroup_AddMultiProperty)); + if ( (eLookupError != 0) || (pWrapperTable->m_MultiPropertyGroup_AddMultiProperty == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_multipropertygroup_setmultiproperty", (void**)&(pWrapperTable->m_MultiPropertyGroup_SetMultiProperty)); + if ( (eLookupError != 0) || (pWrapperTable->m_MultiPropertyGroup_SetMultiProperty == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_multipropertygroup_getmultiproperty", (void**)&(pWrapperTable->m_MultiPropertyGroup_GetMultiProperty)); + if ( (eLookupError != 0) || (pWrapperTable->m_MultiPropertyGroup_GetMultiProperty == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_multipropertygroup_removemultiproperty", (void**)&(pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty)); + if ( (eLookupError != 0) || (pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_multipropertygroup_getlayercount", (void**)&(pWrapperTable->m_MultiPropertyGroup_GetLayerCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_MultiPropertyGroup_GetLayerCount == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_multipropertygroup_addlayer", (void**)&(pWrapperTable->m_MultiPropertyGroup_AddLayer)); + if ( (eLookupError != 0) || (pWrapperTable->m_MultiPropertyGroup_AddLayer == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_multipropertygroup_getlayer", (void**)&(pWrapperTable->m_MultiPropertyGroup_GetLayer)); + if ( (eLookupError != 0) || (pWrapperTable->m_MultiPropertyGroup_GetLayer == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_multipropertygroup_removelayer", (void**)&(pWrapperTable->m_MultiPropertyGroup_RemoveLayer)); + if ( (eLookupError != 0) || (pWrapperTable->m_MultiPropertyGroup_RemoveLayer == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_attachment_getpath", (void**)&(pWrapperTable->m_Attachment_GetPath)); + if ( (eLookupError != 0) || (pWrapperTable->m_Attachment_GetPath == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_attachment_setpath", (void**)&(pWrapperTable->m_Attachment_SetPath)); + if ( (eLookupError != 0) || (pWrapperTable->m_Attachment_SetPath == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_attachment_packagepart", (void**)&(pWrapperTable->m_Attachment_PackagePart)); + if ( (eLookupError != 0) || (pWrapperTable->m_Attachment_PackagePart == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_attachment_getrelationshiptype", (void**)&(pWrapperTable->m_Attachment_GetRelationShipType)); + if ( (eLookupError != 0) || (pWrapperTable->m_Attachment_GetRelationShipType == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_attachment_setrelationshiptype", (void**)&(pWrapperTable->m_Attachment_SetRelationShipType)); + if ( (eLookupError != 0) || (pWrapperTable->m_Attachment_SetRelationShipType == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_attachment_writetofile", (void**)&(pWrapperTable->m_Attachment_WriteToFile)); + if ( (eLookupError != 0) || (pWrapperTable->m_Attachment_WriteToFile == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_attachment_readfromfile", (void**)&(pWrapperTable->m_Attachment_ReadFromFile)); + if ( (eLookupError != 0) || (pWrapperTable->m_Attachment_ReadFromFile == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_attachment_readfromcallback", (void**)&(pWrapperTable->m_Attachment_ReadFromCallback)); + if ( (eLookupError != 0) || (pWrapperTable->m_Attachment_ReadFromCallback == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_attachment_getstreamsize", (void**)&(pWrapperTable->m_Attachment_GetStreamSize)); + if ( (eLookupError != 0) || (pWrapperTable->m_Attachment_GetStreamSize == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_attachment_writetobuffer", (void**)&(pWrapperTable->m_Attachment_WriteToBuffer)); + if ( (eLookupError != 0) || (pWrapperTable->m_Attachment_WriteToBuffer == nullptr) ) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; - return LIB3MF_SUCCESS; -} - - + eLookupError = (*pLookup)("lib3mf_attachment_readfrombuffer", (void**)&(pWrapperTable->m_Attachment_ReadFromBuffer)); + if ( (eLookupError != 0) || (pWrapperTable->m_Attachment_ReadFromBuffer == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_texture2d_getattachment", (void**)&(pWrapperTable->m_Texture2D_GetAttachment)); + if ( (eLookupError != 0) || (pWrapperTable->m_Texture2D_GetAttachment == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_texture2d_setattachment", (void**)&(pWrapperTable->m_Texture2D_SetAttachment)); + if ( (eLookupError != 0) || (pWrapperTable->m_Texture2D_SetAttachment == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_texture2d_getcontenttype", (void**)&(pWrapperTable->m_Texture2D_GetContentType)); + if ( (eLookupError != 0) || (pWrapperTable->m_Texture2D_GetContentType == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_texture2d_setcontenttype", (void**)&(pWrapperTable->m_Texture2D_SetContentType)); + if ( (eLookupError != 0) || (pWrapperTable->m_Texture2D_SetContentType == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_texture2d_gettilestyleuv", (void**)&(pWrapperTable->m_Texture2D_GetTileStyleUV)); + if ( (eLookupError != 0) || (pWrapperTable->m_Texture2D_GetTileStyleUV == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_texture2d_settilestyleuv", (void**)&(pWrapperTable->m_Texture2D_SetTileStyleUV)); + if ( (eLookupError != 0) || (pWrapperTable->m_Texture2D_SetTileStyleUV == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_texture2d_getfilter", (void**)&(pWrapperTable->m_Texture2D_GetFilter)); + if ( (eLookupError != 0) || (pWrapperTable->m_Texture2D_GetFilter == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_texture2d_setfilter", (void**)&(pWrapperTable->m_Texture2D_SetFilter)); + if ( (eLookupError != 0) || (pWrapperTable->m_Texture2D_SetFilter == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_builditem_getobjectresource", (void**)&(pWrapperTable->m_BuildItem_GetObjectResource)); + if ( (eLookupError != 0) || (pWrapperTable->m_BuildItem_GetObjectResource == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_builditem_getuuid", (void**)&(pWrapperTable->m_BuildItem_GetUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_BuildItem_GetUUID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_builditem_setuuid", (void**)&(pWrapperTable->m_BuildItem_SetUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_BuildItem_SetUUID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_builditem_getobjectresourceid", (void**)&(pWrapperTable->m_BuildItem_GetObjectResourceID)); + if ( (eLookupError != 0) || (pWrapperTable->m_BuildItem_GetObjectResourceID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_builditem_hasobjecttransform", (void**)&(pWrapperTable->m_BuildItem_HasObjectTransform)); + if ( (eLookupError != 0) || (pWrapperTable->m_BuildItem_HasObjectTransform == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_builditem_getobjecttransform", (void**)&(pWrapperTable->m_BuildItem_GetObjectTransform)); + if ( (eLookupError != 0) || (pWrapperTable->m_BuildItem_GetObjectTransform == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_builditem_setobjecttransform", (void**)&(pWrapperTable->m_BuildItem_SetObjectTransform)); + if ( (eLookupError != 0) || (pWrapperTable->m_BuildItem_SetObjectTransform == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_builditem_getpartnumber", (void**)&(pWrapperTable->m_BuildItem_GetPartNumber)); + if ( (eLookupError != 0) || (pWrapperTable->m_BuildItem_GetPartNumber == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_builditem_setpartnumber", (void**)&(pWrapperTable->m_BuildItem_SetPartNumber)); + if ( (eLookupError != 0) || (pWrapperTable->m_BuildItem_SetPartNumber == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_builditem_getmetadatagroup", (void**)&(pWrapperTable->m_BuildItem_GetMetaDataGroup)); + if ( (eLookupError != 0) || (pWrapperTable->m_BuildItem_GetMetaDataGroup == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_builditem_getoutbox", (void**)&(pWrapperTable->m_BuildItem_GetOutbox)); + if ( (eLookupError != 0) || (pWrapperTable->m_BuildItem_GetOutbox == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_builditemiterator_movenext", (void**)&(pWrapperTable->m_BuildItemIterator_MoveNext)); + if ( (eLookupError != 0) || (pWrapperTable->m_BuildItemIterator_MoveNext == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_builditemiterator_moveprevious", (void**)&(pWrapperTable->m_BuildItemIterator_MovePrevious)); + if ( (eLookupError != 0) || (pWrapperTable->m_BuildItemIterator_MovePrevious == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_builditemiterator_getcurrent", (void**)&(pWrapperTable->m_BuildItemIterator_GetCurrent)); + if ( (eLookupError != 0) || (pWrapperTable->m_BuildItemIterator_GetCurrent == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_builditemiterator_clone", (void**)&(pWrapperTable->m_BuildItemIterator_Clone)); + if ( (eLookupError != 0) || (pWrapperTable->m_BuildItemIterator_Clone == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_builditemiterator_count", (void**)&(pWrapperTable->m_BuildItemIterator_Count)); + if ( (eLookupError != 0) || (pWrapperTable->m_BuildItemIterator_Count == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_slice_setvertices", (void**)&(pWrapperTable->m_Slice_SetVertices)); + if ( (eLookupError != 0) || (pWrapperTable->m_Slice_SetVertices == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_slice_getvertices", (void**)&(pWrapperTable->m_Slice_GetVertices)); + if ( (eLookupError != 0) || (pWrapperTable->m_Slice_GetVertices == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_slice_getvertexcount", (void**)&(pWrapperTable->m_Slice_GetVertexCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_Slice_GetVertexCount == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_slice_addpolygon", (void**)&(pWrapperTable->m_Slice_AddPolygon)); + if ( (eLookupError != 0) || (pWrapperTable->m_Slice_AddPolygon == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_slice_getpolygoncount", (void**)&(pWrapperTable->m_Slice_GetPolygonCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_Slice_GetPolygonCount == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_slice_setpolygonindices", (void**)&(pWrapperTable->m_Slice_SetPolygonIndices)); + if ( (eLookupError != 0) || (pWrapperTable->m_Slice_SetPolygonIndices == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_slice_getpolygonindices", (void**)&(pWrapperTable->m_Slice_GetPolygonIndices)); + if ( (eLookupError != 0) || (pWrapperTable->m_Slice_GetPolygonIndices == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_slice_getpolygonindexcount", (void**)&(pWrapperTable->m_Slice_GetPolygonIndexCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_Slice_GetPolygonIndexCount == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_slice_getztop", (void**)&(pWrapperTable->m_Slice_GetZTop)); + if ( (eLookupError != 0) || (pWrapperTable->m_Slice_GetZTop == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathprofile_getuuid", (void**)&(pWrapperTable->m_ToolpathProfile_GetUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathProfile_GetUUID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathprofile_getname", (void**)&(pWrapperTable->m_ToolpathProfile_GetName)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathProfile_GetName == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathprofile_getparametercount", (void**)&(pWrapperTable->m_ToolpathProfile_GetParameterCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathProfile_GetParameterCount == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathprofile_getparametername", (void**)&(pWrapperTable->m_ToolpathProfile_GetParameterName)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathProfile_GetParameterName == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathprofile_getparameternamespace", (void**)&(pWrapperTable->m_ToolpathProfile_GetParameterNameSpace)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathProfile_GetParameterNameSpace == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathprofile_hasparametervalue", (void**)&(pWrapperTable->m_ToolpathProfile_HasParameterValue)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathProfile_HasParameterValue == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathprofile_getparametervalue", (void**)&(pWrapperTable->m_ToolpathProfile_GetParameterValue)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathProfile_GetParameterValue == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathprofile_getparametervaluedef", (void**)&(pWrapperTable->m_ToolpathProfile_GetParameterValueDef)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathProfile_GetParameterValueDef == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathprofile_getparameterdoublevalue", (void**)&(pWrapperTable->m_ToolpathProfile_GetParameterDoubleValue)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathProfile_GetParameterDoubleValue == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathprofile_getparameterdoublevaluedef", (void**)&(pWrapperTable->m_ToolpathProfile_GetParameterDoubleValueDef)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathProfile_GetParameterDoubleValueDef == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathprofile_getparameterintegervalue", (void**)&(pWrapperTable->m_ToolpathProfile_GetParameterIntegerValue)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathProfile_GetParameterIntegerValue == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathprofile_getparameterintegervaluedef", (void**)&(pWrapperTable->m_ToolpathProfile_GetParameterIntegerValueDef)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathProfile_GetParameterIntegerValueDef == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathprofile_getparameterboolvalue", (void**)&(pWrapperTable->m_ToolpathProfile_GetParameterBoolValue)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathProfile_GetParameterBoolValue == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathprofile_getparameterboolvaluedef", (void**)&(pWrapperTable->m_ToolpathProfile_GetParameterBoolValueDef)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathProfile_GetParameterBoolValueDef == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathprofile_setname", (void**)&(pWrapperTable->m_ToolpathProfile_SetName)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathProfile_SetName == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathprofile_setparametervalue", (void**)&(pWrapperTable->m_ToolpathProfile_SetParameterValue)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathProfile_SetParameterValue == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathprofile_setparameterdoublevalue", (void**)&(pWrapperTable->m_ToolpathProfile_SetParameterDoubleValue)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathProfile_SetParameterDoubleValue == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathprofile_setparameterintegervalue", (void**)&(pWrapperTable->m_ToolpathProfile_SetParameterIntegerValue)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathProfile_SetParameterIntegerValue == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathprofile_setparameterboolvalue", (void**)&(pWrapperTable->m_ToolpathProfile_SetParameterBoolValue)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathProfile_SetParameterBoolValue == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerreader_getlayerdatauuid", (void**)&(pWrapperTable->m_ToolpathLayerReader_GetLayerDataUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerReader_GetLayerDataUUID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerreader_getsegmentcount", (void**)&(pWrapperTable->m_ToolpathLayerReader_GetSegmentCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerReader_GetSegmentCount == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerreader_getsegmentinfo", (void**)&(pWrapperTable->m_ToolpathLayerReader_GetSegmentInfo)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerReader_GetSegmentInfo == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerreader_getsegmentprofile", (void**)&(pWrapperTable->m_ToolpathLayerReader_GetSegmentProfile)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerReader_GetSegmentProfile == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerreader_getsegmentprofileuuid", (void**)&(pWrapperTable->m_ToolpathLayerReader_GetSegmentProfileUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerReader_GetSegmentProfileUUID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerreader_getsegmentpart", (void**)&(pWrapperTable->m_ToolpathLayerReader_GetSegmentPart)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerReader_GetSegmentPart == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerreader_getsegmentpartuuid", (void**)&(pWrapperTable->m_ToolpathLayerReader_GetSegmentPartUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerReader_GetSegmentPartUUID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerreader_getsegmentlocalpartid", (void**)&(pWrapperTable->m_ToolpathLayerReader_GetSegmentLocalPartID)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerReader_GetSegmentLocalPartID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerreader_getpartuuidbylocalpartid", (void**)&(pWrapperTable->m_ToolpathLayerReader_GetPartUUIDByLocalPartID)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerReader_GetPartUUIDByLocalPartID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerreader_getsegmentpointdata", (void**)&(pWrapperTable->m_ToolpathLayerReader_GetSegmentPointData)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerReader_GetSegmentPointData == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerreader_findattributeinfobyname", (void**)&(pWrapperTable->m_ToolpathLayerReader_FindAttributeInfoByName)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerReader_FindAttributeInfoByName == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerreader_findattributeidbyname", (void**)&(pWrapperTable->m_ToolpathLayerReader_FindAttributeIDByName)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerReader_FindAttributeIDByName == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerreader_findattributevaluebyname", (void**)&(pWrapperTable->m_ToolpathLayerReader_FindAttributeValueByName)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerReader_FindAttributeValueByName == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerreader_getsegmentintegerattributebyid", (void**)&(pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByID)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerreader_getsegmentintegerattributebyname", (void**)&(pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByName)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByName == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid", (void**)&(pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByID)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname", (void**)&(pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByName)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByName == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerreader_getcustomdatacount", (void**)&(pWrapperTable->m_ToolpathLayerReader_GetCustomDataCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerReader_GetCustomDataCount == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerreader_getcustomdata", (void**)&(pWrapperTable->m_ToolpathLayerReader_GetCustomData)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerReader_GetCustomData == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerreader_getcustomdataname", (void**)&(pWrapperTable->m_ToolpathLayerReader_GetCustomDataName)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerReader_GetCustomDataName == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerdata_getlayerdatauuid", (void**)&(pWrapperTable->m_ToolpathLayerData_GetLayerDataUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerData_GetLayerDataUUID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerdata_registerprofile", (void**)&(pWrapperTable->m_ToolpathLayerData_RegisterProfile)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerData_RegisterProfile == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerdata_registerbuilditem", (void**)&(pWrapperTable->m_ToolpathLayerData_RegisterBuildItem)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerData_RegisterBuildItem == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerdata_setsegmentattribute", (void**)&(pWrapperTable->m_ToolpathLayerData_SetSegmentAttribute)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerData_SetSegmentAttribute == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerdata_clearsegmentattributes", (void**)&(pWrapperTable->m_ToolpathLayerData_ClearSegmentAttributes)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerData_ClearSegmentAttributes == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerdata_writehatchdata", (void**)&(pWrapperTable->m_ToolpathLayerData_WriteHatchData)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerData_WriteHatchData == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerdata_writeloop", (void**)&(pWrapperTable->m_ToolpathLayerData_WriteLoop)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerData_WriteLoop == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerdata_writepolyline", (void**)&(pWrapperTable->m_ToolpathLayerData_WritePolyline)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerData_WritePolyline == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerdata_addcustomdata", (void**)&(pWrapperTable->m_ToolpathLayerData_AddCustomData)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerData_AddCustomData == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathlayerdata_finish", (void**)&(pWrapperTable->m_ToolpathLayerData_Finish)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathLayerData_Finish == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpath_getunits", (void**)&(pWrapperTable->m_Toolpath_GetUnits)); + if ( (eLookupError != 0) || (pWrapperTable->m_Toolpath_GetUnits == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpath_getlayercount", (void**)&(pWrapperTable->m_Toolpath_GetLayerCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_Toolpath_GetLayerCount == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpath_getprofilecount", (void**)&(pWrapperTable->m_Toolpath_GetProfileCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_Toolpath_GetProfileCount == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpath_addlayer", (void**)&(pWrapperTable->m_Toolpath_AddLayer)); + if ( (eLookupError != 0) || (pWrapperTable->m_Toolpath_AddLayer == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpath_getlayerattachment", (void**)&(pWrapperTable->m_Toolpath_GetLayerAttachment)); + if ( (eLookupError != 0) || (pWrapperTable->m_Toolpath_GetLayerAttachment == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpath_readlayerdata", (void**)&(pWrapperTable->m_Toolpath_ReadLayerData)); + if ( (eLookupError != 0) || (pWrapperTable->m_Toolpath_ReadLayerData == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpath_getlayerpath", (void**)&(pWrapperTable->m_Toolpath_GetLayerPath)); + if ( (eLookupError != 0) || (pWrapperTable->m_Toolpath_GetLayerPath == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpath_getlayerzmax", (void**)&(pWrapperTable->m_Toolpath_GetLayerZMax)); + if ( (eLookupError != 0) || (pWrapperTable->m_Toolpath_GetLayerZMax == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpath_getlayerz", (void**)&(pWrapperTable->m_Toolpath_GetLayerZ)); + if ( (eLookupError != 0) || (pWrapperTable->m_Toolpath_GetLayerZ == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpath_addprofile", (void**)&(pWrapperTable->m_Toolpath_AddProfile)); + if ( (eLookupError != 0) || (pWrapperTable->m_Toolpath_AddProfile == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpath_getprofile", (void**)&(pWrapperTable->m_Toolpath_GetProfile)); + if ( (eLookupError != 0) || (pWrapperTable->m_Toolpath_GetProfile == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpath_getprofileuuid", (void**)&(pWrapperTable->m_Toolpath_GetProfileUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_Toolpath_GetProfileUUID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpath_getcustomdatacount", (void**)&(pWrapperTable->m_Toolpath_GetCustomDataCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_Toolpath_GetCustomDataCount == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpath_getcustomdata", (void**)&(pWrapperTable->m_Toolpath_GetCustomData)); + if ( (eLookupError != 0) || (pWrapperTable->m_Toolpath_GetCustomData == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpath_getcustomdataname", (void**)&(pWrapperTable->m_Toolpath_GetCustomDataName)); + if ( (eLookupError != 0) || (pWrapperTable->m_Toolpath_GetCustomDataName == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpath_hasuniquecustomdata", (void**)&(pWrapperTable->m_Toolpath_HasUniqueCustomData)); + if ( (eLookupError != 0) || (pWrapperTable->m_Toolpath_HasUniqueCustomData == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpath_finduniquecustomdata", (void**)&(pWrapperTable->m_Toolpath_FindUniqueCustomData)); + if ( (eLookupError != 0) || (pWrapperTable->m_Toolpath_FindUniqueCustomData == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpath_addcustomdata", (void**)&(pWrapperTable->m_Toolpath_AddCustomData)); + if ( (eLookupError != 0) || (pWrapperTable->m_Toolpath_AddCustomData == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpath_clearcustomdata", (void**)&(pWrapperTable->m_Toolpath_ClearCustomData)); + if ( (eLookupError != 0) || (pWrapperTable->m_Toolpath_ClearCustomData == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpath_deletecustomdata", (void**)&(pWrapperTable->m_Toolpath_DeleteCustomData)); + if ( (eLookupError != 0) || (pWrapperTable->m_Toolpath_DeleteCustomData == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpath_registercustomintegerattribute", (void**)&(pWrapperTable->m_Toolpath_RegisterCustomIntegerAttribute)); + if ( (eLookupError != 0) || (pWrapperTable->m_Toolpath_RegisterCustomIntegerAttribute == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpath_registercustomdoubleattribute", (void**)&(pWrapperTable->m_Toolpath_RegisterCustomDoubleAttribute)); + if ( (eLookupError != 0) || (pWrapperTable->m_Toolpath_RegisterCustomDoubleAttribute == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_toolpathiterator_getcurrenttoolpath", (void**)&(pWrapperTable->m_ToolpathIterator_GetCurrentToolpath)); + if ( (eLookupError != 0) || (pWrapperTable->m_ToolpathIterator_GetCurrentToolpath == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_slicestack_getbottomz", (void**)&(pWrapperTable->m_SliceStack_GetBottomZ)); + if ( (eLookupError != 0) || (pWrapperTable->m_SliceStack_GetBottomZ == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_slicestack_getslicecount", (void**)&(pWrapperTable->m_SliceStack_GetSliceCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_SliceStack_GetSliceCount == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_slicestack_getslice", (void**)&(pWrapperTable->m_SliceStack_GetSlice)); + if ( (eLookupError != 0) || (pWrapperTable->m_SliceStack_GetSlice == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_slicestack_addslice", (void**)&(pWrapperTable->m_SliceStack_AddSlice)); + if ( (eLookupError != 0) || (pWrapperTable->m_SliceStack_AddSlice == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_slicestack_getslicerefcount", (void**)&(pWrapperTable->m_SliceStack_GetSliceRefCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_SliceStack_GetSliceRefCount == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_slicestack_addslicestackreference", (void**)&(pWrapperTable->m_SliceStack_AddSliceStackReference)); + if ( (eLookupError != 0) || (pWrapperTable->m_SliceStack_AddSliceStackReference == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_slicestack_getslicestackreference", (void**)&(pWrapperTable->m_SliceStack_GetSliceStackReference)); + if ( (eLookupError != 0) || (pWrapperTable->m_SliceStack_GetSliceStackReference == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_slicestack_collapseslicereferences", (void**)&(pWrapperTable->m_SliceStack_CollapseSliceReferences)); + if ( (eLookupError != 0) || (pWrapperTable->m_SliceStack_CollapseSliceReferences == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_slicestack_setownpath", (void**)&(pWrapperTable->m_SliceStack_SetOwnPath)); + if ( (eLookupError != 0) || (pWrapperTable->m_SliceStack_SetOwnPath == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_slicestack_getownpath", (void**)&(pWrapperTable->m_SliceStack_GetOwnPath)); + if ( (eLookupError != 0) || (pWrapperTable->m_SliceStack_GetOwnPath == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_consumer_getconsumerid", (void**)&(pWrapperTable->m_Consumer_GetConsumerID)); + if ( (eLookupError != 0) || (pWrapperTable->m_Consumer_GetConsumerID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_consumer_getkeyid", (void**)&(pWrapperTable->m_Consumer_GetKeyID)); + if ( (eLookupError != 0) || (pWrapperTable->m_Consumer_GetKeyID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_consumer_getkeyvalue", (void**)&(pWrapperTable->m_Consumer_GetKeyValue)); + if ( (eLookupError != 0) || (pWrapperTable->m_Consumer_GetKeyValue == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_accessright_getconsumer", (void**)&(pWrapperTable->m_AccessRight_GetConsumer)); + if ( (eLookupError != 0) || (pWrapperTable->m_AccessRight_GetConsumer == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_accessright_getwrappingalgorithm", (void**)&(pWrapperTable->m_AccessRight_GetWrappingAlgorithm)); + if ( (eLookupError != 0) || (pWrapperTable->m_AccessRight_GetWrappingAlgorithm == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_accessright_getmgfalgorithm", (void**)&(pWrapperTable->m_AccessRight_GetMgfAlgorithm)); + if ( (eLookupError != 0) || (pWrapperTable->m_AccessRight_GetMgfAlgorithm == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_accessright_getdigestmethod", (void**)&(pWrapperTable->m_AccessRight_GetDigestMethod)); + if ( (eLookupError != 0) || (pWrapperTable->m_AccessRight_GetDigestMethod == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_contentencryptionparams_getencryptionalgorithm", (void**)&(pWrapperTable->m_ContentEncryptionParams_GetEncryptionAlgorithm)); + if ( (eLookupError != 0) || (pWrapperTable->m_ContentEncryptionParams_GetEncryptionAlgorithm == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_contentencryptionparams_getkey", (void**)&(pWrapperTable->m_ContentEncryptionParams_GetKey)); + if ( (eLookupError != 0) || (pWrapperTable->m_ContentEncryptionParams_GetKey == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_contentencryptionparams_getinitializationvector", (void**)&(pWrapperTable->m_ContentEncryptionParams_GetInitializationVector)); + if ( (eLookupError != 0) || (pWrapperTable->m_ContentEncryptionParams_GetInitializationVector == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_contentencryptionparams_getauthenticationtag", (void**)&(pWrapperTable->m_ContentEncryptionParams_GetAuthenticationTag)); + if ( (eLookupError != 0) || (pWrapperTable->m_ContentEncryptionParams_GetAuthenticationTag == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_contentencryptionparams_setauthenticationtag", (void**)&(pWrapperTable->m_ContentEncryptionParams_SetAuthenticationTag)); + if ( (eLookupError != 0) || (pWrapperTable->m_ContentEncryptionParams_SetAuthenticationTag == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_contentencryptionparams_getadditionalauthenticationdata", (void**)&(pWrapperTable->m_ContentEncryptionParams_GetAdditionalAuthenticationData)); + if ( (eLookupError != 0) || (pWrapperTable->m_ContentEncryptionParams_GetAdditionalAuthenticationData == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_contentencryptionparams_getdescriptor", (void**)&(pWrapperTable->m_ContentEncryptionParams_GetDescriptor)); + if ( (eLookupError != 0) || (pWrapperTable->m_ContentEncryptionParams_GetDescriptor == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_contentencryptionparams_getkeyuuid", (void**)&(pWrapperTable->m_ContentEncryptionParams_GetKeyUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_ContentEncryptionParams_GetKeyUUID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_resourcedata_getpath", (void**)&(pWrapperTable->m_ResourceData_GetPath)); + if ( (eLookupError != 0) || (pWrapperTable->m_ResourceData_GetPath == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_resourcedata_getencryptionalgorithm", (void**)&(pWrapperTable->m_ResourceData_GetEncryptionAlgorithm)); + if ( (eLookupError != 0) || (pWrapperTable->m_ResourceData_GetEncryptionAlgorithm == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_resourcedata_getcompression", (void**)&(pWrapperTable->m_ResourceData_GetCompression)); + if ( (eLookupError != 0) || (pWrapperTable->m_ResourceData_GetCompression == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_resourcedata_getadditionalauthenticationdata", (void**)&(pWrapperTable->m_ResourceData_GetAdditionalAuthenticationData)); + if ( (eLookupError != 0) || (pWrapperTable->m_ResourceData_GetAdditionalAuthenticationData == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_resourcedatagroup_getkeyuuid", (void**)&(pWrapperTable->m_ResourceDataGroup_GetKeyUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_ResourceDataGroup_GetKeyUUID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_resourcedatagroup_addaccessright", (void**)&(pWrapperTable->m_ResourceDataGroup_AddAccessRight)); + if ( (eLookupError != 0) || (pWrapperTable->m_ResourceDataGroup_AddAccessRight == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_resourcedatagroup_findaccessrightbyconsumer", (void**)&(pWrapperTable->m_ResourceDataGroup_FindAccessRightByConsumer)); + if ( (eLookupError != 0) || (pWrapperTable->m_ResourceDataGroup_FindAccessRightByConsumer == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_resourcedatagroup_removeaccessright", (void**)&(pWrapperTable->m_ResourceDataGroup_RemoveAccessRight)); + if ( (eLookupError != 0) || (pWrapperTable->m_ResourceDataGroup_RemoveAccessRight == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_keystore_addconsumer", (void**)&(pWrapperTable->m_KeyStore_AddConsumer)); + if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_AddConsumer == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_keystore_getconsumercount", (void**)&(pWrapperTable->m_KeyStore_GetConsumerCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_GetConsumerCount == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_keystore_getconsumer", (void**)&(pWrapperTable->m_KeyStore_GetConsumer)); + if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_GetConsumer == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_keystore_removeconsumer", (void**)&(pWrapperTable->m_KeyStore_RemoveConsumer)); + if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_RemoveConsumer == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_keystore_findconsumer", (void**)&(pWrapperTable->m_KeyStore_FindConsumer)); + if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_FindConsumer == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_keystore_getresourcedatagroupcount", (void**)&(pWrapperTable->m_KeyStore_GetResourceDataGroupCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_GetResourceDataGroupCount == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_keystore_addresourcedatagroup", (void**)&(pWrapperTable->m_KeyStore_AddResourceDataGroup)); + if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_AddResourceDataGroup == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_keystore_getresourcedatagroup", (void**)&(pWrapperTable->m_KeyStore_GetResourceDataGroup)); + if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_GetResourceDataGroup == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_keystore_removeresourcedatagroup", (void**)&(pWrapperTable->m_KeyStore_RemoveResourceDataGroup)); + if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_RemoveResourceDataGroup == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_keystore_findresourcedatagroup", (void**)&(pWrapperTable->m_KeyStore_FindResourceDataGroup)); + if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_FindResourceDataGroup == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_keystore_addresourcedata", (void**)&(pWrapperTable->m_KeyStore_AddResourceData)); + if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_AddResourceData == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_keystore_removeresourcedata", (void**)&(pWrapperTable->m_KeyStore_RemoveResourceData)); + if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_RemoveResourceData == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_keystore_findresourcedata", (void**)&(pWrapperTable->m_KeyStore_FindResourceData)); + if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_FindResourceData == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_keystore_getresourcedatacount", (void**)&(pWrapperTable->m_KeyStore_GetResourceDataCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_GetResourceDataCount == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_keystore_getresourcedata", (void**)&(pWrapperTable->m_KeyStore_GetResourceData)); + if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_GetResourceData == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_keystore_getuuid", (void**)&(pWrapperTable->m_KeyStore_GetUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_GetUUID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_keystore_setuuid", (void**)&(pWrapperTable->m_KeyStore_SetUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_KeyStore_SetUUID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_rootmodelpart", (void**)&(pWrapperTable->m_Model_RootModelPart)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_RootModelPart == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_findorcreatepackagepart", (void**)&(pWrapperTable->m_Model_FindOrCreatePackagePart)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_FindOrCreatePackagePart == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_setunit", (void**)&(pWrapperTable->m_Model_SetUnit)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_SetUnit == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getunit", (void**)&(pWrapperTable->m_Model_GetUnit)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetUnit == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getlanguage", (void**)&(pWrapperTable->m_Model_GetLanguage)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetLanguage == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_setlanguage", (void**)&(pWrapperTable->m_Model_SetLanguage)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_SetLanguage == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_querywriter", (void**)&(pWrapperTable->m_Model_QueryWriter)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_QueryWriter == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_queryreader", (void**)&(pWrapperTable->m_Model_QueryReader)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_QueryReader == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getresourcebyid", (void**)&(pWrapperTable->m_Model_GetResourceByID)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetResourceByID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_gettexture2dbyid", (void**)&(pWrapperTable->m_Model_GetTexture2DByID)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetTexture2DByID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getpropertytypebyid", (void**)&(pWrapperTable->m_Model_GetPropertyTypeByID)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetPropertyTypeByID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getbasematerialgroupbyid", (void**)&(pWrapperTable->m_Model_GetBaseMaterialGroupByID)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetBaseMaterialGroupByID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_gettexture2dgroupbyid", (void**)&(pWrapperTable->m_Model_GetTexture2DGroupByID)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetTexture2DGroupByID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getcompositematerialsbyid", (void**)&(pWrapperTable->m_Model_GetCompositeMaterialsByID)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetCompositeMaterialsByID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getmultipropertygroupbyid", (void**)&(pWrapperTable->m_Model_GetMultiPropertyGroupByID)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetMultiPropertyGroupByID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getmeshobjectbyid", (void**)&(pWrapperTable->m_Model_GetMeshObjectByID)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetMeshObjectByID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getcomponentsobjectbyid", (void**)&(pWrapperTable->m_Model_GetComponentsObjectByID)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetComponentsObjectByID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getcolorgroupbyid", (void**)&(pWrapperTable->m_Model_GetColorGroupByID)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetColorGroupByID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getslicestackbyid", (void**)&(pWrapperTable->m_Model_GetSliceStackByID)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetSliceStackByID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getbuilduuid", (void**)&(pWrapperTable->m_Model_GetBuildUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetBuildUUID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_setbuilduuid", (void**)&(pWrapperTable->m_Model_SetBuildUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_SetBuildUUID == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getbuilditems", (void**)&(pWrapperTable->m_Model_GetBuildItems)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetBuildItems == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getoutbox", (void**)&(pWrapperTable->m_Model_GetOutbox)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetOutbox == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getresources", (void**)&(pWrapperTable->m_Model_GetResources)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetResources == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getobjects", (void**)&(pWrapperTable->m_Model_GetObjects)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetObjects == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getmeshobjects", (void**)&(pWrapperTable->m_Model_GetMeshObjects)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetMeshObjects == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getcomponentsobjects", (void**)&(pWrapperTable->m_Model_GetComponentsObjects)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetComponentsObjects == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_gettexture2ds", (void**)&(pWrapperTable->m_Model_GetTexture2Ds)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetTexture2Ds == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getbasematerialgroups", (void**)&(pWrapperTable->m_Model_GetBaseMaterialGroups)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetBaseMaterialGroups == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getcolorgroups", (void**)&(pWrapperTable->m_Model_GetColorGroups)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetColorGroups == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_gettexture2dgroups", (void**)&(pWrapperTable->m_Model_GetTexture2DGroups)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetTexture2DGroups == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getcompositematerials", (void**)&(pWrapperTable->m_Model_GetCompositeMaterials)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetCompositeMaterials == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getmultipropertygroups", (void**)&(pWrapperTable->m_Model_GetMultiPropertyGroups)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetMultiPropertyGroups == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_gettoolpaths", (void**)&(pWrapperTable->m_Model_GetToolpaths)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetToolpaths == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getslicestacks", (void**)&(pWrapperTable->m_Model_GetSliceStacks)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetSliceStacks == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_mergetomodel", (void**)&(pWrapperTable->m_Model_MergeToModel)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_MergeToModel == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_addmeshobject", (void**)&(pWrapperTable->m_Model_AddMeshObject)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddMeshObject == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_addcomponentsobject", (void**)&(pWrapperTable->m_Model_AddComponentsObject)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddComponentsObject == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_addslicestack", (void**)&(pWrapperTable->m_Model_AddSliceStack)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddSliceStack == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_addtexture2dfromattachment", (void**)&(pWrapperTable->m_Model_AddTexture2DFromAttachment)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddTexture2DFromAttachment == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_addbasematerialgroup", (void**)&(pWrapperTable->m_Model_AddBaseMaterialGroup)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddBaseMaterialGroup == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_addcolorgroup", (void**)&(pWrapperTable->m_Model_AddColorGroup)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddColorGroup == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_addtexture2dgroup", (void**)&(pWrapperTable->m_Model_AddTexture2DGroup)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddTexture2DGroup == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_addcompositematerials", (void**)&(pWrapperTable->m_Model_AddCompositeMaterials)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddCompositeMaterials == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_addmultipropertygroup", (void**)&(pWrapperTable->m_Model_AddMultiPropertyGroup)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddMultiPropertyGroup == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_addbuilditem", (void**)&(pWrapperTable->m_Model_AddBuildItem)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddBuildItem == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_removebuilditem", (void**)&(pWrapperTable->m_Model_RemoveBuildItem)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_RemoveBuildItem == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_addtoolpath", (void**)&(pWrapperTable->m_Model_AddToolpath)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddToolpath == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getmetadatagroup", (void**)&(pWrapperTable->m_Model_GetMetaDataGroup)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetMetaDataGroup == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_addattachment", (void**)&(pWrapperTable->m_Model_AddAttachment)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddAttachment == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_removeattachment", (void**)&(pWrapperTable->m_Model_RemoveAttachment)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_RemoveAttachment == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getattachment", (void**)&(pWrapperTable->m_Model_GetAttachment)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetAttachment == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_findattachment", (void**)&(pWrapperTable->m_Model_FindAttachment)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_FindAttachment == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getattachmentcount", (void**)&(pWrapperTable->m_Model_GetAttachmentCount)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetAttachmentCount == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_haspackagethumbnailattachment", (void**)&(pWrapperTable->m_Model_HasPackageThumbnailAttachment)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_HasPackageThumbnailAttachment == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_createpackagethumbnailattachment", (void**)&(pWrapperTable->m_Model_CreatePackageThumbnailAttachment)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_CreatePackageThumbnailAttachment == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getpackagethumbnailattachment", (void**)&(pWrapperTable->m_Model_GetPackageThumbnailAttachment)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetPackageThumbnailAttachment == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_removepackagethumbnailattachment", (void**)&(pWrapperTable->m_Model_RemovePackageThumbnailAttachment)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_RemovePackageThumbnailAttachment == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_addcustomcontenttype", (void**)&(pWrapperTable->m_Model_AddCustomContentType)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_AddCustomContentType == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_removecustomcontenttype", (void**)&(pWrapperTable->m_Model_RemoveCustomContentType)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_RemoveCustomContentType == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_setrandomnumbercallback", (void**)&(pWrapperTable->m_Model_SetRandomNumberCallback)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_SetRandomNumberCallback == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_getkeystore", (void**)&(pWrapperTable->m_Model_GetKeyStore)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_GetKeyStore == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_createpersistentsourcefromfile", (void**)&(pWrapperTable->m_Model_CreatePersistentSourceFromFile)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_CreatePersistentSourceFromFile == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_createpersistentsourcefrombuffer", (void**)&(pWrapperTable->m_Model_CreatePersistentSourceFromBuffer)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_CreatePersistentSourceFromBuffer == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_model_createpersistentsourcefromcallback", (void**)&(pWrapperTable->m_Model_CreatePersistentSourceFromCallback)); + if ( (eLookupError != 0) || (pWrapperTable->m_Model_CreatePersistentSourceFromCallback == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_getlibraryversion", (void**)&(pWrapperTable->m_GetLibraryVersion)); + if ( (eLookupError != 0) || (pWrapperTable->m_GetLibraryVersion == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_getprereleaseinformation", (void**)&(pWrapperTable->m_GetPrereleaseInformation)); + if ( (eLookupError != 0) || (pWrapperTable->m_GetPrereleaseInformation == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_getbuildinformation", (void**)&(pWrapperTable->m_GetBuildInformation)); + if ( (eLookupError != 0) || (pWrapperTable->m_GetBuildInformation == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_getspecificationversion", (void**)&(pWrapperTable->m_GetSpecificationVersion)); + if ( (eLookupError != 0) || (pWrapperTable->m_GetSpecificationVersion == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_createmodel", (void**)&(pWrapperTable->m_CreateModel)); + if ( (eLookupError != 0) || (pWrapperTable->m_CreateModel == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_release", (void**)&(pWrapperTable->m_Release)); + if ( (eLookupError != 0) || (pWrapperTable->m_Release == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_acquire", (void**)&(pWrapperTable->m_Acquire)); + if ( (eLookupError != 0) || (pWrapperTable->m_Acquire == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_setjournal", (void**)&(pWrapperTable->m_SetJournal)); + if ( (eLookupError != 0) || (pWrapperTable->m_SetJournal == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_getlasterror", (void**)&(pWrapperTable->m_GetLastError)); + if ( (eLookupError != 0) || (pWrapperTable->m_GetLastError == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_getsymbollookupmethod", (void**)&(pWrapperTable->m_GetSymbolLookupMethod)); + if ( (eLookupError != 0) || (pWrapperTable->m_GetSymbolLookupMethod == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_retrieveprogressmessage", (void**)&(pWrapperTable->m_RetrieveProgressMessage)); + if ( (eLookupError != 0) || (pWrapperTable->m_RetrieveProgressMessage == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_rgbatocolor", (void**)&(pWrapperTable->m_RGBAToColor)); + if ( (eLookupError != 0) || (pWrapperTable->m_RGBAToColor == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_floatrgbatocolor", (void**)&(pWrapperTable->m_FloatRGBAToColor)); + if ( (eLookupError != 0) || (pWrapperTable->m_FloatRGBAToColor == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_colortorgba", (void**)&(pWrapperTable->m_ColorToRGBA)); + if ( (eLookupError != 0) || (pWrapperTable->m_ColorToRGBA == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_colortofloatrgba", (void**)&(pWrapperTable->m_ColorToFloatRGBA)); + if ( (eLookupError != 0) || (pWrapperTable->m_ColorToFloatRGBA == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_getidentitytransform", (void**)&(pWrapperTable->m_GetIdentityTransform)); + if ( (eLookupError != 0) || (pWrapperTable->m_GetIdentityTransform == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_getuniformscaletransform", (void**)&(pWrapperTable->m_GetUniformScaleTransform)); + if ( (eLookupError != 0) || (pWrapperTable->m_GetUniformScaleTransform == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_getscaletransform", (void**)&(pWrapperTable->m_GetScaleTransform)); + if ( (eLookupError != 0) || (pWrapperTable->m_GetScaleTransform == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("lib3mf_gettranslationtransform", (void**)&(pWrapperTable->m_GetTranslationTransform)); + if ( (eLookupError != 0) || (pWrapperTable->m_GetTranslationTransform == nullptr) ) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + return LIB3MF_SUCCESS; +} + + + + /** + * Method definitions for class CBase + */ + + /** + * CBase::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer + */ + Lib3MF_uint64 CBase::ClassTypeId() + { + Lib3MF_uint64 resultClassTypeId = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Base_ClassTypeId(m_pHandle, &resultClassTypeId)); + + return resultClassTypeId; + } + + /** + * Method definitions for class CBinaryStream + */ + + /** + * CBinaryStream::GetBinaryPath - Retrieves an binary streams package path for the binary data. + * @return binary streams package binary path. + */ + std::string CBinaryStream::GetBinaryPath() + { + Lib3MF_uint32 bytesNeededPath = 0; + Lib3MF_uint32 bytesWrittenPath = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BinaryStream_GetBinaryPath(m_pHandle, 0, &bytesNeededPath, nullptr)); + std::vector bufferPath(bytesNeededPath); + CheckError(m_pWrapper->m_WrapperTable.m_BinaryStream_GetBinaryPath(m_pHandle, bytesNeededPath, &bytesWrittenPath, &bufferPath[0])); + + return std::string(&bufferPath[0]); + } + + /** + * CBinaryStream::GetIndexPath - Retrieves an binary streams package path for the index data. + * @return binary streams package index path. + */ + std::string CBinaryStream::GetIndexPath() + { + Lib3MF_uint32 bytesNeededPath = 0; + Lib3MF_uint32 bytesWrittenPath = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BinaryStream_GetIndexPath(m_pHandle, 0, &bytesNeededPath, nullptr)); + std::vector bufferPath(bytesNeededPath); + CheckError(m_pWrapper->m_WrapperTable.m_BinaryStream_GetIndexPath(m_pHandle, bytesNeededPath, &bytesWrittenPath, &bufferPath[0])); + + return std::string(&bufferPath[0]); + } + + /** + * CBinaryStream::GetUUID - Retrieves an binary streams uuid. + * @return binary streams uuid + */ + std::string CBinaryStream::GetUUID() + { + Lib3MF_uint32 bytesNeededUUID = 0; + Lib3MF_uint32 bytesWrittenUUID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BinaryStream_GetUUID(m_pHandle, 0, &bytesNeededUUID, nullptr)); + std::vector bufferUUID(bytesNeededUUID); + CheckError(m_pWrapper->m_WrapperTable.m_BinaryStream_GetUUID(m_pHandle, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0])); + + return std::string(&bufferUUID[0]); + } + + /** + * CBinaryStream::DisableDiscretizedArrayCompression - Sets the float compression mode to raw. All subsequent writes will adhere to this mode. + */ + void CBinaryStream::DisableDiscretizedArrayCompression() + { + CheckError(m_pWrapper->m_WrapperTable.m_BinaryStream_DisableDiscretizedArrayCompression(m_pHandle)); + } + + /** + * CBinaryStream::EnableDiscretizedArrayCompression - Sets the compression mode to a quantized array. All subsequent writes will adhere to this mode. + * @param[in] dUnits - Unit factor to use for quantization. + * @param[in] ePredictionType - Prediction type to use for arrays. + */ + void CBinaryStream::EnableDiscretizedArrayCompression(const Lib3MF_double dUnits, const eBinaryStreamPredictionType ePredictionType) + { + CheckError(m_pWrapper->m_WrapperTable.m_BinaryStream_EnableDiscretizedArrayCompression(m_pHandle, dUnits, ePredictionType)); + } + + /** + * CBinaryStream::EnableLZMA - Enables LZMA mode. + * @param[in] nLZMALevel - LZMA Level (0-9) + */ + void CBinaryStream::EnableLZMA(const Lib3MF_uint32 nLZMALevel) + { + CheckError(m_pWrapper->m_WrapperTable.m_BinaryStream_EnableLZMA(m_pHandle, nLZMALevel)); + } + + /** + * CBinaryStream::DisableLZMA - Disables LZMA mode. + */ + void CBinaryStream::DisableLZMA() + { + CheckError(m_pWrapper->m_WrapperTable.m_BinaryStream_DisableLZMA(m_pHandle)); + } + + /** + * Method definitions for class CWriter + */ + + /** + * CWriter::WriteToFile - Writes out the model as file. The file type is specified by the Model Writer class. + * @param[in] sFilename - Filename to write into + */ + void CWriter::WriteToFile(const std::string & sFilename) + { + CheckError(m_pWrapper->m_WrapperTable.m_Writer_WriteToFile(m_pHandle, sFilename.c_str())); + } + + /** + * CWriter::GetStreamSize - Retrieves the size of the full 3MF file stream. + * @return the stream size + */ + Lib3MF_uint64 CWriter::GetStreamSize() + { + Lib3MF_uint64 resultStreamSize = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Writer_GetStreamSize(m_pHandle, &resultStreamSize)); + + return resultStreamSize; + } + + /** + * CWriter::WriteToBuffer - Writes out the 3MF file into a memory buffer + * @param[out] BufferBuffer - buffer to write into + */ + void CWriter::WriteToBuffer(std::vector & BufferBuffer) + { + Lib3MF_uint64 elementsNeededBuffer = 0; + Lib3MF_uint64 elementsWrittenBuffer = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Writer_WriteToBuffer(m_pHandle, 0, &elementsNeededBuffer, nullptr)); + BufferBuffer.resize((size_t) elementsNeededBuffer); + CheckError(m_pWrapper->m_WrapperTable.m_Writer_WriteToBuffer(m_pHandle, elementsNeededBuffer, &elementsWrittenBuffer, BufferBuffer.data())); + } + + /** + * CWriter::WriteToCallback - Writes out the model and passes the data to a provided callback function. The file type is specified by the Model Writer class. + * @param[in] pTheWriteCallback - Callback to call for writing a data chunk + * @param[in] pTheSeekCallback - Callback to call for seeking in the stream + * @param[in] pUserData - Userdata that is passed to the callback function + */ + void CWriter::WriteToCallback(const WriteCallback pTheWriteCallback, const SeekCallback pTheSeekCallback, const Lib3MF_pvoid pUserData) + { + CheckError(m_pWrapper->m_WrapperTable.m_Writer_WriteToCallback(m_pHandle, pTheWriteCallback, pTheSeekCallback, pUserData)); + } + + /** + * CWriter::SetProgressCallback - Set the progress callback for calls to this writer + * @param[in] pProgressCallback - pointer to the callback function. + * @param[in] pUserData - pointer to arbitrary user data that is passed without modification to the callback. + */ + void CWriter::SetProgressCallback(const ProgressCallback pProgressCallback, const Lib3MF_pvoid pUserData) + { + CheckError(m_pWrapper->m_WrapperTable.m_Writer_SetProgressCallback(m_pHandle, pProgressCallback, pUserData)); + } + + /** + * CWriter::GetDecimalPrecision - Returns the number of digits after the decimal point to be written in each vertex coordinate-value. + * @return The number of digits to be written in each vertex coordinate-value after the decimal point. + */ + Lib3MF_uint32 CWriter::GetDecimalPrecision() + { + Lib3MF_uint32 resultDecimalPrecision = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Writer_GetDecimalPrecision(m_pHandle, &resultDecimalPrecision)); + + return resultDecimalPrecision; + } + + /** + * CWriter::SetDecimalPrecision - Sets the number of digits after the decimal point to be written in each vertex coordinate-value. + * @param[in] nDecimalPrecision - The number of digits to be written in each vertex coordinate-value after the decimal point. + */ + void CWriter::SetDecimalPrecision(const Lib3MF_uint32 nDecimalPrecision) + { + CheckError(m_pWrapper->m_WrapperTable.m_Writer_SetDecimalPrecision(m_pHandle, nDecimalPrecision)); + } + + /** + * CWriter::SetStrictModeActive - Activates (deactivates) the strict mode of the reader. + * @param[in] bStrictModeActive - flag whether strict mode is active or not. + */ + void CWriter::SetStrictModeActive(const bool bStrictModeActive) + { + CheckError(m_pWrapper->m_WrapperTable.m_Writer_SetStrictModeActive(m_pHandle, bStrictModeActive)); + } + + /** + * CWriter::GetStrictModeActive - Queries whether the strict mode of the reader is active or not + * @return returns flag whether strict mode is active or not. + */ + bool CWriter::GetStrictModeActive() + { + bool resultStrictModeActive = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Writer_GetStrictModeActive(m_pHandle, &resultStrictModeActive)); + + return resultStrictModeActive; + } + + /** + * CWriter::GetWarning - Returns Warning and Error Information of the read process + * @param[in] nIndex - Index of the Warning. Valid values are 0 to WarningCount - 1 + * @param[out] nErrorCode - filled with the error code of the warning + * @return the message of the warning + */ + std::string CWriter::GetWarning(const Lib3MF_uint32 nIndex, Lib3MF_uint32 & nErrorCode) + { + Lib3MF_uint32 bytesNeededWarning = 0; + Lib3MF_uint32 bytesWrittenWarning = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Writer_GetWarning(m_pHandle, nIndex, &nErrorCode, 0, &bytesNeededWarning, nullptr)); + std::vector bufferWarning(bytesNeededWarning); + CheckError(m_pWrapper->m_WrapperTable.m_Writer_GetWarning(m_pHandle, nIndex, &nErrorCode, bytesNeededWarning, &bytesWrittenWarning, &bufferWarning[0])); + + return std::string(&bufferWarning[0]); + } + + /** + * CWriter::GetWarningCount - Returns Warning and Error Count of the read process + * @return filled with the count of the occurred warnings. + */ + Lib3MF_uint32 CWriter::GetWarningCount() + { + Lib3MF_uint32 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Writer_GetWarningCount(m_pHandle, &resultCount)); + + return resultCount; + } + + /** + * CWriter::AddKeyWrappingCallback - Registers a callback to deal with data key encryption/decryption from keystore + * @param[in] sConsumerID - The ConsumerID to register for + * @param[in] pTheCallback - The callback to be callede for wrapping and encryption key + * @param[in] pUserData - Userdata that is passed to the callback function + */ + void CWriter::AddKeyWrappingCallback(const std::string & sConsumerID, const KeyWrappingCallback pTheCallback, const Lib3MF_pvoid pUserData) + { + CheckError(m_pWrapper->m_WrapperTable.m_Writer_AddKeyWrappingCallback(m_pHandle, sConsumerID.c_str(), pTheCallback, pUserData)); + } + + /** + * CWriter::SetContentEncryptionCallback - Registers a callback to deal with encryption of content + * @param[in] pTheCallback - The callback used to encrypt content + * @param[in] pUserData - Userdata that is passed to the callback function + */ + void CWriter::SetContentEncryptionCallback(const ContentEncryptionCallback pTheCallback, const Lib3MF_pvoid pUserData) + { + CheckError(m_pWrapper->m_WrapperTable.m_Writer_SetContentEncryptionCallback(m_pHandle, pTheCallback, pUserData)); + } + + /** + * CWriter::CreateBinaryStream - Creates a binary stream object. Only applicable for 3MF Writers. + * @param[in] sIndexPath - Package path to write the index into + * @param[in] sBinaryPath - Package path to write raw binary data into + * @return Returns a package path. + */ + PBinaryStream CWriter::CreateBinaryStream(const std::string & sIndexPath, const std::string & sBinaryPath) + { + Lib3MFHandle hBinaryStream = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Writer_CreateBinaryStream(m_pHandle, sIndexPath.c_str(), sBinaryPath.c_str(), &hBinaryStream)); + + if (!hBinaryStream) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBinaryStream))); + } + + /** + * CWriter::AssignBinaryStream - Sets a binary stream for an object. Currently supported objects are Meshes and Toolpath layers. + * @param[in] pInstance - Object instance to assign Binary stream to. + * @param[in] pBinaryStream - Binary stream object to use for this layer. + */ + void CWriter::AssignBinaryStream(classParam pInstance, classParam pBinaryStream) + { + Lib3MFHandle hInstance = pInstance.GetHandle(); + Lib3MFHandle hBinaryStream = pBinaryStream.GetHandle(); + CheckError(m_pWrapper->m_WrapperTable.m_Writer_AssignBinaryStream(m_pHandle, hInstance, hBinaryStream)); + } + + /** + * CWriter::RegisterCustomNamespace - Registers a custom 3MF Namespace. Fails if Prefix is already registered. + * @param[in] sPrefix - Prefix to be used. MUST NOT be empty. MUST be alphanumeric, not starting with a number + * @param[in] sNameSpace - Namespace to be used. MUST NOT be empty. MUST be alphanumeric, not starting with a number + */ + void CWriter::RegisterCustomNamespace(const std::string & sPrefix, const std::string & sNameSpace) + { + CheckError(m_pWrapper->m_WrapperTable.m_Writer_RegisterCustomNamespace(m_pHandle, sPrefix.c_str(), sNameSpace.c_str())); + } + + /** + * Method definitions for class CPersistentReaderSource + */ + + /** + * CPersistentReaderSource::GetSourceType - Retrieves the type of source data. + * @return Reader Source Type + */ + ePersistentReaderSourceType CPersistentReaderSource::GetSourceType() + { + ePersistentReaderSourceType resultSourceType = (ePersistentReaderSourceType) 0; + CheckError(m_pWrapper->m_WrapperTable.m_PersistentReaderSource_GetSourceType(m_pHandle, &resultSourceType)); + + return resultSourceType; + } + + /** + * CPersistentReaderSource::InvalidateSourceData - Invalidates the reader source. Every subsequent read on this data will fail. + */ + void CPersistentReaderSource::InvalidateSourceData() + { + CheckError(m_pWrapper->m_WrapperTable.m_PersistentReaderSource_InvalidateSourceData(m_pHandle)); + } + + /** + * CPersistentReaderSource::SourceDataIsValid - Checks if the source data is valid. Any read on an invalid source object will fail. + * @return The source data is valid. + */ + bool CPersistentReaderSource::SourceDataIsValid() + { + bool resultDataIsValid = 0; + CheckError(m_pWrapper->m_WrapperTable.m_PersistentReaderSource_SourceDataIsValid(m_pHandle, &resultDataIsValid)); + + return resultDataIsValid; + } + + /** + * Method definitions for class CReader + */ + + /** + * CReader::ReadFromPersistentSource - Reads a model from a persistent source object. The object will be referenced until the Model is destroyed or cleared. + * @param[in] pSource - Source object to read from + */ + void CReader::ReadFromPersistentSource(classParam pSource) + { + Lib3MFHandle hSource = pSource.GetHandle(); + CheckError(m_pWrapper->m_WrapperTable.m_Reader_ReadFromPersistentSource(m_pHandle, hSource)); + } + + /** + * CReader::ReadFromFile - Reads a model from a file. The file type is specified by the Model Reader class + * @param[in] sFilename - Filename to read from + */ + void CReader::ReadFromFile(const std::string & sFilename) + { + CheckError(m_pWrapper->m_WrapperTable.m_Reader_ReadFromFile(m_pHandle, sFilename.c_str())); + } + + /** + * CReader::ReadFromBuffer - Reads a model from a memory buffer. + * @param[in] BufferBuffer - Buffer to read from + */ + void CReader::ReadFromBuffer(const CInputVector & BufferBuffer) + { + CheckError(m_pWrapper->m_WrapperTable.m_Reader_ReadFromBuffer(m_pHandle, (Lib3MF_uint64)BufferBuffer.size(), BufferBuffer.data())); + } + + /** + * CReader::ReadFromCallback - Reads a model and from the data provided by a callback function + * @param[in] pTheReadCallback - Callback to call for reading a data chunk + * @param[in] nStreamSize - number of bytes the callback returns + * @param[in] pTheSeekCallback - Callback to call for seeking in the stream. + * @param[in] pUserData - Userdata that is passed to the callback function + */ + void CReader::ReadFromCallback(const ReadCallback pTheReadCallback, const Lib3MF_uint64 nStreamSize, const SeekCallback pTheSeekCallback, const Lib3MF_pvoid pUserData) + { + CheckError(m_pWrapper->m_WrapperTable.m_Reader_ReadFromCallback(m_pHandle, pTheReadCallback, nStreamSize, pTheSeekCallback, pUserData)); + } + + /** + * CReader::SetProgressCallback - Set the progress callback for calls to this writer + * @param[in] pProgressCallback - pointer to the callback function. + * @param[in] pUserData - pointer to arbitrary user data that is passed without modification to the callback. + */ + void CReader::SetProgressCallback(const ProgressCallback pProgressCallback, const Lib3MF_pvoid pUserData) + { + CheckError(m_pWrapper->m_WrapperTable.m_Reader_SetProgressCallback(m_pHandle, pProgressCallback, pUserData)); + } + + /** + * CReader::AddRelationToRead - Adds a relationship type which shall be read as attachment in memory while loading + * @param[in] sRelationShipType - String of the relationship type + */ + void CReader::AddRelationToRead(const std::string & sRelationShipType) + { + CheckError(m_pWrapper->m_WrapperTable.m_Reader_AddRelationToRead(m_pHandle, sRelationShipType.c_str())); + } + + /** + * CReader::RemoveRelationToRead - Removes a relationship type which shall be read as attachment in memory while loading + * @param[in] sRelationShipType - String of the relationship type + */ + void CReader::RemoveRelationToRead(const std::string & sRelationShipType) + { + CheckError(m_pWrapper->m_WrapperTable.m_Reader_RemoveRelationToRead(m_pHandle, sRelationShipType.c_str())); + } + + /** + * CReader::SetStrictModeActive - Activates (deactivates) the strict mode of the reader. + * @param[in] bStrictModeActive - flag whether strict mode is active or not. + */ + void CReader::SetStrictModeActive(const bool bStrictModeActive) + { + CheckError(m_pWrapper->m_WrapperTable.m_Reader_SetStrictModeActive(m_pHandle, bStrictModeActive)); + } + + /** + * CReader::GetStrictModeActive - Queries whether the strict mode of the reader is active or not + * @return returns flag whether strict mode is active or not. + */ + bool CReader::GetStrictModeActive() + { + bool resultStrictModeActive = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Reader_GetStrictModeActive(m_pHandle, &resultStrictModeActive)); + + return resultStrictModeActive; + } + + /** + * CReader::GetWarning - Returns Warning and Error Information of the read process + * @param[in] nIndex - Index of the Warning. Valid values are 0 to WarningCount - 1 + * @param[out] nErrorCode - filled with the error code of the warning + * @return the message of the warning + */ + std::string CReader::GetWarning(const Lib3MF_uint32 nIndex, Lib3MF_uint32 & nErrorCode) + { + Lib3MF_uint32 bytesNeededWarning = 0; + Lib3MF_uint32 bytesWrittenWarning = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Reader_GetWarning(m_pHandle, nIndex, &nErrorCode, 0, &bytesNeededWarning, nullptr)); + std::vector bufferWarning(bytesNeededWarning); + CheckError(m_pWrapper->m_WrapperTable.m_Reader_GetWarning(m_pHandle, nIndex, &nErrorCode, bytesNeededWarning, &bytesWrittenWarning, &bufferWarning[0])); + + return std::string(&bufferWarning[0]); + } + + /** + * CReader::GetWarningCount - Returns Warning and Error Count of the read process + * @return filled with the count of the occurred warnings. + */ + Lib3MF_uint32 CReader::GetWarningCount() + { + Lib3MF_uint32 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Reader_GetWarningCount(m_pHandle, &resultCount)); + + return resultCount; + } + + /** + * CReader::AddKeyWrappingCallback - Registers a callback to deal with key wrapping mechanism from keystore + * @param[in] sConsumerID - The ConsumerID to register for + * @param[in] pTheCallback - The callback used to decrypt data key + * @param[in] pUserData - Userdata that is passed to the callback function + */ + void CReader::AddKeyWrappingCallback(const std::string & sConsumerID, const KeyWrappingCallback pTheCallback, const Lib3MF_pvoid pUserData) + { + CheckError(m_pWrapper->m_WrapperTable.m_Reader_AddKeyWrappingCallback(m_pHandle, sConsumerID.c_str(), pTheCallback, pUserData)); + } + + /** + * CReader::SetContentEncryptionCallback - Registers a callback to deal with encryption of content + * @param[in] pTheCallback - The callback used to encrypt content + * @param[in] pUserData - Userdata that is passed to the callback function + */ + void CReader::SetContentEncryptionCallback(const ContentEncryptionCallback pTheCallback, const Lib3MF_pvoid pUserData) + { + CheckError(m_pWrapper->m_WrapperTable.m_Reader_SetContentEncryptionCallback(m_pHandle, pTheCallback, pUserData)); + } + + /** + * Method definitions for class CPackagePart + */ + + /** + * CPackagePart::GetPath - Returns the absolute path of this PackagePart. + * @return Returns the absolute path of this PackagePart + */ + std::string CPackagePart::GetPath() + { + Lib3MF_uint32 bytesNeededPath = 0; + Lib3MF_uint32 bytesWrittenPath = 0; + CheckError(m_pWrapper->m_WrapperTable.m_PackagePart_GetPath(m_pHandle, 0, &bytesNeededPath, nullptr)); + std::vector bufferPath(bytesNeededPath); + CheckError(m_pWrapper->m_WrapperTable.m_PackagePart_GetPath(m_pHandle, bytesNeededPath, &bytesWrittenPath, &bufferPath[0])); + + return std::string(&bufferPath[0]); + } + + /** + * CPackagePart::SetPath - Sets the absolute path of this PackagePart. + * @param[in] sPath - Sets the absolute path of this PackagePart. + */ + void CPackagePart::SetPath(const std::string & sPath) + { + CheckError(m_pWrapper->m_WrapperTable.m_PackagePart_SetPath(m_pHandle, sPath.c_str())); + } + + /** + * Method definitions for class CResource + */ + + /** + * CResource::GetResourceID - Retrieves the unique id of this resource within a package. This function will be removed in a later release in favor of GetUniqueResourceID + * @return Retrieves the unique id of this resource within a package. + */ + Lib3MF_uint32 CResource::GetResourceID() + { + Lib3MF_uint32 resultUniqueResourceID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Resource_GetResourceID(m_pHandle, &resultUniqueResourceID)); + + return resultUniqueResourceID; + } + + /** + * CResource::GetUniqueResourceID - Retrieves the unique id of this resource within a package. + * @return Retrieves the unique id of this resource within a package. + */ + Lib3MF_uint32 CResource::GetUniqueResourceID() + { + Lib3MF_uint32 resultUniqueResourceID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Resource_GetUniqueResourceID(m_pHandle, &resultUniqueResourceID)); + + return resultUniqueResourceID; + } + + /** + * CResource::PackagePart - Returns the PackagePart within which this resource resides + * @return the PackagePart within which this resource resides. + */ + PPackagePart CResource::PackagePart() + { + Lib3MFHandle hPackagePart = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Resource_PackagePart(m_pHandle, &hPackagePart)); + + if (!hPackagePart) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPackagePart))); + } + + /** + * CResource::SetPackagePart - Sets the new PackagePart within which this resource resides + * @param[in] pPackagePart - the new PackagePart within which this resource resides. + */ + void CResource::SetPackagePart(classParam pPackagePart) + { + Lib3MFHandle hPackagePart = pPackagePart.GetHandle(); + CheckError(m_pWrapper->m_WrapperTable.m_Resource_SetPackagePart(m_pHandle, hPackagePart)); + } + + /** + * CResource::GetModelResourceID - Retrieves the id of this resource within a model. + * @return Retrieves the id of this resource within a model. + */ + Lib3MF_uint32 CResource::GetModelResourceID() + { + Lib3MF_uint32 resultModelResourceId = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Resource_GetModelResourceID(m_pHandle, &resultModelResourceId)); + + return resultModelResourceId; + } + + /** + * Method definitions for class CResourceIterator + */ + + /** + * CResourceIterator::MoveNext - Iterates to the next resource in the list. + * @return Iterates to the next resource in the list. + */ + bool CResourceIterator::MoveNext() + { + bool resultHasNext = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ResourceIterator_MoveNext(m_pHandle, &resultHasNext)); + + return resultHasNext; + } + + /** + * CResourceIterator::MovePrevious - Iterates to the previous resource in the list. + * @return Iterates to the previous resource in the list. + */ + bool CResourceIterator::MovePrevious() + { + bool resultHasPrevious = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ResourceIterator_MovePrevious(m_pHandle, &resultHasPrevious)); + + return resultHasPrevious; + } + + /** + * CResourceIterator::GetCurrent - Returns the resource the iterator points at. + * @return returns the resource instance. + */ + PResource CResourceIterator::GetCurrent() + { + Lib3MFHandle hResource = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_ResourceIterator_GetCurrent(m_pHandle, &hResource)); + + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + } + + /** + * CResourceIterator::Clone - Creates a new resource iterator with the same resource list. + * @return returns the cloned Iterator instance + */ + PResourceIterator CResourceIterator::Clone() + { + Lib3MFHandle hOutResourceIterator = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_ResourceIterator_Clone(m_pHandle, &hOutResourceIterator)); + + if (!hOutResourceIterator) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hOutResourceIterator))); + } + + /** + * CResourceIterator::Count - Returns the number of resoucres the iterator captures. + * @return returns the number of resoucres the iterator captures. + */ + Lib3MF_uint64 CResourceIterator::Count() + { + Lib3MF_uint64 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ResourceIterator_Count(m_pHandle, &resultCount)); + + return resultCount; + } + + /** + * Method definitions for class CCustomXMLAttribute + */ + + /** + * CCustomXMLAttribute::GetName - Retrieves name of the attribute. + * @return returns the name of the attribute. + */ + std::string CCustomXMLAttribute::GetName() + { + Lib3MF_uint32 bytesNeededName = 0; + Lib3MF_uint32 bytesWrittenName = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLAttribute_GetName(m_pHandle, 0, &bytesNeededName, nullptr)); + std::vector bufferName(bytesNeededName); + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLAttribute_GetName(m_pHandle, bytesNeededName, &bytesWrittenName, &bufferName[0])); + + return std::string(&bufferName[0]); + } + + /** + * CCustomXMLAttribute::GetValue - Retrieves value of the attribute as string. + * @return returns the value of the attribute. + */ + std::string CCustomXMLAttribute::GetValue() + { + Lib3MF_uint32 bytesNeededValue = 0; + Lib3MF_uint32 bytesWrittenValue = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLAttribute_GetValue(m_pHandle, 0, &bytesNeededValue, nullptr)); + std::vector bufferValue(bytesNeededValue); + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLAttribute_GetValue(m_pHandle, bytesNeededValue, &bytesWrittenValue, &bufferValue[0])); + + return std::string(&bufferValue[0]); + } + + /** + * CCustomXMLAttribute::IsValidInteger - Checks if the value is a valid integer in the given range. + * @param[in] nMinValue - Minimum allowed value + * @param[in] nMaxValue - Maximum allowed value + * @return returns if the value is a valid integer. + */ + bool CCustomXMLAttribute::IsValidInteger(const Lib3MF_int64 nMinValue, const Lib3MF_int64 nMaxValue) + { + bool resultIsValid = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLAttribute_IsValidInteger(m_pHandle, nMinValue, nMaxValue, &resultIsValid)); + + return resultIsValid; + } + + /** + * CCustomXMLAttribute::GetIntegerValue - Returns the value as integer. Fails if the value is not a valid integer in the given range. + * @param[in] nMinValue - Minimum allowed value + * @param[in] nMaxValue - Maximum allowed value + * @return returns the value. + */ + Lib3MF_int64 CCustomXMLAttribute::GetIntegerValue(const Lib3MF_int64 nMinValue, const Lib3MF_int64 nMaxValue) + { + Lib3MF_int64 resultValue = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLAttribute_GetIntegerValue(m_pHandle, nMinValue, nMaxValue, &resultValue)); + + return resultValue; + } + + /** + * CCustomXMLAttribute::IsValidDouble - Checks if the value is a valid double in the given range. + * @param[in] dMinValue - Minimum allowed value + * @param[in] dMaxValue - Maximum allowed value + * @return returns if the value is a valid double. + */ + bool CCustomXMLAttribute::IsValidDouble(const Lib3MF_double dMinValue, const Lib3MF_double dMaxValue) + { + bool resultIsValid = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLAttribute_IsValidDouble(m_pHandle, dMinValue, dMaxValue, &resultIsValid)); + + return resultIsValid; + } + + /** + * CCustomXMLAttribute::GetDoubleValue - Returns the value as double. Fails if the value is not a valid double in the given range. + * @param[in] dMinValue - Minimum allowed value + * @param[in] dMaxValue - Maximum allowed value + * @return returns the value . + */ + Lib3MF_double CCustomXMLAttribute::GetDoubleValue(const Lib3MF_double dMinValue, const Lib3MF_double dMaxValue) + { + Lib3MF_double resultValue = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLAttribute_GetDoubleValue(m_pHandle, dMinValue, dMaxValue, &resultValue)); + + return resultValue; + } + + /** + * CCustomXMLAttribute::IsValidBool - Checks if the value is a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. + * @return returns if the value is a valid bool. + */ + bool CCustomXMLAttribute::IsValidBool() + { + bool resultIsValid = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLAttribute_IsValidBool(m_pHandle, &resultIsValid)); + + return resultIsValid; + } + + /** + * CCustomXMLAttribute::GetBoolValue - Returns the value as bool. Fails if the value is not a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. + * @param[in] dMinValue - Minimum allowed value + * @param[in] dMaxValue - Maximum allowed value + * @return returns the value . + */ + bool CCustomXMLAttribute::GetBoolValue(const Lib3MF_double dMinValue, const Lib3MF_double dMaxValue) + { + bool resultValue = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLAttribute_GetBoolValue(m_pHandle, dMinValue, dMaxValue, &resultValue)); + + return resultValue; + } + + /** + * CCustomXMLAttribute::SetValue - Sets the value of the attribute as string. + * @param[in] sValue - new value of the attribute. + */ + void CCustomXMLAttribute::SetValue(const std::string & sValue) + { + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLAttribute_SetValue(m_pHandle, sValue.c_str())); + } + + /** + * CCustomXMLAttribute::SetIntegerValue - Sets the value of the attribute as integer. + * @param[in] nValue - new value of the attribute. + */ + void CCustomXMLAttribute::SetIntegerValue(const Lib3MF_int64 nValue) + { + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLAttribute_SetIntegerValue(m_pHandle, nValue)); + } + + /** + * CCustomXMLAttribute::SetDoubleValue - Sets the value of the attribute as double. + * @param[in] dValue - new value of the attribute. + */ + void CCustomXMLAttribute::SetDoubleValue(const Lib3MF_double dValue) + { + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLAttribute_SetDoubleValue(m_pHandle, dValue)); + } + + /** + * CCustomXMLAttribute::SetBoolValue - Sets the value of the attribute as bool. + * @param[in] bValue - new value of the attribute. + */ + void CCustomXMLAttribute::SetBoolValue(const bool bValue) + { + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLAttribute_SetBoolValue(m_pHandle, bValue)); + } + + /** + * CCustomXMLAttribute::Remove - Removes the attribute from its parent node. All subsequent calls to the class will fail. + */ + void CCustomXMLAttribute::Remove() + { + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLAttribute_Remove(m_pHandle)); + } + + /** + * Method definitions for class CCustomXMLNode + */ + + /** + * CCustomXMLNode::GetName - Retrieves name of the node. + * @return returns the name of the node. + */ + std::string CCustomXMLNode::GetName() + { + Lib3MF_uint32 bytesNeededName = 0; + Lib3MF_uint32 bytesWrittenName = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNode_GetName(m_pHandle, 0, &bytesNeededName, nullptr)); + std::vector bufferName(bytesNeededName); + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNode_GetName(m_pHandle, bytesNeededName, &bytesWrittenName, &bufferName[0])); + + return std::string(&bufferName[0]); + } + + /** + * CCustomXMLNode::GetNameSpace - Retrieves namespace of the node. + * @return returns the namespace of the node. + */ + std::string CCustomXMLNode::GetNameSpace() + { + Lib3MF_uint32 bytesNeededNameSpace = 0; + Lib3MF_uint32 bytesWrittenNameSpace = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNode_GetNameSpace(m_pHandle, 0, &bytesNeededNameSpace, nullptr)); + std::vector bufferNameSpace(bytesNeededNameSpace); + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNode_GetNameSpace(m_pHandle, bytesNeededNameSpace, &bytesWrittenNameSpace, &bufferNameSpace[0])); + + return std::string(&bufferNameSpace[0]); + } + + /** + * CCustomXMLNode::GetAttributeCount - Returns number of attributes. + * @return returns the number of attributes. + */ + Lib3MF_uint64 CCustomXMLNode::GetAttributeCount() + { + Lib3MF_uint64 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNode_GetAttributeCount(m_pHandle, &resultCount)); + + return resultCount; + } + + /** + * CCustomXMLNode::GetAttribute - Returns attribute instance. Fails if Index is out of range. + * @param[in] nIndex - Index of the attribute to return (0-based). + * @return XML Document attribute. + */ + PCustomXMLAttribute CCustomXMLNode::GetAttribute(const Lib3MF_uint64 nIndex) + { + Lib3MFHandle hAttributeInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNode_GetAttribute(m_pHandle, nIndex, &hAttributeInstance)); + + if (!hAttributeInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hAttributeInstance))); + } + + /** + * CCustomXMLNode::HasAttribute - Returns if attribute of a specific name exists. + * @param[in] sName - Name of the attribute. + * @return Returns if the attribute exists. + */ + bool CCustomXMLNode::HasAttribute(const std::string & sName) + { + bool resultAttributeExists = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNode_HasAttribute(m_pHandle, sName.c_str(), &resultAttributeExists)); + + return resultAttributeExists; + } + + /** + * CCustomXMLNode::FindAttribute - Returns attribute instance of a specific name. + * @param[in] sName - Name of the attribute. + * @param[in] bMustExist - If true, the call fails if attribute does not exist. If falls, the call will return null if the attribute does not exist. + * @return XML Document attribute. + */ + PCustomXMLAttribute CCustomXMLNode::FindAttribute(const std::string & sName, const bool bMustExist) + { + Lib3MFHandle hAttributeInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNode_FindAttribute(m_pHandle, sName.c_str(), bMustExist, &hAttributeInstance)); + + if (hAttributeInstance) { + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hAttributeInstance))); + } else { + return nullptr; + } + } + + /** + * CCustomXMLNode::RemoveAttribute - Removes the attribute with a specific name. Does nothing if attribute does not exist. + * @param[in] sName - Name of the attribute. + * @return Returns true if an attribute was removed. + */ + bool CCustomXMLNode::RemoveAttribute(const std::string & sName) + { + bool resultAttributeRemoved = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNode_RemoveAttribute(m_pHandle, sName.c_str(), &resultAttributeRemoved)); + + return resultAttributeRemoved; + } + + /** + * CCustomXMLNode::RemoveAttributeByIndex - Removes the attribute with a specific index. Fails if index is invalid + * @param[in] nIndex - Index of the attribute to remove (0-based). + * @return Returns true if an attribute was removed. + */ + bool CCustomXMLNode::RemoveAttributeByIndex(const Lib3MF_uint64 nIndex) + { + bool resultAttributeRemoved = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNode_RemoveAttributeByIndex(m_pHandle, nIndex, &resultAttributeRemoved)); + + return resultAttributeRemoved; + } + + /** + * CCustomXMLNode::AddAttribute - Adds an attribute with a specific name and string value. Fails if attribute already exists. + * @param[in] sName - Name of the attribute. + * @param[in] sValue - Value of the attribute. + */ + void CCustomXMLNode::AddAttribute(const std::string & sName, const std::string & sValue) + { + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNode_AddAttribute(m_pHandle, sName.c_str(), sValue.c_str())); + } + + /** + * CCustomXMLNode::AddIntegerAttribute - Adds an attribute with a specific name and integer value. Fails if attribute already exists. + * @param[in] sName - Name of the attribute. + * @param[in] nValue - Value of the attribute. + */ + void CCustomXMLNode::AddIntegerAttribute(const std::string & sName, const Lib3MF_int64 nValue) + { + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNode_AddIntegerAttribute(m_pHandle, sName.c_str(), nValue)); + } + + /** + * CCustomXMLNode::AddDoubleAttribute - Adds an attribute with a specific name and double value. Fails if attribute already exists. + * @param[in] sName - Name of the attribute. + * @param[in] dValue - Value of the attribute. + */ + void CCustomXMLNode::AddDoubleAttribute(const std::string & sName, const Lib3MF_double dValue) + { + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNode_AddDoubleAttribute(m_pHandle, sName.c_str(), dValue)); + } + + /** + * CCustomXMLNode::AddBoolAttribute - Adds an attribute with a specific name and bool value. Fails if attribute already exists. + * @param[in] sName - Name of the attribute. + * @param[in] bValue - Value of the attribute. + */ + void CCustomXMLNode::AddBoolAttribute(const std::string & sName, const bool bValue) + { + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNode_AddBoolAttribute(m_pHandle, sName.c_str(), bValue)); + } + + /** + * CCustomXMLNode::GetChildren - Returns all the child nodes of the XML Node. + * @return returns the list of child nodes. + */ + PCustomXMLNodes CCustomXMLNode::GetChildren() + { + Lib3MFHandle hChildNodes = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNode_GetChildren(m_pHandle, &hChildNodes)); + + if (!hChildNodes) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hChildNodes))); + } + + /** + * CCustomXMLNode::CountChildrenByName - Returns how many children of the XML Node have a specific name. + * @param[in] sName - Name of the node. + * @return returns the number children with the specified name. + */ + Lib3MF_uint64 CCustomXMLNode::CountChildrenByName(const std::string & sName) + { + Lib3MF_uint64 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNode_CountChildrenByName(m_pHandle, sName.c_str(), &resultCount)); + + return resultCount; + } + + /** + * CCustomXMLNode::GetChildrenByName - Returns all the child nodes of the XML Node with a specific name. + * @param[in] sName - Name of the child. + * @return returns the list of child nodes. + */ + PCustomXMLNodes CCustomXMLNode::GetChildrenByName(const std::string & sName) + { + Lib3MFHandle hChildNodes = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNode_GetChildrenByName(m_pHandle, sName.c_str(), &hChildNodes)); + + if (!hChildNodes) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hChildNodes))); + } + + /** + * CCustomXMLNode::HasChild - Returns if a child with a specific name exist. + * @param[in] sName - Name of the child. + * @return returns if a child with a specific name exists. + */ + bool CCustomXMLNode::HasChild(const std::string & sName) + { + bool resultChildExists = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNode_HasChild(m_pHandle, sName.c_str(), &resultChildExists)); + + return resultChildExists; + } + + /** + * CCustomXMLNode::HasUniqueChild - Returns if a child with a specific name exist once and only once. + * @param[in] sName - Name of the child. + * @return returns if a child with a specific name exists once and only once. + */ + bool CCustomXMLNode::HasUniqueChild(const std::string & sName) + { + bool resultChildExists = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNode_HasUniqueChild(m_pHandle, sName.c_str(), &resultChildExists)); + + return resultChildExists; + } + + /** + * CCustomXMLNode::FindChild - Returns child with a specific name. Throws an error if name does not exist once and only once. + * @param[in] sName - Name of the child. + * @param[in] bMustExist - If true, the call fails if child does not exist. If falls, the call will return null if the child does not exist. + * @return returns child instance or null. + */ + PCustomXMLNode CCustomXMLNode::FindChild(const std::string & sName, const bool bMustExist) + { + Lib3MFHandle hChildInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNode_FindChild(m_pHandle, sName.c_str(), bMustExist, &hChildInstance)); + + if (hChildInstance) { + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hChildInstance))); + } else { + return nullptr; + } + } + + /** + * CCustomXMLNode::AddChild - Adds a new child with a specific name. + * @param[in] sName - Name of the child. + * @return returns child instance. + */ + PCustomXMLNode CCustomXMLNode::AddChild(const std::string & sName) + { + Lib3MFHandle hChildInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNode_AddChild(m_pHandle, sName.c_str(), &hChildInstance)); + + if (!hChildInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hChildInstance))); + } + + /** + * CCustomXMLNode::RemoveChild - Removes a specific child. All subsequent calls to the child will fail after the call. + * @param[in] pChildInstance - child instance to remove. Fails if given instance is not a child of the node. + */ + void CCustomXMLNode::RemoveChild(classParam pChildInstance) + { + Lib3MFHandle hChildInstance = pChildInstance.GetHandle(); + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNode_RemoveChild(m_pHandle, hChildInstance)); + } + + /** + * CCustomXMLNode::RemoveChildrenWithName - Removes all children with a specific name. Does nothing if no child with the name exists. All subsequent calls to the deleted children will fail after the call. + * @param[in] sName - Name of the children. + * @return Returns how many children have been deleted. + */ + Lib3MF_uint64 CCustomXMLNode::RemoveChildrenWithName(const std::string & sName) + { + Lib3MF_uint64 resultNumberOfDeletedChildren = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNode_RemoveChildrenWithName(m_pHandle, sName.c_str(), &resultNumberOfDeletedChildren)); + + return resultNumberOfDeletedChildren; + } + + /** + * CCustomXMLNode::Remove - Removes the node from its parent. The root node of the document can not be removed. Any subsequent call to the node fails after this. + */ + void CCustomXMLNode::Remove() + { + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNode_Remove(m_pHandle)); + } + + /** + * Method definitions for class CCustomXMLNodes + */ + + /** + * CCustomXMLNodes::GetNodeCount - Returns number of nodes. + * @return returns the number of nodes in the list. + */ + Lib3MF_uint64 CCustomXMLNodes::GetNodeCount() + { + Lib3MF_uint64 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNodes_GetNodeCount(m_pHandle, &resultCount)); + + return resultCount; + } + + /** + * CCustomXMLNodes::GetNode - Returns node instance. Fails if Index is out of range. + * @param[in] nIndex - Index of the node to return (0-based). + * @return XML Node node. + */ + PCustomXMLNode CCustomXMLNodes::GetNode(const Lib3MF_uint64 nIndex) + { + Lib3MFHandle hNodeInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNodes_GetNode(m_pHandle, nIndex, &hNodeInstance)); + + if (!hNodeInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNodeInstance))); + } + + /** + * CCustomXMLNodes::CountNodesByName - Returns how many nodes of the XML Node have a specific name. + * @param[in] sName - Name of the node. + * @return returns the number of nodes with the specified name. + */ + Lib3MF_uint64 CCustomXMLNodes::CountNodesByName(const std::string & sName) + { + Lib3MF_uint64 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNodes_CountNodesByName(m_pHandle, sName.c_str(), &resultCount)); + + return resultCount; + } + + /** + * CCustomXMLNodes::GetNodesByName - Returns all the nodes nodes of the XML Node with a specific name. + * @param[in] sName - Name of the node. + * @return returns the list of node nodes. + */ + PCustomXMLNodes CCustomXMLNodes::GetNodesByName(const std::string & sName) + { + Lib3MFHandle hNodes = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNodes_GetNodesByName(m_pHandle, sName.c_str(), &hNodes)); + + if (!hNodes) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNodes))); + } + + /** + * CCustomXMLNodes::HasNode - Returns if a node with a specific name exist. + * @param[in] sName - Name of the node. + * @return returns if a node with a specific name exists. + */ + bool CCustomXMLNodes::HasNode(const std::string & sName) + { + bool resultNodeExists = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNodes_HasNode(m_pHandle, sName.c_str(), &resultNodeExists)); + + return resultNodeExists; + } + + /** + * CCustomXMLNodes::HasUniqueNode - Returns if a node with a specific name exist once and only once. + * @param[in] sName - Name of the node. + * @return returns if a node with a specific name exists once and only once. + */ + bool CCustomXMLNodes::HasUniqueNode(const std::string & sName) + { + bool resultNodeExists = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNodes_HasUniqueNode(m_pHandle, sName.c_str(), &resultNodeExists)); + + return resultNodeExists; + } + + /** + * CCustomXMLNodes::FindNode - Returns node with a specific name. Throws an error if name does not exist once and only once. + * @param[in] sName - Name of the node. + * @param[in] bMustExist - If true, the call fails if node does not exist. If falls, the call will return null if the node does not exist. + * @return returns node instance. + */ + PCustomXMLNode CCustomXMLNodes::FindNode(const std::string & sName, const bool bMustExist) + { + Lib3MFHandle hNodeInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_CustomXMLNodes_FindNode(m_pHandle, sName.c_str(), bMustExist, &hNodeInstance)); + + if (hNodeInstance) { + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hNodeInstance))); + } else { + return nullptr; + } + } + + /** + * Method definitions for class CCustomDOMTree + */ + + /** + * CCustomDOMTree::GetNameSpace - Returns the namespace identifier for the DOM Tree. + * @return returns the namespace of the DOM Tree. + */ + std::string CCustomDOMTree::GetNameSpace() + { + Lib3MF_uint32 bytesNeededNameSpace = 0; + Lib3MF_uint32 bytesWrittenNameSpace = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CustomDOMTree_GetNameSpace(m_pHandle, 0, &bytesNeededNameSpace, nullptr)); + std::vector bufferNameSpace(bytesNeededNameSpace); + CheckError(m_pWrapper->m_WrapperTable.m_CustomDOMTree_GetNameSpace(m_pHandle, bytesNeededNameSpace, &bytesWrittenNameSpace, &bufferNameSpace[0])); + + return std::string(&bufferNameSpace[0]); + } + + /** + * CCustomDOMTree::GetRootNode - Returns root node of the tree. + * @return Root node of the document. + */ + PCustomXMLNode CCustomDOMTree::GetRootNode() + { + Lib3MFHandle hRootNode = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_CustomDOMTree_GetRootNode(m_pHandle, &hRootNode)); + + if (!hRootNode) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hRootNode))); + } + + /** + * CCustomDOMTree::SaveToString - Saves the XML tree into a string. + * @return String with the XML Content. + */ + std::string CCustomDOMTree::SaveToString() + { + Lib3MF_uint32 bytesNeededXMLString = 0; + Lib3MF_uint32 bytesWrittenXMLString = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CustomDOMTree_SaveToString(m_pHandle, 0, &bytesNeededXMLString, nullptr)); + std::vector bufferXMLString(bytesNeededXMLString); + CheckError(m_pWrapper->m_WrapperTable.m_CustomDOMTree_SaveToString(m_pHandle, bytesNeededXMLString, &bytesWrittenXMLString, &bufferXMLString[0])); + + return std::string(&bufferXMLString[0]); + } + + /** + * Method definitions for class CSliceStackIterator + */ + + /** + * CSliceStackIterator::GetCurrentSliceStack - Returns the SliceStack the iterator points at. + * @return returns the SliceStack instance. + */ + PSliceStack CSliceStackIterator::GetCurrentSliceStack() + { + Lib3MFHandle hResource = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_SliceStackIterator_GetCurrentSliceStack(m_pHandle, &hResource)); + + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + } + + /** + * Method definitions for class CObjectIterator + */ + + /** + * CObjectIterator::GetCurrentObject - Returns the Object the iterator points at. + * @return returns the Object instance. + */ + PObject CObjectIterator::GetCurrentObject() + { + Lib3MFHandle hResource = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_ObjectIterator_GetCurrentObject(m_pHandle, &hResource)); + + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + } + + /** + * Method definitions for class CMeshObjectIterator + */ + + /** + * CMeshObjectIterator::GetCurrentMeshObject - Returns the MeshObject the iterator points at. + * @return returns the MeshObject instance. + */ + PMeshObject CMeshObjectIterator::GetCurrentMeshObject() + { + Lib3MFHandle hResource = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MeshObjectIterator_GetCurrentMeshObject(m_pHandle, &hResource)); + + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + } + + /** + * Method definitions for class CComponentsObjectIterator + */ + + /** + * CComponentsObjectIterator::GetCurrentComponentsObject - Returns the ComponentsObject the iterator points at. + * @return returns the ComponentsObject instance. + */ + PComponentsObject CComponentsObjectIterator::GetCurrentComponentsObject() + { + Lib3MFHandle hResource = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_ComponentsObjectIterator_GetCurrentComponentsObject(m_pHandle, &hResource)); + + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + } + + /** + * Method definitions for class CTexture2DIterator + */ + + /** + * CTexture2DIterator::GetCurrentTexture2D - Returns the Texture2D the iterator points at. + * @return returns the Texture2D instance. + */ + PTexture2D CTexture2DIterator::GetCurrentTexture2D() + { + Lib3MFHandle hResource = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Texture2DIterator_GetCurrentTexture2D(m_pHandle, &hResource)); + + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + } + + /** + * Method definitions for class CBaseMaterialGroupIterator + */ + + /** + * CBaseMaterialGroupIterator::GetCurrentBaseMaterialGroup - Returns the MaterialGroup the iterator points at. + * @return returns the BaseMaterialGroup instance. + */ + PBaseMaterialGroup CBaseMaterialGroupIterator::GetCurrentBaseMaterialGroup() + { + Lib3MFHandle hResource = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup(m_pHandle, &hResource)); + + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + } + + /** + * Method definitions for class CColorGroupIterator + */ + + /** + * CColorGroupIterator::GetCurrentColorGroup - Returns the ColorGroup the iterator points at. + * @return returns the ColorGroup instance. + */ + PColorGroup CColorGroupIterator::GetCurrentColorGroup() + { + Lib3MFHandle hResource = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_ColorGroupIterator_GetCurrentColorGroup(m_pHandle, &hResource)); + + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + } + + /** + * Method definitions for class CTexture2DGroupIterator + */ + + /** + * CTexture2DGroupIterator::GetCurrentTexture2DGroup - Returns the Texture2DGroup the iterator points at. + * @return returns the Texture2DGroup instance. + */ + PTexture2DGroup CTexture2DGroupIterator::GetCurrentTexture2DGroup() + { + Lib3MFHandle hResource = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Texture2DGroupIterator_GetCurrentTexture2DGroup(m_pHandle, &hResource)); + + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + } + + /** + * Method definitions for class CCompositeMaterialsIterator + */ + + /** + * CCompositeMaterialsIterator::GetCurrentCompositeMaterials - Returns the CompositeMaterials the iterator points at. + * @return returns the CompositeMaterials instance. + */ + PCompositeMaterials CCompositeMaterialsIterator::GetCurrentCompositeMaterials() + { + Lib3MFHandle hResource = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_CompositeMaterialsIterator_GetCurrentCompositeMaterials(m_pHandle, &hResource)); + + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + } + + /** + * Method definitions for class CMultiPropertyGroupIterator + */ + + /** + * CMultiPropertyGroupIterator::GetCurrentMultiPropertyGroup - Returns the MultiPropertyGroup the iterator points at. + * @return returns the MultiPropertyGroup instance. + */ + PMultiPropertyGroup CMultiPropertyGroupIterator::GetCurrentMultiPropertyGroup() + { + Lib3MFHandle hResource = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup(m_pHandle, &hResource)); + + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + } + + /** + * Method definitions for class CMetaData + */ + + /** + * CMetaData::GetNameSpace - returns the namespace URL of the metadata + * @return the namespace URL of the metadata + */ + std::string CMetaData::GetNameSpace() + { + Lib3MF_uint32 bytesNeededNameSpace = 0; + Lib3MF_uint32 bytesWrittenNameSpace = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MetaData_GetNameSpace(m_pHandle, 0, &bytesNeededNameSpace, nullptr)); + std::vector bufferNameSpace(bytesNeededNameSpace); + CheckError(m_pWrapper->m_WrapperTable.m_MetaData_GetNameSpace(m_pHandle, bytesNeededNameSpace, &bytesWrittenNameSpace, &bufferNameSpace[0])); + + return std::string(&bufferNameSpace[0]); + } + + /** + * CMetaData::SetNameSpace - sets a new namespace URL of the metadata + * @param[in] sNameSpace - the new namespace URL of the metadata + */ + void CMetaData::SetNameSpace(const std::string & sNameSpace) + { + CheckError(m_pWrapper->m_WrapperTable.m_MetaData_SetNameSpace(m_pHandle, sNameSpace.c_str())); + } + + /** + * CMetaData::GetName - returns the name of a metadata + * @return the name of the metadata + */ + std::string CMetaData::GetName() + { + Lib3MF_uint32 bytesNeededName = 0; + Lib3MF_uint32 bytesWrittenName = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MetaData_GetName(m_pHandle, 0, &bytesNeededName, nullptr)); + std::vector bufferName(bytesNeededName); + CheckError(m_pWrapper->m_WrapperTable.m_MetaData_GetName(m_pHandle, bytesNeededName, &bytesWrittenName, &bufferName[0])); + + return std::string(&bufferName[0]); + } /** - * Method definitions for class CBase - */ + * CMetaData::SetName - sets a new name of a metadata + * @param[in] sName - the new name of the metadata + */ + void CMetaData::SetName(const std::string & sName) + { + CheckError(m_pWrapper->m_WrapperTable.m_MetaData_SetName(m_pHandle, sName.c_str())); + } /** - * CBase::ClassTypeId - Get Class Type Id - * @return Class type as a 64 bits integer + * CMetaData::GetKey - returns the (namespace+name) of a metadata + * @return the key (namespace+name) of the metadata */ - Lib3MF_uint64 CBase::ClassTypeId() + std::string CMetaData::GetKey() { - Lib3MF_uint64 resultClassTypeId = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Base_ClassTypeId(m_pHandle, &resultClassTypeId)); + Lib3MF_uint32 bytesNeededKey = 0; + Lib3MF_uint32 bytesWrittenKey = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MetaData_GetKey(m_pHandle, 0, &bytesNeededKey, nullptr)); + std::vector bufferKey(bytesNeededKey); + CheckError(m_pWrapper->m_WrapperTable.m_MetaData_GetKey(m_pHandle, bytesNeededKey, &bytesWrittenKey, &bufferKey[0])); - return resultClassTypeId; + return std::string(&bufferKey[0]); } /** - * Method definitions for class CWriter - */ + * CMetaData::GetMustPreserve - returns, whether a metadata must be preserved + * @return returns, whether a metadata must be preserved + */ + bool CMetaData::GetMustPreserve() + { + bool resultMustPreserve = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MetaData_GetMustPreserve(m_pHandle, &resultMustPreserve)); + + return resultMustPreserve; + } /** - * CWriter::WriteToFile - Writes out the model as file. The file type is specified by the Model Writer class. - * @param[in] sFilename - Filename to write into + * CMetaData::SetMustPreserve - sets whether a metadata must be preserved + * @param[in] bMustPreserve - a new value whether a metadata must be preserved */ - void CWriter::WriteToFile(const std::string & sFilename) + void CMetaData::SetMustPreserve(const bool bMustPreserve) { - CheckError(m_pWrapper->m_WrapperTable.m_Writer_WriteToFile(m_pHandle, sFilename.c_str())); + CheckError(m_pWrapper->m_WrapperTable.m_MetaData_SetMustPreserve(m_pHandle, bMustPreserve)); } /** - * CWriter::GetStreamSize - Retrieves the size of the full 3MF file stream. - * @return the stream size + * CMetaData::GetType - returns the type of a metadata + * @return the type of the metadata */ - Lib3MF_uint64 CWriter::GetStreamSize() + std::string CMetaData::GetType() { - Lib3MF_uint64 resultStreamSize = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Writer_GetStreamSize(m_pHandle, &resultStreamSize)); + Lib3MF_uint32 bytesNeededType = 0; + Lib3MF_uint32 bytesWrittenType = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MetaData_GetType(m_pHandle, 0, &bytesNeededType, nullptr)); + std::vector bufferType(bytesNeededType); + CheckError(m_pWrapper->m_WrapperTable.m_MetaData_GetType(m_pHandle, bytesNeededType, &bytesWrittenType, &bufferType[0])); - return resultStreamSize; + return std::string(&bufferType[0]); } /** - * CWriter::WriteToBuffer - Writes out the 3MF file into a memory buffer - * @param[out] BufferBuffer - buffer to write into + * CMetaData::SetType - sets a new type of a metadata. This must be a simple XML type + * @param[in] sType - a new type of the metadata */ - void CWriter::WriteToBuffer(std::vector & BufferBuffer) + void CMetaData::SetType(const std::string & sType) { - Lib3MF_uint64 elementsNeededBuffer = 0; - Lib3MF_uint64 elementsWrittenBuffer = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Writer_WriteToBuffer(m_pHandle, 0, &elementsNeededBuffer, nullptr)); - BufferBuffer.resize((size_t) elementsNeededBuffer); - CheckError(m_pWrapper->m_WrapperTable.m_Writer_WriteToBuffer(m_pHandle, elementsNeededBuffer, &elementsWrittenBuffer, BufferBuffer.data())); + CheckError(m_pWrapper->m_WrapperTable.m_MetaData_SetType(m_pHandle, sType.c_str())); } /** - * CWriter::WriteToCallback - Writes out the model and passes the data to a provided callback function. The file type is specified by the Model Writer class. - * @param[in] pTheWriteCallback - Callback to call for writing a data chunk - * @param[in] pTheSeekCallback - Callback to call for seeking in the stream - * @param[in] pUserData - Userdata that is passed to the callback function + * CMetaData::GetValue - returns the value of the metadata + * @return the value of the metadata */ - void CWriter::WriteToCallback(const WriteCallback pTheWriteCallback, const SeekCallback pTheSeekCallback, const Lib3MF_pvoid pUserData) + std::string CMetaData::GetValue() { - CheckError(m_pWrapper->m_WrapperTable.m_Writer_WriteToCallback(m_pHandle, pTheWriteCallback, pTheSeekCallback, pUserData)); + Lib3MF_uint32 bytesNeededValue = 0; + Lib3MF_uint32 bytesWrittenValue = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MetaData_GetValue(m_pHandle, 0, &bytesNeededValue, nullptr)); + std::vector bufferValue(bytesNeededValue); + CheckError(m_pWrapper->m_WrapperTable.m_MetaData_GetValue(m_pHandle, bytesNeededValue, &bytesWrittenValue, &bufferValue[0])); + + return std::string(&bufferValue[0]); } /** - * CWriter::SetProgressCallback - Set the progress callback for calls to this writer - * @param[in] pProgressCallback - pointer to the callback function. - * @param[in] pUserData - pointer to arbitrary user data that is passed without modification to the callback. + * CMetaData::SetValue - sets a new value of the metadata + * @param[in] sValue - a new value of the metadata */ - void CWriter::SetProgressCallback(const ProgressCallback pProgressCallback, const Lib3MF_pvoid pUserData) + void CMetaData::SetValue(const std::string & sValue) { - CheckError(m_pWrapper->m_WrapperTable.m_Writer_SetProgressCallback(m_pHandle, pProgressCallback, pUserData)); + CheckError(m_pWrapper->m_WrapperTable.m_MetaData_SetValue(m_pHandle, sValue.c_str())); } /** - * CWriter::GetDecimalPrecision - Returns the number of digits after the decimal point to be written in each vertex coordinate-value. - * @return The number of digits to be written in each vertex coordinate-value after the decimal point. + * Method definitions for class CMetaDataGroup + */ + + /** + * CMetaDataGroup::GetMetaDataCount - returns the number of metadata in this metadatagroup + * @return returns the number metadata */ - Lib3MF_uint32 CWriter::GetDecimalPrecision() + Lib3MF_uint32 CMetaDataGroup::GetMetaDataCount() { - Lib3MF_uint32 resultDecimalPrecision = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Writer_GetDecimalPrecision(m_pHandle, &resultDecimalPrecision)); + Lib3MF_uint32 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MetaDataGroup_GetMetaDataCount(m_pHandle, &resultCount)); - return resultDecimalPrecision; + return resultCount; } /** - * CWriter::SetDecimalPrecision - Sets the number of digits after the decimal point to be written in each vertex coordinate-value. - * @param[in] nDecimalPrecision - The number of digits to be written in each vertex coordinate-value after the decimal point. + * CMetaDataGroup::GetMetaData - returns a metadata value within this metadatagroup + * @param[in] nIndex - Index of the Metadata. + * @return an instance of the metadata */ - void CWriter::SetDecimalPrecision(const Lib3MF_uint32 nDecimalPrecision) + PMetaData CMetaDataGroup::GetMetaData(const Lib3MF_uint32 nIndex) { - CheckError(m_pWrapper->m_WrapperTable.m_Writer_SetDecimalPrecision(m_pHandle, nDecimalPrecision)); + Lib3MFHandle hMetaData = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MetaDataGroup_GetMetaData(m_pHandle, nIndex, &hMetaData)); + + if (!hMetaData) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMetaData))); } /** - * CWriter::SetStrictModeActive - Activates (deactivates) the strict mode of the reader. - * @param[in] bStrictModeActive - flag whether strict mode is active or not. + * CMetaDataGroup::GetMetaDataByKey - returns a metadata value within this metadatagroup + * @param[in] sNameSpace - the namespace of the metadata + * @param[in] sName - the name of the Metadata + * @return an instance of the metadata */ - void CWriter::SetStrictModeActive(const bool bStrictModeActive) + PMetaData CMetaDataGroup::GetMetaDataByKey(const std::string & sNameSpace, const std::string & sName) { - CheckError(m_pWrapper->m_WrapperTable.m_Writer_SetStrictModeActive(m_pHandle, bStrictModeActive)); + Lib3MFHandle hMetaData = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MetaDataGroup_GetMetaDataByKey(m_pHandle, sNameSpace.c_str(), sName.c_str(), &hMetaData)); + + if (!hMetaData) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMetaData))); } /** - * CWriter::GetStrictModeActive - Queries whether the strict mode of the reader is active or not - * @return returns flag whether strict mode is active or not. + * CMetaDataGroup::RemoveMetaDataByIndex - removes metadata by index from the model. + * @param[in] nIndex - Index of the metadata to remove */ - bool CWriter::GetStrictModeActive() + void CMetaDataGroup::RemoveMetaDataByIndex(const Lib3MF_uint32 nIndex) { - bool resultStrictModeActive = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Writer_GetStrictModeActive(m_pHandle, &resultStrictModeActive)); - - return resultStrictModeActive; + CheckError(m_pWrapper->m_WrapperTable.m_MetaDataGroup_RemoveMetaDataByIndex(m_pHandle, nIndex)); } /** - * CWriter::GetWarning - Returns Warning and Error Information of the read process - * @param[in] nIndex - Index of the Warning. Valid values are 0 to WarningCount - 1 - * @param[out] nErrorCode - filled with the error code of the warning - * @return the message of the warning + * CMetaDataGroup::RemoveMetaData - removes metadata from the model. + * @param[in] pTheMetaData - The metadata to remove */ - std::string CWriter::GetWarning(const Lib3MF_uint32 nIndex, Lib3MF_uint32 & nErrorCode) + void CMetaDataGroup::RemoveMetaData(classParam pTheMetaData) { - Lib3MF_uint32 bytesNeededWarning = 0; - Lib3MF_uint32 bytesWrittenWarning = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Writer_GetWarning(m_pHandle, nIndex, &nErrorCode, 0, &bytesNeededWarning, nullptr)); - std::vector bufferWarning(bytesNeededWarning); - CheckError(m_pWrapper->m_WrapperTable.m_Writer_GetWarning(m_pHandle, nIndex, &nErrorCode, bytesNeededWarning, &bytesWrittenWarning, &bufferWarning[0])); - - return std::string(&bufferWarning[0]); + Lib3MFHandle hTheMetaData = pTheMetaData.GetHandle(); + CheckError(m_pWrapper->m_WrapperTable.m_MetaDataGroup_RemoveMetaData(m_pHandle, hTheMetaData)); } /** - * CWriter::GetWarningCount - Returns Warning and Error Count of the read process - * @return filled with the count of the occurred warnings. + * CMetaDataGroup::AddMetaData - adds a new metadata to this metadatagroup + * @param[in] sNameSpace - the namespace of the metadata + * @param[in] sName - the name of the metadata + * @param[in] sValue - the value of the metadata + * @param[in] sType - the type of the metadata + * @param[in] bMustPreserve - shuold the metadata be preserved + * @return a new instance of the metadata */ - Lib3MF_uint32 CWriter::GetWarningCount() + PMetaData CMetaDataGroup::AddMetaData(const std::string & sNameSpace, const std::string & sName, const std::string & sValue, const std::string & sType, const bool bMustPreserve) { - Lib3MF_uint32 resultCount = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Writer_GetWarningCount(m_pHandle, &resultCount)); + Lib3MFHandle hMetaData = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MetaDataGroup_AddMetaData(m_pHandle, sNameSpace.c_str(), sName.c_str(), sValue.c_str(), sType.c_str(), bMustPreserve, &hMetaData)); - return resultCount; + if (!hMetaData) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMetaData))); } /** - * CWriter::AddKeyWrappingCallback - Registers a callback to deal with data key encryption/decryption from keystore - * @param[in] sConsumerID - The ConsumerID to register for - * @param[in] pTheCallback - The callback to be callede for wrapping and encryption key - * @param[in] pUserData - Userdata that is passed to the callback function + * Method definitions for class CObject + */ + + /** + * CObject::GetType - Retrieves an object's type + * @return returns object type enum. */ - void CWriter::AddKeyWrappingCallback(const std::string & sConsumerID, const KeyWrappingCallback pTheCallback, const Lib3MF_pvoid pUserData) + eObjectType CObject::GetType() { - CheckError(m_pWrapper->m_WrapperTable.m_Writer_AddKeyWrappingCallback(m_pHandle, sConsumerID.c_str(), pTheCallback, pUserData)); + eObjectType resultObjectType = (eObjectType) 0; + CheckError(m_pWrapper->m_WrapperTable.m_Object_GetType(m_pHandle, &resultObjectType)); + + return resultObjectType; } /** - * CWriter::SetContentEncryptionCallback - Registers a callback to deal with encryption of content - * @param[in] pTheCallback - The callback used to encrypt content - * @param[in] pUserData - Userdata that is passed to the callback function + * CObject::SetType - Sets an object's type + * @param[in] eObjectType - object type enum. */ - void CWriter::SetContentEncryptionCallback(const ContentEncryptionCallback pTheCallback, const Lib3MF_pvoid pUserData) + void CObject::SetType(const eObjectType eObjectType) { - CheckError(m_pWrapper->m_WrapperTable.m_Writer_SetContentEncryptionCallback(m_pHandle, pTheCallback, pUserData)); + CheckError(m_pWrapper->m_WrapperTable.m_Object_SetType(m_pHandle, eObjectType)); } /** - * Method definitions for class CReader - */ + * CObject::GetName - Retrieves an object's name + * @return returns object name. + */ + std::string CObject::GetName() + { + Lib3MF_uint32 bytesNeededName = 0; + Lib3MF_uint32 bytesWrittenName = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Object_GetName(m_pHandle, 0, &bytesNeededName, nullptr)); + std::vector bufferName(bytesNeededName); + CheckError(m_pWrapper->m_WrapperTable.m_Object_GetName(m_pHandle, bytesNeededName, &bytesWrittenName, &bufferName[0])); + + return std::string(&bufferName[0]); + } /** - * CReader::ReadFromFile - Reads a model from a file. The file type is specified by the Model Reader class - * @param[in] sFilename - Filename to read from + * CObject::SetName - Sets an object's name string + * @param[in] sName - new object name. */ - void CReader::ReadFromFile(const std::string & sFilename) + void CObject::SetName(const std::string & sName) { - CheckError(m_pWrapper->m_WrapperTable.m_Reader_ReadFromFile(m_pHandle, sFilename.c_str())); + CheckError(m_pWrapper->m_WrapperTable.m_Object_SetName(m_pHandle, sName.c_str())); } /** - * CReader::ReadFromBuffer - Reads a model from a memory buffer. - * @param[in] BufferBuffer - Buffer to read from + * CObject::GetPartNumber - Retrieves an object's part number + * @return returns object part number. */ - void CReader::ReadFromBuffer(const CInputVector & BufferBuffer) + std::string CObject::GetPartNumber() { - CheckError(m_pWrapper->m_WrapperTable.m_Reader_ReadFromBuffer(m_pHandle, (Lib3MF_uint64)BufferBuffer.size(), BufferBuffer.data())); + Lib3MF_uint32 bytesNeededPartNumber = 0; + Lib3MF_uint32 bytesWrittenPartNumber = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Object_GetPartNumber(m_pHandle, 0, &bytesNeededPartNumber, nullptr)); + std::vector bufferPartNumber(bytesNeededPartNumber); + CheckError(m_pWrapper->m_WrapperTable.m_Object_GetPartNumber(m_pHandle, bytesNeededPartNumber, &bytesWrittenPartNumber, &bufferPartNumber[0])); + + return std::string(&bufferPartNumber[0]); } /** - * CReader::ReadFromCallback - Reads a model and from the data provided by a callback function - * @param[in] pTheReadCallback - Callback to call for reading a data chunk - * @param[in] nStreamSize - number of bytes the callback returns - * @param[in] pTheSeekCallback - Callback to call for seeking in the stream. - * @param[in] pUserData - Userdata that is passed to the callback function + * CObject::SetPartNumber - Sets an objects partnumber string + * @param[in] sPartNumber - new object part number. */ - void CReader::ReadFromCallback(const ReadCallback pTheReadCallback, const Lib3MF_uint64 nStreamSize, const SeekCallback pTheSeekCallback, const Lib3MF_pvoid pUserData) + void CObject::SetPartNumber(const std::string & sPartNumber) { - CheckError(m_pWrapper->m_WrapperTable.m_Reader_ReadFromCallback(m_pHandle, pTheReadCallback, nStreamSize, pTheSeekCallback, pUserData)); + CheckError(m_pWrapper->m_WrapperTable.m_Object_SetPartNumber(m_pHandle, sPartNumber.c_str())); } /** - * CReader::SetProgressCallback - Set the progress callback for calls to this writer - * @param[in] pProgressCallback - pointer to the callback function. - * @param[in] pUserData - pointer to arbitrary user data that is passed without modification to the callback. + * CObject::IsMeshObject - Retrieves, if an object is a mesh object + * @return returns, whether the object is a mesh object */ - void CReader::SetProgressCallback(const ProgressCallback pProgressCallback, const Lib3MF_pvoid pUserData) + bool CObject::IsMeshObject() { - CheckError(m_pWrapper->m_WrapperTable.m_Reader_SetProgressCallback(m_pHandle, pProgressCallback, pUserData)); + bool resultIsMeshObject = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Object_IsMeshObject(m_pHandle, &resultIsMeshObject)); + + return resultIsMeshObject; } /** - * CReader::AddRelationToRead - Adds a relationship type which shall be read as attachment in memory while loading - * @param[in] sRelationShipType - String of the relationship type + * CObject::IsComponentsObject - Retrieves, if an object is a components object + * @return returns, whether the object is a components object */ - void CReader::AddRelationToRead(const std::string & sRelationShipType) + bool CObject::IsComponentsObject() { - CheckError(m_pWrapper->m_WrapperTable.m_Reader_AddRelationToRead(m_pHandle, sRelationShipType.c_str())); + bool resultIsComponentsObject = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Object_IsComponentsObject(m_pHandle, &resultIsComponentsObject)); + + return resultIsComponentsObject; } /** - * CReader::RemoveRelationToRead - Removes a relationship type which shall be read as attachment in memory while loading - * @param[in] sRelationShipType - String of the relationship type + * CObject::IsValid - Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. + * @return returns whether the object is a valid object description */ - void CReader::RemoveRelationToRead(const std::string & sRelationShipType) + bool CObject::IsValid() { - CheckError(m_pWrapper->m_WrapperTable.m_Reader_RemoveRelationToRead(m_pHandle, sRelationShipType.c_str())); + bool resultIsValid = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Object_IsValid(m_pHandle, &resultIsValid)); + + return resultIsValid; } /** - * CReader::SetStrictModeActive - Activates (deactivates) the strict mode of the reader. - * @param[in] bStrictModeActive - flag whether strict mode is active or not. + * CObject::SetAttachmentAsThumbnail - Use an existing attachment as thumbnail for this object + * @param[in] pAttachment - Instance of a new or the existing thumbnailattachment object. */ - void CReader::SetStrictModeActive(const bool bStrictModeActive) + void CObject::SetAttachmentAsThumbnail(classParam pAttachment) { - CheckError(m_pWrapper->m_WrapperTable.m_Reader_SetStrictModeActive(m_pHandle, bStrictModeActive)); + Lib3MFHandle hAttachment = pAttachment.GetHandle(); + CheckError(m_pWrapper->m_WrapperTable.m_Object_SetAttachmentAsThumbnail(m_pHandle, hAttachment)); } /** - * CReader::GetStrictModeActive - Queries whether the strict mode of the reader is active or not - * @return returns flag whether strict mode is active or not. + * CObject::GetThumbnailAttachment - Get the attachment containing the object thumbnail. + * @return Instance of the thumbnailattachment object or NULL. */ - bool CReader::GetStrictModeActive() + PAttachment CObject::GetThumbnailAttachment() { - bool resultStrictModeActive = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Reader_GetStrictModeActive(m_pHandle, &resultStrictModeActive)); + Lib3MFHandle hAttachment = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Object_GetThumbnailAttachment(m_pHandle, &hAttachment)); - return resultStrictModeActive; + if (hAttachment) { + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hAttachment))); + } else { + return nullptr; + } } /** - * CReader::GetWarning - Returns Warning and Error Information of the read process - * @param[in] nIndex - Index of the Warning. Valid values are 0 to WarningCount - 1 - * @param[out] nErrorCode - filled with the error code of the warning - * @return the message of the warning + * CObject::ClearThumbnailAttachment - Clears the attachment. The attachment instance is not removed from the package. */ - std::string CReader::GetWarning(const Lib3MF_uint32 nIndex, Lib3MF_uint32 & nErrorCode) + void CObject::ClearThumbnailAttachment() { - Lib3MF_uint32 bytesNeededWarning = 0; - Lib3MF_uint32 bytesWrittenWarning = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Reader_GetWarning(m_pHandle, nIndex, &nErrorCode, 0, &bytesNeededWarning, nullptr)); - std::vector bufferWarning(bytesNeededWarning); - CheckError(m_pWrapper->m_WrapperTable.m_Reader_GetWarning(m_pHandle, nIndex, &nErrorCode, bytesNeededWarning, &bytesWrittenWarning, &bufferWarning[0])); - - return std::string(&bufferWarning[0]); + CheckError(m_pWrapper->m_WrapperTable.m_Object_ClearThumbnailAttachment(m_pHandle)); } /** - * CReader::GetWarningCount - Returns Warning and Error Count of the read process - * @return filled with the count of the occurred warnings. + * CObject::GetOutbox - Returns the outbox of a build item + * @return Outbox of this build item */ - Lib3MF_uint32 CReader::GetWarningCount() + sBox CObject::GetOutbox() { - Lib3MF_uint32 resultCount = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Reader_GetWarningCount(m_pHandle, &resultCount)); + sBox resultOutbox; + CheckError(m_pWrapper->m_WrapperTable.m_Object_GetOutbox(m_pHandle, &resultOutbox)); - return resultCount; + return resultOutbox; } /** - * CReader::AddKeyWrappingCallback - Registers a callback to deal with key wrapping mechanism from keystore - * @param[in] sConsumerID - The ConsumerID to register for - * @param[in] pTheCallback - The callback used to decrypt data key - * @param[in] pUserData - Userdata that is passed to the callback function + * CObject::GetUUID - Retrieves an object's uuid string (see production extension specification) + * @param[out] bHasUUID - flag whether the build item has a UUID + * @return returns object uuid. */ - void CReader::AddKeyWrappingCallback(const std::string & sConsumerID, const KeyWrappingCallback pTheCallback, const Lib3MF_pvoid pUserData) + std::string CObject::GetUUID(bool & bHasUUID) { - CheckError(m_pWrapper->m_WrapperTable.m_Reader_AddKeyWrappingCallback(m_pHandle, sConsumerID.c_str(), pTheCallback, pUserData)); + Lib3MF_uint32 bytesNeededUUID = 0; + Lib3MF_uint32 bytesWrittenUUID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Object_GetUUID(m_pHandle, &bHasUUID, 0, &bytesNeededUUID, nullptr)); + std::vector bufferUUID(bytesNeededUUID); + CheckError(m_pWrapper->m_WrapperTable.m_Object_GetUUID(m_pHandle, &bHasUUID, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0])); + + return std::string(&bufferUUID[0]); } /** - * CReader::SetContentEncryptionCallback - Registers a callback to deal with encryption of content - * @param[in] pTheCallback - The callback used to encrypt content - * @param[in] pUserData - Userdata that is passed to the callback function + * CObject::SetUUID - Sets a build object's uuid string (see production extension specification) + * @param[in] sUUID - new object uuid string. */ - void CReader::SetContentEncryptionCallback(const ContentEncryptionCallback pTheCallback, const Lib3MF_pvoid pUserData) + void CObject::SetUUID(const std::string & sUUID) { - CheckError(m_pWrapper->m_WrapperTable.m_Reader_SetContentEncryptionCallback(m_pHandle, pTheCallback, pUserData)); + CheckError(m_pWrapper->m_WrapperTable.m_Object_SetUUID(m_pHandle, sUUID.c_str())); } /** - * Method definitions for class CPackagePart - */ - - /** - * CPackagePart::GetPath - Returns the absolute path of this PackagePart. - * @return Returns the absolute path of this PackagePart + * CObject::GetMetaDataGroup - Returns the metadatagroup of this object + * @return returns an Instance of the metadatagroup of this object */ - std::string CPackagePart::GetPath() + PMetaDataGroup CObject::GetMetaDataGroup() { - Lib3MF_uint32 bytesNeededPath = 0; - Lib3MF_uint32 bytesWrittenPath = 0; - CheckError(m_pWrapper->m_WrapperTable.m_PackagePart_GetPath(m_pHandle, 0, &bytesNeededPath, nullptr)); - std::vector bufferPath(bytesNeededPath); - CheckError(m_pWrapper->m_WrapperTable.m_PackagePart_GetPath(m_pHandle, bytesNeededPath, &bytesWrittenPath, &bufferPath[0])); + Lib3MFHandle hMetaDataGroup = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Object_GetMetaDataGroup(m_pHandle, &hMetaDataGroup)); - return std::string(&bufferPath[0]); + if (!hMetaDataGroup) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMetaDataGroup))); } /** - * CPackagePart::SetPath - Sets the absolute path of this PackagePart. - * @param[in] sPath - Sets the absolute path of this PackagePart. + * CObject::SetSlicesMeshResolution - set the meshresolution of the mesh object + * @param[in] eMeshResolution - meshresolution of this object */ - void CPackagePart::SetPath(const std::string & sPath) + void CObject::SetSlicesMeshResolution(const eSlicesMeshResolution eMeshResolution) { - CheckError(m_pWrapper->m_WrapperTable.m_PackagePart_SetPath(m_pHandle, sPath.c_str())); + CheckError(m_pWrapper->m_WrapperTable.m_Object_SetSlicesMeshResolution(m_pHandle, eMeshResolution)); } /** - * Method definitions for class CResource - */ - - /** - * CResource::GetResourceID - Retrieves the unique id of this resource within a package. This function will be removed in a later release in favor of GetUniqueResourceID - * @return Retrieves the unique id of this resource within a package. + * CObject::GetSlicesMeshResolution - get the meshresolution of the mesh object + * @return meshresolution of this object */ - Lib3MF_uint32 CResource::GetResourceID() + eSlicesMeshResolution CObject::GetSlicesMeshResolution() { - Lib3MF_uint32 resultUniqueResourceID = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Resource_GetResourceID(m_pHandle, &resultUniqueResourceID)); + eSlicesMeshResolution resultMeshResolution = (eSlicesMeshResolution) 0; + CheckError(m_pWrapper->m_WrapperTable.m_Object_GetSlicesMeshResolution(m_pHandle, &resultMeshResolution)); - return resultUniqueResourceID; + return resultMeshResolution; } /** - * CResource::GetUniqueResourceID - Retrieves the unique id of this resource within a package. - * @return Retrieves the unique id of this resource within a package. + * CObject::HasSlices - returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack + * @param[in] bRecursive - check also all referenced objects? + * @return does the object have a slice stack? */ - Lib3MF_uint32 CResource::GetUniqueResourceID() + bool CObject::HasSlices(const bool bRecursive) { - Lib3MF_uint32 resultUniqueResourceID = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Resource_GetUniqueResourceID(m_pHandle, &resultUniqueResourceID)); + bool resultHasSlices = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Object_HasSlices(m_pHandle, bRecursive, &resultHasSlices)); - return resultUniqueResourceID; + return resultHasSlices; } /** - * CResource::PackagePart - Returns the PackagePart within which this resource resides - * @return the PackagePart within which this resource resides. + * CObject::ClearSliceStack - unlinks the attached slicestack from this object. If no slice stack is attached, do noting. */ - PPackagePart CResource::PackagePart() + void CObject::ClearSliceStack() { - Lib3MFHandle hPackagePart = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_Resource_PackagePart(m_pHandle, &hPackagePart)); - - if (!hPackagePart) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPackagePart))); + CheckError(m_pWrapper->m_WrapperTable.m_Object_ClearSliceStack(m_pHandle)); } /** - * CResource::SetPackagePart - Sets the new PackagePart within which this resource resides - * @param[in] pPackagePart - the new PackagePart within which this resource resides. + * CObject::GetSliceStack - get the Slicestack attached to the object + * @return returns the slicestack instance */ - void CResource::SetPackagePart(classParam pPackagePart) + PSliceStack CObject::GetSliceStack() { - Lib3MFHandle hPackagePart = pPackagePart.GetHandle(); - CheckError(m_pWrapper->m_WrapperTable.m_Resource_SetPackagePart(m_pHandle, hPackagePart)); + Lib3MFHandle hSliceStackInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Object_GetSliceStack(m_pHandle, &hSliceStackInstance)); + + if (!hSliceStackInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hSliceStackInstance))); } /** - * CResource::GetModelResourceID - Retrieves the id of this resource within a model. - * @return Retrieves the id of this resource within a model. + * CObject::AssignSliceStack - assigns a slicestack to the object + * @param[in] pSliceStackInstance - the new slice stack of this Object */ - Lib3MF_uint32 CResource::GetModelResourceID() + void CObject::AssignSliceStack(classParam pSliceStackInstance) { - Lib3MF_uint32 resultModelResourceId = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Resource_GetModelResourceID(m_pHandle, &resultModelResourceId)); - - return resultModelResourceId; + Lib3MFHandle hSliceStackInstance = pSliceStackInstance.GetHandle(); + CheckError(m_pWrapper->m_WrapperTable.m_Object_AssignSliceStack(m_pHandle, hSliceStackInstance)); } /** - * Method definitions for class CResourceIterator + * Method definitions for class CMeshObject */ /** - * CResourceIterator::MoveNext - Iterates to the next resource in the list. - * @return Iterates to the next resource in the list. + * CMeshObject::GetVertexCount - Returns the vertex count of a mesh object. + * @return filled with the vertex count. */ - bool CResourceIterator::MoveNext() + Lib3MF_uint32 CMeshObject::GetVertexCount() { - bool resultHasNext = 0; - CheckError(m_pWrapper->m_WrapperTable.m_ResourceIterator_MoveNext(m_pHandle, &resultHasNext)); + Lib3MF_uint32 resultVertexCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_GetVertexCount(m_pHandle, &resultVertexCount)); - return resultHasNext; + return resultVertexCount; } /** - * CResourceIterator::MovePrevious - Iterates to the previous resource in the list. - * @return Iterates to the previous resource in the list. + * CMeshObject::GetTriangleCount - Returns the triangle count of a mesh object. + * @return filled with the triangle count. */ - bool CResourceIterator::MovePrevious() + Lib3MF_uint32 CMeshObject::GetTriangleCount() { - bool resultHasPrevious = 0; - CheckError(m_pWrapper->m_WrapperTable.m_ResourceIterator_MovePrevious(m_pHandle, &resultHasPrevious)); + Lib3MF_uint32 resultVertexCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_GetTriangleCount(m_pHandle, &resultVertexCount)); - return resultHasPrevious; + return resultVertexCount; } /** - * CResourceIterator::GetCurrent - Returns the resource the iterator points at. - * @return returns the resource instance. + * CMeshObject::GetVertex - Returns the vertex count of a mesh object. + * @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) + * @return filled with the vertex coordinates. */ - PResource CResourceIterator::GetCurrent() + sPosition CMeshObject::GetVertex(const Lib3MF_uint32 nIndex) { - Lib3MFHandle hResource = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_ResourceIterator_GetCurrent(m_pHandle, &hResource)); + sPosition resultCoordinates; + CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_GetVertex(m_pHandle, nIndex, &resultCoordinates)); - if (!hResource) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + return resultCoordinates; } /** - * CResourceIterator::Clone - Creates a new resource iterator with the same resource list. - * @return returns the cloned Iterator instance + * CMeshObject::SetVertex - Sets the coordinates of a single vertex of a mesh object + * @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) + * @param[in] Coordinates - contains the vertex coordinates. */ - PResourceIterator CResourceIterator::Clone() + void CMeshObject::SetVertex(const Lib3MF_uint32 nIndex, const sPosition & Coordinates) { - Lib3MFHandle hOutResourceIterator = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_ResourceIterator_Clone(m_pHandle, &hOutResourceIterator)); - - if (!hOutResourceIterator) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hOutResourceIterator))); + CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_SetVertex(m_pHandle, nIndex, &Coordinates)); } /** - * CResourceIterator::Count - Returns the number of resoucres the iterator captures. - * @return returns the number of resoucres the iterator captures. + * CMeshObject::AddVertex - Adds a single vertex to a mesh object + * @param[in] Coordinates - contains the vertex coordinates. + * @return Index of the new vertex */ - Lib3MF_uint64 CResourceIterator::Count() + Lib3MF_uint32 CMeshObject::AddVertex(const sPosition & Coordinates) { - Lib3MF_uint64 resultCount = 0; - CheckError(m_pWrapper->m_WrapperTable.m_ResourceIterator_Count(m_pHandle, &resultCount)); + Lib3MF_uint32 resultNewIndex = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_AddVertex(m_pHandle, &Coordinates, &resultNewIndex)); - return resultCount; + return resultNewIndex; } /** - * Method definitions for class CSliceStackIterator - */ + * CMeshObject::GetVertices - Obtains all vertex positions of a mesh object + * @param[out] VerticesBuffer - contains the vertex coordinates. + */ + void CMeshObject::GetVertices(std::vector & VerticesBuffer) + { + Lib3MF_uint64 elementsNeededVertices = 0; + Lib3MF_uint64 elementsWrittenVertices = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_GetVertices(m_pHandle, 0, &elementsNeededVertices, nullptr)); + VerticesBuffer.resize((size_t) elementsNeededVertices); + CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_GetVertices(m_pHandle, elementsNeededVertices, &elementsWrittenVertices, VerticesBuffer.data())); + } /** - * CSliceStackIterator::GetCurrentSliceStack - Returns the SliceStack the iterator points at. - * @return returns the SliceStack instance. + * CMeshObject::GetTriangle - Returns indices of a single triangle of a mesh object. + * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) + * @return filled with the triangle indices. */ - PSliceStack CSliceStackIterator::GetCurrentSliceStack() + sTriangle CMeshObject::GetTriangle(const Lib3MF_uint32 nIndex) { - Lib3MFHandle hResource = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_SliceStackIterator_GetCurrentSliceStack(m_pHandle, &hResource)); + sTriangle resultIndices; + CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_GetTriangle(m_pHandle, nIndex, &resultIndices)); - if (!hResource) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + return resultIndices; } /** - * Method definitions for class CObjectIterator - */ + * CMeshObject::SetTriangle - Sets the indices of a single triangle of a mesh object. + * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) + * @param[in] Indices - contains the triangle indices. + */ + void CMeshObject::SetTriangle(const Lib3MF_uint32 nIndex, const sTriangle & Indices) + { + CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_SetTriangle(m_pHandle, nIndex, &Indices)); + } /** - * CObjectIterator::GetCurrentObject - Returns the Object the iterator points at. - * @return returns the Object instance. + * CMeshObject::AddTriangle - Adds a single triangle to a mesh object + * @param[in] Indices - contains the triangle indices. + * @return Index of the new triangle */ - PObject CObjectIterator::GetCurrentObject() + Lib3MF_uint32 CMeshObject::AddTriangle(const sTriangle & Indices) { - Lib3MFHandle hResource = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_ObjectIterator_GetCurrentObject(m_pHandle, &hResource)); + Lib3MF_uint32 resultNewIndex = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_AddTriangle(m_pHandle, &Indices, &resultNewIndex)); - if (!hResource) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + return resultNewIndex; } /** - * Method definitions for class CMeshObjectIterator - */ - - /** - * CMeshObjectIterator::GetCurrentMeshObject - Returns the MeshObject the iterator points at. - * @return returns the MeshObject instance. + * CMeshObject::GetTriangleIndices - Get all triangles of a mesh object + * @param[out] IndicesBuffer - contains the triangle indices. */ - PMeshObject CMeshObjectIterator::GetCurrentMeshObject() + void CMeshObject::GetTriangleIndices(std::vector & IndicesBuffer) { - Lib3MFHandle hResource = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MeshObjectIterator_GetCurrentMeshObject(m_pHandle, &hResource)); - - if (!hResource) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + Lib3MF_uint64 elementsNeededIndices = 0; + Lib3MF_uint64 elementsWrittenIndices = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_GetTriangleIndices(m_pHandle, 0, &elementsNeededIndices, nullptr)); + IndicesBuffer.resize((size_t) elementsNeededIndices); + CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_GetTriangleIndices(m_pHandle, elementsNeededIndices, &elementsWrittenIndices, IndicesBuffer.data())); } /** - * Method definitions for class CComponentsObjectIterator - */ + * CMeshObject::SetObjectLevelProperty - Sets the property at the object-level of the mesh object. + * @param[in] nUniqueResourceID - the object-level Property UniqueResourceID. + * @param[in] nPropertyID - the object-level PropertyID. + */ + void CMeshObject::SetObjectLevelProperty(const Lib3MF_uint32 nUniqueResourceID, const Lib3MF_uint32 nPropertyID) + { + CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_SetObjectLevelProperty(m_pHandle, nUniqueResourceID, nPropertyID)); + } /** - * CComponentsObjectIterator::GetCurrentComponentsObject - Returns the ComponentsObject the iterator points at. - * @return returns the ComponentsObject instance. + * CMeshObject::GetObjectLevelProperty - Gets the property at the object-level of the mesh object. + * @param[out] nUniqueResourceID - the object-level Property UniqueResourceID. + * @param[out] nPropertyID - the object-level PropertyID. + * @return Has an object-level property been specified? */ - PComponentsObject CComponentsObjectIterator::GetCurrentComponentsObject() + bool CMeshObject::GetObjectLevelProperty(Lib3MF_uint32 & nUniqueResourceID, Lib3MF_uint32 & nPropertyID) { - Lib3MFHandle hResource = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_ComponentsObjectIterator_GetCurrentComponentsObject(m_pHandle, &hResource)); + bool resultHasObjectLevelProperty = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_GetObjectLevelProperty(m_pHandle, &nUniqueResourceID, &nPropertyID, &resultHasObjectLevelProperty)); - if (!hResource) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + return resultHasObjectLevelProperty; } /** - * Method definitions for class CTexture2DIterator - */ - - /** - * CTexture2DIterator::GetCurrentTexture2D - Returns the Texture2D the iterator points at. - * @return returns the Texture2D instance. + * CMeshObject::SetTriangleProperties - Sets the properties of a single triangle of a mesh object. + * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) + * @param[in] Properties - contains the triangle properties. */ - PTexture2D CTexture2DIterator::GetCurrentTexture2D() + void CMeshObject::SetTriangleProperties(const Lib3MF_uint32 nIndex, const sTriangleProperties & Properties) { - Lib3MFHandle hResource = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_Texture2DIterator_GetCurrentTexture2D(m_pHandle, &hResource)); - - if (!hResource) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_SetTriangleProperties(m_pHandle, nIndex, &Properties)); } /** - * Method definitions for class CBaseMaterialGroupIterator - */ + * CMeshObject::GetTriangleProperties - Gets the properties of a single triangle of a mesh object. + * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) + * @param[out] Property - returns the triangle properties. + */ + void CMeshObject::GetTriangleProperties(const Lib3MF_uint32 nIndex, sTriangleProperties & Property) + { + CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_GetTriangleProperties(m_pHandle, nIndex, &Property)); + } /** - * CBaseMaterialGroupIterator::GetCurrentBaseMaterialGroup - Returns the MaterialGroup the iterator points at. - * @return returns the BaseMaterialGroup instance. + * CMeshObject::SetAllTriangleProperties - Sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. + * @param[in] PropertiesArrayBuffer - contains the triangle properties array. Must have trianglecount elements. */ - PBaseMaterialGroup CBaseMaterialGroupIterator::GetCurrentBaseMaterialGroup() + void CMeshObject::SetAllTriangleProperties(const CInputVector & PropertiesArrayBuffer) { - Lib3MFHandle hResource = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup(m_pHandle, &hResource)); - - if (!hResource) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_SetAllTriangleProperties(m_pHandle, (Lib3MF_uint64)PropertiesArrayBuffer.size(), PropertiesArrayBuffer.data())); } /** - * Method definitions for class CColorGroupIterator - */ + * CMeshObject::GetAllTriangleProperties - Gets the properties of all triangles of a mesh object. + * @param[out] PropertiesArrayBuffer - returns the triangle properties array. Must have trianglecount elements. + */ + void CMeshObject::GetAllTriangleProperties(std::vector & PropertiesArrayBuffer) + { + Lib3MF_uint64 elementsNeededPropertiesArray = 0; + Lib3MF_uint64 elementsWrittenPropertiesArray = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_GetAllTriangleProperties(m_pHandle, 0, &elementsNeededPropertiesArray, nullptr)); + PropertiesArrayBuffer.resize((size_t) elementsNeededPropertiesArray); + CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_GetAllTriangleProperties(m_pHandle, elementsNeededPropertiesArray, &elementsWrittenPropertiesArray, PropertiesArrayBuffer.data())); + } /** - * CColorGroupIterator::GetCurrentColorGroup - Returns the ColorGroup the iterator points at. - * @return returns the ColorGroup instance. + * CMeshObject::ClearAllProperties - Clears all properties of this mesh object (triangle and object-level). */ - PColorGroup CColorGroupIterator::GetCurrentColorGroup() + void CMeshObject::ClearAllProperties() { - Lib3MFHandle hResource = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_ColorGroupIterator_GetCurrentColorGroup(m_pHandle, &hResource)); - - if (!hResource) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_ClearAllProperties(m_pHandle)); } /** - * Method definitions for class CTexture2DGroupIterator - */ + * CMeshObject::SetGeometry - Set all triangles of a mesh object + * @param[in] VerticesBuffer - contains the positions. + * @param[in] IndicesBuffer - contains the triangle indices. + */ + void CMeshObject::SetGeometry(const CInputVector & VerticesBuffer, const CInputVector & IndicesBuffer) + { + CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_SetGeometry(m_pHandle, (Lib3MF_uint64)VerticesBuffer.size(), VerticesBuffer.data(), (Lib3MF_uint64)IndicesBuffer.size(), IndicesBuffer.data())); + } /** - * CTexture2DGroupIterator::GetCurrentTexture2DGroup - Returns the Texture2DGroup the iterator points at. - * @return returns the Texture2DGroup instance. + * CMeshObject::IsManifoldAndOriented - Retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. + * @return returns, if the object is oriented and manifold. */ - PTexture2DGroup CTexture2DGroupIterator::GetCurrentTexture2DGroup() + bool CMeshObject::IsManifoldAndOriented() { - Lib3MFHandle hResource = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_Texture2DGroupIterator_GetCurrentTexture2DGroup(m_pHandle, &hResource)); + bool resultIsManifoldAndOriented = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_IsManifoldAndOriented(m_pHandle, &resultIsManifoldAndOriented)); - if (!hResource) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + return resultIsManifoldAndOriented; } /** - * Method definitions for class CCompositeMaterialsIterator - */ - - /** - * CCompositeMaterialsIterator::GetCurrentCompositeMaterials - Returns the CompositeMaterials the iterator points at. - * @return returns the CompositeMaterials instance. + * CMeshObject::BeamLattice - Retrieves the BeamLattice within this MeshObject. + * @return the BeamLattice within this MeshObject */ - PCompositeMaterials CCompositeMaterialsIterator::GetCurrentCompositeMaterials() + PBeamLattice CMeshObject::BeamLattice() { - Lib3MFHandle hResource = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_CompositeMaterialsIterator_GetCurrentCompositeMaterials(m_pHandle, &hResource)); + Lib3MFHandle hTheBeamLattice = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_BeamLattice(m_pHandle, &hTheBeamLattice)); - if (!hResource) { + if (!hTheBeamLattice) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheBeamLattice))); } /** - * Method definitions for class CMultiPropertyGroupIterator + * Method definitions for class CBeamLattice */ /** - * CMultiPropertyGroupIterator::GetCurrentMultiPropertyGroup - Returns the MultiPropertyGroup the iterator points at. - * @return returns the MultiPropertyGroup instance. + * CBeamLattice::GetMinLength - Returns the minimal length of beams for the beamlattice. + * @return minimal length of beams for the beamlattice */ - PMultiPropertyGroup CMultiPropertyGroupIterator::GetCurrentMultiPropertyGroup() + Lib3MF_double CBeamLattice::GetMinLength() { - Lib3MFHandle hResource = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup(m_pHandle, &hResource)); + Lib3MF_double resultMinLength = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetMinLength(m_pHandle, &resultMinLength)); - if (!hResource) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); + return resultMinLength; } /** - * Method definitions for class CMetaData - */ + * CBeamLattice::SetMinLength - Sets the minimal length of beams for the beamlattice. + * @param[in] dMinLength - minimal length of beams for the beamlattice + */ + void CBeamLattice::SetMinLength(const Lib3MF_double dMinLength) + { + CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_SetMinLength(m_pHandle, dMinLength)); + } /** - * CMetaData::GetNameSpace - returns the namespace URL of the metadata - * @return the namespace URL of the metadata + * CBeamLattice::GetClipping - Returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. + * @param[out] eClipMode - contains the clip mode of this mesh + * @param[out] nUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object or an undefined value if pClipMode is MODELBEAMLATTICECLIPMODE_NONE */ - std::string CMetaData::GetNameSpace() + void CBeamLattice::GetClipping(eBeamLatticeClipMode & eClipMode, Lib3MF_uint32 & nUniqueResourceID) { - Lib3MF_uint32 bytesNeededNameSpace = 0; - Lib3MF_uint32 bytesWrittenNameSpace = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MetaData_GetNameSpace(m_pHandle, 0, &bytesNeededNameSpace, nullptr)); - std::vector bufferNameSpace(bytesNeededNameSpace); - CheckError(m_pWrapper->m_WrapperTable.m_MetaData_GetNameSpace(m_pHandle, bytesNeededNameSpace, &bytesWrittenNameSpace, &bufferNameSpace[0])); - - return std::string(&bufferNameSpace[0]); + CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetClipping(m_pHandle, &eClipMode, &nUniqueResourceID)); } /** - * CMetaData::SetNameSpace - sets a new namespace URL of the metadata - * @param[in] sNameSpace - the new namespace URL of the metadata + * CBeamLattice::SetClipping - Sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. + * @param[in] eClipMode - contains the clip mode of this mesh + * @param[in] nUniqueResourceID - the UniqueResourceID of the clipping mesh-object. This mesh-object has to be defined before setting the Clipping. */ - void CMetaData::SetNameSpace(const std::string & sNameSpace) + void CBeamLattice::SetClipping(const eBeamLatticeClipMode eClipMode, const Lib3MF_uint32 nUniqueResourceID) { - CheckError(m_pWrapper->m_WrapperTable.m_MetaData_SetNameSpace(m_pHandle, sNameSpace.c_str())); + CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_SetClipping(m_pHandle, eClipMode, nUniqueResourceID)); } /** - * CMetaData::GetName - returns the name of a metadata - * @return the name of the metadata + * CBeamLattice::GetRepresentation - Returns the representation-mesh for the beamlattice of this mesh. + * @return flag whether the beamlattice has a representation mesh. + * @param[out] nUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object. */ - std::string CMetaData::GetName() + bool CBeamLattice::GetRepresentation(Lib3MF_uint32 & nUniqueResourceID) { - Lib3MF_uint32 bytesNeededName = 0; - Lib3MF_uint32 bytesWrittenName = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MetaData_GetName(m_pHandle, 0, &bytesNeededName, nullptr)); - std::vector bufferName(bytesNeededName); - CheckError(m_pWrapper->m_WrapperTable.m_MetaData_GetName(m_pHandle, bytesNeededName, &bytesWrittenName, &bufferName[0])); + bool resultHasRepresentation = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetRepresentation(m_pHandle, &resultHasRepresentation, &nUniqueResourceID)); - return std::string(&bufferName[0]); + return resultHasRepresentation; } /** - * CMetaData::SetName - sets a new name of a metadata - * @param[in] sName - the new name of the metadata + * CBeamLattice::SetRepresentation - Sets the representation-mesh for the beamlattice of this mesh. + * @param[in] nUniqueResourceID - the UniqueResourceID of the representation mesh-object. This mesh-object has to be defined before setting the representation. */ - void CMetaData::SetName(const std::string & sName) + void CBeamLattice::SetRepresentation(const Lib3MF_uint32 nUniqueResourceID) { - CheckError(m_pWrapper->m_WrapperTable.m_MetaData_SetName(m_pHandle, sName.c_str())); + CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_SetRepresentation(m_pHandle, nUniqueResourceID)); } /** - * CMetaData::GetKey - returns the (namespace+name) of a metadata - * @return the key (namespace+name) of the metadata + * CBeamLattice::GetBallOptions - Returns the ball mode and the default ball radius for the beamlattice of this mesh. + * @param[out] eBallMode - contains the ball mode of this mesh + * @param[out] dBallRadius - default ball radius of balls for the beamlattice */ - std::string CMetaData::GetKey() + void CBeamLattice::GetBallOptions(eBeamLatticeBallMode & eBallMode, Lib3MF_double & dBallRadius) { - Lib3MF_uint32 bytesNeededKey = 0; - Lib3MF_uint32 bytesWrittenKey = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MetaData_GetKey(m_pHandle, 0, &bytesNeededKey, nullptr)); - std::vector bufferKey(bytesNeededKey); - CheckError(m_pWrapper->m_WrapperTable.m_MetaData_GetKey(m_pHandle, bytesNeededKey, &bytesWrittenKey, &bufferKey[0])); - - return std::string(&bufferKey[0]); + CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetBallOptions(m_pHandle, &eBallMode, &dBallRadius)); } /** - * CMetaData::GetMustPreserve - returns, whether a metadata must be preserved - * @return returns, whether a metadata must be preserved + * CBeamLattice::SetBallOptions - Sets the ball mode and thedefault ball radius for the beamlattice. + * @param[in] eBallMode - contains the ball mode of this mesh + * @param[in] dBallRadius - default ball radius of balls for the beamlattice */ - bool CMetaData::GetMustPreserve() + void CBeamLattice::SetBallOptions(const eBeamLatticeBallMode eBallMode, const Lib3MF_double dBallRadius) { - bool resultMustPreserve = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MetaData_GetMustPreserve(m_pHandle, &resultMustPreserve)); - - return resultMustPreserve; + CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_SetBallOptions(m_pHandle, eBallMode, dBallRadius)); } /** - * CMetaData::SetMustPreserve - sets whether a metadata must be preserved - * @param[in] bMustPreserve - a new value whether a metadata must be preserved + * CBeamLattice::GetBeamCount - Returns the beam count of a mesh object. + * @return filled with the beam count. */ - void CMetaData::SetMustPreserve(const bool bMustPreserve) + Lib3MF_uint32 CBeamLattice::GetBeamCount() { - CheckError(m_pWrapper->m_WrapperTable.m_MetaData_SetMustPreserve(m_pHandle, bMustPreserve)); + Lib3MF_uint32 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetBeamCount(m_pHandle, &resultCount)); + + return resultCount; } /** - * CMetaData::GetType - returns the type of a metadata - * @return the type of the metadata + * CBeamLattice::GetBeam - Returns indices, radii and capmodes of a single beam of a mesh object. + * @param[in] nIndex - Index of the beam (0 to beamcount - 1). + * @return filled with the beam indices, radii and capmodes. */ - std::string CMetaData::GetType() + sBeam CBeamLattice::GetBeam(const Lib3MF_uint32 nIndex) { - Lib3MF_uint32 bytesNeededType = 0; - Lib3MF_uint32 bytesWrittenType = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MetaData_GetType(m_pHandle, 0, &bytesNeededType, nullptr)); - std::vector bufferType(bytesNeededType); - CheckError(m_pWrapper->m_WrapperTable.m_MetaData_GetType(m_pHandle, bytesNeededType, &bytesWrittenType, &bufferType[0])); + sBeam resultBeamInfo; + CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetBeam(m_pHandle, nIndex, &resultBeamInfo)); - return std::string(&bufferType[0]); + return resultBeamInfo; } /** - * CMetaData::SetType - sets a new type of a metadata. This must be a simple XML type - * @param[in] sType - a new type of the metadata + * CBeamLattice::AddBeam - Adds a single beam to a mesh object. + * @param[in] BeamInfo - contains the node indices, radii and capmodes. + * @return filled with the new Index of the beam. */ - void CMetaData::SetType(const std::string & sType) + Lib3MF_uint32 CBeamLattice::AddBeam(const sBeam & BeamInfo) { - CheckError(m_pWrapper->m_WrapperTable.m_MetaData_SetType(m_pHandle, sType.c_str())); + Lib3MF_uint32 resultIndex = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_AddBeam(m_pHandle, &BeamInfo, &resultIndex)); + + return resultIndex; } /** - * CMetaData::GetValue - returns the value of the metadata - * @return the value of the metadata + * CBeamLattice::SetBeam - Sets the indices, radii and capmodes of a single beam of a mesh object. + * @param[in] nIndex - Index of the beam (0 to beamcount - 1). + * @param[in] BeamInfo - filled with the beam indices, radii and capmodes. */ - std::string CMetaData::GetValue() + void CBeamLattice::SetBeam(const Lib3MF_uint32 nIndex, const sBeam & BeamInfo) { - Lib3MF_uint32 bytesNeededValue = 0; - Lib3MF_uint32 bytesWrittenValue = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MetaData_GetValue(m_pHandle, 0, &bytesNeededValue, nullptr)); - std::vector bufferValue(bytesNeededValue); - CheckError(m_pWrapper->m_WrapperTable.m_MetaData_GetValue(m_pHandle, bytesNeededValue, &bytesWrittenValue, &bufferValue[0])); - - return std::string(&bufferValue[0]); + CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_SetBeam(m_pHandle, nIndex, &BeamInfo)); } /** - * CMetaData::SetValue - sets a new value of the metadata - * @param[in] sValue - a new value of the metadata + * CBeamLattice::SetBeams - Sets all beam indices, radii and capmodes of a mesh object. + * @param[in] BeamInfoBuffer - contains information of a number of beams */ - void CMetaData::SetValue(const std::string & sValue) + void CBeamLattice::SetBeams(const CInputVector & BeamInfoBuffer) { - CheckError(m_pWrapper->m_WrapperTable.m_MetaData_SetValue(m_pHandle, sValue.c_str())); + CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_SetBeams(m_pHandle, (Lib3MF_uint64)BeamInfoBuffer.size(), BeamInfoBuffer.data())); } /** - * Method definitions for class CMetaDataGroup - */ + * CBeamLattice::GetBeams - obtains all beam indices, radii and capmodes of a mesh object. + * @param[out] BeamInfoBuffer - contains information of all beams + */ + void CBeamLattice::GetBeams(std::vector & BeamInfoBuffer) + { + Lib3MF_uint64 elementsNeededBeamInfo = 0; + Lib3MF_uint64 elementsWrittenBeamInfo = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetBeams(m_pHandle, 0, &elementsNeededBeamInfo, nullptr)); + BeamInfoBuffer.resize((size_t) elementsNeededBeamInfo); + CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetBeams(m_pHandle, elementsNeededBeamInfo, &elementsWrittenBeamInfo, BeamInfoBuffer.data())); + } /** - * CMetaDataGroup::GetMetaDataCount - returns the number of metadata in this metadatagroup - * @return returns the number metadata + * CBeamLattice::GetBallCount - Returns the ball count of a mesh object. + * @return filled with the ball count. */ - Lib3MF_uint32 CMetaDataGroup::GetMetaDataCount() + Lib3MF_uint32 CBeamLattice::GetBallCount() { Lib3MF_uint32 resultCount = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MetaDataGroup_GetMetaDataCount(m_pHandle, &resultCount)); + CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetBallCount(m_pHandle, &resultCount)); return resultCount; } /** - * CMetaDataGroup::GetMetaData - returns a metadata value within this metadatagroup - * @param[in] nIndex - Index of the Metadata. - * @return an instance of the metadata + * CBeamLattice::GetBall - Returns index and radius of a single ball of a mesh object. + * @param[in] nIndex - Index of the ball (0 to ballcount - 1). + * @return filled with the ball node index and radius. */ - PMetaData CMetaDataGroup::GetMetaData(const Lib3MF_uint32 nIndex) + sBall CBeamLattice::GetBall(const Lib3MF_uint32 nIndex) { - Lib3MFHandle hMetaData = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MetaDataGroup_GetMetaData(m_pHandle, nIndex, &hMetaData)); + sBall resultBallInfo; + CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetBall(m_pHandle, nIndex, &resultBallInfo)); - if (!hMetaData) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMetaData))); + return resultBallInfo; } /** - * CMetaDataGroup::GetMetaDataByKey - returns a metadata value within this metadatagroup - * @param[in] sNameSpace - the namespace of the metadata - * @param[in] sName - the name of the Metadata - * @return an instance of the metadata + * CBeamLattice::AddBall - Adds a single ball to a mesh object. + * @param[in] BallInfo - contains the node index and radius. + * @return filled with the new Index of the ball. */ - PMetaData CMetaDataGroup::GetMetaDataByKey(const std::string & sNameSpace, const std::string & sName) + Lib3MF_uint32 CBeamLattice::AddBall(const sBall & BallInfo) { - Lib3MFHandle hMetaData = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MetaDataGroup_GetMetaDataByKey(m_pHandle, sNameSpace.c_str(), sName.c_str(), &hMetaData)); + Lib3MF_uint32 resultIndex = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_AddBall(m_pHandle, &BallInfo, &resultIndex)); - if (!hMetaData) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMetaData))); + return resultIndex; } /** - * CMetaDataGroup::RemoveMetaDataByIndex - removes metadata by index from the model. - * @param[in] nIndex - Index of the metadata to remove + * CBeamLattice::SetBall - Sets the index and radius of a single ball of a mesh object. + * @param[in] nIndex - Index of the ball (0 to ballcount - 1). + * @param[in] BallInfo - filled with the ball node index and radius. + */ + void CBeamLattice::SetBall(const Lib3MF_uint32 nIndex, const sBall & BallInfo) + { + CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_SetBall(m_pHandle, nIndex, &BallInfo)); + } + + /** + * CBeamLattice::SetBalls - Sets all ball indices and radii of a mesh object. + * @param[in] BallInfoBuffer - contains information of a number of balls + */ + void CBeamLattice::SetBalls(const CInputVector & BallInfoBuffer) + { + CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_SetBalls(m_pHandle, (Lib3MF_uint64)BallInfoBuffer.size(), BallInfoBuffer.data())); + } + + /** + * CBeamLattice::GetBalls - obtains all ball indices and radii of a mesh object. + * @param[out] BallInfoBuffer - contains information of all balls + */ + void CBeamLattice::GetBalls(std::vector & BallInfoBuffer) + { + Lib3MF_uint64 elementsNeededBallInfo = 0; + Lib3MF_uint64 elementsWrittenBallInfo = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetBalls(m_pHandle, 0, &elementsNeededBallInfo, nullptr)); + BallInfoBuffer.resize((size_t) elementsNeededBallInfo); + CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetBalls(m_pHandle, elementsNeededBallInfo, &elementsWrittenBallInfo, BallInfoBuffer.data())); + } + + /** + * CBeamLattice::GetBeamSetCount - Returns the number of beamsets of a mesh object. + * @return filled with the beamset count. */ - void CMetaDataGroup::RemoveMetaDataByIndex(const Lib3MF_uint32 nIndex) + Lib3MF_uint32 CBeamLattice::GetBeamSetCount() { - CheckError(m_pWrapper->m_WrapperTable.m_MetaDataGroup_RemoveMetaDataByIndex(m_pHandle, nIndex)); + Lib3MF_uint32 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetBeamSetCount(m_pHandle, &resultCount)); + + return resultCount; } /** - * CMetaDataGroup::RemoveMetaData - removes metadata from the model. - * @param[in] pTheMetaData - The metadata to remove + * CBeamLattice::AddBeamSet - Adds an empty beamset to a mesh object + * @return the new beamset */ - void CMetaDataGroup::RemoveMetaData(classParam pTheMetaData) + PBeamSet CBeamLattice::AddBeamSet() { - Lib3MFHandle hTheMetaData = pTheMetaData.GetHandle(); - CheckError(m_pWrapper->m_WrapperTable.m_MetaDataGroup_RemoveMetaData(m_pHandle, hTheMetaData)); + Lib3MFHandle hBeamSet = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_AddBeamSet(m_pHandle, &hBeamSet)); + + if (!hBeamSet) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBeamSet))); } /** - * CMetaDataGroup::AddMetaData - adds a new metadata to this metadatagroup - * @param[in] sNameSpace - the namespace of the metadata - * @param[in] sName - the name of the metadata - * @param[in] sValue - the value of the metadata - * @param[in] sType - the type of the metadata - * @param[in] bMustPreserve - shuold the metadata be preserved - * @return a new instance of the metadata + * CBeamLattice::GetBeamSet - Returns a beamset of a mesh object + * @param[in] nIndex - index of the requested beamset (0 ... beamsetcount-1). + * @return the requested beamset */ - PMetaData CMetaDataGroup::AddMetaData(const std::string & sNameSpace, const std::string & sName, const std::string & sValue, const std::string & sType, const bool bMustPreserve) + PBeamSet CBeamLattice::GetBeamSet(const Lib3MF_uint32 nIndex) { - Lib3MFHandle hMetaData = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MetaDataGroup_AddMetaData(m_pHandle, sNameSpace.c_str(), sName.c_str(), sValue.c_str(), sType.c_str(), bMustPreserve, &hMetaData)); + Lib3MFHandle hBeamSet = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetBeamSet(m_pHandle, nIndex, &hBeamSet)); - if (!hMetaData) { + if (!hBeamSet) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMetaData))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBeamSet))); } /** - * Method definitions for class CObject + * Method definitions for class CComponent */ /** - * CObject::GetType - Retrieves an object's type - * @return returns object type enum. + * CComponent::GetObjectResource - Returns the Resource Instance of the component. + * @return filled with the Resource Instance. */ - eObjectType CObject::GetType() + PObject CComponent::GetObjectResource() { - eObjectType resultObjectType = (eObjectType) 0; - CheckError(m_pWrapper->m_WrapperTable.m_Object_GetType(m_pHandle, &resultObjectType)); + Lib3MFHandle hObjectResource = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Component_GetObjectResource(m_pHandle, &hObjectResource)); - return resultObjectType; + if (!hObjectResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hObjectResource))); } /** - * CObject::SetType - Sets an object's type - * @param[in] eObjectType - object type enum. + * CComponent::GetObjectResourceID - Returns the UniqueResourceID of the component. + * @return returns the UniqueResourceID. */ - void CObject::SetType(const eObjectType eObjectType) + Lib3MF_uint32 CComponent::GetObjectResourceID() { - CheckError(m_pWrapper->m_WrapperTable.m_Object_SetType(m_pHandle, eObjectType)); + Lib3MF_uint32 resultUniqueResourceID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Component_GetObjectResourceID(m_pHandle, &resultUniqueResourceID)); + + return resultUniqueResourceID; } /** - * CObject::GetName - Retrieves an object's name - * @return returns object name. + * CComponent::GetUUID - returns, whether a component has a UUID and, if true, the component's UUID + * @param[out] bHasUUID - flag whether the component has a UUID + * @return the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' */ - std::string CObject::GetName() + std::string CComponent::GetUUID(bool & bHasUUID) { - Lib3MF_uint32 bytesNeededName = 0; - Lib3MF_uint32 bytesWrittenName = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Object_GetName(m_pHandle, 0, &bytesNeededName, nullptr)); - std::vector bufferName(bytesNeededName); - CheckError(m_pWrapper->m_WrapperTable.m_Object_GetName(m_pHandle, bytesNeededName, &bytesWrittenName, &bufferName[0])); + Lib3MF_uint32 bytesNeededUUID = 0; + Lib3MF_uint32 bytesWrittenUUID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Component_GetUUID(m_pHandle, &bHasUUID, 0, &bytesNeededUUID, nullptr)); + std::vector bufferUUID(bytesNeededUUID); + CheckError(m_pWrapper->m_WrapperTable.m_Component_GetUUID(m_pHandle, &bHasUUID, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0])); - return std::string(&bufferName[0]); + return std::string(&bufferUUID[0]); } /** - * CObject::SetName - Sets an object's name string - * @param[in] sName - new object name. + * CComponent::SetUUID - sets the component's UUID + * @param[in] sUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' */ - void CObject::SetName(const std::string & sName) + void CComponent::SetUUID(const std::string & sUUID) { - CheckError(m_pWrapper->m_WrapperTable.m_Object_SetName(m_pHandle, sName.c_str())); + CheckError(m_pWrapper->m_WrapperTable.m_Component_SetUUID(m_pHandle, sUUID.c_str())); } /** - * CObject::GetPartNumber - Retrieves an object's part number - * @return returns object part number. + * CComponent::HasTransform - Returns, if the component has a different transformation than the identity matrix + * @return if true is returned, the transformation is not equal than the identity */ - std::string CObject::GetPartNumber() + bool CComponent::HasTransform() { - Lib3MF_uint32 bytesNeededPartNumber = 0; - Lib3MF_uint32 bytesWrittenPartNumber = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Object_GetPartNumber(m_pHandle, 0, &bytesNeededPartNumber, nullptr)); - std::vector bufferPartNumber(bytesNeededPartNumber); - CheckError(m_pWrapper->m_WrapperTable.m_Object_GetPartNumber(m_pHandle, bytesNeededPartNumber, &bytesWrittenPartNumber, &bufferPartNumber[0])); + bool resultHasTransform = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Component_HasTransform(m_pHandle, &resultHasTransform)); - return std::string(&bufferPartNumber[0]); + return resultHasTransform; } /** - * CObject::SetPartNumber - Sets an objects partnumber string - * @param[in] sPartNumber - new object part number. + * CComponent::GetTransform - Returns the transformation matrix of the component. + * @return filled with the component transformation matrix */ - void CObject::SetPartNumber(const std::string & sPartNumber) + sTransform CComponent::GetTransform() { - CheckError(m_pWrapper->m_WrapperTable.m_Object_SetPartNumber(m_pHandle, sPartNumber.c_str())); + sTransform resultTransform; + CheckError(m_pWrapper->m_WrapperTable.m_Component_GetTransform(m_pHandle, &resultTransform)); + + return resultTransform; } /** - * CObject::IsMeshObject - Retrieves, if an object is a mesh object - * @return returns, whether the object is a mesh object + * CComponent::SetTransform - Sets the transformation matrix of the component. + * @param[in] Transform - new transformation matrix */ - bool CObject::IsMeshObject() + void CComponent::SetTransform(const sTransform & Transform) { - bool resultIsMeshObject = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Object_IsMeshObject(m_pHandle, &resultIsMeshObject)); - - return resultIsMeshObject; + CheckError(m_pWrapper->m_WrapperTable.m_Component_SetTransform(m_pHandle, &Transform)); } /** - * CObject::IsComponentsObject - Retrieves, if an object is a components object - * @return returns, whether the object is a components object + * Method definitions for class CComponentsObject + */ + + /** + * CComponentsObject::AddComponent - Adds a new component to a components object. + * @param[in] pObjectResource - object to add as component. Must not lead to circular references! + * @param[in] Transform - optional transform matrix for the component. + * @return new component instance */ - bool CObject::IsComponentsObject() + PComponent CComponentsObject::AddComponent(classParam pObjectResource, const sTransform & Transform) { - bool resultIsComponentsObject = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Object_IsComponentsObject(m_pHandle, &resultIsComponentsObject)); + Lib3MFHandle hObjectResource = pObjectResource.GetHandle(); + Lib3MFHandle hComponentInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_ComponentsObject_AddComponent(m_pHandle, hObjectResource, &Transform, &hComponentInstance)); - return resultIsComponentsObject; + if (!hComponentInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hComponentInstance))); } /** - * CObject::IsValid - Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. - * @return returns whether the object is a valid object description + * CComponentsObject::GetComponent - Retrieves a component from a component object. + * @param[in] nIndex - index of the component to retrieve (0 to componentcount - 1) + * @return component instance */ - bool CObject::IsValid() + PComponent CComponentsObject::GetComponent(const Lib3MF_uint32 nIndex) { - bool resultIsValid = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Object_IsValid(m_pHandle, &resultIsValid)); + Lib3MFHandle hComponentInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_ComponentsObject_GetComponent(m_pHandle, nIndex, &hComponentInstance)); - return resultIsValid; + if (!hComponentInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hComponentInstance))); } /** - * CObject::SetAttachmentAsThumbnail - Use an existing attachment as thumbnail for this object - * @param[in] pAttachment - Instance of a new or the existing thumbnailattachment object. + * CComponentsObject::GetComponentCount - Retrieves a component count of a component object. + * @return returns the component count */ - void CObject::SetAttachmentAsThumbnail(classParam pAttachment) + Lib3MF_uint32 CComponentsObject::GetComponentCount() { - Lib3MFHandle hAttachment = pAttachment.GetHandle(); - CheckError(m_pWrapper->m_WrapperTable.m_Object_SetAttachmentAsThumbnail(m_pHandle, hAttachment)); + Lib3MF_uint32 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ComponentsObject_GetComponentCount(m_pHandle, &resultCount)); + + return resultCount; } /** - * CObject::GetThumbnailAttachment - Get the attachment containing the object thumbnail. - * @return Instance of the thumbnailattachment object or NULL. + * Method definitions for class CBeamSet + */ + + /** + * CBeamSet::SetName - Sets a beamset's name string + * @param[in] sName - new name of the beamset. */ - PAttachment CObject::GetThumbnailAttachment() + void CBeamSet::SetName(const std::string & sName) { - Lib3MFHandle hAttachment = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_Object_GetThumbnailAttachment(m_pHandle, &hAttachment)); - - if (hAttachment) { - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hAttachment))); - } else { - return nullptr; - } + CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_SetName(m_pHandle, sName.c_str())); } /** - * CObject::ClearThumbnailAttachment - Clears the attachment. The attachment instance is not removed from the package. + * CBeamSet::GetName - Retrieves a beamset's name string + * @return returns the name of the beamset. */ - void CObject::ClearThumbnailAttachment() + std::string CBeamSet::GetName() { - CheckError(m_pWrapper->m_WrapperTable.m_Object_ClearThumbnailAttachment(m_pHandle)); + Lib3MF_uint32 bytesNeededName = 0; + Lib3MF_uint32 bytesWrittenName = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_GetName(m_pHandle, 0, &bytesNeededName, nullptr)); + std::vector bufferName(bytesNeededName); + CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_GetName(m_pHandle, bytesNeededName, &bytesWrittenName, &bufferName[0])); + + return std::string(&bufferName[0]); } /** - * CObject::GetOutbox - Returns the outbox of a build item - * @return Outbox of this build item + * CBeamSet::SetIdentifier - Sets a beamset's identifier string + * @param[in] sIdentifier - new name of the beamset. */ - sBox CObject::GetOutbox() + void CBeamSet::SetIdentifier(const std::string & sIdentifier) { - sBox resultOutbox; - CheckError(m_pWrapper->m_WrapperTable.m_Object_GetOutbox(m_pHandle, &resultOutbox)); - - return resultOutbox; + CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_SetIdentifier(m_pHandle, sIdentifier.c_str())); } /** - * CObject::GetUUID - Retrieves an object's uuid string (see production extension specification) - * @param[out] bHasUUID - flag whether the build item has a UUID - * @return returns object uuid. + * CBeamSet::GetIdentifier - Retrieves a beamset's identifier string + * @return returns the identifier of the beamset. */ - std::string CObject::GetUUID(bool & bHasUUID) + std::string CBeamSet::GetIdentifier() { - Lib3MF_uint32 bytesNeededUUID = 0; - Lib3MF_uint32 bytesWrittenUUID = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Object_GetUUID(m_pHandle, &bHasUUID, 0, &bytesNeededUUID, nullptr)); - std::vector bufferUUID(bytesNeededUUID); - CheckError(m_pWrapper->m_WrapperTable.m_Object_GetUUID(m_pHandle, &bHasUUID, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0])); + Lib3MF_uint32 bytesNeededIdentifier = 0; + Lib3MF_uint32 bytesWrittenIdentifier = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_GetIdentifier(m_pHandle, 0, &bytesNeededIdentifier, nullptr)); + std::vector bufferIdentifier(bytesNeededIdentifier); + CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_GetIdentifier(m_pHandle, bytesNeededIdentifier, &bytesWrittenIdentifier, &bufferIdentifier[0])); - return std::string(&bufferUUID[0]); + return std::string(&bufferIdentifier[0]); } /** - * CObject::SetUUID - Sets a build object's uuid string (see production extension specification) - * @param[in] sUUID - new object uuid string. + * CBeamSet::GetReferenceCount - Retrieves the reference count of a beamset + * @return returns the reference count */ - void CObject::SetUUID(const std::string & sUUID) + Lib3MF_uint32 CBeamSet::GetReferenceCount() { - CheckError(m_pWrapper->m_WrapperTable.m_Object_SetUUID(m_pHandle, sUUID.c_str())); + Lib3MF_uint32 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_GetReferenceCount(m_pHandle, &resultCount)); + + return resultCount; } /** - * CObject::GetMetaDataGroup - Returns the metadatagroup of this object - * @return returns an Instance of the metadatagroup of this object + * CBeamSet::SetReferences - Sets the references of a beamset + * @param[in] ReferencesBuffer - the new indices of all beams in this beamset */ - PMetaDataGroup CObject::GetMetaDataGroup() + void CBeamSet::SetReferences(const CInputVector & ReferencesBuffer) { - Lib3MFHandle hMetaDataGroup = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_Object_GetMetaDataGroup(m_pHandle, &hMetaDataGroup)); - - if (!hMetaDataGroup) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMetaDataGroup))); + CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_SetReferences(m_pHandle, (Lib3MF_uint64)ReferencesBuffer.size(), ReferencesBuffer.data())); } /** - * CObject::SetSlicesMeshResolution - set the meshresolution of the mesh object - * @param[in] eMeshResolution - meshresolution of this object + * CBeamSet::GetReferences - Retrieves the references of a beamset + * @param[out] ReferencesBuffer - retrieves the indices of all beams in this beamset */ - void CObject::SetSlicesMeshResolution(const eSlicesMeshResolution eMeshResolution) + void CBeamSet::GetReferences(std::vector & ReferencesBuffer) { - CheckError(m_pWrapper->m_WrapperTable.m_Object_SetSlicesMeshResolution(m_pHandle, eMeshResolution)); + Lib3MF_uint64 elementsNeededReferences = 0; + Lib3MF_uint64 elementsWrittenReferences = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_GetReferences(m_pHandle, 0, &elementsNeededReferences, nullptr)); + ReferencesBuffer.resize((size_t) elementsNeededReferences); + CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_GetReferences(m_pHandle, elementsNeededReferences, &elementsWrittenReferences, ReferencesBuffer.data())); } /** - * CObject::GetSlicesMeshResolution - get the meshresolution of the mesh object - * @return meshresolution of this object + * CBeamSet::GetBallReferenceCount - Retrieves the ball reference count of a beamset + * @return returns the ball reference count */ - eSlicesMeshResolution CObject::GetSlicesMeshResolution() + Lib3MF_uint32 CBeamSet::GetBallReferenceCount() { - eSlicesMeshResolution resultMeshResolution = (eSlicesMeshResolution) 0; - CheckError(m_pWrapper->m_WrapperTable.m_Object_GetSlicesMeshResolution(m_pHandle, &resultMeshResolution)); + Lib3MF_uint32 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_GetBallReferenceCount(m_pHandle, &resultCount)); - return resultMeshResolution; + return resultCount; } /** - * CObject::HasSlices - returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack - * @param[in] bRecursive - check also all referenced objects? - * @return does the object have a slice stack? + * CBeamSet::SetBallReferences - Sets the ball references of a beamset + * @param[in] BallReferencesBuffer - the new indices of all balls in this beamset */ - bool CObject::HasSlices(const bool bRecursive) + void CBeamSet::SetBallReferences(const CInputVector & BallReferencesBuffer) { - bool resultHasSlices = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Object_HasSlices(m_pHandle, bRecursive, &resultHasSlices)); - - return resultHasSlices; + CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_SetBallReferences(m_pHandle, (Lib3MF_uint64)BallReferencesBuffer.size(), BallReferencesBuffer.data())); } /** - * CObject::ClearSliceStack - unlinks the attached slicestack from this object. If no slice stack is attached, do noting. + * CBeamSet::GetBallReferences - Retrieves the ball references of a beamset + * @param[out] BallReferencesBuffer - retrieves the indices of all balls in this beamset */ - void CObject::ClearSliceStack() + void CBeamSet::GetBallReferences(std::vector & BallReferencesBuffer) { - CheckError(m_pWrapper->m_WrapperTable.m_Object_ClearSliceStack(m_pHandle)); + Lib3MF_uint64 elementsNeededBallReferences = 0; + Lib3MF_uint64 elementsWrittenBallReferences = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_GetBallReferences(m_pHandle, 0, &elementsNeededBallReferences, nullptr)); + BallReferencesBuffer.resize((size_t) elementsNeededBallReferences); + CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_GetBallReferences(m_pHandle, elementsNeededBallReferences, &elementsWrittenBallReferences, BallReferencesBuffer.data())); } /** - * CObject::GetSliceStack - get the Slicestack attached to the object - * @return returns the slicestack instance + * Method definitions for class CBaseMaterialGroup + */ + + /** + * CBaseMaterialGroup::GetCount - Retrieves the count of base materials in the material group. + * @return returns the count of base materials. */ - PSliceStack CObject::GetSliceStack() + Lib3MF_uint32 CBaseMaterialGroup::GetCount() { - Lib3MFHandle hSliceStackInstance = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_Object_GetSliceStack(m_pHandle, &hSliceStackInstance)); + Lib3MF_uint32 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BaseMaterialGroup_GetCount(m_pHandle, &resultCount)); - if (!hSliceStackInstance) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hSliceStackInstance))); + return resultCount; } /** - * CObject::AssignSliceStack - assigns a slicestack to the object - * @param[in] pSliceStackInstance - the new slice stack of this Object + * CBaseMaterialGroup::GetAllPropertyIDs - returns all the PropertyIDs of all materials in this group + * @param[out] PropertyIDsBuffer - PropertyID of the material in the material group. */ - void CObject::AssignSliceStack(classParam pSliceStackInstance) + void CBaseMaterialGroup::GetAllPropertyIDs(std::vector & PropertyIDsBuffer) { - Lib3MFHandle hSliceStackInstance = pSliceStackInstance.GetHandle(); - CheckError(m_pWrapper->m_WrapperTable.m_Object_AssignSliceStack(m_pHandle, hSliceStackInstance)); + Lib3MF_uint64 elementsNeededPropertyIDs = 0; + Lib3MF_uint64 elementsWrittenPropertyIDs = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BaseMaterialGroup_GetAllPropertyIDs(m_pHandle, 0, &elementsNeededPropertyIDs, nullptr)); + PropertyIDsBuffer.resize((size_t) elementsNeededPropertyIDs); + CheckError(m_pWrapper->m_WrapperTable.m_BaseMaterialGroup_GetAllPropertyIDs(m_pHandle, elementsNeededPropertyIDs, &elementsWrittenPropertyIDs, PropertyIDsBuffer.data())); } /** - * Method definitions for class CMeshObject - */ - - /** - * CMeshObject::GetVertexCount - Returns the vertex count of a mesh object. - * @return filled with the vertex count. + * CBaseMaterialGroup::AddMaterial - Adds a new material to the material group + * @param[in] sName - new name of the base material. + * @param[in] DisplayColor - Display color of the material + * @return returns new PropertyID of the new material in the material group. */ - Lib3MF_uint32 CMeshObject::GetVertexCount() + Lib3MF_uint32 CBaseMaterialGroup::AddMaterial(const std::string & sName, const sColor & DisplayColor) { - Lib3MF_uint32 resultVertexCount = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_GetVertexCount(m_pHandle, &resultVertexCount)); + Lib3MF_uint32 resultPropertyID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BaseMaterialGroup_AddMaterial(m_pHandle, sName.c_str(), &DisplayColor, &resultPropertyID)); - return resultVertexCount; + return resultPropertyID; } /** - * CMeshObject::GetTriangleCount - Returns the triangle count of a mesh object. - * @return filled with the triangle count. + * CBaseMaterialGroup::RemoveMaterial - Removes a material from the material group. + * @param[in] nPropertyID - PropertyID of the material in the material group. */ - Lib3MF_uint32 CMeshObject::GetTriangleCount() + void CBaseMaterialGroup::RemoveMaterial(const Lib3MF_uint32 nPropertyID) { - Lib3MF_uint32 resultVertexCount = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_GetTriangleCount(m_pHandle, &resultVertexCount)); - - return resultVertexCount; + CheckError(m_pWrapper->m_WrapperTable.m_BaseMaterialGroup_RemoveMaterial(m_pHandle, nPropertyID)); } /** - * CMeshObject::GetVertex - Returns the vertex count of a mesh object. - * @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) - * @return filled with the vertex coordinates. + * CBaseMaterialGroup::GetName - Returns the base material's name + * @param[in] nPropertyID - PropertyID of the material in the material group. + * @return returns the name of the base material. */ - sPosition CMeshObject::GetVertex(const Lib3MF_uint32 nIndex) + std::string CBaseMaterialGroup::GetName(const Lib3MF_uint32 nPropertyID) { - sPosition resultCoordinates; - CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_GetVertex(m_pHandle, nIndex, &resultCoordinates)); + Lib3MF_uint32 bytesNeededName = 0; + Lib3MF_uint32 bytesWrittenName = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BaseMaterialGroup_GetName(m_pHandle, nPropertyID, 0, &bytesNeededName, nullptr)); + std::vector bufferName(bytesNeededName); + CheckError(m_pWrapper->m_WrapperTable.m_BaseMaterialGroup_GetName(m_pHandle, nPropertyID, bytesNeededName, &bytesWrittenName, &bufferName[0])); - return resultCoordinates; + return std::string(&bufferName[0]); } /** - * CMeshObject::SetVertex - Sets the coordinates of a single vertex of a mesh object - * @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) - * @param[in] Coordinates - contains the vertex coordinates. + * CBaseMaterialGroup::SetName - Sets a base material's name + * @param[in] nPropertyID - PropertyID of the material in the material group. + * @param[in] sName - new name of the base material. */ - void CMeshObject::SetVertex(const Lib3MF_uint32 nIndex, const sPosition & Coordinates) + void CBaseMaterialGroup::SetName(const Lib3MF_uint32 nPropertyID, const std::string & sName) { - CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_SetVertex(m_pHandle, nIndex, &Coordinates)); + CheckError(m_pWrapper->m_WrapperTable.m_BaseMaterialGroup_SetName(m_pHandle, nPropertyID, sName.c_str())); } /** - * CMeshObject::AddVertex - Adds a single vertex to a mesh object - * @param[in] Coordinates - contains the vertex coordinates. - * @return Index of the new vertex + * CBaseMaterialGroup::SetDisplayColor - Sets a base material's display color. + * @param[in] nPropertyID - PropertyID of the material in the material group. + * @param[in] TheColor - The base material's display color */ - Lib3MF_uint32 CMeshObject::AddVertex(const sPosition & Coordinates) + void CBaseMaterialGroup::SetDisplayColor(const Lib3MF_uint32 nPropertyID, const sColor & TheColor) { - Lib3MF_uint32 resultNewIndex = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_AddVertex(m_pHandle, &Coordinates, &resultNewIndex)); - - return resultNewIndex; + CheckError(m_pWrapper->m_WrapperTable.m_BaseMaterialGroup_SetDisplayColor(m_pHandle, nPropertyID, &TheColor)); } /** - * CMeshObject::GetVertices - Obtains all vertex positions of a mesh object - * @param[out] VerticesBuffer - contains the vertex coordinates. + * CBaseMaterialGroup::GetDisplayColor - Returns a base material's display color. + * @param[in] nPropertyID - PropertyID of the material in the material group. + * @return The base material's display color */ - void CMeshObject::GetVertices(std::vector & VerticesBuffer) + sColor CBaseMaterialGroup::GetDisplayColor(const Lib3MF_uint32 nPropertyID) { - Lib3MF_uint64 elementsNeededVertices = 0; - Lib3MF_uint64 elementsWrittenVertices = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_GetVertices(m_pHandle, 0, &elementsNeededVertices, nullptr)); - VerticesBuffer.resize((size_t) elementsNeededVertices); - CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_GetVertices(m_pHandle, elementsNeededVertices, &elementsWrittenVertices, VerticesBuffer.data())); + sColor resultTheColor; + CheckError(m_pWrapper->m_WrapperTable.m_BaseMaterialGroup_GetDisplayColor(m_pHandle, nPropertyID, &resultTheColor)); + + return resultTheColor; } /** - * CMeshObject::GetTriangle - Returns indices of a single triangle of a mesh object. - * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) - * @return filled with the triangle indices. + * Method definitions for class CColorGroup + */ + + /** + * CColorGroup::GetCount - Retrieves the count of base materials in this Color Group. + * @return returns the count of colors within this color group. */ - sTriangle CMeshObject::GetTriangle(const Lib3MF_uint32 nIndex) + Lib3MF_uint32 CColorGroup::GetCount() { - sTriangle resultIndices; - CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_GetTriangle(m_pHandle, nIndex, &resultIndices)); + Lib3MF_uint32 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ColorGroup_GetCount(m_pHandle, &resultCount)); - return resultIndices; + return resultCount; } /** - * CMeshObject::SetTriangle - Sets the indices of a single triangle of a mesh object. - * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) - * @param[in] Indices - contains the triangle indices. + * CColorGroup::GetAllPropertyIDs - returns all the PropertyIDs of all colors within this group + * @param[out] PropertyIDsBuffer - PropertyID of the color in the color group. */ - void CMeshObject::SetTriangle(const Lib3MF_uint32 nIndex, const sTriangle & Indices) + void CColorGroup::GetAllPropertyIDs(std::vector & PropertyIDsBuffer) { - CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_SetTriangle(m_pHandle, nIndex, &Indices)); + Lib3MF_uint64 elementsNeededPropertyIDs = 0; + Lib3MF_uint64 elementsWrittenPropertyIDs = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ColorGroup_GetAllPropertyIDs(m_pHandle, 0, &elementsNeededPropertyIDs, nullptr)); + PropertyIDsBuffer.resize((size_t) elementsNeededPropertyIDs); + CheckError(m_pWrapper->m_WrapperTable.m_ColorGroup_GetAllPropertyIDs(m_pHandle, elementsNeededPropertyIDs, &elementsWrittenPropertyIDs, PropertyIDsBuffer.data())); } /** - * CMeshObject::AddTriangle - Adds a single triangle to a mesh object - * @param[in] Indices - contains the triangle indices. - * @return Index of the new triangle + * CColorGroup::AddColor - Adds a new value. + * @param[in] TheColor - The new color + * @return PropertyID of the new color within this color group. */ - Lib3MF_uint32 CMeshObject::AddTriangle(const sTriangle & Indices) + Lib3MF_uint32 CColorGroup::AddColor(const sColor & TheColor) { - Lib3MF_uint32 resultNewIndex = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_AddTriangle(m_pHandle, &Indices, &resultNewIndex)); + Lib3MF_uint32 resultPropertyID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ColorGroup_AddColor(m_pHandle, &TheColor, &resultPropertyID)); - return resultNewIndex; + return resultPropertyID; } /** - * CMeshObject::GetTriangleIndices - Get all triangles of a mesh object - * @param[out] IndicesBuffer - contains the triangle indices. + * CColorGroup::RemoveColor - Removes a color from the color group. + * @param[in] nPropertyID - PropertyID of the color to be removed from the color group. */ - void CMeshObject::GetTriangleIndices(std::vector & IndicesBuffer) + void CColorGroup::RemoveColor(const Lib3MF_uint32 nPropertyID) { - Lib3MF_uint64 elementsNeededIndices = 0; - Lib3MF_uint64 elementsWrittenIndices = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_GetTriangleIndices(m_pHandle, 0, &elementsNeededIndices, nullptr)); - IndicesBuffer.resize((size_t) elementsNeededIndices); - CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_GetTriangleIndices(m_pHandle, elementsNeededIndices, &elementsWrittenIndices, IndicesBuffer.data())); + CheckError(m_pWrapper->m_WrapperTable.m_ColorGroup_RemoveColor(m_pHandle, nPropertyID)); } /** - * CMeshObject::SetObjectLevelProperty - Sets the property at the object-level of the mesh object. - * @param[in] nUniqueResourceID - the object-level Property UniqueResourceID. - * @param[in] nPropertyID - the object-level PropertyID. + * CColorGroup::SetColor - Sets a color value. + * @param[in] nPropertyID - PropertyID of a color within this color group. + * @param[in] TheColor - The color */ - void CMeshObject::SetObjectLevelProperty(const Lib3MF_uint32 nUniqueResourceID, const Lib3MF_uint32 nPropertyID) + void CColorGroup::SetColor(const Lib3MF_uint32 nPropertyID, const sColor & TheColor) + { + CheckError(m_pWrapper->m_WrapperTable.m_ColorGroup_SetColor(m_pHandle, nPropertyID, &TheColor)); + } + + /** + * CColorGroup::GetColor - Sets a color value. + * @param[in] nPropertyID - PropertyID of a color within this color group. + * @return The color + */ + sColor CColorGroup::GetColor(const Lib3MF_uint32 nPropertyID) { - CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_SetObjectLevelProperty(m_pHandle, nUniqueResourceID, nPropertyID)); + sColor resultTheColor; + CheckError(m_pWrapper->m_WrapperTable.m_ColorGroup_GetColor(m_pHandle, nPropertyID, &resultTheColor)); + + return resultTheColor; } /** - * CMeshObject::GetObjectLevelProperty - Gets the property at the object-level of the mesh object. - * @param[out] nUniqueResourceID - the object-level Property UniqueResourceID. - * @param[out] nPropertyID - the object-level PropertyID. - * @return Has an object-level property been specified? + * Method definitions for class CTexture2DGroup + */ + + /** + * CTexture2DGroup::GetCount - Retrieves the count of tex2coords in the Texture2DGroup. + * @return returns the count of tex2coords. */ - bool CMeshObject::GetObjectLevelProperty(Lib3MF_uint32 & nUniqueResourceID, Lib3MF_uint32 & nPropertyID) + Lib3MF_uint32 CTexture2DGroup::GetCount() { - bool resultHasObjectLevelProperty = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_GetObjectLevelProperty(m_pHandle, &nUniqueResourceID, &nPropertyID, &resultHasObjectLevelProperty)); + Lib3MF_uint32 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Texture2DGroup_GetCount(m_pHandle, &resultCount)); - return resultHasObjectLevelProperty; + return resultCount; } /** - * CMeshObject::SetTriangleProperties - Sets the properties of a single triangle of a mesh object. - * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) - * @param[in] Properties - contains the triangle properties. + * CTexture2DGroup::GetAllPropertyIDs - returns all the PropertyIDs of all tex2coords in this Texture2DGroup + * @param[out] PropertyIDsBuffer - PropertyID of the tex2coords in the Texture2DGroup. */ - void CMeshObject::SetTriangleProperties(const Lib3MF_uint32 nIndex, const sTriangleProperties & Properties) + void CTexture2DGroup::GetAllPropertyIDs(std::vector & PropertyIDsBuffer) { - CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_SetTriangleProperties(m_pHandle, nIndex, &Properties)); + Lib3MF_uint64 elementsNeededPropertyIDs = 0; + Lib3MF_uint64 elementsWrittenPropertyIDs = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Texture2DGroup_GetAllPropertyIDs(m_pHandle, 0, &elementsNeededPropertyIDs, nullptr)); + PropertyIDsBuffer.resize((size_t) elementsNeededPropertyIDs); + CheckError(m_pWrapper->m_WrapperTable.m_Texture2DGroup_GetAllPropertyIDs(m_pHandle, elementsNeededPropertyIDs, &elementsWrittenPropertyIDs, PropertyIDsBuffer.data())); } /** - * CMeshObject::GetTriangleProperties - Gets the properties of a single triangle of a mesh object. - * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) - * @param[out] Property - returns the triangle properties. + * CTexture2DGroup::AddTex2Coord - Adds a new tex2coord to the Texture2DGroup + * @param[in] UVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. + * @return returns new PropertyID of the new tex2coord in the Texture2DGroup. */ - void CMeshObject::GetTriangleProperties(const Lib3MF_uint32 nIndex, sTriangleProperties & Property) + Lib3MF_uint32 CTexture2DGroup::AddTex2Coord(const sTex2Coord & UVCoordinate) { - CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_GetTriangleProperties(m_pHandle, nIndex, &Property)); + Lib3MF_uint32 resultPropertyID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Texture2DGroup_AddTex2Coord(m_pHandle, &UVCoordinate, &resultPropertyID)); + + return resultPropertyID; } /** - * CMeshObject::SetAllTriangleProperties - Sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. - * @param[in] PropertiesArrayBuffer - contains the triangle properties array. Must have trianglecount elements. + * CTexture2DGroup::GetTex2Coord - Obtains a tex2coord to the Texture2DGroup + * @param[in] nPropertyID - the PropertyID of the tex2coord in the Texture2DGroup. + * @return The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. */ - void CMeshObject::SetAllTriangleProperties(const CInputVector & PropertiesArrayBuffer) + sTex2Coord CTexture2DGroup::GetTex2Coord(const Lib3MF_uint32 nPropertyID) { - CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_SetAllTriangleProperties(m_pHandle, (Lib3MF_uint64)PropertiesArrayBuffer.size(), PropertiesArrayBuffer.data())); + sTex2Coord resultUVCoordinate; + CheckError(m_pWrapper->m_WrapperTable.m_Texture2DGroup_GetTex2Coord(m_pHandle, nPropertyID, &resultUVCoordinate)); + + return resultUVCoordinate; } /** - * CMeshObject::GetAllTriangleProperties - Gets the properties of all triangles of a mesh object. - * @param[out] PropertiesArrayBuffer - returns the triangle properties array. Must have trianglecount elements. + * CTexture2DGroup::RemoveTex2Coord - Removes a tex2coords from the Texture2DGroup. + * @param[in] nPropertyID - PropertyID of the tex2coords in the Texture2DGroup. */ - void CMeshObject::GetAllTriangleProperties(std::vector & PropertiesArrayBuffer) + void CTexture2DGroup::RemoveTex2Coord(const Lib3MF_uint32 nPropertyID) { - Lib3MF_uint64 elementsNeededPropertiesArray = 0; - Lib3MF_uint64 elementsWrittenPropertiesArray = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_GetAllTriangleProperties(m_pHandle, 0, &elementsNeededPropertiesArray, nullptr)); - PropertiesArrayBuffer.resize((size_t) elementsNeededPropertiesArray); - CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_GetAllTriangleProperties(m_pHandle, elementsNeededPropertiesArray, &elementsWrittenPropertiesArray, PropertiesArrayBuffer.data())); + CheckError(m_pWrapper->m_WrapperTable.m_Texture2DGroup_RemoveTex2Coord(m_pHandle, nPropertyID)); } /** - * CMeshObject::ClearAllProperties - Clears all properties of this mesh object (triangle and object-level). + * CTexture2DGroup::GetTexture2D - Obtains the texture2D instance of this group. + * @return the texture2D instance of this group. */ - void CMeshObject::ClearAllProperties() + PTexture2D CTexture2DGroup::GetTexture2D() { - CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_ClearAllProperties(m_pHandle)); + Lib3MFHandle hTexture2DInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Texture2DGroup_GetTexture2D(m_pHandle, &hTexture2DInstance)); + + if (!hTexture2DInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTexture2DInstance))); } /** - * CMeshObject::SetGeometry - Set all triangles of a mesh object - * @param[in] VerticesBuffer - contains the positions. - * @param[in] IndicesBuffer - contains the triangle indices. + * Method definitions for class CCompositeMaterials + */ + + /** + * CCompositeMaterials::GetCount - Retrieves the count of Composite-s in the CompositeMaterials. + * @return returns the count of Composite-s */ - void CMeshObject::SetGeometry(const CInputVector & VerticesBuffer, const CInputVector & IndicesBuffer) + Lib3MF_uint32 CCompositeMaterials::GetCount() { - CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_SetGeometry(m_pHandle, (Lib3MF_uint64)VerticesBuffer.size(), VerticesBuffer.data(), (Lib3MF_uint64)IndicesBuffer.size(), IndicesBuffer.data())); + Lib3MF_uint32 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CompositeMaterials_GetCount(m_pHandle, &resultCount)); + + return resultCount; } /** - * CMeshObject::IsManifoldAndOriented - Retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. - * @return returns, if the object is oriented and manifold. + * CCompositeMaterials::GetAllPropertyIDs - returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials + * @param[out] PropertyIDsBuffer - PropertyID of the Composite-Mixing Values in the CompositeMaterials. */ - bool CMeshObject::IsManifoldAndOriented() + void CCompositeMaterials::GetAllPropertyIDs(std::vector & PropertyIDsBuffer) { - bool resultIsManifoldAndOriented = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_IsManifoldAndOriented(m_pHandle, &resultIsManifoldAndOriented)); - - return resultIsManifoldAndOriented; + Lib3MF_uint64 elementsNeededPropertyIDs = 0; + Lib3MF_uint64 elementsWrittenPropertyIDs = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CompositeMaterials_GetAllPropertyIDs(m_pHandle, 0, &elementsNeededPropertyIDs, nullptr)); + PropertyIDsBuffer.resize((size_t) elementsNeededPropertyIDs); + CheckError(m_pWrapper->m_WrapperTable.m_CompositeMaterials_GetAllPropertyIDs(m_pHandle, elementsNeededPropertyIDs, &elementsWrittenPropertyIDs, PropertyIDsBuffer.data())); } /** - * CMeshObject::BeamLattice - Retrieves the BeamLattice within this MeshObject. - * @return the BeamLattice within this MeshObject + * CCompositeMaterials::GetBaseMaterialGroup - Obtains the BaseMaterialGroup instance of this CompositeMaterials. + * @return returns the BaseMaterialGroup instance of this CompositeMaterials */ - PBeamLattice CMeshObject::BeamLattice() + PBaseMaterialGroup CCompositeMaterials::GetBaseMaterialGroup() { - Lib3MFHandle hTheBeamLattice = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MeshObject_BeamLattice(m_pHandle, &hTheBeamLattice)); + Lib3MFHandle hBaseMaterialGroupInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_CompositeMaterials_GetBaseMaterialGroup(m_pHandle, &hBaseMaterialGroupInstance)); - if (!hTheBeamLattice) { + if (!hBaseMaterialGroupInstance) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTheBeamLattice))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBaseMaterialGroupInstance))); } /** - * Method definitions for class CBeamLattice - */ + * CCompositeMaterials::AddComposite - Adds a new Composite-Mixing Values to the CompositeMaterials. + * @param[in] CompositeBuffer - The Composite Constituents to be added as composite + * @return returns new PropertyID of the new Composite in the CompositeMaterials. + */ + Lib3MF_uint32 CCompositeMaterials::AddComposite(const CInputVector & CompositeBuffer) + { + Lib3MF_uint32 resultPropertyID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CompositeMaterials_AddComposite(m_pHandle, (Lib3MF_uint64)CompositeBuffer.size(), CompositeBuffer.data(), &resultPropertyID)); + + return resultPropertyID; + } /** - * CBeamLattice::GetMinLength - Returns the minimal length of beams for the beamlattice. - * @return minimal length of beams for the beamlattice + * CCompositeMaterials::RemoveComposite - Removes a Composite-Maxing Ratio from the CompositeMaterials. + * @param[in] nPropertyID - PropertyID of the Composite-Mixing Values in the CompositeMaterials to be removed. */ - Lib3MF_double CBeamLattice::GetMinLength() + void CCompositeMaterials::RemoveComposite(const Lib3MF_uint32 nPropertyID) { - Lib3MF_double resultMinLength = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetMinLength(m_pHandle, &resultMinLength)); - - return resultMinLength; + CheckError(m_pWrapper->m_WrapperTable.m_CompositeMaterials_RemoveComposite(m_pHandle, nPropertyID)); } /** - * CBeamLattice::SetMinLength - Sets the minimal length of beams for the beamlattice. - * @param[in] dMinLength - minimal length of beams for the beamlattice + * CCompositeMaterials::GetComposite - Obtains a Composite-Maxing Ratio of this CompositeMaterials. + * @param[in] nPropertyID - the PropertyID of the Composite-Maxing Ratio in the CompositeMaterials. + * @param[out] CompositeBuffer - The Composite-Mixing Values with the given PropertyID */ - void CBeamLattice::SetMinLength(const Lib3MF_double dMinLength) + void CCompositeMaterials::GetComposite(const Lib3MF_uint32 nPropertyID, std::vector & CompositeBuffer) { - CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_SetMinLength(m_pHandle, dMinLength)); + Lib3MF_uint64 elementsNeededComposite = 0; + Lib3MF_uint64 elementsWrittenComposite = 0; + CheckError(m_pWrapper->m_WrapperTable.m_CompositeMaterials_GetComposite(m_pHandle, nPropertyID, 0, &elementsNeededComposite, nullptr)); + CompositeBuffer.resize((size_t) elementsNeededComposite); + CheckError(m_pWrapper->m_WrapperTable.m_CompositeMaterials_GetComposite(m_pHandle, nPropertyID, elementsNeededComposite, &elementsWrittenComposite, CompositeBuffer.data())); } /** - * CBeamLattice::GetClipping - Returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. - * @param[out] eClipMode - contains the clip mode of this mesh - * @param[out] nUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object or an undefined value if pClipMode is MODELBEAMLATTICECLIPMODE_NONE + * Method definitions for class CMultiPropertyGroup + */ + + /** + * CMultiPropertyGroup::GetCount - Retrieves the count of MultiProperty-s in the MultiPropertyGroup. + * @return returns the count of MultiProperty-s */ - void CBeamLattice::GetClipping(eBeamLatticeClipMode & eClipMode, Lib3MF_uint32 & nUniqueResourceID) + Lib3MF_uint32 CMultiPropertyGroup::GetCount() { - CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetClipping(m_pHandle, &eClipMode, &nUniqueResourceID)); + Lib3MF_uint32 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroup_GetCount(m_pHandle, &resultCount)); + + return resultCount; } /** - * CBeamLattice::SetClipping - Sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. - * @param[in] eClipMode - contains the clip mode of this mesh - * @param[in] nUniqueResourceID - the UniqueResourceID of the clipping mesh-object. This mesh-object has to be defined before setting the Clipping. + * CMultiPropertyGroup::GetAllPropertyIDs - returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup + * @param[out] PropertyIDsBuffer - PropertyID of the MultiProperty-s in the MultiPropertyGroup. */ - void CBeamLattice::SetClipping(const eBeamLatticeClipMode eClipMode, const Lib3MF_uint32 nUniqueResourceID) + void CMultiPropertyGroup::GetAllPropertyIDs(std::vector & PropertyIDsBuffer) { - CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_SetClipping(m_pHandle, eClipMode, nUniqueResourceID)); + Lib3MF_uint64 elementsNeededPropertyIDs = 0; + Lib3MF_uint64 elementsWrittenPropertyIDs = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroup_GetAllPropertyIDs(m_pHandle, 0, &elementsNeededPropertyIDs, nullptr)); + PropertyIDsBuffer.resize((size_t) elementsNeededPropertyIDs); + CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroup_GetAllPropertyIDs(m_pHandle, elementsNeededPropertyIDs, &elementsWrittenPropertyIDs, PropertyIDsBuffer.data())); } /** - * CBeamLattice::GetRepresentation - Returns the representation-mesh for the beamlattice of this mesh. - * @return flag whether the beamlattice has a representation mesh. - * @param[out] nUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object. + * CMultiPropertyGroup::AddMultiProperty - Adds a new MultiProperty to the MultiPropertyGroup. + * @param[in] PropertyIDsBuffer - The PropertyIDs of the new MultiProperty. + * @return returns the PropertyID of the new MultiProperty in the MultiPropertyGroup. */ - bool CBeamLattice::GetRepresentation(Lib3MF_uint32 & nUniqueResourceID) + Lib3MF_uint32 CMultiPropertyGroup::AddMultiProperty(const CInputVector & PropertyIDsBuffer) { - bool resultHasRepresentation = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetRepresentation(m_pHandle, &resultHasRepresentation, &nUniqueResourceID)); + Lib3MF_uint32 resultPropertyID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroup_AddMultiProperty(m_pHandle, (Lib3MF_uint64)PropertyIDsBuffer.size(), PropertyIDsBuffer.data(), &resultPropertyID)); - return resultHasRepresentation; + return resultPropertyID; } /** - * CBeamLattice::SetRepresentation - Sets the representation-mesh for the beamlattice of this mesh. - * @param[in] nUniqueResourceID - the UniqueResourceID of the representation mesh-object. This mesh-object has to be defined before setting the representation. + * CMultiPropertyGroup::SetMultiProperty - Sets the PropertyIDs of a MultiProperty. + * @param[in] nPropertyID - the PropertyID of the MultiProperty to be changed. + * @param[in] PropertyIDsBuffer - The new PropertyIDs of the MultiProperty */ - void CBeamLattice::SetRepresentation(const Lib3MF_uint32 nUniqueResourceID) + void CMultiPropertyGroup::SetMultiProperty(const Lib3MF_uint32 nPropertyID, const CInputVector & PropertyIDsBuffer) { - CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_SetRepresentation(m_pHandle, nUniqueResourceID)); + CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroup_SetMultiProperty(m_pHandle, nPropertyID, (Lib3MF_uint64)PropertyIDsBuffer.size(), PropertyIDsBuffer.data())); } /** - * CBeamLattice::GetBallOptions - Returns the ball mode and the default ball radius for the beamlattice of this mesh. - * @param[out] eBallMode - contains the ball mode of this mesh - * @param[out] dBallRadius - default ball radius of balls for the beamlattice + * CMultiPropertyGroup::GetMultiProperty - Obtains the PropertyIDs of a MultiProperty. + * @param[in] nPropertyID - the PropertyID of the MultiProperty to be queried. + * @param[out] PropertyIDsBuffer - The PropertyIDs of the MultiProperty */ - void CBeamLattice::GetBallOptions(eBeamLatticeBallMode & eBallMode, Lib3MF_double & dBallRadius) + void CMultiPropertyGroup::GetMultiProperty(const Lib3MF_uint32 nPropertyID, std::vector & PropertyIDsBuffer) { - CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetBallOptions(m_pHandle, &eBallMode, &dBallRadius)); + Lib3MF_uint64 elementsNeededPropertyIDs = 0; + Lib3MF_uint64 elementsWrittenPropertyIDs = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroup_GetMultiProperty(m_pHandle, nPropertyID, 0, &elementsNeededPropertyIDs, nullptr)); + PropertyIDsBuffer.resize((size_t) elementsNeededPropertyIDs); + CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroup_GetMultiProperty(m_pHandle, nPropertyID, elementsNeededPropertyIDs, &elementsWrittenPropertyIDs, PropertyIDsBuffer.data())); } /** - * CBeamLattice::SetBallOptions - Sets the ball mode and thedefault ball radius for the beamlattice. - * @param[in] eBallMode - contains the ball mode of this mesh - * @param[in] dBallRadius - default ball radius of balls for the beamlattice + * CMultiPropertyGroup::RemoveMultiProperty - Removes a MultiProperty from this MultiPropertyGroup. + * @param[in] nPropertyID - the PropertyID of the MultiProperty to be removed. */ - void CBeamLattice::SetBallOptions(const eBeamLatticeBallMode eBallMode, const Lib3MF_double dBallRadius) + void CMultiPropertyGroup::RemoveMultiProperty(const Lib3MF_uint32 nPropertyID) { - CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_SetBallOptions(m_pHandle, eBallMode, dBallRadius)); + CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroup_RemoveMultiProperty(m_pHandle, nPropertyID)); } /** - * CBeamLattice::GetBeamCount - Returns the beam count of a mesh object. - * @return filled with the beam count. + * CMultiPropertyGroup::GetLayerCount - Retrieves the number of layers of this MultiPropertyGroup. + * @return returns the number of layers */ - Lib3MF_uint32 CBeamLattice::GetBeamCount() + Lib3MF_uint32 CMultiPropertyGroup::GetLayerCount() { Lib3MF_uint32 resultCount = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetBeamCount(m_pHandle, &resultCount)); + CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroup_GetLayerCount(m_pHandle, &resultCount)); return resultCount; } /** - * CBeamLattice::GetBeam - Returns indices, radii and capmodes of a single beam of a mesh object. - * @param[in] nIndex - Index of the beam (0 to beamcount - 1). - * @return filled with the beam indices, radii and capmodes. + * CMultiPropertyGroup::AddLayer - Adds a MultiPropertyLayer to this MultiPropertyGroup. + * @param[in] TheLayer - The MultiPropertyLayer to add to this MultiPropertyGroup + * @return returns the index of this MultiPropertyLayer */ - sBeam CBeamLattice::GetBeam(const Lib3MF_uint32 nIndex) + Lib3MF_uint32 CMultiPropertyGroup::AddLayer(const sMultiPropertyLayer & TheLayer) { - sBeam resultBeamInfo; - CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetBeam(m_pHandle, nIndex, &resultBeamInfo)); + Lib3MF_uint32 resultLayerIndex = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroup_AddLayer(m_pHandle, &TheLayer, &resultLayerIndex)); - return resultBeamInfo; + return resultLayerIndex; } /** - * CBeamLattice::AddBeam - Adds a single beam to a mesh object. - * @param[in] BeamInfo - contains the node indices, radii and capmodes. - * @return filled with the new Index of the beam. + * CMultiPropertyGroup::GetLayer - Obtains a MultiPropertyLayer of this MultiPropertyGroup. + * @param[in] nLayerIndex - The Index of the MultiPropertyLayer queried + * @return The MultiPropertyLayer with index LayerIndex within MultiPropertyGroup */ - Lib3MF_uint32 CBeamLattice::AddBeam(const sBeam & BeamInfo) + sMultiPropertyLayer CMultiPropertyGroup::GetLayer(const Lib3MF_uint32 nLayerIndex) { - Lib3MF_uint32 resultIndex = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_AddBeam(m_pHandle, &BeamInfo, &resultIndex)); + sMultiPropertyLayer resultTheLayer; + CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroup_GetLayer(m_pHandle, nLayerIndex, &resultTheLayer)); - return resultIndex; + return resultTheLayer; } /** - * CBeamLattice::SetBeam - Sets the indices, radii and capmodes of a single beam of a mesh object. - * @param[in] nIndex - Index of the beam (0 to beamcount - 1). - * @param[in] BeamInfo - filled with the beam indices, radii and capmodes. + * CMultiPropertyGroup::RemoveLayer - Removes a MultiPropertyLayer from this MultiPropertyGroup. + * @param[in] nLayerIndex - The Index of the MultiPropertyLayer to be removed */ - void CBeamLattice::SetBeam(const Lib3MF_uint32 nIndex, const sBeam & BeamInfo) + void CMultiPropertyGroup::RemoveLayer(const Lib3MF_uint32 nLayerIndex) { - CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_SetBeam(m_pHandle, nIndex, &BeamInfo)); + CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroup_RemoveLayer(m_pHandle, nLayerIndex)); } /** - * CBeamLattice::SetBeams - Sets all beam indices, radii and capmodes of a mesh object. - * @param[in] BeamInfoBuffer - contains information of a number of beams + * Method definitions for class CAttachment + */ + + /** + * CAttachment::GetPath - Retrieves an attachment's package path. This function will be removed in a later release. + * @return returns the attachment's package path string */ - void CBeamLattice::SetBeams(const CInputVector & BeamInfoBuffer) + std::string CAttachment::GetPath() { - CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_SetBeams(m_pHandle, (Lib3MF_uint64)BeamInfoBuffer.size(), BeamInfoBuffer.data())); + Lib3MF_uint32 bytesNeededPath = 0; + Lib3MF_uint32 bytesWrittenPath = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Attachment_GetPath(m_pHandle, 0, &bytesNeededPath, nullptr)); + std::vector bufferPath(bytesNeededPath); + CheckError(m_pWrapper->m_WrapperTable.m_Attachment_GetPath(m_pHandle, bytesNeededPath, &bytesWrittenPath, &bufferPath[0])); + + return std::string(&bufferPath[0]); } /** - * CBeamLattice::GetBeams - obtains all beam indices, radii and capmodes of a mesh object. - * @param[out] BeamInfoBuffer - contains information of all beams + * CAttachment::SetPath - Sets an attachment's package path. This function will be removed in a later release. + * @param[in] sPath - new path of the attachment. */ - void CBeamLattice::GetBeams(std::vector & BeamInfoBuffer) + void CAttachment::SetPath(const std::string & sPath) { - Lib3MF_uint64 elementsNeededBeamInfo = 0; - Lib3MF_uint64 elementsWrittenBeamInfo = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetBeams(m_pHandle, 0, &elementsNeededBeamInfo, nullptr)); - BeamInfoBuffer.resize((size_t) elementsNeededBeamInfo); - CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetBeams(m_pHandle, elementsNeededBeamInfo, &elementsWrittenBeamInfo, BeamInfoBuffer.data())); + CheckError(m_pWrapper->m_WrapperTable.m_Attachment_SetPath(m_pHandle, sPath.c_str())); } /** - * CBeamLattice::GetBallCount - Returns the ball count of a mesh object. - * @return filled with the ball count. + * CAttachment::PackagePart - Returns the PackagePart that is this attachment. + * @return The PackagePart of this attachment. */ - Lib3MF_uint32 CBeamLattice::GetBallCount() + PPackagePart CAttachment::PackagePart() { - Lib3MF_uint32 resultCount = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetBallCount(m_pHandle, &resultCount)); + Lib3MFHandle hPackagePart = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Attachment_PackagePart(m_pHandle, &hPackagePart)); - return resultCount; + if (!hPackagePart) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPackagePart))); } /** - * CBeamLattice::GetBall - Returns index and radius of a single ball of a mesh object. - * @param[in] nIndex - Index of the ball (0 to ballcount - 1). - * @return filled with the ball node index and radius. + * CAttachment::GetRelationShipType - Retrieves an attachment's relationship type + * @return returns the attachment's package relationship type string */ - sBall CBeamLattice::GetBall(const Lib3MF_uint32 nIndex) + std::string CAttachment::GetRelationShipType() { - sBall resultBallInfo; - CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetBall(m_pHandle, nIndex, &resultBallInfo)); + Lib3MF_uint32 bytesNeededPath = 0; + Lib3MF_uint32 bytesWrittenPath = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Attachment_GetRelationShipType(m_pHandle, 0, &bytesNeededPath, nullptr)); + std::vector bufferPath(bytesNeededPath); + CheckError(m_pWrapper->m_WrapperTable.m_Attachment_GetRelationShipType(m_pHandle, bytesNeededPath, &bytesWrittenPath, &bufferPath[0])); - return resultBallInfo; + return std::string(&bufferPath[0]); } /** - * CBeamLattice::AddBall - Adds a single ball to a mesh object. - * @param[in] BallInfo - contains the node index and radius. - * @return filled with the new Index of the ball. + * CAttachment::SetRelationShipType - Sets an attachment's relationship type. + * @param[in] sPath - new relationship type string. */ - Lib3MF_uint32 CBeamLattice::AddBall(const sBall & BallInfo) + void CAttachment::SetRelationShipType(const std::string & sPath) { - Lib3MF_uint32 resultIndex = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_AddBall(m_pHandle, &BallInfo, &resultIndex)); - - return resultIndex; + CheckError(m_pWrapper->m_WrapperTable.m_Attachment_SetRelationShipType(m_pHandle, sPath.c_str())); } /** - * CBeamLattice::SetBall - Sets the index and radius of a single ball of a mesh object. - * @param[in] nIndex - Index of the ball (0 to ballcount - 1). - * @param[in] BallInfo - filled with the ball node index and radius. + * CAttachment::WriteToFile - Writes out the attachment as file. + * @param[in] sFileName - file to write into. */ - void CBeamLattice::SetBall(const Lib3MF_uint32 nIndex, const sBall & BallInfo) + void CAttachment::WriteToFile(const std::string & sFileName) { - CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_SetBall(m_pHandle, nIndex, &BallInfo)); + CheckError(m_pWrapper->m_WrapperTable.m_Attachment_WriteToFile(m_pHandle, sFileName.c_str())); } /** - * CBeamLattice::SetBalls - Sets all ball indices and radii of a mesh object. - * @param[in] BallInfoBuffer - contains information of a number of balls + * CAttachment::ReadFromFile - Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. + * @param[in] sFileName - file to read from. */ - void CBeamLattice::SetBalls(const CInputVector & BallInfoBuffer) + void CAttachment::ReadFromFile(const std::string & sFileName) { - CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_SetBalls(m_pHandle, (Lib3MF_uint64)BallInfoBuffer.size(), BallInfoBuffer.data())); + CheckError(m_pWrapper->m_WrapperTable.m_Attachment_ReadFromFile(m_pHandle, sFileName.c_str())); } /** - * CBeamLattice::GetBalls - obtains all ball indices and radii of a mesh object. - * @param[out] BallInfoBuffer - contains information of all balls + * CAttachment::ReadFromCallback - Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. + * @param[in] pTheReadCallback - Callback to call for reading a data chunk + * @param[in] nStreamSize - number of bytes the callback returns + * @param[in] pTheSeekCallback - Callback to call for seeking in the stream. + * @param[in] pUserData - Userdata that is passed to the callback function */ - void CBeamLattice::GetBalls(std::vector & BallInfoBuffer) + void CAttachment::ReadFromCallback(const ReadCallback pTheReadCallback, const Lib3MF_uint64 nStreamSize, const SeekCallback pTheSeekCallback, const Lib3MF_pvoid pUserData) { - Lib3MF_uint64 elementsNeededBallInfo = 0; - Lib3MF_uint64 elementsWrittenBallInfo = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetBalls(m_pHandle, 0, &elementsNeededBallInfo, nullptr)); - BallInfoBuffer.resize((size_t) elementsNeededBallInfo); - CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetBalls(m_pHandle, elementsNeededBallInfo, &elementsWrittenBallInfo, BallInfoBuffer.data())); + CheckError(m_pWrapper->m_WrapperTable.m_Attachment_ReadFromCallback(m_pHandle, pTheReadCallback, nStreamSize, pTheSeekCallback, pUserData)); } /** - * CBeamLattice::GetBeamSetCount - Returns the number of beamsets of a mesh object. - * @return filled with the beamset count. + * CAttachment::GetStreamSize - Retrieves the size of the attachment stream + * @return the stream size */ - Lib3MF_uint32 CBeamLattice::GetBeamSetCount() + Lib3MF_uint64 CAttachment::GetStreamSize() { - Lib3MF_uint32 resultCount = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetBeamSetCount(m_pHandle, &resultCount)); + Lib3MF_uint64 resultStreamSize = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Attachment_GetStreamSize(m_pHandle, &resultStreamSize)); - return resultCount; + return resultStreamSize; } /** - * CBeamLattice::AddBeamSet - Adds an empty beamset to a mesh object - * @return the new beamset + * CAttachment::WriteToBuffer - Writes out the attachment into a buffer + * @param[out] BufferBuffer - Buffer to write into */ - PBeamSet CBeamLattice::AddBeamSet() + void CAttachment::WriteToBuffer(std::vector & BufferBuffer) { - Lib3MFHandle hBeamSet = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_AddBeamSet(m_pHandle, &hBeamSet)); - - if (!hBeamSet) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBeamSet))); + Lib3MF_uint64 elementsNeededBuffer = 0; + Lib3MF_uint64 elementsWrittenBuffer = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Attachment_WriteToBuffer(m_pHandle, 0, &elementsNeededBuffer, nullptr)); + BufferBuffer.resize((size_t) elementsNeededBuffer); + CheckError(m_pWrapper->m_WrapperTable.m_Attachment_WriteToBuffer(m_pHandle, elementsNeededBuffer, &elementsWrittenBuffer, BufferBuffer.data())); } /** - * CBeamLattice::GetBeamSet - Returns a beamset of a mesh object - * @param[in] nIndex - index of the requested beamset (0 ... beamsetcount-1). - * @return the requested beamset + * CAttachment::ReadFromBuffer - Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). + * @param[in] BufferBuffer - Buffer to read from */ - PBeamSet CBeamLattice::GetBeamSet(const Lib3MF_uint32 nIndex) + void CAttachment::ReadFromBuffer(const CInputVector & BufferBuffer) { - Lib3MFHandle hBeamSet = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_BeamLattice_GetBeamSet(m_pHandle, nIndex, &hBeamSet)); - - if (!hBeamSet) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBeamSet))); + CheckError(m_pWrapper->m_WrapperTable.m_Attachment_ReadFromBuffer(m_pHandle, (Lib3MF_uint64)BufferBuffer.size(), BufferBuffer.data())); } /** - * Method definitions for class CComponent + * Method definitions for class CTexture2D */ /** - * CComponent::GetObjectResource - Returns the Resource Instance of the component. - * @return filled with the Resource Instance. + * CTexture2D::GetAttachment - Retrieves the attachment located at the path of the texture. + * @return attachment that holds the texture's image information. */ - PObject CComponent::GetObjectResource() + PAttachment CTexture2D::GetAttachment() { - Lib3MFHandle hObjectResource = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_Component_GetObjectResource(m_pHandle, &hObjectResource)); + Lib3MFHandle hAttachment = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Texture2D_GetAttachment(m_pHandle, &hAttachment)); - if (!hObjectResource) { + if (!hAttachment) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hObjectResource))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hAttachment))); } /** - * CComponent::GetObjectResourceID - Returns the UniqueResourceID of the component. - * @return returns the UniqueResourceID. + * CTexture2D::SetAttachment - Sets the texture's package path to the path of the attachment. + * @param[in] pAttachment - attachment that holds the texture's image information. */ - Lib3MF_uint32 CComponent::GetObjectResourceID() + void CTexture2D::SetAttachment(classParam pAttachment) { - Lib3MF_uint32 resultUniqueResourceID = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Component_GetObjectResourceID(m_pHandle, &resultUniqueResourceID)); - - return resultUniqueResourceID; + Lib3MFHandle hAttachment = pAttachment.GetHandle(); + CheckError(m_pWrapper->m_WrapperTable.m_Texture2D_SetAttachment(m_pHandle, hAttachment)); } /** - * CComponent::GetUUID - returns, whether a component has a UUID and, if true, the component's UUID - * @param[out] bHasUUID - flag whether the component has a UUID - * @return the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + * CTexture2D::GetContentType - Retrieves a texture's content type. + * @return returns content type enum. */ - std::string CComponent::GetUUID(bool & bHasUUID) + eTextureType CTexture2D::GetContentType() { - Lib3MF_uint32 bytesNeededUUID = 0; - Lib3MF_uint32 bytesWrittenUUID = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Component_GetUUID(m_pHandle, &bHasUUID, 0, &bytesNeededUUID, nullptr)); - std::vector bufferUUID(bytesNeededUUID); - CheckError(m_pWrapper->m_WrapperTable.m_Component_GetUUID(m_pHandle, &bHasUUID, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0])); + eTextureType resultContentType = (eTextureType) 0; + CheckError(m_pWrapper->m_WrapperTable.m_Texture2D_GetContentType(m_pHandle, &resultContentType)); - return std::string(&bufferUUID[0]); + return resultContentType; } /** - * CComponent::SetUUID - sets the component's UUID - * @param[in] sUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + * CTexture2D::SetContentType - Retrieves a texture's content type. + * @param[in] eContentType - new Content Type */ - void CComponent::SetUUID(const std::string & sUUID) + void CTexture2D::SetContentType(const eTextureType eContentType) { - CheckError(m_pWrapper->m_WrapperTable.m_Component_SetUUID(m_pHandle, sUUID.c_str())); + CheckError(m_pWrapper->m_WrapperTable.m_Texture2D_SetContentType(m_pHandle, eContentType)); } /** - * CComponent::HasTransform - Returns, if the component has a different transformation than the identity matrix - * @return if true is returned, the transformation is not equal than the identity + * CTexture2D::GetTileStyleUV - Retrieves a texture's tilestyle type. + * @param[out] eTileStyleU - returns tilestyle type enum. + * @param[out] eTileStyleV - returns tilestyle type enum. */ - bool CComponent::HasTransform() + void CTexture2D::GetTileStyleUV(eTextureTileStyle & eTileStyleU, eTextureTileStyle & eTileStyleV) { - bool resultHasTransform = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Component_HasTransform(m_pHandle, &resultHasTransform)); - - return resultHasTransform; + CheckError(m_pWrapper->m_WrapperTable.m_Texture2D_GetTileStyleUV(m_pHandle, &eTileStyleU, &eTileStyleV)); + } + + /** + * CTexture2D::SetTileStyleUV - Sets a texture's tilestyle type. + * @param[in] eTileStyleU - new tilestyle type enum. + * @param[in] eTileStyleV - new tilestyle type enum. + */ + void CTexture2D::SetTileStyleUV(const eTextureTileStyle eTileStyleU, const eTextureTileStyle eTileStyleV) + { + CheckError(m_pWrapper->m_WrapperTable.m_Texture2D_SetTileStyleUV(m_pHandle, eTileStyleU, eTileStyleV)); } /** - * CComponent::GetTransform - Returns the transformation matrix of the component. - * @return filled with the component transformation matrix + * CTexture2D::GetFilter - Retrieves a texture's filter type. + * @return returns filter type enum. */ - sTransform CComponent::GetTransform() + eTextureFilter CTexture2D::GetFilter() { - sTransform resultTransform; - CheckError(m_pWrapper->m_WrapperTable.m_Component_GetTransform(m_pHandle, &resultTransform)); + eTextureFilter resultFilter = (eTextureFilter) 0; + CheckError(m_pWrapper->m_WrapperTable.m_Texture2D_GetFilter(m_pHandle, &resultFilter)); - return resultTransform; + return resultFilter; } /** - * CComponent::SetTransform - Sets the transformation matrix of the component. - * @param[in] Transform - new transformation matrix + * CTexture2D::SetFilter - Sets a texture's filter type. + * @param[in] eFilter - sets new filter type enum. */ - void CComponent::SetTransform(const sTransform & Transform) + void CTexture2D::SetFilter(const eTextureFilter eFilter) { - CheckError(m_pWrapper->m_WrapperTable.m_Component_SetTransform(m_pHandle, &Transform)); + CheckError(m_pWrapper->m_WrapperTable.m_Texture2D_SetFilter(m_pHandle, eFilter)); } /** - * Method definitions for class CComponentsObject + * Method definitions for class CBuildItem */ /** - * CComponentsObject::AddComponent - Adds a new component to a components object. - * @param[in] pObjectResource - object to add as component. Must not lead to circular references! - * @param[in] Transform - optional transform matrix for the component. - * @return new component instance - */ - PComponent CComponentsObject::AddComponent(classParam pObjectResource, const sTransform & Transform) - { - Lib3MFHandle hObjectResource = pObjectResource.GetHandle(); - Lib3MFHandle hComponentInstance = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_ComponentsObject_AddComponent(m_pHandle, hObjectResource, &Transform, &hComponentInstance)); - - if (!hComponentInstance) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hComponentInstance))); - } - - /** - * CComponentsObject::GetComponent - Retrieves a component from a component object. - * @param[in] nIndex - index of the component to retrieve (0 to componentcount - 1) - * @return component instance + * CBuildItem::GetObjectResource - Retrieves the object resource associated to a build item + * @return returns the associated resource instance */ - PComponent CComponentsObject::GetComponent(const Lib3MF_uint32 nIndex) + PObject CBuildItem::GetObjectResource() { - Lib3MFHandle hComponentInstance = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_ComponentsObject_GetComponent(m_pHandle, nIndex, &hComponentInstance)); + Lib3MFHandle hObjectResource = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_GetObjectResource(m_pHandle, &hObjectResource)); - if (!hComponentInstance) { + if (!hObjectResource) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hComponentInstance))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hObjectResource))); } /** - * CComponentsObject::GetComponentCount - Retrieves a component count of a component object. - * @return returns the component count + * CBuildItem::GetUUID - returns, whether a build item has a UUID and, if true, the build item's UUID + * @param[out] bHasUUID - flag whether the build item has a UUID + * @return the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' */ - Lib3MF_uint32 CComponentsObject::GetComponentCount() + std::string CBuildItem::GetUUID(bool & bHasUUID) { - Lib3MF_uint32 resultCount = 0; - CheckError(m_pWrapper->m_WrapperTable.m_ComponentsObject_GetComponentCount(m_pHandle, &resultCount)); + Lib3MF_uint32 bytesNeededUUID = 0; + Lib3MF_uint32 bytesWrittenUUID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_GetUUID(m_pHandle, &bHasUUID, 0, &bytesNeededUUID, nullptr)); + std::vector bufferUUID(bytesNeededUUID); + CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_GetUUID(m_pHandle, &bHasUUID, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0])); - return resultCount; + return std::string(&bufferUUID[0]); } /** - * Method definitions for class CBeamSet - */ - - /** - * CBeamSet::SetName - Sets a beamset's name string - * @param[in] sName - new name of the beamset. + * CBuildItem::SetUUID - sets the build item's UUID + * @param[in] sUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' */ - void CBeamSet::SetName(const std::string & sName) + void CBuildItem::SetUUID(const std::string & sUUID) { - CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_SetName(m_pHandle, sName.c_str())); + CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_SetUUID(m_pHandle, sUUID.c_str())); } /** - * CBeamSet::GetName - Retrieves a beamset's name string - * @return returns the name of the beamset. + * CBuildItem::GetObjectResourceID - Retrieves the object UniqueResourceID associated to a build item + * @return returns the UniqueResourceID of the object */ - std::string CBeamSet::GetName() + Lib3MF_uint32 CBuildItem::GetObjectResourceID() { - Lib3MF_uint32 bytesNeededName = 0; - Lib3MF_uint32 bytesWrittenName = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_GetName(m_pHandle, 0, &bytesNeededName, nullptr)); - std::vector bufferName(bytesNeededName); - CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_GetName(m_pHandle, bytesNeededName, &bytesWrittenName, &bufferName[0])); + Lib3MF_uint32 resultUniqueResourceID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_GetObjectResourceID(m_pHandle, &resultUniqueResourceID)); - return std::string(&bufferName[0]); - } - - /** - * CBeamSet::SetIdentifier - Sets a beamset's identifier string - * @param[in] sIdentifier - new name of the beamset. - */ - void CBeamSet::SetIdentifier(const std::string & sIdentifier) - { - CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_SetIdentifier(m_pHandle, sIdentifier.c_str())); + return resultUniqueResourceID; } /** - * CBeamSet::GetIdentifier - Retrieves a beamset's identifier string - * @return returns the identifier of the beamset. + * CBuildItem::HasObjectTransform - Checks, if a build item has a non-identity transformation matrix + * @return returns true, if the transformation matrix is not the identity */ - std::string CBeamSet::GetIdentifier() + bool CBuildItem::HasObjectTransform() { - Lib3MF_uint32 bytesNeededIdentifier = 0; - Lib3MF_uint32 bytesWrittenIdentifier = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_GetIdentifier(m_pHandle, 0, &bytesNeededIdentifier, nullptr)); - std::vector bufferIdentifier(bytesNeededIdentifier); - CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_GetIdentifier(m_pHandle, bytesNeededIdentifier, &bytesWrittenIdentifier, &bufferIdentifier[0])); + bool resultHasTransform = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_HasObjectTransform(m_pHandle, &resultHasTransform)); - return std::string(&bufferIdentifier[0]); + return resultHasTransform; } /** - * CBeamSet::GetReferenceCount - Retrieves the reference count of a beamset - * @return returns the reference count + * CBuildItem::GetObjectTransform - Retrieves a build item's transformation matrix. + * @return returns the transformation matrix */ - Lib3MF_uint32 CBeamSet::GetReferenceCount() + sTransform CBuildItem::GetObjectTransform() { - Lib3MF_uint32 resultCount = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_GetReferenceCount(m_pHandle, &resultCount)); + sTransform resultTransform; + CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_GetObjectTransform(m_pHandle, &resultTransform)); - return resultCount; + return resultTransform; } /** - * CBeamSet::SetReferences - Sets the references of a beamset - * @param[in] ReferencesBuffer - the new indices of all beams in this beamset + * CBuildItem::SetObjectTransform - Sets a build item's transformation matrix. + * @param[in] Transform - new transformation matrix */ - void CBeamSet::SetReferences(const CInputVector & ReferencesBuffer) + void CBuildItem::SetObjectTransform(const sTransform & Transform) { - CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_SetReferences(m_pHandle, (Lib3MF_uint64)ReferencesBuffer.size(), ReferencesBuffer.data())); + CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_SetObjectTransform(m_pHandle, &Transform)); } /** - * CBeamSet::GetReferences - Retrieves the references of a beamset - * @param[out] ReferencesBuffer - retrieves the indices of all beams in this beamset + * CBuildItem::GetPartNumber - Retrieves a build item's part number string + * @return Returns a build item's part number string */ - void CBeamSet::GetReferences(std::vector & ReferencesBuffer) + std::string CBuildItem::GetPartNumber() { - Lib3MF_uint64 elementsNeededReferences = 0; - Lib3MF_uint64 elementsWrittenReferences = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_GetReferences(m_pHandle, 0, &elementsNeededReferences, nullptr)); - ReferencesBuffer.resize((size_t) elementsNeededReferences); - CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_GetReferences(m_pHandle, elementsNeededReferences, &elementsWrittenReferences, ReferencesBuffer.data())); + Lib3MF_uint32 bytesNeededPartNumber = 0; + Lib3MF_uint32 bytesWrittenPartNumber = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_GetPartNumber(m_pHandle, 0, &bytesNeededPartNumber, nullptr)); + std::vector bufferPartNumber(bytesNeededPartNumber); + CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_GetPartNumber(m_pHandle, bytesNeededPartNumber, &bytesWrittenPartNumber, &bufferPartNumber[0])); + + return std::string(&bufferPartNumber[0]); } /** - * CBeamSet::GetBallReferenceCount - Retrieves the ball reference count of a beamset - * @return returns the ball reference count + * CBuildItem::SetPartNumber - Sets a build item's part number string + * @param[in] sSetPartnumber - new part number string for referencing parts from the outside world */ - Lib3MF_uint32 CBeamSet::GetBallReferenceCount() + void CBuildItem::SetPartNumber(const std::string & sSetPartnumber) { - Lib3MF_uint32 resultCount = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_GetBallReferenceCount(m_pHandle, &resultCount)); - - return resultCount; + CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_SetPartNumber(m_pHandle, sSetPartnumber.c_str())); } /** - * CBeamSet::SetBallReferences - Sets the ball references of a beamset - * @param[in] BallReferencesBuffer - the new indices of all balls in this beamset + * CBuildItem::GetMetaDataGroup - Returns the metadatagroup of this build item + * @return returns an Instance of the metadatagroup of this build item */ - void CBeamSet::SetBallReferences(const CInputVector & BallReferencesBuffer) + PMetaDataGroup CBuildItem::GetMetaDataGroup() { - CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_SetBallReferences(m_pHandle, (Lib3MF_uint64)BallReferencesBuffer.size(), BallReferencesBuffer.data())); + Lib3MFHandle hMetaDataGroup = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_GetMetaDataGroup(m_pHandle, &hMetaDataGroup)); + + if (!hMetaDataGroup) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMetaDataGroup))); } /** - * CBeamSet::GetBallReferences - Retrieves the ball references of a beamset - * @param[out] BallReferencesBuffer - retrieves the indices of all balls in this beamset + * CBuildItem::GetOutbox - Returns the outbox of a build item + * @return Outbox of this build item */ - void CBeamSet::GetBallReferences(std::vector & BallReferencesBuffer) + sBox CBuildItem::GetOutbox() { - Lib3MF_uint64 elementsNeededBallReferences = 0; - Lib3MF_uint64 elementsWrittenBallReferences = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_GetBallReferences(m_pHandle, 0, &elementsNeededBallReferences, nullptr)); - BallReferencesBuffer.resize((size_t) elementsNeededBallReferences); - CheckError(m_pWrapper->m_WrapperTable.m_BeamSet_GetBallReferences(m_pHandle, elementsNeededBallReferences, &elementsWrittenBallReferences, BallReferencesBuffer.data())); + sBox resultOutbox; + CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_GetOutbox(m_pHandle, &resultOutbox)); + + return resultOutbox; } /** - * Method definitions for class CBaseMaterialGroup + * Method definitions for class CBuildItemIterator */ /** - * CBaseMaterialGroup::GetCount - Retrieves the count of base materials in the material group. - * @return returns the count of base materials. + * CBuildItemIterator::MoveNext - Iterates to the next build item in the list. + * @return Iterates to the next build item in the list. */ - Lib3MF_uint32 CBaseMaterialGroup::GetCount() + bool CBuildItemIterator::MoveNext() { - Lib3MF_uint32 resultCount = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BaseMaterialGroup_GetCount(m_pHandle, &resultCount)); + bool resultHasNext = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BuildItemIterator_MoveNext(m_pHandle, &resultHasNext)); - return resultCount; + return resultHasNext; } /** - * CBaseMaterialGroup::GetAllPropertyIDs - returns all the PropertyIDs of all materials in this group - * @param[out] PropertyIDsBuffer - PropertyID of the material in the material group. + * CBuildItemIterator::MovePrevious - Iterates to the previous build item in the list. + * @return Iterates to the previous build item in the list. */ - void CBaseMaterialGroup::GetAllPropertyIDs(std::vector & PropertyIDsBuffer) + bool CBuildItemIterator::MovePrevious() { - Lib3MF_uint64 elementsNeededPropertyIDs = 0; - Lib3MF_uint64 elementsWrittenPropertyIDs = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BaseMaterialGroup_GetAllPropertyIDs(m_pHandle, 0, &elementsNeededPropertyIDs, nullptr)); - PropertyIDsBuffer.resize((size_t) elementsNeededPropertyIDs); - CheckError(m_pWrapper->m_WrapperTable.m_BaseMaterialGroup_GetAllPropertyIDs(m_pHandle, elementsNeededPropertyIDs, &elementsWrittenPropertyIDs, PropertyIDsBuffer.data())); + bool resultHasPrevious = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BuildItemIterator_MovePrevious(m_pHandle, &resultHasPrevious)); + + return resultHasPrevious; } /** - * CBaseMaterialGroup::AddMaterial - Adds a new material to the material group - * @param[in] sName - new name of the base material. - * @param[in] DisplayColor - Display color of the material - * @return returns new PropertyID of the new material in the material group. + * CBuildItemIterator::GetCurrent - Returns the build item the iterator points at. + * @return returns the build item instance. */ - Lib3MF_uint32 CBaseMaterialGroup::AddMaterial(const std::string & sName, const sColor & DisplayColor) + PBuildItem CBuildItemIterator::GetCurrent() { - Lib3MF_uint32 resultPropertyID = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BaseMaterialGroup_AddMaterial(m_pHandle, sName.c_str(), &DisplayColor, &resultPropertyID)); + Lib3MFHandle hBuildItem = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_BuildItemIterator_GetCurrent(m_pHandle, &hBuildItem)); - return resultPropertyID; + if (!hBuildItem) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBuildItem))); } /** - * CBaseMaterialGroup::RemoveMaterial - Removes a material from the material group. - * @param[in] nPropertyID - PropertyID of the material in the material group. + * CBuildItemIterator::Clone - Creates a new build item iterator with the same build item list. + * @return returns the cloned Iterator instance */ - void CBaseMaterialGroup::RemoveMaterial(const Lib3MF_uint32 nPropertyID) + PBuildItemIterator CBuildItemIterator::Clone() { - CheckError(m_pWrapper->m_WrapperTable.m_BaseMaterialGroup_RemoveMaterial(m_pHandle, nPropertyID)); + Lib3MFHandle hOutBuildItemIterator = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_BuildItemIterator_Clone(m_pHandle, &hOutBuildItemIterator)); + + if (!hOutBuildItemIterator) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hOutBuildItemIterator))); } /** - * CBaseMaterialGroup::GetName - Returns the base material's name - * @param[in] nPropertyID - PropertyID of the material in the material group. - * @return returns the name of the base material. + * CBuildItemIterator::Count - Returns the number of build items the iterator captures. + * @return returns the number of build items the iterator captures. */ - std::string CBaseMaterialGroup::GetName(const Lib3MF_uint32 nPropertyID) + Lib3MF_uint64 CBuildItemIterator::Count() { - Lib3MF_uint32 bytesNeededName = 0; - Lib3MF_uint32 bytesWrittenName = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BaseMaterialGroup_GetName(m_pHandle, nPropertyID, 0, &bytesNeededName, nullptr)); - std::vector bufferName(bytesNeededName); - CheckError(m_pWrapper->m_WrapperTable.m_BaseMaterialGroup_GetName(m_pHandle, nPropertyID, bytesNeededName, &bytesWrittenName, &bufferName[0])); + Lib3MF_uint64 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_BuildItemIterator_Count(m_pHandle, &resultCount)); - return std::string(&bufferName[0]); + return resultCount; } /** - * CBaseMaterialGroup::SetName - Sets a base material's name - * @param[in] nPropertyID - PropertyID of the material in the material group. - * @param[in] sName - new name of the base material. + * Method definitions for class CSlice + */ + + /** + * CSlice::SetVertices - Set all vertices of a slice. All polygons will be cleared. + * @param[in] VerticesBuffer - contains the positions. */ - void CBaseMaterialGroup::SetName(const Lib3MF_uint32 nPropertyID, const std::string & sName) + void CSlice::SetVertices(const CInputVector & VerticesBuffer) { - CheckError(m_pWrapper->m_WrapperTable.m_BaseMaterialGroup_SetName(m_pHandle, nPropertyID, sName.c_str())); + CheckError(m_pWrapper->m_WrapperTable.m_Slice_SetVertices(m_pHandle, (Lib3MF_uint64)VerticesBuffer.size(), VerticesBuffer.data())); } /** - * CBaseMaterialGroup::SetDisplayColor - Sets a base material's display color. - * @param[in] nPropertyID - PropertyID of the material in the material group. - * @param[in] TheColor - The base material's display color + * CSlice::GetVertices - Get all vertices of a slice + * @param[out] VerticesBuffer - contains the positions. */ - void CBaseMaterialGroup::SetDisplayColor(const Lib3MF_uint32 nPropertyID, const sColor & TheColor) + void CSlice::GetVertices(std::vector & VerticesBuffer) { - CheckError(m_pWrapper->m_WrapperTable.m_BaseMaterialGroup_SetDisplayColor(m_pHandle, nPropertyID, &TheColor)); + Lib3MF_uint64 elementsNeededVertices = 0; + Lib3MF_uint64 elementsWrittenVertices = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Slice_GetVertices(m_pHandle, 0, &elementsNeededVertices, nullptr)); + VerticesBuffer.resize((size_t) elementsNeededVertices); + CheckError(m_pWrapper->m_WrapperTable.m_Slice_GetVertices(m_pHandle, elementsNeededVertices, &elementsWrittenVertices, VerticesBuffer.data())); } /** - * CBaseMaterialGroup::GetDisplayColor - Returns a base material's display color. - * @param[in] nPropertyID - PropertyID of the material in the material group. - * @return The base material's display color + * CSlice::GetVertexCount - Get the number of vertices in a slice + * @return the number of vertices in the slice */ - sColor CBaseMaterialGroup::GetDisplayColor(const Lib3MF_uint32 nPropertyID) + Lib3MF_uint64 CSlice::GetVertexCount() { - sColor resultTheColor; - CheckError(m_pWrapper->m_WrapperTable.m_BaseMaterialGroup_GetDisplayColor(m_pHandle, nPropertyID, &resultTheColor)); + Lib3MF_uint64 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Slice_GetVertexCount(m_pHandle, &resultCount)); - return resultTheColor; + return resultCount; } /** - * Method definitions for class CColorGroup - */ + * CSlice::AddPolygon - Add a new polygon to this slice + * @param[in] IndicesBuffer - the new indices of the new polygon + * @return the index of the new polygon + */ + Lib3MF_uint64 CSlice::AddPolygon(const CInputVector & IndicesBuffer) + { + Lib3MF_uint64 resultIndex = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Slice_AddPolygon(m_pHandle, (Lib3MF_uint64)IndicesBuffer.size(), IndicesBuffer.data(), &resultIndex)); + + return resultIndex; + } /** - * CColorGroup::GetCount - Retrieves the count of base materials in this Color Group. - * @return returns the count of colors within this color group. + * CSlice::GetPolygonCount - Get the number of polygons in the slice + * @return the number of polygons in the slice */ - Lib3MF_uint32 CColorGroup::GetCount() + Lib3MF_uint64 CSlice::GetPolygonCount() { - Lib3MF_uint32 resultCount = 0; - CheckError(m_pWrapper->m_WrapperTable.m_ColorGroup_GetCount(m_pHandle, &resultCount)); + Lib3MF_uint64 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Slice_GetPolygonCount(m_pHandle, &resultCount)); return resultCount; } /** - * CColorGroup::GetAllPropertyIDs - returns all the PropertyIDs of all colors within this group - * @param[out] PropertyIDsBuffer - PropertyID of the color in the color group. + * CSlice::SetPolygonIndices - Set all indices of a polygon + * @param[in] nIndex - the index of the polygon to manipulate + * @param[in] IndicesBuffer - the new indices of the index-th polygon */ - void CColorGroup::GetAllPropertyIDs(std::vector & PropertyIDsBuffer) + void CSlice::SetPolygonIndices(const Lib3MF_uint64 nIndex, const CInputVector & IndicesBuffer) { - Lib3MF_uint64 elementsNeededPropertyIDs = 0; - Lib3MF_uint64 elementsWrittenPropertyIDs = 0; - CheckError(m_pWrapper->m_WrapperTable.m_ColorGroup_GetAllPropertyIDs(m_pHandle, 0, &elementsNeededPropertyIDs, nullptr)); - PropertyIDsBuffer.resize((size_t) elementsNeededPropertyIDs); - CheckError(m_pWrapper->m_WrapperTable.m_ColorGroup_GetAllPropertyIDs(m_pHandle, elementsNeededPropertyIDs, &elementsWrittenPropertyIDs, PropertyIDsBuffer.data())); + CheckError(m_pWrapper->m_WrapperTable.m_Slice_SetPolygonIndices(m_pHandle, nIndex, (Lib3MF_uint64)IndicesBuffer.size(), IndicesBuffer.data())); } /** - * CColorGroup::AddColor - Adds a new value. - * @param[in] TheColor - The new color - * @return PropertyID of the new color within this color group. + * CSlice::GetPolygonIndices - Get all vertices of a slice + * @param[in] nIndex - the index of the polygon to manipulate + * @param[out] IndicesBuffer - the indices of the index-th polygon */ - Lib3MF_uint32 CColorGroup::AddColor(const sColor & TheColor) + void CSlice::GetPolygonIndices(const Lib3MF_uint64 nIndex, std::vector & IndicesBuffer) { - Lib3MF_uint32 resultPropertyID = 0; - CheckError(m_pWrapper->m_WrapperTable.m_ColorGroup_AddColor(m_pHandle, &TheColor, &resultPropertyID)); - - return resultPropertyID; + Lib3MF_uint64 elementsNeededIndices = 0; + Lib3MF_uint64 elementsWrittenIndices = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Slice_GetPolygonIndices(m_pHandle, nIndex, 0, &elementsNeededIndices, nullptr)); + IndicesBuffer.resize((size_t) elementsNeededIndices); + CheckError(m_pWrapper->m_WrapperTable.m_Slice_GetPolygonIndices(m_pHandle, nIndex, elementsNeededIndices, &elementsWrittenIndices, IndicesBuffer.data())); } /** - * CColorGroup::RemoveColor - Removes a color from the color group. - * @param[in] nPropertyID - PropertyID of the color to be removed from the color group. + * CSlice::GetPolygonIndexCount - Get the number of vertices in a slice + * @param[in] nIndex - the index of the polygon to manipulate + * @return the number of indices of the index-th polygon */ - void CColorGroup::RemoveColor(const Lib3MF_uint32 nPropertyID) + Lib3MF_uint64 CSlice::GetPolygonIndexCount(const Lib3MF_uint64 nIndex) { - CheckError(m_pWrapper->m_WrapperTable.m_ColorGroup_RemoveColor(m_pHandle, nPropertyID)); + Lib3MF_uint64 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Slice_GetPolygonIndexCount(m_pHandle, nIndex, &resultCount)); + + return resultCount; } /** - * CColorGroup::SetColor - Sets a color value. - * @param[in] nPropertyID - PropertyID of a color within this color group. - * @param[in] TheColor - The color + * CSlice::GetZTop - Get the upper Z-Coordinate of this slice. + * @return the upper Z-Coordinate of this slice */ - void CColorGroup::SetColor(const Lib3MF_uint32 nPropertyID, const sColor & TheColor) + Lib3MF_double CSlice::GetZTop() { - CheckError(m_pWrapper->m_WrapperTable.m_ColorGroup_SetColor(m_pHandle, nPropertyID, &TheColor)); + Lib3MF_double resultZTop = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Slice_GetZTop(m_pHandle, &resultZTop)); + + return resultZTop; } /** - * CColorGroup::GetColor - Sets a color value. - * @param[in] nPropertyID - PropertyID of a color within this color group. - * @return The color + * Method definitions for class CToolpathProfile + */ + + /** + * CToolpathProfile::GetUUID - Retrieves the profile's uuid + * @return Returns the uuid value. */ - sColor CColorGroup::GetColor(const Lib3MF_uint32 nPropertyID) + std::string CToolpathProfile::GetUUID() { - sColor resultTheColor; - CheckError(m_pWrapper->m_WrapperTable.m_ColorGroup_GetColor(m_pHandle, nPropertyID, &resultTheColor)); + Lib3MF_uint32 bytesNeededUUID = 0; + Lib3MF_uint32 bytesWrittenUUID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathProfile_GetUUID(m_pHandle, 0, &bytesNeededUUID, nullptr)); + std::vector bufferUUID(bytesNeededUUID); + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathProfile_GetUUID(m_pHandle, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0])); - return resultTheColor; + return std::string(&bufferUUID[0]); } /** - * Method definitions for class CTexture2DGroup - */ + * CToolpathProfile::GetName - Retrieves the profile's name + * @return Returns the name. + */ + std::string CToolpathProfile::GetName() + { + Lib3MF_uint32 bytesNeededName = 0; + Lib3MF_uint32 bytesWrittenName = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathProfile_GetName(m_pHandle, 0, &bytesNeededName, nullptr)); + std::vector bufferName(bytesNeededName); + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathProfile_GetName(m_pHandle, bytesNeededName, &bytesWrittenName, &bufferName[0])); + + return std::string(&bufferName[0]); + } /** - * CTexture2DGroup::GetCount - Retrieves the count of tex2coords in the Texture2DGroup. - * @return returns the count of tex2coords. + * CToolpathProfile::GetParameterCount - Returns the number of parameters. + * @return Returns the number of parameters. */ - Lib3MF_uint32 CTexture2DGroup::GetCount() + Lib3MF_uint32 CToolpathProfile::GetParameterCount() { Lib3MF_uint32 resultCount = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Texture2DGroup_GetCount(m_pHandle, &resultCount)); + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathProfile_GetParameterCount(m_pHandle, &resultCount)); return resultCount; } /** - * CTexture2DGroup::GetAllPropertyIDs - returns all the PropertyIDs of all tex2coords in this Texture2DGroup - * @param[out] PropertyIDsBuffer - PropertyID of the tex2coords in the Texture2DGroup. + * CToolpathProfile::GetParameterName - Returns the Name of a parameter. + * @param[in] nIndex - Index of Parameter (0-based). Call will fail if an invalid index is given. + * @return Returns the name of the parameter. */ - void CTexture2DGroup::GetAllPropertyIDs(std::vector & PropertyIDsBuffer) + std::string CToolpathProfile::GetParameterName(const Lib3MF_uint32 nIndex) { - Lib3MF_uint64 elementsNeededPropertyIDs = 0; - Lib3MF_uint64 elementsWrittenPropertyIDs = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Texture2DGroup_GetAllPropertyIDs(m_pHandle, 0, &elementsNeededPropertyIDs, nullptr)); - PropertyIDsBuffer.resize((size_t) elementsNeededPropertyIDs); - CheckError(m_pWrapper->m_WrapperTable.m_Texture2DGroup_GetAllPropertyIDs(m_pHandle, elementsNeededPropertyIDs, &elementsWrittenPropertyIDs, PropertyIDsBuffer.data())); + Lib3MF_uint32 bytesNeededName = 0; + Lib3MF_uint32 bytesWrittenName = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathProfile_GetParameterName(m_pHandle, nIndex, 0, &bytesNeededName, nullptr)); + std::vector bufferName(bytesNeededName); + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathProfile_GetParameterName(m_pHandle, nIndex, bytesNeededName, &bytesWrittenName, &bufferName[0])); + + return std::string(&bufferName[0]); } /** - * CTexture2DGroup::AddTex2Coord - Adds a new tex2coord to the Texture2DGroup - * @param[in] UVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. - * @return returns new PropertyID of the new tex2coord in the Texture2DGroup. + * CToolpathProfile::GetParameterNameSpace - Returns the NameSpace of a parameter. + * @param[in] nIndex - Index of Parameter (0-based). Call will fail if an invalid index is given. + * @return Returns the namespace of the parameter. */ - Lib3MF_uint32 CTexture2DGroup::AddTex2Coord(const sTex2Coord & UVCoordinate) + std::string CToolpathProfile::GetParameterNameSpace(const Lib3MF_uint32 nIndex) { - Lib3MF_uint32 resultPropertyID = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Texture2DGroup_AddTex2Coord(m_pHandle, &UVCoordinate, &resultPropertyID)); + Lib3MF_uint32 bytesNeededNameSpace = 0; + Lib3MF_uint32 bytesWrittenNameSpace = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathProfile_GetParameterNameSpace(m_pHandle, nIndex, 0, &bytesNeededNameSpace, nullptr)); + std::vector bufferNameSpace(bytesNeededNameSpace); + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathProfile_GetParameterNameSpace(m_pHandle, nIndex, bytesNeededNameSpace, &bytesWrittenNameSpace, &bufferNameSpace[0])); - return resultPropertyID; + return std::string(&bufferNameSpace[0]); } /** - * CTexture2DGroup::GetTex2Coord - Obtains a tex2coord to the Texture2DGroup - * @param[in] nPropertyID - the PropertyID of the tex2coord in the Texture2DGroup. - * @return The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. + * CToolpathProfile::HasParameterValue - Checks if a parameter value exists. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @return Returns if a value exists. */ - sTex2Coord CTexture2DGroup::GetTex2Coord(const Lib3MF_uint32 nPropertyID) + bool CToolpathProfile::HasParameterValue(const std::string & sNameSpaceName, const std::string & sValueName) { - sTex2Coord resultUVCoordinate; - CheckError(m_pWrapper->m_WrapperTable.m_Texture2DGroup_GetTex2Coord(m_pHandle, nPropertyID, &resultUVCoordinate)); + bool resultValueExists = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathProfile_HasParameterValue(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), &resultValueExists)); - return resultUVCoordinate; + return resultValueExists; } /** - * CTexture2DGroup::RemoveTex2Coord - Removes a tex2coords from the Texture2DGroup. - * @param[in] nPropertyID - PropertyID of the tex2coords in the Texture2DGroup. + * CToolpathProfile::GetParameterValue - Retrieves a profile's parameter value. Fails if value does not exist. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @return Returns the value of the field. */ - void CTexture2DGroup::RemoveTex2Coord(const Lib3MF_uint32 nPropertyID) + std::string CToolpathProfile::GetParameterValue(const std::string & sNameSpaceName, const std::string & sValueName) { - CheckError(m_pWrapper->m_WrapperTable.m_Texture2DGroup_RemoveTex2Coord(m_pHandle, nPropertyID)); + Lib3MF_uint32 bytesNeededValue = 0; + Lib3MF_uint32 bytesWrittenValue = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathProfile_GetParameterValue(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), 0, &bytesNeededValue, nullptr)); + std::vector bufferValue(bytesNeededValue); + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathProfile_GetParameterValue(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), bytesNeededValue, &bytesWrittenValue, &bufferValue[0])); + + return std::string(&bufferValue[0]); } /** - * CTexture2DGroup::GetTexture2D - Obtains the texture2D instance of this group. - * @return the texture2D instance of this group. + * CToolpathProfile::GetParameterValueDef - Retrieves a profile's parameter value + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @param[in] sDefaultValue - Default value if value does not exist. + * @return Returns the value of the field. */ - PTexture2D CTexture2DGroup::GetTexture2D() + std::string CToolpathProfile::GetParameterValueDef(const std::string & sNameSpaceName, const std::string & sValueName, const std::string & sDefaultValue) { - Lib3MFHandle hTexture2DInstance = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_Texture2DGroup_GetTexture2D(m_pHandle, &hTexture2DInstance)); + Lib3MF_uint32 bytesNeededValue = 0; + Lib3MF_uint32 bytesWrittenValue = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathProfile_GetParameterValueDef(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), sDefaultValue.c_str(), 0, &bytesNeededValue, nullptr)); + std::vector bufferValue(bytesNeededValue); + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathProfile_GetParameterValueDef(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), sDefaultValue.c_str(), bytesNeededValue, &bytesWrittenValue, &bufferValue[0])); - if (!hTexture2DInstance) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hTexture2DInstance))); + return std::string(&bufferValue[0]); } /** - * Method definitions for class CCompositeMaterials - */ - - /** - * CCompositeMaterials::GetCount - Retrieves the count of Composite-s in the CompositeMaterials. - * @return returns the count of Composite-s + * CToolpathProfile::GetParameterDoubleValue - Retrieves a profile's parameter value as double. Fails if value does not exist or is not a double value. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @return Returns the value of the field. */ - Lib3MF_uint32 CCompositeMaterials::GetCount() + Lib3MF_double CToolpathProfile::GetParameterDoubleValue(const std::string & sNameSpaceName, const std::string & sValueName) { - Lib3MF_uint32 resultCount = 0; - CheckError(m_pWrapper->m_WrapperTable.m_CompositeMaterials_GetCount(m_pHandle, &resultCount)); + Lib3MF_double resultValue = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathProfile_GetParameterDoubleValue(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), &resultValue)); - return resultCount; + return resultValue; } /** - * CCompositeMaterials::GetAllPropertyIDs - returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials - * @param[out] PropertyIDsBuffer - PropertyID of the Composite-Mixing Values in the CompositeMaterials. + * CToolpathProfile::GetParameterDoubleValueDef - Retrieves a profile's parameter value as double. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @param[in] dDefaultValue - Default value if value does not exist or is not a double value. + * @return Returns the value of the field. */ - void CCompositeMaterials::GetAllPropertyIDs(std::vector & PropertyIDsBuffer) + Lib3MF_double CToolpathProfile::GetParameterDoubleValueDef(const std::string & sNameSpaceName, const std::string & sValueName, const Lib3MF_double dDefaultValue) { - Lib3MF_uint64 elementsNeededPropertyIDs = 0; - Lib3MF_uint64 elementsWrittenPropertyIDs = 0; - CheckError(m_pWrapper->m_WrapperTable.m_CompositeMaterials_GetAllPropertyIDs(m_pHandle, 0, &elementsNeededPropertyIDs, nullptr)); - PropertyIDsBuffer.resize((size_t) elementsNeededPropertyIDs); - CheckError(m_pWrapper->m_WrapperTable.m_CompositeMaterials_GetAllPropertyIDs(m_pHandle, elementsNeededPropertyIDs, &elementsWrittenPropertyIDs, PropertyIDsBuffer.data())); + Lib3MF_double resultValue = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathProfile_GetParameterDoubleValueDef(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), dDefaultValue, &resultValue)); + + return resultValue; } /** - * CCompositeMaterials::GetBaseMaterialGroup - Obtains the BaseMaterialGroup instance of this CompositeMaterials. - * @return returns the BaseMaterialGroup instance of this CompositeMaterials + * CToolpathProfile::GetParameterIntegerValue - Retrieves a profile's parameter value as integer. Fails if value does not exist or is not a integer value. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @return Returns the value of the field. */ - PBaseMaterialGroup CCompositeMaterials::GetBaseMaterialGroup() + Lib3MF_int64 CToolpathProfile::GetParameterIntegerValue(const std::string & sNameSpaceName, const std::string & sValueName) { - Lib3MFHandle hBaseMaterialGroupInstance = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_CompositeMaterials_GetBaseMaterialGroup(m_pHandle, &hBaseMaterialGroupInstance)); + Lib3MF_int64 resultValue = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathProfile_GetParameterIntegerValue(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), &resultValue)); - if (!hBaseMaterialGroupInstance) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBaseMaterialGroupInstance))); + return resultValue; } /** - * CCompositeMaterials::AddComposite - Adds a new Composite-Mixing Values to the CompositeMaterials. - * @param[in] CompositeBuffer - The Composite Constituents to be added as composite - * @return returns new PropertyID of the new Composite in the CompositeMaterials. + * CToolpathProfile::GetParameterIntegerValueDef - Retrieves a profile's parameter value as integer. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @param[in] nDefaultValue - Default value if value does not exist or is not a integer value. + * @return Returns the value of the field. */ - Lib3MF_uint32 CCompositeMaterials::AddComposite(const CInputVector & CompositeBuffer) + Lib3MF_int64 CToolpathProfile::GetParameterIntegerValueDef(const std::string & sNameSpaceName, const std::string & sValueName, const Lib3MF_int64 nDefaultValue) { - Lib3MF_uint32 resultPropertyID = 0; - CheckError(m_pWrapper->m_WrapperTable.m_CompositeMaterials_AddComposite(m_pHandle, (Lib3MF_uint64)CompositeBuffer.size(), CompositeBuffer.data(), &resultPropertyID)); + Lib3MF_int64 resultValue = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathProfile_GetParameterIntegerValueDef(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), nDefaultValue, &resultValue)); - return resultPropertyID; + return resultValue; } /** - * CCompositeMaterials::RemoveComposite - Removes a Composite-Maxing Ratio from the CompositeMaterials. - * @param[in] nPropertyID - PropertyID of the Composite-Mixing Values in the CompositeMaterials to be removed. + * CToolpathProfile::GetParameterBoolValue - Retrieves a profile's parameter value as boolean. Fails if value does not exist or is not a boolean value. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @return Returns the value of the field. */ - void CCompositeMaterials::RemoveComposite(const Lib3MF_uint32 nPropertyID) + bool CToolpathProfile::GetParameterBoolValue(const std::string & sNameSpaceName, const std::string & sValueName) { - CheckError(m_pWrapper->m_WrapperTable.m_CompositeMaterials_RemoveComposite(m_pHandle, nPropertyID)); + bool resultValue = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathProfile_GetParameterBoolValue(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), &resultValue)); + + return resultValue; } /** - * CCompositeMaterials::GetComposite - Obtains a Composite-Maxing Ratio of this CompositeMaterials. - * @param[in] nPropertyID - the PropertyID of the Composite-Maxing Ratio in the CompositeMaterials. - * @param[out] CompositeBuffer - The Composite-Mixing Values with the given PropertyID + * CToolpathProfile::GetParameterBoolValueDef - Retrieves a profile's parameter value as boolean. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @param[in] bDefaultValue - Default value if value does not exist or is not a boolean value. + * @return Returns the value of the field. */ - void CCompositeMaterials::GetComposite(const Lib3MF_uint32 nPropertyID, std::vector & CompositeBuffer) + bool CToolpathProfile::GetParameterBoolValueDef(const std::string & sNameSpaceName, const std::string & sValueName, const bool bDefaultValue) { - Lib3MF_uint64 elementsNeededComposite = 0; - Lib3MF_uint64 elementsWrittenComposite = 0; - CheckError(m_pWrapper->m_WrapperTable.m_CompositeMaterials_GetComposite(m_pHandle, nPropertyID, 0, &elementsNeededComposite, nullptr)); - CompositeBuffer.resize((size_t) elementsNeededComposite); - CheckError(m_pWrapper->m_WrapperTable.m_CompositeMaterials_GetComposite(m_pHandle, nPropertyID, elementsNeededComposite, &elementsWrittenComposite, CompositeBuffer.data())); + bool resultValue = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathProfile_GetParameterBoolValueDef(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), bDefaultValue, &resultValue)); + + return resultValue; } /** - * Method definitions for class CMultiPropertyGroup - */ - - /** - * CMultiPropertyGroup::GetCount - Retrieves the count of MultiProperty-s in the MultiPropertyGroup. - * @return returns the count of MultiProperty-s + * CToolpathProfile::SetName - Sets the profile's name + * @param[in] sName - Returns the name. */ - Lib3MF_uint32 CMultiPropertyGroup::GetCount() + void CToolpathProfile::SetName(const std::string & sName) { - Lib3MF_uint32 resultCount = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroup_GetCount(m_pHandle, &resultCount)); - - return resultCount; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathProfile_SetName(m_pHandle, sName.c_str())); } /** - * CMultiPropertyGroup::GetAllPropertyIDs - returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup - * @param[out] PropertyIDsBuffer - PropertyID of the MultiProperty-s in the MultiPropertyGroup. + * CToolpathProfile::SetParameterValue - Sets a profile's parameter value. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @param[in] sValue - String value of the parameter. */ - void CMultiPropertyGroup::GetAllPropertyIDs(std::vector & PropertyIDsBuffer) + void CToolpathProfile::SetParameterValue(const std::string & sNameSpaceName, const std::string & sValueName, const std::string & sValue) { - Lib3MF_uint64 elementsNeededPropertyIDs = 0; - Lib3MF_uint64 elementsWrittenPropertyIDs = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroup_GetAllPropertyIDs(m_pHandle, 0, &elementsNeededPropertyIDs, nullptr)); - PropertyIDsBuffer.resize((size_t) elementsNeededPropertyIDs); - CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroup_GetAllPropertyIDs(m_pHandle, elementsNeededPropertyIDs, &elementsWrittenPropertyIDs, PropertyIDsBuffer.data())); + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathProfile_SetParameterValue(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), sValue.c_str())); } /** - * CMultiPropertyGroup::AddMultiProperty - Adds a new MultiProperty to the MultiPropertyGroup. - * @param[in] PropertyIDsBuffer - The PropertyIDs of the new MultiProperty. - * @return returns the PropertyID of the new MultiProperty in the MultiPropertyGroup. + * CToolpathProfile::SetParameterDoubleValue - Sets a profile's parameter value as double. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @param[in] dValue - Double value of the parameter. */ - Lib3MF_uint32 CMultiPropertyGroup::AddMultiProperty(const CInputVector & PropertyIDsBuffer) + void CToolpathProfile::SetParameterDoubleValue(const std::string & sNameSpaceName, const std::string & sValueName, const Lib3MF_double dValue) { - Lib3MF_uint32 resultPropertyID = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroup_AddMultiProperty(m_pHandle, (Lib3MF_uint64)PropertyIDsBuffer.size(), PropertyIDsBuffer.data(), &resultPropertyID)); - - return resultPropertyID; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathProfile_SetParameterDoubleValue(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), dValue)); } /** - * CMultiPropertyGroup::SetMultiProperty - Sets the PropertyIDs of a MultiProperty. - * @param[in] nPropertyID - the PropertyID of the MultiProperty to be changed. - * @param[in] PropertyIDsBuffer - The new PropertyIDs of the MultiProperty + * CToolpathProfile::SetParameterIntegerValue - Sets a profile's parameter value as integer. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @param[in] nValue - Integer value of the parameter. */ - void CMultiPropertyGroup::SetMultiProperty(const Lib3MF_uint32 nPropertyID, const CInputVector & PropertyIDsBuffer) + void CToolpathProfile::SetParameterIntegerValue(const std::string & sNameSpaceName, const std::string & sValueName, const Lib3MF_int64 nValue) { - CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroup_SetMultiProperty(m_pHandle, nPropertyID, (Lib3MF_uint64)PropertyIDsBuffer.size(), PropertyIDsBuffer.data())); + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathProfile_SetParameterIntegerValue(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), nValue)); } /** - * CMultiPropertyGroup::GetMultiProperty - Obtains the PropertyIDs of a MultiProperty. - * @param[in] nPropertyID - the PropertyID of the MultiProperty to be queried. - * @param[out] PropertyIDsBuffer - The PropertyIDs of the MultiProperty + * CToolpathProfile::SetParameterBoolValue - Sets a profile's parameter value as boolean. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @param[in] bValue - Boolean value of the parameter. */ - void CMultiPropertyGroup::GetMultiProperty(const Lib3MF_uint32 nPropertyID, std::vector & PropertyIDsBuffer) + void CToolpathProfile::SetParameterBoolValue(const std::string & sNameSpaceName, const std::string & sValueName, const bool bValue) { - Lib3MF_uint64 elementsNeededPropertyIDs = 0; - Lib3MF_uint64 elementsWrittenPropertyIDs = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroup_GetMultiProperty(m_pHandle, nPropertyID, 0, &elementsNeededPropertyIDs, nullptr)); - PropertyIDsBuffer.resize((size_t) elementsNeededPropertyIDs); - CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroup_GetMultiProperty(m_pHandle, nPropertyID, elementsNeededPropertyIDs, &elementsWrittenPropertyIDs, PropertyIDsBuffer.data())); + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathProfile_SetParameterBoolValue(m_pHandle, sNameSpaceName.c_str(), sValueName.c_str(), bValue)); } /** - * CMultiPropertyGroup::RemoveMultiProperty - Removes a MultiProperty from this MultiPropertyGroup. - * @param[in] nPropertyID - the PropertyID of the MultiProperty to be removed. + * Method definitions for class CToolpathLayerReader + */ + + /** + * CToolpathLayerReader::GetLayerDataUUID - Retrieves the layerdata's uuid + * @return Returns the uuid value. */ - void CMultiPropertyGroup::RemoveMultiProperty(const Lib3MF_uint32 nPropertyID) + std::string CToolpathLayerReader::GetLayerDataUUID() { - CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroup_RemoveMultiProperty(m_pHandle, nPropertyID)); + Lib3MF_uint32 bytesNeededUUID = 0; + Lib3MF_uint32 bytesWrittenUUID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_GetLayerDataUUID(m_pHandle, 0, &bytesNeededUUID, nullptr)); + std::vector bufferUUID(bytesNeededUUID); + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_GetLayerDataUUID(m_pHandle, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0])); + + return std::string(&bufferUUID[0]); } /** - * CMultiPropertyGroup::GetLayerCount - Retrieves the number of layers of this MultiPropertyGroup. - * @return returns the number of layers + * CToolpathLayerReader::GetSegmentCount - Retrieves the count of segments. + * @return Count */ - Lib3MF_uint32 CMultiPropertyGroup::GetLayerCount() + Lib3MF_uint32 CToolpathLayerReader::GetSegmentCount() { Lib3MF_uint32 resultCount = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroup_GetLayerCount(m_pHandle, &resultCount)); + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_GetSegmentCount(m_pHandle, &resultCount)); return resultCount; } /** - * CMultiPropertyGroup::AddLayer - Adds a MultiPropertyLayer to this MultiPropertyGroup. - * @param[in] TheLayer - The MultiPropertyLayer to add to this MultiPropertyGroup - * @return returns the index of this MultiPropertyLayer + * CToolpathLayerReader::GetSegmentInfo - Retrieves the segment type information . + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @param[out] eType - Segment Type + * @param[out] nPointCount - Point count of segment. */ - Lib3MF_uint32 CMultiPropertyGroup::AddLayer(const sMultiPropertyLayer & TheLayer) + void CToolpathLayerReader::GetSegmentInfo(const Lib3MF_uint32 nIndex, eToolpathSegmentType & eType, Lib3MF_uint32 & nPointCount) { - Lib3MF_uint32 resultLayerIndex = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroup_AddLayer(m_pHandle, &TheLayer, &resultLayerIndex)); - - return resultLayerIndex; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_GetSegmentInfo(m_pHandle, nIndex, &eType, &nPointCount)); } /** - * CMultiPropertyGroup::GetLayer - Obtains a MultiPropertyLayer of this MultiPropertyGroup. - * @param[in] nLayerIndex - The Index of the MultiPropertyLayer queried - * @return The MultiPropertyLayer with index LayerIndex within MultiPropertyGroup + * CToolpathLayerReader::GetSegmentProfile - Retrieves the assigned segment profile. + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @return Segment Profile */ - sMultiPropertyLayer CMultiPropertyGroup::GetLayer(const Lib3MF_uint32 nLayerIndex) + PToolpathProfile CToolpathLayerReader::GetSegmentProfile(const Lib3MF_uint32 nIndex) { - sMultiPropertyLayer resultTheLayer; - CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroup_GetLayer(m_pHandle, nLayerIndex, &resultTheLayer)); + Lib3MFHandle hProfile = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_GetSegmentProfile(m_pHandle, nIndex, &hProfile)); - return resultTheLayer; + if (!hProfile) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hProfile))); } /** - * CMultiPropertyGroup::RemoveLayer - Removes a MultiPropertyLayer from this MultiPropertyGroup. - * @param[in] nLayerIndex - The Index of the MultiPropertyLayer to be removed + * CToolpathLayerReader::GetSegmentProfileUUID - Retrieves the assigned segment profile uuid. + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @return Segment Profile UUID */ - void CMultiPropertyGroup::RemoveLayer(const Lib3MF_uint32 nLayerIndex) + std::string CToolpathLayerReader::GetSegmentProfileUUID(const Lib3MF_uint32 nIndex) { - CheckError(m_pWrapper->m_WrapperTable.m_MultiPropertyGroup_RemoveLayer(m_pHandle, nLayerIndex)); + Lib3MF_uint32 bytesNeededProfileUUID = 0; + Lib3MF_uint32 bytesWrittenProfileUUID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_GetSegmentProfileUUID(m_pHandle, nIndex, 0, &bytesNeededProfileUUID, nullptr)); + std::vector bufferProfileUUID(bytesNeededProfileUUID); + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_GetSegmentProfileUUID(m_pHandle, nIndex, bytesNeededProfileUUID, &bytesWrittenProfileUUID, &bufferProfileUUID[0])); + + return std::string(&bufferProfileUUID[0]); } /** - * Method definitions for class CAttachment - */ + * CToolpathLayerReader::GetSegmentPart - Retrieves the assigned segment profile. + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @return Segment Build Item + */ + PBuildItem CToolpathLayerReader::GetSegmentPart(const Lib3MF_uint32 nIndex) + { + Lib3MFHandle hBuildItem = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_GetSegmentPart(m_pHandle, nIndex, &hBuildItem)); + + if (!hBuildItem) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBuildItem))); + } /** - * CAttachment::GetPath - Retrieves an attachment's package path. This function will be removed in a later release. - * @return returns the attachment's package path string + * CToolpathLayerReader::GetSegmentPartUUID - Retrieves the assigned segment part uuid. + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @return Segment Part UUID */ - std::string CAttachment::GetPath() + std::string CToolpathLayerReader::GetSegmentPartUUID(const Lib3MF_uint32 nIndex) { - Lib3MF_uint32 bytesNeededPath = 0; - Lib3MF_uint32 bytesWrittenPath = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Attachment_GetPath(m_pHandle, 0, &bytesNeededPath, nullptr)); - std::vector bufferPath(bytesNeededPath); - CheckError(m_pWrapper->m_WrapperTable.m_Attachment_GetPath(m_pHandle, bytesNeededPath, &bytesWrittenPath, &bufferPath[0])); + Lib3MF_uint32 bytesNeededPartUUID = 0; + Lib3MF_uint32 bytesWrittenPartUUID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_GetSegmentPartUUID(m_pHandle, nIndex, 0, &bytesNeededPartUUID, nullptr)); + std::vector bufferPartUUID(bytesNeededPartUUID); + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_GetSegmentPartUUID(m_pHandle, nIndex, bytesNeededPartUUID, &bytesWrittenPartUUID, &bufferPartUUID[0])); - return std::string(&bufferPath[0]); + return std::string(&bufferPartUUID[0]); } /** - * CAttachment::SetPath - Sets an attachment's package path. This function will be removed in a later release. - * @param[in] sPath - new path of the attachment. + * CToolpathLayerReader::GetSegmentLocalPartID - Retrieves the assigned segment part id. ATTENTION: This ID is only unique within the layer and there is no guarantee to be globally unique or consistent across layers. + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @return Local Segment Part ID */ - void CAttachment::SetPath(const std::string & sPath) + Lib3MF_uint32 CToolpathLayerReader::GetSegmentLocalPartID(const Lib3MF_uint32 nIndex) { - CheckError(m_pWrapper->m_WrapperTable.m_Attachment_SetPath(m_pHandle, sPath.c_str())); + Lib3MF_uint32 resultLocalPartID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_GetSegmentLocalPartID(m_pHandle, nIndex, &resultLocalPartID)); + + return resultLocalPartID; } /** - * CAttachment::PackagePart - Returns the PackagePart that is this attachment. - * @return The PackagePart of this attachment. + * CToolpathLayerReader::GetPartUUIDByLocalPartID - Retrieves the global part UUID by the local part ID. Fails if part ID does not exist in this layer. ATTENTION: This ID is only unique within the layer and there is no guarantee to be globally unique or consistent across layers. + * @param[in] nLocalPartID - Local Segment Part ID + * @return Segment Part UUID */ - PPackagePart CAttachment::PackagePart() + std::string CToolpathLayerReader::GetPartUUIDByLocalPartID(const Lib3MF_uint32 nLocalPartID) { - Lib3MFHandle hPackagePart = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_Attachment_PackagePart(m_pHandle, &hPackagePart)); + Lib3MF_uint32 bytesNeededPartUUID = 0; + Lib3MF_uint32 bytesWrittenPartUUID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_GetPartUUIDByLocalPartID(m_pHandle, nLocalPartID, 0, &bytesNeededPartUUID, nullptr)); + std::vector bufferPartUUID(bytesNeededPartUUID); + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_GetPartUUIDByLocalPartID(m_pHandle, nLocalPartID, bytesNeededPartUUID, &bytesWrittenPartUUID, &bufferPartUUID[0])); - if (!hPackagePart) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hPackagePart))); + return std::string(&bufferPartUUID[0]); } /** - * CAttachment::GetRelationShipType - Retrieves an attachment's relationship type - * @return returns the attachment's package relationship type string + * CToolpathLayerReader::GetSegmentPointData - Retrieves the assigned segment point list. For type hatch, the points are taken pairwise. + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @param[out] PointDataBuffer - The point data array */ - std::string CAttachment::GetRelationShipType() + void CToolpathLayerReader::GetSegmentPointData(const Lib3MF_uint32 nIndex, std::vector & PointDataBuffer) { - Lib3MF_uint32 bytesNeededPath = 0; - Lib3MF_uint32 bytesWrittenPath = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Attachment_GetRelationShipType(m_pHandle, 0, &bytesNeededPath, nullptr)); - std::vector bufferPath(bytesNeededPath); - CheckError(m_pWrapper->m_WrapperTable.m_Attachment_GetRelationShipType(m_pHandle, bytesNeededPath, &bytesWrittenPath, &bufferPath[0])); - - return std::string(&bufferPath[0]); + Lib3MF_uint64 elementsNeededPointData = 0; + Lib3MF_uint64 elementsWrittenPointData = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_GetSegmentPointData(m_pHandle, nIndex, 0, &elementsNeededPointData, nullptr)); + PointDataBuffer.resize((size_t) elementsNeededPointData); + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_GetSegmentPointData(m_pHandle, nIndex, elementsNeededPointData, &elementsWrittenPointData, PointDataBuffer.data())); } /** - * CAttachment::SetRelationShipType - Sets an attachment's relationship type. - * @param[in] sPath - new relationship type string. + * CToolpathLayerReader::FindAttributeInfoByName - Retrieves a segment attribute Information by Attribute Name. Will fail if Attribute does not exist. + * @param[in] sNameSpace - Namespace of the custom attribute. + * @param[in] sAttributeName - Name of the custom attribute. + * @param[out] nID - Attribute ID. + * @param[out] eAttributeType - Attribute Type. */ - void CAttachment::SetRelationShipType(const std::string & sPath) + void CToolpathLayerReader::FindAttributeInfoByName(const std::string & sNameSpace, const std::string & sAttributeName, Lib3MF_uint32 & nID, eToolpathAttributeType & eAttributeType) { - CheckError(m_pWrapper->m_WrapperTable.m_Attachment_SetRelationShipType(m_pHandle, sPath.c_str())); + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_FindAttributeInfoByName(m_pHandle, sNameSpace.c_str(), sAttributeName.c_str(), &nID, &eAttributeType)); } /** - * CAttachment::WriteToFile - Writes out the attachment as file. - * @param[in] sFileName - file to write into. + * CToolpathLayerReader::FindAttributeIDByName - Retrieves a segment attribute ID by Attribute Name. Will fail if Attribute does not exist. + * @param[in] sNameSpace - Namespace of the custom attribute. + * @param[in] sAttributeName - Name of the custom attribute. + * @return Attribute ID. */ - void CAttachment::WriteToFile(const std::string & sFileName) + Lib3MF_uint32 CToolpathLayerReader::FindAttributeIDByName(const std::string & sNameSpace, const std::string & sAttributeName) { - CheckError(m_pWrapper->m_WrapperTable.m_Attachment_WriteToFile(m_pHandle, sFileName.c_str())); + Lib3MF_uint32 resultID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_FindAttributeIDByName(m_pHandle, sNameSpace.c_str(), sAttributeName.c_str(), &resultID)); + + return resultID; } /** - * CAttachment::ReadFromFile - Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. - * @param[in] sFileName - file to read from. + * CToolpathLayerReader::FindAttributeValueByName - Retrieves a segment attribute Type by Attribute Name. Will fail if Attribute does not exist. + * @param[in] sNameSpace - Namespace of the custom attribute. + * @param[in] sAttributeName - Name of the custom attribute. + * @return Attribute Type. */ - void CAttachment::ReadFromFile(const std::string & sFileName) + eToolpathAttributeType CToolpathLayerReader::FindAttributeValueByName(const std::string & sNameSpace, const std::string & sAttributeName) { - CheckError(m_pWrapper->m_WrapperTable.m_Attachment_ReadFromFile(m_pHandle, sFileName.c_str())); + eToolpathAttributeType resultAttributeType = (eToolpathAttributeType) 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_FindAttributeValueByName(m_pHandle, sNameSpace.c_str(), sAttributeName.c_str(), &resultAttributeType)); + + return resultAttributeType; } /** - * CAttachment::ReadFromCallback - Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. - * @param[in] pTheReadCallback - Callback to call for reading a data chunk - * @param[in] nStreamSize - number of bytes the callback returns - * @param[in] pTheSeekCallback - Callback to call for seeking in the stream. - * @param[in] pUserData - Userdata that is passed to the callback function + * CToolpathLayerReader::GetSegmentIntegerAttributeByID - Retrieves a segment Uint32 attribute by Attribute ID. Will fail if Attribute does not exist. + * @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. + * @param[in] nID - Attribute ID. + * @return Attribute Value. */ - void CAttachment::ReadFromCallback(const ReadCallback pTheReadCallback, const Lib3MF_uint64 nStreamSize, const SeekCallback pTheSeekCallback, const Lib3MF_pvoid pUserData) + Lib3MF_int64 CToolpathLayerReader::GetSegmentIntegerAttributeByID(const Lib3MF_uint32 nIndex, const Lib3MF_uint32 nID) { - CheckError(m_pWrapper->m_WrapperTable.m_Attachment_ReadFromCallback(m_pHandle, pTheReadCallback, nStreamSize, pTheSeekCallback, pUserData)); + Lib3MF_int64 resultValue = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_GetSegmentIntegerAttributeByID(m_pHandle, nIndex, nID, &resultValue)); + + return resultValue; } /** - * CAttachment::GetStreamSize - Retrieves the size of the attachment stream - * @return the stream size + * CToolpathLayerReader::GetSegmentIntegerAttributeByName - Retrieves a segment integer attribute by Attribute Name. Will fail if Attribute does not exist or is of different type. + * @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. + * @param[in] sNameSpace - Namespace of the custom attribute. + * @param[in] sAttributeName - Name of the custom attribute. + * @return Attribute Value. */ - Lib3MF_uint64 CAttachment::GetStreamSize() + Lib3MF_int64 CToolpathLayerReader::GetSegmentIntegerAttributeByName(const Lib3MF_uint32 nIndex, const std::string & sNameSpace, const std::string & sAttributeName) { - Lib3MF_uint64 resultStreamSize = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Attachment_GetStreamSize(m_pHandle, &resultStreamSize)); + Lib3MF_int64 resultValue = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_GetSegmentIntegerAttributeByName(m_pHandle, nIndex, sNameSpace.c_str(), sAttributeName.c_str(), &resultValue)); - return resultStreamSize; + return resultValue; } /** - * CAttachment::WriteToBuffer - Writes out the attachment into a buffer - * @param[out] BufferBuffer - Buffer to write into + * CToolpathLayerReader::GetSegmentDoubleAttributeByID - Retrieves a segment Double attribute by Attribute ID. Will fail if Attribute does not exist. + * @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. + * @param[in] nID - Attribute ID. + * @return Attribute Value. */ - void CAttachment::WriteToBuffer(std::vector & BufferBuffer) + Lib3MF_double CToolpathLayerReader::GetSegmentDoubleAttributeByID(const Lib3MF_uint32 nIndex, const Lib3MF_uint32 nID) { - Lib3MF_uint64 elementsNeededBuffer = 0; - Lib3MF_uint64 elementsWrittenBuffer = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Attachment_WriteToBuffer(m_pHandle, 0, &elementsNeededBuffer, nullptr)); - BufferBuffer.resize((size_t) elementsNeededBuffer); - CheckError(m_pWrapper->m_WrapperTable.m_Attachment_WriteToBuffer(m_pHandle, elementsNeededBuffer, &elementsWrittenBuffer, BufferBuffer.data())); + Lib3MF_double resultValue = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_GetSegmentDoubleAttributeByID(m_pHandle, nIndex, nID, &resultValue)); + + return resultValue; } /** - * CAttachment::ReadFromBuffer - Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). - * @param[in] BufferBuffer - Buffer to read from + * CToolpathLayerReader::GetSegmentDoubleAttributeByName - Retrieves a segment Double attribute by Attribute Name. Will fail if Attribute does not exist. + * @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. + * @param[in] sNameSpace - Namespace of the custom attribute. + * @param[in] sAttributeName - Name of the custom attribute. + * @return Attribute Value. */ - void CAttachment::ReadFromBuffer(const CInputVector & BufferBuffer) + Lib3MF_double CToolpathLayerReader::GetSegmentDoubleAttributeByName(const Lib3MF_uint32 nIndex, const std::string & sNameSpace, const std::string & sAttributeName) { - CheckError(m_pWrapper->m_WrapperTable.m_Attachment_ReadFromBuffer(m_pHandle, (Lib3MF_uint64)BufferBuffer.size(), BufferBuffer.data())); + Lib3MF_double resultValue = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_GetSegmentDoubleAttributeByName(m_pHandle, nIndex, sNameSpace.c_str(), sAttributeName.c_str(), &resultValue)); + + return resultValue; } /** - * Method definitions for class CTexture2D - */ + * CToolpathLayerReader::GetCustomDataCount - Retrieves the count of custom data elements. + * @return Count + */ + Lib3MF_uint32 CToolpathLayerReader::GetCustomDataCount() + { + Lib3MF_uint32 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_GetCustomDataCount(m_pHandle, &resultCount)); + + return resultCount; + } /** - * CTexture2D::GetAttachment - Retrieves the attachment located at the path of the texture. - * @return attachment that holds the texture's image information. + * CToolpathLayerReader::GetCustomData - Retrieves the custom data. + * @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count + * @return DOM Tree of the data. */ - PAttachment CTexture2D::GetAttachment() + PCustomDOMTree CToolpathLayerReader::GetCustomData(const Lib3MF_uint32 nIndex) { - Lib3MFHandle hAttachment = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_Texture2D_GetAttachment(m_pHandle, &hAttachment)); + Lib3MFHandle hData = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_GetCustomData(m_pHandle, nIndex, &hData)); - if (!hAttachment) { + if (!hData) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hAttachment))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hData))); } /** - * CTexture2D::SetAttachment - Sets the texture's package path to the path of the attachment. - * @param[in] pAttachment - attachment that holds the texture's image information. + * CToolpathLayerReader::GetCustomDataName - Retrieves the node name of the custom data. + * @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count + * @param[out] sNameSpace - Namespace of the custom data tree. + * @param[out] sDataName - Root name of the data tree. */ - void CTexture2D::SetAttachment(classParam pAttachment) + void CToolpathLayerReader::GetCustomDataName(const Lib3MF_uint32 nIndex, std::string & sNameSpace, std::string & sDataName) { - Lib3MFHandle hAttachment = pAttachment.GetHandle(); - CheckError(m_pWrapper->m_WrapperTable.m_Texture2D_SetAttachment(m_pHandle, hAttachment)); + Lib3MF_uint32 bytesNeededNameSpace = 0; + Lib3MF_uint32 bytesWrittenNameSpace = 0; + Lib3MF_uint32 bytesNeededDataName = 0; + Lib3MF_uint32 bytesWrittenDataName = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_GetCustomDataName(m_pHandle, nIndex, 0, &bytesNeededNameSpace, nullptr, 0, &bytesNeededDataName, nullptr)); + std::vector bufferNameSpace(bytesNeededNameSpace); + std::vector bufferDataName(bytesNeededDataName); + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerReader_GetCustomDataName(m_pHandle, nIndex, bytesNeededNameSpace, &bytesWrittenNameSpace, &bufferNameSpace[0], bytesNeededDataName, &bytesWrittenDataName, &bufferDataName[0])); + sNameSpace = std::string(&bufferNameSpace[0]); + sDataName = std::string(&bufferDataName[0]); } /** - * CTexture2D::GetContentType - Retrieves a texture's content type. - * @return returns content type enum. + * Method definitions for class CToolpathLayerData + */ + + /** + * CToolpathLayerData::GetLayerDataUUID - Retrieves the layerdata's uuid + * @return Returns the uuid value. */ - eTextureType CTexture2D::GetContentType() + std::string CToolpathLayerData::GetLayerDataUUID() { - eTextureType resultContentType = (eTextureType) 0; - CheckError(m_pWrapper->m_WrapperTable.m_Texture2D_GetContentType(m_pHandle, &resultContentType)); + Lib3MF_uint32 bytesNeededUUID = 0; + Lib3MF_uint32 bytesWrittenUUID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerData_GetLayerDataUUID(m_pHandle, 0, &bytesNeededUUID, nullptr)); + std::vector bufferUUID(bytesNeededUUID); + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerData_GetLayerDataUUID(m_pHandle, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0])); - return resultContentType; + return std::string(&bufferUUID[0]); } /** - * CTexture2D::SetContentType - Retrieves a texture's content type. - * @param[in] eContentType - new Content Type + * CToolpathLayerData::RegisterProfile - Registers a toolpath profile + * @param[in] pProfile - The toolpath profile to register. + * @return returns the local profile ID for the layer. */ - void CTexture2D::SetContentType(const eTextureType eContentType) + Lib3MF_uint32 CToolpathLayerData::RegisterProfile(classParam pProfile) { - CheckError(m_pWrapper->m_WrapperTable.m_Texture2D_SetContentType(m_pHandle, eContentType)); + Lib3MFHandle hProfile = pProfile.GetHandle(); + Lib3MF_uint32 resultProfileID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerData_RegisterProfile(m_pHandle, hProfile, &resultProfileID)); + + return resultProfileID; } /** - * CTexture2D::GetTileStyleUV - Retrieves a texture's tilestyle type. - * @param[out] eTileStyleU - returns tilestyle type enum. - * @param[out] eTileStyleV - returns tilestyle type enum. + * CToolpathLayerData::RegisterBuildItem - Registers a Model Build Item + * @param[in] pBuildItem - The model build item to use. + * @return returns the local part ID for the layer. */ - void CTexture2D::GetTileStyleUV(eTextureTileStyle & eTileStyleU, eTextureTileStyle & eTileStyleV) + Lib3MF_uint32 CToolpathLayerData::RegisterBuildItem(classParam pBuildItem) { - CheckError(m_pWrapper->m_WrapperTable.m_Texture2D_GetTileStyleUV(m_pHandle, &eTileStyleU, &eTileStyleV)); + Lib3MFHandle hBuildItem = pBuildItem.GetHandle(); + Lib3MF_uint32 resultPartID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerData_RegisterBuildItem(m_pHandle, hBuildItem, &resultPartID)); + + return resultPartID; } /** - * CTexture2D::SetTileStyleUV - Sets a texture's tilestyle type. - * @param[in] eTileStyleU - new tilestyle type enum. - * @param[in] eTileStyleV - new tilestyle type enum. + * CToolpathLayerData::SetSegmentAttribute - Sets Segment Attribute for all following segments that are added. Overrides previously set attribute. + * @param[in] sNameSpace - The namespace of the attribute to register. + * @param[in] sAttributeName - The name of the attribute to register. + * @param[in] sValue - The value of the attribute to register. */ - void CTexture2D::SetTileStyleUV(const eTextureTileStyle eTileStyleU, const eTextureTileStyle eTileStyleV) + void CToolpathLayerData::SetSegmentAttribute(const std::string & sNameSpace, const std::string & sAttributeName, const std::string & sValue) { - CheckError(m_pWrapper->m_WrapperTable.m_Texture2D_SetTileStyleUV(m_pHandle, eTileStyleU, eTileStyleV)); + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerData_SetSegmentAttribute(m_pHandle, sNameSpace.c_str(), sAttributeName.c_str(), sValue.c_str())); } /** - * CTexture2D::GetFilter - Retrieves a texture's filter type. - * @return returns filter type enum. + * CToolpathLayerData::ClearSegmentAttributes - Clears current segment attributes. */ - eTextureFilter CTexture2D::GetFilter() + void CToolpathLayerData::ClearSegmentAttributes() { - eTextureFilter resultFilter = (eTextureFilter) 0; - CheckError(m_pWrapper->m_WrapperTable.m_Texture2D_GetFilter(m_pHandle, &resultFilter)); - - return resultFilter; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerData_ClearSegmentAttributes(m_pHandle)); } /** - * CTexture2D::SetFilter - Sets a texture's filter type. - * @param[in] eFilter - sets new filter type enum. + * CToolpathLayerData::WriteHatchData - writes hatch data to the layer. + * @param[in] nProfileID - The toolpath profile to use + * @param[in] nPartID - The toolpath part to use + * @param[in] PointDataBuffer - The point data */ - void CTexture2D::SetFilter(const eTextureFilter eFilter) + void CToolpathLayerData::WriteHatchData(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const CInputVector & PointDataBuffer) { - CheckError(m_pWrapper->m_WrapperTable.m_Texture2D_SetFilter(m_pHandle, eFilter)); + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerData_WriteHatchData(m_pHandle, nProfileID, nPartID, (Lib3MF_uint64)PointDataBuffer.size(), PointDataBuffer.data())); } /** - * Method definitions for class CBuildItem - */ - - /** - * CBuildItem::GetObjectResource - Retrieves the object resource associated to a build item - * @return returns the associated resource instance + * CToolpathLayerData::WriteLoop - writes loop data to the layer. + * @param[in] nProfileID - The toolpath profile to use + * @param[in] nPartID - The toolpath part to use + * @param[in] PointDataBuffer - The point data */ - PObject CBuildItem::GetObjectResource() + void CToolpathLayerData::WriteLoop(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const CInputVector & PointDataBuffer) { - Lib3MFHandle hObjectResource = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_GetObjectResource(m_pHandle, &hObjectResource)); - - if (!hObjectResource) { - CheckError(LIB3MF_ERROR_INVALIDPARAM); - } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hObjectResource))); + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerData_WriteLoop(m_pHandle, nProfileID, nPartID, (Lib3MF_uint64)PointDataBuffer.size(), PointDataBuffer.data())); } /** - * CBuildItem::GetUUID - returns, whether a build item has a UUID and, if true, the build item's UUID - * @param[out] bHasUUID - flag whether the build item has a UUID - * @return the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + * CToolpathLayerData::WritePolyline - writes polyline data to the layer. + * @param[in] nProfileID - The toolpath profile to use + * @param[in] nPartID - The toolpath part to use + * @param[in] PointDataBuffer - The point data */ - std::string CBuildItem::GetUUID(bool & bHasUUID) + void CToolpathLayerData::WritePolyline(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const CInputVector & PointDataBuffer) { - Lib3MF_uint32 bytesNeededUUID = 0; - Lib3MF_uint32 bytesWrittenUUID = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_GetUUID(m_pHandle, &bHasUUID, 0, &bytesNeededUUID, nullptr)); - std::vector bufferUUID(bytesNeededUUID); - CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_GetUUID(m_pHandle, &bHasUUID, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0])); - - return std::string(&bufferUUID[0]); + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerData_WritePolyline(m_pHandle, nProfileID, nPartID, (Lib3MF_uint64)PointDataBuffer.size(), PointDataBuffer.data())); } /** - * CBuildItem::SetUUID - sets the build item's UUID - * @param[in] sUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + * CToolpathLayerData::AddCustomData - Adds a custom data DOM tree to the layer. Layer MUST not be finished when changing the DOM tree. + * @param[in] sNameSpace - Namespace of the custom data tree. MUST not be empty. + * @param[in] sDataName - Root name of the data tree. MUST not be empty. MUST be a valid XML name string. + * @return DOM Tree of the data. */ - void CBuildItem::SetUUID(const std::string & sUUID) + PCustomDOMTree CToolpathLayerData::AddCustomData(const std::string & sNameSpace, const std::string & sDataName) { - CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_SetUUID(m_pHandle, sUUID.c_str())); + Lib3MFHandle hData = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerData_AddCustomData(m_pHandle, sNameSpace.c_str(), sDataName.c_str(), &hData)); + + if (!hData) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hData))); } /** - * CBuildItem::GetObjectResourceID - Retrieves the object UniqueResourceID associated to a build item - * @return returns the UniqueResourceID of the object + * CToolpathLayerData::Finish - finishes all writing of the layer and compresses toolpath data. */ - Lib3MF_uint32 CBuildItem::GetObjectResourceID() + void CToolpathLayerData::Finish() { - Lib3MF_uint32 resultUniqueResourceID = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_GetObjectResourceID(m_pHandle, &resultUniqueResourceID)); - - return resultUniqueResourceID; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathLayerData_Finish(m_pHandle)); } /** - * CBuildItem::HasObjectTransform - Checks, if a build item has a non-identity transformation matrix - * @return returns true, if the transformation matrix is not the identity + * Method definitions for class CToolpath + */ + + /** + * CToolpath::GetUnits - Retrieves the unit factor + * @return Returns the unit factor. */ - bool CBuildItem::HasObjectTransform() + Lib3MF_double CToolpath::GetUnits() { - bool resultHasTransform = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_HasObjectTransform(m_pHandle, &resultHasTransform)); + Lib3MF_double resultUnits = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_GetUnits(m_pHandle, &resultUnits)); - return resultHasTransform; + return resultUnits; } /** - * CBuildItem::GetObjectTransform - Retrieves a build item's transformation matrix. - * @return returns the transformation matrix + * CToolpath::GetLayerCount - Retrieves the count of layers + * @return Returns the layer count */ - sTransform CBuildItem::GetObjectTransform() + Lib3MF_uint32 CToolpath::GetLayerCount() { - sTransform resultTransform; - CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_GetObjectTransform(m_pHandle, &resultTransform)); + Lib3MF_uint32 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_GetLayerCount(m_pHandle, &resultCount)); - return resultTransform; + return resultCount; } /** - * CBuildItem::SetObjectTransform - Sets a build item's transformation matrix. - * @param[in] Transform - new transformation matrix + * CToolpath::GetProfileCount - Retrieves the count of profiles + * @return Returns the profile count */ - void CBuildItem::SetObjectTransform(const sTransform & Transform) + Lib3MF_uint32 CToolpath::GetProfileCount() { - CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_SetObjectTransform(m_pHandle, &Transform)); + Lib3MF_uint32 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_GetProfileCount(m_pHandle, &resultCount)); + + return resultCount; } /** - * CBuildItem::GetPartNumber - Retrieves a build item's part number string - * @return Returns a build item's part number string + * CToolpath::AddLayer - Adds a new toolpath layer + * @param[in] nZMax - ZMax value + * @param[in] sPath - Package Path + * @param[in] pModelWriter - The model writer that writes out the 3MF. + * @return Returns the layerdata object to write the layer content into. */ - std::string CBuildItem::GetPartNumber() + PToolpathLayerData CToolpath::AddLayer(const Lib3MF_uint32 nZMax, const std::string & sPath, classParam pModelWriter) { - Lib3MF_uint32 bytesNeededPartNumber = 0; - Lib3MF_uint32 bytesWrittenPartNumber = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_GetPartNumber(m_pHandle, 0, &bytesNeededPartNumber, nullptr)); - std::vector bufferPartNumber(bytesNeededPartNumber); - CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_GetPartNumber(m_pHandle, bytesNeededPartNumber, &bytesWrittenPartNumber, &bufferPartNumber[0])); + Lib3MFHandle hModelWriter = pModelWriter.GetHandle(); + Lib3MFHandle hLayerData = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_AddLayer(m_pHandle, nZMax, sPath.c_str(), hModelWriter, &hLayerData)); - return std::string(&bufferPartNumber[0]); + if (!hLayerData) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hLayerData))); } /** - * CBuildItem::SetPartNumber - Sets a build item's part number string - * @param[in] sSetPartnumber - new part number string for referencing parts from the outside world + * CToolpath::GetLayerAttachment - Retrieves the Attachment of a layer + * @param[in] nIndex - Layer Index + * @return Attachment */ - void CBuildItem::SetPartNumber(const std::string & sSetPartnumber) + PAttachment CToolpath::GetLayerAttachment(const Lib3MF_uint32 nIndex) { - CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_SetPartNumber(m_pHandle, sSetPartnumber.c_str())); + Lib3MFHandle hAttachment = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_GetLayerAttachment(m_pHandle, nIndex, &hAttachment)); + + if (!hAttachment) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hAttachment))); } /** - * CBuildItem::GetMetaDataGroup - Returns the metadatagroup of this build item - * @return returns an Instance of the metadatagroup of this build item + * CToolpath::ReadLayerData - Reads the toolpath of a layer. + * @param[in] nIndex - Layer Index + * @return Toolpath Reader Instance */ - PMetaDataGroup CBuildItem::GetMetaDataGroup() + PToolpathLayerReader CToolpath::ReadLayerData(const Lib3MF_uint32 nIndex) { - Lib3MFHandle hMetaDataGroup = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_GetMetaDataGroup(m_pHandle, &hMetaDataGroup)); + Lib3MFHandle hToolpathReader = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_ReadLayerData(m_pHandle, nIndex, &hToolpathReader)); - if (!hMetaDataGroup) { + if (!hToolpathReader) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hMetaDataGroup))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hToolpathReader))); } /** - * CBuildItem::GetOutbox - Returns the outbox of a build item - * @return Outbox of this build item + * CToolpath::GetLayerPath - Retrieves the Path of a layer + * @param[in] nIndex - Layer Index + * @return Package Path */ - sBox CBuildItem::GetOutbox() + std::string CToolpath::GetLayerPath(const Lib3MF_uint32 nIndex) { - sBox resultOutbox; - CheckError(m_pWrapper->m_WrapperTable.m_BuildItem_GetOutbox(m_pHandle, &resultOutbox)); + Lib3MF_uint32 bytesNeededPath = 0; + Lib3MF_uint32 bytesWrittenPath = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_GetLayerPath(m_pHandle, nIndex, 0, &bytesNeededPath, nullptr)); + std::vector bufferPath(bytesNeededPath); + CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_GetLayerPath(m_pHandle, nIndex, bytesNeededPath, &bytesWrittenPath, &bufferPath[0])); - return resultOutbox; + return std::string(&bufferPath[0]); } /** - * Method definitions for class CBuildItemIterator - */ + * CToolpath::GetLayerZMax - Retrieves the ZMax of a layer + * @param[in] nIndex - Layer Index + * @return ZMax value + */ + Lib3MF_uint32 CToolpath::GetLayerZMax(const Lib3MF_uint32 nIndex) + { + Lib3MF_uint32 resultZMax = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_GetLayerZMax(m_pHandle, nIndex, &resultZMax)); + + return resultZMax; + } /** - * CBuildItemIterator::MoveNext - Iterates to the next build item in the list. - * @return Iterates to the next build item in the list. + * CToolpath::GetLayerZ - Return the z value of a layer in units. + * @param[in] nLayerIndex - Layer Index. + * @return Z Value in Units. */ - bool CBuildItemIterator::MoveNext() + Lib3MF_uint32 CToolpath::GetLayerZ(const Lib3MF_uint32 nLayerIndex) { - bool resultHasNext = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BuildItemIterator_MoveNext(m_pHandle, &resultHasNext)); + Lib3MF_uint32 resultZValue = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_GetLayerZ(m_pHandle, nLayerIndex, &resultZValue)); - return resultHasNext; + return resultZValue; } /** - * CBuildItemIterator::MovePrevious - Iterates to the previous build item in the list. - * @return Iterates to the previous build item in the list. + * CToolpath::AddProfile - Adds a new profile to the toolpath. + * @param[in] sName - the name. + * @return Returns the profile. */ - bool CBuildItemIterator::MovePrevious() + PToolpathProfile CToolpath::AddProfile(const std::string & sName) { - bool resultHasPrevious = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BuildItemIterator_MovePrevious(m_pHandle, &resultHasPrevious)); + Lib3MFHandle hProfile = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_AddProfile(m_pHandle, sName.c_str(), &hProfile)); - return resultHasPrevious; + if (!hProfile) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hProfile))); } /** - * CBuildItemIterator::GetCurrent - Returns the build item the iterator points at. - * @return returns the build item instance. + * CToolpath::GetProfile - Returns a profile of the toolpath. + * @param[in] nProfileIndex - Layer Index. + * @return Returns the profile. */ - PBuildItem CBuildItemIterator::GetCurrent() + PToolpathProfile CToolpath::GetProfile(const Lib3MF_uint32 nProfileIndex) { - Lib3MFHandle hBuildItem = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_BuildItemIterator_GetCurrent(m_pHandle, &hBuildItem)); + Lib3MFHandle hProfile = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_GetProfile(m_pHandle, nProfileIndex, &hProfile)); - if (!hBuildItem) { + if (!hProfile) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hBuildItem))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hProfile))); } /** - * CBuildItemIterator::Clone - Creates a new build item iterator with the same build item list. - * @return returns the cloned Iterator instance + * CToolpath::GetProfileUUID - Returns a profile of the toolpath by UUID. + * @param[in] sProfileUUID - UUID string. + * @return Returns the profile. */ - PBuildItemIterator CBuildItemIterator::Clone() + PToolpathProfile CToolpath::GetProfileUUID(const std::string & sProfileUUID) { - Lib3MFHandle hOutBuildItemIterator = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_BuildItemIterator_Clone(m_pHandle, &hOutBuildItemIterator)); + Lib3MFHandle hProfile = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_GetProfileUUID(m_pHandle, sProfileUUID.c_str(), &hProfile)); - if (!hOutBuildItemIterator) { + if (!hProfile) { CheckError(LIB3MF_ERROR_INVALIDPARAM); } - return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hOutBuildItemIterator))); + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hProfile))); } /** - * CBuildItemIterator::Count - Returns the number of build items the iterator captures. - * @return returns the number of build items the iterator captures. + * CToolpath::GetCustomDataCount - Retrieves the count of custom data elements. + * @return Count */ - Lib3MF_uint64 CBuildItemIterator::Count() + Lib3MF_uint32 CToolpath::GetCustomDataCount() { - Lib3MF_uint64 resultCount = 0; - CheckError(m_pWrapper->m_WrapperTable.m_BuildItemIterator_Count(m_pHandle, &resultCount)); + Lib3MF_uint32 resultCount = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_GetCustomDataCount(m_pHandle, &resultCount)); return resultCount; } /** - * Method definitions for class CSlice - */ + * CToolpath::GetCustomData - Retrieves the custom data. + * @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count + * @return DOM Tree of the data. + */ + PCustomDOMTree CToolpath::GetCustomData(const Lib3MF_uint32 nIndex) + { + Lib3MFHandle hData = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_GetCustomData(m_pHandle, nIndex, &hData)); + + if (!hData) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hData))); + } /** - * CSlice::SetVertices - Set all vertices of a slice. All polygons will be cleared. - * @param[in] VerticesBuffer - contains the positions. + * CToolpath::GetCustomDataName - Retrieves the node name of the custom data. + * @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count + * @param[out] sNameSpace - Namespace of the custom data tree. + * @param[out] sDataName - Root name of the data tree. */ - void CSlice::SetVertices(const CInputVector & VerticesBuffer) + void CToolpath::GetCustomDataName(const Lib3MF_uint32 nIndex, std::string & sNameSpace, std::string & sDataName) { - CheckError(m_pWrapper->m_WrapperTable.m_Slice_SetVertices(m_pHandle, (Lib3MF_uint64)VerticesBuffer.size(), VerticesBuffer.data())); + Lib3MF_uint32 bytesNeededNameSpace = 0; + Lib3MF_uint32 bytesWrittenNameSpace = 0; + Lib3MF_uint32 bytesNeededDataName = 0; + Lib3MF_uint32 bytesWrittenDataName = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_GetCustomDataName(m_pHandle, nIndex, 0, &bytesNeededNameSpace, nullptr, 0, &bytesNeededDataName, nullptr)); + std::vector bufferNameSpace(bytesNeededNameSpace); + std::vector bufferDataName(bytesNeededDataName); + CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_GetCustomDataName(m_pHandle, nIndex, bytesNeededNameSpace, &bytesWrittenNameSpace, &bufferNameSpace[0], bytesNeededDataName, &bytesWrittenDataName, &bufferDataName[0])); + sNameSpace = std::string(&bufferNameSpace[0]); + sDataName = std::string(&bufferDataName[0]); } /** - * CSlice::GetVertices - Get all vertices of a slice - * @param[out] VerticesBuffer - contains the positions. + * CToolpath::HasUniqueCustomData - Retrieves if custom data with a specific namespace and name combination exists. + * @param[in] sNameSpace - Namespace of the custom data tree. + * @param[in] sDataName - Root name of the data tree. + * @return Returns true if DOM Tree Exists. */ - void CSlice::GetVertices(std::vector & VerticesBuffer) + bool CToolpath::HasUniqueCustomData(const std::string & sNameSpace, const std::string & sDataName) { - Lib3MF_uint64 elementsNeededVertices = 0; - Lib3MF_uint64 elementsWrittenVertices = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Slice_GetVertices(m_pHandle, 0, &elementsNeededVertices, nullptr)); - VerticesBuffer.resize((size_t) elementsNeededVertices); - CheckError(m_pWrapper->m_WrapperTable.m_Slice_GetVertices(m_pHandle, elementsNeededVertices, &elementsWrittenVertices, VerticesBuffer.data())); + bool resultCustomDataExists = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_HasUniqueCustomData(m_pHandle, sNameSpace.c_str(), sDataName.c_str(), &resultCustomDataExists)); + + return resultCustomDataExists; } /** - * CSlice::GetVertexCount - Get the number of vertices in a slice - * @return the number of vertices in the slice + * CToolpath::FindUniqueCustomData - Retrieves the custom data with a specific namespace and name combination. Fails if combination is not unique. + * @param[in] sNameSpace - Namespace of the custom data tree. + * @param[in] sDataName - Root name of the data tree. + * @return DOM Tree of the data. */ - Lib3MF_uint64 CSlice::GetVertexCount() + PCustomDOMTree CToolpath::FindUniqueCustomData(const std::string & sNameSpace, const std::string & sDataName) { - Lib3MF_uint64 resultCount = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Slice_GetVertexCount(m_pHandle, &resultCount)); + Lib3MFHandle hData = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_FindUniqueCustomData(m_pHandle, sNameSpace.c_str(), sDataName.c_str(), &hData)); - return resultCount; + if (!hData) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hData))); } /** - * CSlice::AddPolygon - Add a new polygon to this slice - * @param[in] IndicesBuffer - the new indices of the new polygon - * @return the index of the new polygon + * CToolpath::AddCustomData - Adds a custom data DOM tree to the toolpath. + * @param[in] sNameSpace - Namespace of the custom data tree. MUST not be empty. + * @param[in] sDataName - Root name of the data tree. MUST not be empty. MUST be a valid XML name string. + * @return DOM Tree of the data. */ - Lib3MF_uint64 CSlice::AddPolygon(const CInputVector & IndicesBuffer) + PCustomDOMTree CToolpath::AddCustomData(const std::string & sNameSpace, const std::string & sDataName) { - Lib3MF_uint64 resultIndex = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Slice_AddPolygon(m_pHandle, (Lib3MF_uint64)IndicesBuffer.size(), IndicesBuffer.data(), &resultIndex)); + Lib3MFHandle hData = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_AddCustomData(m_pHandle, sNameSpace.c_str(), sDataName.c_str(), &hData)); - return resultIndex; + if (!hData) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hData))); } /** - * CSlice::GetPolygonCount - Get the number of polygons in the slice - * @return the number of polygons in the slice + * CToolpath::ClearCustomData - Deletes all custom data. + * @return Returns number of deleted items. */ - Lib3MF_uint64 CSlice::GetPolygonCount() + Lib3MF_uint32 CToolpath::ClearCustomData() { - Lib3MF_uint64 resultCount = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Slice_GetPolygonCount(m_pHandle, &resultCount)); + Lib3MF_uint32 resultNumberOfDeletedItems = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_ClearCustomData(m_pHandle, &resultNumberOfDeletedItems)); - return resultCount; + return resultNumberOfDeletedItems; } /** - * CSlice::SetPolygonIndices - Set all indices of a polygon - * @param[in] nIndex - the index of the polygon to manipulate - * @param[in] IndicesBuffer - the new indices of the index-th polygon + * CToolpath::DeleteCustomData - Deletes a custom data instance from the list. + * @param[in] pData - DOM Tree of the data. + * @return Returns if deletion was successful. */ - void CSlice::SetPolygonIndices(const Lib3MF_uint64 nIndex, const CInputVector & IndicesBuffer) + bool CToolpath::DeleteCustomData(classParam pData) { - CheckError(m_pWrapper->m_WrapperTable.m_Slice_SetPolygonIndices(m_pHandle, nIndex, (Lib3MF_uint64)IndicesBuffer.size(), IndicesBuffer.data())); + Lib3MFHandle hData = pData.GetHandle(); + bool resultSuccess = 0; + CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_DeleteCustomData(m_pHandle, hData, &resultSuccess)); + + return resultSuccess; } /** - * CSlice::GetPolygonIndices - Get all vertices of a slice - * @param[in] nIndex - the index of the polygon to manipulate - * @param[out] IndicesBuffer - the indices of the index-th polygon + * CToolpath::RegisterCustomIntegerAttribute - Registers an Integer Attribute that each segment holds. + * @param[in] sNameSpace - Namespace of the custom data tree. MUST not be empty. + * @param[in] sAttributeName - Attribute name. MUST not be empty. */ - void CSlice::GetPolygonIndices(const Lib3MF_uint64 nIndex, std::vector & IndicesBuffer) + void CToolpath::RegisterCustomIntegerAttribute(const std::string & sNameSpace, const std::string & sAttributeName) { - Lib3MF_uint64 elementsNeededIndices = 0; - Lib3MF_uint64 elementsWrittenIndices = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Slice_GetPolygonIndices(m_pHandle, nIndex, 0, &elementsNeededIndices, nullptr)); - IndicesBuffer.resize((size_t) elementsNeededIndices); - CheckError(m_pWrapper->m_WrapperTable.m_Slice_GetPolygonIndices(m_pHandle, nIndex, elementsNeededIndices, &elementsWrittenIndices, IndicesBuffer.data())); + CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_RegisterCustomIntegerAttribute(m_pHandle, sNameSpace.c_str(), sAttributeName.c_str())); } /** - * CSlice::GetPolygonIndexCount - Get the number of vertices in a slice - * @param[in] nIndex - the index of the polygon to manipulate - * @return the number of indices of the index-th polygon + * CToolpath::RegisterCustomDoubleAttribute - Registers a Double Attribute that each segment holds. Registering only applies to reader or writer objects created after the call. + * @param[in] sNameSpace - Namespace of the custom data tree. MUST not be empty. + * @param[in] sAttributeName - Attribute name. MUST not be empty. */ - Lib3MF_uint64 CSlice::GetPolygonIndexCount(const Lib3MF_uint64 nIndex) + void CToolpath::RegisterCustomDoubleAttribute(const std::string & sNameSpace, const std::string & sAttributeName) { - Lib3MF_uint64 resultCount = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Slice_GetPolygonIndexCount(m_pHandle, nIndex, &resultCount)); - - return resultCount; + CheckError(m_pWrapper->m_WrapperTable.m_Toolpath_RegisterCustomDoubleAttribute(m_pHandle, sNameSpace.c_str(), sAttributeName.c_str())); } /** - * CSlice::GetZTop - Get the upper Z-Coordinate of this slice. - * @return the upper Z-Coordinate of this slice + * Method definitions for class CToolpathIterator + */ + + /** + * CToolpathIterator::GetCurrentToolpath - Returns the Toolpath the iterator points at. + * @return returns the Toolpath instance. */ - Lib3MF_double CSlice::GetZTop() + PToolpath CToolpathIterator::GetCurrentToolpath() { - Lib3MF_double resultZTop = 0; - CheckError(m_pWrapper->m_WrapperTable.m_Slice_GetZTop(m_pHandle, &resultZTop)); + Lib3MFHandle hResource = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_ToolpathIterator_GetCurrentToolpath(m_pHandle, &hResource)); - return resultZTop; + if (!hResource) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResource))); } /** @@ -11188,6 +15303,21 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceIterator))); } + /** + * CModel::GetToolpaths - creates a Toolpath instance with all toolpath resources. + * @return returns the iterator instance. + */ + PToolpathIterator CModel::GetToolpaths() + { + Lib3MFHandle hResourceIterator = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Model_GetToolpaths(m_pHandle, &hResourceIterator)); + + if (!hResourceIterator) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hResourceIterator))); + } + /** * CModel::GetSliceStacks - creates a resource iterator instance with all slice stack resources. * @return returns the iterator instance. @@ -11388,6 +15518,22 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) CheckError(m_pWrapper->m_WrapperTable.m_Model_RemoveBuildItem(m_pHandle, hBuildItemInstance)); } + /** + * CModel::AddToolpath - adds an empty Toolpath resource to the model. + * @param[in] dUnitFactor - The toolpath instance of the created Toolpath. + * @return The toolpath instance of the created Toolpath. + */ + PToolpath CModel::AddToolpath(const Lib3MF_double dUnitFactor) + { + Lib3MFHandle hToolpathInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Model_AddToolpath(m_pHandle, dUnitFactor, &hToolpathInstance)); + + if (!hToolpathInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hToolpathInstance))); + } + /** * CModel::GetMetaDataGroup - Returns the metadata of the model as MetaDataGroup * @return returns an Instance of the metadatagroup of the model @@ -11568,6 +15714,57 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle) } return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hKeyStore))); } + + /** + * CModel::CreatePersistentSourceFromFile - Creates an OPC Reader Source from a file. + * @param[in] sFilename - Filename to read from + * @return The instance of the created reader source + */ + PPersistentReaderSource CModel::CreatePersistentSourceFromFile(const std::string & sFilename) + { + Lib3MFHandle hInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Model_CreatePersistentSourceFromFile(m_pHandle, sFilename.c_str(), &hInstance)); + + if (!hInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hInstance))); + } + + /** + * CModel::CreatePersistentSourceFromBuffer - Creates an OPC Reader Source from a memory buffer. The memory buffer MUST exist as long as the Source object exists. + * @param[in] BufferBuffer - Buffer to read from + * @return The instance of the created reader source + */ + PPersistentReaderSource CModel::CreatePersistentSourceFromBuffer(const CInputVector & BufferBuffer) + { + Lib3MFHandle hInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Model_CreatePersistentSourceFromBuffer(m_pHandle, (Lib3MF_uint64)BufferBuffer.size(), BufferBuffer.data(), &hInstance)); + + if (!hInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hInstance))); + } + + /** + * CModel::CreatePersistentSourceFromCallback - Creates an OPC Reader Source from a data provided by a callback function. The callbacks MUST exist as long as the source object exists. + * @param[in] pTheReadCallback - Callback to call for reading a data chunk + * @param[in] nStreamSize - number of bytes the callback returns + * @param[in] pTheSeekCallback - Callback to call for seeking in the stream. + * @param[in] pUserData - Userdata that is passed to the callback function + * @return The instance of the created reader source + */ + PPersistentReaderSource CModel::CreatePersistentSourceFromCallback(const ReadCallback pTheReadCallback, const Lib3MF_uint64 nStreamSize, const SeekCallback pTheSeekCallback, const Lib3MF_pvoid pUserData) + { + Lib3MFHandle hInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_Model_CreatePersistentSourceFromCallback(m_pHandle, pTheReadCallback, nStreamSize, pTheSeekCallback, pUserData, &hInstance)); + + if (!hInstance) { + CheckError(LIB3MF_ERROR_INVALIDPARAM); + } + return std::shared_ptr(dynamic_cast(m_pWrapper->polymorphicFactory(hInstance))); + } } // namespace Lib3MF diff --git a/Autogenerated/Bindings/CppDynamic/lib3mf_types.hpp b/Autogenerated/Bindings/CppDynamic/lib3mf_types.hpp index 705f02718..d7b8241ca 100644 --- a/Autogenerated/Bindings/CppDynamic/lib3mf_types.hpp +++ b/Autogenerated/Bindings/CppDynamic/lib3mf_types.hpp @@ -129,13 +129,27 @@ typedef void * Lib3MF_pvoid; #define LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER 140 /** A progress identifier is unknown */ #define LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT 141 /** An element buffer exceeds its spec limit */ #define LIB3MF_ERROR_INVALIDRESOURCE 142 /** A resource is invalid */ +#define LIB3MF_ERROR_INVALIDNODEINDEX 143 /** Invalid node index */ +#define LIB3MF_ERROR_INVALIDATTRIBUTEINDEX 144 /** Invalid attribute index */ +#define LIB3MF_ERROR_DUPLICATECUSTOMDATA 145 /** Duplicate custom data */ +#define LIB3MF_ERROR_CUSTOMDATANOTFOUND 146 /** Custom data not found */ #define LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE 2000 /** This object type is not valid for beamlattices */ #define LIB3MF_ERROR_INVALIDKEYSTORE 3000 /** The keystore object is invalid */ #define LIB3MF_ERROR_INVALIDKEYSTORECONSUMER 3001 /** The consumer keystore object is invalid */ #define LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND 3002 /** A consumer has not been found */ #define LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND 3003 /** A resource data has not been found */ #define LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED 3004 /** A Key or Conentent encryption callback has not been registered */ -#define LIB3MF_ERROR_INVALIDKEYSIZE 3005 /** The key siue is invalid */ +#define LIB3MF_ERROR_INVALIDKEYSIZE 3005 /** The key size is invalid */ +#define LIB3MF_ERROR_TOOLPATH_NOTWRITINGHEADER 4000 /** Not in toolpath header writing mode */ +#define LIB3MF_ERROR_TOOLPATH_NOTWRITINGDATA 4001 /** Not in toolpath data writing mode */ +#define LIB3MF_ERROR_TOOLPATH_DATAHASBEENWRITTEN 4002 /** Toolpath has already been written out */ +#define LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT 4003 /** Toolpath has an invalid number of points */ +#define LIB3MF_ERROR_TOOLPATH_ATTRIBUTEALREADYDEFINED 4004 /** Toolpath attribute already defined */ +#define LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE 4005 /** Toolpath attribute is of invalid type */ +#define LIB3MF_ERROR_EMPTYNAMESPACEPREFIX 4006 /** Empty namespace prefix. */ +#define LIB3MF_ERROR_EMPTYNAMESPACE 4007 /** Empty namespace. */ +#define LIB3MF_ERROR_INVALIDNAMESPACEPREFIX 4008 /** Invalid namespace prefix. */ +#define LIB3MF_ERROR_WRITERDOESNOTSUPPORTNAMESPACES 4009 /** Writer does not support namespaces. */ /************************************************************************************************************************* Error strings for Lib3MF @@ -180,13 +194,27 @@ inline const char * LIB3MF_GETERRORSTRING (Lib3MFResult nErrorCode) { case LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER: return "A progress identifier is unknown"; case LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT: return "An element buffer exceeds its spec limit"; case LIB3MF_ERROR_INVALIDRESOURCE: return "A resource is invalid"; + case LIB3MF_ERROR_INVALIDNODEINDEX: return "Invalid node index"; + case LIB3MF_ERROR_INVALIDATTRIBUTEINDEX: return "Invalid attribute index"; + case LIB3MF_ERROR_DUPLICATECUSTOMDATA: return "Duplicate custom data"; + case LIB3MF_ERROR_CUSTOMDATANOTFOUND: return "Custom data not found"; case LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE: return "This object type is not valid for beamlattices"; case LIB3MF_ERROR_INVALIDKEYSTORE: return "The keystore object is invalid"; case LIB3MF_ERROR_INVALIDKEYSTORECONSUMER: return "The consumer keystore object is invalid"; case LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND: return "A consumer has not been found"; case LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND: return "A resource data has not been found"; case LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED: return "A Key or Conentent encryption callback has not been registered"; - case LIB3MF_ERROR_INVALIDKEYSIZE: return "The key siue is invalid"; + case LIB3MF_ERROR_INVALIDKEYSIZE: return "The key size is invalid"; + case LIB3MF_ERROR_TOOLPATH_NOTWRITINGHEADER: return "Not in toolpath header writing mode"; + case LIB3MF_ERROR_TOOLPATH_NOTWRITINGDATA: return "Not in toolpath data writing mode"; + case LIB3MF_ERROR_TOOLPATH_DATAHASBEENWRITTEN: return "Toolpath has already been written out"; + case LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT: return "Toolpath has an invalid number of points"; + case LIB3MF_ERROR_TOOLPATH_ATTRIBUTEALREADYDEFINED: return "Toolpath attribute already defined"; + case LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE: return "Toolpath attribute is of invalid type"; + case LIB3MF_ERROR_EMPTYNAMESPACEPREFIX: return "Empty namespace prefix."; + case LIB3MF_ERROR_EMPTYNAMESPACE: return "Empty namespace."; + case LIB3MF_ERROR_INVALIDNAMESPACEPREFIX: return "Invalid namespace prefix."; + case LIB3MF_ERROR_WRITERDOESNOTSUPPORTNAMESPACES: return "Writer does not support namespaces."; default: return "unknown error"; } } @@ -196,11 +224,17 @@ inline const char * LIB3MF_GETERRORSTRING (Lib3MFResult nErrorCode) { **************************************************************************************************************************/ typedef Lib3MFHandle Lib3MF_Base; +typedef Lib3MFHandle Lib3MF_BinaryStream; typedef Lib3MFHandle Lib3MF_Writer; +typedef Lib3MFHandle Lib3MF_PersistentReaderSource; typedef Lib3MFHandle Lib3MF_Reader; typedef Lib3MFHandle Lib3MF_PackagePart; typedef Lib3MFHandle Lib3MF_Resource; typedef Lib3MFHandle Lib3MF_ResourceIterator; +typedef Lib3MFHandle Lib3MF_CustomXMLAttribute; +typedef Lib3MFHandle Lib3MF_CustomXMLNode; +typedef Lib3MFHandle Lib3MF_CustomXMLNodes; +typedef Lib3MFHandle Lib3MF_CustomDOMTree; typedef Lib3MFHandle Lib3MF_SliceStackIterator; typedef Lib3MFHandle Lib3MF_ObjectIterator; typedef Lib3MFHandle Lib3MF_MeshObjectIterator; @@ -229,6 +263,11 @@ typedef Lib3MFHandle Lib3MF_Texture2D; typedef Lib3MFHandle Lib3MF_BuildItem; typedef Lib3MFHandle Lib3MF_BuildItemIterator; typedef Lib3MFHandle Lib3MF_Slice; +typedef Lib3MFHandle Lib3MF_ToolpathProfile; +typedef Lib3MFHandle Lib3MF_ToolpathLayerReader; +typedef Lib3MFHandle Lib3MF_ToolpathLayerData; +typedef Lib3MFHandle Lib3MF_Toolpath; +typedef Lib3MFHandle Lib3MF_ToolpathIterator; typedef Lib3MFHandle Lib3MF_SliceStack; typedef Lib3MFHandle Lib3MF_Consumer; typedef Lib3MFHandle Lib3MF_AccessRight; @@ -258,6 +297,13 @@ namespace Lib3MF { Lowres = 1 }; + enum class ePersistentReaderSourceType : Lib3MF_int32 { + Unknown = 0, + FileOnDisk = 1, + MemoryBuffer = 2, + Callback = 3 + }; + enum class eModelUnit : Lib3MF_int32 { MicroMeter = 0, MilliMeter = 1, @@ -311,6 +357,11 @@ namespace Lib3MF { All = 2 }; + enum class eBinaryStreamPredictionType : Lib3MF_int32 { + NoPrediction = 0, + DeltaPrediction = 1 + }; + enum class eProgressIdentifier : Lib3MF_int32 { QUERYCANCELED = 0, DONE = 1, @@ -344,6 +395,19 @@ namespace Lib3MF { Multiply = 2 }; + enum class eToolpathSegmentType : Lib3MF_int32 { + Unknown = 0, + Hatch = 1, + Loop = 2, + Polyline = 3 + }; + + enum class eToolpathAttributeType : Lib3MF_int32 { + Unknown = 0, + Integer = 1, + Double = 2 + }; + enum class eEncryptionAlgorithm : Lib3MF_int32 { AES256_GCM = 1 /** http://www.w3.org/2009/xmlenc11#aes256-gcm */ }; @@ -520,6 +584,7 @@ namespace Lib3MF { // define legacy C-names for enums, structs and function types typedef Lib3MF::ePropertyType eLib3MFPropertyType; typedef Lib3MF::eSlicesMeshResolution eLib3MFSlicesMeshResolution; +typedef Lib3MF::ePersistentReaderSourceType eLib3MFPersistentReaderSourceType; typedef Lib3MF::eModelUnit eLib3MFModelUnit; typedef Lib3MF::eObjectType eLib3MFObjectType; typedef Lib3MF::eTextureType eLib3MFTextureType; @@ -528,8 +593,11 @@ typedef Lib3MF::eTextureFilter eLib3MFTextureFilter; typedef Lib3MF::eBeamLatticeCapMode eLib3MFBeamLatticeCapMode; typedef Lib3MF::eBeamLatticeClipMode eLib3MFBeamLatticeClipMode; typedef Lib3MF::eBeamLatticeBallMode eLib3MFBeamLatticeBallMode; +typedef Lib3MF::eBinaryStreamPredictionType eLib3MFBinaryStreamPredictionType; typedef Lib3MF::eProgressIdentifier eLib3MFProgressIdentifier; typedef Lib3MF::eBlendMethod eLib3MFBlendMethod; +typedef Lib3MF::eToolpathSegmentType eLib3MFToolpathSegmentType; +typedef Lib3MF::eToolpathAttributeType eLib3MFToolpathAttributeType; typedef Lib3MF::eEncryptionAlgorithm eLib3MFEncryptionAlgorithm; typedef Lib3MF::eWrappingAlgorithm eLib3MFWrappingAlgorithm; typedef Lib3MF::eMgfAlgorithm eLib3MFMgfAlgorithm; diff --git a/Autogenerated/Bindings/Go/lib3mf.go b/Autogenerated/Bindings/Go/lib3mf.go index 705bad104..e43968447 100644 --- a/Autogenerated/Bindings/Go/lib3mf.go +++ b/Autogenerated/Bindings/Go/lib3mf.go @@ -81,6 +81,69 @@ Lib3MFResult CCall_lib3mf_base_classtypeid(Lib3MFHandle libraryHandle, Lib3MF_Ba } +Lib3MFResult CCall_lib3mf_binarystream_getbinarypath(Lib3MFHandle libraryHandle, Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BinaryStream_GetBinaryPath (pBinaryStream, nPathBufferSize, pPathNeededChars, pPathBuffer); +} + + +Lib3MFResult CCall_lib3mf_binarystream_getindexpath(Lib3MFHandle libraryHandle, Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BinaryStream_GetIndexPath (pBinaryStream, nPathBufferSize, pPathNeededChars, pPathBuffer); +} + + +Lib3MFResult CCall_lib3mf_binarystream_getuuid(Lib3MFHandle libraryHandle, Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BinaryStream_GetUUID (pBinaryStream, nUUIDBufferSize, pUUIDNeededChars, pUUIDBuffer); +} + + +Lib3MFResult CCall_lib3mf_binarystream_disablediscretizedarraycompression(Lib3MFHandle libraryHandle, Lib3MF_BinaryStream pBinaryStream) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BinaryStream_DisableDiscretizedArrayCompression (pBinaryStream); +} + + +Lib3MFResult CCall_lib3mf_binarystream_enablediscretizedarraycompression(Lib3MFHandle libraryHandle, Lib3MF_BinaryStream pBinaryStream, Lib3MF_double dUnits, eLib3MFBinaryStreamPredictionType ePredictionType) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BinaryStream_EnableDiscretizedArrayCompression (pBinaryStream, dUnits, ePredictionType); +} + + +Lib3MFResult CCall_lib3mf_binarystream_enablelzma(Lib3MFHandle libraryHandle, Lib3MF_BinaryStream pBinaryStream, Lib3MF_uint32 nLZMALevel) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BinaryStream_EnableLZMA (pBinaryStream, nLZMALevel); +} + + +Lib3MFResult CCall_lib3mf_binarystream_disablelzma(Lib3MFHandle libraryHandle, Lib3MF_BinaryStream pBinaryStream) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_BinaryStream_DisableLZMA (pBinaryStream); +} + + Lib3MFResult CCall_lib3mf_writer_writetofile(Lib3MFHandle libraryHandle, Lib3MF_Writer pWriter, const char * pFilename) { if (libraryHandle == 0) @@ -198,6 +261,69 @@ Lib3MFResult CCall_lib3mf_writer_setcontentencryptioncallback(Lib3MFHandle libra } +Lib3MFResult CCall_lib3mf_writer_createbinarystream(Lib3MFHandle libraryHandle, Lib3MF_Writer pWriter, const char * pIndexPath, const char * pBinaryPath, Lib3MF_BinaryStream * pBinaryStream) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Writer_CreateBinaryStream (pWriter, pIndexPath, pBinaryPath, pBinaryStream); +} + + +Lib3MFResult CCall_lib3mf_writer_assignbinarystream(Lib3MFHandle libraryHandle, Lib3MF_Writer pWriter, Lib3MF_Base pInstance, Lib3MF_BinaryStream pBinaryStream) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Writer_AssignBinaryStream (pWriter, pInstance, pBinaryStream); +} + + +Lib3MFResult CCall_lib3mf_writer_registercustomnamespace(Lib3MFHandle libraryHandle, Lib3MF_Writer pWriter, const char * pPrefix, const char * pNameSpace) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Writer_RegisterCustomNamespace (pWriter, pPrefix, pNameSpace); +} + + +Lib3MFResult CCall_lib3mf_persistentreadersource_getsourcetype(Lib3MFHandle libraryHandle, Lib3MF_PersistentReaderSource pPersistentReaderSource, eLib3MFPersistentReaderSourceType * pSourceType) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_PersistentReaderSource_GetSourceType (pPersistentReaderSource, pSourceType); +} + + +Lib3MFResult CCall_lib3mf_persistentreadersource_invalidatesourcedata(Lib3MFHandle libraryHandle, Lib3MF_PersistentReaderSource pPersistentReaderSource) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_PersistentReaderSource_InvalidateSourceData (pPersistentReaderSource); +} + + +Lib3MFResult CCall_lib3mf_persistentreadersource_sourcedataisvalid(Lib3MFHandle libraryHandle, Lib3MF_PersistentReaderSource pPersistentReaderSource, bool * pDataIsValid) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_PersistentReaderSource_SourceDataIsValid (pPersistentReaderSource, pDataIsValid); +} + + +Lib3MFResult CCall_lib3mf_reader_readfrompersistentsource(Lib3MFHandle libraryHandle, Lib3MF_Reader pReader, Lib3MF_PersistentReaderSource pSource) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Reader_ReadFromPersistentSource (pReader, pSource); +} + + Lib3MFResult CCall_lib3mf_reader_readfromfile(Lib3MFHandle libraryHandle, Lib3MF_Reader pReader, const char * pFilename) { if (libraryHandle == 0) @@ -414,5105 +540,7621 @@ Lib3MFResult CCall_lib3mf_resourceiterator_count(Lib3MFHandle libraryHandle, Lib } -Lib3MFResult CCall_lib3mf_slicestackiterator_getcurrentslicestack(Lib3MFHandle libraryHandle, Lib3MF_SliceStackIterator pSliceStackIterator, Lib3MF_SliceStack * pResource) +Lib3MFResult CCall_lib3mf_customxmlattribute_getname(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_SliceStackIterator_GetCurrentSliceStack (pSliceStackIterator, pResource); + return wrapperTable->m_CustomXMLAttribute_GetName (pCustomXMLAttribute, nNameBufferSize, pNameNeededChars, pNameBuffer); } -Lib3MFResult CCall_lib3mf_objectiterator_getcurrentobject(Lib3MFHandle libraryHandle, Lib3MF_ObjectIterator pObjectIterator, Lib3MF_Object * pResource) +Lib3MFResult CCall_lib3mf_customxmlattribute_getvalue(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ObjectIterator_GetCurrentObject (pObjectIterator, pResource); + return wrapperTable->m_CustomXMLAttribute_GetValue (pCustomXMLAttribute, nValueBufferSize, pValueNeededChars, pValueBuffer); } -Lib3MFResult CCall_lib3mf_meshobjectiterator_getcurrentmeshobject(Lib3MFHandle libraryHandle, Lib3MF_MeshObjectIterator pMeshObjectIterator, Lib3MF_MeshObject * pResource) +Lib3MFResult CCall_lib3mf_customxmlattribute_isvalidinteger(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nMinValue, Lib3MF_int64 nMaxValue, bool * pIsValid) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MeshObjectIterator_GetCurrentMeshObject (pMeshObjectIterator, pResource); + return wrapperTable->m_CustomXMLAttribute_IsValidInteger (pCustomXMLAttribute, nMinValue, nMaxValue, pIsValid); } -Lib3MFResult CCall_lib3mf_componentsobjectiterator_getcurrentcomponentsobject(Lib3MFHandle libraryHandle, Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource) +Lib3MFResult CCall_lib3mf_customxmlattribute_getintegervalue(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nMinValue, Lib3MF_int64 nMaxValue, Lib3MF_int64 * pValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject (pComponentsObjectIterator, pResource); + return wrapperTable->m_CustomXMLAttribute_GetIntegerValue (pCustomXMLAttribute, nMinValue, nMaxValue, pValue); } -Lib3MFResult CCall_lib3mf_texture2diterator_getcurrenttexture2d(Lib3MFHandle libraryHandle, Lib3MF_Texture2DIterator pTexture2DIterator, Lib3MF_Texture2D * pResource) +Lib3MFResult CCall_lib3mf_customxmlattribute_isvaliddouble(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, bool * pIsValid) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Texture2DIterator_GetCurrentTexture2D (pTexture2DIterator, pResource); + return wrapperTable->m_CustomXMLAttribute_IsValidDouble (pCustomXMLAttribute, dMinValue, dMaxValue, pIsValid); } -Lib3MFResult CCall_lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup(Lib3MFHandle libraryHandle, Lib3MF_BaseMaterialGroupIterator pBaseMaterialGroupIterator, Lib3MF_BaseMaterialGroup * pResource) +Lib3MFResult CCall_lib3mf_customxmlattribute_getdoublevalue(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, Lib3MF_double * pValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup (pBaseMaterialGroupIterator, pResource); + return wrapperTable->m_CustomXMLAttribute_GetDoubleValue (pCustomXMLAttribute, dMinValue, dMaxValue, pValue); } -Lib3MFResult CCall_lib3mf_colorgroupiterator_getcurrentcolorgroup(Lib3MFHandle libraryHandle, Lib3MF_ColorGroupIterator pColorGroupIterator, Lib3MF_ColorGroup * pResource) +Lib3MFResult CCall_lib3mf_customxmlattribute_isvalidbool(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLAttribute pCustomXMLAttribute, bool * pIsValid) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ColorGroupIterator_GetCurrentColorGroup (pColorGroupIterator, pResource); + return wrapperTable->m_CustomXMLAttribute_IsValidBool (pCustomXMLAttribute, pIsValid); } -Lib3MFResult CCall_lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup(Lib3MFHandle libraryHandle, Lib3MF_Texture2DGroupIterator pTexture2DGroupIterator, Lib3MF_Texture2DGroup * pResource) +Lib3MFResult CCall_lib3mf_customxmlattribute_getboolvalue(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, bool * pValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup (pTexture2DGroupIterator, pResource); + return wrapperTable->m_CustomXMLAttribute_GetBoolValue (pCustomXMLAttribute, dMinValue, dMaxValue, pValue); } -Lib3MFResult CCall_lib3mf_compositematerialsiterator_getcurrentcompositematerials(Lib3MFHandle libraryHandle, Lib3MF_CompositeMaterialsIterator pCompositeMaterialsIterator, Lib3MF_CompositeMaterials * pResource) +Lib3MFResult CCall_lib3mf_customxmlattribute_setvalue(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const char * pValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials (pCompositeMaterialsIterator, pResource); + return wrapperTable->m_CustomXMLAttribute_SetValue (pCustomXMLAttribute, pValue); } -Lib3MFResult CCall_lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup(Lib3MFHandle libraryHandle, Lib3MF_MultiPropertyGroupIterator pMultiPropertyGroupIterator, Lib3MF_MultiPropertyGroup * pResource) +Lib3MFResult CCall_lib3mf_customxmlattribute_setintegervalue(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup (pMultiPropertyGroupIterator, pResource); + return wrapperTable->m_CustomXMLAttribute_SetIntegerValue (pCustomXMLAttribute, nValue); } -Lib3MFResult CCall_lib3mf_metadata_getnamespace(Lib3MFHandle libraryHandle, Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer) +Lib3MFResult CCall_lib3mf_customxmlattribute_setdoublevalue(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MetaData_GetNameSpace (pMetaData, nNameSpaceBufferSize, pNameSpaceNeededChars, pNameSpaceBuffer); + return wrapperTable->m_CustomXMLAttribute_SetDoubleValue (pCustomXMLAttribute, dValue); } -Lib3MFResult CCall_lib3mf_metadata_setnamespace(Lib3MFHandle libraryHandle, Lib3MF_MetaData pMetaData, const char * pNameSpace) +Lib3MFResult CCall_lib3mf_customxmlattribute_setboolvalue(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLAttribute pCustomXMLAttribute, bool bValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MetaData_SetNameSpace (pMetaData, pNameSpace); + return wrapperTable->m_CustomXMLAttribute_SetBoolValue (pCustomXMLAttribute, bValue); } -Lib3MFResult CCall_lib3mf_metadata_getname(Lib3MFHandle libraryHandle, Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) +Lib3MFResult CCall_lib3mf_customxmlattribute_remove(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLAttribute pCustomXMLAttribute) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MetaData_GetName (pMetaData, nNameBufferSize, pNameNeededChars, pNameBuffer); + return wrapperTable->m_CustomXMLAttribute_Remove (pCustomXMLAttribute); } -Lib3MFResult CCall_lib3mf_metadata_setname(Lib3MFHandle libraryHandle, Lib3MF_MetaData pMetaData, const char * pName) +Lib3MFResult CCall_lib3mf_customxmlnode_getname(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNode pCustomXMLNode, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MetaData_SetName (pMetaData, pName); + return wrapperTable->m_CustomXMLNode_GetName (pCustomXMLNode, nNameBufferSize, pNameNeededChars, pNameBuffer); } -Lib3MFResult CCall_lib3mf_metadata_getkey(Lib3MFHandle libraryHandle, Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nKeyBufferSize, Lib3MF_uint32* pKeyNeededChars, char * pKeyBuffer) +Lib3MFResult CCall_lib3mf_customxmlnode_getnamespace(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNode pCustomXMLNode, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MetaData_GetKey (pMetaData, nKeyBufferSize, pKeyNeededChars, pKeyBuffer); + return wrapperTable->m_CustomXMLNode_GetNameSpace (pCustomXMLNode, nNameSpaceBufferSize, pNameSpaceNeededChars, pNameSpaceBuffer); } -Lib3MFResult CCall_lib3mf_metadata_getmustpreserve(Lib3MFHandle libraryHandle, Lib3MF_MetaData pMetaData, bool * pMustPreserve) +Lib3MFResult CCall_lib3mf_customxmlnode_getattributecount(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MetaData_GetMustPreserve (pMetaData, pMustPreserve); + return wrapperTable->m_CustomXMLNode_GetAttributeCount (pCustomXMLNode, pCount); } -Lib3MFResult CCall_lib3mf_metadata_setmustpreserve(Lib3MFHandle libraryHandle, Lib3MF_MetaData pMetaData, bool bMustPreserve) +Lib3MFResult CCall_lib3mf_customxmlnode_getattribute(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 nIndex, Lib3MF_CustomXMLAttribute * pAttributeInstance) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MetaData_SetMustPreserve (pMetaData, bMustPreserve); + return wrapperTable->m_CustomXMLNode_GetAttribute (pCustomXMLNode, nIndex, pAttributeInstance); } -Lib3MFResult CCall_lib3mf_metadata_gettype(Lib3MFHandle libraryHandle, Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nTypeBufferSize, Lib3MF_uint32* pTypeNeededChars, char * pTypeBuffer) +Lib3MFResult CCall_lib3mf_customxmlnode_hasattribute(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pAttributeExists) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MetaData_GetType (pMetaData, nTypeBufferSize, pTypeNeededChars, pTypeBuffer); + return wrapperTable->m_CustomXMLNode_HasAttribute (pCustomXMLNode, pName, pAttributeExists); } -Lib3MFResult CCall_lib3mf_metadata_settype(Lib3MFHandle libraryHandle, Lib3MF_MetaData pMetaData, const char * pType) +Lib3MFResult CCall_lib3mf_customxmlnode_findattribute(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bMustExist, Lib3MF_CustomXMLAttribute * pAttributeInstance) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MetaData_SetType (pMetaData, pType); + return wrapperTable->m_CustomXMLNode_FindAttribute (pCustomXMLNode, pName, bMustExist, pAttributeInstance); } -Lib3MFResult CCall_lib3mf_metadata_getvalue(Lib3MFHandle libraryHandle, Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer) +Lib3MFResult CCall_lib3mf_customxmlnode_removeattribute(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pAttributeRemoved) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MetaData_GetValue (pMetaData, nValueBufferSize, pValueNeededChars, pValueBuffer); + return wrapperTable->m_CustomXMLNode_RemoveAttribute (pCustomXMLNode, pName, pAttributeRemoved); } -Lib3MFResult CCall_lib3mf_metadata_setvalue(Lib3MFHandle libraryHandle, Lib3MF_MetaData pMetaData, const char * pValue) +Lib3MFResult CCall_lib3mf_customxmlnode_removeattributebyindex(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 nIndex, bool * pAttributeRemoved) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MetaData_SetValue (pMetaData, pValue); + return wrapperTable->m_CustomXMLNode_RemoveAttributeByIndex (pCustomXMLNode, nIndex, pAttributeRemoved); } -Lib3MFResult CCall_lib3mf_metadatagroup_getmetadatacount(Lib3MFHandle libraryHandle, Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 * pCount) +Lib3MFResult CCall_lib3mf_customxmlnode_addattribute(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, const char * pValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MetaDataGroup_GetMetaDataCount (pMetaDataGroup, pCount); + return wrapperTable->m_CustomXMLNode_AddAttribute (pCustomXMLNode, pName, pValue); } -Lib3MFResult CCall_lib3mf_metadatagroup_getmetadata(Lib3MFHandle libraryHandle, Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex, Lib3MF_MetaData * pMetaData) +Lib3MFResult CCall_lib3mf_customxmlnode_addintegerattribute(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_int64 nValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MetaDataGroup_GetMetaData (pMetaDataGroup, nIndex, pMetaData); + return wrapperTable->m_CustomXMLNode_AddIntegerAttribute (pCustomXMLNode, pName, nValue); } -Lib3MFResult CCall_lib3mf_metadatagroup_getmetadatabykey(Lib3MFHandle libraryHandle, Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, Lib3MF_MetaData * pMetaData) +Lib3MFResult CCall_lib3mf_customxmlnode_adddoubleattribute(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_double dValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MetaDataGroup_GetMetaDataByKey (pMetaDataGroup, pNameSpace, pName, pMetaData); + return wrapperTable->m_CustomXMLNode_AddDoubleAttribute (pCustomXMLNode, pName, dValue); } -Lib3MFResult CCall_lib3mf_metadatagroup_removemetadatabyindex(Lib3MFHandle libraryHandle, Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex) +Lib3MFResult CCall_lib3mf_customxmlnode_addboolattribute(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex (pMetaDataGroup, nIndex); + return wrapperTable->m_CustomXMLNode_AddBoolAttribute (pCustomXMLNode, pName, bValue); } -Lib3MFResult CCall_lib3mf_metadatagroup_removemetadata(Lib3MFHandle libraryHandle, Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_MetaData pTheMetaData) +Lib3MFResult CCall_lib3mf_customxmlnode_getchildren(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_CustomXMLNodes * pChildNodes) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MetaDataGroup_RemoveMetaData (pMetaDataGroup, pTheMetaData); + return wrapperTable->m_CustomXMLNode_GetChildren (pCustomXMLNode, pChildNodes); } -Lib3MFResult CCall_lib3mf_metadatagroup_addmetadata(Lib3MFHandle libraryHandle, Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, const char * pValue, const char * pType, bool bMustPreserve, Lib3MF_MetaData * pMetaData) +Lib3MFResult CCall_lib3mf_customxmlnode_countchildrenbyname(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_uint64 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MetaDataGroup_AddMetaData (pMetaDataGroup, pNameSpace, pName, pValue, pType, bMustPreserve, pMetaData); + return wrapperTable->m_CustomXMLNode_CountChildrenByName (pCustomXMLNode, pName, pCount); } -Lib3MFResult CCall_lib3mf_object_gettype(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, eLib3MFObjectType * pObjectType) +Lib3MFResult CCall_lib3mf_customxmlnode_getchildrenbyname(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_CustomXMLNodes * pChildNodes) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Object_GetType (pObject, pObjectType); + return wrapperTable->m_CustomXMLNode_GetChildrenByName (pCustomXMLNode, pName, pChildNodes); } -Lib3MFResult CCall_lib3mf_object_settype(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, eLib3MFObjectType eObjectType) +Lib3MFResult CCall_lib3mf_customxmlnode_haschild(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pChildExists) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Object_SetType (pObject, eObjectType); + return wrapperTable->m_CustomXMLNode_HasChild (pCustomXMLNode, pName, pChildExists); } -Lib3MFResult CCall_lib3mf_object_getname(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) +Lib3MFResult CCall_lib3mf_customxmlnode_hasuniquechild(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pChildExists) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Object_GetName (pObject, nNameBufferSize, pNameNeededChars, pNameBuffer); + return wrapperTable->m_CustomXMLNode_HasUniqueChild (pCustomXMLNode, pName, pChildExists); } -Lib3MFResult CCall_lib3mf_object_setname(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, const char * pName) +Lib3MFResult CCall_lib3mf_customxmlnode_findchild(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bMustExist, Lib3MF_CustomXMLNode * pChildInstance) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Object_SetName (pObject, pName); + return wrapperTable->m_CustomXMLNode_FindChild (pCustomXMLNode, pName, bMustExist, pChildInstance); } -Lib3MFResult CCall_lib3mf_object_getpartnumber(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer) +Lib3MFResult CCall_lib3mf_customxmlnode_addchild(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_CustomXMLNode * pChildInstance) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Object_GetPartNumber (pObject, nPartNumberBufferSize, pPartNumberNeededChars, pPartNumberBuffer); + return wrapperTable->m_CustomXMLNode_AddChild (pCustomXMLNode, pName, pChildInstance); } -Lib3MFResult CCall_lib3mf_object_setpartnumber(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, const char * pPartNumber) +Lib3MFResult CCall_lib3mf_customxmlnode_removechild(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_CustomXMLNode pChildInstance) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Object_SetPartNumber (pObject, pPartNumber); + return wrapperTable->m_CustomXMLNode_RemoveChild (pCustomXMLNode, pChildInstance); } -Lib3MFResult CCall_lib3mf_object_ismeshobject(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, bool * pIsMeshObject) +Lib3MFResult CCall_lib3mf_customxmlnode_removechildrenwithname(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_uint64 * pNumberOfDeletedChildren) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Object_IsMeshObject (pObject, pIsMeshObject); + return wrapperTable->m_CustomXMLNode_RemoveChildrenWithName (pCustomXMLNode, pName, pNumberOfDeletedChildren); } -Lib3MFResult CCall_lib3mf_object_iscomponentsobject(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, bool * pIsComponentsObject) +Lib3MFResult CCall_lib3mf_customxmlnode_remove(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNode pCustomXMLNode) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Object_IsComponentsObject (pObject, pIsComponentsObject); + return wrapperTable->m_CustomXMLNode_Remove (pCustomXMLNode); } -Lib3MFResult CCall_lib3mf_object_isvalid(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, bool * pIsValid) +Lib3MFResult CCall_lib3mf_customxmlnodes_getnodecount(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNodes pCustomXMLNodes, Lib3MF_uint64 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Object_IsValid (pObject, pIsValid); + return wrapperTable->m_CustomXMLNodes_GetNodeCount (pCustomXMLNodes, pCount); } -Lib3MFResult CCall_lib3mf_object_setattachmentasthumbnail(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, Lib3MF_Attachment pAttachment) +Lib3MFResult CCall_lib3mf_customxmlnodes_getnode(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNodes pCustomXMLNodes, Lib3MF_uint64 nIndex, Lib3MF_CustomXMLNode * pNodeInstance) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Object_SetAttachmentAsThumbnail (pObject, pAttachment); + return wrapperTable->m_CustomXMLNodes_GetNode (pCustomXMLNodes, nIndex, pNodeInstance); } -Lib3MFResult CCall_lib3mf_object_getthumbnailattachment(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, Lib3MF_Attachment * pAttachment) +Lib3MFResult CCall_lib3mf_customxmlnodes_countnodesbyname(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, Lib3MF_uint64 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Object_GetThumbnailAttachment (pObject, pAttachment); + return wrapperTable->m_CustomXMLNodes_CountNodesByName (pCustomXMLNodes, pName, pCount); } -Lib3MFResult CCall_lib3mf_object_clearthumbnailattachment(Lib3MFHandle libraryHandle, Lib3MF_Object pObject) +Lib3MFResult CCall_lib3mf_customxmlnodes_getnodesbyname(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, Lib3MF_CustomXMLNodes * pNodes) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Object_ClearThumbnailAttachment (pObject); + return wrapperTable->m_CustomXMLNodes_GetNodesByName (pCustomXMLNodes, pName, pNodes); } -Lib3MFResult CCall_lib3mf_object_getoutbox(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, sLib3MFBox * pOutbox) +Lib3MFResult CCall_lib3mf_customxmlnodes_hasnode(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool * pNodeExists) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Object_GetOutbox (pObject, pOutbox); + return wrapperTable->m_CustomXMLNodes_HasNode (pCustomXMLNodes, pName, pNodeExists); } -Lib3MFResult CCall_lib3mf_object_getuuid(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) +Lib3MFResult CCall_lib3mf_customxmlnodes_hasuniquenode(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool * pNodeExists) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Object_GetUUID (pObject, pHasUUID, nUUIDBufferSize, pUUIDNeededChars, pUUIDBuffer); + return wrapperTable->m_CustomXMLNodes_HasUniqueNode (pCustomXMLNodes, pName, pNodeExists); } -Lib3MFResult CCall_lib3mf_object_setuuid(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, const char * pUUID) +Lib3MFResult CCall_lib3mf_customxmlnodes_findnode(Lib3MFHandle libraryHandle, Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool bMustExist, Lib3MF_CustomXMLNode * pNodeInstance) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Object_SetUUID (pObject, pUUID); + return wrapperTable->m_CustomXMLNodes_FindNode (pCustomXMLNodes, pName, bMustExist, pNodeInstance); } -Lib3MFResult CCall_lib3mf_object_getmetadatagroup(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, Lib3MF_MetaDataGroup * pMetaDataGroup) +Lib3MFResult CCall_lib3mf_customdomtree_getnamespace(Lib3MFHandle libraryHandle, Lib3MF_CustomDOMTree pCustomDOMTree, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Object_GetMetaDataGroup (pObject, pMetaDataGroup); + return wrapperTable->m_CustomDOMTree_GetNameSpace (pCustomDOMTree, nNameSpaceBufferSize, pNameSpaceNeededChars, pNameSpaceBuffer); } -Lib3MFResult CCall_lib3mf_object_setslicesmeshresolution(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, eLib3MFSlicesMeshResolution eMeshResolution) +Lib3MFResult CCall_lib3mf_customdomtree_getrootnode(Lib3MFHandle libraryHandle, Lib3MF_CustomDOMTree pCustomDOMTree, Lib3MF_CustomXMLNode * pRootNode) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Object_SetSlicesMeshResolution (pObject, eMeshResolution); + return wrapperTable->m_CustomDOMTree_GetRootNode (pCustomDOMTree, pRootNode); } -Lib3MFResult CCall_lib3mf_object_getslicesmeshresolution(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, eLib3MFSlicesMeshResolution * pMeshResolution) +Lib3MFResult CCall_lib3mf_customdomtree_savetostring(Lib3MFHandle libraryHandle, Lib3MF_CustomDOMTree pCustomDOMTree, const Lib3MF_uint32 nXMLStringBufferSize, Lib3MF_uint32* pXMLStringNeededChars, char * pXMLStringBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Object_GetSlicesMeshResolution (pObject, pMeshResolution); + return wrapperTable->m_CustomDOMTree_SaveToString (pCustomDOMTree, nXMLStringBufferSize, pXMLStringNeededChars, pXMLStringBuffer); } -Lib3MFResult CCall_lib3mf_object_hasslices(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, bool bRecursive, bool * pHasSlices) +Lib3MFResult CCall_lib3mf_slicestackiterator_getcurrentslicestack(Lib3MFHandle libraryHandle, Lib3MF_SliceStackIterator pSliceStackIterator, Lib3MF_SliceStack * pResource) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Object_HasSlices (pObject, bRecursive, pHasSlices); + return wrapperTable->m_SliceStackIterator_GetCurrentSliceStack (pSliceStackIterator, pResource); } -Lib3MFResult CCall_lib3mf_object_clearslicestack(Lib3MFHandle libraryHandle, Lib3MF_Object pObject) +Lib3MFResult CCall_lib3mf_objectiterator_getcurrentobject(Lib3MFHandle libraryHandle, Lib3MF_ObjectIterator pObjectIterator, Lib3MF_Object * pResource) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Object_ClearSliceStack (pObject); + return wrapperTable->m_ObjectIterator_GetCurrentObject (pObjectIterator, pResource); } -Lib3MFResult CCall_lib3mf_object_getslicestack(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, Lib3MF_SliceStack * pSliceStackInstance) +Lib3MFResult CCall_lib3mf_meshobjectiterator_getcurrentmeshobject(Lib3MFHandle libraryHandle, Lib3MF_MeshObjectIterator pMeshObjectIterator, Lib3MF_MeshObject * pResource) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Object_GetSliceStack (pObject, pSliceStackInstance); + return wrapperTable->m_MeshObjectIterator_GetCurrentMeshObject (pMeshObjectIterator, pResource); } -Lib3MFResult CCall_lib3mf_object_assignslicestack(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, Lib3MF_SliceStack pSliceStackInstance) +Lib3MFResult CCall_lib3mf_componentsobjectiterator_getcurrentcomponentsobject(Lib3MFHandle libraryHandle, Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Object_AssignSliceStack (pObject, pSliceStackInstance); + return wrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject (pComponentsObjectIterator, pResource); } -Lib3MFResult CCall_lib3mf_meshobject_getvertexcount(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount) +Lib3MFResult CCall_lib3mf_texture2diterator_getcurrenttexture2d(Lib3MFHandle libraryHandle, Lib3MF_Texture2DIterator pTexture2DIterator, Lib3MF_Texture2D * pResource) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MeshObject_GetVertexCount (pMeshObject, pVertexCount); + return wrapperTable->m_Texture2DIterator_GetCurrentTexture2D (pTexture2DIterator, pResource); } -Lib3MFResult CCall_lib3mf_meshobject_gettrianglecount(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount) +Lib3MFResult CCall_lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup(Lib3MFHandle libraryHandle, Lib3MF_BaseMaterialGroupIterator pBaseMaterialGroupIterator, Lib3MF_BaseMaterialGroup * pResource) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MeshObject_GetTriangleCount (pMeshObject, pVertexCount); + return wrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup (pBaseMaterialGroupIterator, pResource); } -Lib3MFResult CCall_lib3mf_meshobject_getvertex(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFPosition * pCoordinates) +Lib3MFResult CCall_lib3mf_colorgroupiterator_getcurrentcolorgroup(Lib3MFHandle libraryHandle, Lib3MF_ColorGroupIterator pColorGroupIterator, Lib3MF_ColorGroup * pResource) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MeshObject_GetVertex (pMeshObject, nIndex, pCoordinates); + return wrapperTable->m_ColorGroupIterator_GetCurrentColorGroup (pColorGroupIterator, pResource); } -Lib3MFResult CCall_lib3mf_meshobject_setvertex(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFPosition * pCoordinates) +Lib3MFResult CCall_lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup(Lib3MFHandle libraryHandle, Lib3MF_Texture2DGroupIterator pTexture2DGroupIterator, Lib3MF_Texture2DGroup * pResource) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MeshObject_SetVertex (pMeshObject, nIndex, pCoordinates); + return wrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup (pTexture2DGroupIterator, pResource); } -Lib3MFResult CCall_lib3mf_meshobject_addvertex(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, const sLib3MFPosition * pCoordinates, Lib3MF_uint32 * pNewIndex) +Lib3MFResult CCall_lib3mf_compositematerialsiterator_getcurrentcompositematerials(Lib3MFHandle libraryHandle, Lib3MF_CompositeMaterialsIterator pCompositeMaterialsIterator, Lib3MF_CompositeMaterials * pResource) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MeshObject_AddVertex (pMeshObject, pCoordinates, pNewIndex); + return wrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials (pCompositeMaterialsIterator, pResource); } -Lib3MFResult CCall_lib3mf_meshobject_getvertices(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, sLib3MFPosition * pVerticesBuffer) +Lib3MFResult CCall_lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup(Lib3MFHandle libraryHandle, Lib3MF_MultiPropertyGroupIterator pMultiPropertyGroupIterator, Lib3MF_MultiPropertyGroup * pResource) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MeshObject_GetVertices (pMeshObject, nVerticesBufferSize, pVerticesNeededCount, pVerticesBuffer); + return wrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup (pMultiPropertyGroupIterator, pResource); } -Lib3MFResult CCall_lib3mf_meshobject_gettriangle(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFTriangle * pIndices) +Lib3MFResult CCall_lib3mf_metadata_getnamespace(Lib3MFHandle libraryHandle, Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MeshObject_GetTriangle (pMeshObject, nIndex, pIndices); + return wrapperTable->m_MetaData_GetNameSpace (pMetaData, nNameSpaceBufferSize, pNameSpaceNeededChars, pNameSpaceBuffer); } -Lib3MFResult CCall_lib3mf_meshobject_settriangle(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFTriangle * pIndices) +Lib3MFResult CCall_lib3mf_metadata_setnamespace(Lib3MFHandle libraryHandle, Lib3MF_MetaData pMetaData, const char * pNameSpace) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MeshObject_SetTriangle (pMeshObject, nIndex, pIndices); + return wrapperTable->m_MetaData_SetNameSpace (pMetaData, pNameSpace); } -Lib3MFResult CCall_lib3mf_meshobject_addtriangle(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, const sLib3MFTriangle * pIndices, Lib3MF_uint32 * pNewIndex) +Lib3MFResult CCall_lib3mf_metadata_getname(Lib3MFHandle libraryHandle, Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MeshObject_AddTriangle (pMeshObject, pIndices, pNewIndex); + return wrapperTable->m_MetaData_GetName (pMetaData, nNameBufferSize, pNameNeededChars, pNameBuffer); } -Lib3MFResult CCall_lib3mf_meshobject_gettriangleindices(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, sLib3MFTriangle * pIndicesBuffer) +Lib3MFResult CCall_lib3mf_metadata_setname(Lib3MFHandle libraryHandle, Lib3MF_MetaData pMetaData, const char * pName) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MeshObject_GetTriangleIndices (pMeshObject, nIndicesBufferSize, pIndicesNeededCount, pIndicesBuffer); + return wrapperTable->m_MetaData_SetName (pMetaData, pName); } -Lib3MFResult CCall_lib3mf_meshobject_setobjectlevelproperty(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nUniqueResourceID, Lib3MF_uint32 nPropertyID) +Lib3MFResult CCall_lib3mf_metadata_getkey(Lib3MFHandle libraryHandle, Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nKeyBufferSize, Lib3MF_uint32* pKeyNeededChars, char * pKeyBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MeshObject_SetObjectLevelProperty (pMeshObject, nUniqueResourceID, nPropertyID); + return wrapperTable->m_MetaData_GetKey (pMetaData, nKeyBufferSize, pKeyNeededChars, pKeyBuffer); } -Lib3MFResult CCall_lib3mf_meshobject_getobjectlevelproperty(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pUniqueResourceID, Lib3MF_uint32 * pPropertyID, bool * pHasObjectLevelProperty) +Lib3MFResult CCall_lib3mf_metadata_getmustpreserve(Lib3MFHandle libraryHandle, Lib3MF_MetaData pMetaData, bool * pMustPreserve) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MeshObject_GetObjectLevelProperty (pMeshObject, pUniqueResourceID, pPropertyID, pHasObjectLevelProperty); + return wrapperTable->m_MetaData_GetMustPreserve (pMetaData, pMustPreserve); } -Lib3MFResult CCall_lib3mf_meshobject_settriangleproperties(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFTriangleProperties * pProperties) +Lib3MFResult CCall_lib3mf_metadata_setmustpreserve(Lib3MFHandle libraryHandle, Lib3MF_MetaData pMetaData, bool bMustPreserve) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MeshObject_SetTriangleProperties (pMeshObject, nIndex, pProperties); + return wrapperTable->m_MetaData_SetMustPreserve (pMetaData, bMustPreserve); } -Lib3MFResult CCall_lib3mf_meshobject_gettriangleproperties(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFTriangleProperties * pProperty) +Lib3MFResult CCall_lib3mf_metadata_gettype(Lib3MFHandle libraryHandle, Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nTypeBufferSize, Lib3MF_uint32* pTypeNeededChars, char * pTypeBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MeshObject_GetTriangleProperties (pMeshObject, nIndex, pProperty); + return wrapperTable->m_MetaData_GetType (pMetaData, nTypeBufferSize, pTypeNeededChars, pTypeBuffer); } -Lib3MFResult CCall_lib3mf_meshobject_setalltriangleproperties(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nPropertiesArrayBufferSize, const sLib3MFTriangleProperties * pPropertiesArrayBuffer) +Lib3MFResult CCall_lib3mf_metadata_settype(Lib3MFHandle libraryHandle, Lib3MF_MetaData pMetaData, const char * pType) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MeshObject_SetAllTriangleProperties (pMeshObject, nPropertiesArrayBufferSize, pPropertiesArrayBuffer); + return wrapperTable->m_MetaData_SetType (pMetaData, pType); } -Lib3MFResult CCall_lib3mf_meshobject_getalltriangleproperties(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nPropertiesArrayBufferSize, Lib3MF_uint64* pPropertiesArrayNeededCount, sLib3MFTriangleProperties * pPropertiesArrayBuffer) +Lib3MFResult CCall_lib3mf_metadata_getvalue(Lib3MFHandle libraryHandle, Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MeshObject_GetAllTriangleProperties (pMeshObject, nPropertiesArrayBufferSize, pPropertiesArrayNeededCount, pPropertiesArrayBuffer); + return wrapperTable->m_MetaData_GetValue (pMetaData, nValueBufferSize, pValueNeededChars, pValueBuffer); } -Lib3MFResult CCall_lib3mf_meshobject_clearallproperties(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject) +Lib3MFResult CCall_lib3mf_metadata_setvalue(Lib3MFHandle libraryHandle, Lib3MF_MetaData pMetaData, const char * pValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MeshObject_ClearAllProperties (pMeshObject); + return wrapperTable->m_MetaData_SetValue (pMetaData, pValue); } -Lib3MFResult CCall_lib3mf_meshobject_setgeometry(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nVerticesBufferSize, const sLib3MFPosition * pVerticesBuffer, Lib3MF_uint64 nIndicesBufferSize, const sLib3MFTriangle * pIndicesBuffer) +Lib3MFResult CCall_lib3mf_metadatagroup_getmetadatacount(Lib3MFHandle libraryHandle, Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MeshObject_SetGeometry (pMeshObject, nVerticesBufferSize, pVerticesBuffer, nIndicesBufferSize, pIndicesBuffer); + return wrapperTable->m_MetaDataGroup_GetMetaDataCount (pMetaDataGroup, pCount); } -Lib3MFResult CCall_lib3mf_meshobject_ismanifoldandoriented(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, bool * pIsManifoldAndOriented) +Lib3MFResult CCall_lib3mf_metadatagroup_getmetadata(Lib3MFHandle libraryHandle, Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex, Lib3MF_MetaData * pMetaData) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MeshObject_IsManifoldAndOriented (pMeshObject, pIsManifoldAndOriented); + return wrapperTable->m_MetaDataGroup_GetMetaData (pMetaDataGroup, nIndex, pMetaData); } -Lib3MFResult CCall_lib3mf_meshobject_beamlattice(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_BeamLattice * pTheBeamLattice) +Lib3MFResult CCall_lib3mf_metadatagroup_getmetadatabykey(Lib3MFHandle libraryHandle, Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, Lib3MF_MetaData * pMetaData) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MeshObject_BeamLattice (pMeshObject, pTheBeamLattice); + return wrapperTable->m_MetaDataGroup_GetMetaDataByKey (pMetaDataGroup, pNameSpace, pName, pMetaData); } -Lib3MFResult CCall_lib3mf_beamlattice_getminlength(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_double * pMinLength) +Lib3MFResult CCall_lib3mf_metadatagroup_removemetadatabyindex(Lib3MFHandle libraryHandle, Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamLattice_GetMinLength (pBeamLattice, pMinLength); + return wrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex (pMetaDataGroup, nIndex); } -Lib3MFResult CCall_lib3mf_beamlattice_setminlength(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_double dMinLength) +Lib3MFResult CCall_lib3mf_metadatagroup_removemetadata(Lib3MFHandle libraryHandle, Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_MetaData pTheMetaData) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamLattice_SetMinLength (pBeamLattice, dMinLength); + return wrapperTable->m_MetaDataGroup_RemoveMetaData (pMetaDataGroup, pTheMetaData); } -Lib3MFResult CCall_lib3mf_beamlattice_getclipping(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode * pClipMode, Lib3MF_uint32 * pUniqueResourceID) +Lib3MFResult CCall_lib3mf_metadatagroup_addmetadata(Lib3MFHandle libraryHandle, Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, const char * pValue, const char * pType, bool bMustPreserve, Lib3MF_MetaData * pMetaData) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamLattice_GetClipping (pBeamLattice, pClipMode, pUniqueResourceID); + return wrapperTable->m_MetaDataGroup_AddMetaData (pMetaDataGroup, pNameSpace, pName, pValue, pType, bMustPreserve, pMetaData); } -Lib3MFResult CCall_lib3mf_beamlattice_setclipping(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode eClipMode, Lib3MF_uint32 nUniqueResourceID) +Lib3MFResult CCall_lib3mf_object_gettype(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, eLib3MFObjectType * pObjectType) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamLattice_SetClipping (pBeamLattice, eClipMode, nUniqueResourceID); + return wrapperTable->m_Object_GetType (pObject, pObjectType); } -Lib3MFResult CCall_lib3mf_beamlattice_getrepresentation(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, bool * pHasRepresentation, Lib3MF_uint32 * pUniqueResourceID) +Lib3MFResult CCall_lib3mf_object_settype(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, eLib3MFObjectType eObjectType) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamLattice_GetRepresentation (pBeamLattice, pHasRepresentation, pUniqueResourceID); + return wrapperTable->m_Object_SetType (pObject, eObjectType); } -Lib3MFResult CCall_lib3mf_beamlattice_setrepresentation(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nUniqueResourceID) +Lib3MFResult CCall_lib3mf_object_getname(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamLattice_SetRepresentation (pBeamLattice, nUniqueResourceID); + return wrapperTable->m_Object_GetName (pObject, nNameBufferSize, pNameNeededChars, pNameBuffer); } -Lib3MFResult CCall_lib3mf_beamlattice_getballoptions(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode * pBallMode, Lib3MF_double * pBallRadius) +Lib3MFResult CCall_lib3mf_object_setname(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, const char * pName) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamLattice_GetBallOptions (pBeamLattice, pBallMode, pBallRadius); + return wrapperTable->m_Object_SetName (pObject, pName); } -Lib3MFResult CCall_lib3mf_beamlattice_setballoptions(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode eBallMode, Lib3MF_double dBallRadius) +Lib3MFResult CCall_lib3mf_object_getpartnumber(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamLattice_SetBallOptions (pBeamLattice, eBallMode, dBallRadius); + return wrapperTable->m_Object_GetPartNumber (pObject, nPartNumberBufferSize, pPartNumberNeededChars, pPartNumberBuffer); } -Lib3MFResult CCall_lib3mf_beamlattice_getbeamcount(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount) +Lib3MFResult CCall_lib3mf_object_setpartnumber(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, const char * pPartNumber) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamLattice_GetBeamCount (pBeamLattice, pCount); + return wrapperTable->m_Object_SetPartNumber (pObject, pPartNumber); } -Lib3MFResult CCall_lib3mf_beamlattice_getbeam(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBeam * pBeamInfo) +Lib3MFResult CCall_lib3mf_object_ismeshobject(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, bool * pIsMeshObject) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamLattice_GetBeam (pBeamLattice, nIndex, pBeamInfo); + return wrapperTable->m_Object_IsMeshObject (pObject, pIsMeshObject); } -Lib3MFResult CCall_lib3mf_beamlattice_addbeam(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, const sLib3MFBeam * pBeamInfo, Lib3MF_uint32 * pIndex) +Lib3MFResult CCall_lib3mf_object_iscomponentsobject(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, bool * pIsComponentsObject) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamLattice_AddBeam (pBeamLattice, pBeamInfo, pIndex); + return wrapperTable->m_Object_IsComponentsObject (pObject, pIsComponentsObject); } -Lib3MFResult CCall_lib3mf_beamlattice_setbeam(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBeam * pBeamInfo) +Lib3MFResult CCall_lib3mf_object_isvalid(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, bool * pIsValid) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamLattice_SetBeam (pBeamLattice, nIndex, pBeamInfo); + return wrapperTable->m_Object_IsValid (pObject, pIsValid); } -Lib3MFResult CCall_lib3mf_beamlattice_setbeams(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBeamInfoBufferSize, const sLib3MFBeam * pBeamInfoBuffer) +Lib3MFResult CCall_lib3mf_object_setattachmentasthumbnail(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, Lib3MF_Attachment pAttachment) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamLattice_SetBeams (pBeamLattice, nBeamInfoBufferSize, pBeamInfoBuffer); + return wrapperTable->m_Object_SetAttachmentAsThumbnail (pObject, pAttachment); } -Lib3MFResult CCall_lib3mf_beamlattice_getbeams(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBeamInfoBufferSize, Lib3MF_uint64* pBeamInfoNeededCount, sLib3MFBeam * pBeamInfoBuffer) +Lib3MFResult CCall_lib3mf_object_getthumbnailattachment(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, Lib3MF_Attachment * pAttachment) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamLattice_GetBeams (pBeamLattice, nBeamInfoBufferSize, pBeamInfoNeededCount, pBeamInfoBuffer); + return wrapperTable->m_Object_GetThumbnailAttachment (pObject, pAttachment); } -Lib3MFResult CCall_lib3mf_beamlattice_getballcount(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount) +Lib3MFResult CCall_lib3mf_object_clearthumbnailattachment(Lib3MFHandle libraryHandle, Lib3MF_Object pObject) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamLattice_GetBallCount (pBeamLattice, pCount); + return wrapperTable->m_Object_ClearThumbnailAttachment (pObject); } -Lib3MFResult CCall_lib3mf_beamlattice_getball(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBall * pBallInfo) +Lib3MFResult CCall_lib3mf_object_getoutbox(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, sLib3MFBox * pOutbox) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamLattice_GetBall (pBeamLattice, nIndex, pBallInfo); + return wrapperTable->m_Object_GetOutbox (pObject, pOutbox); } -Lib3MFResult CCall_lib3mf_beamlattice_addball(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, const sLib3MFBall * pBallInfo, Lib3MF_uint32 * pIndex) +Lib3MFResult CCall_lib3mf_object_getuuid(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamLattice_AddBall (pBeamLattice, pBallInfo, pIndex); + return wrapperTable->m_Object_GetUUID (pObject, pHasUUID, nUUIDBufferSize, pUUIDNeededChars, pUUIDBuffer); } -Lib3MFResult CCall_lib3mf_beamlattice_setball(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBall * pBallInfo) +Lib3MFResult CCall_lib3mf_object_setuuid(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, const char * pUUID) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamLattice_SetBall (pBeamLattice, nIndex, pBallInfo); + return wrapperTable->m_Object_SetUUID (pObject, pUUID); } -Lib3MFResult CCall_lib3mf_beamlattice_setballs(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBallInfoBufferSize, const sLib3MFBall * pBallInfoBuffer) +Lib3MFResult CCall_lib3mf_object_getmetadatagroup(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, Lib3MF_MetaDataGroup * pMetaDataGroup) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamLattice_SetBalls (pBeamLattice, nBallInfoBufferSize, pBallInfoBuffer); + return wrapperTable->m_Object_GetMetaDataGroup (pObject, pMetaDataGroup); } -Lib3MFResult CCall_lib3mf_beamlattice_getballs(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBallInfoBufferSize, Lib3MF_uint64* pBallInfoNeededCount, sLib3MFBall * pBallInfoBuffer) +Lib3MFResult CCall_lib3mf_object_setslicesmeshresolution(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, eLib3MFSlicesMeshResolution eMeshResolution) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamLattice_GetBalls (pBeamLattice, nBallInfoBufferSize, pBallInfoNeededCount, pBallInfoBuffer); + return wrapperTable->m_Object_SetSlicesMeshResolution (pObject, eMeshResolution); } -Lib3MFResult CCall_lib3mf_beamlattice_getbeamsetcount(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount) +Lib3MFResult CCall_lib3mf_object_getslicesmeshresolution(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, eLib3MFSlicesMeshResolution * pMeshResolution) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamLattice_GetBeamSetCount (pBeamLattice, pCount); + return wrapperTable->m_Object_GetSlicesMeshResolution (pObject, pMeshResolution); } -Lib3MFResult CCall_lib3mf_beamlattice_addbeamset(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_BeamSet * pBeamSet) +Lib3MFResult CCall_lib3mf_object_hasslices(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, bool bRecursive, bool * pHasSlices) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamLattice_AddBeamSet (pBeamLattice, pBeamSet); + return wrapperTable->m_Object_HasSlices (pObject, bRecursive, pHasSlices); } -Lib3MFResult CCall_lib3mf_beamlattice_getbeamset(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF_BeamSet * pBeamSet) +Lib3MFResult CCall_lib3mf_object_clearslicestack(Lib3MFHandle libraryHandle, Lib3MF_Object pObject) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamLattice_GetBeamSet (pBeamLattice, nIndex, pBeamSet); + return wrapperTable->m_Object_ClearSliceStack (pObject); } -Lib3MFResult CCall_lib3mf_component_getobjectresource(Lib3MFHandle libraryHandle, Lib3MF_Component pComponent, Lib3MF_Object * pObjectResource) +Lib3MFResult CCall_lib3mf_object_getslicestack(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, Lib3MF_SliceStack * pSliceStackInstance) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Component_GetObjectResource (pComponent, pObjectResource); + return wrapperTable->m_Object_GetSliceStack (pObject, pSliceStackInstance); } -Lib3MFResult CCall_lib3mf_component_getobjectresourceid(Lib3MFHandle libraryHandle, Lib3MF_Component pComponent, Lib3MF_uint32 * pUniqueResourceID) +Lib3MFResult CCall_lib3mf_object_assignslicestack(Lib3MFHandle libraryHandle, Lib3MF_Object pObject, Lib3MF_SliceStack pSliceStackInstance) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Component_GetObjectResourceID (pComponent, pUniqueResourceID); + return wrapperTable->m_Object_AssignSliceStack (pObject, pSliceStackInstance); } -Lib3MFResult CCall_lib3mf_component_getuuid(Lib3MFHandle libraryHandle, Lib3MF_Component pComponent, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) +Lib3MFResult CCall_lib3mf_meshobject_getvertexcount(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Component_GetUUID (pComponent, pHasUUID, nUUIDBufferSize, pUUIDNeededChars, pUUIDBuffer); + return wrapperTable->m_MeshObject_GetVertexCount (pMeshObject, pVertexCount); } -Lib3MFResult CCall_lib3mf_component_setuuid(Lib3MFHandle libraryHandle, Lib3MF_Component pComponent, const char * pUUID) +Lib3MFResult CCall_lib3mf_meshobject_gettrianglecount(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Component_SetUUID (pComponent, pUUID); + return wrapperTable->m_MeshObject_GetTriangleCount (pMeshObject, pVertexCount); } -Lib3MFResult CCall_lib3mf_component_hastransform(Lib3MFHandle libraryHandle, Lib3MF_Component pComponent, bool * pHasTransform) +Lib3MFResult CCall_lib3mf_meshobject_getvertex(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFPosition * pCoordinates) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Component_HasTransform (pComponent, pHasTransform); + return wrapperTable->m_MeshObject_GetVertex (pMeshObject, nIndex, pCoordinates); } -Lib3MFResult CCall_lib3mf_component_gettransform(Lib3MFHandle libraryHandle, Lib3MF_Component pComponent, sLib3MFTransform * pTransform) +Lib3MFResult CCall_lib3mf_meshobject_setvertex(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFPosition * pCoordinates) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Component_GetTransform (pComponent, pTransform); + return wrapperTable->m_MeshObject_SetVertex (pMeshObject, nIndex, pCoordinates); } -Lib3MFResult CCall_lib3mf_component_settransform(Lib3MFHandle libraryHandle, Lib3MF_Component pComponent, const sLib3MFTransform * pTransform) +Lib3MFResult CCall_lib3mf_meshobject_addvertex(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, const sLib3MFPosition * pCoordinates, Lib3MF_uint32 * pNewIndex) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Component_SetTransform (pComponent, pTransform); + return wrapperTable->m_MeshObject_AddVertex (pMeshObject, pCoordinates, pNewIndex); } -Lib3MFResult CCall_lib3mf_componentsobject_addcomponent(Lib3MFHandle libraryHandle, Lib3MF_ComponentsObject pComponentsObject, Lib3MF_Object pObjectResource, const sLib3MFTransform * pTransform, Lib3MF_Component * pComponentInstance) +Lib3MFResult CCall_lib3mf_meshobject_getvertices(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, sLib3MFPosition * pVerticesBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ComponentsObject_AddComponent (pComponentsObject, pObjectResource, pTransform, pComponentInstance); + return wrapperTable->m_MeshObject_GetVertices (pMeshObject, nVerticesBufferSize, pVerticesNeededCount, pVerticesBuffer); } -Lib3MFResult CCall_lib3mf_componentsobject_getcomponent(Lib3MFHandle libraryHandle, Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 nIndex, Lib3MF_Component * pComponentInstance) +Lib3MFResult CCall_lib3mf_meshobject_gettriangle(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFTriangle * pIndices) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ComponentsObject_GetComponent (pComponentsObject, nIndex, pComponentInstance); + return wrapperTable->m_MeshObject_GetTriangle (pMeshObject, nIndex, pIndices); } -Lib3MFResult CCall_lib3mf_componentsobject_getcomponentcount(Lib3MFHandle libraryHandle, Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 * pCount) +Lib3MFResult CCall_lib3mf_meshobject_settriangle(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFTriangle * pIndices) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ComponentsObject_GetComponentCount (pComponentsObject, pCount); + return wrapperTable->m_MeshObject_SetTriangle (pMeshObject, nIndex, pIndices); } -Lib3MFResult CCall_lib3mf_beamset_setname(Lib3MFHandle libraryHandle, Lib3MF_BeamSet pBeamSet, const char * pName) +Lib3MFResult CCall_lib3mf_meshobject_addtriangle(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, const sLib3MFTriangle * pIndices, Lib3MF_uint32 * pNewIndex) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamSet_SetName (pBeamSet, pName); + return wrapperTable->m_MeshObject_AddTriangle (pMeshObject, pIndices, pNewIndex); } -Lib3MFResult CCall_lib3mf_beamset_getname(Lib3MFHandle libraryHandle, Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) +Lib3MFResult CCall_lib3mf_meshobject_gettriangleindices(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, sLib3MFTriangle * pIndicesBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamSet_GetName (pBeamSet, nNameBufferSize, pNameNeededChars, pNameBuffer); + return wrapperTable->m_MeshObject_GetTriangleIndices (pMeshObject, nIndicesBufferSize, pIndicesNeededCount, pIndicesBuffer); } -Lib3MFResult CCall_lib3mf_beamset_setidentifier(Lib3MFHandle libraryHandle, Lib3MF_BeamSet pBeamSet, const char * pIdentifier) +Lib3MFResult CCall_lib3mf_meshobject_setobjectlevelproperty(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nUniqueResourceID, Lib3MF_uint32 nPropertyID) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamSet_SetIdentifier (pBeamSet, pIdentifier); + return wrapperTable->m_MeshObject_SetObjectLevelProperty (pMeshObject, nUniqueResourceID, nPropertyID); } -Lib3MFResult CCall_lib3mf_beamset_getidentifier(Lib3MFHandle libraryHandle, Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer) +Lib3MFResult CCall_lib3mf_meshobject_getobjectlevelproperty(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pUniqueResourceID, Lib3MF_uint32 * pPropertyID, bool * pHasObjectLevelProperty) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamSet_GetIdentifier (pBeamSet, nIdentifierBufferSize, pIdentifierNeededChars, pIdentifierBuffer); + return wrapperTable->m_MeshObject_GetObjectLevelProperty (pMeshObject, pUniqueResourceID, pPropertyID, pHasObjectLevelProperty); } -Lib3MFResult CCall_lib3mf_beamset_getreferencecount(Lib3MFHandle libraryHandle, Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount) +Lib3MFResult CCall_lib3mf_meshobject_settriangleproperties(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFTriangleProperties * pProperties) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamSet_GetReferenceCount (pBeamSet, pCount); + return wrapperTable->m_MeshObject_SetTriangleProperties (pMeshObject, nIndex, pProperties); } -Lib3MFResult CCall_lib3mf_beamset_setreferences(Lib3MFHandle libraryHandle, Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nReferencesBufferSize, const Lib3MF_uint32 * pReferencesBuffer) +Lib3MFResult CCall_lib3mf_meshobject_gettriangleproperties(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFTriangleProperties * pProperty) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamSet_SetReferences (pBeamSet, nReferencesBufferSize, pReferencesBuffer); + return wrapperTable->m_MeshObject_GetTriangleProperties (pMeshObject, nIndex, pProperty); } -Lib3MFResult CCall_lib3mf_beamset_getreferences(Lib3MFHandle libraryHandle, Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nReferencesBufferSize, Lib3MF_uint64* pReferencesNeededCount, Lib3MF_uint32 * pReferencesBuffer) +Lib3MFResult CCall_lib3mf_meshobject_setalltriangleproperties(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nPropertiesArrayBufferSize, const sLib3MFTriangleProperties * pPropertiesArrayBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamSet_GetReferences (pBeamSet, nReferencesBufferSize, pReferencesNeededCount, pReferencesBuffer); + return wrapperTable->m_MeshObject_SetAllTriangleProperties (pMeshObject, nPropertiesArrayBufferSize, pPropertiesArrayBuffer); } -Lib3MFResult CCall_lib3mf_beamset_getballreferencecount(Lib3MFHandle libraryHandle, Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount) +Lib3MFResult CCall_lib3mf_meshobject_getalltriangleproperties(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nPropertiesArrayBufferSize, Lib3MF_uint64* pPropertiesArrayNeededCount, sLib3MFTriangleProperties * pPropertiesArrayBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamSet_GetBallReferenceCount (pBeamSet, pCount); + return wrapperTable->m_MeshObject_GetAllTriangleProperties (pMeshObject, nPropertiesArrayBufferSize, pPropertiesArrayNeededCount, pPropertiesArrayBuffer); } -Lib3MFResult CCall_lib3mf_beamset_setballreferences(Lib3MFHandle libraryHandle, Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nBallReferencesBufferSize, const Lib3MF_uint32 * pBallReferencesBuffer) +Lib3MFResult CCall_lib3mf_meshobject_clearallproperties(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamSet_SetBallReferences (pBeamSet, nBallReferencesBufferSize, pBallReferencesBuffer); + return wrapperTable->m_MeshObject_ClearAllProperties (pMeshObject); } -Lib3MFResult CCall_lib3mf_beamset_getballreferences(Lib3MFHandle libraryHandle, Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nBallReferencesBufferSize, Lib3MF_uint64* pBallReferencesNeededCount, Lib3MF_uint32 * pBallReferencesBuffer) +Lib3MFResult CCall_lib3mf_meshobject_setgeometry(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nVerticesBufferSize, const sLib3MFPosition * pVerticesBuffer, Lib3MF_uint64 nIndicesBufferSize, const sLib3MFTriangle * pIndicesBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BeamSet_GetBallReferences (pBeamSet, nBallReferencesBufferSize, pBallReferencesNeededCount, pBallReferencesBuffer); + return wrapperTable->m_MeshObject_SetGeometry (pMeshObject, nVerticesBufferSize, pVerticesBuffer, nIndicesBufferSize, pIndicesBuffer); } -Lib3MFResult CCall_lib3mf_basematerialgroup_getcount(Lib3MFHandle libraryHandle, Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 * pCount) +Lib3MFResult CCall_lib3mf_meshobject_ismanifoldandoriented(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, bool * pIsManifoldAndOriented) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BaseMaterialGroup_GetCount (pBaseMaterialGroup, pCount); + return wrapperTable->m_MeshObject_IsManifoldAndOriented (pMeshObject, pIsManifoldAndOriented); } -Lib3MFResult CCall_lib3mf_basematerialgroup_getallpropertyids(Lib3MFHandle libraryHandle, Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) +Lib3MFResult CCall_lib3mf_meshobject_beamlattice(Lib3MFHandle libraryHandle, Lib3MF_MeshObject pMeshObject, Lib3MF_BeamLattice * pTheBeamLattice) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs (pBaseMaterialGroup, nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); + return wrapperTable->m_MeshObject_BeamLattice (pMeshObject, pTheBeamLattice); } -Lib3MFResult CCall_lib3mf_basematerialgroup_addmaterial(Lib3MFHandle libraryHandle, Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const char * pName, const sLib3MFColor * pDisplayColor, Lib3MF_uint32 * pPropertyID) +Lib3MFResult CCall_lib3mf_beamlattice_getminlength(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_double * pMinLength) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BaseMaterialGroup_AddMaterial (pBaseMaterialGroup, pName, pDisplayColor, pPropertyID); + return wrapperTable->m_BeamLattice_GetMinLength (pBeamLattice, pMinLength); } -Lib3MFResult CCall_lib3mf_basematerialgroup_removematerial(Lib3MFHandle libraryHandle, Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID) +Lib3MFResult CCall_lib3mf_beamlattice_setminlength(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_double dMinLength) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BaseMaterialGroup_RemoveMaterial (pBaseMaterialGroup, nPropertyID); + return wrapperTable->m_BeamLattice_SetMinLength (pBeamLattice, dMinLength); } -Lib3MFResult CCall_lib3mf_basematerialgroup_getname(Lib3MFHandle libraryHandle, Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) +Lib3MFResult CCall_lib3mf_beamlattice_getclipping(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode * pClipMode, Lib3MF_uint32 * pUniqueResourceID) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BaseMaterialGroup_GetName (pBaseMaterialGroup, nPropertyID, nNameBufferSize, pNameNeededChars, pNameBuffer); + return wrapperTable->m_BeamLattice_GetClipping (pBeamLattice, pClipMode, pUniqueResourceID); } -Lib3MFResult CCall_lib3mf_basematerialgroup_setname(Lib3MFHandle libraryHandle, Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const char * pName) +Lib3MFResult CCall_lib3mf_beamlattice_setclipping(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode eClipMode, Lib3MF_uint32 nUniqueResourceID) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BaseMaterialGroup_SetName (pBaseMaterialGroup, nPropertyID, pName); + return wrapperTable->m_BeamLattice_SetClipping (pBeamLattice, eClipMode, nUniqueResourceID); } -Lib3MFResult CCall_lib3mf_basematerialgroup_setdisplaycolor(Lib3MFHandle libraryHandle, Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor) +Lib3MFResult CCall_lib3mf_beamlattice_getrepresentation(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, bool * pHasRepresentation, Lib3MF_uint32 * pUniqueResourceID) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BaseMaterialGroup_SetDisplayColor (pBaseMaterialGroup, nPropertyID, pTheColor); + return wrapperTable->m_BeamLattice_GetRepresentation (pBeamLattice, pHasRepresentation, pUniqueResourceID); } -Lib3MFResult CCall_lib3mf_basematerialgroup_getdisplaycolor(Lib3MFHandle libraryHandle, Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor) +Lib3MFResult CCall_lib3mf_beamlattice_setrepresentation(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nUniqueResourceID) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BaseMaterialGroup_GetDisplayColor (pBaseMaterialGroup, nPropertyID, pTheColor); + return wrapperTable->m_BeamLattice_SetRepresentation (pBeamLattice, nUniqueResourceID); } -Lib3MFResult CCall_lib3mf_colorgroup_getcount(Lib3MFHandle libraryHandle, Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 * pCount) +Lib3MFResult CCall_lib3mf_beamlattice_getballoptions(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode * pBallMode, Lib3MF_double * pBallRadius) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ColorGroup_GetCount (pColorGroup, pCount); + return wrapperTable->m_BeamLattice_GetBallOptions (pBeamLattice, pBallMode, pBallRadius); } -Lib3MFResult CCall_lib3mf_colorgroup_getallpropertyids(Lib3MFHandle libraryHandle, Lib3MF_ColorGroup pColorGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) +Lib3MFResult CCall_lib3mf_beamlattice_setballoptions(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode eBallMode, Lib3MF_double dBallRadius) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ColorGroup_GetAllPropertyIDs (pColorGroup, nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); + return wrapperTable->m_BeamLattice_SetBallOptions (pBeamLattice, eBallMode, dBallRadius); } -Lib3MFResult CCall_lib3mf_colorgroup_addcolor(Lib3MFHandle libraryHandle, Lib3MF_ColorGroup pColorGroup, const sLib3MFColor * pTheColor, Lib3MF_uint32 * pPropertyID) +Lib3MFResult CCall_lib3mf_beamlattice_getbeamcount(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ColorGroup_AddColor (pColorGroup, pTheColor, pPropertyID); + return wrapperTable->m_BeamLattice_GetBeamCount (pBeamLattice, pCount); } -Lib3MFResult CCall_lib3mf_colorgroup_removecolor(Lib3MFHandle libraryHandle, Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID) +Lib3MFResult CCall_lib3mf_beamlattice_getbeam(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBeam * pBeamInfo) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ColorGroup_RemoveColor (pColorGroup, nPropertyID); + return wrapperTable->m_BeamLattice_GetBeam (pBeamLattice, nIndex, pBeamInfo); } -Lib3MFResult CCall_lib3mf_colorgroup_setcolor(Lib3MFHandle libraryHandle, Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor) +Lib3MFResult CCall_lib3mf_beamlattice_addbeam(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, const sLib3MFBeam * pBeamInfo, Lib3MF_uint32 * pIndex) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ColorGroup_SetColor (pColorGroup, nPropertyID, pTheColor); + return wrapperTable->m_BeamLattice_AddBeam (pBeamLattice, pBeamInfo, pIndex); } -Lib3MFResult CCall_lib3mf_colorgroup_getcolor(Lib3MFHandle libraryHandle, Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor) +Lib3MFResult CCall_lib3mf_beamlattice_setbeam(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBeam * pBeamInfo) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ColorGroup_GetColor (pColorGroup, nPropertyID, pTheColor); + return wrapperTable->m_BeamLattice_SetBeam (pBeamLattice, nIndex, pBeamInfo); } -Lib3MFResult CCall_lib3mf_texture2dgroup_getcount(Lib3MFHandle libraryHandle, Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 * pCount) +Lib3MFResult CCall_lib3mf_beamlattice_setbeams(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBeamInfoBufferSize, const sLib3MFBeam * pBeamInfoBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Texture2DGroup_GetCount (pTexture2DGroup, pCount); + return wrapperTable->m_BeamLattice_SetBeams (pBeamLattice, nBeamInfoBufferSize, pBeamInfoBuffer); } -Lib3MFResult CCall_lib3mf_texture2dgroup_getallpropertyids(Lib3MFHandle libraryHandle, Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) +Lib3MFResult CCall_lib3mf_beamlattice_getbeams(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBeamInfoBufferSize, Lib3MF_uint64* pBeamInfoNeededCount, sLib3MFBeam * pBeamInfoBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Texture2DGroup_GetAllPropertyIDs (pTexture2DGroup, nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); + return wrapperTable->m_BeamLattice_GetBeams (pBeamLattice, nBeamInfoBufferSize, pBeamInfoNeededCount, pBeamInfoBuffer); } -Lib3MFResult CCall_lib3mf_texture2dgroup_addtex2coord(Lib3MFHandle libraryHandle, Lib3MF_Texture2DGroup pTexture2DGroup, const sLib3MFTex2Coord * pUVCoordinate, Lib3MF_uint32 * pPropertyID) +Lib3MFResult CCall_lib3mf_beamlattice_getballcount(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Texture2DGroup_AddTex2Coord (pTexture2DGroup, pUVCoordinate, pPropertyID); + return wrapperTable->m_BeamLattice_GetBallCount (pBeamLattice, pCount); } -Lib3MFResult CCall_lib3mf_texture2dgroup_gettex2coord(Lib3MFHandle libraryHandle, Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID, sLib3MFTex2Coord * pUVCoordinate) +Lib3MFResult CCall_lib3mf_beamlattice_getball(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBall * pBallInfo) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Texture2DGroup_GetTex2Coord (pTexture2DGroup, nPropertyID, pUVCoordinate); + return wrapperTable->m_BeamLattice_GetBall (pBeamLattice, nIndex, pBallInfo); } -Lib3MFResult CCall_lib3mf_texture2dgroup_removetex2coord(Lib3MFHandle libraryHandle, Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID) +Lib3MFResult CCall_lib3mf_beamlattice_addball(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, const sLib3MFBall * pBallInfo, Lib3MF_uint32 * pIndex) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Texture2DGroup_RemoveTex2Coord (pTexture2DGroup, nPropertyID); + return wrapperTable->m_BeamLattice_AddBall (pBeamLattice, pBallInfo, pIndex); } -Lib3MFResult CCall_lib3mf_texture2dgroup_gettexture2d(Lib3MFHandle libraryHandle, Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_Texture2D * pTexture2DInstance) +Lib3MFResult CCall_lib3mf_beamlattice_setball(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBall * pBallInfo) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Texture2DGroup_GetTexture2D (pTexture2DGroup, pTexture2DInstance); + return wrapperTable->m_BeamLattice_SetBall (pBeamLattice, nIndex, pBallInfo); } -Lib3MFResult CCall_lib3mf_compositematerials_getcount(Lib3MFHandle libraryHandle, Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 * pCount) +Lib3MFResult CCall_lib3mf_beamlattice_setballs(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBallInfoBufferSize, const sLib3MFBall * pBallInfoBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_CompositeMaterials_GetCount (pCompositeMaterials, pCount); + return wrapperTable->m_BeamLattice_SetBalls (pBeamLattice, nBallInfoBufferSize, pBallInfoBuffer); } -Lib3MFResult CCall_lib3mf_compositematerials_getallpropertyids(Lib3MFHandle libraryHandle, Lib3MF_CompositeMaterials pCompositeMaterials, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) +Lib3MFResult CCall_lib3mf_beamlattice_getballs(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBallInfoBufferSize, Lib3MF_uint64* pBallInfoNeededCount, sLib3MFBall * pBallInfoBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_CompositeMaterials_GetAllPropertyIDs (pCompositeMaterials, nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); + return wrapperTable->m_BeamLattice_GetBalls (pBeamLattice, nBallInfoBufferSize, pBallInfoNeededCount, pBallInfoBuffer); } -Lib3MFResult CCall_lib3mf_compositematerials_getbasematerialgroup(Lib3MFHandle libraryHandle, Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance) +Lib3MFResult CCall_lib3mf_beamlattice_getbeamsetcount(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_CompositeMaterials_GetBaseMaterialGroup (pCompositeMaterials, pBaseMaterialGroupInstance); + return wrapperTable->m_BeamLattice_GetBeamSetCount (pBeamLattice, pCount); } -Lib3MFResult CCall_lib3mf_compositematerials_addcomposite(Lib3MFHandle libraryHandle, Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint64 nCompositeBufferSize, const sLib3MFCompositeConstituent * pCompositeBuffer, Lib3MF_uint32 * pPropertyID) +Lib3MFResult CCall_lib3mf_beamlattice_addbeamset(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_BeamSet * pBeamSet) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_CompositeMaterials_AddComposite (pCompositeMaterials, nCompositeBufferSize, pCompositeBuffer, pPropertyID); + return wrapperTable->m_BeamLattice_AddBeamSet (pBeamLattice, pBeamSet); } -Lib3MFResult CCall_lib3mf_compositematerials_removecomposite(Lib3MFHandle libraryHandle, Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID) +Lib3MFResult CCall_lib3mf_beamlattice_getbeamset(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF_BeamSet * pBeamSet) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_CompositeMaterials_RemoveComposite (pCompositeMaterials, nPropertyID); + return wrapperTable->m_BeamLattice_GetBeamSet (pBeamLattice, nIndex, pBeamSet); } -Lib3MFResult CCall_lib3mf_compositematerials_getcomposite(Lib3MFHandle libraryHandle, Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nCompositeBufferSize, Lib3MF_uint64* pCompositeNeededCount, sLib3MFCompositeConstituent * pCompositeBuffer) +Lib3MFResult CCall_lib3mf_component_getobjectresource(Lib3MFHandle libraryHandle, Lib3MF_Component pComponent, Lib3MF_Object * pObjectResource) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_CompositeMaterials_GetComposite (pCompositeMaterials, nPropertyID, nCompositeBufferSize, pCompositeNeededCount, pCompositeBuffer); + return wrapperTable->m_Component_GetObjectResource (pComponent, pObjectResource); } -Lib3MFResult CCall_lib3mf_multipropertygroup_getcount(Lib3MFHandle libraryHandle, Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount) +Lib3MFResult CCall_lib3mf_component_getobjectresourceid(Lib3MFHandle libraryHandle, Lib3MF_Component pComponent, Lib3MF_uint32 * pUniqueResourceID) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MultiPropertyGroup_GetCount (pMultiPropertyGroup, pCount); + return wrapperTable->m_Component_GetObjectResourceID (pComponent, pUniqueResourceID); } -Lib3MFResult CCall_lib3mf_multipropertygroup_getallpropertyids(Lib3MFHandle libraryHandle, Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) +Lib3MFResult CCall_lib3mf_component_getuuid(Lib3MFHandle libraryHandle, Lib3MF_Component pComponent, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs (pMultiPropertyGroup, nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); + return wrapperTable->m_Component_GetUUID (pComponent, pHasUUID, nUUIDBufferSize, pUUIDNeededChars, pUUIDBuffer); } -Lib3MFResult CCall_lib3mf_multipropertygroup_addmultiproperty(Lib3MFHandle libraryHandle, Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer, Lib3MF_uint32 * pPropertyID) +Lib3MFResult CCall_lib3mf_component_setuuid(Lib3MFHandle libraryHandle, Lib3MF_Component pComponent, const char * pUUID) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MultiPropertyGroup_AddMultiProperty (pMultiPropertyGroup, nPropertyIDsBufferSize, pPropertyIDsBuffer, pPropertyID); + return wrapperTable->m_Component_SetUUID (pComponent, pUUID); } -Lib3MFResult CCall_lib3mf_multipropertygroup_setmultiproperty(Lib3MFHandle libraryHandle, Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer) +Lib3MFResult CCall_lib3mf_component_hastransform(Lib3MFHandle libraryHandle, Lib3MF_Component pComponent, bool * pHasTransform) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MultiPropertyGroup_SetMultiProperty (pMultiPropertyGroup, nPropertyID, nPropertyIDsBufferSize, pPropertyIDsBuffer); + return wrapperTable->m_Component_HasTransform (pComponent, pHasTransform); } -Lib3MFResult CCall_lib3mf_multipropertygroup_getmultiproperty(Lib3MFHandle libraryHandle, Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) +Lib3MFResult CCall_lib3mf_component_gettransform(Lib3MFHandle libraryHandle, Lib3MF_Component pComponent, sLib3MFTransform * pTransform) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MultiPropertyGroup_GetMultiProperty (pMultiPropertyGroup, nPropertyID, nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); + return wrapperTable->m_Component_GetTransform (pComponent, pTransform); } -Lib3MFResult CCall_lib3mf_multipropertygroup_removemultiproperty(Lib3MFHandle libraryHandle, Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID) +Lib3MFResult CCall_lib3mf_component_settransform(Lib3MFHandle libraryHandle, Lib3MF_Component pComponent, const sLib3MFTransform * pTransform) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MultiPropertyGroup_RemoveMultiProperty (pMultiPropertyGroup, nPropertyID); + return wrapperTable->m_Component_SetTransform (pComponent, pTransform); } -Lib3MFResult CCall_lib3mf_multipropertygroup_getlayercount(Lib3MFHandle libraryHandle, Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount) +Lib3MFResult CCall_lib3mf_componentsobject_addcomponent(Lib3MFHandle libraryHandle, Lib3MF_ComponentsObject pComponentsObject, Lib3MF_Object pObjectResource, const sLib3MFTransform * pTransform, Lib3MF_Component * pComponentInstance) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MultiPropertyGroup_GetLayerCount (pMultiPropertyGroup, pCount); + return wrapperTable->m_ComponentsObject_AddComponent (pComponentsObject, pObjectResource, pTransform, pComponentInstance); } -Lib3MFResult CCall_lib3mf_multipropertygroup_addlayer(Lib3MFHandle libraryHandle, Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const sLib3MFMultiPropertyLayer * pTheLayer, Lib3MF_uint32 * pLayerIndex) +Lib3MFResult CCall_lib3mf_componentsobject_getcomponent(Lib3MFHandle libraryHandle, Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 nIndex, Lib3MF_Component * pComponentInstance) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MultiPropertyGroup_AddLayer (pMultiPropertyGroup, pTheLayer, pLayerIndex); + return wrapperTable->m_ComponentsObject_GetComponent (pComponentsObject, nIndex, pComponentInstance); } -Lib3MFResult CCall_lib3mf_multipropertygroup_getlayer(Lib3MFHandle libraryHandle, Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex, sLib3MFMultiPropertyLayer * pTheLayer) +Lib3MFResult CCall_lib3mf_componentsobject_getcomponentcount(Lib3MFHandle libraryHandle, Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MultiPropertyGroup_GetLayer (pMultiPropertyGroup, nLayerIndex, pTheLayer); + return wrapperTable->m_ComponentsObject_GetComponentCount (pComponentsObject, pCount); } -Lib3MFResult CCall_lib3mf_multipropertygroup_removelayer(Lib3MFHandle libraryHandle, Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex) +Lib3MFResult CCall_lib3mf_beamset_setname(Lib3MFHandle libraryHandle, Lib3MF_BeamSet pBeamSet, const char * pName) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_MultiPropertyGroup_RemoveLayer (pMultiPropertyGroup, nLayerIndex); + return wrapperTable->m_BeamSet_SetName (pBeamSet, pName); } -Lib3MFResult CCall_lib3mf_attachment_getpath(Lib3MFHandle libraryHandle, Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer) +Lib3MFResult CCall_lib3mf_beamset_getname(Lib3MFHandle libraryHandle, Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Attachment_GetPath (pAttachment, nPathBufferSize, pPathNeededChars, pPathBuffer); + return wrapperTable->m_BeamSet_GetName (pBeamSet, nNameBufferSize, pNameNeededChars, pNameBuffer); } -Lib3MFResult CCall_lib3mf_attachment_setpath(Lib3MFHandle libraryHandle, Lib3MF_Attachment pAttachment, const char * pPath) +Lib3MFResult CCall_lib3mf_beamset_setidentifier(Lib3MFHandle libraryHandle, Lib3MF_BeamSet pBeamSet, const char * pIdentifier) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Attachment_SetPath (pAttachment, pPath); + return wrapperTable->m_BeamSet_SetIdentifier (pBeamSet, pIdentifier); } -Lib3MFResult CCall_lib3mf_attachment_packagepart(Lib3MFHandle libraryHandle, Lib3MF_Attachment pAttachment, Lib3MF_PackagePart * pPackagePart) +Lib3MFResult CCall_lib3mf_beamset_getidentifier(Lib3MFHandle libraryHandle, Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Attachment_PackagePart (pAttachment, pPackagePart); + return wrapperTable->m_BeamSet_GetIdentifier (pBeamSet, nIdentifierBufferSize, pIdentifierNeededChars, pIdentifierBuffer); } -Lib3MFResult CCall_lib3mf_attachment_getrelationshiptype(Lib3MFHandle libraryHandle, Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer) +Lib3MFResult CCall_lib3mf_beamset_getreferencecount(Lib3MFHandle libraryHandle, Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Attachment_GetRelationShipType (pAttachment, nPathBufferSize, pPathNeededChars, pPathBuffer); + return wrapperTable->m_BeamSet_GetReferenceCount (pBeamSet, pCount); } -Lib3MFResult CCall_lib3mf_attachment_setrelationshiptype(Lib3MFHandle libraryHandle, Lib3MF_Attachment pAttachment, const char * pPath) +Lib3MFResult CCall_lib3mf_beamset_setreferences(Lib3MFHandle libraryHandle, Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nReferencesBufferSize, const Lib3MF_uint32 * pReferencesBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Attachment_SetRelationShipType (pAttachment, pPath); + return wrapperTable->m_BeamSet_SetReferences (pBeamSet, nReferencesBufferSize, pReferencesBuffer); } -Lib3MFResult CCall_lib3mf_attachment_writetofile(Lib3MFHandle libraryHandle, Lib3MF_Attachment pAttachment, const char * pFileName) +Lib3MFResult CCall_lib3mf_beamset_getreferences(Lib3MFHandle libraryHandle, Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nReferencesBufferSize, Lib3MF_uint64* pReferencesNeededCount, Lib3MF_uint32 * pReferencesBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Attachment_WriteToFile (pAttachment, pFileName); + return wrapperTable->m_BeamSet_GetReferences (pBeamSet, nReferencesBufferSize, pReferencesNeededCount, pReferencesBuffer); } -Lib3MFResult CCall_lib3mf_attachment_readfromfile(Lib3MFHandle libraryHandle, Lib3MF_Attachment pAttachment, const char * pFileName) +Lib3MFResult CCall_lib3mf_beamset_getballreferencecount(Lib3MFHandle libraryHandle, Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Attachment_ReadFromFile (pAttachment, pFileName); + return wrapperTable->m_BeamSet_GetBallReferenceCount (pBeamSet, pCount); } -Lib3MFResult CCall_lib3mf_attachment_readfromcallback(Lib3MFHandle libraryHandle, Lib3MF_Attachment pAttachment, Lib3MFReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MFSeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData) +Lib3MFResult CCall_lib3mf_beamset_setballreferences(Lib3MFHandle libraryHandle, Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nBallReferencesBufferSize, const Lib3MF_uint32 * pBallReferencesBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Attachment_ReadFromCallback (pAttachment, pTheReadCallback, nStreamSize, pTheSeekCallback, pUserData); + return wrapperTable->m_BeamSet_SetBallReferences (pBeamSet, nBallReferencesBufferSize, pBallReferencesBuffer); } -Lib3MFResult CCall_lib3mf_attachment_getstreamsize(Lib3MFHandle libraryHandle, Lib3MF_Attachment pAttachment, Lib3MF_uint64 * pStreamSize) +Lib3MFResult CCall_lib3mf_beamset_getballreferences(Lib3MFHandle libraryHandle, Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nBallReferencesBufferSize, Lib3MF_uint64* pBallReferencesNeededCount, Lib3MF_uint32 * pBallReferencesBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Attachment_GetStreamSize (pAttachment, pStreamSize); + return wrapperTable->m_BeamSet_GetBallReferences (pBeamSet, nBallReferencesBufferSize, pBallReferencesNeededCount, pBallReferencesBuffer); } -Lib3MFResult CCall_lib3mf_attachment_writetobuffer(Lib3MFHandle libraryHandle, Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer) +Lib3MFResult CCall_lib3mf_basematerialgroup_getcount(Lib3MFHandle libraryHandle, Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Attachment_WriteToBuffer (pAttachment, nBufferBufferSize, pBufferNeededCount, pBufferBuffer); + return wrapperTable->m_BaseMaterialGroup_GetCount (pBaseMaterialGroup, pCount); } -Lib3MFResult CCall_lib3mf_attachment_readfrombuffer(Lib3MFHandle libraryHandle, Lib3MF_Attachment pAttachment, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer) +Lib3MFResult CCall_lib3mf_basematerialgroup_getallpropertyids(Lib3MFHandle libraryHandle, Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Attachment_ReadFromBuffer (pAttachment, nBufferBufferSize, pBufferBuffer); + return wrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs (pBaseMaterialGroup, nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); } -Lib3MFResult CCall_lib3mf_texture2d_getattachment(Lib3MFHandle libraryHandle, Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment * pAttachment) +Lib3MFResult CCall_lib3mf_basematerialgroup_addmaterial(Lib3MFHandle libraryHandle, Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const char * pName, const sLib3MFColor * pDisplayColor, Lib3MF_uint32 * pPropertyID) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Texture2D_GetAttachment (pTexture2D, pAttachment); + return wrapperTable->m_BaseMaterialGroup_AddMaterial (pBaseMaterialGroup, pName, pDisplayColor, pPropertyID); } -Lib3MFResult CCall_lib3mf_texture2d_setattachment(Lib3MFHandle libraryHandle, Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment pAttachment) +Lib3MFResult CCall_lib3mf_basematerialgroup_removematerial(Lib3MFHandle libraryHandle, Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Texture2D_SetAttachment (pTexture2D, pAttachment); + return wrapperTable->m_BaseMaterialGroup_RemoveMaterial (pBaseMaterialGroup, nPropertyID); } -Lib3MFResult CCall_lib3mf_texture2d_getcontenttype(Lib3MFHandle libraryHandle, Lib3MF_Texture2D pTexture2D, eLib3MFTextureType * pContentType) +Lib3MFResult CCall_lib3mf_basematerialgroup_getname(Lib3MFHandle libraryHandle, Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Texture2D_GetContentType (pTexture2D, pContentType); + return wrapperTable->m_BaseMaterialGroup_GetName (pBaseMaterialGroup, nPropertyID, nNameBufferSize, pNameNeededChars, pNameBuffer); } -Lib3MFResult CCall_lib3mf_texture2d_setcontenttype(Lib3MFHandle libraryHandle, Lib3MF_Texture2D pTexture2D, eLib3MFTextureType eContentType) +Lib3MFResult CCall_lib3mf_basematerialgroup_setname(Lib3MFHandle libraryHandle, Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const char * pName) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Texture2D_SetContentType (pTexture2D, eContentType); + return wrapperTable->m_BaseMaterialGroup_SetName (pBaseMaterialGroup, nPropertyID, pName); } -Lib3MFResult CCall_lib3mf_texture2d_gettilestyleuv(Lib3MFHandle libraryHandle, Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle * pTileStyleU, eLib3MFTextureTileStyle * pTileStyleV) +Lib3MFResult CCall_lib3mf_basematerialgroup_setdisplaycolor(Lib3MFHandle libraryHandle, Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Texture2D_GetTileStyleUV (pTexture2D, pTileStyleU, pTileStyleV); + return wrapperTable->m_BaseMaterialGroup_SetDisplayColor (pBaseMaterialGroup, nPropertyID, pTheColor); } -Lib3MFResult CCall_lib3mf_texture2d_settilestyleuv(Lib3MFHandle libraryHandle, Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle eTileStyleU, eLib3MFTextureTileStyle eTileStyleV) +Lib3MFResult CCall_lib3mf_basematerialgroup_getdisplaycolor(Lib3MFHandle libraryHandle, Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Texture2D_SetTileStyleUV (pTexture2D, eTileStyleU, eTileStyleV); + return wrapperTable->m_BaseMaterialGroup_GetDisplayColor (pBaseMaterialGroup, nPropertyID, pTheColor); } -Lib3MFResult CCall_lib3mf_texture2d_getfilter(Lib3MFHandle libraryHandle, Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter * pFilter) +Lib3MFResult CCall_lib3mf_colorgroup_getcount(Lib3MFHandle libraryHandle, Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Texture2D_GetFilter (pTexture2D, pFilter); + return wrapperTable->m_ColorGroup_GetCount (pColorGroup, pCount); } -Lib3MFResult CCall_lib3mf_texture2d_setfilter(Lib3MFHandle libraryHandle, Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter eFilter) +Lib3MFResult CCall_lib3mf_colorgroup_getallpropertyids(Lib3MFHandle libraryHandle, Lib3MF_ColorGroup pColorGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Texture2D_SetFilter (pTexture2D, eFilter); + return wrapperTable->m_ColorGroup_GetAllPropertyIDs (pColorGroup, nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); } -Lib3MFResult CCall_lib3mf_builditem_getobjectresource(Lib3MFHandle libraryHandle, Lib3MF_BuildItem pBuildItem, Lib3MF_Object * pObjectResource) +Lib3MFResult CCall_lib3mf_colorgroup_addcolor(Lib3MFHandle libraryHandle, Lib3MF_ColorGroup pColorGroup, const sLib3MFColor * pTheColor, Lib3MF_uint32 * pPropertyID) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BuildItem_GetObjectResource (pBuildItem, pObjectResource); + return wrapperTable->m_ColorGroup_AddColor (pColorGroup, pTheColor, pPropertyID); } -Lib3MFResult CCall_lib3mf_builditem_getuuid(Lib3MFHandle libraryHandle, Lib3MF_BuildItem pBuildItem, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) +Lib3MFResult CCall_lib3mf_colorgroup_removecolor(Lib3MFHandle libraryHandle, Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BuildItem_GetUUID (pBuildItem, pHasUUID, nUUIDBufferSize, pUUIDNeededChars, pUUIDBuffer); + return wrapperTable->m_ColorGroup_RemoveColor (pColorGroup, nPropertyID); } -Lib3MFResult CCall_lib3mf_builditem_setuuid(Lib3MFHandle libraryHandle, Lib3MF_BuildItem pBuildItem, const char * pUUID) +Lib3MFResult CCall_lib3mf_colorgroup_setcolor(Lib3MFHandle libraryHandle, Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BuildItem_SetUUID (pBuildItem, pUUID); + return wrapperTable->m_ColorGroup_SetColor (pColorGroup, nPropertyID, pTheColor); } -Lib3MFResult CCall_lib3mf_builditem_getobjectresourceid(Lib3MFHandle libraryHandle, Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pUniqueResourceID) +Lib3MFResult CCall_lib3mf_colorgroup_getcolor(Lib3MFHandle libraryHandle, Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BuildItem_GetObjectResourceID (pBuildItem, pUniqueResourceID); + return wrapperTable->m_ColorGroup_GetColor (pColorGroup, nPropertyID, pTheColor); } -Lib3MFResult CCall_lib3mf_builditem_hasobjecttransform(Lib3MFHandle libraryHandle, Lib3MF_BuildItem pBuildItem, bool * pHasTransform) +Lib3MFResult CCall_lib3mf_texture2dgroup_getcount(Lib3MFHandle libraryHandle, Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BuildItem_HasObjectTransform (pBuildItem, pHasTransform); + return wrapperTable->m_Texture2DGroup_GetCount (pTexture2DGroup, pCount); } -Lib3MFResult CCall_lib3mf_builditem_getobjecttransform(Lib3MFHandle libraryHandle, Lib3MF_BuildItem pBuildItem, sLib3MFTransform * pTransform) +Lib3MFResult CCall_lib3mf_texture2dgroup_getallpropertyids(Lib3MFHandle libraryHandle, Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BuildItem_GetObjectTransform (pBuildItem, pTransform); + return wrapperTable->m_Texture2DGroup_GetAllPropertyIDs (pTexture2DGroup, nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); } -Lib3MFResult CCall_lib3mf_builditem_setobjecttransform(Lib3MFHandle libraryHandle, Lib3MF_BuildItem pBuildItem, const sLib3MFTransform * pTransform) +Lib3MFResult CCall_lib3mf_texture2dgroup_addtex2coord(Lib3MFHandle libraryHandle, Lib3MF_Texture2DGroup pTexture2DGroup, const sLib3MFTex2Coord * pUVCoordinate, Lib3MF_uint32 * pPropertyID) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BuildItem_SetObjectTransform (pBuildItem, pTransform); + return wrapperTable->m_Texture2DGroup_AddTex2Coord (pTexture2DGroup, pUVCoordinate, pPropertyID); } -Lib3MFResult CCall_lib3mf_builditem_getpartnumber(Lib3MFHandle libraryHandle, Lib3MF_BuildItem pBuildItem, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer) +Lib3MFResult CCall_lib3mf_texture2dgroup_gettex2coord(Lib3MFHandle libraryHandle, Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID, sLib3MFTex2Coord * pUVCoordinate) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BuildItem_GetPartNumber (pBuildItem, nPartNumberBufferSize, pPartNumberNeededChars, pPartNumberBuffer); + return wrapperTable->m_Texture2DGroup_GetTex2Coord (pTexture2DGroup, nPropertyID, pUVCoordinate); } -Lib3MFResult CCall_lib3mf_builditem_setpartnumber(Lib3MFHandle libraryHandle, Lib3MF_BuildItem pBuildItem, const char * pSetPartnumber) +Lib3MFResult CCall_lib3mf_texture2dgroup_removetex2coord(Lib3MFHandle libraryHandle, Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BuildItem_SetPartNumber (pBuildItem, pSetPartnumber); + return wrapperTable->m_Texture2DGroup_RemoveTex2Coord (pTexture2DGroup, nPropertyID); } -Lib3MFResult CCall_lib3mf_builditem_getmetadatagroup(Lib3MFHandle libraryHandle, Lib3MF_BuildItem pBuildItem, Lib3MF_MetaDataGroup * pMetaDataGroup) +Lib3MFResult CCall_lib3mf_texture2dgroup_gettexture2d(Lib3MFHandle libraryHandle, Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_Texture2D * pTexture2DInstance) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BuildItem_GetMetaDataGroup (pBuildItem, pMetaDataGroup); + return wrapperTable->m_Texture2DGroup_GetTexture2D (pTexture2DGroup, pTexture2DInstance); } -Lib3MFResult CCall_lib3mf_builditem_getoutbox(Lib3MFHandle libraryHandle, Lib3MF_BuildItem pBuildItem, sLib3MFBox * pOutbox) +Lib3MFResult CCall_lib3mf_compositematerials_getcount(Lib3MFHandle libraryHandle, Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BuildItem_GetOutbox (pBuildItem, pOutbox); + return wrapperTable->m_CompositeMaterials_GetCount (pCompositeMaterials, pCount); } -Lib3MFResult CCall_lib3mf_builditemiterator_movenext(Lib3MFHandle libraryHandle, Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasNext) +Lib3MFResult CCall_lib3mf_compositematerials_getallpropertyids(Lib3MFHandle libraryHandle, Lib3MF_CompositeMaterials pCompositeMaterials, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BuildItemIterator_MoveNext (pBuildItemIterator, pHasNext); + return wrapperTable->m_CompositeMaterials_GetAllPropertyIDs (pCompositeMaterials, nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); } -Lib3MFResult CCall_lib3mf_builditemiterator_moveprevious(Lib3MFHandle libraryHandle, Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasPrevious) +Lib3MFResult CCall_lib3mf_compositematerials_getbasematerialgroup(Lib3MFHandle libraryHandle, Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BuildItemIterator_MovePrevious (pBuildItemIterator, pHasPrevious); + return wrapperTable->m_CompositeMaterials_GetBaseMaterialGroup (pCompositeMaterials, pBaseMaterialGroupInstance); } -Lib3MFResult CCall_lib3mf_builditemiterator_getcurrent(Lib3MFHandle libraryHandle, Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItem * pBuildItem) +Lib3MFResult CCall_lib3mf_compositematerials_addcomposite(Lib3MFHandle libraryHandle, Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint64 nCompositeBufferSize, const sLib3MFCompositeConstituent * pCompositeBuffer, Lib3MF_uint32 * pPropertyID) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BuildItemIterator_GetCurrent (pBuildItemIterator, pBuildItem); + return wrapperTable->m_CompositeMaterials_AddComposite (pCompositeMaterials, nCompositeBufferSize, pCompositeBuffer, pPropertyID); } -Lib3MFResult CCall_lib3mf_builditemiterator_clone(Lib3MFHandle libraryHandle, Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItemIterator * pOutBuildItemIterator) +Lib3MFResult CCall_lib3mf_compositematerials_removecomposite(Lib3MFHandle libraryHandle, Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BuildItemIterator_Clone (pBuildItemIterator, pOutBuildItemIterator); + return wrapperTable->m_CompositeMaterials_RemoveComposite (pCompositeMaterials, nPropertyID); } -Lib3MFResult CCall_lib3mf_builditemiterator_count(Lib3MFHandle libraryHandle, Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_uint64 * pCount) +Lib3MFResult CCall_lib3mf_compositematerials_getcomposite(Lib3MFHandle libraryHandle, Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nCompositeBufferSize, Lib3MF_uint64* pCompositeNeededCount, sLib3MFCompositeConstituent * pCompositeBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_BuildItemIterator_Count (pBuildItemIterator, pCount); + return wrapperTable->m_CompositeMaterials_GetComposite (pCompositeMaterials, nPropertyID, nCompositeBufferSize, pCompositeNeededCount, pCompositeBuffer); } -Lib3MFResult CCall_lib3mf_slice_setvertices(Lib3MFHandle libraryHandle, Lib3MF_Slice pSlice, Lib3MF_uint64 nVerticesBufferSize, const sLib3MFPosition2D * pVerticesBuffer) +Lib3MFResult CCall_lib3mf_multipropertygroup_getcount(Lib3MFHandle libraryHandle, Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Slice_SetVertices (pSlice, nVerticesBufferSize, pVerticesBuffer); + return wrapperTable->m_MultiPropertyGroup_GetCount (pMultiPropertyGroup, pCount); } -Lib3MFResult CCall_lib3mf_slice_getvertices(Lib3MFHandle libraryHandle, Lib3MF_Slice pSlice, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, sLib3MFPosition2D * pVerticesBuffer) +Lib3MFResult CCall_lib3mf_multipropertygroup_getallpropertyids(Lib3MFHandle libraryHandle, Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Slice_GetVertices (pSlice, nVerticesBufferSize, pVerticesNeededCount, pVerticesBuffer); + return wrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs (pMultiPropertyGroup, nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); } -Lib3MFResult CCall_lib3mf_slice_getvertexcount(Lib3MFHandle libraryHandle, Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount) +Lib3MFResult CCall_lib3mf_multipropertygroup_addmultiproperty(Lib3MFHandle libraryHandle, Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer, Lib3MF_uint32 * pPropertyID) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Slice_GetVertexCount (pSlice, pCount); + return wrapperTable->m_MultiPropertyGroup_AddMultiProperty (pMultiPropertyGroup, nPropertyIDsBufferSize, pPropertyIDsBuffer, pPropertyID); } -Lib3MFResult CCall_lib3mf_slice_addpolygon(Lib3MFHandle libraryHandle, Lib3MF_Slice pSlice, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer, Lib3MF_uint64 * pIndex) +Lib3MFResult CCall_lib3mf_multipropertygroup_setmultiproperty(Lib3MFHandle libraryHandle, Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Slice_AddPolygon (pSlice, nIndicesBufferSize, pIndicesBuffer, pIndex); + return wrapperTable->m_MultiPropertyGroup_SetMultiProperty (pMultiPropertyGroup, nPropertyID, nPropertyIDsBufferSize, pPropertyIDsBuffer); } -Lib3MFResult CCall_lib3mf_slice_getpolygoncount(Lib3MFHandle libraryHandle, Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount) +Lib3MFResult CCall_lib3mf_multipropertygroup_getmultiproperty(Lib3MFHandle libraryHandle, Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Slice_GetPolygonCount (pSlice, pCount); + return wrapperTable->m_MultiPropertyGroup_GetMultiProperty (pMultiPropertyGroup, nPropertyID, nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); } -Lib3MFResult CCall_lib3mf_slice_setpolygonindices(Lib3MFHandle libraryHandle, Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer) +Lib3MFResult CCall_lib3mf_multipropertygroup_removemultiproperty(Lib3MFHandle libraryHandle, Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Slice_SetPolygonIndices (pSlice, nIndex, nIndicesBufferSize, pIndicesBuffer); + return wrapperTable->m_MultiPropertyGroup_RemoveMultiProperty (pMultiPropertyGroup, nPropertyID); } -Lib3MFResult CCall_lib3mf_slice_getpolygonindices(Lib3MFHandle libraryHandle, Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF_uint32 * pIndicesBuffer) +Lib3MFResult CCall_lib3mf_multipropertygroup_getlayercount(Lib3MFHandle libraryHandle, Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Slice_GetPolygonIndices (pSlice, nIndex, nIndicesBufferSize, pIndicesNeededCount, pIndicesBuffer); + return wrapperTable->m_MultiPropertyGroup_GetLayerCount (pMultiPropertyGroup, pCount); } -Lib3MFResult CCall_lib3mf_slice_getpolygonindexcount(Lib3MFHandle libraryHandle, Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 * pCount) +Lib3MFResult CCall_lib3mf_multipropertygroup_addlayer(Lib3MFHandle libraryHandle, Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const sLib3MFMultiPropertyLayer * pTheLayer, Lib3MF_uint32 * pLayerIndex) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Slice_GetPolygonIndexCount (pSlice, nIndex, pCount); + return wrapperTable->m_MultiPropertyGroup_AddLayer (pMultiPropertyGroup, pTheLayer, pLayerIndex); } -Lib3MFResult CCall_lib3mf_slice_getztop(Lib3MFHandle libraryHandle, Lib3MF_Slice pSlice, Lib3MF_double * pZTop) +Lib3MFResult CCall_lib3mf_multipropertygroup_getlayer(Lib3MFHandle libraryHandle, Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex, sLib3MFMultiPropertyLayer * pTheLayer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Slice_GetZTop (pSlice, pZTop); + return wrapperTable->m_MultiPropertyGroup_GetLayer (pMultiPropertyGroup, nLayerIndex, pTheLayer); } -Lib3MFResult CCall_lib3mf_slicestack_getbottomz(Lib3MFHandle libraryHandle, Lib3MF_SliceStack pSliceStack, Lib3MF_double * pZBottom) +Lib3MFResult CCall_lib3mf_multipropertygroup_removelayer(Lib3MFHandle libraryHandle, Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_SliceStack_GetBottomZ (pSliceStack, pZBottom); + return wrapperTable->m_MultiPropertyGroup_RemoveLayer (pMultiPropertyGroup, nLayerIndex); } -Lib3MFResult CCall_lib3mf_slicestack_getslicecount(Lib3MFHandle libraryHandle, Lib3MF_SliceStack pSliceStack, Lib3MF_uint64 * pCount) +Lib3MFResult CCall_lib3mf_attachment_getpath(Lib3MFHandle libraryHandle, Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_SliceStack_GetSliceCount (pSliceStack, pCount); + return wrapperTable->m_Attachment_GetPath (pAttachment, nPathBufferSize, pPathNeededChars, pPathBuffer); } -Lib3MFResult CCall_lib3mf_slicestack_getslice(Lib3MFHandle libraryHandle, Lib3MF_SliceStack pSliceStack, Lib3MF_uint64 nSliceIndex, Lib3MF_Slice * pTheSlice) +Lib3MFResult CCall_lib3mf_attachment_setpath(Lib3MFHandle libraryHandle, Lib3MF_Attachment pAttachment, const char * pPath) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_SliceStack_GetSlice (pSliceStack, nSliceIndex, pTheSlice); + return wrapperTable->m_Attachment_SetPath (pAttachment, pPath); } -Lib3MFResult CCall_lib3mf_slicestack_addslice(Lib3MFHandle libraryHandle, Lib3MF_SliceStack pSliceStack, Lib3MF_double dZTop, Lib3MF_Slice * pTheSlice) +Lib3MFResult CCall_lib3mf_attachment_packagepart(Lib3MFHandle libraryHandle, Lib3MF_Attachment pAttachment, Lib3MF_PackagePart * pPackagePart) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_SliceStack_AddSlice (pSliceStack, dZTop, pTheSlice); + return wrapperTable->m_Attachment_PackagePart (pAttachment, pPackagePart); } -Lib3MFResult CCall_lib3mf_slicestack_getslicerefcount(Lib3MFHandle libraryHandle, Lib3MF_SliceStack pSliceStack, Lib3MF_uint64 * pCount) +Lib3MFResult CCall_lib3mf_attachment_getrelationshiptype(Lib3MFHandle libraryHandle, Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_SliceStack_GetSliceRefCount (pSliceStack, pCount); + return wrapperTable->m_Attachment_GetRelationShipType (pAttachment, nPathBufferSize, pPathNeededChars, pPathBuffer); } -Lib3MFResult CCall_lib3mf_slicestack_addslicestackreference(Lib3MFHandle libraryHandle, Lib3MF_SliceStack pSliceStack, Lib3MF_SliceStack pTheSliceStack) +Lib3MFResult CCall_lib3mf_attachment_setrelationshiptype(Lib3MFHandle libraryHandle, Lib3MF_Attachment pAttachment, const char * pPath) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_SliceStack_AddSliceStackReference (pSliceStack, pTheSliceStack); + return wrapperTable->m_Attachment_SetRelationShipType (pAttachment, pPath); } -Lib3MFResult CCall_lib3mf_slicestack_getslicestackreference(Lib3MFHandle libraryHandle, Lib3MF_SliceStack pSliceStack, Lib3MF_uint64 nSliceRefIndex, Lib3MF_SliceStack * pTheSliceStack) +Lib3MFResult CCall_lib3mf_attachment_writetofile(Lib3MFHandle libraryHandle, Lib3MF_Attachment pAttachment, const char * pFileName) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_SliceStack_GetSliceStackReference (pSliceStack, nSliceRefIndex, pTheSliceStack); + return wrapperTable->m_Attachment_WriteToFile (pAttachment, pFileName); } -Lib3MFResult CCall_lib3mf_slicestack_collapseslicereferences(Lib3MFHandle libraryHandle, Lib3MF_SliceStack pSliceStack) +Lib3MFResult CCall_lib3mf_attachment_readfromfile(Lib3MFHandle libraryHandle, Lib3MF_Attachment pAttachment, const char * pFileName) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_SliceStack_CollapseSliceReferences (pSliceStack); + return wrapperTable->m_Attachment_ReadFromFile (pAttachment, pFileName); } -Lib3MFResult CCall_lib3mf_slicestack_setownpath(Lib3MFHandle libraryHandle, Lib3MF_SliceStack pSliceStack, const char * pPath) +Lib3MFResult CCall_lib3mf_attachment_readfromcallback(Lib3MFHandle libraryHandle, Lib3MF_Attachment pAttachment, Lib3MFReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MFSeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_SliceStack_SetOwnPath (pSliceStack, pPath); + return wrapperTable->m_Attachment_ReadFromCallback (pAttachment, pTheReadCallback, nStreamSize, pTheSeekCallback, pUserData); } -Lib3MFResult CCall_lib3mf_slicestack_getownpath(Lib3MFHandle libraryHandle, Lib3MF_SliceStack pSliceStack, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer) +Lib3MFResult CCall_lib3mf_attachment_getstreamsize(Lib3MFHandle libraryHandle, Lib3MF_Attachment pAttachment, Lib3MF_uint64 * pStreamSize) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_SliceStack_GetOwnPath (pSliceStack, nPathBufferSize, pPathNeededChars, pPathBuffer); + return wrapperTable->m_Attachment_GetStreamSize (pAttachment, pStreamSize); } -Lib3MFResult CCall_lib3mf_consumer_getconsumerid(Lib3MFHandle libraryHandle, Lib3MF_Consumer pConsumer, const Lib3MF_uint32 nConsumerIDBufferSize, Lib3MF_uint32* pConsumerIDNeededChars, char * pConsumerIDBuffer) +Lib3MFResult CCall_lib3mf_attachment_writetobuffer(Lib3MFHandle libraryHandle, Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Consumer_GetConsumerID (pConsumer, nConsumerIDBufferSize, pConsumerIDNeededChars, pConsumerIDBuffer); + return wrapperTable->m_Attachment_WriteToBuffer (pAttachment, nBufferBufferSize, pBufferNeededCount, pBufferBuffer); } -Lib3MFResult CCall_lib3mf_consumer_getkeyid(Lib3MFHandle libraryHandle, Lib3MF_Consumer pConsumer, const Lib3MF_uint32 nKeyIDBufferSize, Lib3MF_uint32* pKeyIDNeededChars, char * pKeyIDBuffer) +Lib3MFResult CCall_lib3mf_attachment_readfrombuffer(Lib3MFHandle libraryHandle, Lib3MF_Attachment pAttachment, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Consumer_GetKeyID (pConsumer, nKeyIDBufferSize, pKeyIDNeededChars, pKeyIDBuffer); + return wrapperTable->m_Attachment_ReadFromBuffer (pAttachment, nBufferBufferSize, pBufferBuffer); } -Lib3MFResult CCall_lib3mf_consumer_getkeyvalue(Lib3MFHandle libraryHandle, Lib3MF_Consumer pConsumer, const Lib3MF_uint32 nKeyValueBufferSize, Lib3MF_uint32* pKeyValueNeededChars, char * pKeyValueBuffer) +Lib3MFResult CCall_lib3mf_texture2d_getattachment(Lib3MFHandle libraryHandle, Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment * pAttachment) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Consumer_GetKeyValue (pConsumer, nKeyValueBufferSize, pKeyValueNeededChars, pKeyValueBuffer); + return wrapperTable->m_Texture2D_GetAttachment (pTexture2D, pAttachment); } -Lib3MFResult CCall_lib3mf_accessright_getconsumer(Lib3MFHandle libraryHandle, Lib3MF_AccessRight pAccessRight, Lib3MF_Consumer * pConsumer) +Lib3MFResult CCall_lib3mf_texture2d_setattachment(Lib3MFHandle libraryHandle, Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment pAttachment) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_AccessRight_GetConsumer (pAccessRight, pConsumer); + return wrapperTable->m_Texture2D_SetAttachment (pTexture2D, pAttachment); } -Lib3MFResult CCall_lib3mf_accessright_getwrappingalgorithm(Lib3MFHandle libraryHandle, Lib3MF_AccessRight pAccessRight, eLib3MFWrappingAlgorithm * pAlgorithm) +Lib3MFResult CCall_lib3mf_texture2d_getcontenttype(Lib3MFHandle libraryHandle, Lib3MF_Texture2D pTexture2D, eLib3MFTextureType * pContentType) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_AccessRight_GetWrappingAlgorithm (pAccessRight, pAlgorithm); + return wrapperTable->m_Texture2D_GetContentType (pTexture2D, pContentType); } -Lib3MFResult CCall_lib3mf_accessright_getmgfalgorithm(Lib3MFHandle libraryHandle, Lib3MF_AccessRight pAccessRight, eLib3MFMgfAlgorithm * pAlgorithm) +Lib3MFResult CCall_lib3mf_texture2d_setcontenttype(Lib3MFHandle libraryHandle, Lib3MF_Texture2D pTexture2D, eLib3MFTextureType eContentType) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_AccessRight_GetMgfAlgorithm (pAccessRight, pAlgorithm); + return wrapperTable->m_Texture2D_SetContentType (pTexture2D, eContentType); } -Lib3MFResult CCall_lib3mf_accessright_getdigestmethod(Lib3MFHandle libraryHandle, Lib3MF_AccessRight pAccessRight, eLib3MFDigestMethod * pAlgorithm) +Lib3MFResult CCall_lib3mf_texture2d_gettilestyleuv(Lib3MFHandle libraryHandle, Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle * pTileStyleU, eLib3MFTextureTileStyle * pTileStyleV) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_AccessRight_GetDigestMethod (pAccessRight, pAlgorithm); + return wrapperTable->m_Texture2D_GetTileStyleUV (pTexture2D, pTileStyleU, pTileStyleV); } -Lib3MFResult CCall_lib3mf_contentencryptionparams_getencryptionalgorithm(Lib3MFHandle libraryHandle, Lib3MF_ContentEncryptionParams pContentEncryptionParams, eLib3MFEncryptionAlgorithm * pAlgorithm) +Lib3MFResult CCall_lib3mf_texture2d_settilestyleuv(Lib3MFHandle libraryHandle, Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle eTileStyleU, eLib3MFTextureTileStyle eTileStyleV) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ContentEncryptionParams_GetEncryptionAlgorithm (pContentEncryptionParams, pAlgorithm); + return wrapperTable->m_Texture2D_SetTileStyleUV (pTexture2D, eTileStyleU, eTileStyleV); } -Lib3MFResult CCall_lib3mf_contentencryptionparams_getkey(Lib3MFHandle libraryHandle, Lib3MF_ContentEncryptionParams pContentEncryptionParams, const Lib3MF_uint64 nByteDataBufferSize, Lib3MF_uint64* pByteDataNeededCount, Lib3MF_uint8 * pByteDataBuffer) +Lib3MFResult CCall_lib3mf_texture2d_getfilter(Lib3MFHandle libraryHandle, Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter * pFilter) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ContentEncryptionParams_GetKey (pContentEncryptionParams, nByteDataBufferSize, pByteDataNeededCount, pByteDataBuffer); + return wrapperTable->m_Texture2D_GetFilter (pTexture2D, pFilter); } -Lib3MFResult CCall_lib3mf_contentencryptionparams_getinitializationvector(Lib3MFHandle libraryHandle, Lib3MF_ContentEncryptionParams pContentEncryptionParams, const Lib3MF_uint64 nByteDataBufferSize, Lib3MF_uint64* pByteDataNeededCount, Lib3MF_uint8 * pByteDataBuffer) +Lib3MFResult CCall_lib3mf_texture2d_setfilter(Lib3MFHandle libraryHandle, Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter eFilter) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ContentEncryptionParams_GetInitializationVector (pContentEncryptionParams, nByteDataBufferSize, pByteDataNeededCount, pByteDataBuffer); + return wrapperTable->m_Texture2D_SetFilter (pTexture2D, eFilter); } -Lib3MFResult CCall_lib3mf_contentencryptionparams_getauthenticationtag(Lib3MFHandle libraryHandle, Lib3MF_ContentEncryptionParams pContentEncryptionParams, const Lib3MF_uint64 nByteDataBufferSize, Lib3MF_uint64* pByteDataNeededCount, Lib3MF_uint8 * pByteDataBuffer) +Lib3MFResult CCall_lib3mf_builditem_getobjectresource(Lib3MFHandle libraryHandle, Lib3MF_BuildItem pBuildItem, Lib3MF_Object * pObjectResource) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ContentEncryptionParams_GetAuthenticationTag (pContentEncryptionParams, nByteDataBufferSize, pByteDataNeededCount, pByteDataBuffer); + return wrapperTable->m_BuildItem_GetObjectResource (pBuildItem, pObjectResource); } -Lib3MFResult CCall_lib3mf_contentencryptionparams_setauthenticationtag(Lib3MFHandle libraryHandle, Lib3MF_ContentEncryptionParams pContentEncryptionParams, Lib3MF_uint64 nByteDataBufferSize, const Lib3MF_uint8 * pByteDataBuffer) +Lib3MFResult CCall_lib3mf_builditem_getuuid(Lib3MFHandle libraryHandle, Lib3MF_BuildItem pBuildItem, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ContentEncryptionParams_SetAuthenticationTag (pContentEncryptionParams, nByteDataBufferSize, pByteDataBuffer); + return wrapperTable->m_BuildItem_GetUUID (pBuildItem, pHasUUID, nUUIDBufferSize, pUUIDNeededChars, pUUIDBuffer); } -Lib3MFResult CCall_lib3mf_contentencryptionparams_getadditionalauthenticationdata(Lib3MFHandle libraryHandle, Lib3MF_ContentEncryptionParams pContentEncryptionParams, const Lib3MF_uint64 nByteDataBufferSize, Lib3MF_uint64* pByteDataNeededCount, Lib3MF_uint8 * pByteDataBuffer) +Lib3MFResult CCall_lib3mf_builditem_setuuid(Lib3MFHandle libraryHandle, Lib3MF_BuildItem pBuildItem, const char * pUUID) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ContentEncryptionParams_GetAdditionalAuthenticationData (pContentEncryptionParams, nByteDataBufferSize, pByteDataNeededCount, pByteDataBuffer); + return wrapperTable->m_BuildItem_SetUUID (pBuildItem, pUUID); } -Lib3MFResult CCall_lib3mf_contentencryptionparams_getdescriptor(Lib3MFHandle libraryHandle, Lib3MF_ContentEncryptionParams pContentEncryptionParams, Lib3MF_uint64 * pDescriptor) +Lib3MFResult CCall_lib3mf_builditem_getobjectresourceid(Lib3MFHandle libraryHandle, Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pUniqueResourceID) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ContentEncryptionParams_GetDescriptor (pContentEncryptionParams, pDescriptor); + return wrapperTable->m_BuildItem_GetObjectResourceID (pBuildItem, pUniqueResourceID); } -Lib3MFResult CCall_lib3mf_contentencryptionparams_getkeyuuid(Lib3MFHandle libraryHandle, Lib3MF_ContentEncryptionParams pContentEncryptionParams, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) +Lib3MFResult CCall_lib3mf_builditem_hasobjecttransform(Lib3MFHandle libraryHandle, Lib3MF_BuildItem pBuildItem, bool * pHasTransform) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ContentEncryptionParams_GetKeyUUID (pContentEncryptionParams, nUUIDBufferSize, pUUIDNeededChars, pUUIDBuffer); + return wrapperTable->m_BuildItem_HasObjectTransform (pBuildItem, pHasTransform); } -Lib3MFResult CCall_lib3mf_resourcedata_getpath(Lib3MFHandle libraryHandle, Lib3MF_ResourceData pResourceData, Lib3MF_PackagePart * pPath) +Lib3MFResult CCall_lib3mf_builditem_getobjecttransform(Lib3MFHandle libraryHandle, Lib3MF_BuildItem pBuildItem, sLib3MFTransform * pTransform) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ResourceData_GetPath (pResourceData, pPath); + return wrapperTable->m_BuildItem_GetObjectTransform (pBuildItem, pTransform); } -Lib3MFResult CCall_lib3mf_resourcedata_getencryptionalgorithm(Lib3MFHandle libraryHandle, Lib3MF_ResourceData pResourceData, eLib3MFEncryptionAlgorithm * pEncryptionAlgorithm) +Lib3MFResult CCall_lib3mf_builditem_setobjecttransform(Lib3MFHandle libraryHandle, Lib3MF_BuildItem pBuildItem, const sLib3MFTransform * pTransform) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ResourceData_GetEncryptionAlgorithm (pResourceData, pEncryptionAlgorithm); + return wrapperTable->m_BuildItem_SetObjectTransform (pBuildItem, pTransform); } -Lib3MFResult CCall_lib3mf_resourcedata_getcompression(Lib3MFHandle libraryHandle, Lib3MF_ResourceData pResourceData, eLib3MFCompression * pCompression) +Lib3MFResult CCall_lib3mf_builditem_getpartnumber(Lib3MFHandle libraryHandle, Lib3MF_BuildItem pBuildItem, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ResourceData_GetCompression (pResourceData, pCompression); + return wrapperTable->m_BuildItem_GetPartNumber (pBuildItem, nPartNumberBufferSize, pPartNumberNeededChars, pPartNumberBuffer); } -Lib3MFResult CCall_lib3mf_resourcedata_getadditionalauthenticationdata(Lib3MFHandle libraryHandle, Lib3MF_ResourceData pResourceData, const Lib3MF_uint64 nByteDataBufferSize, Lib3MF_uint64* pByteDataNeededCount, Lib3MF_uint8 * pByteDataBuffer) +Lib3MFResult CCall_lib3mf_builditem_setpartnumber(Lib3MFHandle libraryHandle, Lib3MF_BuildItem pBuildItem, const char * pSetPartnumber) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ResourceData_GetAdditionalAuthenticationData (pResourceData, nByteDataBufferSize, pByteDataNeededCount, pByteDataBuffer); + return wrapperTable->m_BuildItem_SetPartNumber (pBuildItem, pSetPartnumber); } -Lib3MFResult CCall_lib3mf_resourcedatagroup_getkeyuuid(Lib3MFHandle libraryHandle, Lib3MF_ResourceDataGroup pResourceDataGroup, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) +Lib3MFResult CCall_lib3mf_builditem_getmetadatagroup(Lib3MFHandle libraryHandle, Lib3MF_BuildItem pBuildItem, Lib3MF_MetaDataGroup * pMetaDataGroup) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ResourceDataGroup_GetKeyUUID (pResourceDataGroup, nUUIDBufferSize, pUUIDNeededChars, pUUIDBuffer); + return wrapperTable->m_BuildItem_GetMetaDataGroup (pBuildItem, pMetaDataGroup); } -Lib3MFResult CCall_lib3mf_resourcedatagroup_addaccessright(Lib3MFHandle libraryHandle, Lib3MF_ResourceDataGroup pResourceDataGroup, Lib3MF_Consumer pConsumer, eLib3MFWrappingAlgorithm eWrappingAlgorithm, eLib3MFMgfAlgorithm eMgfAlgorithm, eLib3MFDigestMethod eDigestMethod, Lib3MF_AccessRight * pTheAccessRight) +Lib3MFResult CCall_lib3mf_builditem_getoutbox(Lib3MFHandle libraryHandle, Lib3MF_BuildItem pBuildItem, sLib3MFBox * pOutbox) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ResourceDataGroup_AddAccessRight (pResourceDataGroup, pConsumer, eWrappingAlgorithm, eMgfAlgorithm, eDigestMethod, pTheAccessRight); + return wrapperTable->m_BuildItem_GetOutbox (pBuildItem, pOutbox); } -Lib3MFResult CCall_lib3mf_resourcedatagroup_findaccessrightbyconsumer(Lib3MFHandle libraryHandle, Lib3MF_ResourceDataGroup pResourceDataGroup, Lib3MF_Consumer pConsumer, Lib3MF_AccessRight * pTheAccessRight) +Lib3MFResult CCall_lib3mf_builditemiterator_movenext(Lib3MFHandle libraryHandle, Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasNext) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ResourceDataGroup_FindAccessRightByConsumer (pResourceDataGroup, pConsumer, pTheAccessRight); + return wrapperTable->m_BuildItemIterator_MoveNext (pBuildItemIterator, pHasNext); } -Lib3MFResult CCall_lib3mf_resourcedatagroup_removeaccessright(Lib3MFHandle libraryHandle, Lib3MF_ResourceDataGroup pResourceDataGroup, Lib3MF_Consumer pConsumer) +Lib3MFResult CCall_lib3mf_builditemiterator_moveprevious(Lib3MFHandle libraryHandle, Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasPrevious) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ResourceDataGroup_RemoveAccessRight (pResourceDataGroup, pConsumer); + return wrapperTable->m_BuildItemIterator_MovePrevious (pBuildItemIterator, pHasPrevious); } -Lib3MFResult CCall_lib3mf_keystore_addconsumer(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, const char * pConsumerID, const char * pKeyID, const char * pKeyValue, Lib3MF_Consumer * pConsumer) +Lib3MFResult CCall_lib3mf_builditemiterator_getcurrent(Lib3MFHandle libraryHandle, Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItem * pBuildItem) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_KeyStore_AddConsumer (pKeyStore, pConsumerID, pKeyID, pKeyValue, pConsumer); + return wrapperTable->m_BuildItemIterator_GetCurrent (pBuildItemIterator, pBuildItem); } -Lib3MFResult CCall_lib3mf_keystore_getconsumercount(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_uint64 * pCount) +Lib3MFResult CCall_lib3mf_builditemiterator_clone(Lib3MFHandle libraryHandle, Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItemIterator * pOutBuildItemIterator) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_KeyStore_GetConsumerCount (pKeyStore, pCount); + return wrapperTable->m_BuildItemIterator_Clone (pBuildItemIterator, pOutBuildItemIterator); } -Lib3MFResult CCall_lib3mf_keystore_getconsumer(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_uint64 nConsumerIndex, Lib3MF_Consumer * pConsumer) +Lib3MFResult CCall_lib3mf_builditemiterator_count(Lib3MFHandle libraryHandle, Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_uint64 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_KeyStore_GetConsumer (pKeyStore, nConsumerIndex, pConsumer); + return wrapperTable->m_BuildItemIterator_Count (pBuildItemIterator, pCount); } -Lib3MFResult CCall_lib3mf_keystore_removeconsumer(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_Consumer pConsumer) +Lib3MFResult CCall_lib3mf_slice_setvertices(Lib3MFHandle libraryHandle, Lib3MF_Slice pSlice, Lib3MF_uint64 nVerticesBufferSize, const sLib3MFPosition2D * pVerticesBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_KeyStore_RemoveConsumer (pKeyStore, pConsumer); + return wrapperTable->m_Slice_SetVertices (pSlice, nVerticesBufferSize, pVerticesBuffer); } -Lib3MFResult CCall_lib3mf_keystore_findconsumer(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, const char * pConsumerID, Lib3MF_Consumer * pConsumer) +Lib3MFResult CCall_lib3mf_slice_getvertices(Lib3MFHandle libraryHandle, Lib3MF_Slice pSlice, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, sLib3MFPosition2D * pVerticesBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_KeyStore_FindConsumer (pKeyStore, pConsumerID, pConsumer); + return wrapperTable->m_Slice_GetVertices (pSlice, nVerticesBufferSize, pVerticesNeededCount, pVerticesBuffer); } -Lib3MFResult CCall_lib3mf_keystore_getresourcedatagroupcount(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_uint64 * pCount) +Lib3MFResult CCall_lib3mf_slice_getvertexcount(Lib3MFHandle libraryHandle, Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_KeyStore_GetResourceDataGroupCount (pKeyStore, pCount); + return wrapperTable->m_Slice_GetVertexCount (pSlice, pCount); } -Lib3MFResult CCall_lib3mf_keystore_addresourcedatagroup(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_ResourceDataGroup * pResourceDataGroup) +Lib3MFResult CCall_lib3mf_slice_addpolygon(Lib3MFHandle libraryHandle, Lib3MF_Slice pSlice, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer, Lib3MF_uint64 * pIndex) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_KeyStore_AddResourceDataGroup (pKeyStore, pResourceDataGroup); + return wrapperTable->m_Slice_AddPolygon (pSlice, nIndicesBufferSize, pIndicesBuffer, pIndex); } -Lib3MFResult CCall_lib3mf_keystore_getresourcedatagroup(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_uint64 nResourceDataIndex, Lib3MF_ResourceDataGroup * pResourceDataGroup) +Lib3MFResult CCall_lib3mf_slice_getpolygoncount(Lib3MFHandle libraryHandle, Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_KeyStore_GetResourceDataGroup (pKeyStore, nResourceDataIndex, pResourceDataGroup); + return wrapperTable->m_Slice_GetPolygonCount (pSlice, pCount); } -Lib3MFResult CCall_lib3mf_keystore_removeresourcedatagroup(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_ResourceDataGroup pResourceDataGroup) +Lib3MFResult CCall_lib3mf_slice_setpolygonindices(Lib3MFHandle libraryHandle, Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_KeyStore_RemoveResourceDataGroup (pKeyStore, pResourceDataGroup); + return wrapperTable->m_Slice_SetPolygonIndices (pSlice, nIndex, nIndicesBufferSize, pIndicesBuffer); } -Lib3MFResult CCall_lib3mf_keystore_findresourcedatagroup(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_PackagePart pPartPath, Lib3MF_ResourceDataGroup * pResourceDataGroup) +Lib3MFResult CCall_lib3mf_slice_getpolygonindices(Lib3MFHandle libraryHandle, Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF_uint32 * pIndicesBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_KeyStore_FindResourceDataGroup (pKeyStore, pPartPath, pResourceDataGroup); + return wrapperTable->m_Slice_GetPolygonIndices (pSlice, nIndex, nIndicesBufferSize, pIndicesNeededCount, pIndicesBuffer); } -Lib3MFResult CCall_lib3mf_keystore_addresourcedata(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_ResourceDataGroup pResourceDataGroup, Lib3MF_PackagePart pPartPath, eLib3MFEncryptionAlgorithm eAlgorithm, eLib3MFCompression eCompression, Lib3MF_uint64 nAdditionalAuthenticationDataBufferSize, const Lib3MF_uint8 * pAdditionalAuthenticationDataBuffer, Lib3MF_ResourceData * pResourceData) +Lib3MFResult CCall_lib3mf_slice_getpolygonindexcount(Lib3MFHandle libraryHandle, Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_KeyStore_AddResourceData (pKeyStore, pResourceDataGroup, pPartPath, eAlgorithm, eCompression, nAdditionalAuthenticationDataBufferSize, pAdditionalAuthenticationDataBuffer, pResourceData); + return wrapperTable->m_Slice_GetPolygonIndexCount (pSlice, nIndex, pCount); } -Lib3MFResult CCall_lib3mf_keystore_removeresourcedata(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_ResourceData pResourceData) +Lib3MFResult CCall_lib3mf_slice_getztop(Lib3MFHandle libraryHandle, Lib3MF_Slice pSlice, Lib3MF_double * pZTop) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_KeyStore_RemoveResourceData (pKeyStore, pResourceData); + return wrapperTable->m_Slice_GetZTop (pSlice, pZTop); } -Lib3MFResult CCall_lib3mf_keystore_findresourcedata(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_PackagePart pResourcePath, Lib3MF_ResourceData * pResourceData) +Lib3MFResult CCall_lib3mf_toolpathprofile_getuuid(Lib3MFHandle libraryHandle, Lib3MF_ToolpathProfile pToolpathProfile, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_KeyStore_FindResourceData (pKeyStore, pResourcePath, pResourceData); + return wrapperTable->m_ToolpathProfile_GetUUID (pToolpathProfile, nUUIDBufferSize, pUUIDNeededChars, pUUIDBuffer); } -Lib3MFResult CCall_lib3mf_keystore_getresourcedatacount(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_uint64 * pCount) +Lib3MFResult CCall_lib3mf_toolpathprofile_getname(Lib3MFHandle libraryHandle, Lib3MF_ToolpathProfile pToolpathProfile, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_KeyStore_GetResourceDataCount (pKeyStore, pCount); + return wrapperTable->m_ToolpathProfile_GetName (pToolpathProfile, nNameBufferSize, pNameNeededChars, pNameBuffer); } -Lib3MFResult CCall_lib3mf_keystore_getresourcedata(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_uint64 nResourceDataIndex, Lib3MF_ResourceData * pResourceData) +Lib3MFResult CCall_lib3mf_toolpathprofile_getparametercount(Lib3MFHandle libraryHandle, Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_KeyStore_GetResourceData (pKeyStore, nResourceDataIndex, pResourceData); + return wrapperTable->m_ToolpathProfile_GetParameterCount (pToolpathProfile, pCount); } -Lib3MFResult CCall_lib3mf_keystore_getuuid(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) +Lib3MFResult CCall_lib3mf_toolpathprofile_getparametername(Lib3MFHandle libraryHandle, Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_KeyStore_GetUUID (pKeyStore, pHasUUID, nUUIDBufferSize, pUUIDNeededChars, pUUIDBuffer); + return wrapperTable->m_ToolpathProfile_GetParameterName (pToolpathProfile, nIndex, nNameBufferSize, pNameNeededChars, pNameBuffer); } -Lib3MFResult CCall_lib3mf_keystore_setuuid(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, const char * pUUID) +Lib3MFResult CCall_lib3mf_toolpathprofile_getparameternamespace(Lib3MFHandle libraryHandle, Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_KeyStore_SetUUID (pKeyStore, pUUID); + return wrapperTable->m_ToolpathProfile_GetParameterNameSpace (pToolpathProfile, nIndex, nNameSpaceBufferSize, pNameSpaceNeededChars, pNameSpaceBuffer); } -Lib3MFResult CCall_lib3mf_model_rootmodelpart(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_PackagePart * pRootModelPart) +Lib3MFResult CCall_lib3mf_toolpathprofile_hasparametervalue(Lib3MFHandle libraryHandle, Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool * pValueExists) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_RootModelPart (pModel, pRootModelPart); + return wrapperTable->m_ToolpathProfile_HasParameterValue (pToolpathProfile, pNameSpaceName, pValueName, pValueExists); } -Lib3MFResult CCall_lib3mf_model_findorcreatepackagepart(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, const char * pAbsolutePath, Lib3MF_PackagePart * pModelPart) +Lib3MFResult CCall_lib3mf_toolpathprofile_getparametervalue(Lib3MFHandle libraryHandle, Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_FindOrCreatePackagePart (pModel, pAbsolutePath, pModelPart); + return wrapperTable->m_ToolpathProfile_GetParameterValue (pToolpathProfile, pNameSpaceName, pValueName, nValueBufferSize, pValueNeededChars, pValueBuffer); } -Lib3MFResult CCall_lib3mf_model_setunit(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, eLib3MFModelUnit eUnit) +Lib3MFResult CCall_lib3mf_toolpathprofile_getparametervaluedef(Lib3MFHandle libraryHandle, Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const char * pDefaultValue, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_SetUnit (pModel, eUnit); + return wrapperTable->m_ToolpathProfile_GetParameterValueDef (pToolpathProfile, pNameSpaceName, pValueName, pDefaultValue, nValueBufferSize, pValueNeededChars, pValueBuffer); } -Lib3MFResult CCall_lib3mf_model_getunit(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, eLib3MFModelUnit * pUnit) +Lib3MFResult CCall_lib3mf_toolpathprofile_getparameterdoublevalue(Lib3MFHandle libraryHandle, Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double * pValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetUnit (pModel, pUnit); + return wrapperTable->m_ToolpathProfile_GetParameterDoubleValue (pToolpathProfile, pNameSpaceName, pValueName, pValue); } -Lib3MFResult CCall_lib3mf_model_getlanguage(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, const Lib3MF_uint32 nLanguageBufferSize, Lib3MF_uint32* pLanguageNeededChars, char * pLanguageBuffer) +Lib3MFResult CCall_lib3mf_toolpathprofile_getparameterdoublevaluedef(Lib3MFHandle libraryHandle, Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double dDefaultValue, Lib3MF_double * pValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetLanguage (pModel, nLanguageBufferSize, pLanguageNeededChars, pLanguageBuffer); + return wrapperTable->m_ToolpathProfile_GetParameterDoubleValueDef (pToolpathProfile, pNameSpaceName, pValueName, dDefaultValue, pValue); } -Lib3MFResult CCall_lib3mf_model_setlanguage(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, const char * pLanguage) +Lib3MFResult CCall_lib3mf_toolpathprofile_getparameterintegervalue(Lib3MFHandle libraryHandle, Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 * pValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_SetLanguage (pModel, pLanguage); + return wrapperTable->m_ToolpathProfile_GetParameterIntegerValue (pToolpathProfile, pNameSpaceName, pValueName, pValue); } -Lib3MFResult CCall_lib3mf_model_querywriter(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, const char * pWriterClass, Lib3MF_Writer * pWriterInstance) +Lib3MFResult CCall_lib3mf_toolpathprofile_getparameterintegervaluedef(Lib3MFHandle libraryHandle, Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 nDefaultValue, Lib3MF_int64 * pValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_QueryWriter (pModel, pWriterClass, pWriterInstance); + return wrapperTable->m_ToolpathProfile_GetParameterIntegerValueDef (pToolpathProfile, pNameSpaceName, pValueName, nDefaultValue, pValue); } -Lib3MFResult CCall_lib3mf_model_queryreader(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, const char * pReaderClass, Lib3MF_Reader * pReaderInstance) +Lib3MFResult CCall_lib3mf_toolpathprofile_getparameterboolvalue(Lib3MFHandle libraryHandle, Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool * pValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_QueryReader (pModel, pReaderClass, pReaderInstance); + return wrapperTable->m_ToolpathProfile_GetParameterBoolValue (pToolpathProfile, pNameSpaceName, pValueName, pValue); } -Lib3MFResult CCall_lib3mf_model_getresourcebyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_Resource * pResource) +Lib3MFResult CCall_lib3mf_toolpathprofile_getparameterboolvaluedef(Lib3MFHandle libraryHandle, Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool bDefaultValue, bool * pValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetResourceByID (pModel, nUniqueResourceID, pResource); + return wrapperTable->m_ToolpathProfile_GetParameterBoolValueDef (pToolpathProfile, pNameSpaceName, pValueName, bDefaultValue, pValue); } -Lib3MFResult CCall_lib3mf_model_gettexture2dbyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_Texture2D * pTextureInstance) +Lib3MFResult CCall_lib3mf_toolpathprofile_setname(Lib3MFHandle libraryHandle, Lib3MF_ToolpathProfile pToolpathProfile, const char * pName) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetTexture2DByID (pModel, nUniqueResourceID, pTextureInstance); + return wrapperTable->m_ToolpathProfile_SetName (pToolpathProfile, pName); } -Lib3MFResult CCall_lib3mf_model_getpropertytypebyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, eLib3MFPropertyType * pThePropertyType) +Lib3MFResult CCall_lib3mf_toolpathprofile_setparametervalue(Lib3MFHandle libraryHandle, Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const char * pValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetPropertyTypeByID (pModel, nUniqueResourceID, pThePropertyType); + return wrapperTable->m_ToolpathProfile_SetParameterValue (pToolpathProfile, pNameSpaceName, pValueName, pValue); } -Lib3MFResult CCall_lib3mf_model_getbasematerialgroupbyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance) +Lib3MFResult CCall_lib3mf_toolpathprofile_setparameterdoublevalue(Lib3MFHandle libraryHandle, Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double dValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetBaseMaterialGroupByID (pModel, nUniqueResourceID, pBaseMaterialGroupInstance); + return wrapperTable->m_ToolpathProfile_SetParameterDoubleValue (pToolpathProfile, pNameSpaceName, pValueName, dValue); } -Lib3MFResult CCall_lib3mf_model_gettexture2dgroupbyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_Texture2DGroup * pTexture2DGroupInstance) +Lib3MFResult CCall_lib3mf_toolpathprofile_setparameterintegervalue(Lib3MFHandle libraryHandle, Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 nValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetTexture2DGroupByID (pModel, nUniqueResourceID, pTexture2DGroupInstance); + return wrapperTable->m_ToolpathProfile_SetParameterIntegerValue (pToolpathProfile, pNameSpaceName, pValueName, nValue); } -Lib3MFResult CCall_lib3mf_model_getcompositematerialsbyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_CompositeMaterials * pCompositeMaterialsInstance) +Lib3MFResult CCall_lib3mf_toolpathprofile_setparameterboolvalue(Lib3MFHandle libraryHandle, Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool bValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetCompositeMaterialsByID (pModel, nUniqueResourceID, pCompositeMaterialsInstance); + return wrapperTable->m_ToolpathProfile_SetParameterBoolValue (pToolpathProfile, pNameSpaceName, pValueName, bValue); } -Lib3MFResult CCall_lib3mf_model_getmultipropertygroupbyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_MultiPropertyGroup * pMultiPropertyGroupInstance) +Lib3MFResult CCall_lib3mf_toolpathlayerreader_getlayerdatauuid(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerReader pToolpathLayerReader, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetMultiPropertyGroupByID (pModel, nUniqueResourceID, pMultiPropertyGroupInstance); + return wrapperTable->m_ToolpathLayerReader_GetLayerDataUUID (pToolpathLayerReader, nUUIDBufferSize, pUUIDNeededChars, pUUIDBuffer); } -Lib3MFResult CCall_lib3mf_model_getmeshobjectbyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_MeshObject * pMeshObjectInstance) +Lib3MFResult CCall_lib3mf_toolpathlayerreader_getsegmentcount(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetMeshObjectByID (pModel, nUniqueResourceID, pMeshObjectInstance); + return wrapperTable->m_ToolpathLayerReader_GetSegmentCount (pToolpathLayerReader, pCount); } -Lib3MFResult CCall_lib3mf_model_getcomponentsobjectbyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_ComponentsObject * pComponentsObjectInstance) +Lib3MFResult CCall_lib3mf_toolpathlayerreader_getsegmentinfo(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, eLib3MFToolpathSegmentType * pType, Lib3MF_uint32 * pPointCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetComponentsObjectByID (pModel, nUniqueResourceID, pComponentsObjectInstance); + return wrapperTable->m_ToolpathLayerReader_GetSegmentInfo (pToolpathLayerReader, nIndex, pType, pPointCount); } -Lib3MFResult CCall_lib3mf_model_getcolorgroupbyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_ColorGroup * pColorGroupInstance) +Lib3MFResult CCall_lib3mf_toolpathlayerreader_getsegmentprofile(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_ToolpathProfile * pProfile) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetColorGroupByID (pModel, nUniqueResourceID, pColorGroupInstance); + return wrapperTable->m_ToolpathLayerReader_GetSegmentProfile (pToolpathLayerReader, nIndex, pProfile); } -Lib3MFResult CCall_lib3mf_model_getslicestackbyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_SliceStack * pSliceStacInstance) +Lib3MFResult CCall_lib3mf_toolpathlayerreader_getsegmentprofileuuid(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nProfileUUIDBufferSize, Lib3MF_uint32* pProfileUUIDNeededChars, char * pProfileUUIDBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetSliceStackByID (pModel, nUniqueResourceID, pSliceStacInstance); + return wrapperTable->m_ToolpathLayerReader_GetSegmentProfileUUID (pToolpathLayerReader, nIndex, nProfileUUIDBufferSize, pProfileUUIDNeededChars, pProfileUUIDBuffer); } -Lib3MFResult CCall_lib3mf_model_getbuilduuid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) +Lib3MFResult CCall_lib3mf_toolpathlayerreader_getsegmentpart(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_BuildItem * pBuildItem) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetBuildUUID (pModel, pHasUUID, nUUIDBufferSize, pUUIDNeededChars, pUUIDBuffer); + return wrapperTable->m_ToolpathLayerReader_GetSegmentPart (pToolpathLayerReader, nIndex, pBuildItem); } -Lib3MFResult CCall_lib3mf_model_setbuilduuid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, const char * pUUID) +Lib3MFResult CCall_lib3mf_toolpathlayerreader_getsegmentpartuuid(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nPartUUIDBufferSize, Lib3MF_uint32* pPartUUIDNeededChars, char * pPartUUIDBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_SetBuildUUID (pModel, pUUID); + return wrapperTable->m_ToolpathLayerReader_GetSegmentPartUUID (pToolpathLayerReader, nIndex, nPartUUIDBufferSize, pPartUUIDNeededChars, pPartUUIDBuffer); } -Lib3MFResult CCall_lib3mf_model_getbuilditems(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_BuildItemIterator * pBuildItemIterator) +Lib3MFResult CCall_lib3mf_toolpathlayerreader_getsegmentlocalpartid(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 * pLocalPartID) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetBuildItems (pModel, pBuildItemIterator); + return wrapperTable->m_ToolpathLayerReader_GetSegmentLocalPartID (pToolpathLayerReader, nIndex, pLocalPartID); } -Lib3MFResult CCall_lib3mf_model_getoutbox(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, sLib3MFBox * pOutbox) +Lib3MFResult CCall_lib3mf_toolpathlayerreader_getpartuuidbylocalpartid(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nLocalPartID, const Lib3MF_uint32 nPartUUIDBufferSize, Lib3MF_uint32* pPartUUIDNeededChars, char * pPartUUIDBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetOutbox (pModel, pOutbox); + return wrapperTable->m_ToolpathLayerReader_GetPartUUIDByLocalPartID (pToolpathLayerReader, nLocalPartID, nPartUUIDBufferSize, pPartUUIDNeededChars, pPartUUIDBuffer); } -Lib3MFResult CCall_lib3mf_model_getresources(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_ResourceIterator * pResourceIterator) +Lib3MFResult CCall_lib3mf_toolpathlayerreader_getsegmentpointdata(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint64 nPointDataBufferSize, Lib3MF_uint64* pPointDataNeededCount, sLib3MFPosition2D * pPointDataBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetResources (pModel, pResourceIterator); + return wrapperTable->m_ToolpathLayerReader_GetSegmentPointData (pToolpathLayerReader, nIndex, nPointDataBufferSize, pPointDataNeededCount, pPointDataBuffer); } -Lib3MFResult CCall_lib3mf_model_getobjects(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_ObjectIterator * pResourceIterator) +Lib3MFResult CCall_lib3mf_toolpathlayerreader_findattributeinfobyname(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, Lib3MF_uint32 * pID, eLib3MFToolpathAttributeType * pAttributeType) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetObjects (pModel, pResourceIterator); + return wrapperTable->m_ToolpathLayerReader_FindAttributeInfoByName (pToolpathLayerReader, pNameSpace, pAttributeName, pID, pAttributeType); } -Lib3MFResult CCall_lib3mf_model_getmeshobjects(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_MeshObjectIterator * pResourceIterator) +Lib3MFResult CCall_lib3mf_toolpathlayerreader_findattributeidbyname(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, Lib3MF_uint32 * pID) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetMeshObjects (pModel, pResourceIterator); + return wrapperTable->m_ToolpathLayerReader_FindAttributeIDByName (pToolpathLayerReader, pNameSpace, pAttributeName, pID); } -Lib3MFResult CCall_lib3mf_model_getcomponentsobjects(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_ComponentsObjectIterator * pResourceIterator) +Lib3MFResult CCall_lib3mf_toolpathlayerreader_findattributevaluebyname(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, eLib3MFToolpathAttributeType * pAttributeType) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetComponentsObjects (pModel, pResourceIterator); + return wrapperTable->m_ToolpathLayerReader_FindAttributeValueByName (pToolpathLayerReader, pNameSpace, pAttributeName, pAttributeType); } -Lib3MFResult CCall_lib3mf_model_gettexture2ds(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_Texture2DIterator * pResourceIterator) +Lib3MFResult CCall_lib3mf_toolpathlayerreader_getsegmentintegerattributebyid(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 nID, Lib3MF_int64 * pValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetTexture2Ds (pModel, pResourceIterator); + return wrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByID (pToolpathLayerReader, nIndex, nID, pValue); } -Lib3MFResult CCall_lib3mf_model_getbasematerialgroups(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_BaseMaterialGroupIterator * pResourceIterator) +Lib3MFResult CCall_lib3mf_toolpathlayerreader_getsegmentintegerattributebyname(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const char * pNameSpace, const char * pAttributeName, Lib3MF_int64 * pValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetBaseMaterialGroups (pModel, pResourceIterator); + return wrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByName (pToolpathLayerReader, nIndex, pNameSpace, pAttributeName, pValue); } -Lib3MFResult CCall_lib3mf_model_getcolorgroups(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_ColorGroupIterator * pResourceIterator) +Lib3MFResult CCall_lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 nID, Lib3MF_double * pValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetColorGroups (pModel, pResourceIterator); + return wrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByID (pToolpathLayerReader, nIndex, nID, pValue); } -Lib3MFResult CCall_lib3mf_model_gettexture2dgroups(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_Texture2DGroupIterator * pResourceIterator) +Lib3MFResult CCall_lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const char * pNameSpace, const char * pAttributeName, Lib3MF_double * pValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetTexture2DGroups (pModel, pResourceIterator); + return wrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByName (pToolpathLayerReader, nIndex, pNameSpace, pAttributeName, pValue); } -Lib3MFResult CCall_lib3mf_model_getcompositematerials(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_CompositeMaterialsIterator * pResourceIterator) +Lib3MFResult CCall_lib3mf_toolpathlayerreader_getcustomdatacount(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetCompositeMaterials (pModel, pResourceIterator); + return wrapperTable->m_ToolpathLayerReader_GetCustomDataCount (pToolpathLayerReader, pCount); } -Lib3MFResult CCall_lib3mf_model_getmultipropertygroups(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_MultiPropertyGroupIterator * pResourceIterator) +Lib3MFResult CCall_lib3mf_toolpathlayerreader_getcustomdata(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_CustomDOMTree * pData) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetMultiPropertyGroups (pModel, pResourceIterator); + return wrapperTable->m_ToolpathLayerReader_GetCustomData (pToolpathLayerReader, nIndex, pData); } -Lib3MFResult CCall_lib3mf_model_getslicestacks(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_SliceStackIterator * pResourceIterator) +Lib3MFResult CCall_lib3mf_toolpathlayerreader_getcustomdataname(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer, const Lib3MF_uint32 nDataNameBufferSize, Lib3MF_uint32* pDataNameNeededChars, char * pDataNameBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetSliceStacks (pModel, pResourceIterator); + return wrapperTable->m_ToolpathLayerReader_GetCustomDataName (pToolpathLayerReader, nIndex, nNameSpaceBufferSize, pNameSpaceNeededChars, pNameSpaceBuffer, nDataNameBufferSize, pDataNameNeededChars, pDataNameBuffer); } -Lib3MFResult CCall_lib3mf_model_mergetomodel(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_Model * pMergedModelInstance) +Lib3MFResult CCall_lib3mf_toolpathlayerdata_getlayerdatauuid(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerData pToolpathLayerData, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_MergeToModel (pModel, pMergedModelInstance); + return wrapperTable->m_ToolpathLayerData_GetLayerDataUUID (pToolpathLayerData, nUUIDBufferSize, pUUIDNeededChars, pUUIDBuffer); } -Lib3MFResult CCall_lib3mf_model_addmeshobject(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_MeshObject * pMeshObjectInstance) +Lib3MFResult CCall_lib3mf_toolpathlayerdata_registerprofile(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_ToolpathProfile pProfile, Lib3MF_uint32 * pProfileID) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_AddMeshObject (pModel, pMeshObjectInstance); + return wrapperTable->m_ToolpathLayerData_RegisterProfile (pToolpathLayerData, pProfile, pProfileID); } -Lib3MFResult CCall_lib3mf_model_addcomponentsobject(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_ComponentsObject * pComponentsObjectInstance) +Lib3MFResult CCall_lib3mf_toolpathlayerdata_registerbuilditem(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pPartID) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_AddComponentsObject (pModel, pComponentsObjectInstance); + return wrapperTable->m_ToolpathLayerData_RegisterBuildItem (pToolpathLayerData, pBuildItem, pPartID); } -Lib3MFResult CCall_lib3mf_model_addslicestack(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_double dZBottom, Lib3MF_SliceStack * pSliceStackInstance) +Lib3MFResult CCall_lib3mf_toolpathlayerdata_setsegmentattribute(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pAttributeName, const char * pValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_AddSliceStack (pModel, dZBottom, pSliceStackInstance); + return wrapperTable->m_ToolpathLayerData_SetSegmentAttribute (pToolpathLayerData, pNameSpace, pAttributeName, pValue); } -Lib3MFResult CCall_lib3mf_model_addtexture2dfromattachment(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_Attachment pTextureAttachment, Lib3MF_Texture2D * pTexture2DInstance) +Lib3MFResult CCall_lib3mf_toolpathlayerdata_clearsegmentattributes(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerData pToolpathLayerData) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_AddTexture2DFromAttachment (pModel, pTextureAttachment, pTexture2DInstance); + return wrapperTable->m_ToolpathLayerData_ClearSegmentAttributes (pToolpathLayerData); } -Lib3MFResult CCall_lib3mf_model_addbasematerialgroup(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance) +Lib3MFResult CCall_lib3mf_toolpathlayerdata_writehatchdata(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const sLib3MFPosition2D * pPointDataBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_AddBaseMaterialGroup (pModel, pBaseMaterialGroupInstance); + return wrapperTable->m_ToolpathLayerData_WriteHatchData (pToolpathLayerData, nProfileID, nPartID, nPointDataBufferSize, pPointDataBuffer); } -Lib3MFResult CCall_lib3mf_model_addcolorgroup(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_ColorGroup * pColorGroupInstance) +Lib3MFResult CCall_lib3mf_toolpathlayerdata_writeloop(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const sLib3MFPosition2D * pPointDataBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_AddColorGroup (pModel, pColorGroupInstance); + return wrapperTable->m_ToolpathLayerData_WriteLoop (pToolpathLayerData, nProfileID, nPartID, nPointDataBufferSize, pPointDataBuffer); } -Lib3MFResult CCall_lib3mf_model_addtexture2dgroup(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_Texture2D pTexture2DInstance, Lib3MF_Texture2DGroup * pTexture2DGroupInstance) +Lib3MFResult CCall_lib3mf_toolpathlayerdata_writepolyline(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const sLib3MFPosition2D * pPointDataBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_AddTexture2DGroup (pModel, pTexture2DInstance, pTexture2DGroupInstance); + return wrapperTable->m_ToolpathLayerData_WritePolyline (pToolpathLayerData, nProfileID, nPartID, nPointDataBufferSize, pPointDataBuffer); } -Lib3MFResult CCall_lib3mf_model_addcompositematerials(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_BaseMaterialGroup pBaseMaterialGroupInstance, Lib3MF_CompositeMaterials * pCompositeMaterialsInstance) +Lib3MFResult CCall_lib3mf_toolpathlayerdata_addcustomdata(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_AddCompositeMaterials (pModel, pBaseMaterialGroupInstance, pCompositeMaterialsInstance); + return wrapperTable->m_ToolpathLayerData_AddCustomData (pToolpathLayerData, pNameSpace, pDataName, pData); } -Lib3MFResult CCall_lib3mf_model_addmultipropertygroup(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_MultiPropertyGroup * pMultiPropertyGroupInstance) +Lib3MFResult CCall_lib3mf_toolpathlayerdata_finish(Lib3MFHandle libraryHandle, Lib3MF_ToolpathLayerData pToolpathLayerData) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_AddMultiPropertyGroup (pModel, pMultiPropertyGroupInstance); + return wrapperTable->m_ToolpathLayerData_Finish (pToolpathLayerData); } -Lib3MFResult CCall_lib3mf_model_addbuilditem(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_Object pObject, const sLib3MFTransform * pTransform, Lib3MF_BuildItem * pBuildItemInstance) +Lib3MFResult CCall_lib3mf_toolpath_getunits(Lib3MFHandle libraryHandle, Lib3MF_Toolpath pToolpath, Lib3MF_double * pUnits) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_AddBuildItem (pModel, pObject, pTransform, pBuildItemInstance); + return wrapperTable->m_Toolpath_GetUnits (pToolpath, pUnits); } -Lib3MFResult CCall_lib3mf_model_removebuilditem(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_BuildItem pBuildItemInstance) +Lib3MFResult CCall_lib3mf_toolpath_getlayercount(Lib3MFHandle libraryHandle, Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_RemoveBuildItem (pModel, pBuildItemInstance); + return wrapperTable->m_Toolpath_GetLayerCount (pToolpath, pCount); } -Lib3MFResult CCall_lib3mf_model_getmetadatagroup(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_MetaDataGroup * pTheMetaDataGroup) +Lib3MFResult CCall_lib3mf_toolpath_getprofilecount(Lib3MFHandle libraryHandle, Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetMetaDataGroup (pModel, pTheMetaDataGroup); + return wrapperTable->m_Toolpath_GetProfileCount (pToolpath, pCount); } -Lib3MFResult CCall_lib3mf_model_addattachment(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, const char * pURI, const char * pRelationShipType, Lib3MF_Attachment * pAttachmentInstance) +Lib3MFResult CCall_lib3mf_toolpath_addlayer(Lib3MFHandle libraryHandle, Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nZMax, const char * pPath, Lib3MF_Writer pModelWriter, Lib3MF_ToolpathLayerData * pLayerData) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_AddAttachment (pModel, pURI, pRelationShipType, pAttachmentInstance); + return wrapperTable->m_Toolpath_AddLayer (pToolpath, nZMax, pPath, pModelWriter, pLayerData); } -Lib3MFResult CCall_lib3mf_model_removeattachment(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_Attachment pAttachmentInstance) +Lib3MFResult CCall_lib3mf_toolpath_getlayerattachment(Lib3MFHandle libraryHandle, Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_Attachment * pAttachment) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_RemoveAttachment (pModel, pAttachmentInstance); + return wrapperTable->m_Toolpath_GetLayerAttachment (pToolpath, nIndex, pAttachment); } -Lib3MFResult CCall_lib3mf_model_getattachment(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nIndex, Lib3MF_Attachment * pAttachmentInstance) +Lib3MFResult CCall_lib3mf_toolpath_readlayerdata(Lib3MFHandle libraryHandle, Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_ToolpathLayerReader * pToolpathReader) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetAttachment (pModel, nIndex, pAttachmentInstance); + return wrapperTable->m_Toolpath_ReadLayerData (pToolpath, nIndex, pToolpathReader); } -Lib3MFResult CCall_lib3mf_model_findattachment(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, const char * pURI, Lib3MF_Attachment * pAttachmentInstance) +Lib3MFResult CCall_lib3mf_toolpath_getlayerpath(Lib3MFHandle libraryHandle, Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_FindAttachment (pModel, pURI, pAttachmentInstance); + return wrapperTable->m_Toolpath_GetLayerPath (pToolpath, nIndex, nPathBufferSize, pPathNeededChars, pPathBuffer); } -Lib3MFResult CCall_lib3mf_model_getattachmentcount(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 * pAttachmentCount) +Lib3MFResult CCall_lib3mf_toolpath_getlayerzmax(Lib3MFHandle libraryHandle, Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_uint32 * pZMax) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetAttachmentCount (pModel, pAttachmentCount); + return wrapperTable->m_Toolpath_GetLayerZMax (pToolpath, nIndex, pZMax); } -Lib3MFResult CCall_lib3mf_model_haspackagethumbnailattachment(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, bool * pHasThumbnail) +Lib3MFResult CCall_lib3mf_toolpath_getlayerz(Lib3MFHandle libraryHandle, Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nLayerIndex, Lib3MF_uint32 * pZValue) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_HasPackageThumbnailAttachment (pModel, pHasThumbnail); + return wrapperTable->m_Toolpath_GetLayerZ (pToolpath, nLayerIndex, pZValue); } -Lib3MFResult CCall_lib3mf_model_createpackagethumbnailattachment(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_Attachment * pAttachment) +Lib3MFResult CCall_lib3mf_toolpath_addprofile(Lib3MFHandle libraryHandle, Lib3MF_Toolpath pToolpath, const char * pName, Lib3MF_ToolpathProfile * pProfile) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_CreatePackageThumbnailAttachment (pModel, pAttachment); + return wrapperTable->m_Toolpath_AddProfile (pToolpath, pName, pProfile); } -Lib3MFResult CCall_lib3mf_model_getpackagethumbnailattachment(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_Attachment * pAttachment) +Lib3MFResult CCall_lib3mf_toolpath_getprofile(Lib3MFHandle libraryHandle, Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nProfileIndex, Lib3MF_ToolpathProfile * pProfile) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetPackageThumbnailAttachment (pModel, pAttachment); + return wrapperTable->m_Toolpath_GetProfile (pToolpath, nProfileIndex, pProfile); } -Lib3MFResult CCall_lib3mf_model_removepackagethumbnailattachment(Lib3MFHandle libraryHandle, Lib3MF_Model pModel) +Lib3MFResult CCall_lib3mf_toolpath_getprofileuuid(Lib3MFHandle libraryHandle, Lib3MF_Toolpath pToolpath, const char * pProfileUUID, Lib3MF_ToolpathProfile * pProfile) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_RemovePackageThumbnailAttachment (pModel); + return wrapperTable->m_Toolpath_GetProfileUUID (pToolpath, pProfileUUID, pProfile); } -Lib3MFResult CCall_lib3mf_model_addcustomcontenttype(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, const char * pExtension, const char * pContentType) +Lib3MFResult CCall_lib3mf_toolpath_getcustomdatacount(Lib3MFHandle libraryHandle, Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_AddCustomContentType (pModel, pExtension, pContentType); + return wrapperTable->m_Toolpath_GetCustomDataCount (pToolpath, pCount); } -Lib3MFResult CCall_lib3mf_model_removecustomcontenttype(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, const char * pExtension) +Lib3MFResult CCall_lib3mf_toolpath_getcustomdata(Lib3MFHandle libraryHandle, Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_CustomDOMTree * pData) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_RemoveCustomContentType (pModel, pExtension); + return wrapperTable->m_Toolpath_GetCustomData (pToolpath, nIndex, pData); } -Lib3MFResult CCall_lib3mf_model_setrandomnumbercallback(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MFRandomNumberCallback pTheCallback, Lib3MF_pvoid pUserData) +Lib3MFResult CCall_lib3mf_toolpath_getcustomdataname(Lib3MFHandle libraryHandle, Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer, const Lib3MF_uint32 nDataNameBufferSize, Lib3MF_uint32* pDataNameNeededChars, char * pDataNameBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_SetRandomNumberCallback (pModel, pTheCallback, pUserData); + return wrapperTable->m_Toolpath_GetCustomDataName (pToolpath, nIndex, nNameSpaceBufferSize, pNameSpaceNeededChars, pNameSpaceBuffer, nDataNameBufferSize, pDataNameNeededChars, pDataNameBuffer); } -Lib3MFResult CCall_lib3mf_model_getkeystore(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_KeyStore * pKeyStore) +Lib3MFResult CCall_lib3mf_toolpath_hasuniquecustomdata(Lib3MFHandle libraryHandle, Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, bool * pCustomDataExists) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Model_GetKeyStore (pModel, pKeyStore); + return wrapperTable->m_Toolpath_HasUniqueCustomData (pToolpath, pNameSpace, pDataName, pCustomDataExists); } -Lib3MFResult CCall_lib3mf_getlibraryversion(Lib3MFHandle libraryHandle, Lib3MF_uint32 * pMajor, Lib3MF_uint32 * pMinor, Lib3MF_uint32 * pMicro) +Lib3MFResult CCall_lib3mf_toolpath_finduniquecustomdata(Lib3MFHandle libraryHandle, Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_GetLibraryVersion (pMajor, pMinor, pMicro); + return wrapperTable->m_Toolpath_FindUniqueCustomData (pToolpath, pNameSpace, pDataName, pData); } -Lib3MFResult CCall_lib3mf_getprereleaseinformation(Lib3MFHandle libraryHandle, bool * pHasPrereleaseInfo, const Lib3MF_uint32 nPrereleaseInfoBufferSize, Lib3MF_uint32* pPrereleaseInfoNeededChars, char * pPrereleaseInfoBuffer) +Lib3MFResult CCall_lib3mf_toolpath_addcustomdata(Lib3MFHandle libraryHandle, Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_GetPrereleaseInformation (pHasPrereleaseInfo, nPrereleaseInfoBufferSize, pPrereleaseInfoNeededChars, pPrereleaseInfoBuffer); + return wrapperTable->m_Toolpath_AddCustomData (pToolpath, pNameSpace, pDataName, pData); } -Lib3MFResult CCall_lib3mf_getbuildinformation(Lib3MFHandle libraryHandle, bool * pHasBuildInfo, const Lib3MF_uint32 nBuildInformationBufferSize, Lib3MF_uint32* pBuildInformationNeededChars, char * pBuildInformationBuffer) +Lib3MFResult CCall_lib3mf_toolpath_clearcustomdata(Lib3MFHandle libraryHandle, Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pNumberOfDeletedItems) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_GetBuildInformation (pHasBuildInfo, nBuildInformationBufferSize, pBuildInformationNeededChars, pBuildInformationBuffer); + return wrapperTable->m_Toolpath_ClearCustomData (pToolpath, pNumberOfDeletedItems); } -Lib3MFResult CCall_lib3mf_getspecificationversion(Lib3MFHandle libraryHandle, const char * pSpecificationURL, bool * pIsSupported, Lib3MF_uint32 * pMajor, Lib3MF_uint32 * pMinor, Lib3MF_uint32 * pMicro) +Lib3MFResult CCall_lib3mf_toolpath_deletecustomdata(Lib3MFHandle libraryHandle, Lib3MF_Toolpath pToolpath, Lib3MF_CustomDOMTree pData, bool * pSuccess) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_GetSpecificationVersion (pSpecificationURL, pIsSupported, pMajor, pMinor, pMicro); + return wrapperTable->m_Toolpath_DeleteCustomData (pToolpath, pData, pSuccess); } -Lib3MFResult CCall_lib3mf_createmodel(Lib3MFHandle libraryHandle, Lib3MF_Model * pModel) +Lib3MFResult CCall_lib3mf_toolpath_registercustomintegerattribute(Lib3MFHandle libraryHandle, Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pAttributeName) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_CreateModel (pModel); + return wrapperTable->m_Toolpath_RegisterCustomIntegerAttribute (pToolpath, pNameSpace, pAttributeName); } -Lib3MFResult CCall_lib3mf_release(Lib3MFHandle libraryHandle, Lib3MF_Base pInstance) +Lib3MFResult CCall_lib3mf_toolpath_registercustomdoubleattribute(Lib3MFHandle libraryHandle, Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pAttributeName) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Release (pInstance); + return wrapperTable->m_Toolpath_RegisterCustomDoubleAttribute (pToolpath, pNameSpace, pAttributeName); } -Lib3MFResult CCall_lib3mf_acquire(Lib3MFHandle libraryHandle, Lib3MF_Base pInstance) +Lib3MFResult CCall_lib3mf_toolpathiterator_getcurrenttoolpath(Lib3MFHandle libraryHandle, Lib3MF_ToolpathIterator pToolpathIterator, Lib3MF_Toolpath * pResource) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_Acquire (pInstance); + return wrapperTable->m_ToolpathIterator_GetCurrentToolpath (pToolpathIterator, pResource); } -Lib3MFResult CCall_lib3mf_setjournal(Lib3MFHandle libraryHandle, const char * pJournalPath) +Lib3MFResult CCall_lib3mf_slicestack_getbottomz(Lib3MFHandle libraryHandle, Lib3MF_SliceStack pSliceStack, Lib3MF_double * pZBottom) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_SetJournal (pJournalPath); + return wrapperTable->m_SliceStack_GetBottomZ (pSliceStack, pZBottom); } -Lib3MFResult CCall_lib3mf_getlasterror(Lib3MFHandle libraryHandle, Lib3MF_Base pInstance, const Lib3MF_uint32 nLastErrorStringBufferSize, Lib3MF_uint32* pLastErrorStringNeededChars, char * pLastErrorStringBuffer, bool * pHasLastError) +Lib3MFResult CCall_lib3mf_slicestack_getslicecount(Lib3MFHandle libraryHandle, Lib3MF_SliceStack pSliceStack, Lib3MF_uint64 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_GetLastError (pInstance, nLastErrorStringBufferSize, pLastErrorStringNeededChars, pLastErrorStringBuffer, pHasLastError); + return wrapperTable->m_SliceStack_GetSliceCount (pSliceStack, pCount); } -Lib3MFResult CCall_lib3mf_getsymbollookupmethod(Lib3MFHandle libraryHandle, Lib3MF_pvoid * pSymbolLookupMethod) +Lib3MFResult CCall_lib3mf_slicestack_getslice(Lib3MFHandle libraryHandle, Lib3MF_SliceStack pSliceStack, Lib3MF_uint64 nSliceIndex, Lib3MF_Slice * pTheSlice) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_GetSymbolLookupMethod (pSymbolLookupMethod); + return wrapperTable->m_SliceStack_GetSlice (pSliceStack, nSliceIndex, pTheSlice); } -Lib3MFResult CCall_lib3mf_retrieveprogressmessage(Lib3MFHandle libraryHandle, eLib3MFProgressIdentifier eTheProgressIdentifier, const Lib3MF_uint32 nProgressMessageBufferSize, Lib3MF_uint32* pProgressMessageNeededChars, char * pProgressMessageBuffer) +Lib3MFResult CCall_lib3mf_slicestack_addslice(Lib3MFHandle libraryHandle, Lib3MF_SliceStack pSliceStack, Lib3MF_double dZTop, Lib3MF_Slice * pTheSlice) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_RetrieveProgressMessage (eTheProgressIdentifier, nProgressMessageBufferSize, pProgressMessageNeededChars, pProgressMessageBuffer); + return wrapperTable->m_SliceStack_AddSlice (pSliceStack, dZTop, pTheSlice); } -Lib3MFResult CCall_lib3mf_rgbatocolor(Lib3MFHandle libraryHandle, Lib3MF_uint8 nRed, Lib3MF_uint8 nGreen, Lib3MF_uint8 nBlue, Lib3MF_uint8 nAlpha, sLib3MFColor * pTheColor) +Lib3MFResult CCall_lib3mf_slicestack_getslicerefcount(Lib3MFHandle libraryHandle, Lib3MF_SliceStack pSliceStack, Lib3MF_uint64 * pCount) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_RGBAToColor (nRed, nGreen, nBlue, nAlpha, pTheColor); + return wrapperTable->m_SliceStack_GetSliceRefCount (pSliceStack, pCount); } -Lib3MFResult CCall_lib3mf_floatrgbatocolor(Lib3MFHandle libraryHandle, Lib3MF_single fRed, Lib3MF_single fGreen, Lib3MF_single fBlue, Lib3MF_single fAlpha, sLib3MFColor * pTheColor) +Lib3MFResult CCall_lib3mf_slicestack_addslicestackreference(Lib3MFHandle libraryHandle, Lib3MF_SliceStack pSliceStack, Lib3MF_SliceStack pTheSliceStack) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_FloatRGBAToColor (fRed, fGreen, fBlue, fAlpha, pTheColor); + return wrapperTable->m_SliceStack_AddSliceStackReference (pSliceStack, pTheSliceStack); } -Lib3MFResult CCall_lib3mf_colortorgba(Lib3MFHandle libraryHandle, const sLib3MFColor * pTheColor, Lib3MF_uint8 * pRed, Lib3MF_uint8 * pGreen, Lib3MF_uint8 * pBlue, Lib3MF_uint8 * pAlpha) +Lib3MFResult CCall_lib3mf_slicestack_getslicestackreference(Lib3MFHandle libraryHandle, Lib3MF_SliceStack pSliceStack, Lib3MF_uint64 nSliceRefIndex, Lib3MF_SliceStack * pTheSliceStack) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ColorToRGBA (pTheColor, pRed, pGreen, pBlue, pAlpha); + return wrapperTable->m_SliceStack_GetSliceStackReference (pSliceStack, nSliceRefIndex, pTheSliceStack); } -Lib3MFResult CCall_lib3mf_colortofloatrgba(Lib3MFHandle libraryHandle, const sLib3MFColor * pTheColor, Lib3MF_single * pRed, Lib3MF_single * pGreen, Lib3MF_single * pBlue, Lib3MF_single * pAlpha) +Lib3MFResult CCall_lib3mf_slicestack_collapseslicereferences(Lib3MFHandle libraryHandle, Lib3MF_SliceStack pSliceStack) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_ColorToFloatRGBA (pTheColor, pRed, pGreen, pBlue, pAlpha); + return wrapperTable->m_SliceStack_CollapseSliceReferences (pSliceStack); } -Lib3MFResult CCall_lib3mf_getidentitytransform(Lib3MFHandle libraryHandle, sLib3MFTransform * pTransform) +Lib3MFResult CCall_lib3mf_slicestack_setownpath(Lib3MFHandle libraryHandle, Lib3MF_SliceStack pSliceStack, const char * pPath) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_GetIdentityTransform (pTransform); + return wrapperTable->m_SliceStack_SetOwnPath (pSliceStack, pPath); } -Lib3MFResult CCall_lib3mf_getuniformscaletransform(Lib3MFHandle libraryHandle, Lib3MF_single fFactor, sLib3MFTransform * pTransform) +Lib3MFResult CCall_lib3mf_slicestack_getownpath(Lib3MFHandle libraryHandle, Lib3MF_SliceStack pSliceStack, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_GetUniformScaleTransform (fFactor, pTransform); + return wrapperTable->m_SliceStack_GetOwnPath (pSliceStack, nPathBufferSize, pPathNeededChars, pPathBuffer); } -Lib3MFResult CCall_lib3mf_getscaletransform(Lib3MFHandle libraryHandle, Lib3MF_single fFactorX, Lib3MF_single fFactorY, Lib3MF_single fFactorZ, sLib3MFTransform * pTransform) +Lib3MFResult CCall_lib3mf_consumer_getconsumerid(Lib3MFHandle libraryHandle, Lib3MF_Consumer pConsumer, const Lib3MF_uint32 nConsumerIDBufferSize, Lib3MF_uint32* pConsumerIDNeededChars, char * pConsumerIDBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_GetScaleTransform (fFactorX, fFactorY, fFactorZ, pTransform); + return wrapperTable->m_Consumer_GetConsumerID (pConsumer, nConsumerIDBufferSize, pConsumerIDNeededChars, pConsumerIDBuffer); } -Lib3MFResult CCall_lib3mf_gettranslationtransform(Lib3MFHandle libraryHandle, Lib3MF_single fVectorX, Lib3MF_single fVectorY, Lib3MF_single fVectorZ, sLib3MFTransform * pTransform) +Lib3MFResult CCall_lib3mf_consumer_getkeyid(Lib3MFHandle libraryHandle, Lib3MF_Consumer pConsumer, const Lib3MF_uint32 nKeyIDBufferSize, Lib3MF_uint32* pKeyIDNeededChars, char * pKeyIDBuffer) { if (libraryHandle == 0) return LIB3MF_ERROR_INVALIDCAST; sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; - return wrapperTable->m_GetTranslationTransform (fVectorX, fVectorY, fVectorZ, pTransform); + return wrapperTable->m_Consumer_GetKeyID (pConsumer, nKeyIDBufferSize, pKeyIDNeededChars, pKeyIDBuffer); } -*/ -import "C" -import ( - "fmt" - "unsafe" - "runtime" -) +Lib3MFResult CCall_lib3mf_consumer_getkeyvalue(Lib3MFHandle libraryHandle, Lib3MF_Consumer pConsumer, const Lib3MF_uint32 nKeyValueBufferSize, Lib3MF_uint32* pKeyValueNeededChars, char * pKeyValueBuffer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Consumer_GetKeyValue (pConsumer, nKeyValueBufferSize, pKeyValueNeededChars, pKeyValueBuffer); +} -type ref = C.Lib3MFHandle +Lib3MFResult CCall_lib3mf_accessright_getconsumer(Lib3MFHandle libraryHandle, Lib3MF_AccessRight pAccessRight, Lib3MF_Consumer * pConsumer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_AccessRight_GetConsumer (pAccessRight, pConsumer); +} -// PropertyType represents a Lib3MF enum. -type PropertyType int -const ( - PropertyType_NoPropertyType = 0 - PropertyType_BaseMaterial = 1 - PropertyType_TexCoord = 2 - PropertyType_Colors = 3 - PropertyType_Composite = 4 - PropertyType_Multi = 5 -) +Lib3MFResult CCall_lib3mf_accessright_getwrappingalgorithm(Lib3MFHandle libraryHandle, Lib3MF_AccessRight pAccessRight, eLib3MFWrappingAlgorithm * pAlgorithm) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_AccessRight_GetWrappingAlgorithm (pAccessRight, pAlgorithm); +} -// SlicesMeshResolution represents a Lib3MF enum. -type SlicesMeshResolution int -const ( - SlicesMeshResolution_Fullres = 0 - SlicesMeshResolution_Lowres = 1 -) +Lib3MFResult CCall_lib3mf_accessright_getmgfalgorithm(Lib3MFHandle libraryHandle, Lib3MF_AccessRight pAccessRight, eLib3MFMgfAlgorithm * pAlgorithm) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_AccessRight_GetMgfAlgorithm (pAccessRight, pAlgorithm); +} -// ModelUnit represents a Lib3MF enum. -type ModelUnit int -const ( - ModelUnit_MicroMeter = 0 - ModelUnit_MilliMeter = 1 - ModelUnit_CentiMeter = 2 - ModelUnit_Inch = 3 - ModelUnit_Foot = 4 - ModelUnit_Meter = 5 -) +Lib3MFResult CCall_lib3mf_accessright_getdigestmethod(Lib3MFHandle libraryHandle, Lib3MF_AccessRight pAccessRight, eLib3MFDigestMethod * pAlgorithm) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_AccessRight_GetDigestMethod (pAccessRight, pAlgorithm); +} -// ObjectType represents a Lib3MF enum. -type ObjectType int -const ( - ObjectType_Other = 0 - ObjectType_Model = 1 - ObjectType_Support = 2 - ObjectType_SolidSupport = 3 -) +Lib3MFResult CCall_lib3mf_contentencryptionparams_getencryptionalgorithm(Lib3MFHandle libraryHandle, Lib3MF_ContentEncryptionParams pContentEncryptionParams, eLib3MFEncryptionAlgorithm * pAlgorithm) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_ContentEncryptionParams_GetEncryptionAlgorithm (pContentEncryptionParams, pAlgorithm); +} -// TextureType represents a Lib3MF enum. -type TextureType int -const ( - TextureType_Unknown = 0 - TextureType_PNG = 1 - TextureType_JPEG = 2 -) +Lib3MFResult CCall_lib3mf_contentencryptionparams_getkey(Lib3MFHandle libraryHandle, Lib3MF_ContentEncryptionParams pContentEncryptionParams, const Lib3MF_uint64 nByteDataBufferSize, Lib3MF_uint64* pByteDataNeededCount, Lib3MF_uint8 * pByteDataBuffer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_ContentEncryptionParams_GetKey (pContentEncryptionParams, nByteDataBufferSize, pByteDataNeededCount, pByteDataBuffer); +} -// TextureTileStyle represents a Lib3MF enum. -type TextureTileStyle int -const ( - TextureTileStyle_Wrap = 0 - TextureTileStyle_Mirror = 1 - TextureTileStyle_Clamp = 2 - TextureTileStyle_NoTileStyle = 3 -) +Lib3MFResult CCall_lib3mf_contentencryptionparams_getinitializationvector(Lib3MFHandle libraryHandle, Lib3MF_ContentEncryptionParams pContentEncryptionParams, const Lib3MF_uint64 nByteDataBufferSize, Lib3MF_uint64* pByteDataNeededCount, Lib3MF_uint8 * pByteDataBuffer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_ContentEncryptionParams_GetInitializationVector (pContentEncryptionParams, nByteDataBufferSize, pByteDataNeededCount, pByteDataBuffer); +} -// TextureFilter represents a Lib3MF enum. -type TextureFilter int -const ( - TextureFilter_Auto = 0 - TextureFilter_Linear = 1 - TextureFilter_Nearest = 2 -) +Lib3MFResult CCall_lib3mf_contentencryptionparams_getauthenticationtag(Lib3MFHandle libraryHandle, Lib3MF_ContentEncryptionParams pContentEncryptionParams, const Lib3MF_uint64 nByteDataBufferSize, Lib3MF_uint64* pByteDataNeededCount, Lib3MF_uint8 * pByteDataBuffer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_ContentEncryptionParams_GetAuthenticationTag (pContentEncryptionParams, nByteDataBufferSize, pByteDataNeededCount, pByteDataBuffer); +} -// BeamLatticeCapMode represents a Lib3MF enum. -type BeamLatticeCapMode int -const ( - BeamLatticeCapMode_Sphere = 0 - BeamLatticeCapMode_HemiSphere = 1 +Lib3MFResult CCall_lib3mf_contentencryptionparams_setauthenticationtag(Lib3MFHandle libraryHandle, Lib3MF_ContentEncryptionParams pContentEncryptionParams, Lib3MF_uint64 nByteDataBufferSize, const Lib3MF_uint8 * pByteDataBuffer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_ContentEncryptionParams_SetAuthenticationTag (pContentEncryptionParams, nByteDataBufferSize, pByteDataBuffer); +} + + +Lib3MFResult CCall_lib3mf_contentencryptionparams_getadditionalauthenticationdata(Lib3MFHandle libraryHandle, Lib3MF_ContentEncryptionParams pContentEncryptionParams, const Lib3MF_uint64 nByteDataBufferSize, Lib3MF_uint64* pByteDataNeededCount, Lib3MF_uint8 * pByteDataBuffer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_ContentEncryptionParams_GetAdditionalAuthenticationData (pContentEncryptionParams, nByteDataBufferSize, pByteDataNeededCount, pByteDataBuffer); +} + + +Lib3MFResult CCall_lib3mf_contentencryptionparams_getdescriptor(Lib3MFHandle libraryHandle, Lib3MF_ContentEncryptionParams pContentEncryptionParams, Lib3MF_uint64 * pDescriptor) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_ContentEncryptionParams_GetDescriptor (pContentEncryptionParams, pDescriptor); +} + + +Lib3MFResult CCall_lib3mf_contentencryptionparams_getkeyuuid(Lib3MFHandle libraryHandle, Lib3MF_ContentEncryptionParams pContentEncryptionParams, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_ContentEncryptionParams_GetKeyUUID (pContentEncryptionParams, nUUIDBufferSize, pUUIDNeededChars, pUUIDBuffer); +} + + +Lib3MFResult CCall_lib3mf_resourcedata_getpath(Lib3MFHandle libraryHandle, Lib3MF_ResourceData pResourceData, Lib3MF_PackagePart * pPath) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_ResourceData_GetPath (pResourceData, pPath); +} + + +Lib3MFResult CCall_lib3mf_resourcedata_getencryptionalgorithm(Lib3MFHandle libraryHandle, Lib3MF_ResourceData pResourceData, eLib3MFEncryptionAlgorithm * pEncryptionAlgorithm) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_ResourceData_GetEncryptionAlgorithm (pResourceData, pEncryptionAlgorithm); +} + + +Lib3MFResult CCall_lib3mf_resourcedata_getcompression(Lib3MFHandle libraryHandle, Lib3MF_ResourceData pResourceData, eLib3MFCompression * pCompression) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_ResourceData_GetCompression (pResourceData, pCompression); +} + + +Lib3MFResult CCall_lib3mf_resourcedata_getadditionalauthenticationdata(Lib3MFHandle libraryHandle, Lib3MF_ResourceData pResourceData, const Lib3MF_uint64 nByteDataBufferSize, Lib3MF_uint64* pByteDataNeededCount, Lib3MF_uint8 * pByteDataBuffer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_ResourceData_GetAdditionalAuthenticationData (pResourceData, nByteDataBufferSize, pByteDataNeededCount, pByteDataBuffer); +} + + +Lib3MFResult CCall_lib3mf_resourcedatagroup_getkeyuuid(Lib3MFHandle libraryHandle, Lib3MF_ResourceDataGroup pResourceDataGroup, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_ResourceDataGroup_GetKeyUUID (pResourceDataGroup, nUUIDBufferSize, pUUIDNeededChars, pUUIDBuffer); +} + + +Lib3MFResult CCall_lib3mf_resourcedatagroup_addaccessright(Lib3MFHandle libraryHandle, Lib3MF_ResourceDataGroup pResourceDataGroup, Lib3MF_Consumer pConsumer, eLib3MFWrappingAlgorithm eWrappingAlgorithm, eLib3MFMgfAlgorithm eMgfAlgorithm, eLib3MFDigestMethod eDigestMethod, Lib3MF_AccessRight * pTheAccessRight) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_ResourceDataGroup_AddAccessRight (pResourceDataGroup, pConsumer, eWrappingAlgorithm, eMgfAlgorithm, eDigestMethod, pTheAccessRight); +} + + +Lib3MFResult CCall_lib3mf_resourcedatagroup_findaccessrightbyconsumer(Lib3MFHandle libraryHandle, Lib3MF_ResourceDataGroup pResourceDataGroup, Lib3MF_Consumer pConsumer, Lib3MF_AccessRight * pTheAccessRight) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_ResourceDataGroup_FindAccessRightByConsumer (pResourceDataGroup, pConsumer, pTheAccessRight); +} + + +Lib3MFResult CCall_lib3mf_resourcedatagroup_removeaccessright(Lib3MFHandle libraryHandle, Lib3MF_ResourceDataGroup pResourceDataGroup, Lib3MF_Consumer pConsumer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_ResourceDataGroup_RemoveAccessRight (pResourceDataGroup, pConsumer); +} + + +Lib3MFResult CCall_lib3mf_keystore_addconsumer(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, const char * pConsumerID, const char * pKeyID, const char * pKeyValue, Lib3MF_Consumer * pConsumer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_KeyStore_AddConsumer (pKeyStore, pConsumerID, pKeyID, pKeyValue, pConsumer); +} + + +Lib3MFResult CCall_lib3mf_keystore_getconsumercount(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_uint64 * pCount) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_KeyStore_GetConsumerCount (pKeyStore, pCount); +} + + +Lib3MFResult CCall_lib3mf_keystore_getconsumer(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_uint64 nConsumerIndex, Lib3MF_Consumer * pConsumer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_KeyStore_GetConsumer (pKeyStore, nConsumerIndex, pConsumer); +} + + +Lib3MFResult CCall_lib3mf_keystore_removeconsumer(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_Consumer pConsumer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_KeyStore_RemoveConsumer (pKeyStore, pConsumer); +} + + +Lib3MFResult CCall_lib3mf_keystore_findconsumer(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, const char * pConsumerID, Lib3MF_Consumer * pConsumer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_KeyStore_FindConsumer (pKeyStore, pConsumerID, pConsumer); +} + + +Lib3MFResult CCall_lib3mf_keystore_getresourcedatagroupcount(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_uint64 * pCount) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_KeyStore_GetResourceDataGroupCount (pKeyStore, pCount); +} + + +Lib3MFResult CCall_lib3mf_keystore_addresourcedatagroup(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_ResourceDataGroup * pResourceDataGroup) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_KeyStore_AddResourceDataGroup (pKeyStore, pResourceDataGroup); +} + + +Lib3MFResult CCall_lib3mf_keystore_getresourcedatagroup(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_uint64 nResourceDataIndex, Lib3MF_ResourceDataGroup * pResourceDataGroup) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_KeyStore_GetResourceDataGroup (pKeyStore, nResourceDataIndex, pResourceDataGroup); +} + + +Lib3MFResult CCall_lib3mf_keystore_removeresourcedatagroup(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_ResourceDataGroup pResourceDataGroup) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_KeyStore_RemoveResourceDataGroup (pKeyStore, pResourceDataGroup); +} + + +Lib3MFResult CCall_lib3mf_keystore_findresourcedatagroup(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_PackagePart pPartPath, Lib3MF_ResourceDataGroup * pResourceDataGroup) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_KeyStore_FindResourceDataGroup (pKeyStore, pPartPath, pResourceDataGroup); +} + + +Lib3MFResult CCall_lib3mf_keystore_addresourcedata(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_ResourceDataGroup pResourceDataGroup, Lib3MF_PackagePart pPartPath, eLib3MFEncryptionAlgorithm eAlgorithm, eLib3MFCompression eCompression, Lib3MF_uint64 nAdditionalAuthenticationDataBufferSize, const Lib3MF_uint8 * pAdditionalAuthenticationDataBuffer, Lib3MF_ResourceData * pResourceData) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_KeyStore_AddResourceData (pKeyStore, pResourceDataGroup, pPartPath, eAlgorithm, eCompression, nAdditionalAuthenticationDataBufferSize, pAdditionalAuthenticationDataBuffer, pResourceData); +} + + +Lib3MFResult CCall_lib3mf_keystore_removeresourcedata(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_ResourceData pResourceData) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_KeyStore_RemoveResourceData (pKeyStore, pResourceData); +} + + +Lib3MFResult CCall_lib3mf_keystore_findresourcedata(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_PackagePart pResourcePath, Lib3MF_ResourceData * pResourceData) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_KeyStore_FindResourceData (pKeyStore, pResourcePath, pResourceData); +} + + +Lib3MFResult CCall_lib3mf_keystore_getresourcedatacount(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_uint64 * pCount) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_KeyStore_GetResourceDataCount (pKeyStore, pCount); +} + + +Lib3MFResult CCall_lib3mf_keystore_getresourcedata(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, Lib3MF_uint64 nResourceDataIndex, Lib3MF_ResourceData * pResourceData) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_KeyStore_GetResourceData (pKeyStore, nResourceDataIndex, pResourceData); +} + + +Lib3MFResult CCall_lib3mf_keystore_getuuid(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_KeyStore_GetUUID (pKeyStore, pHasUUID, nUUIDBufferSize, pUUIDNeededChars, pUUIDBuffer); +} + + +Lib3MFResult CCall_lib3mf_keystore_setuuid(Lib3MFHandle libraryHandle, Lib3MF_KeyStore pKeyStore, const char * pUUID) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_KeyStore_SetUUID (pKeyStore, pUUID); +} + + +Lib3MFResult CCall_lib3mf_model_rootmodelpart(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_PackagePart * pRootModelPart) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_RootModelPart (pModel, pRootModelPart); +} + + +Lib3MFResult CCall_lib3mf_model_findorcreatepackagepart(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, const char * pAbsolutePath, Lib3MF_PackagePart * pModelPart) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_FindOrCreatePackagePart (pModel, pAbsolutePath, pModelPart); +} + + +Lib3MFResult CCall_lib3mf_model_setunit(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, eLib3MFModelUnit eUnit) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_SetUnit (pModel, eUnit); +} + + +Lib3MFResult CCall_lib3mf_model_getunit(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, eLib3MFModelUnit * pUnit) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetUnit (pModel, pUnit); +} + + +Lib3MFResult CCall_lib3mf_model_getlanguage(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, const Lib3MF_uint32 nLanguageBufferSize, Lib3MF_uint32* pLanguageNeededChars, char * pLanguageBuffer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetLanguage (pModel, nLanguageBufferSize, pLanguageNeededChars, pLanguageBuffer); +} + + +Lib3MFResult CCall_lib3mf_model_setlanguage(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, const char * pLanguage) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_SetLanguage (pModel, pLanguage); +} + + +Lib3MFResult CCall_lib3mf_model_querywriter(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, const char * pWriterClass, Lib3MF_Writer * pWriterInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_QueryWriter (pModel, pWriterClass, pWriterInstance); +} + + +Lib3MFResult CCall_lib3mf_model_queryreader(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, const char * pReaderClass, Lib3MF_Reader * pReaderInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_QueryReader (pModel, pReaderClass, pReaderInstance); +} + + +Lib3MFResult CCall_lib3mf_model_getresourcebyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_Resource * pResource) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetResourceByID (pModel, nUniqueResourceID, pResource); +} + + +Lib3MFResult CCall_lib3mf_model_gettexture2dbyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_Texture2D * pTextureInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetTexture2DByID (pModel, nUniqueResourceID, pTextureInstance); +} + + +Lib3MFResult CCall_lib3mf_model_getpropertytypebyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, eLib3MFPropertyType * pThePropertyType) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetPropertyTypeByID (pModel, nUniqueResourceID, pThePropertyType); +} + + +Lib3MFResult CCall_lib3mf_model_getbasematerialgroupbyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetBaseMaterialGroupByID (pModel, nUniqueResourceID, pBaseMaterialGroupInstance); +} + + +Lib3MFResult CCall_lib3mf_model_gettexture2dgroupbyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_Texture2DGroup * pTexture2DGroupInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetTexture2DGroupByID (pModel, nUniqueResourceID, pTexture2DGroupInstance); +} + + +Lib3MFResult CCall_lib3mf_model_getcompositematerialsbyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_CompositeMaterials * pCompositeMaterialsInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetCompositeMaterialsByID (pModel, nUniqueResourceID, pCompositeMaterialsInstance); +} + + +Lib3MFResult CCall_lib3mf_model_getmultipropertygroupbyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_MultiPropertyGroup * pMultiPropertyGroupInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetMultiPropertyGroupByID (pModel, nUniqueResourceID, pMultiPropertyGroupInstance); +} + + +Lib3MFResult CCall_lib3mf_model_getmeshobjectbyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_MeshObject * pMeshObjectInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetMeshObjectByID (pModel, nUniqueResourceID, pMeshObjectInstance); +} + + +Lib3MFResult CCall_lib3mf_model_getcomponentsobjectbyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_ComponentsObject * pComponentsObjectInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetComponentsObjectByID (pModel, nUniqueResourceID, pComponentsObjectInstance); +} + + +Lib3MFResult CCall_lib3mf_model_getcolorgroupbyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_ColorGroup * pColorGroupInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetColorGroupByID (pModel, nUniqueResourceID, pColorGroupInstance); +} + + +Lib3MFResult CCall_lib3mf_model_getslicestackbyid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nUniqueResourceID, Lib3MF_SliceStack * pSliceStacInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetSliceStackByID (pModel, nUniqueResourceID, pSliceStacInstance); +} + + +Lib3MFResult CCall_lib3mf_model_getbuilduuid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetBuildUUID (pModel, pHasUUID, nUUIDBufferSize, pUUIDNeededChars, pUUIDBuffer); +} + + +Lib3MFResult CCall_lib3mf_model_setbuilduuid(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, const char * pUUID) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_SetBuildUUID (pModel, pUUID); +} + + +Lib3MFResult CCall_lib3mf_model_getbuilditems(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_BuildItemIterator * pBuildItemIterator) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetBuildItems (pModel, pBuildItemIterator); +} + + +Lib3MFResult CCall_lib3mf_model_getoutbox(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, sLib3MFBox * pOutbox) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetOutbox (pModel, pOutbox); +} + + +Lib3MFResult CCall_lib3mf_model_getresources(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_ResourceIterator * pResourceIterator) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetResources (pModel, pResourceIterator); +} + + +Lib3MFResult CCall_lib3mf_model_getobjects(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_ObjectIterator * pResourceIterator) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetObjects (pModel, pResourceIterator); +} + + +Lib3MFResult CCall_lib3mf_model_getmeshobjects(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_MeshObjectIterator * pResourceIterator) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetMeshObjects (pModel, pResourceIterator); +} + + +Lib3MFResult CCall_lib3mf_model_getcomponentsobjects(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_ComponentsObjectIterator * pResourceIterator) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetComponentsObjects (pModel, pResourceIterator); +} + + +Lib3MFResult CCall_lib3mf_model_gettexture2ds(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_Texture2DIterator * pResourceIterator) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetTexture2Ds (pModel, pResourceIterator); +} + + +Lib3MFResult CCall_lib3mf_model_getbasematerialgroups(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_BaseMaterialGroupIterator * pResourceIterator) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetBaseMaterialGroups (pModel, pResourceIterator); +} + + +Lib3MFResult CCall_lib3mf_model_getcolorgroups(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_ColorGroupIterator * pResourceIterator) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetColorGroups (pModel, pResourceIterator); +} + + +Lib3MFResult CCall_lib3mf_model_gettexture2dgroups(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_Texture2DGroupIterator * pResourceIterator) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetTexture2DGroups (pModel, pResourceIterator); +} + + +Lib3MFResult CCall_lib3mf_model_getcompositematerials(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_CompositeMaterialsIterator * pResourceIterator) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetCompositeMaterials (pModel, pResourceIterator); +} + + +Lib3MFResult CCall_lib3mf_model_getmultipropertygroups(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_MultiPropertyGroupIterator * pResourceIterator) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetMultiPropertyGroups (pModel, pResourceIterator); +} + + +Lib3MFResult CCall_lib3mf_model_gettoolpaths(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_ToolpathIterator * pResourceIterator) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetToolpaths (pModel, pResourceIterator); +} + + +Lib3MFResult CCall_lib3mf_model_getslicestacks(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_SliceStackIterator * pResourceIterator) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetSliceStacks (pModel, pResourceIterator); +} + + +Lib3MFResult CCall_lib3mf_model_mergetomodel(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_Model * pMergedModelInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_MergeToModel (pModel, pMergedModelInstance); +} + + +Lib3MFResult CCall_lib3mf_model_addmeshobject(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_MeshObject * pMeshObjectInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_AddMeshObject (pModel, pMeshObjectInstance); +} + + +Lib3MFResult CCall_lib3mf_model_addcomponentsobject(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_ComponentsObject * pComponentsObjectInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_AddComponentsObject (pModel, pComponentsObjectInstance); +} + + +Lib3MFResult CCall_lib3mf_model_addslicestack(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_double dZBottom, Lib3MF_SliceStack * pSliceStackInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_AddSliceStack (pModel, dZBottom, pSliceStackInstance); +} + + +Lib3MFResult CCall_lib3mf_model_addtexture2dfromattachment(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_Attachment pTextureAttachment, Lib3MF_Texture2D * pTexture2DInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_AddTexture2DFromAttachment (pModel, pTextureAttachment, pTexture2DInstance); +} + + +Lib3MFResult CCall_lib3mf_model_addbasematerialgroup(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_AddBaseMaterialGroup (pModel, pBaseMaterialGroupInstance); +} + + +Lib3MFResult CCall_lib3mf_model_addcolorgroup(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_ColorGroup * pColorGroupInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_AddColorGroup (pModel, pColorGroupInstance); +} + + +Lib3MFResult CCall_lib3mf_model_addtexture2dgroup(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_Texture2D pTexture2DInstance, Lib3MF_Texture2DGroup * pTexture2DGroupInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_AddTexture2DGroup (pModel, pTexture2DInstance, pTexture2DGroupInstance); +} + + +Lib3MFResult CCall_lib3mf_model_addcompositematerials(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_BaseMaterialGroup pBaseMaterialGroupInstance, Lib3MF_CompositeMaterials * pCompositeMaterialsInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_AddCompositeMaterials (pModel, pBaseMaterialGroupInstance, pCompositeMaterialsInstance); +} + + +Lib3MFResult CCall_lib3mf_model_addmultipropertygroup(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_MultiPropertyGroup * pMultiPropertyGroupInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_AddMultiPropertyGroup (pModel, pMultiPropertyGroupInstance); +} + + +Lib3MFResult CCall_lib3mf_model_addbuilditem(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_Object pObject, const sLib3MFTransform * pTransform, Lib3MF_BuildItem * pBuildItemInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_AddBuildItem (pModel, pObject, pTransform, pBuildItemInstance); +} + + +Lib3MFResult CCall_lib3mf_model_removebuilditem(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_BuildItem pBuildItemInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_RemoveBuildItem (pModel, pBuildItemInstance); +} + + +Lib3MFResult CCall_lib3mf_model_addtoolpath(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_double dUnitFactor, Lib3MF_Toolpath * pToolpathInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_AddToolpath (pModel, dUnitFactor, pToolpathInstance); +} + + +Lib3MFResult CCall_lib3mf_model_getmetadatagroup(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_MetaDataGroup * pTheMetaDataGroup) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetMetaDataGroup (pModel, pTheMetaDataGroup); +} + + +Lib3MFResult CCall_lib3mf_model_addattachment(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, const char * pURI, const char * pRelationShipType, Lib3MF_Attachment * pAttachmentInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_AddAttachment (pModel, pURI, pRelationShipType, pAttachmentInstance); +} + + +Lib3MFResult CCall_lib3mf_model_removeattachment(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_Attachment pAttachmentInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_RemoveAttachment (pModel, pAttachmentInstance); +} + + +Lib3MFResult CCall_lib3mf_model_getattachment(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 nIndex, Lib3MF_Attachment * pAttachmentInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetAttachment (pModel, nIndex, pAttachmentInstance); +} + + +Lib3MFResult CCall_lib3mf_model_findattachment(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, const char * pURI, Lib3MF_Attachment * pAttachmentInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_FindAttachment (pModel, pURI, pAttachmentInstance); +} + + +Lib3MFResult CCall_lib3mf_model_getattachmentcount(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint32 * pAttachmentCount) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetAttachmentCount (pModel, pAttachmentCount); +} + + +Lib3MFResult CCall_lib3mf_model_haspackagethumbnailattachment(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, bool * pHasThumbnail) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_HasPackageThumbnailAttachment (pModel, pHasThumbnail); +} + + +Lib3MFResult CCall_lib3mf_model_createpackagethumbnailattachment(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_Attachment * pAttachment) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_CreatePackageThumbnailAttachment (pModel, pAttachment); +} + + +Lib3MFResult CCall_lib3mf_model_getpackagethumbnailattachment(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_Attachment * pAttachment) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetPackageThumbnailAttachment (pModel, pAttachment); +} + + +Lib3MFResult CCall_lib3mf_model_removepackagethumbnailattachment(Lib3MFHandle libraryHandle, Lib3MF_Model pModel) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_RemovePackageThumbnailAttachment (pModel); +} + + +Lib3MFResult CCall_lib3mf_model_addcustomcontenttype(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, const char * pExtension, const char * pContentType) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_AddCustomContentType (pModel, pExtension, pContentType); +} + + +Lib3MFResult CCall_lib3mf_model_removecustomcontenttype(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, const char * pExtension) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_RemoveCustomContentType (pModel, pExtension); +} + + +Lib3MFResult CCall_lib3mf_model_setrandomnumbercallback(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MFRandomNumberCallback pTheCallback, Lib3MF_pvoid pUserData) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_SetRandomNumberCallback (pModel, pTheCallback, pUserData); +} + + +Lib3MFResult CCall_lib3mf_model_getkeystore(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_KeyStore * pKeyStore) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_GetKeyStore (pModel, pKeyStore); +} + + +Lib3MFResult CCall_lib3mf_model_createpersistentsourcefromfile(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, const char * pFilename, Lib3MF_PersistentReaderSource * pInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_CreatePersistentSourceFromFile (pModel, pFilename, pInstance); +} + + +Lib3MFResult CCall_lib3mf_model_createpersistentsourcefrombuffer(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer, Lib3MF_PersistentReaderSource * pInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_CreatePersistentSourceFromBuffer (pModel, nBufferBufferSize, pBufferBuffer, pInstance); +} + + +Lib3MFResult CCall_lib3mf_model_createpersistentsourcefromcallback(Lib3MFHandle libraryHandle, Lib3MF_Model pModel, Lib3MFReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MFSeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData, Lib3MF_PersistentReaderSource * pInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Model_CreatePersistentSourceFromCallback (pModel, pTheReadCallback, nStreamSize, pTheSeekCallback, pUserData, pInstance); +} + + +Lib3MFResult CCall_lib3mf_getlibraryversion(Lib3MFHandle libraryHandle, Lib3MF_uint32 * pMajor, Lib3MF_uint32 * pMinor, Lib3MF_uint32 * pMicro) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_GetLibraryVersion (pMajor, pMinor, pMicro); +} + + +Lib3MFResult CCall_lib3mf_getprereleaseinformation(Lib3MFHandle libraryHandle, bool * pHasPrereleaseInfo, const Lib3MF_uint32 nPrereleaseInfoBufferSize, Lib3MF_uint32* pPrereleaseInfoNeededChars, char * pPrereleaseInfoBuffer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_GetPrereleaseInformation (pHasPrereleaseInfo, nPrereleaseInfoBufferSize, pPrereleaseInfoNeededChars, pPrereleaseInfoBuffer); +} + + +Lib3MFResult CCall_lib3mf_getbuildinformation(Lib3MFHandle libraryHandle, bool * pHasBuildInfo, const Lib3MF_uint32 nBuildInformationBufferSize, Lib3MF_uint32* pBuildInformationNeededChars, char * pBuildInformationBuffer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_GetBuildInformation (pHasBuildInfo, nBuildInformationBufferSize, pBuildInformationNeededChars, pBuildInformationBuffer); +} + + +Lib3MFResult CCall_lib3mf_getspecificationversion(Lib3MFHandle libraryHandle, const char * pSpecificationURL, bool * pIsSupported, Lib3MF_uint32 * pMajor, Lib3MF_uint32 * pMinor, Lib3MF_uint32 * pMicro) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_GetSpecificationVersion (pSpecificationURL, pIsSupported, pMajor, pMinor, pMicro); +} + + +Lib3MFResult CCall_lib3mf_createmodel(Lib3MFHandle libraryHandle, Lib3MF_Model * pModel) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_CreateModel (pModel); +} + + +Lib3MFResult CCall_lib3mf_release(Lib3MFHandle libraryHandle, Lib3MF_Base pInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Release (pInstance); +} + + +Lib3MFResult CCall_lib3mf_acquire(Lib3MFHandle libraryHandle, Lib3MF_Base pInstance) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_Acquire (pInstance); +} + + +Lib3MFResult CCall_lib3mf_setjournal(Lib3MFHandle libraryHandle, const char * pJournalPath) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_SetJournal (pJournalPath); +} + + +Lib3MFResult CCall_lib3mf_getlasterror(Lib3MFHandle libraryHandle, Lib3MF_Base pInstance, const Lib3MF_uint32 nLastErrorStringBufferSize, Lib3MF_uint32* pLastErrorStringNeededChars, char * pLastErrorStringBuffer, bool * pHasLastError) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_GetLastError (pInstance, nLastErrorStringBufferSize, pLastErrorStringNeededChars, pLastErrorStringBuffer, pHasLastError); +} + + +Lib3MFResult CCall_lib3mf_getsymbollookupmethod(Lib3MFHandle libraryHandle, Lib3MF_pvoid * pSymbolLookupMethod) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_GetSymbolLookupMethod (pSymbolLookupMethod); +} + + +Lib3MFResult CCall_lib3mf_retrieveprogressmessage(Lib3MFHandle libraryHandle, eLib3MFProgressIdentifier eTheProgressIdentifier, const Lib3MF_uint32 nProgressMessageBufferSize, Lib3MF_uint32* pProgressMessageNeededChars, char * pProgressMessageBuffer) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_RetrieveProgressMessage (eTheProgressIdentifier, nProgressMessageBufferSize, pProgressMessageNeededChars, pProgressMessageBuffer); +} + + +Lib3MFResult CCall_lib3mf_rgbatocolor(Lib3MFHandle libraryHandle, Lib3MF_uint8 nRed, Lib3MF_uint8 nGreen, Lib3MF_uint8 nBlue, Lib3MF_uint8 nAlpha, sLib3MFColor * pTheColor) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_RGBAToColor (nRed, nGreen, nBlue, nAlpha, pTheColor); +} + + +Lib3MFResult CCall_lib3mf_floatrgbatocolor(Lib3MFHandle libraryHandle, Lib3MF_single fRed, Lib3MF_single fGreen, Lib3MF_single fBlue, Lib3MF_single fAlpha, sLib3MFColor * pTheColor) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_FloatRGBAToColor (fRed, fGreen, fBlue, fAlpha, pTheColor); +} + + +Lib3MFResult CCall_lib3mf_colortorgba(Lib3MFHandle libraryHandle, const sLib3MFColor * pTheColor, Lib3MF_uint8 * pRed, Lib3MF_uint8 * pGreen, Lib3MF_uint8 * pBlue, Lib3MF_uint8 * pAlpha) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_ColorToRGBA (pTheColor, pRed, pGreen, pBlue, pAlpha); +} + + +Lib3MFResult CCall_lib3mf_colortofloatrgba(Lib3MFHandle libraryHandle, const sLib3MFColor * pTheColor, Lib3MF_single * pRed, Lib3MF_single * pGreen, Lib3MF_single * pBlue, Lib3MF_single * pAlpha) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_ColorToFloatRGBA (pTheColor, pRed, pGreen, pBlue, pAlpha); +} + + +Lib3MFResult CCall_lib3mf_getidentitytransform(Lib3MFHandle libraryHandle, sLib3MFTransform * pTransform) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_GetIdentityTransform (pTransform); +} + + +Lib3MFResult CCall_lib3mf_getuniformscaletransform(Lib3MFHandle libraryHandle, Lib3MF_single fFactor, sLib3MFTransform * pTransform) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_GetUniformScaleTransform (fFactor, pTransform); +} + + +Lib3MFResult CCall_lib3mf_getscaletransform(Lib3MFHandle libraryHandle, Lib3MF_single fFactorX, Lib3MF_single fFactorY, Lib3MF_single fFactorZ, sLib3MFTransform * pTransform) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_GetScaleTransform (fFactorX, fFactorY, fFactorZ, pTransform); +} + + +Lib3MFResult CCall_lib3mf_gettranslationtransform(Lib3MFHandle libraryHandle, Lib3MF_single fVectorX, Lib3MF_single fVectorY, Lib3MF_single fVectorZ, sLib3MFTransform * pTransform) +{ + if (libraryHandle == 0) + return LIB3MF_ERROR_INVALIDCAST; + sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle; + return wrapperTable->m_GetTranslationTransform (fVectorX, fVectorY, fVectorZ, pTransform); +} + +*/ +import "C" + +import ( + "fmt" + "unsafe" + "runtime" +) + +type ref = C.Lib3MFHandle + + +// PropertyType represents a Lib3MF enum. +type PropertyType int + +const ( + PropertyType_NoPropertyType = 0 + PropertyType_BaseMaterial = 1 + PropertyType_TexCoord = 2 + PropertyType_Colors = 3 + PropertyType_Composite = 4 + PropertyType_Multi = 5 +) + +// SlicesMeshResolution represents a Lib3MF enum. +type SlicesMeshResolution int + +const ( + SlicesMeshResolution_Fullres = 0 + SlicesMeshResolution_Lowres = 1 +) + +// PersistentReaderSourceType represents a Lib3MF enum. +type PersistentReaderSourceType int + +const ( + PersistentReaderSourceType_Unknown = 0 + PersistentReaderSourceType_FileOnDisk = 1 + PersistentReaderSourceType_MemoryBuffer = 2 + PersistentReaderSourceType_Callback = 3 +) + +// ModelUnit represents a Lib3MF enum. +type ModelUnit int + +const ( + ModelUnit_MicroMeter = 0 + ModelUnit_MilliMeter = 1 + ModelUnit_CentiMeter = 2 + ModelUnit_Inch = 3 + ModelUnit_Foot = 4 + ModelUnit_Meter = 5 +) + +// ObjectType represents a Lib3MF enum. +type ObjectType int + +const ( + ObjectType_Other = 0 + ObjectType_Model = 1 + ObjectType_Support = 2 + ObjectType_SolidSupport = 3 +) + +// TextureType represents a Lib3MF enum. +type TextureType int + +const ( + TextureType_Unknown = 0 + TextureType_PNG = 1 + TextureType_JPEG = 2 +) + +// TextureTileStyle represents a Lib3MF enum. +type TextureTileStyle int + +const ( + TextureTileStyle_Wrap = 0 + TextureTileStyle_Mirror = 1 + TextureTileStyle_Clamp = 2 + TextureTileStyle_NoTileStyle = 3 +) + +// TextureFilter represents a Lib3MF enum. +type TextureFilter int + +const ( + TextureFilter_Auto = 0 + TextureFilter_Linear = 1 + TextureFilter_Nearest = 2 +) + +// BeamLatticeCapMode represents a Lib3MF enum. +type BeamLatticeCapMode int + +const ( + BeamLatticeCapMode_Sphere = 0 + BeamLatticeCapMode_HemiSphere = 1 BeamLatticeCapMode_Butt = 2 ) -// BeamLatticeClipMode represents a Lib3MF enum. -type BeamLatticeClipMode int +// BeamLatticeClipMode represents a Lib3MF enum. +type BeamLatticeClipMode int + +const ( + BeamLatticeClipMode_NoClipMode = 0 + BeamLatticeClipMode_Inside = 1 + BeamLatticeClipMode_Outside = 2 +) + +// BeamLatticeBallMode represents a Lib3MF enum. +type BeamLatticeBallMode int + +const ( + BeamLatticeBallMode_None = 0 + BeamLatticeBallMode_Mixed = 1 + BeamLatticeBallMode_All = 2 +) + +// BinaryStreamPredictionType represents a Lib3MF enum. +type BinaryStreamPredictionType int + +const ( + BinaryStreamPredictionType_NoPrediction = 0 + BinaryStreamPredictionType_DeltaPrediction = 1 +) + +// ProgressIdentifier represents a Lib3MF enum. +type ProgressIdentifier int + +const ( + ProgressIdentifier_QUERYCANCELED = 0 + ProgressIdentifier_DONE = 1 + ProgressIdentifier_CLEANUP = 2 + ProgressIdentifier_READSTREAM = 3 + ProgressIdentifier_EXTRACTOPCPACKAGE = 4 + ProgressIdentifier_READNONROOTMODELS = 5 + ProgressIdentifier_READROOTMODEL = 6 + ProgressIdentifier_READRESOURCES = 7 + ProgressIdentifier_READMESH = 8 + ProgressIdentifier_READSLICES = 9 + ProgressIdentifier_READBUILD = 10 + ProgressIdentifier_READCUSTOMATTACHMENT = 11 + ProgressIdentifier_READTEXTURETACHMENTS = 12 + ProgressIdentifier_CREATEOPCPACKAGE = 13 + ProgressIdentifier_WRITEMODELSTOSTREAM = 14 + ProgressIdentifier_WRITEROOTMODEL = 15 + ProgressIdentifier_WRITENONROOTMODELS = 16 + ProgressIdentifier_WRITEATTACHMENTS = 17 + ProgressIdentifier_WRITECONTENTTYPES = 18 + ProgressIdentifier_WRITENOBJECTS = 19 + ProgressIdentifier_WRITENODES = 20 + ProgressIdentifier_WRITETRIANGLES = 21 + ProgressIdentifier_WRITESLICES = 22 + ProgressIdentifier_WRITEKEYSTORE = 23 +) + +// BlendMethod represents a Lib3MF enum. +type BlendMethod int + +const ( + BlendMethod_NoBlendMethod = 0 + BlendMethod_Mix = 1 + BlendMethod_Multiply = 2 +) + +// ToolpathSegmentType represents a Lib3MF enum. +type ToolpathSegmentType int + +const ( + ToolpathSegmentType_Unknown = 0 + ToolpathSegmentType_Hatch = 1 + ToolpathSegmentType_Loop = 2 + ToolpathSegmentType_Polyline = 3 +) + +// ToolpathAttributeType represents a Lib3MF enum. +type ToolpathAttributeType int + +const ( + ToolpathAttributeType_Unknown = 0 + ToolpathAttributeType_Integer = 1 + ToolpathAttributeType_Double = 2 +) + +// EncryptionAlgorithm represents a Lib3MF enum. +type EncryptionAlgorithm int + +const ( + EncryptionAlgorithm_AES256_GCM = 1 +) + +// WrappingAlgorithm represents a Lib3MF enum. +type WrappingAlgorithm int + +const ( + WrappingAlgorithm_RSA_OAEP = 0 +) + +// MgfAlgorithm represents a Lib3MF enum. +type MgfAlgorithm int + +const ( + MgfAlgorithm_MGF1_SHA1 = 160 + MgfAlgorithm_MGF1_SHA224 = 224 + MgfAlgorithm_MGF1_SHA256 = 256 + MgfAlgorithm_MGF1_SHA384 = 384 + MgfAlgorithm_MGF1_SHA512 = 512 +) + +// DigestMethod represents a Lib3MF enum. +type DigestMethod int + +const ( + DigestMethod_SHA1 = 160 + DigestMethod_SHA256 = 256 +) + +// Compression represents a Lib3MF enum. +type Compression int + +const ( + Compression_NoCompression = 0 + Compression_Deflate = 1 +) + +// Triangle represents a Lib3MF struct. +type Triangle struct { + Indices[3] uint32 +} + +// TriangleProperties represents a Lib3MF struct. +type TriangleProperties struct { + ResourceID uint32 + PropertyIDs[3] uint32 +} + +// Position represents a Lib3MF struct. +type Position struct { + Coordinates[3] float32 +} + +// Position2D represents a Lib3MF struct. +type Position2D struct { + Coordinates[2] float32 +} + +// CompositeConstituent represents a Lib3MF struct. +type CompositeConstituent struct { + PropertyID uint32 + MixingRatio float64 +} + +// MultiPropertyLayer represents a Lib3MF struct. +type MultiPropertyLayer struct { + ResourceID uint32 + TheBlendMethod BlendMethod +} + +// Tex2Coord represents a Lib3MF struct. +type Tex2Coord struct { + U float64 + V float64 +} + +// Transform represents a Lib3MF struct. +type Transform struct { + Fields[4][3] float32 +} + +// Box represents a Lib3MF struct. +type Box struct { + MinCoordinate[3] float32 + MaxCoordinate[3] float32 +} + +// Color represents a Lib3MF struct. +type Color struct { + Red uint8 + Green uint8 + Blue uint8 + Alpha uint8 +} + +// Beam represents a Lib3MF struct. +type Beam struct { + Indices[2] uint32 + Radii[2] float64 + CapModes[2] BeamLatticeCapMode +} + +// Ball represents a Lib3MF struct. +type Ball struct { + Index uint32 + Radius float64 +} + +// Error constants for Lib3MF. +const LIB3MF_ERROR_NOTIMPLEMENTED = 1; +const LIB3MF_ERROR_INVALIDPARAM = 2; +const LIB3MF_ERROR_INVALIDCAST = 3; +const LIB3MF_ERROR_BUFFERTOOSMALL = 4; +const LIB3MF_ERROR_GENERICEXCEPTION = 5; +const LIB3MF_ERROR_COULDNOTLOADLIBRARY = 6; +const LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT = 7; +const LIB3MF_ERROR_INCOMPATIBLEBINARYVERSION = 8; +const LIB3MF_ERROR_CALCULATIONABORTED = 10; +const LIB3MF_ERROR_SHOULDNOTBECALLED = 11; +const LIB3MF_ERROR_READERCLASSUNKNOWN = 100; +const LIB3MF_ERROR_WRITERCLASSUNKNOWN = 101; +const LIB3MF_ERROR_ITERATORINVALIDINDEX = 102; +const LIB3MF_ERROR_INVALIDMODELRESOURCE = 103; +const LIB3MF_ERROR_RESOURCENOTFOUND = 104; +const LIB3MF_ERROR_INVALIDMODEL = 105; +const LIB3MF_ERROR_INVALIDOBJECT = 106; +const LIB3MF_ERROR_INVALIDMESHOBJECT = 107; +const LIB3MF_ERROR_INVALIDCOMPONENTSOBJECT = 108; +const LIB3MF_ERROR_INVALIDCOMPONENT = 109; +const LIB3MF_ERROR_INVALIDBUILDITEM = 110; +const LIB3MF_ERROR_INVALIDBASEMATERIALGROUP = 111; +const LIB3MF_ERROR_INVALIDSLICESTACKRESOURCE = 112; +const LIB3MF_ERROR_INVALIDTEXTURERESOURCE = 113; +const LIB3MF_ERROR_INVALIDCOLORGROUP = 114; +const LIB3MF_ERROR_INVALIDTEXTURE2DGROUP = 115; +const LIB3MF_ERROR_INVALIDCOMPOSITEMATERIALS = 116; +const LIB3MF_ERROR_INVALIDMULTIPROPERTYGROUP = 117; +const LIB3MF_ERROR_INVALIDRESOURCEINDEX = 120; +const LIB3MF_ERROR_ATTACHMENTNOTFOUND = 121; +const LIB3MF_ERROR_FORBIDDENCYCLICREFERENCE = 130; +const LIB3MF_ERROR_INVALIDATTACHMENTSTREAM = 131; +const LIB3MF_ERROR_INVALIDPROPERTYCOUNT = 132; +const LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER = 140; +const LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT = 141; +const LIB3MF_ERROR_INVALIDRESOURCE = 142; +const LIB3MF_ERROR_INVALIDNODEINDEX = 143; +const LIB3MF_ERROR_INVALIDATTRIBUTEINDEX = 144; +const LIB3MF_ERROR_DUPLICATECUSTOMDATA = 145; +const LIB3MF_ERROR_CUSTOMDATANOTFOUND = 146; +const LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE = 2000; +const LIB3MF_ERROR_INVALIDKEYSTORE = 3000; +const LIB3MF_ERROR_INVALIDKEYSTORECONSUMER = 3001; +const LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND = 3002; +const LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND = 3003; +const LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED = 3004; +const LIB3MF_ERROR_INVALIDKEYSIZE = 3005; +const LIB3MF_ERROR_TOOLPATH_NOTWRITINGHEADER = 4000; +const LIB3MF_ERROR_TOOLPATH_NOTWRITINGDATA = 4001; +const LIB3MF_ERROR_TOOLPATH_DATAHASBEENWRITTEN = 4002; +const LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT = 4003; +const LIB3MF_ERROR_TOOLPATH_ATTRIBUTEALREADYDEFINED = 4004; +const LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE = 4005; +const LIB3MF_ERROR_EMPTYNAMESPACEPREFIX = 4006; +const LIB3MF_ERROR_EMPTYNAMESPACE = 4007; +const LIB3MF_ERROR_INVALIDNAMESPACEPREFIX = 4008; +const LIB3MF_ERROR_WRITERDOESNOTSUPPORTNAMESPACES = 4009; + +// WrappedError is an error that wraps a Lib3MF error. +type WrappedError struct { + Code uint32 + Message string +} + +func (e *WrappedError) Error() string { + return fmt.Sprintf("lib3mf: %s (%d)", e.Message, e.Code) +} + +func errorMessage(errorcode uint32) string { + switch (errorcode) { + case LIB3MF_ERROR_NOTIMPLEMENTED: + return "functionality not implemented"; + case LIB3MF_ERROR_INVALIDPARAM: + return "an invalid parameter was passed"; + case LIB3MF_ERROR_INVALIDCAST: + return "a type cast failed"; + case LIB3MF_ERROR_BUFFERTOOSMALL: + return "a provided buffer is too small"; + case LIB3MF_ERROR_GENERICEXCEPTION: + return "a generic exception occurred"; + case LIB3MF_ERROR_COULDNOTLOADLIBRARY: + return "the library could not be loaded"; + case LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT: + return "a required exported symbol could not be found in the library"; + case LIB3MF_ERROR_INCOMPATIBLEBINARYVERSION: + return "the version of the binary interface does not match the bindings interface"; + case LIB3MF_ERROR_CALCULATIONABORTED: + return "a calculation has been aborted"; + case LIB3MF_ERROR_SHOULDNOTBECALLED: + return "functionality should not be called"; + case LIB3MF_ERROR_READERCLASSUNKNOWN: + return "the queried reader class is unknown"; + case LIB3MF_ERROR_WRITERCLASSUNKNOWN: + return "the queried writer class is unknown"; + case LIB3MF_ERROR_ITERATORINVALIDINDEX: + return "the current index of an iterator is invalid"; + case LIB3MF_ERROR_INVALIDMODELRESOURCE: + return "no Model Resource has been given"; + case LIB3MF_ERROR_RESOURCENOTFOUND: + return "Resource not found"; + case LIB3MF_ERROR_INVALIDMODEL: + return "A model is invalid"; + case LIB3MF_ERROR_INVALIDOBJECT: + return "An object is invalid"; + case LIB3MF_ERROR_INVALIDMESHOBJECT: + return "A mesh object is invalid"; + case LIB3MF_ERROR_INVALIDCOMPONENTSOBJECT: + return "A components object is invalid"; + case LIB3MF_ERROR_INVALIDCOMPONENT: + return "A component is invalid"; + case LIB3MF_ERROR_INVALIDBUILDITEM: + return "A build item is invalid"; + case LIB3MF_ERROR_INVALIDBASEMATERIALGROUP: + return "A basematerialgroup is invalid"; + case LIB3MF_ERROR_INVALIDSLICESTACKRESOURCE: + return "A slicestack resource is invalid"; + case LIB3MF_ERROR_INVALIDTEXTURERESOURCE: + return "A texture resource is invalid"; + case LIB3MF_ERROR_INVALIDCOLORGROUP: + return "A color group resource is invalid"; + case LIB3MF_ERROR_INVALIDTEXTURE2DGROUP: + return "A texture2d group resource is invalid"; + case LIB3MF_ERROR_INVALIDCOMPOSITEMATERIALS: + return "A composite materials resource is invalid"; + case LIB3MF_ERROR_INVALIDMULTIPROPERTYGROUP: + return "A MultiPropertyGroup resource is invalid"; + case LIB3MF_ERROR_INVALIDRESOURCEINDEX: + return "A resource index is invalid"; + case LIB3MF_ERROR_ATTACHMENTNOTFOUND: + return "Attachment not found"; + case LIB3MF_ERROR_FORBIDDENCYCLICREFERENCE: + return "A component references one of its ancestors"; + case LIB3MF_ERROR_INVALIDATTACHMENTSTREAM: + return "An attachment stream is invalid"; + case LIB3MF_ERROR_INVALIDPROPERTYCOUNT: + return "Invalid property count."; + case LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER: + return "A progress identifier is unknown"; + case LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT: + return "An element buffer exceeds its spec limit"; + case LIB3MF_ERROR_INVALIDRESOURCE: + return "A resource is invalid"; + case LIB3MF_ERROR_INVALIDNODEINDEX: + return "Invalid node index"; + case LIB3MF_ERROR_INVALIDATTRIBUTEINDEX: + return "Invalid attribute index"; + case LIB3MF_ERROR_DUPLICATECUSTOMDATA: + return "Duplicate custom data"; + case LIB3MF_ERROR_CUSTOMDATANOTFOUND: + return "Custom data not found"; + case LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE: + return "This object type is not valid for beamlattices"; + case LIB3MF_ERROR_INVALIDKEYSTORE: + return "The keystore object is invalid"; + case LIB3MF_ERROR_INVALIDKEYSTORECONSUMER: + return "The consumer keystore object is invalid"; + case LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND: + return "A consumer has not been found"; + case LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND: + return "A resource data has not been found"; + case LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED: + return "A Key or Conentent encryption callback has not been registered"; + case LIB3MF_ERROR_INVALIDKEYSIZE: + return "The key size is invalid"; + case LIB3MF_ERROR_TOOLPATH_NOTWRITINGHEADER: + return "Not in toolpath header writing mode"; + case LIB3MF_ERROR_TOOLPATH_NOTWRITINGDATA: + return "Not in toolpath data writing mode"; + case LIB3MF_ERROR_TOOLPATH_DATAHASBEENWRITTEN: + return "Toolpath has already been written out"; + case LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT: + return "Toolpath has an invalid number of points"; + case LIB3MF_ERROR_TOOLPATH_ATTRIBUTEALREADYDEFINED: + return "Toolpath attribute already defined"; + case LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE: + return "Toolpath attribute is of invalid type"; + case LIB3MF_ERROR_EMPTYNAMESPACEPREFIX: + return "Empty namespace prefix."; + case LIB3MF_ERROR_EMPTYNAMESPACE: + return "Empty namespace."; + case LIB3MF_ERROR_INVALIDNAMESPACEPREFIX: + return "Invalid namespace prefix."; + case LIB3MF_ERROR_WRITERDOESNOTSUPPORTNAMESPACES: + return "Writer does not support namespaces."; + default: + return "unknown"; + } +} + +func makeError(errorcode uint32) error { + return &WrappedError{errorcode, errorMessage(uint32(errorcode))} +} + +// ProgressCallbackFunc a callback function. +type ProgressCallbackFunc = func(abort *bool, progressValue float64, progressIdentifier ProgressIdentifier, userData uintptr) + +var progressCallbackFunc ProgressCallbackFunc + +//export progressCallback +func progressCallback(abort *C.bool, progressValue C.double, progressIdentifier C.eLib3MFProgressIdentifier, userData C.Lib3MF_pvoid) { + if progressCallbackFunc == nil { + return + } + progressCallbackFunc((*bool)(abort), float64(progressValue), ProgressIdentifier(progressIdentifier), uintptr(userData)) +} + +// WriteCallbackFunc callback to call for writing a data chunk. +type WriteCallbackFunc = func(byteData uint64, numBytes uint64, userData uintptr) + +var writeCallbackFunc WriteCallbackFunc + +//export writeCallback +func writeCallback(byteData C.uint64_t, numBytes C.uint64_t, userData C.Lib3MF_pvoid) { + if writeCallbackFunc == nil { + return + } + writeCallbackFunc(uint64(byteData), uint64(numBytes), uintptr(userData)) +} + +// ReadCallbackFunc callback to call for reading a data chunk. +type ReadCallbackFunc = func(byteData uint64, numBytes uint64, userData uintptr) + +var readCallbackFunc ReadCallbackFunc + +//export readCallback +func readCallback(byteData C.uint64_t, numBytes C.uint64_t, userData C.Lib3MF_pvoid) { + if readCallbackFunc == nil { + return + } + readCallbackFunc(uint64(byteData), uint64(numBytes), uintptr(userData)) +} + +// SeekCallbackFunc callback to call for seeking in the stream. +type SeekCallbackFunc = func(position uint64, userData uintptr) + +var seekCallbackFunc SeekCallbackFunc + +//export seekCallback +func seekCallback(position C.uint64_t, userData C.Lib3MF_pvoid) { + if seekCallbackFunc == nil { + return + } + seekCallbackFunc(uint64(position), uintptr(userData)) +} + +// RandomNumberCallbackFunc callback to generate random numbers. +type RandomNumberCallbackFunc = func(byteData uint64, numBytes uint64, userData uintptr, bytesWritten *uint64) + +var randomNumberCallbackFunc RandomNumberCallbackFunc + +//export randomNumberCallback +func randomNumberCallback(byteData C.uint64_t, numBytes C.uint64_t, userData C.Lib3MF_pvoid, bytesWritten *C.uint64_t) { + if randomNumberCallbackFunc == nil { + return + } + randomNumberCallbackFunc(uint64(byteData), uint64(numBytes), uintptr(userData), (*uint64)(bytesWritten)) +} + +// KeyWrappingCallbackFunc a callback used to wrap (encrypt) the content key available in keystore resource group. +type KeyWrappingCallbackFunc = func(kEKParams AccessRight, inBuffer []uint8, outBuffer []uint8, userData uintptr, status *uint64) + +var keyWrappingCallbackFunc KeyWrappingCallbackFunc + +//export keyWrappingCallback +func keyWrappingCallback(kEKParams C.Lib3MF_AccessRight, inBuffer *C.uint8_t, outBuffer *C.uint8_t, userData C.Lib3MF_pvoid, status *C.uint64_t) { + if keyWrappingCallbackFunc == nil { + return + } + keyWrappingCallbackFunc(, ([][]uint8)(unsafe.Pointer(&inBuffer[0])), ([][]uint8)(unsafe.Pointer(&outBuffer[0])), uintptr(userData), (*uint64)(status)) +} + +// ContentEncryptionCallbackFunc 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. +type ContentEncryptionCallbackFunc = func(cEKParams ContentEncryptionParams, input []uint8, output []uint8, userData uintptr, status *uint64) + +var contentEncryptionCallbackFunc ContentEncryptionCallbackFunc + +//export contentEncryptionCallback +func contentEncryptionCallback(cEKParams C.Lib3MF_ContentEncryptionParams, input *C.uint8_t, output *C.uint8_t, userData C.Lib3MF_pvoid, status *C.uint64_t) { + if contentEncryptionCallbackFunc == nil { + return + } + contentEncryptionCallbackFunc(, ([][]uint8)(unsafe.Pointer(&input[0])), ([][]uint8)(unsafe.Pointer(&output[0])), uintptr(userData), (*uint64)(status)) +} + +// Wrapper represents the number wrapper +type Wrapper struct { + _ [0]func() // uncomparable; to make == not compile + LibraryHandle ref +} + +// Base represents a Lib3MF class. +type Base struct { + _ [0]func() // uncomparable; to make == not compile + Ref ref // identifies a C value, see ref type + wrapperRef Wrapper + gcPtr *ref // used to trigger the finalizer when the Value is not referenced any more +} + +// NewBase creates a new Base. +// The wrapped C pointer will be freed when the Go pointer is finalized, +// but one can release it manually calling Release. +func (wrapper Wrapper) NewBase(r ref) Base { + gcPtr := new(ref) + *gcPtr = r + runtime.SetFinalizer(gcPtr, wrapper.releaseC) + return Base{Ref: r, gcPtr: gcPtr, wrapperRef: wrapper} +} + +// Release releases the C pointer. +func (inst Base) Release() error { + err := inst.wrapperRef.Release(inst) + *inst.gcPtr = nil + return err +} + +// Equal reports whether inst and w refer to the same C pointer. +func (inst Base) Equal(w Base) bool { + return inst.Ref == w.Ref +} +// ClassTypeId get Class Type Id. +func (inst Base) ClassTypeId() (uint64, error) { + var classTypeId C.uint64_t + ret := C.CCall_lib3mf_base_classtypeid(inst.wrapperRef.LibraryHandle, inst.Ref, &classTypeId) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return uint64(classTypeId), nil +} + + +// BinaryStream represents a Lib3MF class. +type BinaryStream struct { + Base +} + +func (wrapper Wrapper) NewBinaryStream(r ref) BinaryStream { + return BinaryStream{wrapper.NewBase(r)} +} + +// GetBinaryPath retrieves an binary streams package path for the binary data. +func (inst BinaryStream) GetBinaryPath() (string, error) { + var neededforpath C.uint32_t + var filledinpath C.uint32_t + ret := C.CCall_lib3mf_binarystream_getbinarypath(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforpath, nil) + if ret != 0 { + return "", makeError(uint32(ret)) + } + bufferSizepath := neededforpath + bufferpath := make([]byte, bufferSizepath) + ret = C.CCall_lib3mf_binarystream_getbinarypath(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizepath, &filledinpath, (*C.char)(unsafe.Pointer(&bufferpath[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(bufferpath[:(filledinpath-1)]), nil +} + +// GetIndexPath retrieves an binary streams package path for the index data. +func (inst BinaryStream) GetIndexPath() (string, error) { + var neededforpath C.uint32_t + var filledinpath C.uint32_t + ret := C.CCall_lib3mf_binarystream_getindexpath(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforpath, nil) + if ret != 0 { + return "", makeError(uint32(ret)) + } + bufferSizepath := neededforpath + bufferpath := make([]byte, bufferSizepath) + ret = C.CCall_lib3mf_binarystream_getindexpath(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizepath, &filledinpath, (*C.char)(unsafe.Pointer(&bufferpath[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(bufferpath[:(filledinpath-1)]), nil +} + +// GetUUID retrieves an binary streams uuid. +func (inst BinaryStream) GetUUID() (string, error) { + var neededforuUID C.uint32_t + var filledinuUID C.uint32_t + ret := C.CCall_lib3mf_binarystream_getuuid(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforuUID, nil) + if ret != 0 { + return "", makeError(uint32(ret)) + } + bufferSizeuUID := neededforuUID + bufferuUID := make([]byte, bufferSizeuUID) + ret = C.CCall_lib3mf_binarystream_getuuid(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizeuUID, &filledinuUID, (*C.char)(unsafe.Pointer(&bufferuUID[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(bufferuUID[:(filledinuUID-1)]), nil +} + +// DisableDiscretizedArrayCompression sets the float compression mode to raw. All subsequent writes will adhere to this mode. +func (inst BinaryStream) DisableDiscretizedArrayCompression() error { + ret := C.CCall_lib3mf_binarystream_disablediscretizedarraycompression(inst.wrapperRef.LibraryHandle, inst.Ref) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// EnableDiscretizedArrayCompression sets the compression mode to a quantized array. All subsequent writes will adhere to this mode. +func (inst BinaryStream) EnableDiscretizedArrayCompression(units float64, predictionType BinaryStreamPredictionType) error { + ret := C.CCall_lib3mf_binarystream_enablediscretizedarraycompression(inst.wrapperRef.LibraryHandle, inst.Ref, C.double(units), C.eLib3MFBinaryStreamPredictionType(predictionType)) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// EnableLZMA enables LZMA mode. +func (inst BinaryStream) EnableLZMA(lZMALevel uint32) error { + ret := C.CCall_lib3mf_binarystream_enablelzma(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(lZMALevel)) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// DisableLZMA disables LZMA mode. +func (inst BinaryStream) DisableLZMA() error { + ret := C.CCall_lib3mf_binarystream_disablelzma(inst.wrapperRef.LibraryHandle, inst.Ref) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + + +// Writer represents a Lib3MF class. +type Writer struct { + Base +} + +func (wrapper Wrapper) NewWriter(r ref) Writer { + return Writer{wrapper.NewBase(r)} +} + +// WriteToFile writes out the model as file. The file type is specified by the Model Writer class. +func (inst Writer) WriteToFile(filename string) error { + ret := C.CCall_lib3mf_writer_writetofile(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(filename)[0]))) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// GetStreamSize retrieves the size of the full 3MF file stream. +func (inst Writer) GetStreamSize() (uint64, error) { + var streamSize C.uint64_t + ret := C.CCall_lib3mf_writer_getstreamsize(inst.wrapperRef.LibraryHandle, inst.Ref, &streamSize) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return uint64(streamSize), nil +} + +// WriteToBuffer writes out the 3MF file into a memory buffer. +func (inst Writer) WriteToBuffer(buffer []uint8) ([]uint8, error) { + var neededforbuffer C.uint64_t + ret := C.CCall_lib3mf_writer_writetobuffer(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforbuffer, nil) + if ret != 0 { + return nil, makeError(uint32(ret)) + } + if len(buffer) < int(neededforbuffer) { + buffer = append(buffer, make([]uint8, int(neededforbuffer)-len(buffer))...) + } + ret = C.CCall_lib3mf_writer_writetobuffer(inst.wrapperRef.LibraryHandle, inst.Ref, neededforbuffer, nil, (*C.uint8_t)(unsafe.Pointer(&buffer[0]))) + if ret != 0 { + return nil, makeError(uint32(ret)) + } + return buffer[:int(neededforbuffer)], nil +} + +// WriteToCallback writes out the model and passes the data to a provided callback function. The file type is specified by the Model Writer class. +func (inst Writer) WriteToCallback(theWriteCallback WriteCallbackFunc, theSeekCallback SeekCallbackFunc, userData uintptr) error { + ret := C.CCall_lib3mf_writer_writetocallback(inst.wrapperRef.LibraryHandle, inst.Ref, (C.Lib3MFWriteCallback)(unsafe.Pointer(C.Lib3MFWriteCallback_cgo)), (C.Lib3MFSeekCallback)(unsafe.Pointer(C.Lib3MFSeekCallback_cgo)), (C.Lib3MF_pvoid)(userData)) + if ret != 0 { + return makeError(uint32(ret)) + } + writeCallbackFunc = theWriteCallback + seekCallbackFunc = theSeekCallback + return nil +} + +// SetProgressCallback set the progress callback for calls to this writer. +func (inst Writer) SetProgressCallback(progressCallback ProgressCallbackFunc, userData uintptr) error { + ret := C.CCall_lib3mf_writer_setprogresscallback(inst.wrapperRef.LibraryHandle, inst.Ref, (C.Lib3MFProgressCallback)(unsafe.Pointer(C.Lib3MFProgressCallback_cgo)), (C.Lib3MF_pvoid)(userData)) + if ret != 0 { + return makeError(uint32(ret)) + } + progressCallbackFunc = progressCallback + return nil +} + +// GetDecimalPrecision returns the number of digits after the decimal point to be written in each vertex coordinate-value. +func (inst Writer) GetDecimalPrecision() (uint32, error) { + var decimalPrecision C.uint32_t + ret := C.CCall_lib3mf_writer_getdecimalprecision(inst.wrapperRef.LibraryHandle, inst.Ref, &decimalPrecision) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return uint32(decimalPrecision), nil +} + +// SetDecimalPrecision sets the number of digits after the decimal point to be written in each vertex coordinate-value. +func (inst Writer) SetDecimalPrecision(decimalPrecision uint32) error { + ret := C.CCall_lib3mf_writer_setdecimalprecision(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(decimalPrecision)) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// SetStrictModeActive activates (deactivates) the strict mode of the reader. +func (inst Writer) SetStrictModeActive(strictModeActive bool) error { + ret := C.CCall_lib3mf_writer_setstrictmodeactive(inst.wrapperRef.LibraryHandle, inst.Ref, C.bool(strictModeActive)) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// GetStrictModeActive queries whether the strict mode of the reader is active or not. +func (inst Writer) GetStrictModeActive() (bool, error) { + var strictModeActive C.bool + ret := C.CCall_lib3mf_writer_getstrictmodeactive(inst.wrapperRef.LibraryHandle, inst.Ref, &strictModeActive) + if ret != 0 { + return false, makeError(uint32(ret)) + } + return bool(strictModeActive), nil +} + +// GetWarning returns Warning and Error Information of the read process. +func (inst Writer) GetWarning(index uint32) (uint32, string, error) { + var errorCode C.uint32_t + var neededforwarning C.uint32_t + var filledinwarning C.uint32_t + ret := C.CCall_lib3mf_writer_getwarning(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &errorCode, 0, &neededforwarning, nil) + if ret != 0 { + return 0, "", makeError(uint32(ret)) + } + bufferSizewarning := neededforwarning + bufferwarning := make([]byte, bufferSizewarning) + ret = C.CCall_lib3mf_writer_getwarning(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &errorCode, bufferSizewarning, &filledinwarning, (*C.char)(unsafe.Pointer(&bufferwarning[0]))) + if ret != 0 { + return 0, "", makeError(uint32(ret)) + } + return uint32(errorCode), string(bufferwarning[:(filledinwarning-1)]), nil +} + +// GetWarningCount returns Warning and Error Count of the read process. +func (inst Writer) GetWarningCount() (uint32, error) { + var count C.uint32_t + ret := C.CCall_lib3mf_writer_getwarningcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return uint32(count), nil +} + +// AddKeyWrappingCallback registers a callback to deal with data key encryption/decryption from keystore. +func (inst Writer) AddKeyWrappingCallback(consumerID string, theCallback KeyWrappingCallbackFunc, userData uintptr) error { + ret := C.CCall_lib3mf_writer_addkeywrappingcallback(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(consumerID)[0])), (C.Lib3MFKeyWrappingCallback)(unsafe.Pointer(C.Lib3MFKeyWrappingCallback_cgo)), (C.Lib3MF_pvoid)(userData)) + if ret != 0 { + return makeError(uint32(ret)) + } + keyWrappingCallbackFunc = theCallback + return nil +} + +// SetContentEncryptionCallback registers a callback to deal with encryption of content. +func (inst Writer) SetContentEncryptionCallback(theCallback ContentEncryptionCallbackFunc, userData uintptr) error { + ret := C.CCall_lib3mf_writer_setcontentencryptioncallback(inst.wrapperRef.LibraryHandle, inst.Ref, (C.Lib3MFContentEncryptionCallback)(unsafe.Pointer(C.Lib3MFContentEncryptionCallback_cgo)), (C.Lib3MF_pvoid)(userData)) + if ret != 0 { + return makeError(uint32(ret)) + } + contentEncryptionCallbackFunc = theCallback + return nil +} + +// CreateBinaryStream creates a binary stream object. Only applicable for 3MF Writers. +func (inst Writer) CreateBinaryStream(indexPath string, binaryPath string) (BinaryStream, error) { + var binaryStream ref + ret := C.CCall_lib3mf_writer_createbinarystream(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(indexPath)[0])), (*C.char)(unsafe.Pointer(&[]byte(binaryPath)[0])), &binaryStream) + if ret != 0 { + return BinaryStream{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewBinaryStream(binaryStream), nil +} + +// AssignBinaryStream sets a binary stream for an object. Currently supported objects are Meshes and Toolpath layers. +func (inst Writer) AssignBinaryStream(instance Base, binaryStream BinaryStream) error { + ret := C.CCall_lib3mf_writer_assignbinarystream(inst.wrapperRef.LibraryHandle, inst.Ref, instance.Ref, binaryStream.Ref) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// RegisterCustomNamespace registers a custom 3MF Namespace. Fails if Prefix is already registered. +func (inst Writer) RegisterCustomNamespace(prefix string, nameSpace string) error { + ret := C.CCall_lib3mf_writer_registercustomnamespace(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(prefix)[0])), (*C.char)(unsafe.Pointer(&[]byte(nameSpace)[0]))) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + + +// PersistentReaderSource represents a Lib3MF class. +type PersistentReaderSource struct { + Base +} + +func (wrapper Wrapper) NewPersistentReaderSource(r ref) PersistentReaderSource { + return PersistentReaderSource{wrapper.NewBase(r)} +} + +// GetSourceType retrieves the type of source data. +func (inst PersistentReaderSource) GetSourceType() (PersistentReaderSourceType, error) { + var sourceType C.eLib3MFPersistentReaderSourceType + ret := C.CCall_lib3mf_persistentreadersource_getsourcetype(inst.wrapperRef.LibraryHandle, inst.Ref, &sourceType) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return PersistentReaderSourceType(sourceType), nil +} + +// InvalidateSourceData invalidates the reader source. Every subsequent read on this data will fail. +func (inst PersistentReaderSource) InvalidateSourceData() error { + ret := C.CCall_lib3mf_persistentreadersource_invalidatesourcedata(inst.wrapperRef.LibraryHandle, inst.Ref) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// SourceDataIsValid checks if the source data is valid. Any read on an invalid source object will fail. +func (inst PersistentReaderSource) SourceDataIsValid() (bool, error) { + var dataIsValid C.bool + ret := C.CCall_lib3mf_persistentreadersource_sourcedataisvalid(inst.wrapperRef.LibraryHandle, inst.Ref, &dataIsValid) + if ret != 0 { + return false, makeError(uint32(ret)) + } + return bool(dataIsValid), nil +} + + +// Reader represents a Lib3MF class. +type Reader struct { + Base +} + +func (wrapper Wrapper) NewReader(r ref) Reader { + return Reader{wrapper.NewBase(r)} +} + +// ReadFromPersistentSource reads a model from a persistent source object. The object will be referenced until the Model is destroyed or cleared. +func (inst Reader) ReadFromPersistentSource(source PersistentReaderSource) error { + ret := C.CCall_lib3mf_reader_readfrompersistentsource(inst.wrapperRef.LibraryHandle, inst.Ref, source.Ref) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// ReadFromFile reads a model from a file. The file type is specified by the Model Reader class. +func (inst Reader) ReadFromFile(filename string) error { + ret := C.CCall_lib3mf_reader_readfromfile(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(filename)[0]))) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// ReadFromBuffer reads a model from a memory buffer. +func (inst Reader) ReadFromBuffer(buffer []uint8) error { + ret := C.CCall_lib3mf_reader_readfrombuffer(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(buffer)), (*C.uint8_t)(unsafe.Pointer(&buffer[0]))) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// ReadFromCallback reads a model and from the data provided by a callback function. +func (inst Reader) ReadFromCallback(theReadCallback ReadCallbackFunc, streamSize uint64, theSeekCallback SeekCallbackFunc, userData uintptr) error { + ret := C.CCall_lib3mf_reader_readfromcallback(inst.wrapperRef.LibraryHandle, inst.Ref, (C.Lib3MFReadCallback)(unsafe.Pointer(C.Lib3MFReadCallback_cgo)), C.uint64_t(streamSize), (C.Lib3MFSeekCallback)(unsafe.Pointer(C.Lib3MFSeekCallback_cgo)), (C.Lib3MF_pvoid)(userData)) + if ret != 0 { + return makeError(uint32(ret)) + } + readCallbackFunc = theReadCallback + seekCallbackFunc = theSeekCallback + return nil +} + +// SetProgressCallback set the progress callback for calls to this writer. +func (inst Reader) SetProgressCallback(progressCallback ProgressCallbackFunc, userData uintptr) error { + ret := C.CCall_lib3mf_reader_setprogresscallback(inst.wrapperRef.LibraryHandle, inst.Ref, (C.Lib3MFProgressCallback)(unsafe.Pointer(C.Lib3MFProgressCallback_cgo)), (C.Lib3MF_pvoid)(userData)) + if ret != 0 { + return makeError(uint32(ret)) + } + progressCallbackFunc = progressCallback + return nil +} + +// AddRelationToRead adds a relationship type which shall be read as attachment in memory while loading. +func (inst Reader) AddRelationToRead(relationShipType string) error { + ret := C.CCall_lib3mf_reader_addrelationtoread(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(relationShipType)[0]))) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// RemoveRelationToRead removes a relationship type which shall be read as attachment in memory while loading. +func (inst Reader) RemoveRelationToRead(relationShipType string) error { + ret := C.CCall_lib3mf_reader_removerelationtoread(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(relationShipType)[0]))) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// SetStrictModeActive activates (deactivates) the strict mode of the reader. +func (inst Reader) SetStrictModeActive(strictModeActive bool) error { + ret := C.CCall_lib3mf_reader_setstrictmodeactive(inst.wrapperRef.LibraryHandle, inst.Ref, C.bool(strictModeActive)) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// GetStrictModeActive queries whether the strict mode of the reader is active or not. +func (inst Reader) GetStrictModeActive() (bool, error) { + var strictModeActive C.bool + ret := C.CCall_lib3mf_reader_getstrictmodeactive(inst.wrapperRef.LibraryHandle, inst.Ref, &strictModeActive) + if ret != 0 { + return false, makeError(uint32(ret)) + } + return bool(strictModeActive), nil +} + +// GetWarning returns Warning and Error Information of the read process. +func (inst Reader) GetWarning(index uint32) (uint32, string, error) { + var errorCode C.uint32_t + var neededforwarning C.uint32_t + var filledinwarning C.uint32_t + ret := C.CCall_lib3mf_reader_getwarning(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &errorCode, 0, &neededforwarning, nil) + if ret != 0 { + return 0, "", makeError(uint32(ret)) + } + bufferSizewarning := neededforwarning + bufferwarning := make([]byte, bufferSizewarning) + ret = C.CCall_lib3mf_reader_getwarning(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &errorCode, bufferSizewarning, &filledinwarning, (*C.char)(unsafe.Pointer(&bufferwarning[0]))) + if ret != 0 { + return 0, "", makeError(uint32(ret)) + } + return uint32(errorCode), string(bufferwarning[:(filledinwarning-1)]), nil +} + +// GetWarningCount returns Warning and Error Count of the read process. +func (inst Reader) GetWarningCount() (uint32, error) { + var count C.uint32_t + ret := C.CCall_lib3mf_reader_getwarningcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return uint32(count), nil +} + +// AddKeyWrappingCallback registers a callback to deal with key wrapping mechanism from keystore. +func (inst Reader) AddKeyWrappingCallback(consumerID string, theCallback KeyWrappingCallbackFunc, userData uintptr) error { + ret := C.CCall_lib3mf_reader_addkeywrappingcallback(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(consumerID)[0])), (C.Lib3MFKeyWrappingCallback)(unsafe.Pointer(C.Lib3MFKeyWrappingCallback_cgo)), (C.Lib3MF_pvoid)(userData)) + if ret != 0 { + return makeError(uint32(ret)) + } + keyWrappingCallbackFunc = theCallback + return nil +} + +// SetContentEncryptionCallback registers a callback to deal with encryption of content. +func (inst Reader) SetContentEncryptionCallback(theCallback ContentEncryptionCallbackFunc, userData uintptr) error { + ret := C.CCall_lib3mf_reader_setcontentencryptioncallback(inst.wrapperRef.LibraryHandle, inst.Ref, (C.Lib3MFContentEncryptionCallback)(unsafe.Pointer(C.Lib3MFContentEncryptionCallback_cgo)), (C.Lib3MF_pvoid)(userData)) + if ret != 0 { + return makeError(uint32(ret)) + } + contentEncryptionCallbackFunc = theCallback + return nil +} + + +// PackagePart represents a Lib3MF class. +type PackagePart struct { + Base +} + +func (wrapper Wrapper) NewPackagePart(r ref) PackagePart { + return PackagePart{wrapper.NewBase(r)} +} + +// GetPath returns the absolute path of this PackagePart. +func (inst PackagePart) GetPath() (string, error) { + var neededforpath C.uint32_t + var filledinpath C.uint32_t + ret := C.CCall_lib3mf_packagepart_getpath(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforpath, nil) + if ret != 0 { + return "", makeError(uint32(ret)) + } + bufferSizepath := neededforpath + bufferpath := make([]byte, bufferSizepath) + ret = C.CCall_lib3mf_packagepart_getpath(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizepath, &filledinpath, (*C.char)(unsafe.Pointer(&bufferpath[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(bufferpath[:(filledinpath-1)]), nil +} + +// SetPath sets the absolute path of this PackagePart. +func (inst PackagePart) SetPath(path string) error { + ret := C.CCall_lib3mf_packagepart_setpath(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(path)[0]))) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + + +// Resource represents a Lib3MF class. +type Resource struct { + Base +} + +func (wrapper Wrapper) NewResource(r ref) Resource { + return Resource{wrapper.NewBase(r)} +} + +// GetResourceID retrieves the unique id of this resource within a package. This function will be removed in a later release in favor of GetUniqueResourceID. +func (inst Resource) GetResourceID() (uint32, error) { + var uniqueResourceID C.uint32_t + ret := C.CCall_lib3mf_resource_getresourceid(inst.wrapperRef.LibraryHandle, inst.Ref, &uniqueResourceID) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return uint32(uniqueResourceID), nil +} -const ( - BeamLatticeClipMode_NoClipMode = 0 - BeamLatticeClipMode_Inside = 1 - BeamLatticeClipMode_Outside = 2 -) +// GetUniqueResourceID retrieves the unique id of this resource within a package. +func (inst Resource) GetUniqueResourceID() (uint32, error) { + var uniqueResourceID C.uint32_t + ret := C.CCall_lib3mf_resource_getuniqueresourceid(inst.wrapperRef.LibraryHandle, inst.Ref, &uniqueResourceID) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return uint32(uniqueResourceID), nil +} -// BeamLatticeBallMode represents a Lib3MF enum. -type BeamLatticeBallMode int +// PackagePart returns the PackagePart within which this resource resides. +func (inst Resource) PackagePart() (PackagePart, error) { + var packagePart ref + ret := C.CCall_lib3mf_resource_packagepart(inst.wrapperRef.LibraryHandle, inst.Ref, &packagePart) + if ret != 0 { + return PackagePart{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewPackagePart(packagePart), nil +} -const ( - BeamLatticeBallMode_None = 0 - BeamLatticeBallMode_Mixed = 1 - BeamLatticeBallMode_All = 2 -) +// SetPackagePart sets the new PackagePart within which this resource resides. +func (inst Resource) SetPackagePart(packagePart PackagePart) error { + ret := C.CCall_lib3mf_resource_setpackagepart(inst.wrapperRef.LibraryHandle, inst.Ref, packagePart.Ref) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} -// ProgressIdentifier represents a Lib3MF enum. -type ProgressIdentifier int +// GetModelResourceID retrieves the id of this resource within a model. +func (inst Resource) GetModelResourceID() (uint32, error) { + var modelResourceId C.uint32_t + ret := C.CCall_lib3mf_resource_getmodelresourceid(inst.wrapperRef.LibraryHandle, inst.Ref, &modelResourceId) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return uint32(modelResourceId), nil +} -const ( - ProgressIdentifier_QUERYCANCELED = 0 - ProgressIdentifier_DONE = 1 - ProgressIdentifier_CLEANUP = 2 - ProgressIdentifier_READSTREAM = 3 - ProgressIdentifier_EXTRACTOPCPACKAGE = 4 - ProgressIdentifier_READNONROOTMODELS = 5 - ProgressIdentifier_READROOTMODEL = 6 - ProgressIdentifier_READRESOURCES = 7 - ProgressIdentifier_READMESH = 8 - ProgressIdentifier_READSLICES = 9 - ProgressIdentifier_READBUILD = 10 - ProgressIdentifier_READCUSTOMATTACHMENT = 11 - ProgressIdentifier_READTEXTURETACHMENTS = 12 - ProgressIdentifier_CREATEOPCPACKAGE = 13 - ProgressIdentifier_WRITEMODELSTOSTREAM = 14 - ProgressIdentifier_WRITEROOTMODEL = 15 - ProgressIdentifier_WRITENONROOTMODELS = 16 - ProgressIdentifier_WRITEATTACHMENTS = 17 - ProgressIdentifier_WRITECONTENTTYPES = 18 - ProgressIdentifier_WRITENOBJECTS = 19 - ProgressIdentifier_WRITENODES = 20 - ProgressIdentifier_WRITETRIANGLES = 21 - ProgressIdentifier_WRITESLICES = 22 - ProgressIdentifier_WRITEKEYSTORE = 23 -) -// BlendMethod represents a Lib3MF enum. -type BlendMethod int +// ResourceIterator represents a Lib3MF class. +type ResourceIterator struct { + Base +} + +func (wrapper Wrapper) NewResourceIterator(r ref) ResourceIterator { + return ResourceIterator{wrapper.NewBase(r)} +} + +// MoveNext iterates to the next resource in the list. +func (inst ResourceIterator) MoveNext() (bool, error) { + var hasNext C.bool + ret := C.CCall_lib3mf_resourceiterator_movenext(inst.wrapperRef.LibraryHandle, inst.Ref, &hasNext) + if ret != 0 { + return false, makeError(uint32(ret)) + } + return bool(hasNext), nil +} + +// MovePrevious iterates to the previous resource in the list. +func (inst ResourceIterator) MovePrevious() (bool, error) { + var hasPrevious C.bool + ret := C.CCall_lib3mf_resourceiterator_moveprevious(inst.wrapperRef.LibraryHandle, inst.Ref, &hasPrevious) + if ret != 0 { + return false, makeError(uint32(ret)) + } + return bool(hasPrevious), nil +} + +// GetCurrent returns the resource the iterator points at. +func (inst ResourceIterator) GetCurrent() (Resource, error) { + var resource ref + ret := C.CCall_lib3mf_resourceiterator_getcurrent(inst.wrapperRef.LibraryHandle, inst.Ref, &resource) + if ret != 0 { + return Resource{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewResource(resource), nil +} + +// Clone creates a new resource iterator with the same resource list. +func (inst ResourceIterator) Clone() (ResourceIterator, error) { + var outResourceIterator ref + ret := C.CCall_lib3mf_resourceiterator_clone(inst.wrapperRef.LibraryHandle, inst.Ref, &outResourceIterator) + if ret != 0 { + return ResourceIterator{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewResourceIterator(outResourceIterator), nil +} + +// Count returns the number of resoucres the iterator captures. +func (inst ResourceIterator) Count() (uint64, error) { + var count C.uint64_t + ret := C.CCall_lib3mf_resourceiterator_count(inst.wrapperRef.LibraryHandle, inst.Ref, &count) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return uint64(count), nil +} + + +// CustomXMLAttribute represents a Lib3MF class. +type CustomXMLAttribute struct { + Base +} + +func (wrapper Wrapper) NewCustomXMLAttribute(r ref) CustomXMLAttribute { + return CustomXMLAttribute{wrapper.NewBase(r)} +} + +// GetName retrieves name of the attribute. +func (inst CustomXMLAttribute) GetName() (string, error) { + var neededforname C.uint32_t + var filledinname C.uint32_t + ret := C.CCall_lib3mf_customxmlattribute_getname(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforname, nil) + if ret != 0 { + return "", makeError(uint32(ret)) + } + bufferSizename := neededforname + buffername := make([]byte, bufferSizename) + ret = C.CCall_lib3mf_customxmlattribute_getname(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizename, &filledinname, (*C.char)(unsafe.Pointer(&buffername[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(buffername[:(filledinname-1)]), nil +} + +// GetValue retrieves value of the attribute as string. +func (inst CustomXMLAttribute) GetValue() (string, error) { + var neededforvalue C.uint32_t + var filledinvalue C.uint32_t + ret := C.CCall_lib3mf_customxmlattribute_getvalue(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforvalue, nil) + if ret != 0 { + return "", makeError(uint32(ret)) + } + bufferSizevalue := neededforvalue + buffervalue := make([]byte, bufferSizevalue) + ret = C.CCall_lib3mf_customxmlattribute_getvalue(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizevalue, &filledinvalue, (*C.char)(unsafe.Pointer(&buffervalue[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(buffervalue[:(filledinvalue-1)]), nil +} + +// IsValidInteger checks if the value is a valid integer in the given range. +func (inst CustomXMLAttribute) IsValidInteger(minValue int64, maxValue int64) (bool, error) { + var isValid C.bool + ret := C.CCall_lib3mf_customxmlattribute_isvalidinteger(inst.wrapperRef.LibraryHandle, inst.Ref, C.int64_t(minValue), C.int64_t(maxValue), &isValid) + if ret != 0 { + return false, makeError(uint32(ret)) + } + return bool(isValid), nil +} + +// GetIntegerValue returns the value as integer. Fails if the value is not a valid integer in the given range. +func (inst CustomXMLAttribute) GetIntegerValue(minValue int64, maxValue int64) (int64, error) { + var value C.int64_t + ret := C.CCall_lib3mf_customxmlattribute_getintegervalue(inst.wrapperRef.LibraryHandle, inst.Ref, C.int64_t(minValue), C.int64_t(maxValue), &value) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return int64(value), nil +} + +// IsValidDouble checks if the value is a valid double in the given range. +func (inst CustomXMLAttribute) IsValidDouble(minValue float64, maxValue float64) (bool, error) { + var isValid C.bool + ret := C.CCall_lib3mf_customxmlattribute_isvaliddouble(inst.wrapperRef.LibraryHandle, inst.Ref, C.double(minValue), C.double(maxValue), &isValid) + if ret != 0 { + return false, makeError(uint32(ret)) + } + return bool(isValid), nil +} + +// GetDoubleValue returns the value as double. Fails if the value is not a valid double in the given range. +func (inst CustomXMLAttribute) GetDoubleValue(minValue float64, maxValue float64) (float64, error) { + var value C.double + ret := C.CCall_lib3mf_customxmlattribute_getdoublevalue(inst.wrapperRef.LibraryHandle, inst.Ref, C.double(minValue), C.double(maxValue), &value) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return float64(value), nil +} + +// IsValidBool checks if the value is a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. +func (inst CustomXMLAttribute) IsValidBool() (bool, error) { + var isValid C.bool + ret := C.CCall_lib3mf_customxmlattribute_isvalidbool(inst.wrapperRef.LibraryHandle, inst.Ref, &isValid) + if ret != 0 { + return false, makeError(uint32(ret)) + } + return bool(isValid), nil +} + +// GetBoolValue returns the value as bool. Fails if the value is not a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. +func (inst CustomXMLAttribute) GetBoolValue(minValue float64, maxValue float64) (bool, error) { + var value C.bool + ret := C.CCall_lib3mf_customxmlattribute_getboolvalue(inst.wrapperRef.LibraryHandle, inst.Ref, C.double(minValue), C.double(maxValue), &value) + if ret != 0 { + return false, makeError(uint32(ret)) + } + return bool(value), nil +} + +// SetValue sets the value of the attribute as string. +func (inst CustomXMLAttribute) SetValue(value string) error { + ret := C.CCall_lib3mf_customxmlattribute_setvalue(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(value)[0]))) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// SetIntegerValue sets the value of the attribute as integer. +func (inst CustomXMLAttribute) SetIntegerValue(value int64) error { + ret := C.CCall_lib3mf_customxmlattribute_setintegervalue(inst.wrapperRef.LibraryHandle, inst.Ref, C.int64_t(value)) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// SetDoubleValue sets the value of the attribute as double. +func (inst CustomXMLAttribute) SetDoubleValue(value float64) error { + ret := C.CCall_lib3mf_customxmlattribute_setdoublevalue(inst.wrapperRef.LibraryHandle, inst.Ref, C.double(value)) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// SetBoolValue sets the value of the attribute as bool. +func (inst CustomXMLAttribute) SetBoolValue(value bool) error { + ret := C.CCall_lib3mf_customxmlattribute_setboolvalue(inst.wrapperRef.LibraryHandle, inst.Ref, C.bool(value)) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// Remove removes the attribute from its parent node. All subsequent calls to the class will fail. +func (inst CustomXMLAttribute) Remove() error { + ret := C.CCall_lib3mf_customxmlattribute_remove(inst.wrapperRef.LibraryHandle, inst.Ref) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + + +// CustomXMLNode represents a Lib3MF class. +type CustomXMLNode struct { + Base +} + +func (wrapper Wrapper) NewCustomXMLNode(r ref) CustomXMLNode { + return CustomXMLNode{wrapper.NewBase(r)} +} + +// GetName retrieves name of the node. +func (inst CustomXMLNode) GetName() (string, error) { + var neededforname C.uint32_t + var filledinname C.uint32_t + ret := C.CCall_lib3mf_customxmlnode_getname(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforname, nil) + if ret != 0 { + return "", makeError(uint32(ret)) + } + bufferSizename := neededforname + buffername := make([]byte, bufferSizename) + ret = C.CCall_lib3mf_customxmlnode_getname(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizename, &filledinname, (*C.char)(unsafe.Pointer(&buffername[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(buffername[:(filledinname-1)]), nil +} + +// GetNameSpace retrieves namespace of the node. +func (inst CustomXMLNode) GetNameSpace() (string, error) { + var neededfornameSpace C.uint32_t + var filledinnameSpace C.uint32_t + ret := C.CCall_lib3mf_customxmlnode_getnamespace(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededfornameSpace, nil) + if ret != 0 { + return "", makeError(uint32(ret)) + } + bufferSizenameSpace := neededfornameSpace + buffernameSpace := make([]byte, bufferSizenameSpace) + ret = C.CCall_lib3mf_customxmlnode_getnamespace(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizenameSpace, &filledinnameSpace, (*C.char)(unsafe.Pointer(&buffernameSpace[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(buffernameSpace[:(filledinnameSpace-1)]), nil +} -const ( - BlendMethod_NoBlendMethod = 0 - BlendMethod_Mix = 1 - BlendMethod_Multiply = 2 -) +// GetAttributeCount returns number of attributes. +func (inst CustomXMLNode) GetAttributeCount() (uint64, error) { + var count C.uint64_t + ret := C.CCall_lib3mf_customxmlnode_getattributecount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return uint64(count), nil +} -// EncryptionAlgorithm represents a Lib3MF enum. -type EncryptionAlgorithm int +// GetAttribute returns attribute instance. Fails if Index is out of range. +func (inst CustomXMLNode) GetAttribute(index uint64) (CustomXMLAttribute, error) { + var attributeInstance ref + ret := C.CCall_lib3mf_customxmlnode_getattribute(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(index), &attributeInstance) + if ret != 0 { + return CustomXMLAttribute{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewCustomXMLAttribute(attributeInstance), nil +} -const ( - EncryptionAlgorithm_AES256_GCM = 1 -) +// HasAttribute returns if attribute of a specific name exists. +func (inst CustomXMLNode) HasAttribute(name string) (bool, error) { + var attributeExists C.bool + ret := C.CCall_lib3mf_customxmlnode_hasattribute(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0])), &attributeExists) + if ret != 0 { + return false, makeError(uint32(ret)) + } + return bool(attributeExists), nil +} -// WrappingAlgorithm represents a Lib3MF enum. -type WrappingAlgorithm int +// FindAttribute returns attribute instance of a specific name. . +func (inst CustomXMLNode) FindAttribute(name string, mustExist bool) (*CustomXMLAttribute, error) { + var attributeInstance ref + ret := C.CCall_lib3mf_customxmlnode_findattribute(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0])), C.bool(mustExist), &attributeInstance) + if ret != 0 { + return nil, makeError(uint32(ret)) + } + var _attributeInstancePtr *CustomXMLAttribute + if attributeInstance != nil { + _attributeInstancePtrVal := inst.wrapperRef.NewCustomXMLAttribute(attributeInstance) + _attributeInstancePtr = &_attributeInstancePtrVal + } + return _attributeInstancePtr, nil +} -const ( - WrappingAlgorithm_RSA_OAEP = 0 -) +// RemoveAttribute removes the attribute with a specific name. Does nothing if attribute does not exist. +func (inst CustomXMLNode) RemoveAttribute(name string) (bool, error) { + var attributeRemoved C.bool + ret := C.CCall_lib3mf_customxmlnode_removeattribute(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0])), &attributeRemoved) + if ret != 0 { + return false, makeError(uint32(ret)) + } + return bool(attributeRemoved), nil +} -// MgfAlgorithm represents a Lib3MF enum. -type MgfAlgorithm int +// RemoveAttributeByIndex removes the attribute with a specific index. Fails if index is invalid. +func (inst CustomXMLNode) RemoveAttributeByIndex(index uint64) (bool, error) { + var attributeRemoved C.bool + ret := C.CCall_lib3mf_customxmlnode_removeattributebyindex(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(index), &attributeRemoved) + if ret != 0 { + return false, makeError(uint32(ret)) + } + return bool(attributeRemoved), nil +} -const ( - MgfAlgorithm_MGF1_SHA1 = 160 - MgfAlgorithm_MGF1_SHA224 = 224 - MgfAlgorithm_MGF1_SHA256 = 256 - MgfAlgorithm_MGF1_SHA384 = 384 - MgfAlgorithm_MGF1_SHA512 = 512 -) +// AddAttribute adds an attribute with a specific name and string value. Fails if attribute already exists. +func (inst CustomXMLNode) AddAttribute(name string, value string) error { + ret := C.CCall_lib3mf_customxmlnode_addattribute(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0])), (*C.char)(unsafe.Pointer(&[]byte(value)[0]))) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} -// DigestMethod represents a Lib3MF enum. -type DigestMethod int +// AddIntegerAttribute adds an attribute with a specific name and integer value. Fails if attribute already exists. +func (inst CustomXMLNode) AddIntegerAttribute(name string, value int64) error { + ret := C.CCall_lib3mf_customxmlnode_addintegerattribute(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0])), C.int64_t(value)) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} -const ( - DigestMethod_SHA1 = 160 - DigestMethod_SHA256 = 256 -) +// AddDoubleAttribute adds an attribute with a specific name and double value. Fails if attribute already exists. +func (inst CustomXMLNode) AddDoubleAttribute(name string, value float64) error { + ret := C.CCall_lib3mf_customxmlnode_adddoubleattribute(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0])), C.double(value)) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} -// Compression represents a Lib3MF enum. -type Compression int +// AddBoolAttribute adds an attribute with a specific name and bool value. Fails if attribute already exists. +func (inst CustomXMLNode) AddBoolAttribute(name string, value bool) error { + ret := C.CCall_lib3mf_customxmlnode_addboolattribute(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0])), C.bool(value)) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} -const ( - Compression_NoCompression = 0 - Compression_Deflate = 1 -) +// GetChildren returns all the child nodes of the XML Node. +func (inst CustomXMLNode) GetChildren() (CustomXMLNodes, error) { + var childNodes ref + ret := C.CCall_lib3mf_customxmlnode_getchildren(inst.wrapperRef.LibraryHandle, inst.Ref, &childNodes) + if ret != 0 { + return CustomXMLNodes{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewCustomXMLNodes(childNodes), nil +} -// Triangle represents a Lib3MF struct. -type Triangle struct { - Indices[3] uint32 +// CountChildrenByName returns how many children of the XML Node have a specific name. +func (inst CustomXMLNode) CountChildrenByName(name string) (uint64, error) { + var count C.uint64_t + ret := C.CCall_lib3mf_customxmlnode_countchildrenbyname(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0])), &count) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return uint64(count), nil } -// TriangleProperties represents a Lib3MF struct. -type TriangleProperties struct { - ResourceID uint32 - PropertyIDs[3] uint32 +// GetChildrenByName returns all the child nodes of the XML Node with a specific name. +func (inst CustomXMLNode) GetChildrenByName(name string) (CustomXMLNodes, error) { + var childNodes ref + ret := C.CCall_lib3mf_customxmlnode_getchildrenbyname(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0])), &childNodes) + if ret != 0 { + return CustomXMLNodes{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewCustomXMLNodes(childNodes), nil } -// Position represents a Lib3MF struct. -type Position struct { - Coordinates[3] float32 +// HasChild returns if a child with a specific name exist. +func (inst CustomXMLNode) HasChild(name string) (bool, error) { + var childExists C.bool + ret := C.CCall_lib3mf_customxmlnode_haschild(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0])), &childExists) + if ret != 0 { + return false, makeError(uint32(ret)) + } + return bool(childExists), nil } -// Position2D represents a Lib3MF struct. -type Position2D struct { - Coordinates[2] float32 +// HasUniqueChild returns if a child with a specific name exist once and only once. +func (inst CustomXMLNode) HasUniqueChild(name string) (bool, error) { + var childExists C.bool + ret := C.CCall_lib3mf_customxmlnode_hasuniquechild(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0])), &childExists) + if ret != 0 { + return false, makeError(uint32(ret)) + } + return bool(childExists), nil } -// CompositeConstituent represents a Lib3MF struct. -type CompositeConstituent struct { - PropertyID uint32 - MixingRatio float64 +// FindChild returns child with a specific name. Throws an error if name does not exist once and only once. +func (inst CustomXMLNode) FindChild(name string, mustExist bool) (*CustomXMLNode, error) { + var childInstance ref + ret := C.CCall_lib3mf_customxmlnode_findchild(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0])), C.bool(mustExist), &childInstance) + if ret != 0 { + return nil, makeError(uint32(ret)) + } + var _childInstancePtr *CustomXMLNode + if childInstance != nil { + _childInstancePtrVal := inst.wrapperRef.NewCustomXMLNode(childInstance) + _childInstancePtr = &_childInstancePtrVal + } + return _childInstancePtr, nil } -// MultiPropertyLayer represents a Lib3MF struct. -type MultiPropertyLayer struct { - ResourceID uint32 - TheBlendMethod BlendMethod +// AddChild adds a new child with a specific name. +func (inst CustomXMLNode) AddChild(name string) (CustomXMLNode, error) { + var childInstance ref + ret := C.CCall_lib3mf_customxmlnode_addchild(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0])), &childInstance) + if ret != 0 { + return CustomXMLNode{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewCustomXMLNode(childInstance), nil } -// Tex2Coord represents a Lib3MF struct. -type Tex2Coord struct { - U float64 - V float64 +// RemoveChild removes a specific child. All subsequent calls to the child will fail after the call. +func (inst CustomXMLNode) RemoveChild(childInstance CustomXMLNode) error { + ret := C.CCall_lib3mf_customxmlnode_removechild(inst.wrapperRef.LibraryHandle, inst.Ref, childInstance.Ref) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil } -// Transform represents a Lib3MF struct. -type Transform struct { - Fields[4][3] float32 +// RemoveChildrenWithName removes all children with a specific name. Does nothing if no child with the name exists. All subsequent calls to the deleted children will fail after the call. +func (inst CustomXMLNode) RemoveChildrenWithName(name string) (uint64, error) { + var numberOfDeletedChildren C.uint64_t + ret := C.CCall_lib3mf_customxmlnode_removechildrenwithname(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0])), &numberOfDeletedChildren) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return uint64(numberOfDeletedChildren), nil } -// Box represents a Lib3MF struct. -type Box struct { - MinCoordinate[3] float32 - MaxCoordinate[3] float32 +// Remove removes the node from its parent. The root node of the document can not be removed. Any subsequent call to the node fails after this. +func (inst CustomXMLNode) Remove() error { + ret := C.CCall_lib3mf_customxmlnode_remove(inst.wrapperRef.LibraryHandle, inst.Ref) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil } -// Color represents a Lib3MF struct. -type Color struct { - Red uint8 - Green uint8 - Blue uint8 - Alpha uint8 + +// CustomXMLNodes represents a Lib3MF class. +type CustomXMLNodes struct { + Base } -// Beam represents a Lib3MF struct. -type Beam struct { - Indices[2] uint32 - Radii[2] float64 - CapModes[2] BeamLatticeCapMode +func (wrapper Wrapper) NewCustomXMLNodes(r ref) CustomXMLNodes { + return CustomXMLNodes{wrapper.NewBase(r)} } -// Ball represents a Lib3MF struct. -type Ball struct { - Index uint32 - Radius float64 +// GetNodeCount returns number of nodes. +func (inst CustomXMLNodes) GetNodeCount() (uint64, error) { + var count C.uint64_t + ret := C.CCall_lib3mf_customxmlnodes_getnodecount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return uint64(count), nil } -// Error constants for Lib3MF. -const LIB3MF_ERROR_NOTIMPLEMENTED = 1; -const LIB3MF_ERROR_INVALIDPARAM = 2; -const LIB3MF_ERROR_INVALIDCAST = 3; -const LIB3MF_ERROR_BUFFERTOOSMALL = 4; -const LIB3MF_ERROR_GENERICEXCEPTION = 5; -const LIB3MF_ERROR_COULDNOTLOADLIBRARY = 6; -const LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT = 7; -const LIB3MF_ERROR_INCOMPATIBLEBINARYVERSION = 8; -const LIB3MF_ERROR_CALCULATIONABORTED = 10; -const LIB3MF_ERROR_SHOULDNOTBECALLED = 11; -const LIB3MF_ERROR_READERCLASSUNKNOWN = 100; -const LIB3MF_ERROR_WRITERCLASSUNKNOWN = 101; -const LIB3MF_ERROR_ITERATORINVALIDINDEX = 102; -const LIB3MF_ERROR_INVALIDMODELRESOURCE = 103; -const LIB3MF_ERROR_RESOURCENOTFOUND = 104; -const LIB3MF_ERROR_INVALIDMODEL = 105; -const LIB3MF_ERROR_INVALIDOBJECT = 106; -const LIB3MF_ERROR_INVALIDMESHOBJECT = 107; -const LIB3MF_ERROR_INVALIDCOMPONENTSOBJECT = 108; -const LIB3MF_ERROR_INVALIDCOMPONENT = 109; -const LIB3MF_ERROR_INVALIDBUILDITEM = 110; -const LIB3MF_ERROR_INVALIDBASEMATERIALGROUP = 111; -const LIB3MF_ERROR_INVALIDSLICESTACKRESOURCE = 112; -const LIB3MF_ERROR_INVALIDTEXTURERESOURCE = 113; -const LIB3MF_ERROR_INVALIDCOLORGROUP = 114; -const LIB3MF_ERROR_INVALIDTEXTURE2DGROUP = 115; -const LIB3MF_ERROR_INVALIDCOMPOSITEMATERIALS = 116; -const LIB3MF_ERROR_INVALIDMULTIPROPERTYGROUP = 117; -const LIB3MF_ERROR_INVALIDRESOURCEINDEX = 120; -const LIB3MF_ERROR_ATTACHMENTNOTFOUND = 121; -const LIB3MF_ERROR_FORBIDDENCYCLICREFERENCE = 130; -const LIB3MF_ERROR_INVALIDATTACHMENTSTREAM = 131; -const LIB3MF_ERROR_INVALIDPROPERTYCOUNT = 132; -const LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER = 140; -const LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT = 141; -const LIB3MF_ERROR_INVALIDRESOURCE = 142; -const LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE = 2000; -const LIB3MF_ERROR_INVALIDKEYSTORE = 3000; -const LIB3MF_ERROR_INVALIDKEYSTORECONSUMER = 3001; -const LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND = 3002; -const LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND = 3003; -const LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED = 3004; -const LIB3MF_ERROR_INVALIDKEYSIZE = 3005; +// GetNode returns node instance. Fails if Index is out of range. +func (inst CustomXMLNodes) GetNode(index uint64) (CustomXMLNode, error) { + var nodeInstance ref + ret := C.CCall_lib3mf_customxmlnodes_getnode(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(index), &nodeInstance) + if ret != 0 { + return CustomXMLNode{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewCustomXMLNode(nodeInstance), nil +} -// WrappedError is an error that wraps a Lib3MF error. -type WrappedError struct { - Code uint32 - Message string +// CountNodesByName returns how many nodes of the XML Node have a specific name. +func (inst CustomXMLNodes) CountNodesByName(name string) (uint64, error) { + var count C.uint64_t + ret := C.CCall_lib3mf_customxmlnodes_countnodesbyname(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0])), &count) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return uint64(count), nil } -func (e *WrappedError) Error() string { - return fmt.Sprintf("lib3mf: %s (%d)", e.Message, e.Code) +// GetNodesByName returns all the nodes nodes of the XML Node with a specific name. +func (inst CustomXMLNodes) GetNodesByName(name string) (CustomXMLNodes, error) { + var nodes ref + ret := C.CCall_lib3mf_customxmlnodes_getnodesbyname(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0])), &nodes) + if ret != 0 { + return CustomXMLNodes{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewCustomXMLNodes(nodes), nil +} + +// HasNode returns if a node with a specific name exist. +func (inst CustomXMLNodes) HasNode(name string) (bool, error) { + var nodeExists C.bool + ret := C.CCall_lib3mf_customxmlnodes_hasnode(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0])), &nodeExists) + if ret != 0 { + return false, makeError(uint32(ret)) + } + return bool(nodeExists), nil } -func errorMessage(errorcode uint32) string { - switch (errorcode) { - case LIB3MF_ERROR_NOTIMPLEMENTED: - return "functionality not implemented"; - case LIB3MF_ERROR_INVALIDPARAM: - return "an invalid parameter was passed"; - case LIB3MF_ERROR_INVALIDCAST: - return "a type cast failed"; - case LIB3MF_ERROR_BUFFERTOOSMALL: - return "a provided buffer is too small"; - case LIB3MF_ERROR_GENERICEXCEPTION: - return "a generic exception occurred"; - case LIB3MF_ERROR_COULDNOTLOADLIBRARY: - return "the library could not be loaded"; - case LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT: - return "a required exported symbol could not be found in the library"; - case LIB3MF_ERROR_INCOMPATIBLEBINARYVERSION: - return "the version of the binary interface does not match the bindings interface"; - case LIB3MF_ERROR_CALCULATIONABORTED: - return "a calculation has been aborted"; - case LIB3MF_ERROR_SHOULDNOTBECALLED: - return "functionality should not be called"; - case LIB3MF_ERROR_READERCLASSUNKNOWN: - return "the queried reader class is unknown"; - case LIB3MF_ERROR_WRITERCLASSUNKNOWN: - return "the queried writer class is unknown"; - case LIB3MF_ERROR_ITERATORINVALIDINDEX: - return "the current index of an iterator is invalid"; - case LIB3MF_ERROR_INVALIDMODELRESOURCE: - return "no Model Resource has been given"; - case LIB3MF_ERROR_RESOURCENOTFOUND: - return "Resource not found"; - case LIB3MF_ERROR_INVALIDMODEL: - return "A model is invalid"; - case LIB3MF_ERROR_INVALIDOBJECT: - return "An object is invalid"; - case LIB3MF_ERROR_INVALIDMESHOBJECT: - return "A mesh object is invalid"; - case LIB3MF_ERROR_INVALIDCOMPONENTSOBJECT: - return "A components object is invalid"; - case LIB3MF_ERROR_INVALIDCOMPONENT: - return "A component is invalid"; - case LIB3MF_ERROR_INVALIDBUILDITEM: - return "A build item is invalid"; - case LIB3MF_ERROR_INVALIDBASEMATERIALGROUP: - return "A basematerialgroup is invalid"; - case LIB3MF_ERROR_INVALIDSLICESTACKRESOURCE: - return "A slicestack resource is invalid"; - case LIB3MF_ERROR_INVALIDTEXTURERESOURCE: - return "A texture resource is invalid"; - case LIB3MF_ERROR_INVALIDCOLORGROUP: - return "A color group resource is invalid"; - case LIB3MF_ERROR_INVALIDTEXTURE2DGROUP: - return "A texture2d group resource is invalid"; - case LIB3MF_ERROR_INVALIDCOMPOSITEMATERIALS: - return "A composite materials resource is invalid"; - case LIB3MF_ERROR_INVALIDMULTIPROPERTYGROUP: - return "A MultiPropertyGroup resource is invalid"; - case LIB3MF_ERROR_INVALIDRESOURCEINDEX: - return "A resource index is invalid"; - case LIB3MF_ERROR_ATTACHMENTNOTFOUND: - return "Attachment not found"; - case LIB3MF_ERROR_FORBIDDENCYCLICREFERENCE: - return "A component references one of its ancestors"; - case LIB3MF_ERROR_INVALIDATTACHMENTSTREAM: - return "An attachment stream is invalid"; - case LIB3MF_ERROR_INVALIDPROPERTYCOUNT: - return "Invalid property count."; - case LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER: - return "A progress identifier is unknown"; - case LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT: - return "An element buffer exceeds its spec limit"; - case LIB3MF_ERROR_INVALIDRESOURCE: - return "A resource is invalid"; - case LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE: - return "This object type is not valid for beamlattices"; - case LIB3MF_ERROR_INVALIDKEYSTORE: - return "The keystore object is invalid"; - case LIB3MF_ERROR_INVALIDKEYSTORECONSUMER: - return "The consumer keystore object is invalid"; - case LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND: - return "A consumer has not been found"; - case LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND: - return "A resource data has not been found"; - case LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED: - return "A Key or Conentent encryption callback has not been registered"; - case LIB3MF_ERROR_INVALIDKEYSIZE: - return "The key siue is invalid"; - default: - return "unknown"; +// HasUniqueNode returns if a node with a specific name exist once and only once. +func (inst CustomXMLNodes) HasUniqueNode(name string) (bool, error) { + var nodeExists C.bool + ret := C.CCall_lib3mf_customxmlnodes_hasuniquenode(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0])), &nodeExists) + if ret != 0 { + return false, makeError(uint32(ret)) } + return bool(nodeExists), nil } -func makeError(errorcode uint32) error { - return &WrappedError{errorcode, errorMessage(uint32(errorcode))} +// FindNode returns node with a specific name. Throws an error if name does not exist once and only once. +func (inst CustomXMLNodes) FindNode(name string, mustExist bool) (*CustomXMLNode, error) { + var nodeInstance ref + ret := C.CCall_lib3mf_customxmlnodes_findnode(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0])), C.bool(mustExist), &nodeInstance) + if ret != 0 { + return nil, makeError(uint32(ret)) + } + var _nodeInstancePtr *CustomXMLNode + if nodeInstance != nil { + _nodeInstancePtrVal := inst.wrapperRef.NewCustomXMLNode(nodeInstance) + _nodeInstancePtr = &_nodeInstancePtrVal + } + return _nodeInstancePtr, nil } -// ProgressCallbackFunc a callback function. -type ProgressCallbackFunc = func(abort *bool, progressValue float64, progressIdentifier ProgressIdentifier, userData uintptr) -var progressCallbackFunc ProgressCallbackFunc +// CustomDOMTree represents a Lib3MF class. +type CustomDOMTree struct { + Base +} -//export progressCallback -func progressCallback(abort *C.bool, progressValue C.double, progressIdentifier C.eLib3MFProgressIdentifier, userData C.Lib3MF_pvoid) { - if progressCallbackFunc == nil { - return - } - progressCallbackFunc((*bool)(abort), float64(progressValue), ProgressIdentifier(progressIdentifier), uintptr(userData)) +func (wrapper Wrapper) NewCustomDOMTree(r ref) CustomDOMTree { + return CustomDOMTree{wrapper.NewBase(r)} } -// WriteCallbackFunc callback to call for writing a data chunk. -type WriteCallbackFunc = func(byteData uint64, numBytes uint64, userData uintptr) +// GetNameSpace returns the namespace identifier for the DOM Tree. +func (inst CustomDOMTree) GetNameSpace() (string, error) { + var neededfornameSpace C.uint32_t + var filledinnameSpace C.uint32_t + ret := C.CCall_lib3mf_customdomtree_getnamespace(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededfornameSpace, nil) + if ret != 0 { + return "", makeError(uint32(ret)) + } + bufferSizenameSpace := neededfornameSpace + buffernameSpace := make([]byte, bufferSizenameSpace) + ret = C.CCall_lib3mf_customdomtree_getnamespace(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizenameSpace, &filledinnameSpace, (*C.char)(unsafe.Pointer(&buffernameSpace[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(buffernameSpace[:(filledinnameSpace-1)]), nil +} -var writeCallbackFunc WriteCallbackFunc +// GetRootNode returns root node of the tree. +func (inst CustomDOMTree) GetRootNode() (CustomXMLNode, error) { + var rootNode ref + ret := C.CCall_lib3mf_customdomtree_getrootnode(inst.wrapperRef.LibraryHandle, inst.Ref, &rootNode) + if ret != 0 { + return CustomXMLNode{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewCustomXMLNode(rootNode), nil +} -//export writeCallback -func writeCallback(byteData C.uint64_t, numBytes C.uint64_t, userData C.Lib3MF_pvoid) { - if writeCallbackFunc == nil { - return +// SaveToString saves the XML tree into a string. +func (inst CustomDOMTree) SaveToString() (string, error) { + var neededforxMLString C.uint32_t + var filledinxMLString C.uint32_t + ret := C.CCall_lib3mf_customdomtree_savetostring(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforxMLString, nil) + if ret != 0 { + return "", makeError(uint32(ret)) } - writeCallbackFunc(uint64(byteData), uint64(numBytes), uintptr(userData)) + bufferSizexMLString := neededforxMLString + bufferxMLString := make([]byte, bufferSizexMLString) + ret = C.CCall_lib3mf_customdomtree_savetostring(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizexMLString, &filledinxMLString, (*C.char)(unsafe.Pointer(&bufferxMLString[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(bufferxMLString[:(filledinxMLString-1)]), nil } -// ReadCallbackFunc callback to call for reading a data chunk. -type ReadCallbackFunc = func(byteData uint64, numBytes uint64, userData uintptr) -var readCallbackFunc ReadCallbackFunc +// SliceStackIterator represents a Lib3MF class. +type SliceStackIterator struct { + ResourceIterator +} -//export readCallback -func readCallback(byteData C.uint64_t, numBytes C.uint64_t, userData C.Lib3MF_pvoid) { - if readCallbackFunc == nil { - return +func (wrapper Wrapper) NewSliceStackIterator(r ref) SliceStackIterator { + return SliceStackIterator{wrapper.NewResourceIterator(r)} +} + +// GetCurrentSliceStack returns the SliceStack the iterator points at. +func (inst SliceStackIterator) GetCurrentSliceStack() (SliceStack, error) { + var resource ref + ret := C.CCall_lib3mf_slicestackiterator_getcurrentslicestack(inst.wrapperRef.LibraryHandle, inst.Ref, &resource) + if ret != 0 { + return SliceStack{}, makeError(uint32(ret)) } - readCallbackFunc(uint64(byteData), uint64(numBytes), uintptr(userData)) + return inst.wrapperRef.NewSliceStack(resource), nil } -// SeekCallbackFunc callback to call for seeking in the stream. -type SeekCallbackFunc = func(position uint64, userData uintptr) -var seekCallbackFunc SeekCallbackFunc +// ObjectIterator represents a Lib3MF class. +type ObjectIterator struct { + ResourceIterator +} -//export seekCallback -func seekCallback(position C.uint64_t, userData C.Lib3MF_pvoid) { - if seekCallbackFunc == nil { - return +func (wrapper Wrapper) NewObjectIterator(r ref) ObjectIterator { + return ObjectIterator{wrapper.NewResourceIterator(r)} +} + +// GetCurrentObject returns the Object the iterator points at. +func (inst ObjectIterator) GetCurrentObject() (Object, error) { + var resource ref + ret := C.CCall_lib3mf_objectiterator_getcurrentobject(inst.wrapperRef.LibraryHandle, inst.Ref, &resource) + if ret != 0 { + return Object{}, makeError(uint32(ret)) } - seekCallbackFunc(uint64(position), uintptr(userData)) + return inst.wrapperRef.NewObject(resource), nil } -// RandomNumberCallbackFunc callback to generate random numbers. -type RandomNumberCallbackFunc = func(byteData uint64, numBytes uint64, userData uintptr, bytesWritten *uint64) -var randomNumberCallbackFunc RandomNumberCallbackFunc +// MeshObjectIterator represents a Lib3MF class. +type MeshObjectIterator struct { + ResourceIterator +} -//export randomNumberCallback -func randomNumberCallback(byteData C.uint64_t, numBytes C.uint64_t, userData C.Lib3MF_pvoid, bytesWritten *C.uint64_t) { - if randomNumberCallbackFunc == nil { - return +func (wrapper Wrapper) NewMeshObjectIterator(r ref) MeshObjectIterator { + return MeshObjectIterator{wrapper.NewResourceIterator(r)} +} + +// GetCurrentMeshObject returns the MeshObject the iterator points at. +func (inst MeshObjectIterator) GetCurrentMeshObject() (MeshObject, error) { + var resource ref + ret := C.CCall_lib3mf_meshobjectiterator_getcurrentmeshobject(inst.wrapperRef.LibraryHandle, inst.Ref, &resource) + if ret != 0 { + return MeshObject{}, makeError(uint32(ret)) } - randomNumberCallbackFunc(uint64(byteData), uint64(numBytes), uintptr(userData), (*uint64)(bytesWritten)) + return inst.wrapperRef.NewMeshObject(resource), nil } -// KeyWrappingCallbackFunc a callback used to wrap (encrypt) the content key available in keystore resource group. -type KeyWrappingCallbackFunc = func(kEKParams AccessRight, inBuffer []uint8, outBuffer []uint8, userData uintptr, status *uint64) -var keyWrappingCallbackFunc KeyWrappingCallbackFunc +// ComponentsObjectIterator represents a Lib3MF class. +type ComponentsObjectIterator struct { + ResourceIterator +} -//export keyWrappingCallback -func keyWrappingCallback(kEKParams C.Lib3MF_AccessRight, inBuffer *C.uint8_t, outBuffer *C.uint8_t, userData C.Lib3MF_pvoid, status *C.uint64_t) { - if keyWrappingCallbackFunc == nil { - return +func (wrapper Wrapper) NewComponentsObjectIterator(r ref) ComponentsObjectIterator { + return ComponentsObjectIterator{wrapper.NewResourceIterator(r)} +} + +// GetCurrentComponentsObject returns the ComponentsObject the iterator points at. +func (inst ComponentsObjectIterator) GetCurrentComponentsObject() (ComponentsObject, error) { + var resource ref + ret := C.CCall_lib3mf_componentsobjectiterator_getcurrentcomponentsobject(inst.wrapperRef.LibraryHandle, inst.Ref, &resource) + if ret != 0 { + return ComponentsObject{}, makeError(uint32(ret)) } - keyWrappingCallbackFunc(, ([][]uint8)(unsafe.Pointer(&inBuffer[0])), ([][]uint8)(unsafe.Pointer(&outBuffer[0])), uintptr(userData), (*uint64)(status)) + return inst.wrapperRef.NewComponentsObject(resource), nil } -// ContentEncryptionCallbackFunc 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. -type ContentEncryptionCallbackFunc = func(cEKParams ContentEncryptionParams, input []uint8, output []uint8, userData uintptr, status *uint64) -var contentEncryptionCallbackFunc ContentEncryptionCallbackFunc +// Texture2DIterator represents a Lib3MF class. +type Texture2DIterator struct { + ResourceIterator +} -//export contentEncryptionCallback -func contentEncryptionCallback(cEKParams C.Lib3MF_ContentEncryptionParams, input *C.uint8_t, output *C.uint8_t, userData C.Lib3MF_pvoid, status *C.uint64_t) { - if contentEncryptionCallbackFunc == nil { - return +func (wrapper Wrapper) NewTexture2DIterator(r ref) Texture2DIterator { + return Texture2DIterator{wrapper.NewResourceIterator(r)} +} + +// GetCurrentTexture2D returns the Texture2D the iterator points at. +func (inst Texture2DIterator) GetCurrentTexture2D() (Texture2D, error) { + var resource ref + ret := C.CCall_lib3mf_texture2diterator_getcurrenttexture2d(inst.wrapperRef.LibraryHandle, inst.Ref, &resource) + if ret != 0 { + return Texture2D{}, makeError(uint32(ret)) } - contentEncryptionCallbackFunc(, ([][]uint8)(unsafe.Pointer(&input[0])), ([][]uint8)(unsafe.Pointer(&output[0])), uintptr(userData), (*uint64)(status)) + return inst.wrapperRef.NewTexture2D(resource), nil } -// Wrapper represents the number wrapper -type Wrapper struct { - _ [0]func() // uncomparable; to make == not compile - LibraryHandle ref + +// BaseMaterialGroupIterator represents a Lib3MF class. +type BaseMaterialGroupIterator struct { + ResourceIterator } -// Base represents a Lib3MF class. -type Base struct { - _ [0]func() // uncomparable; to make == not compile - Ref ref // identifies a C value, see ref type - wrapperRef Wrapper - gcPtr *ref // used to trigger the finalizer when the Value is not referenced any more +func (wrapper Wrapper) NewBaseMaterialGroupIterator(r ref) BaseMaterialGroupIterator { + return BaseMaterialGroupIterator{wrapper.NewResourceIterator(r)} } -// NewBase creates a new Base. -// The wrapped C pointer will be freed when the Go pointer is finalized, -// but one can release it manually calling Release. -func (wrapper Wrapper) NewBase(r ref) Base { - gcPtr := new(ref) - *gcPtr = r - runtime.SetFinalizer(gcPtr, wrapper.releaseC) - return Base{Ref: r, gcPtr: gcPtr, wrapperRef: wrapper} +// GetCurrentBaseMaterialGroup returns the MaterialGroup the iterator points at. +func (inst BaseMaterialGroupIterator) GetCurrentBaseMaterialGroup() (BaseMaterialGroup, error) { + var resource ref + ret := C.CCall_lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup(inst.wrapperRef.LibraryHandle, inst.Ref, &resource) + if ret != 0 { + return BaseMaterialGroup{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewBaseMaterialGroup(resource), nil } -// Release releases the C pointer. -func (inst Base) Release() error { - err := inst.wrapperRef.Release(inst) - *inst.gcPtr = nil - return err + +// ColorGroupIterator represents a Lib3MF class. +type ColorGroupIterator struct { + ResourceIterator } -// Equal reports whether inst and w refer to the same C pointer. -func (inst Base) Equal(w Base) bool { - return inst.Ref == w.Ref +func (wrapper Wrapper) NewColorGroupIterator(r ref) ColorGroupIterator { + return ColorGroupIterator{wrapper.NewResourceIterator(r)} } -// ClassTypeId get Class Type Id. -func (inst Base) ClassTypeId() (uint64, error) { - var classTypeId C.uint64_t - ret := C.CCall_lib3mf_base_classtypeid(inst.wrapperRef.LibraryHandle, inst.Ref, &classTypeId) + +// GetCurrentColorGroup returns the ColorGroup the iterator points at. +func (inst ColorGroupIterator) GetCurrentColorGroup() (ColorGroup, error) { + var resource ref + ret := C.CCall_lib3mf_colorgroupiterator_getcurrentcolorgroup(inst.wrapperRef.LibraryHandle, inst.Ref, &resource) if ret != 0 { - return 0, makeError(uint32(ret)) + return ColorGroup{}, makeError(uint32(ret)) } - return uint64(classTypeId), nil + return inst.wrapperRef.NewColorGroup(resource), nil } -// Writer represents a Lib3MF class. -type Writer struct { - Base +// Texture2DGroupIterator represents a Lib3MF class. +type Texture2DGroupIterator struct { + ResourceIterator } -func (wrapper Wrapper) NewWriter(r ref) Writer { - return Writer{wrapper.NewBase(r)} +func (wrapper Wrapper) NewTexture2DGroupIterator(r ref) Texture2DGroupIterator { + return Texture2DGroupIterator{wrapper.NewResourceIterator(r)} } -// WriteToFile writes out the model as file. The file type is specified by the Model Writer class. -func (inst Writer) WriteToFile(filename string) error { - ret := C.CCall_lib3mf_writer_writetofile(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(filename)[0]))) +// GetCurrentTexture2DGroup returns the Texture2DGroup the iterator points at. +func (inst Texture2DGroupIterator) GetCurrentTexture2DGroup() (Texture2DGroup, error) { + var resource ref + ret := C.CCall_lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup(inst.wrapperRef.LibraryHandle, inst.Ref, &resource) if ret != 0 { - return makeError(uint32(ret)) + return Texture2DGroup{}, makeError(uint32(ret)) } - return nil + return inst.wrapperRef.NewTexture2DGroup(resource), nil } -// GetStreamSize retrieves the size of the full 3MF file stream. -func (inst Writer) GetStreamSize() (uint64, error) { - var streamSize C.uint64_t - ret := C.CCall_lib3mf_writer_getstreamsize(inst.wrapperRef.LibraryHandle, inst.Ref, &streamSize) - if ret != 0 { - return 0, makeError(uint32(ret)) - } - return uint64(streamSize), nil + +// CompositeMaterialsIterator represents a Lib3MF class. +type CompositeMaterialsIterator struct { + ResourceIterator } -// WriteToBuffer writes out the 3MF file into a memory buffer. -func (inst Writer) WriteToBuffer(buffer []uint8) ([]uint8, error) { - var neededforbuffer C.uint64_t - ret := C.CCall_lib3mf_writer_writetobuffer(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforbuffer, nil) - if ret != 0 { - return nil, makeError(uint32(ret)) - } - if len(buffer) < int(neededforbuffer) { - buffer = append(buffer, make([]uint8, int(neededforbuffer)-len(buffer))...) - } - ret = C.CCall_lib3mf_writer_writetobuffer(inst.wrapperRef.LibraryHandle, inst.Ref, neededforbuffer, nil, (*C.uint8_t)(unsafe.Pointer(&buffer[0]))) - if ret != 0 { - return nil, makeError(uint32(ret)) - } - return buffer[:int(neededforbuffer)], nil +func (wrapper Wrapper) NewCompositeMaterialsIterator(r ref) CompositeMaterialsIterator { + return CompositeMaterialsIterator{wrapper.NewResourceIterator(r)} } -// WriteToCallback writes out the model and passes the data to a provided callback function. The file type is specified by the Model Writer class. -func (inst Writer) WriteToCallback(theWriteCallback WriteCallbackFunc, theSeekCallback SeekCallbackFunc, userData uintptr) error { - ret := C.CCall_lib3mf_writer_writetocallback(inst.wrapperRef.LibraryHandle, inst.Ref, (C.Lib3MFWriteCallback)(unsafe.Pointer(C.Lib3MFWriteCallback_cgo)), (C.Lib3MFSeekCallback)(unsafe.Pointer(C.Lib3MFSeekCallback_cgo)), (C.Lib3MF_pvoid)(userData)) +// GetCurrentCompositeMaterials returns the CompositeMaterials the iterator points at. +func (inst CompositeMaterialsIterator) GetCurrentCompositeMaterials() (CompositeMaterials, error) { + var resource ref + ret := C.CCall_lib3mf_compositematerialsiterator_getcurrentcompositematerials(inst.wrapperRef.LibraryHandle, inst.Ref, &resource) if ret != 0 { - return makeError(uint32(ret)) + return CompositeMaterials{}, makeError(uint32(ret)) } - writeCallbackFunc = theWriteCallback - seekCallbackFunc = theSeekCallback - return nil + return inst.wrapperRef.NewCompositeMaterials(resource), nil } -// SetProgressCallback set the progress callback for calls to this writer. -func (inst Writer) SetProgressCallback(progressCallback ProgressCallbackFunc, userData uintptr) error { - ret := C.CCall_lib3mf_writer_setprogresscallback(inst.wrapperRef.LibraryHandle, inst.Ref, (C.Lib3MFProgressCallback)(unsafe.Pointer(C.Lib3MFProgressCallback_cgo)), (C.Lib3MF_pvoid)(userData)) - if ret != 0 { - return makeError(uint32(ret)) - } - progressCallbackFunc = progressCallback - return nil + +// MultiPropertyGroupIterator represents a Lib3MF class. +type MultiPropertyGroupIterator struct { + ResourceIterator } -// GetDecimalPrecision returns the number of digits after the decimal point to be written in each vertex coordinate-value. -func (inst Writer) GetDecimalPrecision() (uint32, error) { - var decimalPrecision C.uint32_t - ret := C.CCall_lib3mf_writer_getdecimalprecision(inst.wrapperRef.LibraryHandle, inst.Ref, &decimalPrecision) - if ret != 0 { - return 0, makeError(uint32(ret)) - } - return uint32(decimalPrecision), nil +func (wrapper Wrapper) NewMultiPropertyGroupIterator(r ref) MultiPropertyGroupIterator { + return MultiPropertyGroupIterator{wrapper.NewResourceIterator(r)} } -// SetDecimalPrecision sets the number of digits after the decimal point to be written in each vertex coordinate-value. -func (inst Writer) SetDecimalPrecision(decimalPrecision uint32) error { - ret := C.CCall_lib3mf_writer_setdecimalprecision(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(decimalPrecision)) +// GetCurrentMultiPropertyGroup returns the MultiPropertyGroup the iterator points at. +func (inst MultiPropertyGroupIterator) GetCurrentMultiPropertyGroup() (MultiPropertyGroup, error) { + var resource ref + ret := C.CCall_lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup(inst.wrapperRef.LibraryHandle, inst.Ref, &resource) if ret != 0 { - return makeError(uint32(ret)) + return MultiPropertyGroup{}, makeError(uint32(ret)) } - return nil + return inst.wrapperRef.NewMultiPropertyGroup(resource), nil } -// SetStrictModeActive activates (deactivates) the strict mode of the reader. -func (inst Writer) SetStrictModeActive(strictModeActive bool) error { - ret := C.CCall_lib3mf_writer_setstrictmodeactive(inst.wrapperRef.LibraryHandle, inst.Ref, C.bool(strictModeActive)) - if ret != 0 { - return makeError(uint32(ret)) - } - return nil + +// MetaData represents a Lib3MF class. +type MetaData struct { + Base } -// GetStrictModeActive queries whether the strict mode of the reader is active or not. -func (inst Writer) GetStrictModeActive() (bool, error) { - var strictModeActive C.bool - ret := C.CCall_lib3mf_writer_getstrictmodeactive(inst.wrapperRef.LibraryHandle, inst.Ref, &strictModeActive) - if ret != 0 { - return false, makeError(uint32(ret)) - } - return bool(strictModeActive), nil +func (wrapper Wrapper) NewMetaData(r ref) MetaData { + return MetaData{wrapper.NewBase(r)} } -// GetWarning returns Warning and Error Information of the read process. -func (inst Writer) GetWarning(index uint32) (uint32, string, error) { - var errorCode C.uint32_t - var neededforwarning C.uint32_t - var filledinwarning C.uint32_t - ret := C.CCall_lib3mf_writer_getwarning(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &errorCode, 0, &neededforwarning, nil) +// GetNameSpace returns the namespace URL of the metadata. +func (inst MetaData) GetNameSpace() (string, error) { + var neededfornameSpace C.uint32_t + var filledinnameSpace C.uint32_t + ret := C.CCall_lib3mf_metadata_getnamespace(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededfornameSpace, nil) if ret != 0 { - return 0, "", makeError(uint32(ret)) + return "", makeError(uint32(ret)) } - bufferSizewarning := neededforwarning - bufferwarning := make([]byte, bufferSizewarning) - ret = C.CCall_lib3mf_writer_getwarning(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &errorCode, bufferSizewarning, &filledinwarning, (*C.char)(unsafe.Pointer(&bufferwarning[0]))) + bufferSizenameSpace := neededfornameSpace + buffernameSpace := make([]byte, bufferSizenameSpace) + ret = C.CCall_lib3mf_metadata_getnamespace(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizenameSpace, &filledinnameSpace, (*C.char)(unsafe.Pointer(&buffernameSpace[0]))) if ret != 0 { - return 0, "", makeError(uint32(ret)) + return "", makeError(uint32(ret)) } - return uint32(errorCode), string(bufferwarning[:(filledinwarning-1)]), nil + return string(buffernameSpace[:(filledinnameSpace-1)]), nil } -// GetWarningCount returns Warning and Error Count of the read process. -func (inst Writer) GetWarningCount() (uint32, error) { - var count C.uint32_t - ret := C.CCall_lib3mf_writer_getwarningcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) +// SetNameSpace sets a new namespace URL of the metadata. +func (inst MetaData) SetNameSpace(nameSpace string) error { + ret := C.CCall_lib3mf_metadata_setnamespace(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpace)[0]))) if ret != 0 { - return 0, makeError(uint32(ret)) + return makeError(uint32(ret)) } - return uint32(count), nil + return nil } -// AddKeyWrappingCallback registers a callback to deal with data key encryption/decryption from keystore. -func (inst Writer) AddKeyWrappingCallback(consumerID string, theCallback KeyWrappingCallbackFunc, userData uintptr) error { - ret := C.CCall_lib3mf_writer_addkeywrappingcallback(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(consumerID)[0])), (C.Lib3MFKeyWrappingCallback)(unsafe.Pointer(C.Lib3MFKeyWrappingCallback_cgo)), (C.Lib3MF_pvoid)(userData)) +// GetName returns the name of a metadata. +func (inst MetaData) GetName() (string, error) { + var neededforname C.uint32_t + var filledinname C.uint32_t + ret := C.CCall_lib3mf_metadata_getname(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforname, nil) if ret != 0 { - return makeError(uint32(ret)) + return "", makeError(uint32(ret)) } - keyWrappingCallbackFunc = theCallback - return nil + bufferSizename := neededforname + buffername := make([]byte, bufferSizename) + ret = C.CCall_lib3mf_metadata_getname(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizename, &filledinname, (*C.char)(unsafe.Pointer(&buffername[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(buffername[:(filledinname-1)]), nil } -// SetContentEncryptionCallback registers a callback to deal with encryption of content. -func (inst Writer) SetContentEncryptionCallback(theCallback ContentEncryptionCallbackFunc, userData uintptr) error { - ret := C.CCall_lib3mf_writer_setcontentencryptioncallback(inst.wrapperRef.LibraryHandle, inst.Ref, (C.Lib3MFContentEncryptionCallback)(unsafe.Pointer(C.Lib3MFContentEncryptionCallback_cgo)), (C.Lib3MF_pvoid)(userData)) +// SetName sets a new name of a metadata. +func (inst MetaData) SetName(name string) error { + ret := C.CCall_lib3mf_metadata_setname(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0]))) if ret != 0 { return makeError(uint32(ret)) } - contentEncryptionCallbackFunc = theCallback return nil } - -// Reader represents a Lib3MF class. -type Reader struct { - Base -} - -func (wrapper Wrapper) NewReader(r ref) Reader { - return Reader{wrapper.NewBase(r)} -} - -// ReadFromFile reads a model from a file. The file type is specified by the Model Reader class. -func (inst Reader) ReadFromFile(filename string) error { - ret := C.CCall_lib3mf_reader_readfromfile(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(filename)[0]))) +// GetKey returns the (namespace+name) of a metadata. +func (inst MetaData) GetKey() (string, error) { + var neededforkey C.uint32_t + var filledinkey C.uint32_t + ret := C.CCall_lib3mf_metadata_getkey(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforkey, nil) if ret != 0 { - return makeError(uint32(ret)) + return "", makeError(uint32(ret)) + } + bufferSizekey := neededforkey + bufferkey := make([]byte, bufferSizekey) + ret = C.CCall_lib3mf_metadata_getkey(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizekey, &filledinkey, (*C.char)(unsafe.Pointer(&bufferkey[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) } - return nil + return string(bufferkey[:(filledinkey-1)]), nil } -// ReadFromBuffer reads a model from a memory buffer. -func (inst Reader) ReadFromBuffer(buffer []uint8) error { - ret := C.CCall_lib3mf_reader_readfrombuffer(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(buffer)), (*C.uint8_t)(unsafe.Pointer(&buffer[0]))) +// GetMustPreserve returns, whether a metadata must be preserved. +func (inst MetaData) GetMustPreserve() (bool, error) { + var mustPreserve C.bool + ret := C.CCall_lib3mf_metadata_getmustpreserve(inst.wrapperRef.LibraryHandle, inst.Ref, &mustPreserve) if ret != 0 { - return makeError(uint32(ret)) + return false, makeError(uint32(ret)) } - return nil + return bool(mustPreserve), nil } -// ReadFromCallback reads a model and from the data provided by a callback function. -func (inst Reader) ReadFromCallback(theReadCallback ReadCallbackFunc, streamSize uint64, theSeekCallback SeekCallbackFunc, userData uintptr) error { - ret := C.CCall_lib3mf_reader_readfromcallback(inst.wrapperRef.LibraryHandle, inst.Ref, (C.Lib3MFReadCallback)(unsafe.Pointer(C.Lib3MFReadCallback_cgo)), C.uint64_t(streamSize), (C.Lib3MFSeekCallback)(unsafe.Pointer(C.Lib3MFSeekCallback_cgo)), (C.Lib3MF_pvoid)(userData)) +// SetMustPreserve sets whether a metadata must be preserved. +func (inst MetaData) SetMustPreserve(mustPreserve bool) error { + ret := C.CCall_lib3mf_metadata_setmustpreserve(inst.wrapperRef.LibraryHandle, inst.Ref, C.bool(mustPreserve)) if ret != 0 { return makeError(uint32(ret)) } - readCallbackFunc = theReadCallback - seekCallbackFunc = theSeekCallback return nil } -// SetProgressCallback set the progress callback for calls to this writer. -func (inst Reader) SetProgressCallback(progressCallback ProgressCallbackFunc, userData uintptr) error { - ret := C.CCall_lib3mf_reader_setprogresscallback(inst.wrapperRef.LibraryHandle, inst.Ref, (C.Lib3MFProgressCallback)(unsafe.Pointer(C.Lib3MFProgressCallback_cgo)), (C.Lib3MF_pvoid)(userData)) +// GetType returns the type of a metadata. +func (inst MetaData) GetType() (string, error) { + var neededfor_type C.uint32_t + var filledin_type C.uint32_t + ret := C.CCall_lib3mf_metadata_gettype(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededfor_type, nil) if ret != 0 { - return makeError(uint32(ret)) + return "", makeError(uint32(ret)) } - progressCallbackFunc = progressCallback - return nil + bufferSize_type := neededfor_type + buffer_type := make([]byte, bufferSize_type) + ret = C.CCall_lib3mf_metadata_gettype(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSize_type, &filledin_type, (*C.char)(unsafe.Pointer(&buffer_type[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(buffer_type[:(filledin_type-1)]), nil } -// AddRelationToRead adds a relationship type which shall be read as attachment in memory while loading. -func (inst Reader) AddRelationToRead(relationShipType string) error { - ret := C.CCall_lib3mf_reader_addrelationtoread(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(relationShipType)[0]))) +// SetType sets a new type of a metadata. This must be a simple XML type. +func (inst MetaData) SetType(_type string) error { + ret := C.CCall_lib3mf_metadata_settype(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(_type)[0]))) if ret != 0 { return makeError(uint32(ret)) } return nil } -// RemoveRelationToRead removes a relationship type which shall be read as attachment in memory while loading. -func (inst Reader) RemoveRelationToRead(relationShipType string) error { - ret := C.CCall_lib3mf_reader_removerelationtoread(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(relationShipType)[0]))) +// GetValue returns the value of the metadata. +func (inst MetaData) GetValue() (string, error) { + var neededforvalue C.uint32_t + var filledinvalue C.uint32_t + ret := C.CCall_lib3mf_metadata_getvalue(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforvalue, nil) if ret != 0 { - return makeError(uint32(ret)) + return "", makeError(uint32(ret)) } - return nil + bufferSizevalue := neededforvalue + buffervalue := make([]byte, bufferSizevalue) + ret = C.CCall_lib3mf_metadata_getvalue(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizevalue, &filledinvalue, (*C.char)(unsafe.Pointer(&buffervalue[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(buffervalue[:(filledinvalue-1)]), nil } -// SetStrictModeActive activates (deactivates) the strict mode of the reader. -func (inst Reader) SetStrictModeActive(strictModeActive bool) error { - ret := C.CCall_lib3mf_reader_setstrictmodeactive(inst.wrapperRef.LibraryHandle, inst.Ref, C.bool(strictModeActive)) +// SetValue sets a new value of the metadata. +func (inst MetaData) SetValue(value string) error { + ret := C.CCall_lib3mf_metadata_setvalue(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(value)[0]))) if ret != 0 { return makeError(uint32(ret)) } return nil } -// GetStrictModeActive queries whether the strict mode of the reader is active or not. -func (inst Reader) GetStrictModeActive() (bool, error) { - var strictModeActive C.bool - ret := C.CCall_lib3mf_reader_getstrictmodeactive(inst.wrapperRef.LibraryHandle, inst.Ref, &strictModeActive) - if ret != 0 { - return false, makeError(uint32(ret)) - } - return bool(strictModeActive), nil + +// MetaDataGroup represents a Lib3MF class. +type MetaDataGroup struct { + Base } -// GetWarning returns Warning and Error Information of the read process. -func (inst Reader) GetWarning(index uint32) (uint32, string, error) { - var errorCode C.uint32_t - var neededforwarning C.uint32_t - var filledinwarning C.uint32_t - ret := C.CCall_lib3mf_reader_getwarning(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &errorCode, 0, &neededforwarning, nil) - if ret != 0 { - return 0, "", makeError(uint32(ret)) - } - bufferSizewarning := neededforwarning - bufferwarning := make([]byte, bufferSizewarning) - ret = C.CCall_lib3mf_reader_getwarning(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &errorCode, bufferSizewarning, &filledinwarning, (*C.char)(unsafe.Pointer(&bufferwarning[0]))) - if ret != 0 { - return 0, "", makeError(uint32(ret)) - } - return uint32(errorCode), string(bufferwarning[:(filledinwarning-1)]), nil +func (wrapper Wrapper) NewMetaDataGroup(r ref) MetaDataGroup { + return MetaDataGroup{wrapper.NewBase(r)} } -// GetWarningCount returns Warning and Error Count of the read process. -func (inst Reader) GetWarningCount() (uint32, error) { +// GetMetaDataCount returns the number of metadata in this metadatagroup. +func (inst MetaDataGroup) GetMetaDataCount() (uint32, error) { var count C.uint32_t - ret := C.CCall_lib3mf_reader_getwarningcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) + ret := C.CCall_lib3mf_metadatagroup_getmetadatacount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) if ret != 0 { return 0, makeError(uint32(ret)) } return uint32(count), nil } -// AddKeyWrappingCallback registers a callback to deal with key wrapping mechanism from keystore. -func (inst Reader) AddKeyWrappingCallback(consumerID string, theCallback KeyWrappingCallbackFunc, userData uintptr) error { - ret := C.CCall_lib3mf_reader_addkeywrappingcallback(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(consumerID)[0])), (C.Lib3MFKeyWrappingCallback)(unsafe.Pointer(C.Lib3MFKeyWrappingCallback_cgo)), (C.Lib3MF_pvoid)(userData)) +// GetMetaData returns a metadata value within this metadatagroup. +func (inst MetaDataGroup) GetMetaData(index uint32) (MetaData, error) { + var metaData ref + ret := C.CCall_lib3mf_metadatagroup_getmetadata(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &metaData) if ret != 0 { - return makeError(uint32(ret)) + return MetaData{}, makeError(uint32(ret)) } - keyWrappingCallbackFunc = theCallback - return nil + return inst.wrapperRef.NewMetaData(metaData), nil } -// SetContentEncryptionCallback registers a callback to deal with encryption of content. -func (inst Reader) SetContentEncryptionCallback(theCallback ContentEncryptionCallbackFunc, userData uintptr) error { - ret := C.CCall_lib3mf_reader_setcontentencryptioncallback(inst.wrapperRef.LibraryHandle, inst.Ref, (C.Lib3MFContentEncryptionCallback)(unsafe.Pointer(C.Lib3MFContentEncryptionCallback_cgo)), (C.Lib3MF_pvoid)(userData)) +// GetMetaDataByKey returns a metadata value within this metadatagroup. +func (inst MetaDataGroup) GetMetaDataByKey(nameSpace string, name string) (MetaData, error) { + var metaData ref + ret := C.CCall_lib3mf_metadatagroup_getmetadatabykey(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpace)[0])), (*C.char)(unsafe.Pointer(&[]byte(name)[0])), &metaData) if ret != 0 { - return makeError(uint32(ret)) + return MetaData{}, makeError(uint32(ret)) } - contentEncryptionCallbackFunc = theCallback - return nil -} - - -// PackagePart represents a Lib3MF class. -type PackagePart struct { - Base -} - -func (wrapper Wrapper) NewPackagePart(r ref) PackagePart { - return PackagePart{wrapper.NewBase(r)} + return inst.wrapperRef.NewMetaData(metaData), nil } -// GetPath returns the absolute path of this PackagePart. -func (inst PackagePart) GetPath() (string, error) { - var neededforpath C.uint32_t - var filledinpath C.uint32_t - ret := C.CCall_lib3mf_packagepart_getpath(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforpath, nil) - if ret != 0 { - return "", makeError(uint32(ret)) - } - bufferSizepath := neededforpath - bufferpath := make([]byte, bufferSizepath) - ret = C.CCall_lib3mf_packagepart_getpath(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizepath, &filledinpath, (*C.char)(unsafe.Pointer(&bufferpath[0]))) +// RemoveMetaDataByIndex removes metadata by index from the model. +func (inst MetaDataGroup) RemoveMetaDataByIndex(index uint32) error { + ret := C.CCall_lib3mf_metadatagroup_removemetadatabyindex(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index)) if ret != 0 { - return "", makeError(uint32(ret)) + return makeError(uint32(ret)) } - return string(bufferpath[:(filledinpath-1)]), nil + return nil } -// SetPath sets the absolute path of this PackagePart. -func (inst PackagePart) SetPath(path string) error { - ret := C.CCall_lib3mf_packagepart_setpath(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(path)[0]))) +// RemoveMetaData removes metadata from the model. +func (inst MetaDataGroup) RemoveMetaData(theMetaData MetaData) error { + ret := C.CCall_lib3mf_metadatagroup_removemetadata(inst.wrapperRef.LibraryHandle, inst.Ref, theMetaData.Ref) if ret != 0 { return makeError(uint32(ret)) } return nil } +// AddMetaData adds a new metadata to this metadatagroup. +func (inst MetaDataGroup) AddMetaData(nameSpace string, name string, value string, _type string, mustPreserve bool) (MetaData, error) { + var metaData ref + ret := C.CCall_lib3mf_metadatagroup_addmetadata(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpace)[0])), (*C.char)(unsafe.Pointer(&[]byte(name)[0])), (*C.char)(unsafe.Pointer(&[]byte(value)[0])), (*C.char)(unsafe.Pointer(&[]byte(_type)[0])), C.bool(mustPreserve), &metaData) + if ret != 0 { + return MetaData{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewMetaData(metaData), nil +} -// Resource represents a Lib3MF class. -type Resource struct { - Base + +// Object represents a Lib3MF class. +type Object struct { + Resource } -func (wrapper Wrapper) NewResource(r ref) Resource { - return Resource{wrapper.NewBase(r)} +func (wrapper Wrapper) NewObject(r ref) Object { + return Object{wrapper.NewResource(r)} } -// GetResourceID retrieves the unique id of this resource within a package. This function will be removed in a later release in favor of GetUniqueResourceID. -func (inst Resource) GetResourceID() (uint32, error) { - var uniqueResourceID C.uint32_t - ret := C.CCall_lib3mf_resource_getresourceid(inst.wrapperRef.LibraryHandle, inst.Ref, &uniqueResourceID) +// GetType retrieves an object's type. +func (inst Object) GetType() (ObjectType, error) { + var objectType C.eLib3MFObjectType + ret := C.CCall_lib3mf_object_gettype(inst.wrapperRef.LibraryHandle, inst.Ref, &objectType) if ret != 0 { return 0, makeError(uint32(ret)) } - return uint32(uniqueResourceID), nil + return ObjectType(objectType), nil } -// GetUniqueResourceID retrieves the unique id of this resource within a package. -func (inst Resource) GetUniqueResourceID() (uint32, error) { - var uniqueResourceID C.uint32_t - ret := C.CCall_lib3mf_resource_getuniqueresourceid(inst.wrapperRef.LibraryHandle, inst.Ref, &uniqueResourceID) +// SetType sets an object's type. +func (inst Object) SetType(objectType ObjectType) error { + ret := C.CCall_lib3mf_object_settype(inst.wrapperRef.LibraryHandle, inst.Ref, C.eLib3MFObjectType(objectType)) if ret != 0 { - return 0, makeError(uint32(ret)) + return makeError(uint32(ret)) } - return uint32(uniqueResourceID), nil + return nil } -// PackagePart returns the PackagePart within which this resource resides. -func (inst Resource) PackagePart() (PackagePart, error) { - var packagePart ref - ret := C.CCall_lib3mf_resource_packagepart(inst.wrapperRef.LibraryHandle, inst.Ref, &packagePart) +// GetName retrieves an object's name. +func (inst Object) GetName() (string, error) { + var neededforname C.uint32_t + var filledinname C.uint32_t + ret := C.CCall_lib3mf_object_getname(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforname, nil) if ret != 0 { - return PackagePart{}, makeError(uint32(ret)) + return "", makeError(uint32(ret)) } - return inst.wrapperRef.NewPackagePart(packagePart), nil + bufferSizename := neededforname + buffername := make([]byte, bufferSizename) + ret = C.CCall_lib3mf_object_getname(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizename, &filledinname, (*C.char)(unsafe.Pointer(&buffername[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(buffername[:(filledinname-1)]), nil } -// SetPackagePart sets the new PackagePart within which this resource resides. -func (inst Resource) SetPackagePart(packagePart PackagePart) error { - ret := C.CCall_lib3mf_resource_setpackagepart(inst.wrapperRef.LibraryHandle, inst.Ref, packagePart.Ref) +// SetName sets an object's name string. +func (inst Object) SetName(name string) error { + ret := C.CCall_lib3mf_object_setname(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0]))) if ret != 0 { return makeError(uint32(ret)) } return nil } -// GetModelResourceID retrieves the id of this resource within a model. -func (inst Resource) GetModelResourceID() (uint32, error) { - var modelResourceId C.uint32_t - ret := C.CCall_lib3mf_resource_getmodelresourceid(inst.wrapperRef.LibraryHandle, inst.Ref, &modelResourceId) +// GetPartNumber retrieves an object's part number. +func (inst Object) GetPartNumber() (string, error) { + var neededforpartNumber C.uint32_t + var filledinpartNumber C.uint32_t + ret := C.CCall_lib3mf_object_getpartnumber(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforpartNumber, nil) if ret != 0 { - return 0, makeError(uint32(ret)) + return "", makeError(uint32(ret)) } - return uint32(modelResourceId), nil -} - - -// ResourceIterator represents a Lib3MF class. -type ResourceIterator struct { - Base + bufferSizepartNumber := neededforpartNumber + bufferpartNumber := make([]byte, bufferSizepartNumber) + ret = C.CCall_lib3mf_object_getpartnumber(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizepartNumber, &filledinpartNumber, (*C.char)(unsafe.Pointer(&bufferpartNumber[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(bufferpartNumber[:(filledinpartNumber-1)]), nil } -func (wrapper Wrapper) NewResourceIterator(r ref) ResourceIterator { - return ResourceIterator{wrapper.NewBase(r)} +// SetPartNumber sets an objects partnumber string. +func (inst Object) SetPartNumber(partNumber string) error { + ret := C.CCall_lib3mf_object_setpartnumber(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(partNumber)[0]))) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil } -// MoveNext iterates to the next resource in the list. -func (inst ResourceIterator) MoveNext() (bool, error) { - var hasNext C.bool - ret := C.CCall_lib3mf_resourceiterator_movenext(inst.wrapperRef.LibraryHandle, inst.Ref, &hasNext) +// IsMeshObject retrieves, if an object is a mesh object. +func (inst Object) IsMeshObject() (bool, error) { + var isMeshObject C.bool + ret := C.CCall_lib3mf_object_ismeshobject(inst.wrapperRef.LibraryHandle, inst.Ref, &isMeshObject) if ret != 0 { return false, makeError(uint32(ret)) } - return bool(hasNext), nil + return bool(isMeshObject), nil } -// MovePrevious iterates to the previous resource in the list. -func (inst ResourceIterator) MovePrevious() (bool, error) { - var hasPrevious C.bool - ret := C.CCall_lib3mf_resourceiterator_moveprevious(inst.wrapperRef.LibraryHandle, inst.Ref, &hasPrevious) +// IsComponentsObject retrieves, if an object is a components object. +func (inst Object) IsComponentsObject() (bool, error) { + var isComponentsObject C.bool + ret := C.CCall_lib3mf_object_iscomponentsobject(inst.wrapperRef.LibraryHandle, inst.Ref, &isComponentsObject) if ret != 0 { return false, makeError(uint32(ret)) } - return bool(hasPrevious), nil + return bool(isComponentsObject), nil } -// GetCurrent returns the resource the iterator points at. -func (inst ResourceIterator) GetCurrent() (Resource, error) { - var resource ref - ret := C.CCall_lib3mf_resourceiterator_getcurrent(inst.wrapperRef.LibraryHandle, inst.Ref, &resource) +// IsValid retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. +func (inst Object) IsValid() (bool, error) { + var isValid C.bool + ret := C.CCall_lib3mf_object_isvalid(inst.wrapperRef.LibraryHandle, inst.Ref, &isValid) if ret != 0 { - return Resource{}, makeError(uint32(ret)) + return false, makeError(uint32(ret)) } - return inst.wrapperRef.NewResource(resource), nil + return bool(isValid), nil } -// Clone creates a new resource iterator with the same resource list. -func (inst ResourceIterator) Clone() (ResourceIterator, error) { - var outResourceIterator ref - ret := C.CCall_lib3mf_resourceiterator_clone(inst.wrapperRef.LibraryHandle, inst.Ref, &outResourceIterator) +// SetAttachmentAsThumbnail use an existing attachment as thumbnail for this object. +func (inst Object) SetAttachmentAsThumbnail(attachment Attachment) error { + ret := C.CCall_lib3mf_object_setattachmentasthumbnail(inst.wrapperRef.LibraryHandle, inst.Ref, attachment.Ref) if ret != 0 { - return ResourceIterator{}, makeError(uint32(ret)) + return makeError(uint32(ret)) } - return inst.wrapperRef.NewResourceIterator(outResourceIterator), nil + return nil } -// Count returns the number of resoucres the iterator captures. -func (inst ResourceIterator) Count() (uint64, error) { - var count C.uint64_t - ret := C.CCall_lib3mf_resourceiterator_count(inst.wrapperRef.LibraryHandle, inst.Ref, &count) +// GetThumbnailAttachment get the attachment containing the object thumbnail. +func (inst Object) GetThumbnailAttachment() (*Attachment, error) { + var attachment ref + ret := C.CCall_lib3mf_object_getthumbnailattachment(inst.wrapperRef.LibraryHandle, inst.Ref, &attachment) if ret != 0 { - return 0, makeError(uint32(ret)) + return nil, makeError(uint32(ret)) } - return uint64(count), nil -} - - -// SliceStackIterator represents a Lib3MF class. -type SliceStackIterator struct { - ResourceIterator -} - -func (wrapper Wrapper) NewSliceStackIterator(r ref) SliceStackIterator { - return SliceStackIterator{wrapper.NewResourceIterator(r)} + var _attachmentPtr *Attachment + if attachment != nil { + _attachmentPtrVal := inst.wrapperRef.NewAttachment(attachment) + _attachmentPtr = &_attachmentPtrVal + } + return _attachmentPtr, nil } -// GetCurrentSliceStack returns the SliceStack the iterator points at. -func (inst SliceStackIterator) GetCurrentSliceStack() (SliceStack, error) { - var resource ref - ret := C.CCall_lib3mf_slicestackiterator_getcurrentslicestack(inst.wrapperRef.LibraryHandle, inst.Ref, &resource) +// ClearThumbnailAttachment clears the attachment. The attachment instance is not removed from the package. +func (inst Object) ClearThumbnailAttachment() error { + ret := C.CCall_lib3mf_object_clearthumbnailattachment(inst.wrapperRef.LibraryHandle, inst.Ref) if ret != 0 { - return SliceStack{}, makeError(uint32(ret)) + return makeError(uint32(ret)) } - return inst.wrapperRef.NewSliceStack(resource), nil -} - - -// ObjectIterator represents a Lib3MF class. -type ObjectIterator struct { - ResourceIterator -} - -func (wrapper Wrapper) NewObjectIterator(r ref) ObjectIterator { - return ObjectIterator{wrapper.NewResourceIterator(r)} + return nil } -// GetCurrentObject returns the Object the iterator points at. -func (inst ObjectIterator) GetCurrentObject() (Object, error) { - var resource ref - ret := C.CCall_lib3mf_objectiterator_getcurrentobject(inst.wrapperRef.LibraryHandle, inst.Ref, &resource) +// GetOutbox returns the outbox of a build item. +func (inst Object) GetOutbox() (Box, error) { + var outbox C.sLib3MFBox + ret := C.CCall_lib3mf_object_getoutbox(inst.wrapperRef.LibraryHandle, inst.Ref, &outbox) if ret != 0 { - return Object{}, makeError(uint32(ret)) + return Box{}, makeError(uint32(ret)) } - return inst.wrapperRef.NewObject(resource), nil -} - - -// MeshObjectIterator represents a Lib3MF class. -type MeshObjectIterator struct { - ResourceIterator -} - -func (wrapper Wrapper) NewMeshObjectIterator(r ref) MeshObjectIterator { - return MeshObjectIterator{wrapper.NewResourceIterator(r)} + return *(*Box)(unsafe.Pointer(&outbox)), nil } -// GetCurrentMeshObject returns the MeshObject the iterator points at. -func (inst MeshObjectIterator) GetCurrentMeshObject() (MeshObject, error) { - var resource ref - ret := C.CCall_lib3mf_meshobjectiterator_getcurrentmeshobject(inst.wrapperRef.LibraryHandle, inst.Ref, &resource) +// GetUUID retrieves an object's uuid string (see production extension specification). +func (inst Object) GetUUID() (bool, string, error) { + var hasUUID C.bool + var neededforuUID C.uint32_t + var filledinuUID C.uint32_t + ret := C.CCall_lib3mf_object_getuuid(inst.wrapperRef.LibraryHandle, inst.Ref, &hasUUID, 0, &neededforuUID, nil) if ret != 0 { - return MeshObject{}, makeError(uint32(ret)) + return false, "", makeError(uint32(ret)) } - return inst.wrapperRef.NewMeshObject(resource), nil -} - - -// ComponentsObjectIterator represents a Lib3MF class. -type ComponentsObjectIterator struct { - ResourceIterator + bufferSizeuUID := neededforuUID + bufferuUID := make([]byte, bufferSizeuUID) + ret = C.CCall_lib3mf_object_getuuid(inst.wrapperRef.LibraryHandle, inst.Ref, &hasUUID, bufferSizeuUID, &filledinuUID, (*C.char)(unsafe.Pointer(&bufferuUID[0]))) + if ret != 0 { + return false, "", makeError(uint32(ret)) + } + return bool(hasUUID), string(bufferuUID[:(filledinuUID-1)]), nil } -func (wrapper Wrapper) NewComponentsObjectIterator(r ref) ComponentsObjectIterator { - return ComponentsObjectIterator{wrapper.NewResourceIterator(r)} +// SetUUID sets a build object's uuid string (see production extension specification). +func (inst Object) SetUUID(uUID string) error { + ret := C.CCall_lib3mf_object_setuuid(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(uUID)[0]))) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil } -// GetCurrentComponentsObject returns the ComponentsObject the iterator points at. -func (inst ComponentsObjectIterator) GetCurrentComponentsObject() (ComponentsObject, error) { - var resource ref - ret := C.CCall_lib3mf_componentsobjectiterator_getcurrentcomponentsobject(inst.wrapperRef.LibraryHandle, inst.Ref, &resource) +// GetMetaDataGroup returns the metadatagroup of this object. +func (inst Object) GetMetaDataGroup() (MetaDataGroup, error) { + var metaDataGroup ref + ret := C.CCall_lib3mf_object_getmetadatagroup(inst.wrapperRef.LibraryHandle, inst.Ref, &metaDataGroup) if ret != 0 { - return ComponentsObject{}, makeError(uint32(ret)) + return MetaDataGroup{}, makeError(uint32(ret)) } - return inst.wrapperRef.NewComponentsObject(resource), nil + return inst.wrapperRef.NewMetaDataGroup(metaDataGroup), nil } - -// Texture2DIterator represents a Lib3MF class. -type Texture2DIterator struct { - ResourceIterator +// SetSlicesMeshResolution set the meshresolution of the mesh object. +func (inst Object) SetSlicesMeshResolution(meshResolution SlicesMeshResolution) error { + ret := C.CCall_lib3mf_object_setslicesmeshresolution(inst.wrapperRef.LibraryHandle, inst.Ref, C.eLib3MFSlicesMeshResolution(meshResolution)) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil } -func (wrapper Wrapper) NewTexture2DIterator(r ref) Texture2DIterator { - return Texture2DIterator{wrapper.NewResourceIterator(r)} +// GetSlicesMeshResolution get the meshresolution of the mesh object. +func (inst Object) GetSlicesMeshResolution() (SlicesMeshResolution, error) { + var meshResolution C.eLib3MFSlicesMeshResolution + ret := C.CCall_lib3mf_object_getslicesmeshresolution(inst.wrapperRef.LibraryHandle, inst.Ref, &meshResolution) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return SlicesMeshResolution(meshResolution), nil } -// GetCurrentTexture2D returns the Texture2D the iterator points at. -func (inst Texture2DIterator) GetCurrentTexture2D() (Texture2D, error) { - var resource ref - ret := C.CCall_lib3mf_texture2diterator_getcurrenttexture2d(inst.wrapperRef.LibraryHandle, inst.Ref, &resource) +// HasSlices returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack. +func (inst Object) HasSlices(recursive bool) (bool, error) { + var hasSlices C.bool + ret := C.CCall_lib3mf_object_hasslices(inst.wrapperRef.LibraryHandle, inst.Ref, C.bool(recursive), &hasSlices) if ret != 0 { - return Texture2D{}, makeError(uint32(ret)) + return false, makeError(uint32(ret)) } - return inst.wrapperRef.NewTexture2D(resource), nil + return bool(hasSlices), nil } - -// BaseMaterialGroupIterator represents a Lib3MF class. -type BaseMaterialGroupIterator struct { - ResourceIterator +// ClearSliceStack unlinks the attached slicestack from this object. If no slice stack is attached, do noting. +func (inst Object) ClearSliceStack() error { + ret := C.CCall_lib3mf_object_clearslicestack(inst.wrapperRef.LibraryHandle, inst.Ref) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil } -func (wrapper Wrapper) NewBaseMaterialGroupIterator(r ref) BaseMaterialGroupIterator { - return BaseMaterialGroupIterator{wrapper.NewResourceIterator(r)} +// GetSliceStack get the Slicestack attached to the object. +func (inst Object) GetSliceStack() (SliceStack, error) { + var sliceStackInstance ref + ret := C.CCall_lib3mf_object_getslicestack(inst.wrapperRef.LibraryHandle, inst.Ref, &sliceStackInstance) + if ret != 0 { + return SliceStack{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewSliceStack(sliceStackInstance), nil } -// GetCurrentBaseMaterialGroup returns the MaterialGroup the iterator points at. -func (inst BaseMaterialGroupIterator) GetCurrentBaseMaterialGroup() (BaseMaterialGroup, error) { - var resource ref - ret := C.CCall_lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup(inst.wrapperRef.LibraryHandle, inst.Ref, &resource) +// AssignSliceStack assigns a slicestack to the object. +func (inst Object) AssignSliceStack(sliceStackInstance SliceStack) error { + ret := C.CCall_lib3mf_object_assignslicestack(inst.wrapperRef.LibraryHandle, inst.Ref, sliceStackInstance.Ref) if ret != 0 { - return BaseMaterialGroup{}, makeError(uint32(ret)) + return makeError(uint32(ret)) } - return inst.wrapperRef.NewBaseMaterialGroup(resource), nil + return nil } -// ColorGroupIterator represents a Lib3MF class. -type ColorGroupIterator struct { - ResourceIterator +// MeshObject represents a Lib3MF class. +type MeshObject struct { + Object } -func (wrapper Wrapper) NewColorGroupIterator(r ref) ColorGroupIterator { - return ColorGroupIterator{wrapper.NewResourceIterator(r)} +func (wrapper Wrapper) NewMeshObject(r ref) MeshObject { + return MeshObject{wrapper.NewObject(r)} } -// GetCurrentColorGroup returns the ColorGroup the iterator points at. -func (inst ColorGroupIterator) GetCurrentColorGroup() (ColorGroup, error) { - var resource ref - ret := C.CCall_lib3mf_colorgroupiterator_getcurrentcolorgroup(inst.wrapperRef.LibraryHandle, inst.Ref, &resource) +// GetVertexCount returns the vertex count of a mesh object. +func (inst MeshObject) GetVertexCount() (uint32, error) { + var vertexCount C.uint32_t + ret := C.CCall_lib3mf_meshobject_getvertexcount(inst.wrapperRef.LibraryHandle, inst.Ref, &vertexCount) if ret != 0 { - return ColorGroup{}, makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return inst.wrapperRef.NewColorGroup(resource), nil + return uint32(vertexCount), nil } - -// Texture2DGroupIterator represents a Lib3MF class. -type Texture2DGroupIterator struct { - ResourceIterator +// GetTriangleCount returns the triangle count of a mesh object. +func (inst MeshObject) GetTriangleCount() (uint32, error) { + var vertexCount C.uint32_t + ret := C.CCall_lib3mf_meshobject_gettrianglecount(inst.wrapperRef.LibraryHandle, inst.Ref, &vertexCount) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return uint32(vertexCount), nil } -func (wrapper Wrapper) NewTexture2DGroupIterator(r ref) Texture2DGroupIterator { - return Texture2DGroupIterator{wrapper.NewResourceIterator(r)} +// GetVertex returns the vertex count of a mesh object. +func (inst MeshObject) GetVertex(index uint32) (Position, error) { + var coordinates C.sLib3MFPosition + ret := C.CCall_lib3mf_meshobject_getvertex(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &coordinates) + if ret != 0 { + return Position{}, makeError(uint32(ret)) + } + return *(*Position)(unsafe.Pointer(&coordinates)), nil } -// GetCurrentTexture2DGroup returns the Texture2DGroup the iterator points at. -func (inst Texture2DGroupIterator) GetCurrentTexture2DGroup() (Texture2DGroup, error) { - var resource ref - ret := C.CCall_lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup(inst.wrapperRef.LibraryHandle, inst.Ref, &resource) +// SetVertex sets the coordinates of a single vertex of a mesh object. +func (inst MeshObject) SetVertex(index uint32, coordinates Position) error { + ret := C.CCall_lib3mf_meshobject_setvertex(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), (*C.sLib3MFPosition)(unsafe.Pointer(&coordinates))) if ret != 0 { - return Texture2DGroup{}, makeError(uint32(ret)) + return makeError(uint32(ret)) } - return inst.wrapperRef.NewTexture2DGroup(resource), nil + return nil } - -// CompositeMaterialsIterator represents a Lib3MF class. -type CompositeMaterialsIterator struct { - ResourceIterator +// AddVertex adds a single vertex to a mesh object. +func (inst MeshObject) AddVertex(coordinates Position) (uint32, error) { + var newIndex C.uint32_t + ret := C.CCall_lib3mf_meshobject_addvertex(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.sLib3MFPosition)(unsafe.Pointer(&coordinates)), &newIndex) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return uint32(newIndex), nil } -func (wrapper Wrapper) NewCompositeMaterialsIterator(r ref) CompositeMaterialsIterator { - return CompositeMaterialsIterator{wrapper.NewResourceIterator(r)} +// GetVertices obtains all vertex positions of a mesh object. +func (inst MeshObject) GetVertices(vertices []Position) ([]Position, error) { + var neededforvertices C.uint64_t + ret := C.CCall_lib3mf_meshobject_getvertices(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforvertices, nil) + if ret != 0 { + return nil, makeError(uint32(ret)) + } + if len(vertices) < int(neededforvertices) { + vertices = append(vertices, make([]Position, int(neededforvertices)-len(vertices))...) + } + ret = C.CCall_lib3mf_meshobject_getvertices(inst.wrapperRef.LibraryHandle, inst.Ref, neededforvertices, nil, (*C.sLib3MFPosition)(unsafe.Pointer(&vertices[0]))) + if ret != 0 { + return nil, makeError(uint32(ret)) + } + return vertices[:int(neededforvertices)], nil } -// GetCurrentCompositeMaterials returns the CompositeMaterials the iterator points at. -func (inst CompositeMaterialsIterator) GetCurrentCompositeMaterials() (CompositeMaterials, error) { - var resource ref - ret := C.CCall_lib3mf_compositematerialsiterator_getcurrentcompositematerials(inst.wrapperRef.LibraryHandle, inst.Ref, &resource) +// GetTriangle returns indices of a single triangle of a mesh object. +func (inst MeshObject) GetTriangle(index uint32) (Triangle, error) { + var indices C.sLib3MFTriangle + ret := C.CCall_lib3mf_meshobject_gettriangle(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &indices) if ret != 0 { - return CompositeMaterials{}, makeError(uint32(ret)) + return Triangle{}, makeError(uint32(ret)) } - return inst.wrapperRef.NewCompositeMaterials(resource), nil + return *(*Triangle)(unsafe.Pointer(&indices)), nil } - -// MultiPropertyGroupIterator represents a Lib3MF class. -type MultiPropertyGroupIterator struct { - ResourceIterator +// SetTriangle sets the indices of a single triangle of a mesh object. +func (inst MeshObject) SetTriangle(index uint32, indices Triangle) error { + ret := C.CCall_lib3mf_meshobject_settriangle(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), (*C.sLib3MFTriangle)(unsafe.Pointer(&indices))) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil } -func (wrapper Wrapper) NewMultiPropertyGroupIterator(r ref) MultiPropertyGroupIterator { - return MultiPropertyGroupIterator{wrapper.NewResourceIterator(r)} +// AddTriangle adds a single triangle to a mesh object. +func (inst MeshObject) AddTriangle(indices Triangle) (uint32, error) { + var newIndex C.uint32_t + ret := C.CCall_lib3mf_meshobject_addtriangle(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.sLib3MFTriangle)(unsafe.Pointer(&indices)), &newIndex) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return uint32(newIndex), nil } -// GetCurrentMultiPropertyGroup returns the MultiPropertyGroup the iterator points at. -func (inst MultiPropertyGroupIterator) GetCurrentMultiPropertyGroup() (MultiPropertyGroup, error) { - var resource ref - ret := C.CCall_lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup(inst.wrapperRef.LibraryHandle, inst.Ref, &resource) +// GetTriangleIndices get all triangles of a mesh object. +func (inst MeshObject) GetTriangleIndices(indices []Triangle) ([]Triangle, error) { + var neededforindices C.uint64_t + ret := C.CCall_lib3mf_meshobject_gettriangleindices(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforindices, nil) if ret != 0 { - return MultiPropertyGroup{}, makeError(uint32(ret)) + return nil, makeError(uint32(ret)) } - return inst.wrapperRef.NewMultiPropertyGroup(resource), nil + if len(indices) < int(neededforindices) { + indices = append(indices, make([]Triangle, int(neededforindices)-len(indices))...) + } + ret = C.CCall_lib3mf_meshobject_gettriangleindices(inst.wrapperRef.LibraryHandle, inst.Ref, neededforindices, nil, (*C.sLib3MFTriangle)(unsafe.Pointer(&indices[0]))) + if ret != 0 { + return nil, makeError(uint32(ret)) + } + return indices[:int(neededforindices)], nil } - -// MetaData represents a Lib3MF class. -type MetaData struct { - Base +// SetObjectLevelProperty sets the property at the object-level of the mesh object. +func (inst MeshObject) SetObjectLevelProperty(uniqueResourceID uint32, propertyID uint32) error { + ret := C.CCall_lib3mf_meshobject_setobjectlevelproperty(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(uniqueResourceID), C.uint32_t(propertyID)) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil } -func (wrapper Wrapper) NewMetaData(r ref) MetaData { - return MetaData{wrapper.NewBase(r)} +// GetObjectLevelProperty gets the property at the object-level of the mesh object. +func (inst MeshObject) GetObjectLevelProperty() (uint32, uint32, bool, error) { + var uniqueResourceID C.uint32_t + var propertyID C.uint32_t + var hasObjectLevelProperty C.bool + ret := C.CCall_lib3mf_meshobject_getobjectlevelproperty(inst.wrapperRef.LibraryHandle, inst.Ref, &uniqueResourceID, &propertyID, &hasObjectLevelProperty) + if ret != 0 { + return 0, 0, false, makeError(uint32(ret)) + } + return uint32(uniqueResourceID), uint32(propertyID), bool(hasObjectLevelProperty), nil } -// GetNameSpace returns the namespace URL of the metadata. -func (inst MetaData) GetNameSpace() (string, error) { - var neededfornameSpace C.uint32_t - var filledinnameSpace C.uint32_t - ret := C.CCall_lib3mf_metadata_getnamespace(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededfornameSpace, nil) +// SetTriangleProperties sets the properties of a single triangle of a mesh object. +func (inst MeshObject) SetTriangleProperties(index uint32, properties TriangleProperties) error { + ret := C.CCall_lib3mf_meshobject_settriangleproperties(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), (*C.sLib3MFTriangleProperties)(unsafe.Pointer(&properties))) if ret != 0 { - return "", makeError(uint32(ret)) + return makeError(uint32(ret)) } - bufferSizenameSpace := neededfornameSpace - buffernameSpace := make([]byte, bufferSizenameSpace) - ret = C.CCall_lib3mf_metadata_getnamespace(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizenameSpace, &filledinnameSpace, (*C.char)(unsafe.Pointer(&buffernameSpace[0]))) + return nil +} + +// GetTriangleProperties gets the properties of a single triangle of a mesh object. +func (inst MeshObject) GetTriangleProperties(index uint32) (TriangleProperties, error) { + var property C.sLib3MFTriangleProperties + ret := C.CCall_lib3mf_meshobject_gettriangleproperties(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &property) if ret != 0 { - return "", makeError(uint32(ret)) + return TriangleProperties{}, makeError(uint32(ret)) } - return string(buffernameSpace[:(filledinnameSpace-1)]), nil + return *(*TriangleProperties)(unsafe.Pointer(&property)), nil } -// SetNameSpace sets a new namespace URL of the metadata. -func (inst MetaData) SetNameSpace(nameSpace string) error { - ret := C.CCall_lib3mf_metadata_setnamespace(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpace)[0]))) +// SetAllTriangleProperties sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. +func (inst MeshObject) SetAllTriangleProperties(propertiesArray []TriangleProperties) error { + ret := C.CCall_lib3mf_meshobject_setalltriangleproperties(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(propertiesArray)), (*C.sLib3MFTriangleProperties)(unsafe.Pointer(&propertiesArray[0]))) if ret != 0 { return makeError(uint32(ret)) } return nil } -// GetName returns the name of a metadata. -func (inst MetaData) GetName() (string, error) { - var neededforname C.uint32_t - var filledinname C.uint32_t - ret := C.CCall_lib3mf_metadata_getname(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforname, nil) +// GetAllTriangleProperties gets the properties of all triangles of a mesh object. +func (inst MeshObject) GetAllTriangleProperties(propertiesArray []TriangleProperties) ([]TriangleProperties, error) { + var neededforpropertiesArray C.uint64_t + ret := C.CCall_lib3mf_meshobject_getalltriangleproperties(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforpropertiesArray, nil) if ret != 0 { - return "", makeError(uint32(ret)) + return nil, makeError(uint32(ret)) } - bufferSizename := neededforname - buffername := make([]byte, bufferSizename) - ret = C.CCall_lib3mf_metadata_getname(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizename, &filledinname, (*C.char)(unsafe.Pointer(&buffername[0]))) + if len(propertiesArray) < int(neededforpropertiesArray) { + propertiesArray = append(propertiesArray, make([]TriangleProperties, int(neededforpropertiesArray)-len(propertiesArray))...) + } + ret = C.CCall_lib3mf_meshobject_getalltriangleproperties(inst.wrapperRef.LibraryHandle, inst.Ref, neededforpropertiesArray, nil, (*C.sLib3MFTriangleProperties)(unsafe.Pointer(&propertiesArray[0]))) if ret != 0 { - return "", makeError(uint32(ret)) + return nil, makeError(uint32(ret)) } - return string(buffername[:(filledinname-1)]), nil + return propertiesArray[:int(neededforpropertiesArray)], nil } -// SetName sets a new name of a metadata. -func (inst MetaData) SetName(name string) error { - ret := C.CCall_lib3mf_metadata_setname(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0]))) +// ClearAllProperties clears all properties of this mesh object (triangle and object-level). +func (inst MeshObject) ClearAllProperties() error { + ret := C.CCall_lib3mf_meshobject_clearallproperties(inst.wrapperRef.LibraryHandle, inst.Ref) if ret != 0 { return makeError(uint32(ret)) } return nil } -// GetKey returns the (namespace+name) of a metadata. -func (inst MetaData) GetKey() (string, error) { - var neededforkey C.uint32_t - var filledinkey C.uint32_t - ret := C.CCall_lib3mf_metadata_getkey(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforkey, nil) +// SetGeometry set all triangles of a mesh object. +func (inst MeshObject) SetGeometry(vertices []Position, indices []Triangle) error { + ret := C.CCall_lib3mf_meshobject_setgeometry(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(vertices)), (*C.sLib3MFPosition)(unsafe.Pointer(&vertices[0])), C.uint64_t(len(indices)), (*C.sLib3MFTriangle)(unsafe.Pointer(&indices[0]))) if ret != 0 { - return "", makeError(uint32(ret)) + return makeError(uint32(ret)) } - bufferSizekey := neededforkey - bufferkey := make([]byte, bufferSizekey) - ret = C.CCall_lib3mf_metadata_getkey(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizekey, &filledinkey, (*C.char)(unsafe.Pointer(&bufferkey[0]))) + return nil +} + +// IsManifoldAndOriented retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. +func (inst MeshObject) IsManifoldAndOriented() (bool, error) { + var isManifoldAndOriented C.bool + ret := C.CCall_lib3mf_meshobject_ismanifoldandoriented(inst.wrapperRef.LibraryHandle, inst.Ref, &isManifoldAndOriented) if ret != 0 { - return "", makeError(uint32(ret)) + return false, makeError(uint32(ret)) } - return string(bufferkey[:(filledinkey-1)]), nil + return bool(isManifoldAndOriented), nil } -// GetMustPreserve returns, whether a metadata must be preserved. -func (inst MetaData) GetMustPreserve() (bool, error) { - var mustPreserve C.bool - ret := C.CCall_lib3mf_metadata_getmustpreserve(inst.wrapperRef.LibraryHandle, inst.Ref, &mustPreserve) +// BeamLattice retrieves the BeamLattice within this MeshObject. +func (inst MeshObject) BeamLattice() (BeamLattice, error) { + var theBeamLattice ref + ret := C.CCall_lib3mf_meshobject_beamlattice(inst.wrapperRef.LibraryHandle, inst.Ref, &theBeamLattice) if ret != 0 { - return false, makeError(uint32(ret)) + return BeamLattice{}, makeError(uint32(ret)) } - return bool(mustPreserve), nil + return inst.wrapperRef.NewBeamLattice(theBeamLattice), nil } -// SetMustPreserve sets whether a metadata must be preserved. -func (inst MetaData) SetMustPreserve(mustPreserve bool) error { - ret := C.CCall_lib3mf_metadata_setmustpreserve(inst.wrapperRef.LibraryHandle, inst.Ref, C.bool(mustPreserve)) + +// BeamLattice represents a Lib3MF class. +type BeamLattice struct { + Base +} + +func (wrapper Wrapper) NewBeamLattice(r ref) BeamLattice { + return BeamLattice{wrapper.NewBase(r)} +} + +// GetMinLength returns the minimal length of beams for the beamlattice. +func (inst BeamLattice) GetMinLength() (float64, error) { + var minLength C.double + ret := C.CCall_lib3mf_beamlattice_getminlength(inst.wrapperRef.LibraryHandle, inst.Ref, &minLength) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return float64(minLength), nil +} + +// SetMinLength sets the minimal length of beams for the beamlattice. +func (inst BeamLattice) SetMinLength(minLength float64) error { + ret := C.CCall_lib3mf_beamlattice_setminlength(inst.wrapperRef.LibraryHandle, inst.Ref, C.double(minLength)) if ret != 0 { return makeError(uint32(ret)) } return nil } -// GetType returns the type of a metadata. -func (inst MetaData) GetType() (string, error) { - var neededfor_type C.uint32_t - var filledin_type C.uint32_t - ret := C.CCall_lib3mf_metadata_gettype(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededfor_type, nil) - if ret != 0 { - return "", makeError(uint32(ret)) - } - bufferSize_type := neededfor_type - buffer_type := make([]byte, bufferSize_type) - ret = C.CCall_lib3mf_metadata_gettype(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSize_type, &filledin_type, (*C.char)(unsafe.Pointer(&buffer_type[0]))) +// GetClipping returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. +func (inst BeamLattice) GetClipping() (BeamLatticeClipMode, uint32, error) { + var clipMode C.eLib3MFBeamLatticeClipMode + var uniqueResourceID C.uint32_t + ret := C.CCall_lib3mf_beamlattice_getclipping(inst.wrapperRef.LibraryHandle, inst.Ref, &clipMode, &uniqueResourceID) if ret != 0 { - return "", makeError(uint32(ret)) + return 0, 0, makeError(uint32(ret)) } - return string(buffer_type[:(filledin_type-1)]), nil + return BeamLatticeClipMode(clipMode), uint32(uniqueResourceID), nil } -// SetType sets a new type of a metadata. This must be a simple XML type. -func (inst MetaData) SetType(_type string) error { - ret := C.CCall_lib3mf_metadata_settype(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(_type)[0]))) +// SetClipping sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. +func (inst BeamLattice) SetClipping(clipMode BeamLatticeClipMode, uniqueResourceID uint32) error { + ret := C.CCall_lib3mf_beamlattice_setclipping(inst.wrapperRef.LibraryHandle, inst.Ref, C.eLib3MFBeamLatticeClipMode(clipMode), C.uint32_t(uniqueResourceID)) if ret != 0 { return makeError(uint32(ret)) } return nil } -// GetValue returns the value of the metadata. -func (inst MetaData) GetValue() (string, error) { - var neededforvalue C.uint32_t - var filledinvalue C.uint32_t - ret := C.CCall_lib3mf_metadata_getvalue(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforvalue, nil) - if ret != 0 { - return "", makeError(uint32(ret)) - } - bufferSizevalue := neededforvalue - buffervalue := make([]byte, bufferSizevalue) - ret = C.CCall_lib3mf_metadata_getvalue(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizevalue, &filledinvalue, (*C.char)(unsafe.Pointer(&buffervalue[0]))) +// GetRepresentation returns the representation-mesh for the beamlattice of this mesh. +func (inst BeamLattice) GetRepresentation() (bool, uint32, error) { + var hasRepresentation C.bool + var uniqueResourceID C.uint32_t + ret := C.CCall_lib3mf_beamlattice_getrepresentation(inst.wrapperRef.LibraryHandle, inst.Ref, &hasRepresentation, &uniqueResourceID) if ret != 0 { - return "", makeError(uint32(ret)) + return false, 0, makeError(uint32(ret)) } - return string(buffervalue[:(filledinvalue-1)]), nil + return bool(hasRepresentation), uint32(uniqueResourceID), nil } -// SetValue sets a new value of the metadata. -func (inst MetaData) SetValue(value string) error { - ret := C.CCall_lib3mf_metadata_setvalue(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(value)[0]))) +// SetRepresentation sets the representation-mesh for the beamlattice of this mesh. +func (inst BeamLattice) SetRepresentation(uniqueResourceID uint32) error { + ret := C.CCall_lib3mf_beamlattice_setrepresentation(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(uniqueResourceID)) if ret != 0 { return makeError(uint32(ret)) } return nil } - -// MetaDataGroup represents a Lib3MF class. -type MetaDataGroup struct { - Base +// GetBallOptions returns the ball mode and the default ball radius for the beamlattice of this mesh. +func (inst BeamLattice) GetBallOptions() (BeamLatticeBallMode, float64, error) { + var ballMode C.eLib3MFBeamLatticeBallMode + var ballRadius C.double + ret := C.CCall_lib3mf_beamlattice_getballoptions(inst.wrapperRef.LibraryHandle, inst.Ref, &ballMode, &ballRadius) + if ret != 0 { + return 0, 0, makeError(uint32(ret)) + } + return BeamLatticeBallMode(ballMode), float64(ballRadius), nil } -func (wrapper Wrapper) NewMetaDataGroup(r ref) MetaDataGroup { - return MetaDataGroup{wrapper.NewBase(r)} +// SetBallOptions sets the ball mode and thedefault ball radius for the beamlattice. +func (inst BeamLattice) SetBallOptions(ballMode BeamLatticeBallMode, ballRadius float64) error { + ret := C.CCall_lib3mf_beamlattice_setballoptions(inst.wrapperRef.LibraryHandle, inst.Ref, C.eLib3MFBeamLatticeBallMode(ballMode), C.double(ballRadius)) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil } -// GetMetaDataCount returns the number of metadata in this metadatagroup. -func (inst MetaDataGroup) GetMetaDataCount() (uint32, error) { +// GetBeamCount returns the beam count of a mesh object. +func (inst BeamLattice) GetBeamCount() (uint32, error) { var count C.uint32_t - ret := C.CCall_lib3mf_metadatagroup_getmetadatacount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) + ret := C.CCall_lib3mf_beamlattice_getbeamcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) if ret != 0 { return 0, makeError(uint32(ret)) } return uint32(count), nil } -// GetMetaData returns a metadata value within this metadatagroup. -func (inst MetaDataGroup) GetMetaData(index uint32) (MetaData, error) { - var metaData ref - ret := C.CCall_lib3mf_metadatagroup_getmetadata(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &metaData) +// GetBeam returns indices, radii and capmodes of a single beam of a mesh object. +func (inst BeamLattice) GetBeam(index uint32) (Beam, error) { + var beamInfo C.sLib3MFBeam + ret := C.CCall_lib3mf_beamlattice_getbeam(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &beamInfo) if ret != 0 { - return MetaData{}, makeError(uint32(ret)) + return Beam{}, makeError(uint32(ret)) } - return inst.wrapperRef.NewMetaData(metaData), nil + return *(*Beam)(unsafe.Pointer(&beamInfo)), nil } -// GetMetaDataByKey returns a metadata value within this metadatagroup. -func (inst MetaDataGroup) GetMetaDataByKey(nameSpace string, name string) (MetaData, error) { - var metaData ref - ret := C.CCall_lib3mf_metadatagroup_getmetadatabykey(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpace)[0])), (*C.char)(unsafe.Pointer(&[]byte(name)[0])), &metaData) +// AddBeam adds a single beam to a mesh object. +func (inst BeamLattice) AddBeam(beamInfo Beam) (uint32, error) { + var index C.uint32_t + ret := C.CCall_lib3mf_beamlattice_addbeam(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.sLib3MFBeam)(unsafe.Pointer(&beamInfo)), &index) if ret != 0 { - return MetaData{}, makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return inst.wrapperRef.NewMetaData(metaData), nil + return uint32(index), nil } -// RemoveMetaDataByIndex removes metadata by index from the model. -func (inst MetaDataGroup) RemoveMetaDataByIndex(index uint32) error { - ret := C.CCall_lib3mf_metadatagroup_removemetadatabyindex(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index)) +// SetBeam sets the indices, radii and capmodes of a single beam of a mesh object. +func (inst BeamLattice) SetBeam(index uint32, beamInfo Beam) error { + ret := C.CCall_lib3mf_beamlattice_setbeam(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), (*C.sLib3MFBeam)(unsafe.Pointer(&beamInfo))) if ret != 0 { return makeError(uint32(ret)) } return nil } -// RemoveMetaData removes metadata from the model. -func (inst MetaDataGroup) RemoveMetaData(theMetaData MetaData) error { - ret := C.CCall_lib3mf_metadatagroup_removemetadata(inst.wrapperRef.LibraryHandle, inst.Ref, theMetaData.Ref) +// SetBeams sets all beam indices, radii and capmodes of a mesh object. +func (inst BeamLattice) SetBeams(beamInfo []Beam) error { + ret := C.CCall_lib3mf_beamlattice_setbeams(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(beamInfo)), (*C.sLib3MFBeam)(unsafe.Pointer(&beamInfo[0]))) if ret != 0 { return makeError(uint32(ret)) } return nil } -// AddMetaData adds a new metadata to this metadatagroup. -func (inst MetaDataGroup) AddMetaData(nameSpace string, name string, value string, _type string, mustPreserve bool) (MetaData, error) { - var metaData ref - ret := C.CCall_lib3mf_metadatagroup_addmetadata(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpace)[0])), (*C.char)(unsafe.Pointer(&[]byte(name)[0])), (*C.char)(unsafe.Pointer(&[]byte(value)[0])), (*C.char)(unsafe.Pointer(&[]byte(_type)[0])), C.bool(mustPreserve), &metaData) +// GetBeams obtains all beam indices, radii and capmodes of a mesh object. +func (inst BeamLattice) GetBeams(beamInfo []Beam) ([]Beam, error) { + var neededforbeamInfo C.uint64_t + ret := C.CCall_lib3mf_beamlattice_getbeams(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforbeamInfo, nil) if ret != 0 { - return MetaData{}, makeError(uint32(ret)) + return nil, makeError(uint32(ret)) } - return inst.wrapperRef.NewMetaData(metaData), nil -} - - -// Object represents a Lib3MF class. -type Object struct { - Resource -} - -func (wrapper Wrapper) NewObject(r ref) Object { - return Object{wrapper.NewResource(r)} + if len(beamInfo) < int(neededforbeamInfo) { + beamInfo = append(beamInfo, make([]Beam, int(neededforbeamInfo)-len(beamInfo))...) + } + ret = C.CCall_lib3mf_beamlattice_getbeams(inst.wrapperRef.LibraryHandle, inst.Ref, neededforbeamInfo, nil, (*C.sLib3MFBeam)(unsafe.Pointer(&beamInfo[0]))) + if ret != 0 { + return nil, makeError(uint32(ret)) + } + return beamInfo[:int(neededforbeamInfo)], nil } -// GetType retrieves an object's type. -func (inst Object) GetType() (ObjectType, error) { - var objectType C.eLib3MFObjectType - ret := C.CCall_lib3mf_object_gettype(inst.wrapperRef.LibraryHandle, inst.Ref, &objectType) +// GetBallCount returns the ball count of a mesh object. +func (inst BeamLattice) GetBallCount() (uint32, error) { + var count C.uint32_t + ret := C.CCall_lib3mf_beamlattice_getballcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) if ret != 0 { return 0, makeError(uint32(ret)) } - return ObjectType(objectType), nil + return uint32(count), nil } -// SetType sets an object's type. -func (inst Object) SetType(objectType ObjectType) error { - ret := C.CCall_lib3mf_object_settype(inst.wrapperRef.LibraryHandle, inst.Ref, C.eLib3MFObjectType(objectType)) +// GetBall returns index and radius of a single ball of a mesh object. +func (inst BeamLattice) GetBall(index uint32) (Ball, error) { + var ballInfo C.sLib3MFBall + ret := C.CCall_lib3mf_beamlattice_getball(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &ballInfo) if ret != 0 { - return makeError(uint32(ret)) + return Ball{}, makeError(uint32(ret)) } - return nil + return *(*Ball)(unsafe.Pointer(&ballInfo)), nil } -// GetName retrieves an object's name. -func (inst Object) GetName() (string, error) { - var neededforname C.uint32_t - var filledinname C.uint32_t - ret := C.CCall_lib3mf_object_getname(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforname, nil) - if ret != 0 { - return "", makeError(uint32(ret)) - } - bufferSizename := neededforname - buffername := make([]byte, bufferSizename) - ret = C.CCall_lib3mf_object_getname(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizename, &filledinname, (*C.char)(unsafe.Pointer(&buffername[0]))) +// AddBall adds a single ball to a mesh object. +func (inst BeamLattice) AddBall(ballInfo Ball) (uint32, error) { + var index C.uint32_t + ret := C.CCall_lib3mf_beamlattice_addball(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.sLib3MFBall)(unsafe.Pointer(&ballInfo)), &index) if ret != 0 { - return "", makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return string(buffername[:(filledinname-1)]), nil + return uint32(index), nil } -// SetName sets an object's name string. -func (inst Object) SetName(name string) error { - ret := C.CCall_lib3mf_object_setname(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0]))) +// SetBall sets the index and radius of a single ball of a mesh object. +func (inst BeamLattice) SetBall(index uint32, ballInfo Ball) error { + ret := C.CCall_lib3mf_beamlattice_setball(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), (*C.sLib3MFBall)(unsafe.Pointer(&ballInfo))) if ret != 0 { return makeError(uint32(ret)) } return nil } -// GetPartNumber retrieves an object's part number. -func (inst Object) GetPartNumber() (string, error) { - var neededforpartNumber C.uint32_t - var filledinpartNumber C.uint32_t - ret := C.CCall_lib3mf_object_getpartnumber(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforpartNumber, nil) - if ret != 0 { - return "", makeError(uint32(ret)) - } - bufferSizepartNumber := neededforpartNumber - bufferpartNumber := make([]byte, bufferSizepartNumber) - ret = C.CCall_lib3mf_object_getpartnumber(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizepartNumber, &filledinpartNumber, (*C.char)(unsafe.Pointer(&bufferpartNumber[0]))) - if ret != 0 { - return "", makeError(uint32(ret)) - } - return string(bufferpartNumber[:(filledinpartNumber-1)]), nil -} - -// SetPartNumber sets an objects partnumber string. -func (inst Object) SetPartNumber(partNumber string) error { - ret := C.CCall_lib3mf_object_setpartnumber(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(partNumber)[0]))) +// SetBalls sets all ball indices and radii of a mesh object. +func (inst BeamLattice) SetBalls(ballInfo []Ball) error { + ret := C.CCall_lib3mf_beamlattice_setballs(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(ballInfo)), (*C.sLib3MFBall)(unsafe.Pointer(&ballInfo[0]))) if ret != 0 { return makeError(uint32(ret)) } return nil } -// IsMeshObject retrieves, if an object is a mesh object. -func (inst Object) IsMeshObject() (bool, error) { - var isMeshObject C.bool - ret := C.CCall_lib3mf_object_ismeshobject(inst.wrapperRef.LibraryHandle, inst.Ref, &isMeshObject) +// GetBalls obtains all ball indices and radii of a mesh object. +func (inst BeamLattice) GetBalls(ballInfo []Ball) ([]Ball, error) { + var neededforballInfo C.uint64_t + ret := C.CCall_lib3mf_beamlattice_getballs(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforballInfo, nil) if ret != 0 { - return false, makeError(uint32(ret)) + return nil, makeError(uint32(ret)) } - return bool(isMeshObject), nil + if len(ballInfo) < int(neededforballInfo) { + ballInfo = append(ballInfo, make([]Ball, int(neededforballInfo)-len(ballInfo))...) + } + ret = C.CCall_lib3mf_beamlattice_getballs(inst.wrapperRef.LibraryHandle, inst.Ref, neededforballInfo, nil, (*C.sLib3MFBall)(unsafe.Pointer(&ballInfo[0]))) + if ret != 0 { + return nil, makeError(uint32(ret)) + } + return ballInfo[:int(neededforballInfo)], nil } -// IsComponentsObject retrieves, if an object is a components object. -func (inst Object) IsComponentsObject() (bool, error) { - var isComponentsObject C.bool - ret := C.CCall_lib3mf_object_iscomponentsobject(inst.wrapperRef.LibraryHandle, inst.Ref, &isComponentsObject) +// GetBeamSetCount returns the number of beamsets of a mesh object. +func (inst BeamLattice) GetBeamSetCount() (uint32, error) { + var count C.uint32_t + ret := C.CCall_lib3mf_beamlattice_getbeamsetcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) if ret != 0 { - return false, makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return bool(isComponentsObject), nil + return uint32(count), nil } -// IsValid retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. -func (inst Object) IsValid() (bool, error) { - var isValid C.bool - ret := C.CCall_lib3mf_object_isvalid(inst.wrapperRef.LibraryHandle, inst.Ref, &isValid) +// AddBeamSet adds an empty beamset to a mesh object. +func (inst BeamLattice) AddBeamSet() (BeamSet, error) { + var beamSet ref + ret := C.CCall_lib3mf_beamlattice_addbeamset(inst.wrapperRef.LibraryHandle, inst.Ref, &beamSet) if ret != 0 { - return false, makeError(uint32(ret)) + return BeamSet{}, makeError(uint32(ret)) } - return bool(isValid), nil + return inst.wrapperRef.NewBeamSet(beamSet), nil } -// SetAttachmentAsThumbnail use an existing attachment as thumbnail for this object. -func (inst Object) SetAttachmentAsThumbnail(attachment Attachment) error { - ret := C.CCall_lib3mf_object_setattachmentasthumbnail(inst.wrapperRef.LibraryHandle, inst.Ref, attachment.Ref) +// GetBeamSet returns a beamset of a mesh object. +func (inst BeamLattice) GetBeamSet(index uint32) (BeamSet, error) { + var beamSet ref + ret := C.CCall_lib3mf_beamlattice_getbeamset(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &beamSet) if ret != 0 { - return makeError(uint32(ret)) + return BeamSet{}, makeError(uint32(ret)) } - return nil + return inst.wrapperRef.NewBeamSet(beamSet), nil } -// GetThumbnailAttachment get the attachment containing the object thumbnail. -func (inst Object) GetThumbnailAttachment() (*Attachment, error) { - var attachment ref - ret := C.CCall_lib3mf_object_getthumbnailattachment(inst.wrapperRef.LibraryHandle, inst.Ref, &attachment) - if ret != 0 { - return nil, makeError(uint32(ret)) - } - var _attachmentPtr *Attachment - if attachment != nil { - _attachmentPtrVal := inst.wrapperRef.NewAttachment(attachment) - _attachmentPtr = &_attachmentPtrVal - } - return _attachmentPtr, nil + +// Component represents a Lib3MF class. +type Component struct { + Base } -// ClearThumbnailAttachment clears the attachment. The attachment instance is not removed from the package. -func (inst Object) ClearThumbnailAttachment() error { - ret := C.CCall_lib3mf_object_clearthumbnailattachment(inst.wrapperRef.LibraryHandle, inst.Ref) +func (wrapper Wrapper) NewComponent(r ref) Component { + return Component{wrapper.NewBase(r)} +} + +// GetObjectResource returns the Resource Instance of the component. +func (inst Component) GetObjectResource() (Object, error) { + var objectResource ref + ret := C.CCall_lib3mf_component_getobjectresource(inst.wrapperRef.LibraryHandle, inst.Ref, &objectResource) if ret != 0 { - return makeError(uint32(ret)) + return Object{}, makeError(uint32(ret)) } - return nil + return inst.wrapperRef.NewObject(objectResource), nil } -// GetOutbox returns the outbox of a build item. -func (inst Object) GetOutbox() (Box, error) { - var outbox C.sLib3MFBox - ret := C.CCall_lib3mf_object_getoutbox(inst.wrapperRef.LibraryHandle, inst.Ref, &outbox) +// GetObjectResourceID returns the UniqueResourceID of the component. +func (inst Component) GetObjectResourceID() (uint32, error) { + var uniqueResourceID C.uint32_t + ret := C.CCall_lib3mf_component_getobjectresourceid(inst.wrapperRef.LibraryHandle, inst.Ref, &uniqueResourceID) if ret != 0 { - return Box{}, makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return *(*Box)(unsafe.Pointer(&outbox)), nil + return uint32(uniqueResourceID), nil } -// GetUUID retrieves an object's uuid string (see production extension specification). -func (inst Object) GetUUID() (bool, string, error) { +// GetUUID returns, whether a component has a UUID and, if true, the component's UUID. +func (inst Component) GetUUID() (bool, string, error) { var hasUUID C.bool var neededforuUID C.uint32_t var filledinuUID C.uint32_t - ret := C.CCall_lib3mf_object_getuuid(inst.wrapperRef.LibraryHandle, inst.Ref, &hasUUID, 0, &neededforuUID, nil) + ret := C.CCall_lib3mf_component_getuuid(inst.wrapperRef.LibraryHandle, inst.Ref, &hasUUID, 0, &neededforuUID, nil) if ret != 0 { return false, "", makeError(uint32(ret)) } bufferSizeuUID := neededforuUID bufferuUID := make([]byte, bufferSizeuUID) - ret = C.CCall_lib3mf_object_getuuid(inst.wrapperRef.LibraryHandle, inst.Ref, &hasUUID, bufferSizeuUID, &filledinuUID, (*C.char)(unsafe.Pointer(&bufferuUID[0]))) + ret = C.CCall_lib3mf_component_getuuid(inst.wrapperRef.LibraryHandle, inst.Ref, &hasUUID, bufferSizeuUID, &filledinuUID, (*C.char)(unsafe.Pointer(&bufferuUID[0]))) if ret != 0 { return false, "", makeError(uint32(ret)) } return bool(hasUUID), string(bufferuUID[:(filledinuUID-1)]), nil } -// SetUUID sets a build object's uuid string (see production extension specification). -func (inst Object) SetUUID(uUID string) error { - ret := C.CCall_lib3mf_object_setuuid(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(uUID)[0]))) +// SetUUID sets the component's UUID. +func (inst Component) SetUUID(uUID string) error { + ret := C.CCall_lib3mf_component_setuuid(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(uUID)[0]))) if ret != 0 { return makeError(uint32(ret)) } return nil } -// GetMetaDataGroup returns the metadatagroup of this object. -func (inst Object) GetMetaDataGroup() (MetaDataGroup, error) { - var metaDataGroup ref - ret := C.CCall_lib3mf_object_getmetadatagroup(inst.wrapperRef.LibraryHandle, inst.Ref, &metaDataGroup) +// HasTransform returns, if the component has a different transformation than the identity matrix. +func (inst Component) HasTransform() (bool, error) { + var hasTransform C.bool + ret := C.CCall_lib3mf_component_hastransform(inst.wrapperRef.LibraryHandle, inst.Ref, &hasTransform) if ret != 0 { - return MetaDataGroup{}, makeError(uint32(ret)) + return false, makeError(uint32(ret)) } - return inst.wrapperRef.NewMetaDataGroup(metaDataGroup), nil + return bool(hasTransform), nil } -// SetSlicesMeshResolution set the meshresolution of the mesh object. -func (inst Object) SetSlicesMeshResolution(meshResolution SlicesMeshResolution) error { - ret := C.CCall_lib3mf_object_setslicesmeshresolution(inst.wrapperRef.LibraryHandle, inst.Ref, C.eLib3MFSlicesMeshResolution(meshResolution)) +// GetTransform returns the transformation matrix of the component. +func (inst Component) GetTransform() (Transform, error) { + var transform C.sLib3MFTransform + ret := C.CCall_lib3mf_component_gettransform(inst.wrapperRef.LibraryHandle, inst.Ref, &transform) if ret != 0 { - return makeError(uint32(ret)) + return Transform{}, makeError(uint32(ret)) } - return nil + return *(*Transform)(unsafe.Pointer(&transform)), nil } -// GetSlicesMeshResolution get the meshresolution of the mesh object. -func (inst Object) GetSlicesMeshResolution() (SlicesMeshResolution, error) { - var meshResolution C.eLib3MFSlicesMeshResolution - ret := C.CCall_lib3mf_object_getslicesmeshresolution(inst.wrapperRef.LibraryHandle, inst.Ref, &meshResolution) +// SetTransform sets the transformation matrix of the component. +func (inst Component) SetTransform(transform Transform) error { + ret := C.CCall_lib3mf_component_settransform(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.sLib3MFTransform)(unsafe.Pointer(&transform))) if ret != 0 { - return 0, makeError(uint32(ret)) + return makeError(uint32(ret)) } - return SlicesMeshResolution(meshResolution), nil + return nil } -// HasSlices returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack. -func (inst Object) HasSlices(recursive bool) (bool, error) { - var hasSlices C.bool - ret := C.CCall_lib3mf_object_hasslices(inst.wrapperRef.LibraryHandle, inst.Ref, C.bool(recursive), &hasSlices) - if ret != 0 { - return false, makeError(uint32(ret)) - } - return bool(hasSlices), nil + +// ComponentsObject represents a Lib3MF class. +type ComponentsObject struct { + Object } -// ClearSliceStack unlinks the attached slicestack from this object. If no slice stack is attached, do noting. -func (inst Object) ClearSliceStack() error { - ret := C.CCall_lib3mf_object_clearslicestack(inst.wrapperRef.LibraryHandle, inst.Ref) +func (wrapper Wrapper) NewComponentsObject(r ref) ComponentsObject { + return ComponentsObject{wrapper.NewObject(r)} +} + +// AddComponent adds a new component to a components object. +func (inst ComponentsObject) AddComponent(objectResource Object, transform Transform) (Component, error) { + var componentInstance ref + ret := C.CCall_lib3mf_componentsobject_addcomponent(inst.wrapperRef.LibraryHandle, inst.Ref, objectResource.Ref, (*C.sLib3MFTransform)(unsafe.Pointer(&transform)), &componentInstance) if ret != 0 { - return makeError(uint32(ret)) + return Component{}, makeError(uint32(ret)) } - return nil + return inst.wrapperRef.NewComponent(componentInstance), nil } -// GetSliceStack get the Slicestack attached to the object. -func (inst Object) GetSliceStack() (SliceStack, error) { - var sliceStackInstance ref - ret := C.CCall_lib3mf_object_getslicestack(inst.wrapperRef.LibraryHandle, inst.Ref, &sliceStackInstance) +// GetComponent retrieves a component from a component object. +func (inst ComponentsObject) GetComponent(index uint32) (Component, error) { + var componentInstance ref + ret := C.CCall_lib3mf_componentsobject_getcomponent(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &componentInstance) if ret != 0 { - return SliceStack{}, makeError(uint32(ret)) + return Component{}, makeError(uint32(ret)) } - return inst.wrapperRef.NewSliceStack(sliceStackInstance), nil + return inst.wrapperRef.NewComponent(componentInstance), nil } -// AssignSliceStack assigns a slicestack to the object. -func (inst Object) AssignSliceStack(sliceStackInstance SliceStack) error { - ret := C.CCall_lib3mf_object_assignslicestack(inst.wrapperRef.LibraryHandle, inst.Ref, sliceStackInstance.Ref) +// GetComponentCount retrieves a component count of a component object. +func (inst ComponentsObject) GetComponentCount() (uint32, error) { + var count C.uint32_t + ret := C.CCall_lib3mf_componentsobject_getcomponentcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) if ret != 0 { - return makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return nil + return uint32(count), nil } -// MeshObject represents a Lib3MF class. -type MeshObject struct { - Object +// BeamSet represents a Lib3MF class. +type BeamSet struct { + Base } -func (wrapper Wrapper) NewMeshObject(r ref) MeshObject { - return MeshObject{wrapper.NewObject(r)} +func (wrapper Wrapper) NewBeamSet(r ref) BeamSet { + return BeamSet{wrapper.NewBase(r)} } -// GetVertexCount returns the vertex count of a mesh object. -func (inst MeshObject) GetVertexCount() (uint32, error) { - var vertexCount C.uint32_t - ret := C.CCall_lib3mf_meshobject_getvertexcount(inst.wrapperRef.LibraryHandle, inst.Ref, &vertexCount) +// SetName sets a beamset's name string. +func (inst BeamSet) SetName(name string) error { + ret := C.CCall_lib3mf_beamset_setname(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0]))) if ret != 0 { - return 0, makeError(uint32(ret)) + return makeError(uint32(ret)) } - return uint32(vertexCount), nil + return nil } -// GetTriangleCount returns the triangle count of a mesh object. -func (inst MeshObject) GetTriangleCount() (uint32, error) { - var vertexCount C.uint32_t - ret := C.CCall_lib3mf_meshobject_gettrianglecount(inst.wrapperRef.LibraryHandle, inst.Ref, &vertexCount) +// GetName retrieves a beamset's name string. +func (inst BeamSet) GetName() (string, error) { + var neededforname C.uint32_t + var filledinname C.uint32_t + ret := C.CCall_lib3mf_beamset_getname(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforname, nil) if ret != 0 { - return 0, makeError(uint32(ret)) + return "", makeError(uint32(ret)) } - return uint32(vertexCount), nil -} - -// GetVertex returns the vertex count of a mesh object. -func (inst MeshObject) GetVertex(index uint32) (Position, error) { - var coordinates C.sLib3MFPosition - ret := C.CCall_lib3mf_meshobject_getvertex(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &coordinates) + bufferSizename := neededforname + buffername := make([]byte, bufferSizename) + ret = C.CCall_lib3mf_beamset_getname(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizename, &filledinname, (*C.char)(unsafe.Pointer(&buffername[0]))) if ret != 0 { - return Position{}, makeError(uint32(ret)) + return "", makeError(uint32(ret)) } - return *(*Position)(unsafe.Pointer(&coordinates)), nil + return string(buffername[:(filledinname-1)]), nil } -// SetVertex sets the coordinates of a single vertex of a mesh object. -func (inst MeshObject) SetVertex(index uint32, coordinates Position) error { - ret := C.CCall_lib3mf_meshobject_setvertex(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), (*C.sLib3MFPosition)(unsafe.Pointer(&coordinates))) +// SetIdentifier sets a beamset's identifier string. +func (inst BeamSet) SetIdentifier(identifier string) error { + ret := C.CCall_lib3mf_beamset_setidentifier(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(identifier)[0]))) if ret != 0 { return makeError(uint32(ret)) } return nil } -// AddVertex adds a single vertex to a mesh object. -func (inst MeshObject) AddVertex(coordinates Position) (uint32, error) { - var newIndex C.uint32_t - ret := C.CCall_lib3mf_meshobject_addvertex(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.sLib3MFPosition)(unsafe.Pointer(&coordinates)), &newIndex) +// GetIdentifier retrieves a beamset's identifier string. +func (inst BeamSet) GetIdentifier() (string, error) { + var neededforidentifier C.uint32_t + var filledinidentifier C.uint32_t + ret := C.CCall_lib3mf_beamset_getidentifier(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforidentifier, nil) + if ret != 0 { + return "", makeError(uint32(ret)) + } + bufferSizeidentifier := neededforidentifier + bufferidentifier := make([]byte, bufferSizeidentifier) + ret = C.CCall_lib3mf_beamset_getidentifier(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizeidentifier, &filledinidentifier, (*C.char)(unsafe.Pointer(&bufferidentifier[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(bufferidentifier[:(filledinidentifier-1)]), nil +} + +// GetReferenceCount retrieves the reference count of a beamset. +func (inst BeamSet) GetReferenceCount() (uint32, error) { + var count C.uint32_t + ret := C.CCall_lib3mf_beamset_getreferencecount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) if ret != 0 { return 0, makeError(uint32(ret)) } - return uint32(newIndex), nil + return uint32(count), nil } -// GetVertices obtains all vertex positions of a mesh object. -func (inst MeshObject) GetVertices(vertices []Position) ([]Position, error) { - var neededforvertices C.uint64_t - ret := C.CCall_lib3mf_meshobject_getvertices(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforvertices, nil) +// SetReferences sets the references of a beamset. +func (inst BeamSet) SetReferences(references []uint32) error { + ret := C.CCall_lib3mf_beamset_setreferences(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(references)), (*C.uint32_t)(unsafe.Pointer(&references[0]))) + if ret != 0 { + return makeError(uint32(ret)) + } + return nil +} + +// GetReferences retrieves the references of a beamset. +func (inst BeamSet) GetReferences(references []uint32) ([]uint32, error) { + var neededforreferences C.uint64_t + ret := C.CCall_lib3mf_beamset_getreferences(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforreferences, nil) if ret != 0 { return nil, makeError(uint32(ret)) } - if len(vertices) < int(neededforvertices) { - vertices = append(vertices, make([]Position, int(neededforvertices)-len(vertices))...) + if len(references) < int(neededforreferences) { + references = append(references, make([]uint32, int(neededforreferences)-len(references))...) } - ret = C.CCall_lib3mf_meshobject_getvertices(inst.wrapperRef.LibraryHandle, inst.Ref, neededforvertices, nil, (*C.sLib3MFPosition)(unsafe.Pointer(&vertices[0]))) + ret = C.CCall_lib3mf_beamset_getreferences(inst.wrapperRef.LibraryHandle, inst.Ref, neededforreferences, nil, (*C.uint32_t)(unsafe.Pointer(&references[0]))) if ret != 0 { return nil, makeError(uint32(ret)) } - return vertices[:int(neededforvertices)], nil + return references[:int(neededforreferences)], nil } -// GetTriangle returns indices of a single triangle of a mesh object. -func (inst MeshObject) GetTriangle(index uint32) (Triangle, error) { - var indices C.sLib3MFTriangle - ret := C.CCall_lib3mf_meshobject_gettriangle(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &indices) +// GetBallReferenceCount retrieves the ball reference count of a beamset. +func (inst BeamSet) GetBallReferenceCount() (uint32, error) { + var count C.uint32_t + ret := C.CCall_lib3mf_beamset_getballreferencecount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) if ret != 0 { - return Triangle{}, makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return *(*Triangle)(unsafe.Pointer(&indices)), nil + return uint32(count), nil } -// SetTriangle sets the indices of a single triangle of a mesh object. -func (inst MeshObject) SetTriangle(index uint32, indices Triangle) error { - ret := C.CCall_lib3mf_meshobject_settriangle(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), (*C.sLib3MFTriangle)(unsafe.Pointer(&indices))) +// SetBallReferences sets the ball references of a beamset. +func (inst BeamSet) SetBallReferences(ballReferences []uint32) error { + ret := C.CCall_lib3mf_beamset_setballreferences(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(ballReferences)), (*C.uint32_t)(unsafe.Pointer(&ballReferences[0]))) if ret != 0 { return makeError(uint32(ret)) } return nil } -// AddTriangle adds a single triangle to a mesh object. -func (inst MeshObject) AddTriangle(indices Triangle) (uint32, error) { - var newIndex C.uint32_t - ret := C.CCall_lib3mf_meshobject_addtriangle(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.sLib3MFTriangle)(unsafe.Pointer(&indices)), &newIndex) - if ret != 0 { - return 0, makeError(uint32(ret)) - } - return uint32(newIndex), nil -} - -// GetTriangleIndices get all triangles of a mesh object. -func (inst MeshObject) GetTriangleIndices(indices []Triangle) ([]Triangle, error) { - var neededforindices C.uint64_t - ret := C.CCall_lib3mf_meshobject_gettriangleindices(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforindices, nil) +// GetBallReferences retrieves the ball references of a beamset. +func (inst BeamSet) GetBallReferences(ballReferences []uint32) ([]uint32, error) { + var neededforballReferences C.uint64_t + ret := C.CCall_lib3mf_beamset_getballreferences(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforballReferences, nil) if ret != 0 { return nil, makeError(uint32(ret)) } - if len(indices) < int(neededforindices) { - indices = append(indices, make([]Triangle, int(neededforindices)-len(indices))...) + if len(ballReferences) < int(neededforballReferences) { + ballReferences = append(ballReferences, make([]uint32, int(neededforballReferences)-len(ballReferences))...) } - ret = C.CCall_lib3mf_meshobject_gettriangleindices(inst.wrapperRef.LibraryHandle, inst.Ref, neededforindices, nil, (*C.sLib3MFTriangle)(unsafe.Pointer(&indices[0]))) + ret = C.CCall_lib3mf_beamset_getballreferences(inst.wrapperRef.LibraryHandle, inst.Ref, neededforballReferences, nil, (*C.uint32_t)(unsafe.Pointer(&ballReferences[0]))) if ret != 0 { return nil, makeError(uint32(ret)) } - return indices[:int(neededforindices)], nil + return ballReferences[:int(neededforballReferences)], nil } -// SetObjectLevelProperty sets the property at the object-level of the mesh object. -func (inst MeshObject) SetObjectLevelProperty(uniqueResourceID uint32, propertyID uint32) error { - ret := C.CCall_lib3mf_meshobject_setobjectlevelproperty(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(uniqueResourceID), C.uint32_t(propertyID)) - if ret != 0 { - return makeError(uint32(ret)) - } - return nil + +// BaseMaterialGroup represents a Lib3MF class. +type BaseMaterialGroup struct { + Resource } -// GetObjectLevelProperty gets the property at the object-level of the mesh object. -func (inst MeshObject) GetObjectLevelProperty() (uint32, uint32, bool, error) { - var uniqueResourceID C.uint32_t - var propertyID C.uint32_t - var hasObjectLevelProperty C.bool - ret := C.CCall_lib3mf_meshobject_getobjectlevelproperty(inst.wrapperRef.LibraryHandle, inst.Ref, &uniqueResourceID, &propertyID, &hasObjectLevelProperty) +func (wrapper Wrapper) NewBaseMaterialGroup(r ref) BaseMaterialGroup { + return BaseMaterialGroup{wrapper.NewResource(r)} +} + +// GetCount retrieves the count of base materials in the material group. +func (inst BaseMaterialGroup) GetCount() (uint32, error) { + var count C.uint32_t + ret := C.CCall_lib3mf_basematerialgroup_getcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) if ret != 0 { - return 0, 0, false, makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return uint32(uniqueResourceID), uint32(propertyID), bool(hasObjectLevelProperty), nil + return uint32(count), nil } -// SetTriangleProperties sets the properties of a single triangle of a mesh object. -func (inst MeshObject) SetTriangleProperties(index uint32, properties TriangleProperties) error { - ret := C.CCall_lib3mf_meshobject_settriangleproperties(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), (*C.sLib3MFTriangleProperties)(unsafe.Pointer(&properties))) +// GetAllPropertyIDs returns all the PropertyIDs of all materials in this group. +func (inst BaseMaterialGroup) GetAllPropertyIDs(propertyIDs []uint32) ([]uint32, error) { + var neededforpropertyIDs C.uint64_t + ret := C.CCall_lib3mf_basematerialgroup_getallpropertyids(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforpropertyIDs, nil) if ret != 0 { - return makeError(uint32(ret)) + return nil, makeError(uint32(ret)) } - return nil + if len(propertyIDs) < int(neededforpropertyIDs) { + propertyIDs = append(propertyIDs, make([]uint32, int(neededforpropertyIDs)-len(propertyIDs))...) + } + ret = C.CCall_lib3mf_basematerialgroup_getallpropertyids(inst.wrapperRef.LibraryHandle, inst.Ref, neededforpropertyIDs, nil, (*C.uint32_t)(unsafe.Pointer(&propertyIDs[0]))) + if ret != 0 { + return nil, makeError(uint32(ret)) + } + return propertyIDs[:int(neededforpropertyIDs)], nil } -// GetTriangleProperties gets the properties of a single triangle of a mesh object. -func (inst MeshObject) GetTriangleProperties(index uint32) (TriangleProperties, error) { - var property C.sLib3MFTriangleProperties - ret := C.CCall_lib3mf_meshobject_gettriangleproperties(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &property) +// AddMaterial adds a new material to the material group. +func (inst BaseMaterialGroup) AddMaterial(name string, displayColor Color) (uint32, error) { + var propertyID C.uint32_t + ret := C.CCall_lib3mf_basematerialgroup_addmaterial(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0])), (*C.sLib3MFColor)(unsafe.Pointer(&displayColor)), &propertyID) if ret != 0 { - return TriangleProperties{}, makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return *(*TriangleProperties)(unsafe.Pointer(&property)), nil + return uint32(propertyID), nil } -// SetAllTriangleProperties sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. -func (inst MeshObject) SetAllTriangleProperties(propertiesArray []TriangleProperties) error { - ret := C.CCall_lib3mf_meshobject_setalltriangleproperties(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(propertiesArray)), (*C.sLib3MFTriangleProperties)(unsafe.Pointer(&propertiesArray[0]))) +// RemoveMaterial removes a material from the material group. +func (inst BaseMaterialGroup) RemoveMaterial(propertyID uint32) error { + ret := C.CCall_lib3mf_basematerialgroup_removematerial(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID)) if ret != 0 { return makeError(uint32(ret)) } return nil } -// GetAllTriangleProperties gets the properties of all triangles of a mesh object. -func (inst MeshObject) GetAllTriangleProperties(propertiesArray []TriangleProperties) ([]TriangleProperties, error) { - var neededforpropertiesArray C.uint64_t - ret := C.CCall_lib3mf_meshobject_getalltriangleproperties(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforpropertiesArray, nil) +// GetName returns the base material's name. +func (inst BaseMaterialGroup) GetName(propertyID uint32) (string, error) { + var neededforname C.uint32_t + var filledinname C.uint32_t + ret := C.CCall_lib3mf_basematerialgroup_getname(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), 0, &neededforname, nil) if ret != 0 { - return nil, makeError(uint32(ret)) - } - if len(propertiesArray) < int(neededforpropertiesArray) { - propertiesArray = append(propertiesArray, make([]TriangleProperties, int(neededforpropertiesArray)-len(propertiesArray))...) + return "", makeError(uint32(ret)) } - ret = C.CCall_lib3mf_meshobject_getalltriangleproperties(inst.wrapperRef.LibraryHandle, inst.Ref, neededforpropertiesArray, nil, (*C.sLib3MFTriangleProperties)(unsafe.Pointer(&propertiesArray[0]))) + bufferSizename := neededforname + buffername := make([]byte, bufferSizename) + ret = C.CCall_lib3mf_basematerialgroup_getname(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), bufferSizename, &filledinname, (*C.char)(unsafe.Pointer(&buffername[0]))) if ret != 0 { - return nil, makeError(uint32(ret)) + return "", makeError(uint32(ret)) } - return propertiesArray[:int(neededforpropertiesArray)], nil + return string(buffername[:(filledinname-1)]), nil } -// ClearAllProperties clears all properties of this mesh object (triangle and object-level). -func (inst MeshObject) ClearAllProperties() error { - ret := C.CCall_lib3mf_meshobject_clearallproperties(inst.wrapperRef.LibraryHandle, inst.Ref) +// SetName sets a base material's name. +func (inst BaseMaterialGroup) SetName(propertyID uint32, name string) error { + ret := C.CCall_lib3mf_basematerialgroup_setname(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), (*C.char)(unsafe.Pointer(&[]byte(name)[0]))) if ret != 0 { return makeError(uint32(ret)) } return nil } -// SetGeometry set all triangles of a mesh object. -func (inst MeshObject) SetGeometry(vertices []Position, indices []Triangle) error { - ret := C.CCall_lib3mf_meshobject_setgeometry(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(vertices)), (*C.sLib3MFPosition)(unsafe.Pointer(&vertices[0])), C.uint64_t(len(indices)), (*C.sLib3MFTriangle)(unsafe.Pointer(&indices[0]))) +// SetDisplayColor sets a base material's display color. +func (inst BaseMaterialGroup) SetDisplayColor(propertyID uint32, theColor Color) error { + ret := C.CCall_lib3mf_basematerialgroup_setdisplaycolor(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), (*C.sLib3MFColor)(unsafe.Pointer(&theColor))) if ret != 0 { return makeError(uint32(ret)) } return nil } -// IsManifoldAndOriented retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. -func (inst MeshObject) IsManifoldAndOriented() (bool, error) { - var isManifoldAndOriented C.bool - ret := C.CCall_lib3mf_meshobject_ismanifoldandoriented(inst.wrapperRef.LibraryHandle, inst.Ref, &isManifoldAndOriented) - if ret != 0 { - return false, makeError(uint32(ret)) - } - return bool(isManifoldAndOriented), nil -} - -// BeamLattice retrieves the BeamLattice within this MeshObject. -func (inst MeshObject) BeamLattice() (BeamLattice, error) { - var theBeamLattice ref - ret := C.CCall_lib3mf_meshobject_beamlattice(inst.wrapperRef.LibraryHandle, inst.Ref, &theBeamLattice) +// GetDisplayColor returns a base material's display color. +func (inst BaseMaterialGroup) GetDisplayColor(propertyID uint32) (Color, error) { + var theColor C.sLib3MFColor + ret := C.CCall_lib3mf_basematerialgroup_getdisplaycolor(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), &theColor) if ret != 0 { - return BeamLattice{}, makeError(uint32(ret)) + return Color{}, makeError(uint32(ret)) } - return inst.wrapperRef.NewBeamLattice(theBeamLattice), nil + return *(*Color)(unsafe.Pointer(&theColor)), nil } -// BeamLattice represents a Lib3MF class. -type BeamLattice struct { - Base +// ColorGroup represents a Lib3MF class. +type ColorGroup struct { + Resource } -func (wrapper Wrapper) NewBeamLattice(r ref) BeamLattice { - return BeamLattice{wrapper.NewBase(r)} +func (wrapper Wrapper) NewColorGroup(r ref) ColorGroup { + return ColorGroup{wrapper.NewResource(r)} } -// GetMinLength returns the minimal length of beams for the beamlattice. -func (inst BeamLattice) GetMinLength() (float64, error) { - var minLength C.double - ret := C.CCall_lib3mf_beamlattice_getminlength(inst.wrapperRef.LibraryHandle, inst.Ref, &minLength) +// GetCount retrieves the count of base materials in this Color Group. +func (inst ColorGroup) GetCount() (uint32, error) { + var count C.uint32_t + ret := C.CCall_lib3mf_colorgroup_getcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) if ret != 0 { return 0, makeError(uint32(ret)) } - return float64(minLength), nil + return uint32(count), nil } -// SetMinLength sets the minimal length of beams for the beamlattice. -func (inst BeamLattice) SetMinLength(minLength float64) error { - ret := C.CCall_lib3mf_beamlattice_setminlength(inst.wrapperRef.LibraryHandle, inst.Ref, C.double(minLength)) +// GetAllPropertyIDs returns all the PropertyIDs of all colors within this group. +func (inst ColorGroup) GetAllPropertyIDs(propertyIDs []uint32) ([]uint32, error) { + var neededforpropertyIDs C.uint64_t + ret := C.CCall_lib3mf_colorgroup_getallpropertyids(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforpropertyIDs, nil) if ret != 0 { - return makeError(uint32(ret)) + return nil, makeError(uint32(ret)) } - return nil -} - -// GetClipping returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. -func (inst BeamLattice) GetClipping() (BeamLatticeClipMode, uint32, error) { - var clipMode C.eLib3MFBeamLatticeClipMode - var uniqueResourceID C.uint32_t - ret := C.CCall_lib3mf_beamlattice_getclipping(inst.wrapperRef.LibraryHandle, inst.Ref, &clipMode, &uniqueResourceID) - if ret != 0 { - return 0, 0, makeError(uint32(ret)) + if len(propertyIDs) < int(neededforpropertyIDs) { + propertyIDs = append(propertyIDs, make([]uint32, int(neededforpropertyIDs)-len(propertyIDs))...) } - return BeamLatticeClipMode(clipMode), uint32(uniqueResourceID), nil -} - -// SetClipping sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. -func (inst BeamLattice) SetClipping(clipMode BeamLatticeClipMode, uniqueResourceID uint32) error { - ret := C.CCall_lib3mf_beamlattice_setclipping(inst.wrapperRef.LibraryHandle, inst.Ref, C.eLib3MFBeamLatticeClipMode(clipMode), C.uint32_t(uniqueResourceID)) + ret = C.CCall_lib3mf_colorgroup_getallpropertyids(inst.wrapperRef.LibraryHandle, inst.Ref, neededforpropertyIDs, nil, (*C.uint32_t)(unsafe.Pointer(&propertyIDs[0]))) if ret != 0 { - return makeError(uint32(ret)) + return nil, makeError(uint32(ret)) } - return nil + return propertyIDs[:int(neededforpropertyIDs)], nil } -// GetRepresentation returns the representation-mesh for the beamlattice of this mesh. -func (inst BeamLattice) GetRepresentation() (bool, uint32, error) { - var hasRepresentation C.bool - var uniqueResourceID C.uint32_t - ret := C.CCall_lib3mf_beamlattice_getrepresentation(inst.wrapperRef.LibraryHandle, inst.Ref, &hasRepresentation, &uniqueResourceID) +// AddColor adds a new value. +func (inst ColorGroup) AddColor(theColor Color) (uint32, error) { + var propertyID C.uint32_t + ret := C.CCall_lib3mf_colorgroup_addcolor(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.sLib3MFColor)(unsafe.Pointer(&theColor)), &propertyID) if ret != 0 { - return false, 0, makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return bool(hasRepresentation), uint32(uniqueResourceID), nil + return uint32(propertyID), nil } -// SetRepresentation sets the representation-mesh for the beamlattice of this mesh. -func (inst BeamLattice) SetRepresentation(uniqueResourceID uint32) error { - ret := C.CCall_lib3mf_beamlattice_setrepresentation(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(uniqueResourceID)) +// RemoveColor removes a color from the color group. +func (inst ColorGroup) RemoveColor(propertyID uint32) error { + ret := C.CCall_lib3mf_colorgroup_removecolor(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID)) if ret != 0 { return makeError(uint32(ret)) } return nil } -// GetBallOptions returns the ball mode and the default ball radius for the beamlattice of this mesh. -func (inst BeamLattice) GetBallOptions() (BeamLatticeBallMode, float64, error) { - var ballMode C.eLib3MFBeamLatticeBallMode - var ballRadius C.double - ret := C.CCall_lib3mf_beamlattice_getballoptions(inst.wrapperRef.LibraryHandle, inst.Ref, &ballMode, &ballRadius) - if ret != 0 { - return 0, 0, makeError(uint32(ret)) - } - return BeamLatticeBallMode(ballMode), float64(ballRadius), nil -} - -// SetBallOptions sets the ball mode and thedefault ball radius for the beamlattice. -func (inst BeamLattice) SetBallOptions(ballMode BeamLatticeBallMode, ballRadius float64) error { - ret := C.CCall_lib3mf_beamlattice_setballoptions(inst.wrapperRef.LibraryHandle, inst.Ref, C.eLib3MFBeamLatticeBallMode(ballMode), C.double(ballRadius)) +// SetColor sets a color value. +func (inst ColorGroup) SetColor(propertyID uint32, theColor Color) error { + ret := C.CCall_lib3mf_colorgroup_setcolor(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), (*C.sLib3MFColor)(unsafe.Pointer(&theColor))) if ret != 0 { return makeError(uint32(ret)) } return nil } -// GetBeamCount returns the beam count of a mesh object. -func (inst BeamLattice) GetBeamCount() (uint32, error) { +// GetColor sets a color value. +func (inst ColorGroup) GetColor(propertyID uint32) (Color, error) { + var theColor C.sLib3MFColor + ret := C.CCall_lib3mf_colorgroup_getcolor(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), &theColor) + if ret != 0 { + return Color{}, makeError(uint32(ret)) + } + return *(*Color)(unsafe.Pointer(&theColor)), nil +} + + +// Texture2DGroup represents a Lib3MF class. +type Texture2DGroup struct { + Resource +} + +func (wrapper Wrapper) NewTexture2DGroup(r ref) Texture2DGroup { + return Texture2DGroup{wrapper.NewResource(r)} +} + +// GetCount retrieves the count of tex2coords in the Texture2DGroup. +func (inst Texture2DGroup) GetCount() (uint32, error) { var count C.uint32_t - ret := C.CCall_lib3mf_beamlattice_getbeamcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) + ret := C.CCall_lib3mf_texture2dgroup_getcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) if ret != 0 { return 0, makeError(uint32(ret)) } return uint32(count), nil } -// GetBeam returns indices, radii and capmodes of a single beam of a mesh object. -func (inst BeamLattice) GetBeam(index uint32) (Beam, error) { - var beamInfo C.sLib3MFBeam - ret := C.CCall_lib3mf_beamlattice_getbeam(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &beamInfo) +// GetAllPropertyIDs returns all the PropertyIDs of all tex2coords in this Texture2DGroup. +func (inst Texture2DGroup) GetAllPropertyIDs(propertyIDs []uint32) ([]uint32, error) { + var neededforpropertyIDs C.uint64_t + ret := C.CCall_lib3mf_texture2dgroup_getallpropertyids(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforpropertyIDs, nil) if ret != 0 { - return Beam{}, makeError(uint32(ret)) + return nil, makeError(uint32(ret)) } - return *(*Beam)(unsafe.Pointer(&beamInfo)), nil + if len(propertyIDs) < int(neededforpropertyIDs) { + propertyIDs = append(propertyIDs, make([]uint32, int(neededforpropertyIDs)-len(propertyIDs))...) + } + ret = C.CCall_lib3mf_texture2dgroup_getallpropertyids(inst.wrapperRef.LibraryHandle, inst.Ref, neededforpropertyIDs, nil, (*C.uint32_t)(unsafe.Pointer(&propertyIDs[0]))) + if ret != 0 { + return nil, makeError(uint32(ret)) + } + return propertyIDs[:int(neededforpropertyIDs)], nil } -// AddBeam adds a single beam to a mesh object. -func (inst BeamLattice) AddBeam(beamInfo Beam) (uint32, error) { - var index C.uint32_t - ret := C.CCall_lib3mf_beamlattice_addbeam(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.sLib3MFBeam)(unsafe.Pointer(&beamInfo)), &index) +// AddTex2Coord adds a new tex2coord to the Texture2DGroup. +func (inst Texture2DGroup) AddTex2Coord(uVCoordinate Tex2Coord) (uint32, error) { + var propertyID C.uint32_t + ret := C.CCall_lib3mf_texture2dgroup_addtex2coord(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.sLib3MFTex2Coord)(unsafe.Pointer(&uVCoordinate)), &propertyID) if ret != 0 { return 0, makeError(uint32(ret)) } - return uint32(index), nil + return uint32(propertyID), nil } -// SetBeam sets the indices, radii and capmodes of a single beam of a mesh object. -func (inst BeamLattice) SetBeam(index uint32, beamInfo Beam) error { - ret := C.CCall_lib3mf_beamlattice_setbeam(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), (*C.sLib3MFBeam)(unsafe.Pointer(&beamInfo))) +// GetTex2Coord obtains a tex2coord to the Texture2DGroup. +func (inst Texture2DGroup) GetTex2Coord(propertyID uint32) (Tex2Coord, error) { + var uVCoordinate C.sLib3MFTex2Coord + ret := C.CCall_lib3mf_texture2dgroup_gettex2coord(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), &uVCoordinate) if ret != 0 { - return makeError(uint32(ret)) + return Tex2Coord{}, makeError(uint32(ret)) } - return nil + return *(*Tex2Coord)(unsafe.Pointer(&uVCoordinate)), nil } -// SetBeams sets all beam indices, radii and capmodes of a mesh object. -func (inst BeamLattice) SetBeams(beamInfo []Beam) error { - ret := C.CCall_lib3mf_beamlattice_setbeams(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(beamInfo)), (*C.sLib3MFBeam)(unsafe.Pointer(&beamInfo[0]))) +// RemoveTex2Coord removes a tex2coords from the Texture2DGroup. +func (inst Texture2DGroup) RemoveTex2Coord(propertyID uint32) error { + ret := C.CCall_lib3mf_texture2dgroup_removetex2coord(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID)) if ret != 0 { return makeError(uint32(ret)) } return nil } -// GetBeams obtains all beam indices, radii and capmodes of a mesh object. -func (inst BeamLattice) GetBeams(beamInfo []Beam) ([]Beam, error) { - var neededforbeamInfo C.uint64_t - ret := C.CCall_lib3mf_beamlattice_getbeams(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforbeamInfo, nil) - if ret != 0 { - return nil, makeError(uint32(ret)) - } - if len(beamInfo) < int(neededforbeamInfo) { - beamInfo = append(beamInfo, make([]Beam, int(neededforbeamInfo)-len(beamInfo))...) - } - ret = C.CCall_lib3mf_beamlattice_getbeams(inst.wrapperRef.LibraryHandle, inst.Ref, neededforbeamInfo, nil, (*C.sLib3MFBeam)(unsafe.Pointer(&beamInfo[0]))) +// GetTexture2D obtains the texture2D instance of this group. +func (inst Texture2DGroup) GetTexture2D() (Texture2D, error) { + var texture2DInstance ref + ret := C.CCall_lib3mf_texture2dgroup_gettexture2d(inst.wrapperRef.LibraryHandle, inst.Ref, &texture2DInstance) if ret != 0 { - return nil, makeError(uint32(ret)) + return Texture2D{}, makeError(uint32(ret)) } - return beamInfo[:int(neededforbeamInfo)], nil + return inst.wrapperRef.NewTexture2D(texture2DInstance), nil } -// GetBallCount returns the ball count of a mesh object. -func (inst BeamLattice) GetBallCount() (uint32, error) { + +// CompositeMaterials represents a Lib3MF class. +type CompositeMaterials struct { + Resource +} + +func (wrapper Wrapper) NewCompositeMaterials(r ref) CompositeMaterials { + return CompositeMaterials{wrapper.NewResource(r)} +} + +// GetCount retrieves the count of Composite-s in the CompositeMaterials. +func (inst CompositeMaterials) GetCount() (uint32, error) { var count C.uint32_t - ret := C.CCall_lib3mf_beamlattice_getballcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) + ret := C.CCall_lib3mf_compositematerials_getcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) if ret != 0 { return 0, makeError(uint32(ret)) } return uint32(count), nil } -// GetBall returns index and radius of a single ball of a mesh object. -func (inst BeamLattice) GetBall(index uint32) (Ball, error) { - var ballInfo C.sLib3MFBall - ret := C.CCall_lib3mf_beamlattice_getball(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &ballInfo) +// GetAllPropertyIDs returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials. +func (inst CompositeMaterials) GetAllPropertyIDs(propertyIDs []uint32) ([]uint32, error) { + var neededforpropertyIDs C.uint64_t + ret := C.CCall_lib3mf_compositematerials_getallpropertyids(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforpropertyIDs, nil) if ret != 0 { - return Ball{}, makeError(uint32(ret)) + return nil, makeError(uint32(ret)) } - return *(*Ball)(unsafe.Pointer(&ballInfo)), nil + if len(propertyIDs) < int(neededforpropertyIDs) { + propertyIDs = append(propertyIDs, make([]uint32, int(neededforpropertyIDs)-len(propertyIDs))...) + } + ret = C.CCall_lib3mf_compositematerials_getallpropertyids(inst.wrapperRef.LibraryHandle, inst.Ref, neededforpropertyIDs, nil, (*C.uint32_t)(unsafe.Pointer(&propertyIDs[0]))) + if ret != 0 { + return nil, makeError(uint32(ret)) + } + return propertyIDs[:int(neededforpropertyIDs)], nil } -// AddBall adds a single ball to a mesh object. -func (inst BeamLattice) AddBall(ballInfo Ball) (uint32, error) { - var index C.uint32_t - ret := C.CCall_lib3mf_beamlattice_addball(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.sLib3MFBall)(unsafe.Pointer(&ballInfo)), &index) +// GetBaseMaterialGroup obtains the BaseMaterialGroup instance of this CompositeMaterials. +func (inst CompositeMaterials) GetBaseMaterialGroup() (BaseMaterialGroup, error) { + var baseMaterialGroupInstance ref + ret := C.CCall_lib3mf_compositematerials_getbasematerialgroup(inst.wrapperRef.LibraryHandle, inst.Ref, &baseMaterialGroupInstance) if ret != 0 { - return 0, makeError(uint32(ret)) + return BaseMaterialGroup{}, makeError(uint32(ret)) } - return uint32(index), nil + return inst.wrapperRef.NewBaseMaterialGroup(baseMaterialGroupInstance), nil } -// SetBall sets the index and radius of a single ball of a mesh object. -func (inst BeamLattice) SetBall(index uint32, ballInfo Ball) error { - ret := C.CCall_lib3mf_beamlattice_setball(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), (*C.sLib3MFBall)(unsafe.Pointer(&ballInfo))) +// AddComposite adds a new Composite-Mixing Values to the CompositeMaterials. +func (inst CompositeMaterials) AddComposite(composite []CompositeConstituent) (uint32, error) { + var propertyID C.uint32_t + ret := C.CCall_lib3mf_compositematerials_addcomposite(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(composite)), (*C.sLib3MFCompositeConstituent)(unsafe.Pointer(&composite[0])), &propertyID) if ret != 0 { - return makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return nil + return uint32(propertyID), nil } -// SetBalls sets all ball indices and radii of a mesh object. -func (inst BeamLattice) SetBalls(ballInfo []Ball) error { - ret := C.CCall_lib3mf_beamlattice_setballs(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(ballInfo)), (*C.sLib3MFBall)(unsafe.Pointer(&ballInfo[0]))) +// RemoveComposite removes a Composite-Maxing Ratio from the CompositeMaterials. +func (inst CompositeMaterials) RemoveComposite(propertyID uint32) error { + ret := C.CCall_lib3mf_compositematerials_removecomposite(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID)) if ret != 0 { return makeError(uint32(ret)) } return nil } -// GetBalls obtains all ball indices and radii of a mesh object. -func (inst BeamLattice) GetBalls(ballInfo []Ball) ([]Ball, error) { - var neededforballInfo C.uint64_t - ret := C.CCall_lib3mf_beamlattice_getballs(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforballInfo, nil) +// GetComposite obtains a Composite-Maxing Ratio of this CompositeMaterials. +func (inst CompositeMaterials) GetComposite(propertyID uint32, composite []CompositeConstituent) ([]CompositeConstituent, error) { + var neededforcomposite C.uint64_t + ret := C.CCall_lib3mf_compositematerials_getcomposite(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), 0, &neededforcomposite, nil) if ret != 0 { return nil, makeError(uint32(ret)) } - if len(ballInfo) < int(neededforballInfo) { - ballInfo = append(ballInfo, make([]Ball, int(neededforballInfo)-len(ballInfo))...) + if len(composite) < int(neededforcomposite) { + composite = append(composite, make([]CompositeConstituent, int(neededforcomposite)-len(composite))...) } - ret = C.CCall_lib3mf_beamlattice_getballs(inst.wrapperRef.LibraryHandle, inst.Ref, neededforballInfo, nil, (*C.sLib3MFBall)(unsafe.Pointer(&ballInfo[0]))) + ret = C.CCall_lib3mf_compositematerials_getcomposite(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), neededforcomposite, nil, (*C.sLib3MFCompositeConstituent)(unsafe.Pointer(&composite[0]))) if ret != 0 { return nil, makeError(uint32(ret)) } - return ballInfo[:int(neededforballInfo)], nil + return composite[:int(neededforcomposite)], nil } -// GetBeamSetCount returns the number of beamsets of a mesh object. -func (inst BeamLattice) GetBeamSetCount() (uint32, error) { + +// MultiPropertyGroup represents a Lib3MF class. +type MultiPropertyGroup struct { + Resource +} + +func (wrapper Wrapper) NewMultiPropertyGroup(r ref) MultiPropertyGroup { + return MultiPropertyGroup{wrapper.NewResource(r)} +} + +// GetCount retrieves the count of MultiProperty-s in the MultiPropertyGroup. +func (inst MultiPropertyGroup) GetCount() (uint32, error) { var count C.uint32_t - ret := C.CCall_lib3mf_beamlattice_getbeamsetcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) + ret := C.CCall_lib3mf_multipropertygroup_getcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) if ret != 0 { return 0, makeError(uint32(ret)) } return uint32(count), nil } -// AddBeamSet adds an empty beamset to a mesh object. -func (inst BeamLattice) AddBeamSet() (BeamSet, error) { - var beamSet ref - ret := C.CCall_lib3mf_beamlattice_addbeamset(inst.wrapperRef.LibraryHandle, inst.Ref, &beamSet) +// GetAllPropertyIDs returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup. +func (inst MultiPropertyGroup) GetAllPropertyIDs(propertyIDs []uint32) ([]uint32, error) { + var neededforpropertyIDs C.uint64_t + ret := C.CCall_lib3mf_multipropertygroup_getallpropertyids(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforpropertyIDs, nil) if ret != 0 { - return BeamSet{}, makeError(uint32(ret)) + return nil, makeError(uint32(ret)) } - return inst.wrapperRef.NewBeamSet(beamSet), nil -} - -// GetBeamSet returns a beamset of a mesh object. -func (inst BeamLattice) GetBeamSet(index uint32) (BeamSet, error) { - var beamSet ref - ret := C.CCall_lib3mf_beamlattice_getbeamset(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &beamSet) + if len(propertyIDs) < int(neededforpropertyIDs) { + propertyIDs = append(propertyIDs, make([]uint32, int(neededforpropertyIDs)-len(propertyIDs))...) + } + ret = C.CCall_lib3mf_multipropertygroup_getallpropertyids(inst.wrapperRef.LibraryHandle, inst.Ref, neededforpropertyIDs, nil, (*C.uint32_t)(unsafe.Pointer(&propertyIDs[0]))) if ret != 0 { - return BeamSet{}, makeError(uint32(ret)) + return nil, makeError(uint32(ret)) } - return inst.wrapperRef.NewBeamSet(beamSet), nil -} - - -// Component represents a Lib3MF class. -type Component struct { - Base -} - -func (wrapper Wrapper) NewComponent(r ref) Component { - return Component{wrapper.NewBase(r)} + return propertyIDs[:int(neededforpropertyIDs)], nil } -// GetObjectResource returns the Resource Instance of the component. -func (inst Component) GetObjectResource() (Object, error) { - var objectResource ref - ret := C.CCall_lib3mf_component_getobjectresource(inst.wrapperRef.LibraryHandle, inst.Ref, &objectResource) +// AddMultiProperty adds a new MultiProperty to the MultiPropertyGroup. +func (inst MultiPropertyGroup) AddMultiProperty(propertyIDs []uint32) (uint32, error) { + var propertyID C.uint32_t + ret := C.CCall_lib3mf_multipropertygroup_addmultiproperty(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(propertyIDs)), (*C.uint32_t)(unsafe.Pointer(&propertyIDs[0])), &propertyID) if ret != 0 { - return Object{}, makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return inst.wrapperRef.NewObject(objectResource), nil + return uint32(propertyID), nil } -// GetObjectResourceID returns the UniqueResourceID of the component. -func (inst Component) GetObjectResourceID() (uint32, error) { - var uniqueResourceID C.uint32_t - ret := C.CCall_lib3mf_component_getobjectresourceid(inst.wrapperRef.LibraryHandle, inst.Ref, &uniqueResourceID) +// SetMultiProperty sets the PropertyIDs of a MultiProperty. +func (inst MultiPropertyGroup) SetMultiProperty(propertyID uint32, propertyIDs []uint32) error { + ret := C.CCall_lib3mf_multipropertygroup_setmultiproperty(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), C.uint64_t(len(propertyIDs)), (*C.uint32_t)(unsafe.Pointer(&propertyIDs[0]))) if ret != 0 { - return 0, makeError(uint32(ret)) + return makeError(uint32(ret)) } - return uint32(uniqueResourceID), nil + return nil } -// GetUUID returns, whether a component has a UUID and, if true, the component's UUID. -func (inst Component) GetUUID() (bool, string, error) { - var hasUUID C.bool - var neededforuUID C.uint32_t - var filledinuUID C.uint32_t - ret := C.CCall_lib3mf_component_getuuid(inst.wrapperRef.LibraryHandle, inst.Ref, &hasUUID, 0, &neededforuUID, nil) +// GetMultiProperty obtains the PropertyIDs of a MultiProperty. +func (inst MultiPropertyGroup) GetMultiProperty(propertyID uint32, propertyIDs []uint32) ([]uint32, error) { + var neededforpropertyIDs C.uint64_t + ret := C.CCall_lib3mf_multipropertygroup_getmultiproperty(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), 0, &neededforpropertyIDs, nil) if ret != 0 { - return false, "", makeError(uint32(ret)) + return nil, makeError(uint32(ret)) } - bufferSizeuUID := neededforuUID - bufferuUID := make([]byte, bufferSizeuUID) - ret = C.CCall_lib3mf_component_getuuid(inst.wrapperRef.LibraryHandle, inst.Ref, &hasUUID, bufferSizeuUID, &filledinuUID, (*C.char)(unsafe.Pointer(&bufferuUID[0]))) + if len(propertyIDs) < int(neededforpropertyIDs) { + propertyIDs = append(propertyIDs, make([]uint32, int(neededforpropertyIDs)-len(propertyIDs))...) + } + ret = C.CCall_lib3mf_multipropertygroup_getmultiproperty(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), neededforpropertyIDs, nil, (*C.uint32_t)(unsafe.Pointer(&propertyIDs[0]))) if ret != 0 { - return false, "", makeError(uint32(ret)) + return nil, makeError(uint32(ret)) } - return bool(hasUUID), string(bufferuUID[:(filledinuUID-1)]), nil + return propertyIDs[:int(neededforpropertyIDs)], nil } -// SetUUID sets the component's UUID. -func (inst Component) SetUUID(uUID string) error { - ret := C.CCall_lib3mf_component_setuuid(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(uUID)[0]))) +// RemoveMultiProperty removes a MultiProperty from this MultiPropertyGroup. +func (inst MultiPropertyGroup) RemoveMultiProperty(propertyID uint32) error { + ret := C.CCall_lib3mf_multipropertygroup_removemultiproperty(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID)) if ret != 0 { return makeError(uint32(ret)) } return nil } -// HasTransform returns, if the component has a different transformation than the identity matrix. -func (inst Component) HasTransform() (bool, error) { - var hasTransform C.bool - ret := C.CCall_lib3mf_component_hastransform(inst.wrapperRef.LibraryHandle, inst.Ref, &hasTransform) +// GetLayerCount retrieves the number of layers of this MultiPropertyGroup. +func (inst MultiPropertyGroup) GetLayerCount() (uint32, error) { + var count C.uint32_t + ret := C.CCall_lib3mf_multipropertygroup_getlayercount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) if ret != 0 { - return false, makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return bool(hasTransform), nil + return uint32(count), nil } -// GetTransform returns the transformation matrix of the component. -func (inst Component) GetTransform() (Transform, error) { - var transform C.sLib3MFTransform - ret := C.CCall_lib3mf_component_gettransform(inst.wrapperRef.LibraryHandle, inst.Ref, &transform) +// AddLayer adds a MultiPropertyLayer to this MultiPropertyGroup. +func (inst MultiPropertyGroup) AddLayer(theLayer MultiPropertyLayer) (uint32, error) { + var layerIndex C.uint32_t + ret := C.CCall_lib3mf_multipropertygroup_addlayer(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.sLib3MFMultiPropertyLayer)(unsafe.Pointer(&theLayer)), &layerIndex) if ret != 0 { - return Transform{}, makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return *(*Transform)(unsafe.Pointer(&transform)), nil + return uint32(layerIndex), nil } -// SetTransform sets the transformation matrix of the component. -func (inst Component) SetTransform(transform Transform) error { - ret := C.CCall_lib3mf_component_settransform(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.sLib3MFTransform)(unsafe.Pointer(&transform))) +// GetLayer obtains a MultiPropertyLayer of this MultiPropertyGroup. +func (inst MultiPropertyGroup) GetLayer(layerIndex uint32) (MultiPropertyLayer, error) { + var theLayer C.sLib3MFMultiPropertyLayer + ret := C.CCall_lib3mf_multipropertygroup_getlayer(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(layerIndex), &theLayer) + if ret != 0 { + return MultiPropertyLayer{}, makeError(uint32(ret)) + } + return *(*MultiPropertyLayer)(unsafe.Pointer(&theLayer)), nil +} + +// RemoveLayer removes a MultiPropertyLayer from this MultiPropertyGroup. +func (inst MultiPropertyGroup) RemoveLayer(layerIndex uint32) error { + ret := C.CCall_lib3mf_multipropertygroup_removelayer(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(layerIndex)) if ret != 0 { return makeError(uint32(ret)) } @@ -5520,629 +8162,764 @@ func (inst Component) SetTransform(transform Transform) error { } -// ComponentsObject represents a Lib3MF class. -type ComponentsObject struct { - Object +// Attachment represents a Lib3MF class. +type Attachment struct { + Base } -func (wrapper Wrapper) NewComponentsObject(r ref) ComponentsObject { - return ComponentsObject{wrapper.NewObject(r)} +func (wrapper Wrapper) NewAttachment(r ref) Attachment { + return Attachment{wrapper.NewBase(r)} } -// AddComponent adds a new component to a components object. -func (inst ComponentsObject) AddComponent(objectResource Object, transform Transform) (Component, error) { - var componentInstance ref - ret := C.CCall_lib3mf_componentsobject_addcomponent(inst.wrapperRef.LibraryHandle, inst.Ref, objectResource.Ref, (*C.sLib3MFTransform)(unsafe.Pointer(&transform)), &componentInstance) +// GetPath retrieves an attachment's package path. This function will be removed in a later release. +func (inst Attachment) GetPath() (string, error) { + var neededforpath C.uint32_t + var filledinpath C.uint32_t + ret := C.CCall_lib3mf_attachment_getpath(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforpath, nil) if ret != 0 { - return Component{}, makeError(uint32(ret)) + return "", makeError(uint32(ret)) } - return inst.wrapperRef.NewComponent(componentInstance), nil -} - -// GetComponent retrieves a component from a component object. -func (inst ComponentsObject) GetComponent(index uint32) (Component, error) { - var componentInstance ref - ret := C.CCall_lib3mf_componentsobject_getcomponent(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &componentInstance) + bufferSizepath := neededforpath + bufferpath := make([]byte, bufferSizepath) + ret = C.CCall_lib3mf_attachment_getpath(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizepath, &filledinpath, (*C.char)(unsafe.Pointer(&bufferpath[0]))) if ret != 0 { - return Component{}, makeError(uint32(ret)) + return "", makeError(uint32(ret)) } - return inst.wrapperRef.NewComponent(componentInstance), nil + return string(bufferpath[:(filledinpath-1)]), nil } -// GetComponentCount retrieves a component count of a component object. -func (inst ComponentsObject) GetComponentCount() (uint32, error) { - var count C.uint32_t - ret := C.CCall_lib3mf_componentsobject_getcomponentcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) +// SetPath sets an attachment's package path. This function will be removed in a later release. +func (inst Attachment) SetPath(path string) error { + ret := C.CCall_lib3mf_attachment_setpath(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(path)[0]))) if ret != 0 { - return 0, makeError(uint32(ret)) + return makeError(uint32(ret)) } - return uint32(count), nil + return nil } - -// BeamSet represents a Lib3MF class. -type BeamSet struct { - Base +// PackagePart returns the PackagePart that is this attachment. +func (inst Attachment) PackagePart() (PackagePart, error) { + var packagePart ref + ret := C.CCall_lib3mf_attachment_packagepart(inst.wrapperRef.LibraryHandle, inst.Ref, &packagePart) + if ret != 0 { + return PackagePart{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewPackagePart(packagePart), nil } -func (wrapper Wrapper) NewBeamSet(r ref) BeamSet { - return BeamSet{wrapper.NewBase(r)} +// GetRelationShipType retrieves an attachment's relationship type. +func (inst Attachment) GetRelationShipType() (string, error) { + var neededforpath C.uint32_t + var filledinpath C.uint32_t + ret := C.CCall_lib3mf_attachment_getrelationshiptype(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforpath, nil) + if ret != 0 { + return "", makeError(uint32(ret)) + } + bufferSizepath := neededforpath + bufferpath := make([]byte, bufferSizepath) + ret = C.CCall_lib3mf_attachment_getrelationshiptype(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizepath, &filledinpath, (*C.char)(unsafe.Pointer(&bufferpath[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(bufferpath[:(filledinpath-1)]), nil } -// SetName sets a beamset's name string. -func (inst BeamSet) SetName(name string) error { - ret := C.CCall_lib3mf_beamset_setname(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0]))) +// SetRelationShipType sets an attachment's relationship type. +func (inst Attachment) SetRelationShipType(path string) error { + ret := C.CCall_lib3mf_attachment_setrelationshiptype(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(path)[0]))) if ret != 0 { return makeError(uint32(ret)) } return nil } -// GetName retrieves a beamset's name string. -func (inst BeamSet) GetName() (string, error) { - var neededforname C.uint32_t - var filledinname C.uint32_t - ret := C.CCall_lib3mf_beamset_getname(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforname, nil) +// WriteToFile writes out the attachment as file. +func (inst Attachment) WriteToFile(fileName string) error { + ret := C.CCall_lib3mf_attachment_writetofile(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(fileName)[0]))) if ret != 0 { - return "", makeError(uint32(ret)) + return makeError(uint32(ret)) } - bufferSizename := neededforname - buffername := make([]byte, bufferSizename) - ret = C.CCall_lib3mf_beamset_getname(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizename, &filledinname, (*C.char)(unsafe.Pointer(&buffername[0]))) + return nil +} + +// ReadFromFile reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +func (inst Attachment) ReadFromFile(fileName string) error { + ret := C.CCall_lib3mf_attachment_readfromfile(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(fileName)[0]))) if ret != 0 { - return "", makeError(uint32(ret)) + return makeError(uint32(ret)) } - return string(buffername[:(filledinname-1)]), nil + return nil } -// SetIdentifier sets a beamset's identifier string. -func (inst BeamSet) SetIdentifier(identifier string) error { - ret := C.CCall_lib3mf_beamset_setidentifier(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(identifier)[0]))) +// ReadFromCallback reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +func (inst Attachment) ReadFromCallback(theReadCallback ReadCallbackFunc, streamSize uint64, theSeekCallback SeekCallbackFunc, userData uintptr) error { + ret := C.CCall_lib3mf_attachment_readfromcallback(inst.wrapperRef.LibraryHandle, inst.Ref, (C.Lib3MFReadCallback)(unsafe.Pointer(C.Lib3MFReadCallback_cgo)), C.uint64_t(streamSize), (C.Lib3MFSeekCallback)(unsafe.Pointer(C.Lib3MFSeekCallback_cgo)), (C.Lib3MF_pvoid)(userData)) if ret != 0 { return makeError(uint32(ret)) } + readCallbackFunc = theReadCallback + seekCallbackFunc = theSeekCallback return nil } -// GetIdentifier retrieves a beamset's identifier string. -func (inst BeamSet) GetIdentifier() (string, error) { - var neededforidentifier C.uint32_t - var filledinidentifier C.uint32_t - ret := C.CCall_lib3mf_beamset_getidentifier(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforidentifier, nil) +// GetStreamSize retrieves the size of the attachment stream. +func (inst Attachment) GetStreamSize() (uint64, error) { + var streamSize C.uint64_t + ret := C.CCall_lib3mf_attachment_getstreamsize(inst.wrapperRef.LibraryHandle, inst.Ref, &streamSize) if ret != 0 { - return "", makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - bufferSizeidentifier := neededforidentifier - bufferidentifier := make([]byte, bufferSizeidentifier) - ret = C.CCall_lib3mf_beamset_getidentifier(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizeidentifier, &filledinidentifier, (*C.char)(unsafe.Pointer(&bufferidentifier[0]))) + return uint64(streamSize), nil +} + +// WriteToBuffer writes out the attachment into a buffer. +func (inst Attachment) WriteToBuffer(buffer []uint8) ([]uint8, error) { + var neededforbuffer C.uint64_t + ret := C.CCall_lib3mf_attachment_writetobuffer(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforbuffer, nil) if ret != 0 { - return "", makeError(uint32(ret)) + return nil, makeError(uint32(ret)) } - return string(bufferidentifier[:(filledinidentifier-1)]), nil + if len(buffer) < int(neededforbuffer) { + buffer = append(buffer, make([]uint8, int(neededforbuffer)-len(buffer))...) + } + ret = C.CCall_lib3mf_attachment_writetobuffer(inst.wrapperRef.LibraryHandle, inst.Ref, neededforbuffer, nil, (*C.uint8_t)(unsafe.Pointer(&buffer[0]))) + if ret != 0 { + return nil, makeError(uint32(ret)) + } + return buffer[:int(neededforbuffer)], nil } -// GetReferenceCount retrieves the reference count of a beamset. -func (inst BeamSet) GetReferenceCount() (uint32, error) { - var count C.uint32_t - ret := C.CCall_lib3mf_beamset_getreferencecount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) +// ReadFromBuffer reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). +func (inst Attachment) ReadFromBuffer(buffer []uint8) error { + ret := C.CCall_lib3mf_attachment_readfrombuffer(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(buffer)), (*C.uint8_t)(unsafe.Pointer(&buffer[0]))) if ret != 0 { - return 0, makeError(uint32(ret)) + return makeError(uint32(ret)) } - return uint32(count), nil + return nil } -// SetReferences sets the references of a beamset. -func (inst BeamSet) SetReferences(references []uint32) error { - ret := C.CCall_lib3mf_beamset_setreferences(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(references)), (*C.uint32_t)(unsafe.Pointer(&references[0]))) + +// Texture2D represents a Lib3MF class. +type Texture2D struct { + Resource +} + +func (wrapper Wrapper) NewTexture2D(r ref) Texture2D { + return Texture2D{wrapper.NewResource(r)} +} + +// GetAttachment retrieves the attachment located at the path of the texture. +func (inst Texture2D) GetAttachment() (Attachment, error) { + var attachment ref + ret := C.CCall_lib3mf_texture2d_getattachment(inst.wrapperRef.LibraryHandle, inst.Ref, &attachment) + if ret != 0 { + return Attachment{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewAttachment(attachment), nil +} + +// SetAttachment sets the texture's package path to the path of the attachment. +func (inst Texture2D) SetAttachment(attachment Attachment) error { + ret := C.CCall_lib3mf_texture2d_setattachment(inst.wrapperRef.LibraryHandle, inst.Ref, attachment.Ref) if ret != 0 { return makeError(uint32(ret)) } return nil } -// GetReferences retrieves the references of a beamset. -func (inst BeamSet) GetReferences(references []uint32) ([]uint32, error) { - var neededforreferences C.uint64_t - ret := C.CCall_lib3mf_beamset_getreferences(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforreferences, nil) +// GetContentType retrieves a texture's content type. +func (inst Texture2D) GetContentType() (TextureType, error) { + var contentType C.eLib3MFTextureType + ret := C.CCall_lib3mf_texture2d_getcontenttype(inst.wrapperRef.LibraryHandle, inst.Ref, &contentType) if ret != 0 { - return nil, makeError(uint32(ret)) - } - if len(references) < int(neededforreferences) { - references = append(references, make([]uint32, int(neededforreferences)-len(references))...) + return 0, makeError(uint32(ret)) } - ret = C.CCall_lib3mf_beamset_getreferences(inst.wrapperRef.LibraryHandle, inst.Ref, neededforreferences, nil, (*C.uint32_t)(unsafe.Pointer(&references[0]))) + return TextureType(contentType), nil +} + +// SetContentType retrieves a texture's content type. +func (inst Texture2D) SetContentType(contentType TextureType) error { + ret := C.CCall_lib3mf_texture2d_setcontenttype(inst.wrapperRef.LibraryHandle, inst.Ref, C.eLib3MFTextureType(contentType)) if ret != 0 { - return nil, makeError(uint32(ret)) + return makeError(uint32(ret)) } - return references[:int(neededforreferences)], nil + return nil } -// GetBallReferenceCount retrieves the ball reference count of a beamset. -func (inst BeamSet) GetBallReferenceCount() (uint32, error) { - var count C.uint32_t - ret := C.CCall_lib3mf_beamset_getballreferencecount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) +// GetTileStyleUV retrieves a texture's tilestyle type. +func (inst Texture2D) GetTileStyleUV() (TextureTileStyle, TextureTileStyle, error) { + var tileStyleU C.eLib3MFTextureTileStyle + var tileStyleV C.eLib3MFTextureTileStyle + ret := C.CCall_lib3mf_texture2d_gettilestyleuv(inst.wrapperRef.LibraryHandle, inst.Ref, &tileStyleU, &tileStyleV) if ret != 0 { - return 0, makeError(uint32(ret)) + return 0, 0, makeError(uint32(ret)) } - return uint32(count), nil + return TextureTileStyle(tileStyleU), TextureTileStyle(tileStyleV), nil } -// SetBallReferences sets the ball references of a beamset. -func (inst BeamSet) SetBallReferences(ballReferences []uint32) error { - ret := C.CCall_lib3mf_beamset_setballreferences(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(ballReferences)), (*C.uint32_t)(unsafe.Pointer(&ballReferences[0]))) +// SetTileStyleUV sets a texture's tilestyle type. +func (inst Texture2D) SetTileStyleUV(tileStyleU TextureTileStyle, tileStyleV TextureTileStyle) error { + ret := C.CCall_lib3mf_texture2d_settilestyleuv(inst.wrapperRef.LibraryHandle, inst.Ref, C.eLib3MFTextureTileStyle(tileStyleU), C.eLib3MFTextureTileStyle(tileStyleV)) if ret != 0 { return makeError(uint32(ret)) } return nil } -// GetBallReferences retrieves the ball references of a beamset. -func (inst BeamSet) GetBallReferences(ballReferences []uint32) ([]uint32, error) { - var neededforballReferences C.uint64_t - ret := C.CCall_lib3mf_beamset_getballreferences(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforballReferences, nil) +// GetFilter retrieves a texture's filter type. +func (inst Texture2D) GetFilter() (TextureFilter, error) { + var filter C.eLib3MFTextureFilter + ret := C.CCall_lib3mf_texture2d_getfilter(inst.wrapperRef.LibraryHandle, inst.Ref, &filter) if ret != 0 { - return nil, makeError(uint32(ret)) - } - if len(ballReferences) < int(neededforballReferences) { - ballReferences = append(ballReferences, make([]uint32, int(neededforballReferences)-len(ballReferences))...) + return 0, makeError(uint32(ret)) } - ret = C.CCall_lib3mf_beamset_getballreferences(inst.wrapperRef.LibraryHandle, inst.Ref, neededforballReferences, nil, (*C.uint32_t)(unsafe.Pointer(&ballReferences[0]))) + return TextureFilter(filter), nil +} + +// SetFilter sets a texture's filter type. +func (inst Texture2D) SetFilter(filter TextureFilter) error { + ret := C.CCall_lib3mf_texture2d_setfilter(inst.wrapperRef.LibraryHandle, inst.Ref, C.eLib3MFTextureFilter(filter)) if ret != 0 { - return nil, makeError(uint32(ret)) + return makeError(uint32(ret)) } - return ballReferences[:int(neededforballReferences)], nil + return nil } -// BaseMaterialGroup represents a Lib3MF class. -type BaseMaterialGroup struct { - Resource +// BuildItem represents a Lib3MF class. +type BuildItem struct { + Base } -func (wrapper Wrapper) NewBaseMaterialGroup(r ref) BaseMaterialGroup { - return BaseMaterialGroup{wrapper.NewResource(r)} +func (wrapper Wrapper) NewBuildItem(r ref) BuildItem { + return BuildItem{wrapper.NewBase(r)} } -// GetCount retrieves the count of base materials in the material group. -func (inst BaseMaterialGroup) GetCount() (uint32, error) { - var count C.uint32_t - ret := C.CCall_lib3mf_basematerialgroup_getcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) +// GetObjectResource retrieves the object resource associated to a build item. +func (inst BuildItem) GetObjectResource() (Object, error) { + var objectResource ref + ret := C.CCall_lib3mf_builditem_getobjectresource(inst.wrapperRef.LibraryHandle, inst.Ref, &objectResource) if ret != 0 { - return 0, makeError(uint32(ret)) + return Object{}, makeError(uint32(ret)) } - return uint32(count), nil + return inst.wrapperRef.NewObject(objectResource), nil } -// GetAllPropertyIDs returns all the PropertyIDs of all materials in this group. -func (inst BaseMaterialGroup) GetAllPropertyIDs(propertyIDs []uint32) ([]uint32, error) { - var neededforpropertyIDs C.uint64_t - ret := C.CCall_lib3mf_basematerialgroup_getallpropertyids(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforpropertyIDs, nil) +// GetUUID returns, whether a build item has a UUID and, if true, the build item's UUID. +func (inst BuildItem) GetUUID() (bool, string, error) { + var hasUUID C.bool + var neededforuUID C.uint32_t + var filledinuUID C.uint32_t + ret := C.CCall_lib3mf_builditem_getuuid(inst.wrapperRef.LibraryHandle, inst.Ref, &hasUUID, 0, &neededforuUID, nil) if ret != 0 { - return nil, makeError(uint32(ret)) + return false, "", makeError(uint32(ret)) } - if len(propertyIDs) < int(neededforpropertyIDs) { - propertyIDs = append(propertyIDs, make([]uint32, int(neededforpropertyIDs)-len(propertyIDs))...) + bufferSizeuUID := neededforuUID + bufferuUID := make([]byte, bufferSizeuUID) + ret = C.CCall_lib3mf_builditem_getuuid(inst.wrapperRef.LibraryHandle, inst.Ref, &hasUUID, bufferSizeuUID, &filledinuUID, (*C.char)(unsafe.Pointer(&bufferuUID[0]))) + if ret != 0 { + return false, "", makeError(uint32(ret)) } - ret = C.CCall_lib3mf_basematerialgroup_getallpropertyids(inst.wrapperRef.LibraryHandle, inst.Ref, neededforpropertyIDs, nil, (*C.uint32_t)(unsafe.Pointer(&propertyIDs[0]))) + return bool(hasUUID), string(bufferuUID[:(filledinuUID-1)]), nil +} + +// SetUUID sets the build item's UUID. +func (inst BuildItem) SetUUID(uUID string) error { + ret := C.CCall_lib3mf_builditem_setuuid(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(uUID)[0]))) if ret != 0 { - return nil, makeError(uint32(ret)) + return makeError(uint32(ret)) } - return propertyIDs[:int(neededforpropertyIDs)], nil + return nil } -// AddMaterial adds a new material to the material group. -func (inst BaseMaterialGroup) AddMaterial(name string, displayColor Color) (uint32, error) { - var propertyID C.uint32_t - ret := C.CCall_lib3mf_basematerialgroup_addmaterial(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0])), (*C.sLib3MFColor)(unsafe.Pointer(&displayColor)), &propertyID) +// GetObjectResourceID retrieves the object UniqueResourceID associated to a build item. +func (inst BuildItem) GetObjectResourceID() (uint32, error) { + var uniqueResourceID C.uint32_t + ret := C.CCall_lib3mf_builditem_getobjectresourceid(inst.wrapperRef.LibraryHandle, inst.Ref, &uniqueResourceID) if ret != 0 { return 0, makeError(uint32(ret)) } - return uint32(propertyID), nil + return uint32(uniqueResourceID), nil } -// RemoveMaterial removes a material from the material group. -func (inst BaseMaterialGroup) RemoveMaterial(propertyID uint32) error { - ret := C.CCall_lib3mf_basematerialgroup_removematerial(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID)) +// HasObjectTransform checks, if a build item has a non-identity transformation matrix. +func (inst BuildItem) HasObjectTransform() (bool, error) { + var hasTransform C.bool + ret := C.CCall_lib3mf_builditem_hasobjecttransform(inst.wrapperRef.LibraryHandle, inst.Ref, &hasTransform) + if ret != 0 { + return false, makeError(uint32(ret)) + } + return bool(hasTransform), nil +} + +// GetObjectTransform retrieves a build item's transformation matrix. +func (inst BuildItem) GetObjectTransform() (Transform, error) { + var transform C.sLib3MFTransform + ret := C.CCall_lib3mf_builditem_getobjecttransform(inst.wrapperRef.LibraryHandle, inst.Ref, &transform) + if ret != 0 { + return Transform{}, makeError(uint32(ret)) + } + return *(*Transform)(unsafe.Pointer(&transform)), nil +} + +// SetObjectTransform sets a build item's transformation matrix. +func (inst BuildItem) SetObjectTransform(transform Transform) error { + ret := C.CCall_lib3mf_builditem_setobjecttransform(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.sLib3MFTransform)(unsafe.Pointer(&transform))) if ret != 0 { return makeError(uint32(ret)) } return nil } -// GetName returns the base material's name. -func (inst BaseMaterialGroup) GetName(propertyID uint32) (string, error) { - var neededforname C.uint32_t - var filledinname C.uint32_t - ret := C.CCall_lib3mf_basematerialgroup_getname(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), 0, &neededforname, nil) +// GetPartNumber retrieves a build item's part number string. +func (inst BuildItem) GetPartNumber() (string, error) { + var neededforpartNumber C.uint32_t + var filledinpartNumber C.uint32_t + ret := C.CCall_lib3mf_builditem_getpartnumber(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforpartNumber, nil) if ret != 0 { return "", makeError(uint32(ret)) } - bufferSizename := neededforname - buffername := make([]byte, bufferSizename) - ret = C.CCall_lib3mf_basematerialgroup_getname(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), bufferSizename, &filledinname, (*C.char)(unsafe.Pointer(&buffername[0]))) + bufferSizepartNumber := neededforpartNumber + bufferpartNumber := make([]byte, bufferSizepartNumber) + ret = C.CCall_lib3mf_builditem_getpartnumber(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizepartNumber, &filledinpartNumber, (*C.char)(unsafe.Pointer(&bufferpartNumber[0]))) if ret != 0 { return "", makeError(uint32(ret)) } - return string(buffername[:(filledinname-1)]), nil + return string(bufferpartNumber[:(filledinpartNumber-1)]), nil } -// SetName sets a base material's name. -func (inst BaseMaterialGroup) SetName(propertyID uint32, name string) error { - ret := C.CCall_lib3mf_basematerialgroup_setname(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), (*C.char)(unsafe.Pointer(&[]byte(name)[0]))) +// SetPartNumber sets a build item's part number string. +func (inst BuildItem) SetPartNumber(setPartnumber string) error { + ret := C.CCall_lib3mf_builditem_setpartnumber(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(setPartnumber)[0]))) if ret != 0 { return makeError(uint32(ret)) } return nil } -// SetDisplayColor sets a base material's display color. -func (inst BaseMaterialGroup) SetDisplayColor(propertyID uint32, theColor Color) error { - ret := C.CCall_lib3mf_basematerialgroup_setdisplaycolor(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), (*C.sLib3MFColor)(unsafe.Pointer(&theColor))) +// GetMetaDataGroup returns the metadatagroup of this build item. +func (inst BuildItem) GetMetaDataGroup() (MetaDataGroup, error) { + var metaDataGroup ref + ret := C.CCall_lib3mf_builditem_getmetadatagroup(inst.wrapperRef.LibraryHandle, inst.Ref, &metaDataGroup) if ret != 0 { - return makeError(uint32(ret)) + return MetaDataGroup{}, makeError(uint32(ret)) } - return nil + return inst.wrapperRef.NewMetaDataGroup(metaDataGroup), nil } -// GetDisplayColor returns a base material's display color. -func (inst BaseMaterialGroup) GetDisplayColor(propertyID uint32) (Color, error) { - var theColor C.sLib3MFColor - ret := C.CCall_lib3mf_basematerialgroup_getdisplaycolor(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), &theColor) +// GetOutbox returns the outbox of a build item. +func (inst BuildItem) GetOutbox() (Box, error) { + var outbox C.sLib3MFBox + ret := C.CCall_lib3mf_builditem_getoutbox(inst.wrapperRef.LibraryHandle, inst.Ref, &outbox) if ret != 0 { - return Color{}, makeError(uint32(ret)) + return Box{}, makeError(uint32(ret)) } - return *(*Color)(unsafe.Pointer(&theColor)), nil + return *(*Box)(unsafe.Pointer(&outbox)), nil } -// ColorGroup represents a Lib3MF class. -type ColorGroup struct { - Resource -} - -func (wrapper Wrapper) NewColorGroup(r ref) ColorGroup { - return ColorGroup{wrapper.NewResource(r)} +// BuildItemIterator represents a Lib3MF class. +type BuildItemIterator struct { + Base } -// GetCount retrieves the count of base materials in this Color Group. -func (inst ColorGroup) GetCount() (uint32, error) { - var count C.uint32_t - ret := C.CCall_lib3mf_colorgroup_getcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) - if ret != 0 { - return 0, makeError(uint32(ret)) - } - return uint32(count), nil +func (wrapper Wrapper) NewBuildItemIterator(r ref) BuildItemIterator { + return BuildItemIterator{wrapper.NewBase(r)} } -// GetAllPropertyIDs returns all the PropertyIDs of all colors within this group. -func (inst ColorGroup) GetAllPropertyIDs(propertyIDs []uint32) ([]uint32, error) { - var neededforpropertyIDs C.uint64_t - ret := C.CCall_lib3mf_colorgroup_getallpropertyids(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforpropertyIDs, nil) - if ret != 0 { - return nil, makeError(uint32(ret)) - } - if len(propertyIDs) < int(neededforpropertyIDs) { - propertyIDs = append(propertyIDs, make([]uint32, int(neededforpropertyIDs)-len(propertyIDs))...) - } - ret = C.CCall_lib3mf_colorgroup_getallpropertyids(inst.wrapperRef.LibraryHandle, inst.Ref, neededforpropertyIDs, nil, (*C.uint32_t)(unsafe.Pointer(&propertyIDs[0]))) +// MoveNext iterates to the next build item in the list. +func (inst BuildItemIterator) MoveNext() (bool, error) { + var hasNext C.bool + ret := C.CCall_lib3mf_builditemiterator_movenext(inst.wrapperRef.LibraryHandle, inst.Ref, &hasNext) if ret != 0 { - return nil, makeError(uint32(ret)) + return false, makeError(uint32(ret)) } - return propertyIDs[:int(neededforpropertyIDs)], nil + return bool(hasNext), nil } -// AddColor adds a new value. -func (inst ColorGroup) AddColor(theColor Color) (uint32, error) { - var propertyID C.uint32_t - ret := C.CCall_lib3mf_colorgroup_addcolor(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.sLib3MFColor)(unsafe.Pointer(&theColor)), &propertyID) +// MovePrevious iterates to the previous build item in the list. +func (inst BuildItemIterator) MovePrevious() (bool, error) { + var hasPrevious C.bool + ret := C.CCall_lib3mf_builditemiterator_moveprevious(inst.wrapperRef.LibraryHandle, inst.Ref, &hasPrevious) if ret != 0 { - return 0, makeError(uint32(ret)) + return false, makeError(uint32(ret)) } - return uint32(propertyID), nil + return bool(hasPrevious), nil } -// RemoveColor removes a color from the color group. -func (inst ColorGroup) RemoveColor(propertyID uint32) error { - ret := C.CCall_lib3mf_colorgroup_removecolor(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID)) +// GetCurrent returns the build item the iterator points at. +func (inst BuildItemIterator) GetCurrent() (BuildItem, error) { + var buildItem ref + ret := C.CCall_lib3mf_builditemiterator_getcurrent(inst.wrapperRef.LibraryHandle, inst.Ref, &buildItem) if ret != 0 { - return makeError(uint32(ret)) + return BuildItem{}, makeError(uint32(ret)) } - return nil + return inst.wrapperRef.NewBuildItem(buildItem), nil } -// SetColor sets a color value. -func (inst ColorGroup) SetColor(propertyID uint32, theColor Color) error { - ret := C.CCall_lib3mf_colorgroup_setcolor(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), (*C.sLib3MFColor)(unsafe.Pointer(&theColor))) +// Clone creates a new build item iterator with the same build item list. +func (inst BuildItemIterator) Clone() (BuildItemIterator, error) { + var outBuildItemIterator ref + ret := C.CCall_lib3mf_builditemiterator_clone(inst.wrapperRef.LibraryHandle, inst.Ref, &outBuildItemIterator) if ret != 0 { - return makeError(uint32(ret)) + return BuildItemIterator{}, makeError(uint32(ret)) } - return nil + return inst.wrapperRef.NewBuildItemIterator(outBuildItemIterator), nil } -// GetColor sets a color value. -func (inst ColorGroup) GetColor(propertyID uint32) (Color, error) { - var theColor C.sLib3MFColor - ret := C.CCall_lib3mf_colorgroup_getcolor(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), &theColor) +// Count returns the number of build items the iterator captures. +func (inst BuildItemIterator) Count() (uint64, error) { + var count C.uint64_t + ret := C.CCall_lib3mf_builditemiterator_count(inst.wrapperRef.LibraryHandle, inst.Ref, &count) if ret != 0 { - return Color{}, makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return *(*Color)(unsafe.Pointer(&theColor)), nil + return uint64(count), nil } -// Texture2DGroup represents a Lib3MF class. -type Texture2DGroup struct { - Resource +// Slice represents a Lib3MF class. +type Slice struct { + Base } -func (wrapper Wrapper) NewTexture2DGroup(r ref) Texture2DGroup { - return Texture2DGroup{wrapper.NewResource(r)} +func (wrapper Wrapper) NewSlice(r ref) Slice { + return Slice{wrapper.NewBase(r)} } -// GetCount retrieves the count of tex2coords in the Texture2DGroup. -func (inst Texture2DGroup) GetCount() (uint32, error) { - var count C.uint32_t - ret := C.CCall_lib3mf_texture2dgroup_getcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) +// SetVertices set all vertices of a slice. All polygons will be cleared. +func (inst Slice) SetVertices(vertices []Position2D) error { + ret := C.CCall_lib3mf_slice_setvertices(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(vertices)), (*C.sLib3MFPosition2D)(unsafe.Pointer(&vertices[0]))) if ret != 0 { - return 0, makeError(uint32(ret)) + return makeError(uint32(ret)) } - return uint32(count), nil + return nil } -// GetAllPropertyIDs returns all the PropertyIDs of all tex2coords in this Texture2DGroup. -func (inst Texture2DGroup) GetAllPropertyIDs(propertyIDs []uint32) ([]uint32, error) { - var neededforpropertyIDs C.uint64_t - ret := C.CCall_lib3mf_texture2dgroup_getallpropertyids(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforpropertyIDs, nil) +// GetVertices get all vertices of a slice. +func (inst Slice) GetVertices(vertices []Position2D) ([]Position2D, error) { + var neededforvertices C.uint64_t + ret := C.CCall_lib3mf_slice_getvertices(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforvertices, nil) if ret != 0 { return nil, makeError(uint32(ret)) } - if len(propertyIDs) < int(neededforpropertyIDs) { - propertyIDs = append(propertyIDs, make([]uint32, int(neededforpropertyIDs)-len(propertyIDs))...) + if len(vertices) < int(neededforvertices) { + vertices = append(vertices, make([]Position2D, int(neededforvertices)-len(vertices))...) } - ret = C.CCall_lib3mf_texture2dgroup_getallpropertyids(inst.wrapperRef.LibraryHandle, inst.Ref, neededforpropertyIDs, nil, (*C.uint32_t)(unsafe.Pointer(&propertyIDs[0]))) + ret = C.CCall_lib3mf_slice_getvertices(inst.wrapperRef.LibraryHandle, inst.Ref, neededforvertices, nil, (*C.sLib3MFPosition2D)(unsafe.Pointer(&vertices[0]))) if ret != 0 { return nil, makeError(uint32(ret)) } - return propertyIDs[:int(neededforpropertyIDs)], nil + return vertices[:int(neededforvertices)], nil } -// AddTex2Coord adds a new tex2coord to the Texture2DGroup. -func (inst Texture2DGroup) AddTex2Coord(uVCoordinate Tex2Coord) (uint32, error) { - var propertyID C.uint32_t - ret := C.CCall_lib3mf_texture2dgroup_addtex2coord(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.sLib3MFTex2Coord)(unsafe.Pointer(&uVCoordinate)), &propertyID) +// GetVertexCount get the number of vertices in a slice. +func (inst Slice) GetVertexCount() (uint64, error) { + var count C.uint64_t + ret := C.CCall_lib3mf_slice_getvertexcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) if ret != 0 { return 0, makeError(uint32(ret)) } - return uint32(propertyID), nil + return uint64(count), nil } -// GetTex2Coord obtains a tex2coord to the Texture2DGroup. -func (inst Texture2DGroup) GetTex2Coord(propertyID uint32) (Tex2Coord, error) { - var uVCoordinate C.sLib3MFTex2Coord - ret := C.CCall_lib3mf_texture2dgroup_gettex2coord(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), &uVCoordinate) +// AddPolygon add a new polygon to this slice. +func (inst Slice) AddPolygon(indices []uint32) (uint64, error) { + var index C.uint64_t + ret := C.CCall_lib3mf_slice_addpolygon(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(indices)), (*C.uint32_t)(unsafe.Pointer(&indices[0])), &index) if ret != 0 { - return Tex2Coord{}, makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return *(*Tex2Coord)(unsafe.Pointer(&uVCoordinate)), nil + return uint64(index), nil } -// RemoveTex2Coord removes a tex2coords from the Texture2DGroup. -func (inst Texture2DGroup) RemoveTex2Coord(propertyID uint32) error { - ret := C.CCall_lib3mf_texture2dgroup_removetex2coord(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID)) +// GetPolygonCount get the number of polygons in the slice. +func (inst Slice) GetPolygonCount() (uint64, error) { + var count C.uint64_t + ret := C.CCall_lib3mf_slice_getpolygoncount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) if ret != 0 { - return makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return nil + return uint64(count), nil } -// GetTexture2D obtains the texture2D instance of this group. -func (inst Texture2DGroup) GetTexture2D() (Texture2D, error) { - var texture2DInstance ref - ret := C.CCall_lib3mf_texture2dgroup_gettexture2d(inst.wrapperRef.LibraryHandle, inst.Ref, &texture2DInstance) +// SetPolygonIndices set all indices of a polygon. +func (inst Slice) SetPolygonIndices(index uint64, indices []uint32) error { + ret := C.CCall_lib3mf_slice_setpolygonindices(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(index), C.uint64_t(len(indices)), (*C.uint32_t)(unsafe.Pointer(&indices[0]))) if ret != 0 { - return Texture2D{}, makeError(uint32(ret)) + return makeError(uint32(ret)) } - return inst.wrapperRef.NewTexture2D(texture2DInstance), nil + return nil } - -// CompositeMaterials represents a Lib3MF class. -type CompositeMaterials struct { - Resource +// GetPolygonIndices get all vertices of a slice. +func (inst Slice) GetPolygonIndices(index uint64, indices []uint32) ([]uint32, error) { + var neededforindices C.uint64_t + ret := C.CCall_lib3mf_slice_getpolygonindices(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(index), 0, &neededforindices, nil) + if ret != 0 { + return nil, makeError(uint32(ret)) + } + if len(indices) < int(neededforindices) { + indices = append(indices, make([]uint32, int(neededforindices)-len(indices))...) + } + ret = C.CCall_lib3mf_slice_getpolygonindices(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(index), neededforindices, nil, (*C.uint32_t)(unsafe.Pointer(&indices[0]))) + if ret != 0 { + return nil, makeError(uint32(ret)) + } + return indices[:int(neededforindices)], nil } -func (wrapper Wrapper) NewCompositeMaterials(r ref) CompositeMaterials { - return CompositeMaterials{wrapper.NewResource(r)} +// GetPolygonIndexCount get the number of vertices in a slice. +func (inst Slice) GetPolygonIndexCount(index uint64) (uint64, error) { + var count C.uint64_t + ret := C.CCall_lib3mf_slice_getpolygonindexcount(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(index), &count) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return uint64(count), nil } -// GetCount retrieves the count of Composite-s in the CompositeMaterials. -func (inst CompositeMaterials) GetCount() (uint32, error) { - var count C.uint32_t - ret := C.CCall_lib3mf_compositematerials_getcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) +// GetZTop get the upper Z-Coordinate of this slice. +func (inst Slice) GetZTop() (float64, error) { + var zTop C.double + ret := C.CCall_lib3mf_slice_getztop(inst.wrapperRef.LibraryHandle, inst.Ref, &zTop) if ret != 0 { return 0, makeError(uint32(ret)) } - return uint32(count), nil + return float64(zTop), nil } -// GetAllPropertyIDs returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials. -func (inst CompositeMaterials) GetAllPropertyIDs(propertyIDs []uint32) ([]uint32, error) { - var neededforpropertyIDs C.uint64_t - ret := C.CCall_lib3mf_compositematerials_getallpropertyids(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforpropertyIDs, nil) + +// ToolpathProfile represents a Lib3MF class. +type ToolpathProfile struct { + Base +} + +func (wrapper Wrapper) NewToolpathProfile(r ref) ToolpathProfile { + return ToolpathProfile{wrapper.NewBase(r)} +} + +// GetUUID retrieves the profile's uuid. +func (inst ToolpathProfile) GetUUID() (string, error) { + var neededforuUID C.uint32_t + var filledinuUID C.uint32_t + ret := C.CCall_lib3mf_toolpathprofile_getuuid(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforuUID, nil) if ret != 0 { - return nil, makeError(uint32(ret)) - } - if len(propertyIDs) < int(neededforpropertyIDs) { - propertyIDs = append(propertyIDs, make([]uint32, int(neededforpropertyIDs)-len(propertyIDs))...) + return "", makeError(uint32(ret)) } - ret = C.CCall_lib3mf_compositematerials_getallpropertyids(inst.wrapperRef.LibraryHandle, inst.Ref, neededforpropertyIDs, nil, (*C.uint32_t)(unsafe.Pointer(&propertyIDs[0]))) + bufferSizeuUID := neededforuUID + bufferuUID := make([]byte, bufferSizeuUID) + ret = C.CCall_lib3mf_toolpathprofile_getuuid(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizeuUID, &filledinuUID, (*C.char)(unsafe.Pointer(&bufferuUID[0]))) if ret != 0 { - return nil, makeError(uint32(ret)) + return "", makeError(uint32(ret)) } - return propertyIDs[:int(neededforpropertyIDs)], nil + return string(bufferuUID[:(filledinuUID-1)]), nil } -// GetBaseMaterialGroup obtains the BaseMaterialGroup instance of this CompositeMaterials. -func (inst CompositeMaterials) GetBaseMaterialGroup() (BaseMaterialGroup, error) { - var baseMaterialGroupInstance ref - ret := C.CCall_lib3mf_compositematerials_getbasematerialgroup(inst.wrapperRef.LibraryHandle, inst.Ref, &baseMaterialGroupInstance) +// GetName retrieves the profile's name. +func (inst ToolpathProfile) GetName() (string, error) { + var neededforname C.uint32_t + var filledinname C.uint32_t + ret := C.CCall_lib3mf_toolpathprofile_getname(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforname, nil) if ret != 0 { - return BaseMaterialGroup{}, makeError(uint32(ret)) + return "", makeError(uint32(ret)) } - return inst.wrapperRef.NewBaseMaterialGroup(baseMaterialGroupInstance), nil + bufferSizename := neededforname + buffername := make([]byte, bufferSizename) + ret = C.CCall_lib3mf_toolpathprofile_getname(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizename, &filledinname, (*C.char)(unsafe.Pointer(&buffername[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(buffername[:(filledinname-1)]), nil } -// AddComposite adds a new Composite-Mixing Values to the CompositeMaterials. -func (inst CompositeMaterials) AddComposite(composite []CompositeConstituent) (uint32, error) { - var propertyID C.uint32_t - ret := C.CCall_lib3mf_compositematerials_addcomposite(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(composite)), (*C.sLib3MFCompositeConstituent)(unsafe.Pointer(&composite[0])), &propertyID) +// GetParameterCount returns the number of parameters. +func (inst ToolpathProfile) GetParameterCount() (uint32, error) { + var count C.uint32_t + ret := C.CCall_lib3mf_toolpathprofile_getparametercount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) if ret != 0 { return 0, makeError(uint32(ret)) } - return uint32(propertyID), nil + return uint32(count), nil } -// RemoveComposite removes a Composite-Maxing Ratio from the CompositeMaterials. -func (inst CompositeMaterials) RemoveComposite(propertyID uint32) error { - ret := C.CCall_lib3mf_compositematerials_removecomposite(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID)) +// GetParameterName returns the Name of a parameter. +func (inst ToolpathProfile) GetParameterName(index uint32) (string, error) { + var neededforname C.uint32_t + var filledinname C.uint32_t + ret := C.CCall_lib3mf_toolpathprofile_getparametername(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), 0, &neededforname, nil) if ret != 0 { - return makeError(uint32(ret)) + return "", makeError(uint32(ret)) } - return nil + bufferSizename := neededforname + buffername := make([]byte, bufferSizename) + ret = C.CCall_lib3mf_toolpathprofile_getparametername(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), bufferSizename, &filledinname, (*C.char)(unsafe.Pointer(&buffername[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(buffername[:(filledinname-1)]), nil } -// GetComposite obtains a Composite-Maxing Ratio of this CompositeMaterials. -func (inst CompositeMaterials) GetComposite(propertyID uint32, composite []CompositeConstituent) ([]CompositeConstituent, error) { - var neededforcomposite C.uint64_t - ret := C.CCall_lib3mf_compositematerials_getcomposite(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), 0, &neededforcomposite, nil) +// GetParameterNameSpace returns the NameSpace of a parameter. +func (inst ToolpathProfile) GetParameterNameSpace(index uint32) (string, error) { + var neededfornameSpace C.uint32_t + var filledinnameSpace C.uint32_t + ret := C.CCall_lib3mf_toolpathprofile_getparameternamespace(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), 0, &neededfornameSpace, nil) if ret != 0 { - return nil, makeError(uint32(ret)) - } - if len(composite) < int(neededforcomposite) { - composite = append(composite, make([]CompositeConstituent, int(neededforcomposite)-len(composite))...) + return "", makeError(uint32(ret)) } - ret = C.CCall_lib3mf_compositematerials_getcomposite(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), neededforcomposite, nil, (*C.sLib3MFCompositeConstituent)(unsafe.Pointer(&composite[0]))) + bufferSizenameSpace := neededfornameSpace + buffernameSpace := make([]byte, bufferSizenameSpace) + ret = C.CCall_lib3mf_toolpathprofile_getparameternamespace(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), bufferSizenameSpace, &filledinnameSpace, (*C.char)(unsafe.Pointer(&buffernameSpace[0]))) if ret != 0 { - return nil, makeError(uint32(ret)) + return "", makeError(uint32(ret)) } - return composite[:int(neededforcomposite)], nil -} - - -// MultiPropertyGroup represents a Lib3MF class. -type MultiPropertyGroup struct { - Resource + return string(buffernameSpace[:(filledinnameSpace-1)]), nil } -func (wrapper Wrapper) NewMultiPropertyGroup(r ref) MultiPropertyGroup { - return MultiPropertyGroup{wrapper.NewResource(r)} +// HasParameterValue checks if a parameter value exists. +func (inst ToolpathProfile) HasParameterValue(nameSpaceName string, valueName string) (bool, error) { + var valueExists C.bool + ret := C.CCall_lib3mf_toolpathprofile_hasparametervalue(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpaceName)[0])), (*C.char)(unsafe.Pointer(&[]byte(valueName)[0])), &valueExists) + if ret != 0 { + return false, makeError(uint32(ret)) + } + return bool(valueExists), nil } -// GetCount retrieves the count of MultiProperty-s in the MultiPropertyGroup. -func (inst MultiPropertyGroup) GetCount() (uint32, error) { - var count C.uint32_t - ret := C.CCall_lib3mf_multipropertygroup_getcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) +// GetParameterValue retrieves a profile's parameter value. Fails if value does not exist. +func (inst ToolpathProfile) GetParameterValue(nameSpaceName string, valueName string) (string, error) { + var neededforvalue C.uint32_t + var filledinvalue C.uint32_t + ret := C.CCall_lib3mf_toolpathprofile_getparametervalue(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpaceName)[0])), (*C.char)(unsafe.Pointer(&[]byte(valueName)[0])), 0, &neededforvalue, nil) if ret != 0 { - return 0, makeError(uint32(ret)) + return "", makeError(uint32(ret)) } - return uint32(count), nil + bufferSizevalue := neededforvalue + buffervalue := make([]byte, bufferSizevalue) + ret = C.CCall_lib3mf_toolpathprofile_getparametervalue(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpaceName)[0])), (*C.char)(unsafe.Pointer(&[]byte(valueName)[0])), bufferSizevalue, &filledinvalue, (*C.char)(unsafe.Pointer(&buffervalue[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(buffervalue[:(filledinvalue-1)]), nil } -// GetAllPropertyIDs returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup. -func (inst MultiPropertyGroup) GetAllPropertyIDs(propertyIDs []uint32) ([]uint32, error) { - var neededforpropertyIDs C.uint64_t - ret := C.CCall_lib3mf_multipropertygroup_getallpropertyids(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforpropertyIDs, nil) +// GetParameterValueDef retrieves a profile's parameter value. +func (inst ToolpathProfile) GetParameterValueDef(nameSpaceName string, valueName string, defaultValue string) (string, error) { + var neededforvalue C.uint32_t + var filledinvalue C.uint32_t + ret := C.CCall_lib3mf_toolpathprofile_getparametervaluedef(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpaceName)[0])), (*C.char)(unsafe.Pointer(&[]byte(valueName)[0])), (*C.char)(unsafe.Pointer(&[]byte(defaultValue)[0])), 0, &neededforvalue, nil) if ret != 0 { - return nil, makeError(uint32(ret)) + return "", makeError(uint32(ret)) } - if len(propertyIDs) < int(neededforpropertyIDs) { - propertyIDs = append(propertyIDs, make([]uint32, int(neededforpropertyIDs)-len(propertyIDs))...) + bufferSizevalue := neededforvalue + buffervalue := make([]byte, bufferSizevalue) + ret = C.CCall_lib3mf_toolpathprofile_getparametervaluedef(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpaceName)[0])), (*C.char)(unsafe.Pointer(&[]byte(valueName)[0])), (*C.char)(unsafe.Pointer(&[]byte(defaultValue)[0])), bufferSizevalue, &filledinvalue, (*C.char)(unsafe.Pointer(&buffervalue[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) } - ret = C.CCall_lib3mf_multipropertygroup_getallpropertyids(inst.wrapperRef.LibraryHandle, inst.Ref, neededforpropertyIDs, nil, (*C.uint32_t)(unsafe.Pointer(&propertyIDs[0]))) + return string(buffervalue[:(filledinvalue-1)]), nil +} + +// GetParameterDoubleValue retrieves a profile's parameter value as double. Fails if value does not exist or is not a double value. +func (inst ToolpathProfile) GetParameterDoubleValue(nameSpaceName string, valueName string) (float64, error) { + var value C.double + ret := C.CCall_lib3mf_toolpathprofile_getparameterdoublevalue(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpaceName)[0])), (*C.char)(unsafe.Pointer(&[]byte(valueName)[0])), &value) if ret != 0 { - return nil, makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return propertyIDs[:int(neededforpropertyIDs)], nil + return float64(value), nil } -// AddMultiProperty adds a new MultiProperty to the MultiPropertyGroup. -func (inst MultiPropertyGroup) AddMultiProperty(propertyIDs []uint32) (uint32, error) { - var propertyID C.uint32_t - ret := C.CCall_lib3mf_multipropertygroup_addmultiproperty(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(propertyIDs)), (*C.uint32_t)(unsafe.Pointer(&propertyIDs[0])), &propertyID) +// GetParameterDoubleValueDef retrieves a profile's parameter value as double. +func (inst ToolpathProfile) GetParameterDoubleValueDef(nameSpaceName string, valueName string, defaultValue float64) (float64, error) { + var value C.double + ret := C.CCall_lib3mf_toolpathprofile_getparameterdoublevaluedef(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpaceName)[0])), (*C.char)(unsafe.Pointer(&[]byte(valueName)[0])), C.double(defaultValue), &value) if ret != 0 { return 0, makeError(uint32(ret)) } - return uint32(propertyID), nil + return float64(value), nil } -// SetMultiProperty sets the PropertyIDs of a MultiProperty. -func (inst MultiPropertyGroup) SetMultiProperty(propertyID uint32, propertyIDs []uint32) error { - ret := C.CCall_lib3mf_multipropertygroup_setmultiproperty(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), C.uint64_t(len(propertyIDs)), (*C.uint32_t)(unsafe.Pointer(&propertyIDs[0]))) +// GetParameterIntegerValue retrieves a profile's parameter value as integer. Fails if value does not exist or is not a integer value. +func (inst ToolpathProfile) GetParameterIntegerValue(nameSpaceName string, valueName string) (int64, error) { + var value C.int64_t + ret := C.CCall_lib3mf_toolpathprofile_getparameterintegervalue(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpaceName)[0])), (*C.char)(unsafe.Pointer(&[]byte(valueName)[0])), &value) if ret != 0 { - return makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return nil + return int64(value), nil } -// GetMultiProperty obtains the PropertyIDs of a MultiProperty. -func (inst MultiPropertyGroup) GetMultiProperty(propertyID uint32, propertyIDs []uint32) ([]uint32, error) { - var neededforpropertyIDs C.uint64_t - ret := C.CCall_lib3mf_multipropertygroup_getmultiproperty(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), 0, &neededforpropertyIDs, nil) +// GetParameterIntegerValueDef retrieves a profile's parameter value as integer. +func (inst ToolpathProfile) GetParameterIntegerValueDef(nameSpaceName string, valueName string, defaultValue int64) (int64, error) { + var value C.int64_t + ret := C.CCall_lib3mf_toolpathprofile_getparameterintegervaluedef(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpaceName)[0])), (*C.char)(unsafe.Pointer(&[]byte(valueName)[0])), C.int64_t(defaultValue), &value) if ret != 0 { - return nil, makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - if len(propertyIDs) < int(neededforpropertyIDs) { - propertyIDs = append(propertyIDs, make([]uint32, int(neededforpropertyIDs)-len(propertyIDs))...) + return int64(value), nil +} + +// GetParameterBoolValue retrieves a profile's parameter value as boolean. Fails if value does not exist or is not a boolean value. +func (inst ToolpathProfile) GetParameterBoolValue(nameSpaceName string, valueName string) (bool, error) { + var value C.bool + ret := C.CCall_lib3mf_toolpathprofile_getparameterboolvalue(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpaceName)[0])), (*C.char)(unsafe.Pointer(&[]byte(valueName)[0])), &value) + if ret != 0 { + return false, makeError(uint32(ret)) } - ret = C.CCall_lib3mf_multipropertygroup_getmultiproperty(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID), neededforpropertyIDs, nil, (*C.uint32_t)(unsafe.Pointer(&propertyIDs[0]))) + return bool(value), nil +} + +// GetParameterBoolValueDef retrieves a profile's parameter value as boolean. +func (inst ToolpathProfile) GetParameterBoolValueDef(nameSpaceName string, valueName string, defaultValue bool) (bool, error) { + var value C.bool + ret := C.CCall_lib3mf_toolpathprofile_getparameterboolvaluedef(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpaceName)[0])), (*C.char)(unsafe.Pointer(&[]byte(valueName)[0])), C.bool(defaultValue), &value) if ret != 0 { - return nil, makeError(uint32(ret)) + return false, makeError(uint32(ret)) } - return propertyIDs[:int(neededforpropertyIDs)], nil + return bool(value), nil } -// RemoveMultiProperty removes a MultiProperty from this MultiPropertyGroup. -func (inst MultiPropertyGroup) RemoveMultiProperty(propertyID uint32) error { - ret := C.CCall_lib3mf_multipropertygroup_removemultiproperty(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(propertyID)) +// SetName sets the profile's name. +func (inst ToolpathProfile) SetName(name string) error { + ret := C.CCall_lib3mf_toolpathprofile_setname(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0]))) if ret != 0 { return makeError(uint32(ret)) } return nil } -// GetLayerCount retrieves the number of layers of this MultiPropertyGroup. -func (inst MultiPropertyGroup) GetLayerCount() (uint32, error) { - var count C.uint32_t - ret := C.CCall_lib3mf_multipropertygroup_getlayercount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) +// SetParameterValue sets a profile's parameter value. +func (inst ToolpathProfile) SetParameterValue(nameSpaceName string, valueName string, value string) error { + ret := C.CCall_lib3mf_toolpathprofile_setparametervalue(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpaceName)[0])), (*C.char)(unsafe.Pointer(&[]byte(valueName)[0])), (*C.char)(unsafe.Pointer(&[]byte(value)[0]))) if ret != 0 { - return 0, makeError(uint32(ret)) + return makeError(uint32(ret)) } - return uint32(count), nil + return nil } -// AddLayer adds a MultiPropertyLayer to this MultiPropertyGroup. -func (inst MultiPropertyGroup) AddLayer(theLayer MultiPropertyLayer) (uint32, error) { - var layerIndex C.uint32_t - ret := C.CCall_lib3mf_multipropertygroup_addlayer(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.sLib3MFMultiPropertyLayer)(unsafe.Pointer(&theLayer)), &layerIndex) +// SetParameterDoubleValue sets a profile's parameter value as double. +func (inst ToolpathProfile) SetParameterDoubleValue(nameSpaceName string, valueName string, value float64) error { + ret := C.CCall_lib3mf_toolpathprofile_setparameterdoublevalue(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpaceName)[0])), (*C.char)(unsafe.Pointer(&[]byte(valueName)[0])), C.double(value)) if ret != 0 { - return 0, makeError(uint32(ret)) + return makeError(uint32(ret)) } - return uint32(layerIndex), nil + return nil } -// GetLayer obtains a MultiPropertyLayer of this MultiPropertyGroup. -func (inst MultiPropertyGroup) GetLayer(layerIndex uint32) (MultiPropertyLayer, error) { - var theLayer C.sLib3MFMultiPropertyLayer - ret := C.CCall_lib3mf_multipropertygroup_getlayer(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(layerIndex), &theLayer) +// SetParameterIntegerValue sets a profile's parameter value as integer. +func (inst ToolpathProfile) SetParameterIntegerValue(nameSpaceName string, valueName string, value int64) error { + ret := C.CCall_lib3mf_toolpathprofile_setparameterintegervalue(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpaceName)[0])), (*C.char)(unsafe.Pointer(&[]byte(valueName)[0])), C.int64_t(value)) if ret != 0 { - return MultiPropertyLayer{}, makeError(uint32(ret)) + return makeError(uint32(ret)) } - return *(*MultiPropertyLayer)(unsafe.Pointer(&theLayer)), nil + return nil } -// RemoveLayer removes a MultiPropertyLayer from this MultiPropertyGroup. -func (inst MultiPropertyGroup) RemoveLayer(layerIndex uint32) error { - ret := C.CCall_lib3mf_multipropertygroup_removelayer(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(layerIndex)) +// SetParameterBoolValue sets a profile's parameter value as boolean. +func (inst ToolpathProfile) SetParameterBoolValue(nameSpaceName string, valueName string, value bool) error { + ret := C.CCall_lib3mf_toolpathprofile_setparameterboolvalue(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpaceName)[0])), (*C.char)(unsafe.Pointer(&[]byte(valueName)[0])), C.bool(value)) if ret != 0 { return makeError(uint32(ret)) } @@ -6150,531 +8927,638 @@ func (inst MultiPropertyGroup) RemoveLayer(layerIndex uint32) error { } -// Attachment represents a Lib3MF class. -type Attachment struct { +// ToolpathLayerReader represents a Lib3MF class. +type ToolpathLayerReader struct { Base } -func (wrapper Wrapper) NewAttachment(r ref) Attachment { - return Attachment{wrapper.NewBase(r)} +func (wrapper Wrapper) NewToolpathLayerReader(r ref) ToolpathLayerReader { + return ToolpathLayerReader{wrapper.NewBase(r)} } -// GetPath retrieves an attachment's package path. This function will be removed in a later release. -func (inst Attachment) GetPath() (string, error) { - var neededforpath C.uint32_t - var filledinpath C.uint32_t - ret := C.CCall_lib3mf_attachment_getpath(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforpath, nil) +// GetLayerDataUUID retrieves the layerdata's uuid. +func (inst ToolpathLayerReader) GetLayerDataUUID() (string, error) { + var neededforuUID C.uint32_t + var filledinuUID C.uint32_t + ret := C.CCall_lib3mf_toolpathlayerreader_getlayerdatauuid(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforuUID, nil) if ret != 0 { return "", makeError(uint32(ret)) } - bufferSizepath := neededforpath - bufferpath := make([]byte, bufferSizepath) - ret = C.CCall_lib3mf_attachment_getpath(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizepath, &filledinpath, (*C.char)(unsafe.Pointer(&bufferpath[0]))) + bufferSizeuUID := neededforuUID + bufferuUID := make([]byte, bufferSizeuUID) + ret = C.CCall_lib3mf_toolpathlayerreader_getlayerdatauuid(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizeuUID, &filledinuUID, (*C.char)(unsafe.Pointer(&bufferuUID[0]))) if ret != 0 { return "", makeError(uint32(ret)) } - return string(bufferpath[:(filledinpath-1)]), nil + return string(bufferuUID[:(filledinuUID-1)]), nil } -// SetPath sets an attachment's package path. This function will be removed in a later release. -func (inst Attachment) SetPath(path string) error { - ret := C.CCall_lib3mf_attachment_setpath(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(path)[0]))) +// GetSegmentCount retrieves the count of segments. +func (inst ToolpathLayerReader) GetSegmentCount() (uint32, error) { + var count C.uint32_t + ret := C.CCall_lib3mf_toolpathlayerreader_getsegmentcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) if ret != 0 { - return makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return nil + return uint32(count), nil } -// PackagePart returns the PackagePart that is this attachment. -func (inst Attachment) PackagePart() (PackagePart, error) { - var packagePart ref - ret := C.CCall_lib3mf_attachment_packagepart(inst.wrapperRef.LibraryHandle, inst.Ref, &packagePart) +// GetSegmentInfo retrieves the segment type information . +func (inst ToolpathLayerReader) GetSegmentInfo(index uint32) (ToolpathSegmentType, uint32, error) { + var _type C.eLib3MFToolpathSegmentType + var pointCount C.uint32_t + ret := C.CCall_lib3mf_toolpathlayerreader_getsegmentinfo(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &_type, &pointCount) if ret != 0 { - return PackagePart{}, makeError(uint32(ret)) + return 0, 0, makeError(uint32(ret)) } - return inst.wrapperRef.NewPackagePart(packagePart), nil + return ToolpathSegmentType(_type), uint32(pointCount), nil } -// GetRelationShipType retrieves an attachment's relationship type. -func (inst Attachment) GetRelationShipType() (string, error) { - var neededforpath C.uint32_t - var filledinpath C.uint32_t - ret := C.CCall_lib3mf_attachment_getrelationshiptype(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforpath, nil) +// GetSegmentProfile retrieves the assigned segment profile. +func (inst ToolpathLayerReader) GetSegmentProfile(index uint32) (ToolpathProfile, error) { + var profile ref + ret := C.CCall_lib3mf_toolpathlayerreader_getsegmentprofile(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &profile) + if ret != 0 { + return ToolpathProfile{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewToolpathProfile(profile), nil +} + +// GetSegmentProfileUUID retrieves the assigned segment profile uuid. +func (inst ToolpathLayerReader) GetSegmentProfileUUID(index uint32) (string, error) { + var neededforprofileUUID C.uint32_t + var filledinprofileUUID C.uint32_t + ret := C.CCall_lib3mf_toolpathlayerreader_getsegmentprofileuuid(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), 0, &neededforprofileUUID, nil) if ret != 0 { return "", makeError(uint32(ret)) } - bufferSizepath := neededforpath - bufferpath := make([]byte, bufferSizepath) - ret = C.CCall_lib3mf_attachment_getrelationshiptype(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizepath, &filledinpath, (*C.char)(unsafe.Pointer(&bufferpath[0]))) + bufferSizeprofileUUID := neededforprofileUUID + bufferprofileUUID := make([]byte, bufferSizeprofileUUID) + ret = C.CCall_lib3mf_toolpathlayerreader_getsegmentprofileuuid(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), bufferSizeprofileUUID, &filledinprofileUUID, (*C.char)(unsafe.Pointer(&bufferprofileUUID[0]))) if ret != 0 { return "", makeError(uint32(ret)) } - return string(bufferpath[:(filledinpath-1)]), nil + return string(bufferprofileUUID[:(filledinprofileUUID-1)]), nil } -// SetRelationShipType sets an attachment's relationship type. -func (inst Attachment) SetRelationShipType(path string) error { - ret := C.CCall_lib3mf_attachment_setrelationshiptype(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(path)[0]))) +// GetSegmentPart retrieves the assigned segment profile. +func (inst ToolpathLayerReader) GetSegmentPart(index uint32) (BuildItem, error) { + var buildItem ref + ret := C.CCall_lib3mf_toolpathlayerreader_getsegmentpart(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &buildItem) if ret != 0 { - return makeError(uint32(ret)) + return BuildItem{}, makeError(uint32(ret)) } - return nil + return inst.wrapperRef.NewBuildItem(buildItem), nil } -// WriteToFile writes out the attachment as file. -func (inst Attachment) WriteToFile(fileName string) error { - ret := C.CCall_lib3mf_attachment_writetofile(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(fileName)[0]))) +// GetSegmentPartUUID retrieves the assigned segment part uuid. +func (inst ToolpathLayerReader) GetSegmentPartUUID(index uint32) (string, error) { + var neededforpartUUID C.uint32_t + var filledinpartUUID C.uint32_t + ret := C.CCall_lib3mf_toolpathlayerreader_getsegmentpartuuid(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), 0, &neededforpartUUID, nil) if ret != 0 { - return makeError(uint32(ret)) + return "", makeError(uint32(ret)) } - return nil -} - -// ReadFromFile reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. -func (inst Attachment) ReadFromFile(fileName string) error { - ret := C.CCall_lib3mf_attachment_readfromfile(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(fileName)[0]))) + bufferSizepartUUID := neededforpartUUID + bufferpartUUID := make([]byte, bufferSizepartUUID) + ret = C.CCall_lib3mf_toolpathlayerreader_getsegmentpartuuid(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), bufferSizepartUUID, &filledinpartUUID, (*C.char)(unsafe.Pointer(&bufferpartUUID[0]))) if ret != 0 { - return makeError(uint32(ret)) + return "", makeError(uint32(ret)) } - return nil + return string(bufferpartUUID[:(filledinpartUUID-1)]), nil } -// ReadFromCallback reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. -func (inst Attachment) ReadFromCallback(theReadCallback ReadCallbackFunc, streamSize uint64, theSeekCallback SeekCallbackFunc, userData uintptr) error { - ret := C.CCall_lib3mf_attachment_readfromcallback(inst.wrapperRef.LibraryHandle, inst.Ref, (C.Lib3MFReadCallback)(unsafe.Pointer(C.Lib3MFReadCallback_cgo)), C.uint64_t(streamSize), (C.Lib3MFSeekCallback)(unsafe.Pointer(C.Lib3MFSeekCallback_cgo)), (C.Lib3MF_pvoid)(userData)) +// GetSegmentLocalPartID retrieves the assigned segment part id. ATTENTION: This ID is only unique within the layer and there is no guarantee to be globally unique or consistent across layers. +func (inst ToolpathLayerReader) GetSegmentLocalPartID(index uint32) (uint32, error) { + var localPartID C.uint32_t + ret := C.CCall_lib3mf_toolpathlayerreader_getsegmentlocalpartid(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &localPartID) if ret != 0 { - return makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - readCallbackFunc = theReadCallback - seekCallbackFunc = theSeekCallback - return nil + return uint32(localPartID), nil } -// GetStreamSize retrieves the size of the attachment stream. -func (inst Attachment) GetStreamSize() (uint64, error) { - var streamSize C.uint64_t - ret := C.CCall_lib3mf_attachment_getstreamsize(inst.wrapperRef.LibraryHandle, inst.Ref, &streamSize) +// GetPartUUIDByLocalPartID retrieves the global part UUID by the local part ID. Fails if part ID does not exist in this layer. ATTENTION: This ID is only unique within the layer and there is no guarantee to be globally unique or consistent across layers. +func (inst ToolpathLayerReader) GetPartUUIDByLocalPartID(localPartID uint32) (string, error) { + var neededforpartUUID C.uint32_t + var filledinpartUUID C.uint32_t + ret := C.CCall_lib3mf_toolpathlayerreader_getpartuuidbylocalpartid(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(localPartID), 0, &neededforpartUUID, nil) if ret != 0 { - return 0, makeError(uint32(ret)) + return "", makeError(uint32(ret)) } - return uint64(streamSize), nil + bufferSizepartUUID := neededforpartUUID + bufferpartUUID := make([]byte, bufferSizepartUUID) + ret = C.CCall_lib3mf_toolpathlayerreader_getpartuuidbylocalpartid(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(localPartID), bufferSizepartUUID, &filledinpartUUID, (*C.char)(unsafe.Pointer(&bufferpartUUID[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(bufferpartUUID[:(filledinpartUUID-1)]), nil } -// WriteToBuffer writes out the attachment into a buffer. -func (inst Attachment) WriteToBuffer(buffer []uint8) ([]uint8, error) { - var neededforbuffer C.uint64_t - ret := C.CCall_lib3mf_attachment_writetobuffer(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforbuffer, nil) +// GetSegmentPointData retrieves the assigned segment point list. For type hatch, the points are taken pairwise. +func (inst ToolpathLayerReader) GetSegmentPointData(index uint32, pointData []Position2D) ([]Position2D, error) { + var neededforpointData C.uint64_t + ret := C.CCall_lib3mf_toolpathlayerreader_getsegmentpointdata(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), 0, &neededforpointData, nil) if ret != 0 { return nil, makeError(uint32(ret)) } - if len(buffer) < int(neededforbuffer) { - buffer = append(buffer, make([]uint8, int(neededforbuffer)-len(buffer))...) + if len(pointData) < int(neededforpointData) { + pointData = append(pointData, make([]Position2D, int(neededforpointData)-len(pointData))...) } - ret = C.CCall_lib3mf_attachment_writetobuffer(inst.wrapperRef.LibraryHandle, inst.Ref, neededforbuffer, nil, (*C.uint8_t)(unsafe.Pointer(&buffer[0]))) + ret = C.CCall_lib3mf_toolpathlayerreader_getsegmentpointdata(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), neededforpointData, nil, (*C.sLib3MFPosition2D)(unsafe.Pointer(&pointData[0]))) if ret != 0 { return nil, makeError(uint32(ret)) } - return buffer[:int(neededforbuffer)], nil + return pointData[:int(neededforpointData)], nil } -// ReadFromBuffer reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). -func (inst Attachment) ReadFromBuffer(buffer []uint8) error { - ret := C.CCall_lib3mf_attachment_readfrombuffer(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(buffer)), (*C.uint8_t)(unsafe.Pointer(&buffer[0]))) +// FindAttributeInfoByName retrieves a segment attribute Information by Attribute Name. Will fail if Attribute does not exist. +func (inst ToolpathLayerReader) FindAttributeInfoByName(nameSpace string, attributeName string) (uint32, ToolpathAttributeType, error) { + var iD C.uint32_t + var attributeType C.eLib3MFToolpathAttributeType + ret := C.CCall_lib3mf_toolpathlayerreader_findattributeinfobyname(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpace)[0])), (*C.char)(unsafe.Pointer(&[]byte(attributeName)[0])), &iD, &attributeType) if ret != 0 { - return makeError(uint32(ret)) + return 0, 0, makeError(uint32(ret)) } - return nil -} - - -// Texture2D represents a Lib3MF class. -type Texture2D struct { - Resource + return uint32(iD), ToolpathAttributeType(attributeType), nil } -func (wrapper Wrapper) NewTexture2D(r ref) Texture2D { - return Texture2D{wrapper.NewResource(r)} +// FindAttributeIDByName retrieves a segment attribute ID by Attribute Name. Will fail if Attribute does not exist. +func (inst ToolpathLayerReader) FindAttributeIDByName(nameSpace string, attributeName string) (uint32, error) { + var iD C.uint32_t + ret := C.CCall_lib3mf_toolpathlayerreader_findattributeidbyname(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpace)[0])), (*C.char)(unsafe.Pointer(&[]byte(attributeName)[0])), &iD) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return uint32(iD), nil } -// GetAttachment retrieves the attachment located at the path of the texture. -func (inst Texture2D) GetAttachment() (Attachment, error) { - var attachment ref - ret := C.CCall_lib3mf_texture2d_getattachment(inst.wrapperRef.LibraryHandle, inst.Ref, &attachment) +// FindAttributeValueByName retrieves a segment attribute Type by Attribute Name. Will fail if Attribute does not exist. +func (inst ToolpathLayerReader) FindAttributeValueByName(nameSpace string, attributeName string) (ToolpathAttributeType, error) { + var attributeType C.eLib3MFToolpathAttributeType + ret := C.CCall_lib3mf_toolpathlayerreader_findattributevaluebyname(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpace)[0])), (*C.char)(unsafe.Pointer(&[]byte(attributeName)[0])), &attributeType) if ret != 0 { - return Attachment{}, makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return inst.wrapperRef.NewAttachment(attachment), nil + return ToolpathAttributeType(attributeType), nil } -// SetAttachment sets the texture's package path to the path of the attachment. -func (inst Texture2D) SetAttachment(attachment Attachment) error { - ret := C.CCall_lib3mf_texture2d_setattachment(inst.wrapperRef.LibraryHandle, inst.Ref, attachment.Ref) +// GetSegmentIntegerAttributeByID retrieves a segment Uint32 attribute by Attribute ID. Will fail if Attribute does not exist. +func (inst ToolpathLayerReader) GetSegmentIntegerAttributeByID(index uint32, iD uint32) (int64, error) { + var value C.int64_t + ret := C.CCall_lib3mf_toolpathlayerreader_getsegmentintegerattributebyid(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), C.uint32_t(iD), &value) if ret != 0 { - return makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return nil + return int64(value), nil } -// GetContentType retrieves a texture's content type. -func (inst Texture2D) GetContentType() (TextureType, error) { - var contentType C.eLib3MFTextureType - ret := C.CCall_lib3mf_texture2d_getcontenttype(inst.wrapperRef.LibraryHandle, inst.Ref, &contentType) +// GetSegmentIntegerAttributeByName retrieves a segment integer attribute by Attribute Name. Will fail if Attribute does not exist or is of different type. +func (inst ToolpathLayerReader) GetSegmentIntegerAttributeByName(index uint32, nameSpace string, attributeName string) (int64, error) { + var value C.int64_t + ret := C.CCall_lib3mf_toolpathlayerreader_getsegmentintegerattributebyname(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), (*C.char)(unsafe.Pointer(&[]byte(nameSpace)[0])), (*C.char)(unsafe.Pointer(&[]byte(attributeName)[0])), &value) if ret != 0 { return 0, makeError(uint32(ret)) } - return TextureType(contentType), nil + return int64(value), nil } -// SetContentType retrieves a texture's content type. -func (inst Texture2D) SetContentType(contentType TextureType) error { - ret := C.CCall_lib3mf_texture2d_setcontenttype(inst.wrapperRef.LibraryHandle, inst.Ref, C.eLib3MFTextureType(contentType)) +// GetSegmentDoubleAttributeByID retrieves a segment Double attribute by Attribute ID. Will fail if Attribute does not exist. +func (inst ToolpathLayerReader) GetSegmentDoubleAttributeByID(index uint32, iD uint32) (float64, error) { + var value C.double + ret := C.CCall_lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), C.uint32_t(iD), &value) if ret != 0 { - return makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return nil + return float64(value), nil } -// GetTileStyleUV retrieves a texture's tilestyle type. -func (inst Texture2D) GetTileStyleUV() (TextureTileStyle, TextureTileStyle, error) { - var tileStyleU C.eLib3MFTextureTileStyle - var tileStyleV C.eLib3MFTextureTileStyle - ret := C.CCall_lib3mf_texture2d_gettilestyleuv(inst.wrapperRef.LibraryHandle, inst.Ref, &tileStyleU, &tileStyleV) +// GetSegmentDoubleAttributeByName retrieves a segment Double attribute by Attribute Name. Will fail if Attribute does not exist. +func (inst ToolpathLayerReader) GetSegmentDoubleAttributeByName(index uint32, nameSpace string, attributeName string) (float64, error) { + var value C.double + ret := C.CCall_lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), (*C.char)(unsafe.Pointer(&[]byte(nameSpace)[0])), (*C.char)(unsafe.Pointer(&[]byte(attributeName)[0])), &value) if ret != 0 { - return 0, 0, makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return TextureTileStyle(tileStyleU), TextureTileStyle(tileStyleV), nil + return float64(value), nil } -// SetTileStyleUV sets a texture's tilestyle type. -func (inst Texture2D) SetTileStyleUV(tileStyleU TextureTileStyle, tileStyleV TextureTileStyle) error { - ret := C.CCall_lib3mf_texture2d_settilestyleuv(inst.wrapperRef.LibraryHandle, inst.Ref, C.eLib3MFTextureTileStyle(tileStyleU), C.eLib3MFTextureTileStyle(tileStyleV)) +// GetCustomDataCount retrieves the count of custom data elements. +func (inst ToolpathLayerReader) GetCustomDataCount() (uint32, error) { + var count C.uint32_t + ret := C.CCall_lib3mf_toolpathlayerreader_getcustomdatacount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) if ret != 0 { - return makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return nil + return uint32(count), nil } -// GetFilter retrieves a texture's filter type. -func (inst Texture2D) GetFilter() (TextureFilter, error) { - var filter C.eLib3MFTextureFilter - ret := C.CCall_lib3mf_texture2d_getfilter(inst.wrapperRef.LibraryHandle, inst.Ref, &filter) +// GetCustomData retrieves the custom data. +func (inst ToolpathLayerReader) GetCustomData(index uint32) (CustomDOMTree, error) { + var data ref + ret := C.CCall_lib3mf_toolpathlayerreader_getcustomdata(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &data) if ret != 0 { - return 0, makeError(uint32(ret)) + return CustomDOMTree{}, makeError(uint32(ret)) } - return TextureFilter(filter), nil + return inst.wrapperRef.NewCustomDOMTree(data), nil } -// SetFilter sets a texture's filter type. -func (inst Texture2D) SetFilter(filter TextureFilter) error { - ret := C.CCall_lib3mf_texture2d_setfilter(inst.wrapperRef.LibraryHandle, inst.Ref, C.eLib3MFTextureFilter(filter)) +// GetCustomDataName retrieves the node name of the custom data. +func (inst ToolpathLayerReader) GetCustomDataName(index uint32) (string, string, error) { + var neededfornameSpace C.uint32_t + var filledinnameSpace C.uint32_t + var neededfordataName C.uint32_t + var filledindataName C.uint32_t + ret := C.CCall_lib3mf_toolpathlayerreader_getcustomdataname(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), 0, &neededfornameSpace, nil, 0, &neededfordataName, nil) if ret != 0 { - return makeError(uint32(ret)) + return "", "", makeError(uint32(ret)) } - return nil + bufferSizenameSpace := neededfornameSpace + buffernameSpace := make([]byte, bufferSizenameSpace) + bufferSizedataName := neededfordataName + bufferdataName := make([]byte, bufferSizedataName) + ret = C.CCall_lib3mf_toolpathlayerreader_getcustomdataname(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), bufferSizenameSpace, &filledinnameSpace, (*C.char)(unsafe.Pointer(&buffernameSpace[0])), bufferSizedataName, &filledindataName, (*C.char)(unsafe.Pointer(&bufferdataName[0]))) + if ret != 0 { + return "", "", makeError(uint32(ret)) + } + return string(buffernameSpace[:(filledinnameSpace-1)]), string(bufferdataName[:(filledindataName-1)]), nil } -// BuildItem represents a Lib3MF class. -type BuildItem struct { +// ToolpathLayerData represents a Lib3MF class. +type ToolpathLayerData struct { Base } -func (wrapper Wrapper) NewBuildItem(r ref) BuildItem { - return BuildItem{wrapper.NewBase(r)} +func (wrapper Wrapper) NewToolpathLayerData(r ref) ToolpathLayerData { + return ToolpathLayerData{wrapper.NewBase(r)} } -// GetObjectResource retrieves the object resource associated to a build item. -func (inst BuildItem) GetObjectResource() (Object, error) { - var objectResource ref - ret := C.CCall_lib3mf_builditem_getobjectresource(inst.wrapperRef.LibraryHandle, inst.Ref, &objectResource) +// GetLayerDataUUID retrieves the layerdata's uuid. +func (inst ToolpathLayerData) GetLayerDataUUID() (string, error) { + var neededforuUID C.uint32_t + var filledinuUID C.uint32_t + ret := C.CCall_lib3mf_toolpathlayerdata_getlayerdatauuid(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforuUID, nil) if ret != 0 { - return Object{}, makeError(uint32(ret)) + return "", makeError(uint32(ret)) } - return inst.wrapperRef.NewObject(objectResource), nil + bufferSizeuUID := neededforuUID + bufferuUID := make([]byte, bufferSizeuUID) + ret = C.CCall_lib3mf_toolpathlayerdata_getlayerdatauuid(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizeuUID, &filledinuUID, (*C.char)(unsafe.Pointer(&bufferuUID[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(bufferuUID[:(filledinuUID-1)]), nil } - -// GetUUID returns, whether a build item has a UUID and, if true, the build item's UUID. -func (inst BuildItem) GetUUID() (bool, string, error) { - var hasUUID C.bool - var neededforuUID C.uint32_t - var filledinuUID C.uint32_t - ret := C.CCall_lib3mf_builditem_getuuid(inst.wrapperRef.LibraryHandle, inst.Ref, &hasUUID, 0, &neededforuUID, nil) + +// RegisterProfile registers a toolpath profile. +func (inst ToolpathLayerData) RegisterProfile(profile ToolpathProfile) (uint32, error) { + var profileID C.uint32_t + ret := C.CCall_lib3mf_toolpathlayerdata_registerprofile(inst.wrapperRef.LibraryHandle, inst.Ref, profile.Ref, &profileID) if ret != 0 { - return false, "", makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - bufferSizeuUID := neededforuUID - bufferuUID := make([]byte, bufferSizeuUID) - ret = C.CCall_lib3mf_builditem_getuuid(inst.wrapperRef.LibraryHandle, inst.Ref, &hasUUID, bufferSizeuUID, &filledinuUID, (*C.char)(unsafe.Pointer(&bufferuUID[0]))) + return uint32(profileID), nil +} + +// RegisterBuildItem registers a Model Build Item. +func (inst ToolpathLayerData) RegisterBuildItem(buildItem BuildItem) (uint32, error) { + var partID C.uint32_t + ret := C.CCall_lib3mf_toolpathlayerdata_registerbuilditem(inst.wrapperRef.LibraryHandle, inst.Ref, buildItem.Ref, &partID) if ret != 0 { - return false, "", makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return bool(hasUUID), string(bufferuUID[:(filledinuUID-1)]), nil + return uint32(partID), nil } -// SetUUID sets the build item's UUID. -func (inst BuildItem) SetUUID(uUID string) error { - ret := C.CCall_lib3mf_builditem_setuuid(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(uUID)[0]))) +// SetSegmentAttribute sets Segment Attribute for all following segments that are added. Overrides previously set attribute. +func (inst ToolpathLayerData) SetSegmentAttribute(nameSpace string, attributeName string, value string) error { + ret := C.CCall_lib3mf_toolpathlayerdata_setsegmentattribute(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpace)[0])), (*C.char)(unsafe.Pointer(&[]byte(attributeName)[0])), (*C.char)(unsafe.Pointer(&[]byte(value)[0]))) if ret != 0 { return makeError(uint32(ret)) } return nil } -// GetObjectResourceID retrieves the object UniqueResourceID associated to a build item. -func (inst BuildItem) GetObjectResourceID() (uint32, error) { - var uniqueResourceID C.uint32_t - ret := C.CCall_lib3mf_builditem_getobjectresourceid(inst.wrapperRef.LibraryHandle, inst.Ref, &uniqueResourceID) +// ClearSegmentAttributes clears current segment attributes. +func (inst ToolpathLayerData) ClearSegmentAttributes() error { + ret := C.CCall_lib3mf_toolpathlayerdata_clearsegmentattributes(inst.wrapperRef.LibraryHandle, inst.Ref) if ret != 0 { - return 0, makeError(uint32(ret)) + return makeError(uint32(ret)) } - return uint32(uniqueResourceID), nil + return nil } -// HasObjectTransform checks, if a build item has a non-identity transformation matrix. -func (inst BuildItem) HasObjectTransform() (bool, error) { - var hasTransform C.bool - ret := C.CCall_lib3mf_builditem_hasobjecttransform(inst.wrapperRef.LibraryHandle, inst.Ref, &hasTransform) +// WriteHatchData writes hatch data to the layer. +func (inst ToolpathLayerData) WriteHatchData(profileID uint32, partID uint32, pointData []Position2D) error { + ret := C.CCall_lib3mf_toolpathlayerdata_writehatchdata(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(profileID), C.uint32_t(partID), C.uint64_t(len(pointData)), (*C.sLib3MFPosition2D)(unsafe.Pointer(&pointData[0]))) if ret != 0 { - return false, makeError(uint32(ret)) + return makeError(uint32(ret)) } - return bool(hasTransform), nil + return nil } -// GetObjectTransform retrieves a build item's transformation matrix. -func (inst BuildItem) GetObjectTransform() (Transform, error) { - var transform C.sLib3MFTransform - ret := C.CCall_lib3mf_builditem_getobjecttransform(inst.wrapperRef.LibraryHandle, inst.Ref, &transform) +// WriteLoop writes loop data to the layer. +func (inst ToolpathLayerData) WriteLoop(profileID uint32, partID uint32, pointData []Position2D) error { + ret := C.CCall_lib3mf_toolpathlayerdata_writeloop(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(profileID), C.uint32_t(partID), C.uint64_t(len(pointData)), (*C.sLib3MFPosition2D)(unsafe.Pointer(&pointData[0]))) if ret != 0 { - return Transform{}, makeError(uint32(ret)) + return makeError(uint32(ret)) } - return *(*Transform)(unsafe.Pointer(&transform)), nil + return nil } -// SetObjectTransform sets a build item's transformation matrix. -func (inst BuildItem) SetObjectTransform(transform Transform) error { - ret := C.CCall_lib3mf_builditem_setobjecttransform(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.sLib3MFTransform)(unsafe.Pointer(&transform))) +// WritePolyline writes polyline data to the layer. +func (inst ToolpathLayerData) WritePolyline(profileID uint32, partID uint32, pointData []Position2D) error { + ret := C.CCall_lib3mf_toolpathlayerdata_writepolyline(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(profileID), C.uint32_t(partID), C.uint64_t(len(pointData)), (*C.sLib3MFPosition2D)(unsafe.Pointer(&pointData[0]))) if ret != 0 { return makeError(uint32(ret)) } return nil } -// GetPartNumber retrieves a build item's part number string. -func (inst BuildItem) GetPartNumber() (string, error) { - var neededforpartNumber C.uint32_t - var filledinpartNumber C.uint32_t - ret := C.CCall_lib3mf_builditem_getpartnumber(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforpartNumber, nil) - if ret != 0 { - return "", makeError(uint32(ret)) - } - bufferSizepartNumber := neededforpartNumber - bufferpartNumber := make([]byte, bufferSizepartNumber) - ret = C.CCall_lib3mf_builditem_getpartnumber(inst.wrapperRef.LibraryHandle, inst.Ref, bufferSizepartNumber, &filledinpartNumber, (*C.char)(unsafe.Pointer(&bufferpartNumber[0]))) +// AddCustomData adds a custom data DOM tree to the layer. Layer MUST not be finished when changing the DOM tree. +func (inst ToolpathLayerData) AddCustomData(nameSpace string, dataName string) (CustomDOMTree, error) { + var data ref + ret := C.CCall_lib3mf_toolpathlayerdata_addcustomdata(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpace)[0])), (*C.char)(unsafe.Pointer(&[]byte(dataName)[0])), &data) if ret != 0 { - return "", makeError(uint32(ret)) + return CustomDOMTree{}, makeError(uint32(ret)) } - return string(bufferpartNumber[:(filledinpartNumber-1)]), nil + return inst.wrapperRef.NewCustomDOMTree(data), nil } -// SetPartNumber sets a build item's part number string. -func (inst BuildItem) SetPartNumber(setPartnumber string) error { - ret := C.CCall_lib3mf_builditem_setpartnumber(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(setPartnumber)[0]))) +// Finish finishes all writing of the layer and compresses toolpath data. +func (inst ToolpathLayerData) Finish() error { + ret := C.CCall_lib3mf_toolpathlayerdata_finish(inst.wrapperRef.LibraryHandle, inst.Ref) if ret != 0 { return makeError(uint32(ret)) } return nil } -// GetMetaDataGroup returns the metadatagroup of this build item. -func (inst BuildItem) GetMetaDataGroup() (MetaDataGroup, error) { - var metaDataGroup ref - ret := C.CCall_lib3mf_builditem_getmetadatagroup(inst.wrapperRef.LibraryHandle, inst.Ref, &metaDataGroup) + +// Toolpath represents a Lib3MF class. +type Toolpath struct { + Resource +} + +func (wrapper Wrapper) NewToolpath(r ref) Toolpath { + return Toolpath{wrapper.NewResource(r)} +} + +// GetUnits retrieves the unit factor. +func (inst Toolpath) GetUnits() (float64, error) { + var units C.double + ret := C.CCall_lib3mf_toolpath_getunits(inst.wrapperRef.LibraryHandle, inst.Ref, &units) if ret != 0 { - return MetaDataGroup{}, makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return inst.wrapperRef.NewMetaDataGroup(metaDataGroup), nil + return float64(units), nil } -// GetOutbox returns the outbox of a build item. -func (inst BuildItem) GetOutbox() (Box, error) { - var outbox C.sLib3MFBox - ret := C.CCall_lib3mf_builditem_getoutbox(inst.wrapperRef.LibraryHandle, inst.Ref, &outbox) +// GetLayerCount retrieves the count of layers. +func (inst Toolpath) GetLayerCount() (uint32, error) { + var count C.uint32_t + ret := C.CCall_lib3mf_toolpath_getlayercount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) if ret != 0 { - return Box{}, makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return *(*Box)(unsafe.Pointer(&outbox)), nil + return uint32(count), nil } - -// BuildItemIterator represents a Lib3MF class. -type BuildItemIterator struct { - Base +// GetProfileCount retrieves the count of profiles. +func (inst Toolpath) GetProfileCount() (uint32, error) { + var count C.uint32_t + ret := C.CCall_lib3mf_toolpath_getprofilecount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) + if ret != 0 { + return 0, makeError(uint32(ret)) + } + return uint32(count), nil } -func (wrapper Wrapper) NewBuildItemIterator(r ref) BuildItemIterator { - return BuildItemIterator{wrapper.NewBase(r)} +// AddLayer adds a new toolpath layer. +func (inst Toolpath) AddLayer(zMax uint32, path string, modelWriter Writer) (ToolpathLayerData, error) { + var layerData ref + ret := C.CCall_lib3mf_toolpath_addlayer(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(zMax), (*C.char)(unsafe.Pointer(&[]byte(path)[0])), modelWriter.Ref, &layerData) + if ret != 0 { + return ToolpathLayerData{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewToolpathLayerData(layerData), nil } -// MoveNext iterates to the next build item in the list. -func (inst BuildItemIterator) MoveNext() (bool, error) { - var hasNext C.bool - ret := C.CCall_lib3mf_builditemiterator_movenext(inst.wrapperRef.LibraryHandle, inst.Ref, &hasNext) +// GetLayerAttachment retrieves the Attachment of a layer. +func (inst Toolpath) GetLayerAttachment(index uint32) (Attachment, error) { + var attachment ref + ret := C.CCall_lib3mf_toolpath_getlayerattachment(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &attachment) if ret != 0 { - return false, makeError(uint32(ret)) + return Attachment{}, makeError(uint32(ret)) } - return bool(hasNext), nil + return inst.wrapperRef.NewAttachment(attachment), nil } -// MovePrevious iterates to the previous build item in the list. -func (inst BuildItemIterator) MovePrevious() (bool, error) { - var hasPrevious C.bool - ret := C.CCall_lib3mf_builditemiterator_moveprevious(inst.wrapperRef.LibraryHandle, inst.Ref, &hasPrevious) +// ReadLayerData reads the toolpath of a layer. +func (inst Toolpath) ReadLayerData(index uint32) (ToolpathLayerReader, error) { + var toolpathReader ref + ret := C.CCall_lib3mf_toolpath_readlayerdata(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &toolpathReader) if ret != 0 { - return false, makeError(uint32(ret)) + return ToolpathLayerReader{}, makeError(uint32(ret)) } - return bool(hasPrevious), nil + return inst.wrapperRef.NewToolpathLayerReader(toolpathReader), nil } -// GetCurrent returns the build item the iterator points at. -func (inst BuildItemIterator) GetCurrent() (BuildItem, error) { - var buildItem ref - ret := C.CCall_lib3mf_builditemiterator_getcurrent(inst.wrapperRef.LibraryHandle, inst.Ref, &buildItem) +// GetLayerPath retrieves the Path of a layer. +func (inst Toolpath) GetLayerPath(index uint32) (string, error) { + var neededforpath C.uint32_t + var filledinpath C.uint32_t + ret := C.CCall_lib3mf_toolpath_getlayerpath(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), 0, &neededforpath, nil) if ret != 0 { - return BuildItem{}, makeError(uint32(ret)) + return "", makeError(uint32(ret)) } - return inst.wrapperRef.NewBuildItem(buildItem), nil + bufferSizepath := neededforpath + bufferpath := make([]byte, bufferSizepath) + ret = C.CCall_lib3mf_toolpath_getlayerpath(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), bufferSizepath, &filledinpath, (*C.char)(unsafe.Pointer(&bufferpath[0]))) + if ret != 0 { + return "", makeError(uint32(ret)) + } + return string(bufferpath[:(filledinpath-1)]), nil } -// Clone creates a new build item iterator with the same build item list. -func (inst BuildItemIterator) Clone() (BuildItemIterator, error) { - var outBuildItemIterator ref - ret := C.CCall_lib3mf_builditemiterator_clone(inst.wrapperRef.LibraryHandle, inst.Ref, &outBuildItemIterator) +// GetLayerZMax retrieves the ZMax of a layer. +func (inst Toolpath) GetLayerZMax(index uint32) (uint32, error) { + var zMax C.uint32_t + ret := C.CCall_lib3mf_toolpath_getlayerzmax(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &zMax) if ret != 0 { - return BuildItemIterator{}, makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return inst.wrapperRef.NewBuildItemIterator(outBuildItemIterator), nil + return uint32(zMax), nil } -// Count returns the number of build items the iterator captures. -func (inst BuildItemIterator) Count() (uint64, error) { - var count C.uint64_t - ret := C.CCall_lib3mf_builditemiterator_count(inst.wrapperRef.LibraryHandle, inst.Ref, &count) +// GetLayerZ return the z value of a layer in units. +func (inst Toolpath) GetLayerZ(layerIndex uint32) (uint32, error) { + var zValue C.uint32_t + ret := C.CCall_lib3mf_toolpath_getlayerz(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(layerIndex), &zValue) if ret != 0 { return 0, makeError(uint32(ret)) } - return uint64(count), nil + return uint32(zValue), nil } +// AddProfile adds a new profile to the toolpath. +func (inst Toolpath) AddProfile(name string) (ToolpathProfile, error) { + var profile ref + ret := C.CCall_lib3mf_toolpath_addprofile(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(name)[0])), &profile) + if ret != 0 { + return ToolpathProfile{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewToolpathProfile(profile), nil +} -// Slice represents a Lib3MF class. -type Slice struct { - Base +// GetProfile returns a profile of the toolpath. +func (inst Toolpath) GetProfile(profileIndex uint32) (ToolpathProfile, error) { + var profile ref + ret := C.CCall_lib3mf_toolpath_getprofile(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(profileIndex), &profile) + if ret != 0 { + return ToolpathProfile{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewToolpathProfile(profile), nil } -func (wrapper Wrapper) NewSlice(r ref) Slice { - return Slice{wrapper.NewBase(r)} +// GetProfileUUID returns a profile of the toolpath by UUID. +func (inst Toolpath) GetProfileUUID(profileUUID string) (ToolpathProfile, error) { + var profile ref + ret := C.CCall_lib3mf_toolpath_getprofileuuid(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(profileUUID)[0])), &profile) + if ret != 0 { + return ToolpathProfile{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewToolpathProfile(profile), nil } -// SetVertices set all vertices of a slice. All polygons will be cleared. -func (inst Slice) SetVertices(vertices []Position2D) error { - ret := C.CCall_lib3mf_slice_setvertices(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(vertices)), (*C.sLib3MFPosition2D)(unsafe.Pointer(&vertices[0]))) +// GetCustomDataCount retrieves the count of custom data elements. +func (inst Toolpath) GetCustomDataCount() (uint32, error) { + var count C.uint32_t + ret := C.CCall_lib3mf_toolpath_getcustomdatacount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) if ret != 0 { - return makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return nil + return uint32(count), nil } -// GetVertices get all vertices of a slice. -func (inst Slice) GetVertices(vertices []Position2D) ([]Position2D, error) { - var neededforvertices C.uint64_t - ret := C.CCall_lib3mf_slice_getvertices(inst.wrapperRef.LibraryHandle, inst.Ref, 0, &neededforvertices, nil) +// GetCustomData retrieves the custom data. +func (inst Toolpath) GetCustomData(index uint32) (CustomDOMTree, error) { + var data ref + ret := C.CCall_lib3mf_toolpath_getcustomdata(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), &data) if ret != 0 { - return nil, makeError(uint32(ret)) + return CustomDOMTree{}, makeError(uint32(ret)) } - if len(vertices) < int(neededforvertices) { - vertices = append(vertices, make([]Position2D, int(neededforvertices)-len(vertices))...) + return inst.wrapperRef.NewCustomDOMTree(data), nil +} + +// GetCustomDataName retrieves the node name of the custom data. +func (inst Toolpath) GetCustomDataName(index uint32) (string, string, error) { + var neededfornameSpace C.uint32_t + var filledinnameSpace C.uint32_t + var neededfordataName C.uint32_t + var filledindataName C.uint32_t + ret := C.CCall_lib3mf_toolpath_getcustomdataname(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), 0, &neededfornameSpace, nil, 0, &neededfordataName, nil) + if ret != 0 { + return "", "", makeError(uint32(ret)) } - ret = C.CCall_lib3mf_slice_getvertices(inst.wrapperRef.LibraryHandle, inst.Ref, neededforvertices, nil, (*C.sLib3MFPosition2D)(unsafe.Pointer(&vertices[0]))) + bufferSizenameSpace := neededfornameSpace + buffernameSpace := make([]byte, bufferSizenameSpace) + bufferSizedataName := neededfordataName + bufferdataName := make([]byte, bufferSizedataName) + ret = C.CCall_lib3mf_toolpath_getcustomdataname(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint32_t(index), bufferSizenameSpace, &filledinnameSpace, (*C.char)(unsafe.Pointer(&buffernameSpace[0])), bufferSizedataName, &filledindataName, (*C.char)(unsafe.Pointer(&bufferdataName[0]))) if ret != 0 { - return nil, makeError(uint32(ret)) + return "", "", makeError(uint32(ret)) } - return vertices[:int(neededforvertices)], nil + return string(buffernameSpace[:(filledinnameSpace-1)]), string(bufferdataName[:(filledindataName-1)]), nil } -// GetVertexCount get the number of vertices in a slice. -func (inst Slice) GetVertexCount() (uint64, error) { - var count C.uint64_t - ret := C.CCall_lib3mf_slice_getvertexcount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) +// HasUniqueCustomData retrieves if custom data with a specific namespace and name combination exists. +func (inst Toolpath) HasUniqueCustomData(nameSpace string, dataName string) (bool, error) { + var customDataExists C.bool + ret := C.CCall_lib3mf_toolpath_hasuniquecustomdata(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpace)[0])), (*C.char)(unsafe.Pointer(&[]byte(dataName)[0])), &customDataExists) if ret != 0 { - return 0, makeError(uint32(ret)) + return false, makeError(uint32(ret)) } - return uint64(count), nil + return bool(customDataExists), nil } -// AddPolygon add a new polygon to this slice. -func (inst Slice) AddPolygon(indices []uint32) (uint64, error) { - var index C.uint64_t - ret := C.CCall_lib3mf_slice_addpolygon(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(indices)), (*C.uint32_t)(unsafe.Pointer(&indices[0])), &index) +// FindUniqueCustomData retrieves the custom data with a specific namespace and name combination. Fails if combination is not unique. +func (inst Toolpath) FindUniqueCustomData(nameSpace string, dataName string) (CustomDOMTree, error) { + var data ref + ret := C.CCall_lib3mf_toolpath_finduniquecustomdata(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpace)[0])), (*C.char)(unsafe.Pointer(&[]byte(dataName)[0])), &data) if ret != 0 { - return 0, makeError(uint32(ret)) + return CustomDOMTree{}, makeError(uint32(ret)) } - return uint64(index), nil + return inst.wrapperRef.NewCustomDOMTree(data), nil } -// GetPolygonCount get the number of polygons in the slice. -func (inst Slice) GetPolygonCount() (uint64, error) { - var count C.uint64_t - ret := C.CCall_lib3mf_slice_getpolygoncount(inst.wrapperRef.LibraryHandle, inst.Ref, &count) +// AddCustomData adds a custom data DOM tree to the toolpath. +func (inst Toolpath) AddCustomData(nameSpace string, dataName string) (CustomDOMTree, error) { + var data ref + ret := C.CCall_lib3mf_toolpath_addcustomdata(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpace)[0])), (*C.char)(unsafe.Pointer(&[]byte(dataName)[0])), &data) if ret != 0 { - return 0, makeError(uint32(ret)) + return CustomDOMTree{}, makeError(uint32(ret)) } - return uint64(count), nil + return inst.wrapperRef.NewCustomDOMTree(data), nil } -// SetPolygonIndices set all indices of a polygon. -func (inst Slice) SetPolygonIndices(index uint64, indices []uint32) error { - ret := C.CCall_lib3mf_slice_setpolygonindices(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(index), C.uint64_t(len(indices)), (*C.uint32_t)(unsafe.Pointer(&indices[0]))) +// ClearCustomData deletes all custom data. +func (inst Toolpath) ClearCustomData() (uint32, error) { + var numberOfDeletedItems C.uint32_t + ret := C.CCall_lib3mf_toolpath_clearcustomdata(inst.wrapperRef.LibraryHandle, inst.Ref, &numberOfDeletedItems) if ret != 0 { - return makeError(uint32(ret)) + return 0, makeError(uint32(ret)) } - return nil + return uint32(numberOfDeletedItems), nil } -// GetPolygonIndices get all vertices of a slice. -func (inst Slice) GetPolygonIndices(index uint64, indices []uint32) ([]uint32, error) { - var neededforindices C.uint64_t - ret := C.CCall_lib3mf_slice_getpolygonindices(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(index), 0, &neededforindices, nil) +// DeleteCustomData deletes a custom data instance from the list. +func (inst Toolpath) DeleteCustomData(data CustomDOMTree) (bool, error) { + var success C.bool + ret := C.CCall_lib3mf_toolpath_deletecustomdata(inst.wrapperRef.LibraryHandle, inst.Ref, data.Ref, &success) if ret != 0 { - return nil, makeError(uint32(ret)) - } - if len(indices) < int(neededforindices) { - indices = append(indices, make([]uint32, int(neededforindices)-len(indices))...) + return false, makeError(uint32(ret)) } - ret = C.CCall_lib3mf_slice_getpolygonindices(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(index), neededforindices, nil, (*C.uint32_t)(unsafe.Pointer(&indices[0]))) + return bool(success), nil +} + +// RegisterCustomIntegerAttribute registers an Integer Attribute that each segment holds. +func (inst Toolpath) RegisterCustomIntegerAttribute(nameSpace string, attributeName string) error { + ret := C.CCall_lib3mf_toolpath_registercustomintegerattribute(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpace)[0])), (*C.char)(unsafe.Pointer(&[]byte(attributeName)[0]))) if ret != 0 { - return nil, makeError(uint32(ret)) + return makeError(uint32(ret)) } - return indices[:int(neededforindices)], nil + return nil } -// GetPolygonIndexCount get the number of vertices in a slice. -func (inst Slice) GetPolygonIndexCount(index uint64) (uint64, error) { - var count C.uint64_t - ret := C.CCall_lib3mf_slice_getpolygonindexcount(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(index), &count) +// RegisterCustomDoubleAttribute registers a Double Attribute that each segment holds. Registering only applies to reader or writer objects created after the call. +func (inst Toolpath) RegisterCustomDoubleAttribute(nameSpace string, attributeName string) error { + ret := C.CCall_lib3mf_toolpath_registercustomdoubleattribute(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(nameSpace)[0])), (*C.char)(unsafe.Pointer(&[]byte(attributeName)[0]))) if ret != 0 { - return 0, makeError(uint32(ret)) + return makeError(uint32(ret)) } - return uint64(count), nil + return nil } -// GetZTop get the upper Z-Coordinate of this slice. -func (inst Slice) GetZTop() (float64, error) { - var zTop C.double - ret := C.CCall_lib3mf_slice_getztop(inst.wrapperRef.LibraryHandle, inst.Ref, &zTop) + +// ToolpathIterator represents a Lib3MF class. +type ToolpathIterator struct { + ResourceIterator +} + +func (wrapper Wrapper) NewToolpathIterator(r ref) ToolpathIterator { + return ToolpathIterator{wrapper.NewResourceIterator(r)} +} + +// GetCurrentToolpath returns the Toolpath the iterator points at. +func (inst ToolpathIterator) GetCurrentToolpath() (Toolpath, error) { + var resource ref + ret := C.CCall_lib3mf_toolpathiterator_getcurrenttoolpath(inst.wrapperRef.LibraryHandle, inst.Ref, &resource) if ret != 0 { - return 0, makeError(uint32(ret)) + return Toolpath{}, makeError(uint32(ret)) } - return float64(zTop), nil + return inst.wrapperRef.NewToolpath(resource), nil } @@ -7695,6 +10579,16 @@ func (inst Model) GetMultiPropertyGroups() (MultiPropertyGroupIterator, error) { return inst.wrapperRef.NewMultiPropertyGroupIterator(resourceIterator), nil } +// GetToolpaths creates a Toolpath instance with all toolpath resources. +func (inst Model) GetToolpaths() (ToolpathIterator, error) { + var resourceIterator ref + ret := C.CCall_lib3mf_model_gettoolpaths(inst.wrapperRef.LibraryHandle, inst.Ref, &resourceIterator) + if ret != 0 { + return ToolpathIterator{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewToolpathIterator(resourceIterator), nil +} + // GetSliceStacks creates a resource iterator instance with all slice stack resources. func (inst Model) GetSliceStacks() (SliceStackIterator, error) { var resourceIterator ref @@ -7824,6 +10718,16 @@ func (inst Model) RemoveBuildItem(buildItemInstance BuildItem) error { return nil } +// AddToolpath adds an empty Toolpath resource to the model. +func (inst Model) AddToolpath(unitFactor float64) (Toolpath, error) { + var toolpathInstance ref + ret := C.CCall_lib3mf_model_addtoolpath(inst.wrapperRef.LibraryHandle, inst.Ref, C.double(unitFactor), &toolpathInstance) + if ret != 0 { + return Toolpath{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewToolpath(toolpathInstance), nil +} + // GetMetaDataGroup returns the metadata of the model as MetaDataGroup. func (inst Model) GetMetaDataGroup() (MetaDataGroup, error) { var theMetaDataGroup ref @@ -7965,6 +10869,38 @@ func (inst Model) GetKeyStore() (KeyStore, error) { return inst.wrapperRef.NewKeyStore(keyStore), nil } +// CreatePersistentSourceFromFile creates an OPC Reader Source from a file. +func (inst Model) CreatePersistentSourceFromFile(filename string) (PersistentReaderSource, error) { + var instance ref + ret := C.CCall_lib3mf_model_createpersistentsourcefromfile(inst.wrapperRef.LibraryHandle, inst.Ref, (*C.char)(unsafe.Pointer(&[]byte(filename)[0])), &instance) + if ret != 0 { + return PersistentReaderSource{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewPersistentReaderSource(instance), nil +} + +// CreatePersistentSourceFromBuffer creates an OPC Reader Source from a memory buffer. The memory buffer MUST exist as long as the Source object exists. +func (inst Model) CreatePersistentSourceFromBuffer(buffer []uint8) (PersistentReaderSource, error) { + var instance ref + ret := C.CCall_lib3mf_model_createpersistentsourcefrombuffer(inst.wrapperRef.LibraryHandle, inst.Ref, C.uint64_t(len(buffer)), (*C.uint8_t)(unsafe.Pointer(&buffer[0])), &instance) + if ret != 0 { + return PersistentReaderSource{}, makeError(uint32(ret)) + } + return inst.wrapperRef.NewPersistentReaderSource(instance), nil +} + +// CreatePersistentSourceFromCallback creates an OPC Reader Source from a data provided by a callback function. The callbacks MUST exist as long as the source object exists. +func (inst Model) CreatePersistentSourceFromCallback(theReadCallback ReadCallbackFunc, streamSize uint64, theSeekCallback SeekCallbackFunc, userData uintptr) (PersistentReaderSource, error) { + var instance ref + ret := C.CCall_lib3mf_model_createpersistentsourcefromcallback(inst.wrapperRef.LibraryHandle, inst.Ref, (C.Lib3MFReadCallback)(unsafe.Pointer(C.Lib3MFReadCallback_cgo)), C.uint64_t(streamSize), (C.Lib3MFSeekCallback)(unsafe.Pointer(C.Lib3MFSeekCallback_cgo)), (C.Lib3MF_pvoid)(userData), &instance) + if ret != 0 { + return PersistentReaderSource{}, makeError(uint32(ret)) + } + readCallbackFunc = theReadCallback + seekCallbackFunc = theSeekCallback + return inst.wrapperRef.NewPersistentReaderSource(instance), nil +} + // GetLibraryVersion retrieves the binary version of this library. func (wrapper Wrapper) GetLibraryVersion() (uint32, uint32, uint32, error) { diff --git a/Autogenerated/Bindings/Go/lib3mf_dynamic.cc b/Autogenerated/Bindings/Go/lib3mf_dynamic.cc index e1cec341d..c561fda7f 100644 --- a/Autogenerated/Bindings/Go/lib3mf_dynamic.cc +++ b/Autogenerated/Bindings/Go/lib3mf_dynamic.cc @@ -49,6 +49,13 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_LibraryHandle = NULL; pWrapperTable->m_Base_ClassTypeId = NULL; + pWrapperTable->m_BinaryStream_GetBinaryPath = NULL; + pWrapperTable->m_BinaryStream_GetIndexPath = NULL; + pWrapperTable->m_BinaryStream_GetUUID = NULL; + pWrapperTable->m_BinaryStream_DisableDiscretizedArrayCompression = NULL; + pWrapperTable->m_BinaryStream_EnableDiscretizedArrayCompression = NULL; + pWrapperTable->m_BinaryStream_EnableLZMA = NULL; + pWrapperTable->m_BinaryStream_DisableLZMA = NULL; pWrapperTable->m_Writer_WriteToFile = NULL; pWrapperTable->m_Writer_GetStreamSize = NULL; pWrapperTable->m_Writer_WriteToBuffer = NULL; @@ -62,6 +69,13 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Writer_GetWarningCount = NULL; pWrapperTable->m_Writer_AddKeyWrappingCallback = NULL; pWrapperTable->m_Writer_SetContentEncryptionCallback = NULL; + pWrapperTable->m_Writer_CreateBinaryStream = NULL; + pWrapperTable->m_Writer_AssignBinaryStream = NULL; + pWrapperTable->m_Writer_RegisterCustomNamespace = NULL; + pWrapperTable->m_PersistentReaderSource_GetSourceType = NULL; + pWrapperTable->m_PersistentReaderSource_InvalidateSourceData = NULL; + pWrapperTable->m_PersistentReaderSource_SourceDataIsValid = NULL; + pWrapperTable->m_Reader_ReadFromPersistentSource = NULL; pWrapperTable->m_Reader_ReadFromFile = NULL; pWrapperTable->m_Reader_ReadFromBuffer = NULL; pWrapperTable->m_Reader_ReadFromCallback = NULL; @@ -86,6 +100,51 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_ResourceIterator_GetCurrent = NULL; pWrapperTable->m_ResourceIterator_Clone = NULL; pWrapperTable->m_ResourceIterator_Count = NULL; + pWrapperTable->m_CustomXMLAttribute_GetName = NULL; + pWrapperTable->m_CustomXMLAttribute_GetValue = NULL; + pWrapperTable->m_CustomXMLAttribute_IsValidInteger = NULL; + pWrapperTable->m_CustomXMLAttribute_GetIntegerValue = NULL; + pWrapperTable->m_CustomXMLAttribute_IsValidDouble = NULL; + pWrapperTable->m_CustomXMLAttribute_GetDoubleValue = NULL; + pWrapperTable->m_CustomXMLAttribute_IsValidBool = NULL; + pWrapperTable->m_CustomXMLAttribute_GetBoolValue = NULL; + pWrapperTable->m_CustomXMLAttribute_SetValue = NULL; + pWrapperTable->m_CustomXMLAttribute_SetIntegerValue = NULL; + pWrapperTable->m_CustomXMLAttribute_SetDoubleValue = NULL; + pWrapperTable->m_CustomXMLAttribute_SetBoolValue = NULL; + pWrapperTable->m_CustomXMLAttribute_Remove = NULL; + pWrapperTable->m_CustomXMLNode_GetName = NULL; + pWrapperTable->m_CustomXMLNode_GetNameSpace = NULL; + pWrapperTable->m_CustomXMLNode_GetAttributeCount = NULL; + pWrapperTable->m_CustomXMLNode_GetAttribute = NULL; + pWrapperTable->m_CustomXMLNode_HasAttribute = NULL; + pWrapperTable->m_CustomXMLNode_FindAttribute = NULL; + pWrapperTable->m_CustomXMLNode_RemoveAttribute = NULL; + pWrapperTable->m_CustomXMLNode_RemoveAttributeByIndex = NULL; + pWrapperTable->m_CustomXMLNode_AddAttribute = NULL; + pWrapperTable->m_CustomXMLNode_AddIntegerAttribute = NULL; + pWrapperTable->m_CustomXMLNode_AddDoubleAttribute = NULL; + pWrapperTable->m_CustomXMLNode_AddBoolAttribute = NULL; + pWrapperTable->m_CustomXMLNode_GetChildren = NULL; + pWrapperTable->m_CustomXMLNode_CountChildrenByName = NULL; + pWrapperTable->m_CustomXMLNode_GetChildrenByName = NULL; + pWrapperTable->m_CustomXMLNode_HasChild = NULL; + pWrapperTable->m_CustomXMLNode_HasUniqueChild = NULL; + pWrapperTable->m_CustomXMLNode_FindChild = NULL; + pWrapperTable->m_CustomXMLNode_AddChild = NULL; + pWrapperTable->m_CustomXMLNode_RemoveChild = NULL; + pWrapperTable->m_CustomXMLNode_RemoveChildrenWithName = NULL; + pWrapperTable->m_CustomXMLNode_Remove = NULL; + pWrapperTable->m_CustomXMLNodes_GetNodeCount = NULL; + pWrapperTable->m_CustomXMLNodes_GetNode = NULL; + pWrapperTable->m_CustomXMLNodes_CountNodesByName = NULL; + pWrapperTable->m_CustomXMLNodes_GetNodesByName = NULL; + pWrapperTable->m_CustomXMLNodes_HasNode = NULL; + pWrapperTable->m_CustomXMLNodes_HasUniqueNode = NULL; + pWrapperTable->m_CustomXMLNodes_FindNode = NULL; + pWrapperTable->m_CustomDOMTree_GetNameSpace = NULL; + pWrapperTable->m_CustomDOMTree_GetRootNode = NULL; + pWrapperTable->m_CustomDOMTree_SaveToString = NULL; pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack = NULL; pWrapperTable->m_ObjectIterator_GetCurrentObject = NULL; pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject = NULL; @@ -278,6 +337,78 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Slice_GetPolygonIndices = NULL; pWrapperTable->m_Slice_GetPolygonIndexCount = NULL; pWrapperTable->m_Slice_GetZTop = NULL; + pWrapperTable->m_ToolpathProfile_GetUUID = NULL; + pWrapperTable->m_ToolpathProfile_GetName = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterCount = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterName = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterNameSpace = NULL; + pWrapperTable->m_ToolpathProfile_HasParameterValue = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterValue = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterValueDef = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterDoubleValue = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterDoubleValueDef = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterIntegerValue = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterIntegerValueDef = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterBoolValue = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterBoolValueDef = NULL; + pWrapperTable->m_ToolpathProfile_SetName = NULL; + pWrapperTable->m_ToolpathProfile_SetParameterValue = NULL; + pWrapperTable->m_ToolpathProfile_SetParameterDoubleValue = NULL; + pWrapperTable->m_ToolpathProfile_SetParameterIntegerValue = NULL; + pWrapperTable->m_ToolpathProfile_SetParameterBoolValue = NULL; + pWrapperTable->m_ToolpathLayerReader_GetLayerDataUUID = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentCount = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentInfo = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentProfile = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentProfileUUID = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentPart = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentPartUUID = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentLocalPartID = NULL; + pWrapperTable->m_ToolpathLayerReader_GetPartUUIDByLocalPartID = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentPointData = NULL; + pWrapperTable->m_ToolpathLayerReader_FindAttributeInfoByName = NULL; + pWrapperTable->m_ToolpathLayerReader_FindAttributeIDByName = NULL; + pWrapperTable->m_ToolpathLayerReader_FindAttributeValueByName = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByID = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByName = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByID = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByName = NULL; + pWrapperTable->m_ToolpathLayerReader_GetCustomDataCount = NULL; + pWrapperTable->m_ToolpathLayerReader_GetCustomData = NULL; + pWrapperTable->m_ToolpathLayerReader_GetCustomDataName = NULL; + pWrapperTable->m_ToolpathLayerData_GetLayerDataUUID = NULL; + pWrapperTable->m_ToolpathLayerData_RegisterProfile = NULL; + pWrapperTable->m_ToolpathLayerData_RegisterBuildItem = NULL; + pWrapperTable->m_ToolpathLayerData_SetSegmentAttribute = NULL; + pWrapperTable->m_ToolpathLayerData_ClearSegmentAttributes = NULL; + pWrapperTable->m_ToolpathLayerData_WriteHatchData = NULL; + pWrapperTable->m_ToolpathLayerData_WriteLoop = NULL; + pWrapperTable->m_ToolpathLayerData_WritePolyline = NULL; + pWrapperTable->m_ToolpathLayerData_AddCustomData = NULL; + pWrapperTable->m_ToolpathLayerData_Finish = NULL; + pWrapperTable->m_Toolpath_GetUnits = NULL; + pWrapperTable->m_Toolpath_GetLayerCount = NULL; + pWrapperTable->m_Toolpath_GetProfileCount = NULL; + pWrapperTable->m_Toolpath_AddLayer = NULL; + pWrapperTable->m_Toolpath_GetLayerAttachment = NULL; + pWrapperTable->m_Toolpath_ReadLayerData = NULL; + pWrapperTable->m_Toolpath_GetLayerPath = NULL; + pWrapperTable->m_Toolpath_GetLayerZMax = NULL; + pWrapperTable->m_Toolpath_GetLayerZ = NULL; + pWrapperTable->m_Toolpath_AddProfile = NULL; + pWrapperTable->m_Toolpath_GetProfile = NULL; + pWrapperTable->m_Toolpath_GetProfileUUID = NULL; + pWrapperTable->m_Toolpath_GetCustomDataCount = NULL; + pWrapperTable->m_Toolpath_GetCustomData = NULL; + pWrapperTable->m_Toolpath_GetCustomDataName = NULL; + pWrapperTable->m_Toolpath_HasUniqueCustomData = NULL; + pWrapperTable->m_Toolpath_FindUniqueCustomData = NULL; + pWrapperTable->m_Toolpath_AddCustomData = NULL; + pWrapperTable->m_Toolpath_ClearCustomData = NULL; + pWrapperTable->m_Toolpath_DeleteCustomData = NULL; + pWrapperTable->m_Toolpath_RegisterCustomIntegerAttribute = NULL; + pWrapperTable->m_Toolpath_RegisterCustomDoubleAttribute = NULL; + pWrapperTable->m_ToolpathIterator_GetCurrentToolpath = NULL; pWrapperTable->m_SliceStack_GetBottomZ = NULL; pWrapperTable->m_SliceStack_GetSliceCount = NULL; pWrapperTable->m_SliceStack_GetSlice = NULL; @@ -361,6 +492,7 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Model_GetTexture2DGroups = NULL; pWrapperTable->m_Model_GetCompositeMaterials = NULL; pWrapperTable->m_Model_GetMultiPropertyGroups = NULL; + pWrapperTable->m_Model_GetToolpaths = NULL; pWrapperTable->m_Model_GetSliceStacks = NULL; pWrapperTable->m_Model_MergeToModel = NULL; pWrapperTable->m_Model_AddMeshObject = NULL; @@ -374,6 +506,7 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Model_AddMultiPropertyGroup = NULL; pWrapperTable->m_Model_AddBuildItem = NULL; pWrapperTable->m_Model_RemoveBuildItem = NULL; + pWrapperTable->m_Model_AddToolpath = NULL; pWrapperTable->m_Model_GetMetaDataGroup = NULL; pWrapperTable->m_Model_AddAttachment = NULL; pWrapperTable->m_Model_RemoveAttachment = NULL; @@ -388,6 +521,9 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Model_RemoveCustomContentType = NULL; pWrapperTable->m_Model_SetRandomNumberCallback = NULL; pWrapperTable->m_Model_GetKeyStore = NULL; + pWrapperTable->m_Model_CreatePersistentSourceFromFile = NULL; + pWrapperTable->m_Model_CreatePersistentSourceFromBuffer = NULL; + pWrapperTable->m_Model_CreatePersistentSourceFromCallback = NULL; pWrapperTable->m_GetLibraryVersion = NULL; pWrapperTable->m_GetPrereleaseInformation = NULL; pWrapperTable->m_GetBuildInformation = NULL; @@ -470,6 +606,69 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Base_ClassTypeId == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_GetBinaryPath = (PLib3MFBinaryStream_GetBinaryPathPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_getbinarypath"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_GetBinaryPath = (PLib3MFBinaryStream_GetBinaryPathPtr) dlsym(hLibrary, "lib3mf_binarystream_getbinarypath"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_GetBinaryPath == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_GetIndexPath = (PLib3MFBinaryStream_GetIndexPathPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_getindexpath"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_GetIndexPath = (PLib3MFBinaryStream_GetIndexPathPtr) dlsym(hLibrary, "lib3mf_binarystream_getindexpath"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_GetIndexPath == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_GetUUID = (PLib3MFBinaryStream_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_getuuid"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_GetUUID = (PLib3MFBinaryStream_GetUUIDPtr) dlsym(hLibrary, "lib3mf_binarystream_getuuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_GetUUID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_DisableDiscretizedArrayCompression = (PLib3MFBinaryStream_DisableDiscretizedArrayCompressionPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_disablediscretizedarraycompression"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_DisableDiscretizedArrayCompression = (PLib3MFBinaryStream_DisableDiscretizedArrayCompressionPtr) dlsym(hLibrary, "lib3mf_binarystream_disablediscretizedarraycompression"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_DisableDiscretizedArrayCompression == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_EnableDiscretizedArrayCompression = (PLib3MFBinaryStream_EnableDiscretizedArrayCompressionPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_enablediscretizedarraycompression"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_EnableDiscretizedArrayCompression = (PLib3MFBinaryStream_EnableDiscretizedArrayCompressionPtr) dlsym(hLibrary, "lib3mf_binarystream_enablediscretizedarraycompression"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_EnableDiscretizedArrayCompression == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_EnableLZMA = (PLib3MFBinaryStream_EnableLZMAPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_enablelzma"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_EnableLZMA = (PLib3MFBinaryStream_EnableLZMAPtr) dlsym(hLibrary, "lib3mf_binarystream_enablelzma"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_EnableLZMA == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_DisableLZMA = (PLib3MFBinaryStream_DisableLZMAPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_disablelzma"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_DisableLZMA = (PLib3MFBinaryStream_DisableLZMAPtr) dlsym(hLibrary, "lib3mf_binarystream_disablelzma"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_DisableLZMA == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Writer_WriteToFile = (PLib3MFWriter_WriteToFilePtr) GetProcAddress(hLibrary, "lib3mf_writer_writetofile"); #else // _WIN32 @@ -587,6 +786,69 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Writer_SetContentEncryptionCallback == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Writer_CreateBinaryStream = (PLib3MFWriter_CreateBinaryStreamPtr) GetProcAddress(hLibrary, "lib3mf_writer_createbinarystream"); + #else // _WIN32 + pWrapperTable->m_Writer_CreateBinaryStream = (PLib3MFWriter_CreateBinaryStreamPtr) dlsym(hLibrary, "lib3mf_writer_createbinarystream"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Writer_CreateBinaryStream == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Writer_AssignBinaryStream = (PLib3MFWriter_AssignBinaryStreamPtr) GetProcAddress(hLibrary, "lib3mf_writer_assignbinarystream"); + #else // _WIN32 + pWrapperTable->m_Writer_AssignBinaryStream = (PLib3MFWriter_AssignBinaryStreamPtr) dlsym(hLibrary, "lib3mf_writer_assignbinarystream"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Writer_AssignBinaryStream == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Writer_RegisterCustomNamespace = (PLib3MFWriter_RegisterCustomNamespacePtr) GetProcAddress(hLibrary, "lib3mf_writer_registercustomnamespace"); + #else // _WIN32 + pWrapperTable->m_Writer_RegisterCustomNamespace = (PLib3MFWriter_RegisterCustomNamespacePtr) dlsym(hLibrary, "lib3mf_writer_registercustomnamespace"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Writer_RegisterCustomNamespace == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_PersistentReaderSource_GetSourceType = (PLib3MFPersistentReaderSource_GetSourceTypePtr) GetProcAddress(hLibrary, "lib3mf_persistentreadersource_getsourcetype"); + #else // _WIN32 + pWrapperTable->m_PersistentReaderSource_GetSourceType = (PLib3MFPersistentReaderSource_GetSourceTypePtr) dlsym(hLibrary, "lib3mf_persistentreadersource_getsourcetype"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_PersistentReaderSource_GetSourceType == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_PersistentReaderSource_InvalidateSourceData = (PLib3MFPersistentReaderSource_InvalidateSourceDataPtr) GetProcAddress(hLibrary, "lib3mf_persistentreadersource_invalidatesourcedata"); + #else // _WIN32 + pWrapperTable->m_PersistentReaderSource_InvalidateSourceData = (PLib3MFPersistentReaderSource_InvalidateSourceDataPtr) dlsym(hLibrary, "lib3mf_persistentreadersource_invalidatesourcedata"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_PersistentReaderSource_InvalidateSourceData == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_PersistentReaderSource_SourceDataIsValid = (PLib3MFPersistentReaderSource_SourceDataIsValidPtr) GetProcAddress(hLibrary, "lib3mf_persistentreadersource_sourcedataisvalid"); + #else // _WIN32 + pWrapperTable->m_PersistentReaderSource_SourceDataIsValid = (PLib3MFPersistentReaderSource_SourceDataIsValidPtr) dlsym(hLibrary, "lib3mf_persistentreadersource_sourcedataisvalid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_PersistentReaderSource_SourceDataIsValid == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Reader_ReadFromPersistentSource = (PLib3MFReader_ReadFromPersistentSourcePtr) GetProcAddress(hLibrary, "lib3mf_reader_readfrompersistentsource"); + #else // _WIN32 + pWrapperTable->m_Reader_ReadFromPersistentSource = (PLib3MFReader_ReadFromPersistentSourcePtr) dlsym(hLibrary, "lib3mf_reader_readfrompersistentsource"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Reader_ReadFromPersistentSource == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Reader_ReadFromFile = (PLib3MFReader_ReadFromFilePtr) GetProcAddress(hLibrary, "lib3mf_reader_readfromfile"); #else // _WIN32 @@ -804,1731 +1066,2784 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack = (PLib3MFSliceStackIterator_GetCurrentSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_slicestackiterator_getcurrentslicestack"); + pWrapperTable->m_CustomXMLAttribute_GetName = (PLib3MFCustomXMLAttribute_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_getname"); #else // _WIN32 - pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack = (PLib3MFSliceStackIterator_GetCurrentSliceStackPtr) dlsym(hLibrary, "lib3mf_slicestackiterator_getcurrentslicestack"); + pWrapperTable->m_CustomXMLAttribute_GetName = (PLib3MFCustomXMLAttribute_GetNamePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_getname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack == NULL) + if (pWrapperTable->m_CustomXMLAttribute_GetName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ObjectIterator_GetCurrentObject = (PLib3MFObjectIterator_GetCurrentObjectPtr) GetProcAddress(hLibrary, "lib3mf_objectiterator_getcurrentobject"); + pWrapperTable->m_CustomXMLAttribute_GetValue = (PLib3MFCustomXMLAttribute_GetValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_getvalue"); #else // _WIN32 - pWrapperTable->m_ObjectIterator_GetCurrentObject = (PLib3MFObjectIterator_GetCurrentObjectPtr) dlsym(hLibrary, "lib3mf_objectiterator_getcurrentobject"); + pWrapperTable->m_CustomXMLAttribute_GetValue = (PLib3MFCustomXMLAttribute_GetValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_getvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ObjectIterator_GetCurrentObject == NULL) + if (pWrapperTable->m_CustomXMLAttribute_GetValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject = (PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) GetProcAddress(hLibrary, "lib3mf_meshobjectiterator_getcurrentmeshobject"); + pWrapperTable->m_CustomXMLAttribute_IsValidInteger = (PLib3MFCustomXMLAttribute_IsValidIntegerPtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_isvalidinteger"); #else // _WIN32 - pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject = (PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) dlsym(hLibrary, "lib3mf_meshobjectiterator_getcurrentmeshobject"); + pWrapperTable->m_CustomXMLAttribute_IsValidInteger = (PLib3MFCustomXMLAttribute_IsValidIntegerPtr) dlsym(hLibrary, "lib3mf_customxmlattribute_isvalidinteger"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject == NULL) + if (pWrapperTable->m_CustomXMLAttribute_IsValidInteger == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject = (PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) GetProcAddress(hLibrary, "lib3mf_componentsobjectiterator_getcurrentcomponentsobject"); + pWrapperTable->m_CustomXMLAttribute_GetIntegerValue = (PLib3MFCustomXMLAttribute_GetIntegerValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_getintegervalue"); #else // _WIN32 - pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject = (PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) dlsym(hLibrary, "lib3mf_componentsobjectiterator_getcurrentcomponentsobject"); + pWrapperTable->m_CustomXMLAttribute_GetIntegerValue = (PLib3MFCustomXMLAttribute_GetIntegerValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_getintegervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject == NULL) + if (pWrapperTable->m_CustomXMLAttribute_GetIntegerValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D = (PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) GetProcAddress(hLibrary, "lib3mf_texture2diterator_getcurrenttexture2d"); + pWrapperTable->m_CustomXMLAttribute_IsValidDouble = (PLib3MFCustomXMLAttribute_IsValidDoublePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_isvaliddouble"); #else // _WIN32 - pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D = (PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) dlsym(hLibrary, "lib3mf_texture2diterator_getcurrenttexture2d"); + pWrapperTable->m_CustomXMLAttribute_IsValidDouble = (PLib3MFCustomXMLAttribute_IsValidDoublePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_isvaliddouble"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D == NULL) + if (pWrapperTable->m_CustomXMLAttribute_IsValidDouble == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup = (PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup"); + pWrapperTable->m_CustomXMLAttribute_GetDoubleValue = (PLib3MFCustomXMLAttribute_GetDoubleValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_getdoublevalue"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup = (PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr) dlsym(hLibrary, "lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup"); + pWrapperTable->m_CustomXMLAttribute_GetDoubleValue = (PLib3MFCustomXMLAttribute_GetDoubleValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_getdoublevalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup == NULL) + if (pWrapperTable->m_CustomXMLAttribute_GetDoubleValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup = (PLib3MFColorGroupIterator_GetCurrentColorGroupPtr) GetProcAddress(hLibrary, "lib3mf_colorgroupiterator_getcurrentcolorgroup"); + pWrapperTable->m_CustomXMLAttribute_IsValidBool = (PLib3MFCustomXMLAttribute_IsValidBoolPtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_isvalidbool"); #else // _WIN32 - pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup = (PLib3MFColorGroupIterator_GetCurrentColorGroupPtr) dlsym(hLibrary, "lib3mf_colorgroupiterator_getcurrentcolorgroup"); + pWrapperTable->m_CustomXMLAttribute_IsValidBool = (PLib3MFCustomXMLAttribute_IsValidBoolPtr) dlsym(hLibrary, "lib3mf_customxmlattribute_isvalidbool"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup == NULL) + if (pWrapperTable->m_CustomXMLAttribute_IsValidBool == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup = (PLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup"); + pWrapperTable->m_CustomXMLAttribute_GetBoolValue = (PLib3MFCustomXMLAttribute_GetBoolValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_getboolvalue"); #else // _WIN32 - pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup = (PLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupPtr) dlsym(hLibrary, "lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup"); + pWrapperTable->m_CustomXMLAttribute_GetBoolValue = (PLib3MFCustomXMLAttribute_GetBoolValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_getboolvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup == NULL) + if (pWrapperTable->m_CustomXMLAttribute_GetBoolValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials = (PLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsPtr) GetProcAddress(hLibrary, "lib3mf_compositematerialsiterator_getcurrentcompositematerials"); + pWrapperTable->m_CustomXMLAttribute_SetValue = (PLib3MFCustomXMLAttribute_SetValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_setvalue"); #else // _WIN32 - pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials = (PLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsPtr) dlsym(hLibrary, "lib3mf_compositematerialsiterator_getcurrentcompositematerials"); + pWrapperTable->m_CustomXMLAttribute_SetValue = (PLib3MFCustomXMLAttribute_SetValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_setvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials == NULL) + if (pWrapperTable->m_CustomXMLAttribute_SetValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup = (PLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup"); + pWrapperTable->m_CustomXMLAttribute_SetIntegerValue = (PLib3MFCustomXMLAttribute_SetIntegerValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_setintegervalue"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup = (PLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupPtr) dlsym(hLibrary, "lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup"); + pWrapperTable->m_CustomXMLAttribute_SetIntegerValue = (PLib3MFCustomXMLAttribute_SetIntegerValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_setintegervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup == NULL) + if (pWrapperTable->m_CustomXMLAttribute_SetIntegerValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_GetNameSpace = (PLib3MFMetaData_GetNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getnamespace"); + pWrapperTable->m_CustomXMLAttribute_SetDoubleValue = (PLib3MFCustomXMLAttribute_SetDoubleValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_setdoublevalue"); #else // _WIN32 - pWrapperTable->m_MetaData_GetNameSpace = (PLib3MFMetaData_GetNameSpacePtr) dlsym(hLibrary, "lib3mf_metadata_getnamespace"); + pWrapperTable->m_CustomXMLAttribute_SetDoubleValue = (PLib3MFCustomXMLAttribute_SetDoubleValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_setdoublevalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_GetNameSpace == NULL) + if (pWrapperTable->m_CustomXMLAttribute_SetDoubleValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_SetNameSpace = (PLib3MFMetaData_SetNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setnamespace"); + pWrapperTable->m_CustomXMLAttribute_SetBoolValue = (PLib3MFCustomXMLAttribute_SetBoolValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_setboolvalue"); #else // _WIN32 - pWrapperTable->m_MetaData_SetNameSpace = (PLib3MFMetaData_SetNameSpacePtr) dlsym(hLibrary, "lib3mf_metadata_setnamespace"); + pWrapperTable->m_CustomXMLAttribute_SetBoolValue = (PLib3MFCustomXMLAttribute_SetBoolValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_setboolvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_SetNameSpace == NULL) + if (pWrapperTable->m_CustomXMLAttribute_SetBoolValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_GetName = (PLib3MFMetaData_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getname"); + pWrapperTable->m_CustomXMLAttribute_Remove = (PLib3MFCustomXMLAttribute_RemovePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_remove"); #else // _WIN32 - pWrapperTable->m_MetaData_GetName = (PLib3MFMetaData_GetNamePtr) dlsym(hLibrary, "lib3mf_metadata_getname"); + pWrapperTable->m_CustomXMLAttribute_Remove = (PLib3MFCustomXMLAttribute_RemovePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_remove"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_GetName == NULL) + if (pWrapperTable->m_CustomXMLAttribute_Remove == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_SetName = (PLib3MFMetaData_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setname"); + pWrapperTable->m_CustomXMLNode_GetName = (PLib3MFCustomXMLNode_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_getname"); #else // _WIN32 - pWrapperTable->m_MetaData_SetName = (PLib3MFMetaData_SetNamePtr) dlsym(hLibrary, "lib3mf_metadata_setname"); + pWrapperTable->m_CustomXMLNode_GetName = (PLib3MFCustomXMLNode_GetNamePtr) dlsym(hLibrary, "lib3mf_customxmlnode_getname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_SetName == NULL) + if (pWrapperTable->m_CustomXMLNode_GetName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_GetKey = (PLib3MFMetaData_GetKeyPtr) GetProcAddress(hLibrary, "lib3mf_metadata_getkey"); + pWrapperTable->m_CustomXMLNode_GetNameSpace = (PLib3MFCustomXMLNode_GetNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_getnamespace"); #else // _WIN32 - pWrapperTable->m_MetaData_GetKey = (PLib3MFMetaData_GetKeyPtr) dlsym(hLibrary, "lib3mf_metadata_getkey"); + pWrapperTable->m_CustomXMLNode_GetNameSpace = (PLib3MFCustomXMLNode_GetNameSpacePtr) dlsym(hLibrary, "lib3mf_customxmlnode_getnamespace"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_GetKey == NULL) + if (pWrapperTable->m_CustomXMLNode_GetNameSpace == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_GetMustPreserve = (PLib3MFMetaData_GetMustPreservePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getmustpreserve"); + pWrapperTable->m_CustomXMLNode_GetAttributeCount = (PLib3MFCustomXMLNode_GetAttributeCountPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_getattributecount"); #else // _WIN32 - pWrapperTable->m_MetaData_GetMustPreserve = (PLib3MFMetaData_GetMustPreservePtr) dlsym(hLibrary, "lib3mf_metadata_getmustpreserve"); + pWrapperTable->m_CustomXMLNode_GetAttributeCount = (PLib3MFCustomXMLNode_GetAttributeCountPtr) dlsym(hLibrary, "lib3mf_customxmlnode_getattributecount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_GetMustPreserve == NULL) + if (pWrapperTable->m_CustomXMLNode_GetAttributeCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_SetMustPreserve = (PLib3MFMetaData_SetMustPreservePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setmustpreserve"); + pWrapperTable->m_CustomXMLNode_GetAttribute = (PLib3MFCustomXMLNode_GetAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_getattribute"); #else // _WIN32 - pWrapperTable->m_MetaData_SetMustPreserve = (PLib3MFMetaData_SetMustPreservePtr) dlsym(hLibrary, "lib3mf_metadata_setmustpreserve"); + pWrapperTable->m_CustomXMLNode_GetAttribute = (PLib3MFCustomXMLNode_GetAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_getattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_SetMustPreserve == NULL) + if (pWrapperTable->m_CustomXMLNode_GetAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_GetType = (PLib3MFMetaData_GetTypePtr) GetProcAddress(hLibrary, "lib3mf_metadata_gettype"); + pWrapperTable->m_CustomXMLNode_HasAttribute = (PLib3MFCustomXMLNode_HasAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_hasattribute"); #else // _WIN32 - pWrapperTable->m_MetaData_GetType = (PLib3MFMetaData_GetTypePtr) dlsym(hLibrary, "lib3mf_metadata_gettype"); + pWrapperTable->m_CustomXMLNode_HasAttribute = (PLib3MFCustomXMLNode_HasAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_hasattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_GetType == NULL) + if (pWrapperTable->m_CustomXMLNode_HasAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_SetType = (PLib3MFMetaData_SetTypePtr) GetProcAddress(hLibrary, "lib3mf_metadata_settype"); + pWrapperTable->m_CustomXMLNode_FindAttribute = (PLib3MFCustomXMLNode_FindAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_findattribute"); #else // _WIN32 - pWrapperTable->m_MetaData_SetType = (PLib3MFMetaData_SetTypePtr) dlsym(hLibrary, "lib3mf_metadata_settype"); + pWrapperTable->m_CustomXMLNode_FindAttribute = (PLib3MFCustomXMLNode_FindAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_findattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_SetType == NULL) + if (pWrapperTable->m_CustomXMLNode_FindAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_GetValue = (PLib3MFMetaData_GetValuePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getvalue"); + pWrapperTable->m_CustomXMLNode_RemoveAttribute = (PLib3MFCustomXMLNode_RemoveAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_removeattribute"); #else // _WIN32 - pWrapperTable->m_MetaData_GetValue = (PLib3MFMetaData_GetValuePtr) dlsym(hLibrary, "lib3mf_metadata_getvalue"); + pWrapperTable->m_CustomXMLNode_RemoveAttribute = (PLib3MFCustomXMLNode_RemoveAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_removeattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_GetValue == NULL) + if (pWrapperTable->m_CustomXMLNode_RemoveAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_SetValue = (PLib3MFMetaData_SetValuePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setvalue"); + pWrapperTable->m_CustomXMLNode_RemoveAttributeByIndex = (PLib3MFCustomXMLNode_RemoveAttributeByIndexPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_removeattributebyindex"); #else // _WIN32 - pWrapperTable->m_MetaData_SetValue = (PLib3MFMetaData_SetValuePtr) dlsym(hLibrary, "lib3mf_metadata_setvalue"); + pWrapperTable->m_CustomXMLNode_RemoveAttributeByIndex = (PLib3MFCustomXMLNode_RemoveAttributeByIndexPtr) dlsym(hLibrary, "lib3mf_customxmlnode_removeattributebyindex"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_SetValue == NULL) + if (pWrapperTable->m_CustomXMLNode_RemoveAttributeByIndex == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaDataGroup_GetMetaDataCount = (PLib3MFMetaDataGroup_GetMetaDataCountPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_getmetadatacount"); + pWrapperTable->m_CustomXMLNode_AddAttribute = (PLib3MFCustomXMLNode_AddAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_addattribute"); #else // _WIN32 - pWrapperTable->m_MetaDataGroup_GetMetaDataCount = (PLib3MFMetaDataGroup_GetMetaDataCountPtr) dlsym(hLibrary, "lib3mf_metadatagroup_getmetadatacount"); + pWrapperTable->m_CustomXMLNode_AddAttribute = (PLib3MFCustomXMLNode_AddAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_addattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaDataGroup_GetMetaDataCount == NULL) + if (pWrapperTable->m_CustomXMLNode_AddAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaDataGroup_GetMetaData = (PLib3MFMetaDataGroup_GetMetaDataPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_getmetadata"); + pWrapperTable->m_CustomXMLNode_AddIntegerAttribute = (PLib3MFCustomXMLNode_AddIntegerAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_addintegerattribute"); #else // _WIN32 - pWrapperTable->m_MetaDataGroup_GetMetaData = (PLib3MFMetaDataGroup_GetMetaDataPtr) dlsym(hLibrary, "lib3mf_metadatagroup_getmetadata"); + pWrapperTable->m_CustomXMLNode_AddIntegerAttribute = (PLib3MFCustomXMLNode_AddIntegerAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_addintegerattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaDataGroup_GetMetaData == NULL) + if (pWrapperTable->m_CustomXMLNode_AddIntegerAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaDataGroup_GetMetaDataByKey = (PLib3MFMetaDataGroup_GetMetaDataByKeyPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_getmetadatabykey"); + pWrapperTable->m_CustomXMLNode_AddDoubleAttribute = (PLib3MFCustomXMLNode_AddDoubleAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_adddoubleattribute"); #else // _WIN32 - pWrapperTable->m_MetaDataGroup_GetMetaDataByKey = (PLib3MFMetaDataGroup_GetMetaDataByKeyPtr) dlsym(hLibrary, "lib3mf_metadatagroup_getmetadatabykey"); + pWrapperTable->m_CustomXMLNode_AddDoubleAttribute = (PLib3MFCustomXMLNode_AddDoubleAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_adddoubleattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaDataGroup_GetMetaDataByKey == NULL) + if (pWrapperTable->m_CustomXMLNode_AddDoubleAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex = (PLib3MFMetaDataGroup_RemoveMetaDataByIndexPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_removemetadatabyindex"); + pWrapperTable->m_CustomXMLNode_AddBoolAttribute = (PLib3MFCustomXMLNode_AddBoolAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_addboolattribute"); #else // _WIN32 - pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex = (PLib3MFMetaDataGroup_RemoveMetaDataByIndexPtr) dlsym(hLibrary, "lib3mf_metadatagroup_removemetadatabyindex"); + pWrapperTable->m_CustomXMLNode_AddBoolAttribute = (PLib3MFCustomXMLNode_AddBoolAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_addboolattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex == NULL) + if (pWrapperTable->m_CustomXMLNode_AddBoolAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaDataGroup_RemoveMetaData = (PLib3MFMetaDataGroup_RemoveMetaDataPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_removemetadata"); + pWrapperTable->m_CustomXMLNode_GetChildren = (PLib3MFCustomXMLNode_GetChildrenPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_getchildren"); #else // _WIN32 - pWrapperTable->m_MetaDataGroup_RemoveMetaData = (PLib3MFMetaDataGroup_RemoveMetaDataPtr) dlsym(hLibrary, "lib3mf_metadatagroup_removemetadata"); + pWrapperTable->m_CustomXMLNode_GetChildren = (PLib3MFCustomXMLNode_GetChildrenPtr) dlsym(hLibrary, "lib3mf_customxmlnode_getchildren"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaDataGroup_RemoveMetaData == NULL) + if (pWrapperTable->m_CustomXMLNode_GetChildren == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaDataGroup_AddMetaData = (PLib3MFMetaDataGroup_AddMetaDataPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_addmetadata"); + pWrapperTable->m_CustomXMLNode_CountChildrenByName = (PLib3MFCustomXMLNode_CountChildrenByNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_countchildrenbyname"); #else // _WIN32 - pWrapperTable->m_MetaDataGroup_AddMetaData = (PLib3MFMetaDataGroup_AddMetaDataPtr) dlsym(hLibrary, "lib3mf_metadatagroup_addmetadata"); + pWrapperTable->m_CustomXMLNode_CountChildrenByName = (PLib3MFCustomXMLNode_CountChildrenByNamePtr) dlsym(hLibrary, "lib3mf_customxmlnode_countchildrenbyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaDataGroup_AddMetaData == NULL) + if (pWrapperTable->m_CustomXMLNode_CountChildrenByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetType = (PLib3MFObject_GetTypePtr) GetProcAddress(hLibrary, "lib3mf_object_gettype"); + pWrapperTable->m_CustomXMLNode_GetChildrenByName = (PLib3MFCustomXMLNode_GetChildrenByNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_getchildrenbyname"); #else // _WIN32 - pWrapperTable->m_Object_GetType = (PLib3MFObject_GetTypePtr) dlsym(hLibrary, "lib3mf_object_gettype"); + pWrapperTable->m_CustomXMLNode_GetChildrenByName = (PLib3MFCustomXMLNode_GetChildrenByNamePtr) dlsym(hLibrary, "lib3mf_customxmlnode_getchildrenbyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetType == NULL) + if (pWrapperTable->m_CustomXMLNode_GetChildrenByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_SetType = (PLib3MFObject_SetTypePtr) GetProcAddress(hLibrary, "lib3mf_object_settype"); + pWrapperTable->m_CustomXMLNode_HasChild = (PLib3MFCustomXMLNode_HasChildPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_haschild"); #else // _WIN32 - pWrapperTable->m_Object_SetType = (PLib3MFObject_SetTypePtr) dlsym(hLibrary, "lib3mf_object_settype"); + pWrapperTable->m_CustomXMLNode_HasChild = (PLib3MFCustomXMLNode_HasChildPtr) dlsym(hLibrary, "lib3mf_customxmlnode_haschild"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_SetType == NULL) + if (pWrapperTable->m_CustomXMLNode_HasChild == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetName = (PLib3MFObject_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_object_getname"); + pWrapperTable->m_CustomXMLNode_HasUniqueChild = (PLib3MFCustomXMLNode_HasUniqueChildPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_hasuniquechild"); #else // _WIN32 - pWrapperTable->m_Object_GetName = (PLib3MFObject_GetNamePtr) dlsym(hLibrary, "lib3mf_object_getname"); + pWrapperTable->m_CustomXMLNode_HasUniqueChild = (PLib3MFCustomXMLNode_HasUniqueChildPtr) dlsym(hLibrary, "lib3mf_customxmlnode_hasuniquechild"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetName == NULL) + if (pWrapperTable->m_CustomXMLNode_HasUniqueChild == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_SetName = (PLib3MFObject_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_object_setname"); + pWrapperTable->m_CustomXMLNode_FindChild = (PLib3MFCustomXMLNode_FindChildPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_findchild"); #else // _WIN32 - pWrapperTable->m_Object_SetName = (PLib3MFObject_SetNamePtr) dlsym(hLibrary, "lib3mf_object_setname"); + pWrapperTable->m_CustomXMLNode_FindChild = (PLib3MFCustomXMLNode_FindChildPtr) dlsym(hLibrary, "lib3mf_customxmlnode_findchild"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_SetName == NULL) + if (pWrapperTable->m_CustomXMLNode_FindChild == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetPartNumber = (PLib3MFObject_GetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_object_getpartnumber"); + pWrapperTable->m_CustomXMLNode_AddChild = (PLib3MFCustomXMLNode_AddChildPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_addchild"); #else // _WIN32 - pWrapperTable->m_Object_GetPartNumber = (PLib3MFObject_GetPartNumberPtr) dlsym(hLibrary, "lib3mf_object_getpartnumber"); + pWrapperTable->m_CustomXMLNode_AddChild = (PLib3MFCustomXMLNode_AddChildPtr) dlsym(hLibrary, "lib3mf_customxmlnode_addchild"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetPartNumber == NULL) + if (pWrapperTable->m_CustomXMLNode_AddChild == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_SetPartNumber = (PLib3MFObject_SetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_object_setpartnumber"); + pWrapperTable->m_CustomXMLNode_RemoveChild = (PLib3MFCustomXMLNode_RemoveChildPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_removechild"); #else // _WIN32 - pWrapperTable->m_Object_SetPartNumber = (PLib3MFObject_SetPartNumberPtr) dlsym(hLibrary, "lib3mf_object_setpartnumber"); + pWrapperTable->m_CustomXMLNode_RemoveChild = (PLib3MFCustomXMLNode_RemoveChildPtr) dlsym(hLibrary, "lib3mf_customxmlnode_removechild"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_SetPartNumber == NULL) + if (pWrapperTable->m_CustomXMLNode_RemoveChild == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_IsMeshObject = (PLib3MFObject_IsMeshObjectPtr) GetProcAddress(hLibrary, "lib3mf_object_ismeshobject"); + pWrapperTable->m_CustomXMLNode_RemoveChildrenWithName = (PLib3MFCustomXMLNode_RemoveChildrenWithNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_removechildrenwithname"); #else // _WIN32 - pWrapperTable->m_Object_IsMeshObject = (PLib3MFObject_IsMeshObjectPtr) dlsym(hLibrary, "lib3mf_object_ismeshobject"); + pWrapperTable->m_CustomXMLNode_RemoveChildrenWithName = (PLib3MFCustomXMLNode_RemoveChildrenWithNamePtr) dlsym(hLibrary, "lib3mf_customxmlnode_removechildrenwithname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_IsMeshObject == NULL) + if (pWrapperTable->m_CustomXMLNode_RemoveChildrenWithName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_IsComponentsObject = (PLib3MFObject_IsComponentsObjectPtr) GetProcAddress(hLibrary, "lib3mf_object_iscomponentsobject"); + pWrapperTable->m_CustomXMLNode_Remove = (PLib3MFCustomXMLNode_RemovePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_remove"); #else // _WIN32 - pWrapperTable->m_Object_IsComponentsObject = (PLib3MFObject_IsComponentsObjectPtr) dlsym(hLibrary, "lib3mf_object_iscomponentsobject"); + pWrapperTable->m_CustomXMLNode_Remove = (PLib3MFCustomXMLNode_RemovePtr) dlsym(hLibrary, "lib3mf_customxmlnode_remove"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_IsComponentsObject == NULL) + if (pWrapperTable->m_CustomXMLNode_Remove == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_IsValid = (PLib3MFObject_IsValidPtr) GetProcAddress(hLibrary, "lib3mf_object_isvalid"); + pWrapperTable->m_CustomXMLNodes_GetNodeCount = (PLib3MFCustomXMLNodes_GetNodeCountPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_getnodecount"); #else // _WIN32 - pWrapperTable->m_Object_IsValid = (PLib3MFObject_IsValidPtr) dlsym(hLibrary, "lib3mf_object_isvalid"); + pWrapperTable->m_CustomXMLNodes_GetNodeCount = (PLib3MFCustomXMLNodes_GetNodeCountPtr) dlsym(hLibrary, "lib3mf_customxmlnodes_getnodecount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_IsValid == NULL) + if (pWrapperTable->m_CustomXMLNodes_GetNodeCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_SetAttachmentAsThumbnail = (PLib3MFObject_SetAttachmentAsThumbnailPtr) GetProcAddress(hLibrary, "lib3mf_object_setattachmentasthumbnail"); + pWrapperTable->m_CustomXMLNodes_GetNode = (PLib3MFCustomXMLNodes_GetNodePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_getnode"); #else // _WIN32 - pWrapperTable->m_Object_SetAttachmentAsThumbnail = (PLib3MFObject_SetAttachmentAsThumbnailPtr) dlsym(hLibrary, "lib3mf_object_setattachmentasthumbnail"); + pWrapperTable->m_CustomXMLNodes_GetNode = (PLib3MFCustomXMLNodes_GetNodePtr) dlsym(hLibrary, "lib3mf_customxmlnodes_getnode"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_SetAttachmentAsThumbnail == NULL) + if (pWrapperTable->m_CustomXMLNodes_GetNode == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetThumbnailAttachment = (PLib3MFObject_GetThumbnailAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_object_getthumbnailattachment"); + pWrapperTable->m_CustomXMLNodes_CountNodesByName = (PLib3MFCustomXMLNodes_CountNodesByNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_countnodesbyname"); #else // _WIN32 - pWrapperTable->m_Object_GetThumbnailAttachment = (PLib3MFObject_GetThumbnailAttachmentPtr) dlsym(hLibrary, "lib3mf_object_getthumbnailattachment"); + pWrapperTable->m_CustomXMLNodes_CountNodesByName = (PLib3MFCustomXMLNodes_CountNodesByNamePtr) dlsym(hLibrary, "lib3mf_customxmlnodes_countnodesbyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetThumbnailAttachment == NULL) + if (pWrapperTable->m_CustomXMLNodes_CountNodesByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_ClearThumbnailAttachment = (PLib3MFObject_ClearThumbnailAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_object_clearthumbnailattachment"); + pWrapperTable->m_CustomXMLNodes_GetNodesByName = (PLib3MFCustomXMLNodes_GetNodesByNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_getnodesbyname"); #else // _WIN32 - pWrapperTable->m_Object_ClearThumbnailAttachment = (PLib3MFObject_ClearThumbnailAttachmentPtr) dlsym(hLibrary, "lib3mf_object_clearthumbnailattachment"); + pWrapperTable->m_CustomXMLNodes_GetNodesByName = (PLib3MFCustomXMLNodes_GetNodesByNamePtr) dlsym(hLibrary, "lib3mf_customxmlnodes_getnodesbyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_ClearThumbnailAttachment == NULL) + if (pWrapperTable->m_CustomXMLNodes_GetNodesByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetOutbox = (PLib3MFObject_GetOutboxPtr) GetProcAddress(hLibrary, "lib3mf_object_getoutbox"); + pWrapperTable->m_CustomXMLNodes_HasNode = (PLib3MFCustomXMLNodes_HasNodePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_hasnode"); #else // _WIN32 - pWrapperTable->m_Object_GetOutbox = (PLib3MFObject_GetOutboxPtr) dlsym(hLibrary, "lib3mf_object_getoutbox"); + pWrapperTable->m_CustomXMLNodes_HasNode = (PLib3MFCustomXMLNodes_HasNodePtr) dlsym(hLibrary, "lib3mf_customxmlnodes_hasnode"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetOutbox == NULL) + if (pWrapperTable->m_CustomXMLNodes_HasNode == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetUUID = (PLib3MFObject_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_object_getuuid"); + pWrapperTable->m_CustomXMLNodes_HasUniqueNode = (PLib3MFCustomXMLNodes_HasUniqueNodePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_hasuniquenode"); #else // _WIN32 - pWrapperTable->m_Object_GetUUID = (PLib3MFObject_GetUUIDPtr) dlsym(hLibrary, "lib3mf_object_getuuid"); + pWrapperTable->m_CustomXMLNodes_HasUniqueNode = (PLib3MFCustomXMLNodes_HasUniqueNodePtr) dlsym(hLibrary, "lib3mf_customxmlnodes_hasuniquenode"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetUUID == NULL) + if (pWrapperTable->m_CustomXMLNodes_HasUniqueNode == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_SetUUID = (PLib3MFObject_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_object_setuuid"); + pWrapperTable->m_CustomXMLNodes_FindNode = (PLib3MFCustomXMLNodes_FindNodePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_findnode"); #else // _WIN32 - pWrapperTable->m_Object_SetUUID = (PLib3MFObject_SetUUIDPtr) dlsym(hLibrary, "lib3mf_object_setuuid"); + pWrapperTable->m_CustomXMLNodes_FindNode = (PLib3MFCustomXMLNodes_FindNodePtr) dlsym(hLibrary, "lib3mf_customxmlnodes_findnode"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_SetUUID == NULL) + if (pWrapperTable->m_CustomXMLNodes_FindNode == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetMetaDataGroup = (PLib3MFObject_GetMetaDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_object_getmetadatagroup"); + pWrapperTable->m_CustomDOMTree_GetNameSpace = (PLib3MFCustomDOMTree_GetNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_customdomtree_getnamespace"); #else // _WIN32 - pWrapperTable->m_Object_GetMetaDataGroup = (PLib3MFObject_GetMetaDataGroupPtr) dlsym(hLibrary, "lib3mf_object_getmetadatagroup"); + pWrapperTable->m_CustomDOMTree_GetNameSpace = (PLib3MFCustomDOMTree_GetNameSpacePtr) dlsym(hLibrary, "lib3mf_customdomtree_getnamespace"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetMetaDataGroup == NULL) + if (pWrapperTable->m_CustomDOMTree_GetNameSpace == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_SetSlicesMeshResolution = (PLib3MFObject_SetSlicesMeshResolutionPtr) GetProcAddress(hLibrary, "lib3mf_object_setslicesmeshresolution"); + pWrapperTable->m_CustomDOMTree_GetRootNode = (PLib3MFCustomDOMTree_GetRootNodePtr) GetProcAddress(hLibrary, "lib3mf_customdomtree_getrootnode"); #else // _WIN32 - pWrapperTable->m_Object_SetSlicesMeshResolution = (PLib3MFObject_SetSlicesMeshResolutionPtr) dlsym(hLibrary, "lib3mf_object_setslicesmeshresolution"); + pWrapperTable->m_CustomDOMTree_GetRootNode = (PLib3MFCustomDOMTree_GetRootNodePtr) dlsym(hLibrary, "lib3mf_customdomtree_getrootnode"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_SetSlicesMeshResolution == NULL) + if (pWrapperTable->m_CustomDOMTree_GetRootNode == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetSlicesMeshResolution = (PLib3MFObject_GetSlicesMeshResolutionPtr) GetProcAddress(hLibrary, "lib3mf_object_getslicesmeshresolution"); + pWrapperTable->m_CustomDOMTree_SaveToString = (PLib3MFCustomDOMTree_SaveToStringPtr) GetProcAddress(hLibrary, "lib3mf_customdomtree_savetostring"); #else // _WIN32 - pWrapperTable->m_Object_GetSlicesMeshResolution = (PLib3MFObject_GetSlicesMeshResolutionPtr) dlsym(hLibrary, "lib3mf_object_getslicesmeshresolution"); + pWrapperTable->m_CustomDOMTree_SaveToString = (PLib3MFCustomDOMTree_SaveToStringPtr) dlsym(hLibrary, "lib3mf_customdomtree_savetostring"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetSlicesMeshResolution == NULL) + if (pWrapperTable->m_CustomDOMTree_SaveToString == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_HasSlices = (PLib3MFObject_HasSlicesPtr) GetProcAddress(hLibrary, "lib3mf_object_hasslices"); + pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack = (PLib3MFSliceStackIterator_GetCurrentSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_slicestackiterator_getcurrentslicestack"); #else // _WIN32 - pWrapperTable->m_Object_HasSlices = (PLib3MFObject_HasSlicesPtr) dlsym(hLibrary, "lib3mf_object_hasslices"); + pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack = (PLib3MFSliceStackIterator_GetCurrentSliceStackPtr) dlsym(hLibrary, "lib3mf_slicestackiterator_getcurrentslicestack"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_HasSlices == NULL) + if (pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_ClearSliceStack = (PLib3MFObject_ClearSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_object_clearslicestack"); + pWrapperTable->m_ObjectIterator_GetCurrentObject = (PLib3MFObjectIterator_GetCurrentObjectPtr) GetProcAddress(hLibrary, "lib3mf_objectiterator_getcurrentobject"); #else // _WIN32 - pWrapperTable->m_Object_ClearSliceStack = (PLib3MFObject_ClearSliceStackPtr) dlsym(hLibrary, "lib3mf_object_clearslicestack"); + pWrapperTable->m_ObjectIterator_GetCurrentObject = (PLib3MFObjectIterator_GetCurrentObjectPtr) dlsym(hLibrary, "lib3mf_objectiterator_getcurrentobject"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_ClearSliceStack == NULL) + if (pWrapperTable->m_ObjectIterator_GetCurrentObject == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetSliceStack = (PLib3MFObject_GetSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_object_getslicestack"); + pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject = (PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) GetProcAddress(hLibrary, "lib3mf_meshobjectiterator_getcurrentmeshobject"); #else // _WIN32 - pWrapperTable->m_Object_GetSliceStack = (PLib3MFObject_GetSliceStackPtr) dlsym(hLibrary, "lib3mf_object_getslicestack"); + pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject = (PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) dlsym(hLibrary, "lib3mf_meshobjectiterator_getcurrentmeshobject"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetSliceStack == NULL) + if (pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_AssignSliceStack = (PLib3MFObject_AssignSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_object_assignslicestack"); + pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject = (PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) GetProcAddress(hLibrary, "lib3mf_componentsobjectiterator_getcurrentcomponentsobject"); #else // _WIN32 - pWrapperTable->m_Object_AssignSliceStack = (PLib3MFObject_AssignSliceStackPtr) dlsym(hLibrary, "lib3mf_object_assignslicestack"); + pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject = (PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) dlsym(hLibrary, "lib3mf_componentsobjectiterator_getcurrentcomponentsobject"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_AssignSliceStack == NULL) + if (pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetVertexCount = (PLib3MFMeshObject_GetVertexCountPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getvertexcount"); + pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D = (PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) GetProcAddress(hLibrary, "lib3mf_texture2diterator_getcurrenttexture2d"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetVertexCount = (PLib3MFMeshObject_GetVertexCountPtr) dlsym(hLibrary, "lib3mf_meshobject_getvertexcount"); + pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D = (PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) dlsym(hLibrary, "lib3mf_texture2diterator_getcurrenttexture2d"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetVertexCount == NULL) + if (pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetTriangleCount = (PLib3MFMeshObject_GetTriangleCountPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettrianglecount"); + pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup = (PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetTriangleCount = (PLib3MFMeshObject_GetTriangleCountPtr) dlsym(hLibrary, "lib3mf_meshobject_gettrianglecount"); + pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup = (PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr) dlsym(hLibrary, "lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetTriangleCount == NULL) + if (pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetVertex = (PLib3MFMeshObject_GetVertexPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getvertex"); + pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup = (PLib3MFColorGroupIterator_GetCurrentColorGroupPtr) GetProcAddress(hLibrary, "lib3mf_colorgroupiterator_getcurrentcolorgroup"); + #else // _WIN32 + pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup = (PLib3MFColorGroupIterator_GetCurrentColorGroupPtr) dlsym(hLibrary, "lib3mf_colorgroupiterator_getcurrentcolorgroup"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup = (PLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup"); + #else // _WIN32 + pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup = (PLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupPtr) dlsym(hLibrary, "lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials = (PLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsPtr) GetProcAddress(hLibrary, "lib3mf_compositematerialsiterator_getcurrentcompositematerials"); + #else // _WIN32 + pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials = (PLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsPtr) dlsym(hLibrary, "lib3mf_compositematerialsiterator_getcurrentcompositematerials"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup = (PLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup = (PLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupPtr) dlsym(hLibrary, "lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_GetNameSpace = (PLib3MFMetaData_GetNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getnamespace"); + #else // _WIN32 + pWrapperTable->m_MetaData_GetNameSpace = (PLib3MFMetaData_GetNameSpacePtr) dlsym(hLibrary, "lib3mf_metadata_getnamespace"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_GetNameSpace == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_SetNameSpace = (PLib3MFMetaData_SetNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setnamespace"); + #else // _WIN32 + pWrapperTable->m_MetaData_SetNameSpace = (PLib3MFMetaData_SetNameSpacePtr) dlsym(hLibrary, "lib3mf_metadata_setnamespace"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_SetNameSpace == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_GetName = (PLib3MFMetaData_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getname"); + #else // _WIN32 + pWrapperTable->m_MetaData_GetName = (PLib3MFMetaData_GetNamePtr) dlsym(hLibrary, "lib3mf_metadata_getname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_GetName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_SetName = (PLib3MFMetaData_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setname"); + #else // _WIN32 + pWrapperTable->m_MetaData_SetName = (PLib3MFMetaData_SetNamePtr) dlsym(hLibrary, "lib3mf_metadata_setname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_SetName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_GetKey = (PLib3MFMetaData_GetKeyPtr) GetProcAddress(hLibrary, "lib3mf_metadata_getkey"); + #else // _WIN32 + pWrapperTable->m_MetaData_GetKey = (PLib3MFMetaData_GetKeyPtr) dlsym(hLibrary, "lib3mf_metadata_getkey"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_GetKey == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_GetMustPreserve = (PLib3MFMetaData_GetMustPreservePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getmustpreserve"); + #else // _WIN32 + pWrapperTable->m_MetaData_GetMustPreserve = (PLib3MFMetaData_GetMustPreservePtr) dlsym(hLibrary, "lib3mf_metadata_getmustpreserve"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_GetMustPreserve == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_SetMustPreserve = (PLib3MFMetaData_SetMustPreservePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setmustpreserve"); + #else // _WIN32 + pWrapperTable->m_MetaData_SetMustPreserve = (PLib3MFMetaData_SetMustPreservePtr) dlsym(hLibrary, "lib3mf_metadata_setmustpreserve"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_SetMustPreserve == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_GetType = (PLib3MFMetaData_GetTypePtr) GetProcAddress(hLibrary, "lib3mf_metadata_gettype"); + #else // _WIN32 + pWrapperTable->m_MetaData_GetType = (PLib3MFMetaData_GetTypePtr) dlsym(hLibrary, "lib3mf_metadata_gettype"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_GetType == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_SetType = (PLib3MFMetaData_SetTypePtr) GetProcAddress(hLibrary, "lib3mf_metadata_settype"); + #else // _WIN32 + pWrapperTable->m_MetaData_SetType = (PLib3MFMetaData_SetTypePtr) dlsym(hLibrary, "lib3mf_metadata_settype"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_SetType == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_GetValue = (PLib3MFMetaData_GetValuePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getvalue"); + #else // _WIN32 + pWrapperTable->m_MetaData_GetValue = (PLib3MFMetaData_GetValuePtr) dlsym(hLibrary, "lib3mf_metadata_getvalue"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_GetValue == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_SetValue = (PLib3MFMetaData_SetValuePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setvalue"); + #else // _WIN32 + pWrapperTable->m_MetaData_SetValue = (PLib3MFMetaData_SetValuePtr) dlsym(hLibrary, "lib3mf_metadata_setvalue"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_SetValue == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaDataGroup_GetMetaDataCount = (PLib3MFMetaDataGroup_GetMetaDataCountPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_getmetadatacount"); + #else // _WIN32 + pWrapperTable->m_MetaDataGroup_GetMetaDataCount = (PLib3MFMetaDataGroup_GetMetaDataCountPtr) dlsym(hLibrary, "lib3mf_metadatagroup_getmetadatacount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaDataGroup_GetMetaDataCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaDataGroup_GetMetaData = (PLib3MFMetaDataGroup_GetMetaDataPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_getmetadata"); + #else // _WIN32 + pWrapperTable->m_MetaDataGroup_GetMetaData = (PLib3MFMetaDataGroup_GetMetaDataPtr) dlsym(hLibrary, "lib3mf_metadatagroup_getmetadata"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaDataGroup_GetMetaData == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaDataGroup_GetMetaDataByKey = (PLib3MFMetaDataGroup_GetMetaDataByKeyPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_getmetadatabykey"); + #else // _WIN32 + pWrapperTable->m_MetaDataGroup_GetMetaDataByKey = (PLib3MFMetaDataGroup_GetMetaDataByKeyPtr) dlsym(hLibrary, "lib3mf_metadatagroup_getmetadatabykey"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaDataGroup_GetMetaDataByKey == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex = (PLib3MFMetaDataGroup_RemoveMetaDataByIndexPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_removemetadatabyindex"); + #else // _WIN32 + pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex = (PLib3MFMetaDataGroup_RemoveMetaDataByIndexPtr) dlsym(hLibrary, "lib3mf_metadatagroup_removemetadatabyindex"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaDataGroup_RemoveMetaData = (PLib3MFMetaDataGroup_RemoveMetaDataPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_removemetadata"); + #else // _WIN32 + pWrapperTable->m_MetaDataGroup_RemoveMetaData = (PLib3MFMetaDataGroup_RemoveMetaDataPtr) dlsym(hLibrary, "lib3mf_metadatagroup_removemetadata"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaDataGroup_RemoveMetaData == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaDataGroup_AddMetaData = (PLib3MFMetaDataGroup_AddMetaDataPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_addmetadata"); + #else // _WIN32 + pWrapperTable->m_MetaDataGroup_AddMetaData = (PLib3MFMetaDataGroup_AddMetaDataPtr) dlsym(hLibrary, "lib3mf_metadatagroup_addmetadata"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaDataGroup_AddMetaData == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetType = (PLib3MFObject_GetTypePtr) GetProcAddress(hLibrary, "lib3mf_object_gettype"); + #else // _WIN32 + pWrapperTable->m_Object_GetType = (PLib3MFObject_GetTypePtr) dlsym(hLibrary, "lib3mf_object_gettype"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetType == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_SetType = (PLib3MFObject_SetTypePtr) GetProcAddress(hLibrary, "lib3mf_object_settype"); + #else // _WIN32 + pWrapperTable->m_Object_SetType = (PLib3MFObject_SetTypePtr) dlsym(hLibrary, "lib3mf_object_settype"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_SetType == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetName = (PLib3MFObject_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_object_getname"); + #else // _WIN32 + pWrapperTable->m_Object_GetName = (PLib3MFObject_GetNamePtr) dlsym(hLibrary, "lib3mf_object_getname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_SetName = (PLib3MFObject_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_object_setname"); + #else // _WIN32 + pWrapperTable->m_Object_SetName = (PLib3MFObject_SetNamePtr) dlsym(hLibrary, "lib3mf_object_setname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_SetName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetPartNumber = (PLib3MFObject_GetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_object_getpartnumber"); + #else // _WIN32 + pWrapperTable->m_Object_GetPartNumber = (PLib3MFObject_GetPartNumberPtr) dlsym(hLibrary, "lib3mf_object_getpartnumber"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetPartNumber == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_SetPartNumber = (PLib3MFObject_SetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_object_setpartnumber"); + #else // _WIN32 + pWrapperTable->m_Object_SetPartNumber = (PLib3MFObject_SetPartNumberPtr) dlsym(hLibrary, "lib3mf_object_setpartnumber"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_SetPartNumber == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_IsMeshObject = (PLib3MFObject_IsMeshObjectPtr) GetProcAddress(hLibrary, "lib3mf_object_ismeshobject"); + #else // _WIN32 + pWrapperTable->m_Object_IsMeshObject = (PLib3MFObject_IsMeshObjectPtr) dlsym(hLibrary, "lib3mf_object_ismeshobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_IsMeshObject == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_IsComponentsObject = (PLib3MFObject_IsComponentsObjectPtr) GetProcAddress(hLibrary, "lib3mf_object_iscomponentsobject"); + #else // _WIN32 + pWrapperTable->m_Object_IsComponentsObject = (PLib3MFObject_IsComponentsObjectPtr) dlsym(hLibrary, "lib3mf_object_iscomponentsobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_IsComponentsObject == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_IsValid = (PLib3MFObject_IsValidPtr) GetProcAddress(hLibrary, "lib3mf_object_isvalid"); + #else // _WIN32 + pWrapperTable->m_Object_IsValid = (PLib3MFObject_IsValidPtr) dlsym(hLibrary, "lib3mf_object_isvalid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_IsValid == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_SetAttachmentAsThumbnail = (PLib3MFObject_SetAttachmentAsThumbnailPtr) GetProcAddress(hLibrary, "lib3mf_object_setattachmentasthumbnail"); + #else // _WIN32 + pWrapperTable->m_Object_SetAttachmentAsThumbnail = (PLib3MFObject_SetAttachmentAsThumbnailPtr) dlsym(hLibrary, "lib3mf_object_setattachmentasthumbnail"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_SetAttachmentAsThumbnail == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetThumbnailAttachment = (PLib3MFObject_GetThumbnailAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_object_getthumbnailattachment"); + #else // _WIN32 + pWrapperTable->m_Object_GetThumbnailAttachment = (PLib3MFObject_GetThumbnailAttachmentPtr) dlsym(hLibrary, "lib3mf_object_getthumbnailattachment"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetThumbnailAttachment == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_ClearThumbnailAttachment = (PLib3MFObject_ClearThumbnailAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_object_clearthumbnailattachment"); + #else // _WIN32 + pWrapperTable->m_Object_ClearThumbnailAttachment = (PLib3MFObject_ClearThumbnailAttachmentPtr) dlsym(hLibrary, "lib3mf_object_clearthumbnailattachment"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_ClearThumbnailAttachment == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetOutbox = (PLib3MFObject_GetOutboxPtr) GetProcAddress(hLibrary, "lib3mf_object_getoutbox"); + #else // _WIN32 + pWrapperTable->m_Object_GetOutbox = (PLib3MFObject_GetOutboxPtr) dlsym(hLibrary, "lib3mf_object_getoutbox"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetOutbox == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetUUID = (PLib3MFObject_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_object_getuuid"); + #else // _WIN32 + pWrapperTable->m_Object_GetUUID = (PLib3MFObject_GetUUIDPtr) dlsym(hLibrary, "lib3mf_object_getuuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetUUID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_SetUUID = (PLib3MFObject_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_object_setuuid"); + #else // _WIN32 + pWrapperTable->m_Object_SetUUID = (PLib3MFObject_SetUUIDPtr) dlsym(hLibrary, "lib3mf_object_setuuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_SetUUID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetMetaDataGroup = (PLib3MFObject_GetMetaDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_object_getmetadatagroup"); + #else // _WIN32 + pWrapperTable->m_Object_GetMetaDataGroup = (PLib3MFObject_GetMetaDataGroupPtr) dlsym(hLibrary, "lib3mf_object_getmetadatagroup"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetMetaDataGroup == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_SetSlicesMeshResolution = (PLib3MFObject_SetSlicesMeshResolutionPtr) GetProcAddress(hLibrary, "lib3mf_object_setslicesmeshresolution"); + #else // _WIN32 + pWrapperTable->m_Object_SetSlicesMeshResolution = (PLib3MFObject_SetSlicesMeshResolutionPtr) dlsym(hLibrary, "lib3mf_object_setslicesmeshresolution"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_SetSlicesMeshResolution == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetSlicesMeshResolution = (PLib3MFObject_GetSlicesMeshResolutionPtr) GetProcAddress(hLibrary, "lib3mf_object_getslicesmeshresolution"); + #else // _WIN32 + pWrapperTable->m_Object_GetSlicesMeshResolution = (PLib3MFObject_GetSlicesMeshResolutionPtr) dlsym(hLibrary, "lib3mf_object_getslicesmeshresolution"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetSlicesMeshResolution == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_HasSlices = (PLib3MFObject_HasSlicesPtr) GetProcAddress(hLibrary, "lib3mf_object_hasslices"); + #else // _WIN32 + pWrapperTable->m_Object_HasSlices = (PLib3MFObject_HasSlicesPtr) dlsym(hLibrary, "lib3mf_object_hasslices"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_HasSlices == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_ClearSliceStack = (PLib3MFObject_ClearSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_object_clearslicestack"); + #else // _WIN32 + pWrapperTable->m_Object_ClearSliceStack = (PLib3MFObject_ClearSliceStackPtr) dlsym(hLibrary, "lib3mf_object_clearslicestack"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_ClearSliceStack == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetSliceStack = (PLib3MFObject_GetSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_object_getslicestack"); + #else // _WIN32 + pWrapperTable->m_Object_GetSliceStack = (PLib3MFObject_GetSliceStackPtr) dlsym(hLibrary, "lib3mf_object_getslicestack"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetSliceStack == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_AssignSliceStack = (PLib3MFObject_AssignSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_object_assignslicestack"); + #else // _WIN32 + pWrapperTable->m_Object_AssignSliceStack = (PLib3MFObject_AssignSliceStackPtr) dlsym(hLibrary, "lib3mf_object_assignslicestack"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_AssignSliceStack == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetVertexCount = (PLib3MFMeshObject_GetVertexCountPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getvertexcount"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetVertexCount = (PLib3MFMeshObject_GetVertexCountPtr) dlsym(hLibrary, "lib3mf_meshobject_getvertexcount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetVertexCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetTriangleCount = (PLib3MFMeshObject_GetTriangleCountPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettrianglecount"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetTriangleCount = (PLib3MFMeshObject_GetTriangleCountPtr) dlsym(hLibrary, "lib3mf_meshobject_gettrianglecount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetTriangleCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetVertex = (PLib3MFMeshObject_GetVertexPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getvertex"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetVertex = (PLib3MFMeshObject_GetVertexPtr) dlsym(hLibrary, "lib3mf_meshobject_getvertex"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetVertex == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_SetVertex = (PLib3MFMeshObject_SetVertexPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setvertex"); + #else // _WIN32 + pWrapperTable->m_MeshObject_SetVertex = (PLib3MFMeshObject_SetVertexPtr) dlsym(hLibrary, "lib3mf_meshobject_setvertex"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_SetVertex == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_AddVertex = (PLib3MFMeshObject_AddVertexPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_addvertex"); + #else // _WIN32 + pWrapperTable->m_MeshObject_AddVertex = (PLib3MFMeshObject_AddVertexPtr) dlsym(hLibrary, "lib3mf_meshobject_addvertex"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_AddVertex == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetVertices = (PLib3MFMeshObject_GetVerticesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getvertices"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetVertices = (PLib3MFMeshObject_GetVerticesPtr) dlsym(hLibrary, "lib3mf_meshobject_getvertices"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetVertices == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetTriangle = (PLib3MFMeshObject_GetTrianglePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettriangle"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetTriangle = (PLib3MFMeshObject_GetTrianglePtr) dlsym(hLibrary, "lib3mf_meshobject_gettriangle"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetTriangle == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_SetTriangle = (PLib3MFMeshObject_SetTrianglePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_settriangle"); + #else // _WIN32 + pWrapperTable->m_MeshObject_SetTriangle = (PLib3MFMeshObject_SetTrianglePtr) dlsym(hLibrary, "lib3mf_meshobject_settriangle"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_SetTriangle == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_AddTriangle = (PLib3MFMeshObject_AddTrianglePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_addtriangle"); + #else // _WIN32 + pWrapperTable->m_MeshObject_AddTriangle = (PLib3MFMeshObject_AddTrianglePtr) dlsym(hLibrary, "lib3mf_meshobject_addtriangle"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_AddTriangle == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetTriangleIndices = (PLib3MFMeshObject_GetTriangleIndicesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettriangleindices"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetTriangleIndices = (PLib3MFMeshObject_GetTriangleIndicesPtr) dlsym(hLibrary, "lib3mf_meshobject_gettriangleindices"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetTriangleIndices == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_SetObjectLevelProperty = (PLib3MFMeshObject_SetObjectLevelPropertyPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setobjectlevelproperty"); + #else // _WIN32 + pWrapperTable->m_MeshObject_SetObjectLevelProperty = (PLib3MFMeshObject_SetObjectLevelPropertyPtr) dlsym(hLibrary, "lib3mf_meshobject_setobjectlevelproperty"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_SetObjectLevelProperty == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetObjectLevelProperty = (PLib3MFMeshObject_GetObjectLevelPropertyPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getobjectlevelproperty"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetObjectLevelProperty = (PLib3MFMeshObject_GetObjectLevelPropertyPtr) dlsym(hLibrary, "lib3mf_meshobject_getobjectlevelproperty"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetObjectLevelProperty == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_SetTriangleProperties = (PLib3MFMeshObject_SetTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_settriangleproperties"); + #else // _WIN32 + pWrapperTable->m_MeshObject_SetTriangleProperties = (PLib3MFMeshObject_SetTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_settriangleproperties"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_SetTriangleProperties == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetTriangleProperties = (PLib3MFMeshObject_GetTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettriangleproperties"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetTriangleProperties = (PLib3MFMeshObject_GetTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_gettriangleproperties"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetTriangleProperties == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_SetAllTriangleProperties = (PLib3MFMeshObject_SetAllTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setalltriangleproperties"); + #else // _WIN32 + pWrapperTable->m_MeshObject_SetAllTriangleProperties = (PLib3MFMeshObject_SetAllTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_setalltriangleproperties"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_SetAllTriangleProperties == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetAllTriangleProperties = (PLib3MFMeshObject_GetAllTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getalltriangleproperties"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetAllTriangleProperties = (PLib3MFMeshObject_GetAllTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_getalltriangleproperties"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetAllTriangleProperties == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_ClearAllProperties = (PLib3MFMeshObject_ClearAllPropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_clearallproperties"); + #else // _WIN32 + pWrapperTable->m_MeshObject_ClearAllProperties = (PLib3MFMeshObject_ClearAllPropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_clearallproperties"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_ClearAllProperties == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_SetGeometry = (PLib3MFMeshObject_SetGeometryPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setgeometry"); + #else // _WIN32 + pWrapperTable->m_MeshObject_SetGeometry = (PLib3MFMeshObject_SetGeometryPtr) dlsym(hLibrary, "lib3mf_meshobject_setgeometry"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_SetGeometry == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_IsManifoldAndOriented = (PLib3MFMeshObject_IsManifoldAndOrientedPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_ismanifoldandoriented"); + #else // _WIN32 + pWrapperTable->m_MeshObject_IsManifoldAndOriented = (PLib3MFMeshObject_IsManifoldAndOrientedPtr) dlsym(hLibrary, "lib3mf_meshobject_ismanifoldandoriented"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_IsManifoldAndOriented == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_BeamLattice = (PLib3MFMeshObject_BeamLatticePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_beamlattice"); + #else // _WIN32 + pWrapperTable->m_MeshObject_BeamLattice = (PLib3MFMeshObject_BeamLatticePtr) dlsym(hLibrary, "lib3mf_meshobject_beamlattice"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_BeamLattice == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetMinLength = (PLib3MFBeamLattice_GetMinLengthPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getminlength"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetMinLength = (PLib3MFBeamLattice_GetMinLengthPtr) dlsym(hLibrary, "lib3mf_beamlattice_getminlength"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetMinLength == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_SetMinLength = (PLib3MFBeamLattice_SetMinLengthPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setminlength"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_SetMinLength = (PLib3MFBeamLattice_SetMinLengthPtr) dlsym(hLibrary, "lib3mf_beamlattice_setminlength"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_SetMinLength == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetClipping = (PLib3MFBeamLattice_GetClippingPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getclipping"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetClipping = (PLib3MFBeamLattice_GetClippingPtr) dlsym(hLibrary, "lib3mf_beamlattice_getclipping"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetClipping == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_SetClipping = (PLib3MFBeamLattice_SetClippingPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setclipping"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_SetClipping = (PLib3MFBeamLattice_SetClippingPtr) dlsym(hLibrary, "lib3mf_beamlattice_setclipping"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_SetClipping == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetRepresentation = (PLib3MFBeamLattice_GetRepresentationPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getrepresentation"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetRepresentation = (PLib3MFBeamLattice_GetRepresentationPtr) dlsym(hLibrary, "lib3mf_beamlattice_getrepresentation"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetRepresentation == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_SetRepresentation = (PLib3MFBeamLattice_SetRepresentationPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setrepresentation"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_SetRepresentation = (PLib3MFBeamLattice_SetRepresentationPtr) dlsym(hLibrary, "lib3mf_beamlattice_setrepresentation"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_SetRepresentation == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBallOptions = (PLib3MFBeamLattice_GetBallOptionsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getballoptions"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBallOptions = (PLib3MFBeamLattice_GetBallOptionsPtr) dlsym(hLibrary, "lib3mf_beamlattice_getballoptions"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBallOptions == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_SetBallOptions = (PLib3MFBeamLattice_SetBallOptionsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setballoptions"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_SetBallOptions = (PLib3MFBeamLattice_SetBallOptionsPtr) dlsym(hLibrary, "lib3mf_beamlattice_setballoptions"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_SetBallOptions == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBeamCount = (PLib3MFBeamLattice_GetBeamCountPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeamcount"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBeamCount = (PLib3MFBeamLattice_GetBeamCountPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeamcount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBeamCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBeam = (PLib3MFBeamLattice_GetBeamPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeam"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBeam = (PLib3MFBeamLattice_GetBeamPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeam"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBeam == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_AddBeam = (PLib3MFBeamLattice_AddBeamPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_addbeam"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_AddBeam = (PLib3MFBeamLattice_AddBeamPtr) dlsym(hLibrary, "lib3mf_beamlattice_addbeam"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_AddBeam == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_SetBeam = (PLib3MFBeamLattice_SetBeamPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setbeam"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_SetBeam = (PLib3MFBeamLattice_SetBeamPtr) dlsym(hLibrary, "lib3mf_beamlattice_setbeam"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_SetBeam == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_SetBeams = (PLib3MFBeamLattice_SetBeamsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setbeams"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_SetBeams = (PLib3MFBeamLattice_SetBeamsPtr) dlsym(hLibrary, "lib3mf_beamlattice_setbeams"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_SetBeams == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBeams = (PLib3MFBeamLattice_GetBeamsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeams"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBeams = (PLib3MFBeamLattice_GetBeamsPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeams"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBeams == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBallCount = (PLib3MFBeamLattice_GetBallCountPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getballcount"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBallCount = (PLib3MFBeamLattice_GetBallCountPtr) dlsym(hLibrary, "lib3mf_beamlattice_getballcount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBallCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBall = (PLib3MFBeamLattice_GetBallPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getball"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBall = (PLib3MFBeamLattice_GetBallPtr) dlsym(hLibrary, "lib3mf_beamlattice_getball"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBall == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_AddBall = (PLib3MFBeamLattice_AddBallPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_addball"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_AddBall = (PLib3MFBeamLattice_AddBallPtr) dlsym(hLibrary, "lib3mf_beamlattice_addball"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_AddBall == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_SetBall = (PLib3MFBeamLattice_SetBallPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setball"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_SetBall = (PLib3MFBeamLattice_SetBallPtr) dlsym(hLibrary, "lib3mf_beamlattice_setball"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_SetBall == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_SetBalls = (PLib3MFBeamLattice_SetBallsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setballs"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_SetBalls = (PLib3MFBeamLattice_SetBallsPtr) dlsym(hLibrary, "lib3mf_beamlattice_setballs"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_SetBalls == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBalls = (PLib3MFBeamLattice_GetBallsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getballs"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBalls = (PLib3MFBeamLattice_GetBallsPtr) dlsym(hLibrary, "lib3mf_beamlattice_getballs"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBalls == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBeamSetCount = (PLib3MFBeamLattice_GetBeamSetCountPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeamsetcount"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBeamSetCount = (PLib3MFBeamLattice_GetBeamSetCountPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeamsetcount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBeamSetCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_AddBeamSet = (PLib3MFBeamLattice_AddBeamSetPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_addbeamset"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_AddBeamSet = (PLib3MFBeamLattice_AddBeamSetPtr) dlsym(hLibrary, "lib3mf_beamlattice_addbeamset"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_AddBeamSet == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBeamSet = (PLib3MFBeamLattice_GetBeamSetPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeamset"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBeamSet = (PLib3MFBeamLattice_GetBeamSetPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeamset"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBeamSet == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Component_GetObjectResource = (PLib3MFComponent_GetObjectResourcePtr) GetProcAddress(hLibrary, "lib3mf_component_getobjectresource"); + #else // _WIN32 + pWrapperTable->m_Component_GetObjectResource = (PLib3MFComponent_GetObjectResourcePtr) dlsym(hLibrary, "lib3mf_component_getobjectresource"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Component_GetObjectResource == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Component_GetObjectResourceID = (PLib3MFComponent_GetObjectResourceIDPtr) GetProcAddress(hLibrary, "lib3mf_component_getobjectresourceid"); + #else // _WIN32 + pWrapperTable->m_Component_GetObjectResourceID = (PLib3MFComponent_GetObjectResourceIDPtr) dlsym(hLibrary, "lib3mf_component_getobjectresourceid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Component_GetObjectResourceID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Component_GetUUID = (PLib3MFComponent_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_component_getuuid"); + #else // _WIN32 + pWrapperTable->m_Component_GetUUID = (PLib3MFComponent_GetUUIDPtr) dlsym(hLibrary, "lib3mf_component_getuuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Component_GetUUID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Component_SetUUID = (PLib3MFComponent_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_component_setuuid"); + #else // _WIN32 + pWrapperTable->m_Component_SetUUID = (PLib3MFComponent_SetUUIDPtr) dlsym(hLibrary, "lib3mf_component_setuuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Component_SetUUID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Component_HasTransform = (PLib3MFComponent_HasTransformPtr) GetProcAddress(hLibrary, "lib3mf_component_hastransform"); + #else // _WIN32 + pWrapperTable->m_Component_HasTransform = (PLib3MFComponent_HasTransformPtr) dlsym(hLibrary, "lib3mf_component_hastransform"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Component_HasTransform == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Component_GetTransform = (PLib3MFComponent_GetTransformPtr) GetProcAddress(hLibrary, "lib3mf_component_gettransform"); + #else // _WIN32 + pWrapperTable->m_Component_GetTransform = (PLib3MFComponent_GetTransformPtr) dlsym(hLibrary, "lib3mf_component_gettransform"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Component_GetTransform == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Component_SetTransform = (PLib3MFComponent_SetTransformPtr) GetProcAddress(hLibrary, "lib3mf_component_settransform"); + #else // _WIN32 + pWrapperTable->m_Component_SetTransform = (PLib3MFComponent_SetTransformPtr) dlsym(hLibrary, "lib3mf_component_settransform"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Component_SetTransform == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ComponentsObject_AddComponent = (PLib3MFComponentsObject_AddComponentPtr) GetProcAddress(hLibrary, "lib3mf_componentsobject_addcomponent"); + #else // _WIN32 + pWrapperTable->m_ComponentsObject_AddComponent = (PLib3MFComponentsObject_AddComponentPtr) dlsym(hLibrary, "lib3mf_componentsobject_addcomponent"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ComponentsObject_AddComponent == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ComponentsObject_GetComponent = (PLib3MFComponentsObject_GetComponentPtr) GetProcAddress(hLibrary, "lib3mf_componentsobject_getcomponent"); + #else // _WIN32 + pWrapperTable->m_ComponentsObject_GetComponent = (PLib3MFComponentsObject_GetComponentPtr) dlsym(hLibrary, "lib3mf_componentsobject_getcomponent"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ComponentsObject_GetComponent == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ComponentsObject_GetComponentCount = (PLib3MFComponentsObject_GetComponentCountPtr) GetProcAddress(hLibrary, "lib3mf_componentsobject_getcomponentcount"); + #else // _WIN32 + pWrapperTable->m_ComponentsObject_GetComponentCount = (PLib3MFComponentsObject_GetComponentCountPtr) dlsym(hLibrary, "lib3mf_componentsobject_getcomponentcount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ComponentsObject_GetComponentCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_SetName = (PLib3MFBeamSet_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_beamset_setname"); + #else // _WIN32 + pWrapperTable->m_BeamSet_SetName = (PLib3MFBeamSet_SetNamePtr) dlsym(hLibrary, "lib3mf_beamset_setname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_SetName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_GetName = (PLib3MFBeamSet_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_beamset_getname"); + #else // _WIN32 + pWrapperTable->m_BeamSet_GetName = (PLib3MFBeamSet_GetNamePtr) dlsym(hLibrary, "lib3mf_beamset_getname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_GetName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_SetIdentifier = (PLib3MFBeamSet_SetIdentifierPtr) GetProcAddress(hLibrary, "lib3mf_beamset_setidentifier"); + #else // _WIN32 + pWrapperTable->m_BeamSet_SetIdentifier = (PLib3MFBeamSet_SetIdentifierPtr) dlsym(hLibrary, "lib3mf_beamset_setidentifier"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_SetIdentifier == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_GetIdentifier = (PLib3MFBeamSet_GetIdentifierPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getidentifier"); + #else // _WIN32 + pWrapperTable->m_BeamSet_GetIdentifier = (PLib3MFBeamSet_GetIdentifierPtr) dlsym(hLibrary, "lib3mf_beamset_getidentifier"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_GetIdentifier == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_GetReferenceCount = (PLib3MFBeamSet_GetReferenceCountPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getreferencecount"); + #else // _WIN32 + pWrapperTable->m_BeamSet_GetReferenceCount = (PLib3MFBeamSet_GetReferenceCountPtr) dlsym(hLibrary, "lib3mf_beamset_getreferencecount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_GetReferenceCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_SetReferences = (PLib3MFBeamSet_SetReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_setreferences"); + #else // _WIN32 + pWrapperTable->m_BeamSet_SetReferences = (PLib3MFBeamSet_SetReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_setreferences"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_SetReferences == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_GetReferences = (PLib3MFBeamSet_GetReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getreferences"); + #else // _WIN32 + pWrapperTable->m_BeamSet_GetReferences = (PLib3MFBeamSet_GetReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_getreferences"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_GetReferences == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_GetBallReferenceCount = (PLib3MFBeamSet_GetBallReferenceCountPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getballreferencecount"); + #else // _WIN32 + pWrapperTable->m_BeamSet_GetBallReferenceCount = (PLib3MFBeamSet_GetBallReferenceCountPtr) dlsym(hLibrary, "lib3mf_beamset_getballreferencecount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_GetBallReferenceCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_SetBallReferences = (PLib3MFBeamSet_SetBallReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_setballreferences"); + #else // _WIN32 + pWrapperTable->m_BeamSet_SetBallReferences = (PLib3MFBeamSet_SetBallReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_setballreferences"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_SetBallReferences == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_GetBallReferences = (PLib3MFBeamSet_GetBallReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getballreferences"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetVertex = (PLib3MFMeshObject_GetVertexPtr) dlsym(hLibrary, "lib3mf_meshobject_getvertex"); + pWrapperTable->m_BeamSet_GetBallReferences = (PLib3MFBeamSet_GetBallReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_getballreferences"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetVertex == NULL) + if (pWrapperTable->m_BeamSet_GetBallReferences == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_SetVertex = (PLib3MFMeshObject_SetVertexPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setvertex"); + pWrapperTable->m_BaseMaterialGroup_GetCount = (PLib3MFBaseMaterialGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getcount"); #else // _WIN32 - pWrapperTable->m_MeshObject_SetVertex = (PLib3MFMeshObject_SetVertexPtr) dlsym(hLibrary, "lib3mf_meshobject_setvertex"); + pWrapperTable->m_BaseMaterialGroup_GetCount = (PLib3MFBaseMaterialGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_SetVertex == NULL) + if (pWrapperTable->m_BaseMaterialGroup_GetCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_AddVertex = (PLib3MFMeshObject_AddVertexPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_addvertex"); + pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs = (PLib3MFBaseMaterialGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getallpropertyids"); #else // _WIN32 - pWrapperTable->m_MeshObject_AddVertex = (PLib3MFMeshObject_AddVertexPtr) dlsym(hLibrary, "lib3mf_meshobject_addvertex"); + pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs = (PLib3MFBaseMaterialGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getallpropertyids"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_AddVertex == NULL) + if (pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetVertices = (PLib3MFMeshObject_GetVerticesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getvertices"); + pWrapperTable->m_BaseMaterialGroup_AddMaterial = (PLib3MFBaseMaterialGroup_AddMaterialPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_addmaterial"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetVertices = (PLib3MFMeshObject_GetVerticesPtr) dlsym(hLibrary, "lib3mf_meshobject_getvertices"); + pWrapperTable->m_BaseMaterialGroup_AddMaterial = (PLib3MFBaseMaterialGroup_AddMaterialPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_addmaterial"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetVertices == NULL) + if (pWrapperTable->m_BaseMaterialGroup_AddMaterial == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetTriangle = (PLib3MFMeshObject_GetTrianglePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettriangle"); + pWrapperTable->m_BaseMaterialGroup_RemoveMaterial = (PLib3MFBaseMaterialGroup_RemoveMaterialPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_removematerial"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetTriangle = (PLib3MFMeshObject_GetTrianglePtr) dlsym(hLibrary, "lib3mf_meshobject_gettriangle"); + pWrapperTable->m_BaseMaterialGroup_RemoveMaterial = (PLib3MFBaseMaterialGroup_RemoveMaterialPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_removematerial"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetTriangle == NULL) + if (pWrapperTable->m_BaseMaterialGroup_RemoveMaterial == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_SetTriangle = (PLib3MFMeshObject_SetTrianglePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_settriangle"); + pWrapperTable->m_BaseMaterialGroup_GetName = (PLib3MFBaseMaterialGroup_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getname"); #else // _WIN32 - pWrapperTable->m_MeshObject_SetTriangle = (PLib3MFMeshObject_SetTrianglePtr) dlsym(hLibrary, "lib3mf_meshobject_settriangle"); + pWrapperTable->m_BaseMaterialGroup_GetName = (PLib3MFBaseMaterialGroup_GetNamePtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_SetTriangle == NULL) + if (pWrapperTable->m_BaseMaterialGroup_GetName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_AddTriangle = (PLib3MFMeshObject_AddTrianglePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_addtriangle"); + pWrapperTable->m_BaseMaterialGroup_SetName = (PLib3MFBaseMaterialGroup_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_setname"); #else // _WIN32 - pWrapperTable->m_MeshObject_AddTriangle = (PLib3MFMeshObject_AddTrianglePtr) dlsym(hLibrary, "lib3mf_meshobject_addtriangle"); + pWrapperTable->m_BaseMaterialGroup_SetName = (PLib3MFBaseMaterialGroup_SetNamePtr) dlsym(hLibrary, "lib3mf_basematerialgroup_setname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_AddTriangle == NULL) + if (pWrapperTable->m_BaseMaterialGroup_SetName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetTriangleIndices = (PLib3MFMeshObject_GetTriangleIndicesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettriangleindices"); + pWrapperTable->m_BaseMaterialGroup_SetDisplayColor = (PLib3MFBaseMaterialGroup_SetDisplayColorPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_setdisplaycolor"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetTriangleIndices = (PLib3MFMeshObject_GetTriangleIndicesPtr) dlsym(hLibrary, "lib3mf_meshobject_gettriangleindices"); + pWrapperTable->m_BaseMaterialGroup_SetDisplayColor = (PLib3MFBaseMaterialGroup_SetDisplayColorPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_setdisplaycolor"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetTriangleIndices == NULL) + if (pWrapperTable->m_BaseMaterialGroup_SetDisplayColor == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_SetObjectLevelProperty = (PLib3MFMeshObject_SetObjectLevelPropertyPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setobjectlevelproperty"); + pWrapperTable->m_BaseMaterialGroup_GetDisplayColor = (PLib3MFBaseMaterialGroup_GetDisplayColorPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getdisplaycolor"); #else // _WIN32 - pWrapperTable->m_MeshObject_SetObjectLevelProperty = (PLib3MFMeshObject_SetObjectLevelPropertyPtr) dlsym(hLibrary, "lib3mf_meshobject_setobjectlevelproperty"); + pWrapperTable->m_BaseMaterialGroup_GetDisplayColor = (PLib3MFBaseMaterialGroup_GetDisplayColorPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getdisplaycolor"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_SetObjectLevelProperty == NULL) + if (pWrapperTable->m_BaseMaterialGroup_GetDisplayColor == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetObjectLevelProperty = (PLib3MFMeshObject_GetObjectLevelPropertyPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getobjectlevelproperty"); + pWrapperTable->m_ColorGroup_GetCount = (PLib3MFColorGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_getcount"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetObjectLevelProperty = (PLib3MFMeshObject_GetObjectLevelPropertyPtr) dlsym(hLibrary, "lib3mf_meshobject_getobjectlevelproperty"); + pWrapperTable->m_ColorGroup_GetCount = (PLib3MFColorGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_colorgroup_getcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetObjectLevelProperty == NULL) + if (pWrapperTable->m_ColorGroup_GetCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_SetTriangleProperties = (PLib3MFMeshObject_SetTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_settriangleproperties"); + pWrapperTable->m_ColorGroup_GetAllPropertyIDs = (PLib3MFColorGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_getallpropertyids"); #else // _WIN32 - pWrapperTable->m_MeshObject_SetTriangleProperties = (PLib3MFMeshObject_SetTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_settriangleproperties"); + pWrapperTable->m_ColorGroup_GetAllPropertyIDs = (PLib3MFColorGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_colorgroup_getallpropertyids"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_SetTriangleProperties == NULL) + if (pWrapperTable->m_ColorGroup_GetAllPropertyIDs == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetTriangleProperties = (PLib3MFMeshObject_GetTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettriangleproperties"); + pWrapperTable->m_ColorGroup_AddColor = (PLib3MFColorGroup_AddColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_addcolor"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetTriangleProperties = (PLib3MFMeshObject_GetTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_gettriangleproperties"); + pWrapperTable->m_ColorGroup_AddColor = (PLib3MFColorGroup_AddColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_addcolor"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetTriangleProperties == NULL) + if (pWrapperTable->m_ColorGroup_AddColor == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_SetAllTriangleProperties = (PLib3MFMeshObject_SetAllTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setalltriangleproperties"); + pWrapperTable->m_ColorGroup_RemoveColor = (PLib3MFColorGroup_RemoveColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_removecolor"); #else // _WIN32 - pWrapperTable->m_MeshObject_SetAllTriangleProperties = (PLib3MFMeshObject_SetAllTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_setalltriangleproperties"); + pWrapperTable->m_ColorGroup_RemoveColor = (PLib3MFColorGroup_RemoveColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_removecolor"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_SetAllTriangleProperties == NULL) + if (pWrapperTable->m_ColorGroup_RemoveColor == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetAllTriangleProperties = (PLib3MFMeshObject_GetAllTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getalltriangleproperties"); + pWrapperTable->m_ColorGroup_SetColor = (PLib3MFColorGroup_SetColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_setcolor"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetAllTriangleProperties = (PLib3MFMeshObject_GetAllTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_getalltriangleproperties"); + pWrapperTable->m_ColorGroup_SetColor = (PLib3MFColorGroup_SetColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_setcolor"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetAllTriangleProperties == NULL) + if (pWrapperTable->m_ColorGroup_SetColor == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_ClearAllProperties = (PLib3MFMeshObject_ClearAllPropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_clearallproperties"); + pWrapperTable->m_ColorGroup_GetColor = (PLib3MFColorGroup_GetColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_getcolor"); #else // _WIN32 - pWrapperTable->m_MeshObject_ClearAllProperties = (PLib3MFMeshObject_ClearAllPropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_clearallproperties"); + pWrapperTable->m_ColorGroup_GetColor = (PLib3MFColorGroup_GetColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_getcolor"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_ClearAllProperties == NULL) + if (pWrapperTable->m_ColorGroup_GetColor == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_SetGeometry = (PLib3MFMeshObject_SetGeometryPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setgeometry"); + pWrapperTable->m_Texture2DGroup_GetCount = (PLib3MFTexture2DGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_getcount"); #else // _WIN32 - pWrapperTable->m_MeshObject_SetGeometry = (PLib3MFMeshObject_SetGeometryPtr) dlsym(hLibrary, "lib3mf_meshobject_setgeometry"); + pWrapperTable->m_Texture2DGroup_GetCount = (PLib3MFTexture2DGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_getcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_SetGeometry == NULL) + if (pWrapperTable->m_Texture2DGroup_GetCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_IsManifoldAndOriented = (PLib3MFMeshObject_IsManifoldAndOrientedPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_ismanifoldandoriented"); + pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs = (PLib3MFTexture2DGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_getallpropertyids"); #else // _WIN32 - pWrapperTable->m_MeshObject_IsManifoldAndOriented = (PLib3MFMeshObject_IsManifoldAndOrientedPtr) dlsym(hLibrary, "lib3mf_meshobject_ismanifoldandoriented"); + pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs = (PLib3MFTexture2DGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_getallpropertyids"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_IsManifoldAndOriented == NULL) + if (pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_BeamLattice = (PLib3MFMeshObject_BeamLatticePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_beamlattice"); + pWrapperTable->m_Texture2DGroup_AddTex2Coord = (PLib3MFTexture2DGroup_AddTex2CoordPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_addtex2coord"); #else // _WIN32 - pWrapperTable->m_MeshObject_BeamLattice = (PLib3MFMeshObject_BeamLatticePtr) dlsym(hLibrary, "lib3mf_meshobject_beamlattice"); + pWrapperTable->m_Texture2DGroup_AddTex2Coord = (PLib3MFTexture2DGroup_AddTex2CoordPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_addtex2coord"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_BeamLattice == NULL) + if (pWrapperTable->m_Texture2DGroup_AddTex2Coord == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetMinLength = (PLib3MFBeamLattice_GetMinLengthPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getminlength"); + pWrapperTable->m_Texture2DGroup_GetTex2Coord = (PLib3MFTexture2DGroup_GetTex2CoordPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_gettex2coord"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetMinLength = (PLib3MFBeamLattice_GetMinLengthPtr) dlsym(hLibrary, "lib3mf_beamlattice_getminlength"); + pWrapperTable->m_Texture2DGroup_GetTex2Coord = (PLib3MFTexture2DGroup_GetTex2CoordPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_gettex2coord"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetMinLength == NULL) + if (pWrapperTable->m_Texture2DGroup_GetTex2Coord == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetMinLength = (PLib3MFBeamLattice_SetMinLengthPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setminlength"); + pWrapperTable->m_Texture2DGroup_RemoveTex2Coord = (PLib3MFTexture2DGroup_RemoveTex2CoordPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_removetex2coord"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetMinLength = (PLib3MFBeamLattice_SetMinLengthPtr) dlsym(hLibrary, "lib3mf_beamlattice_setminlength"); + pWrapperTable->m_Texture2DGroup_RemoveTex2Coord = (PLib3MFTexture2DGroup_RemoveTex2CoordPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_removetex2coord"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetMinLength == NULL) + if (pWrapperTable->m_Texture2DGroup_RemoveTex2Coord == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetClipping = (PLib3MFBeamLattice_GetClippingPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getclipping"); + pWrapperTable->m_Texture2DGroup_GetTexture2D = (PLib3MFTexture2DGroup_GetTexture2DPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_gettexture2d"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetClipping = (PLib3MFBeamLattice_GetClippingPtr) dlsym(hLibrary, "lib3mf_beamlattice_getclipping"); + pWrapperTable->m_Texture2DGroup_GetTexture2D = (PLib3MFTexture2DGroup_GetTexture2DPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_gettexture2d"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetClipping == NULL) + if (pWrapperTable->m_Texture2DGroup_GetTexture2D == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetClipping = (PLib3MFBeamLattice_SetClippingPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setclipping"); + pWrapperTable->m_CompositeMaterials_GetCount = (PLib3MFCompositeMaterials_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getcount"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetClipping = (PLib3MFBeamLattice_SetClippingPtr) dlsym(hLibrary, "lib3mf_beamlattice_setclipping"); + pWrapperTable->m_CompositeMaterials_GetCount = (PLib3MFCompositeMaterials_GetCountPtr) dlsym(hLibrary, "lib3mf_compositematerials_getcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetClipping == NULL) + if (pWrapperTable->m_CompositeMaterials_GetCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetRepresentation = (PLib3MFBeamLattice_GetRepresentationPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getrepresentation"); + pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs = (PLib3MFCompositeMaterials_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getallpropertyids"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetRepresentation = (PLib3MFBeamLattice_GetRepresentationPtr) dlsym(hLibrary, "lib3mf_beamlattice_getrepresentation"); + pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs = (PLib3MFCompositeMaterials_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_compositematerials_getallpropertyids"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetRepresentation == NULL) + if (pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetRepresentation = (PLib3MFBeamLattice_SetRepresentationPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setrepresentation"); + pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup = (PLib3MFCompositeMaterials_GetBaseMaterialGroupPtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getbasematerialgroup"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetRepresentation = (PLib3MFBeamLattice_SetRepresentationPtr) dlsym(hLibrary, "lib3mf_beamlattice_setrepresentation"); + pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup = (PLib3MFCompositeMaterials_GetBaseMaterialGroupPtr) dlsym(hLibrary, "lib3mf_compositematerials_getbasematerialgroup"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetRepresentation == NULL) + if (pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBallOptions = (PLib3MFBeamLattice_GetBallOptionsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getballoptions"); + pWrapperTable->m_CompositeMaterials_AddComposite = (PLib3MFCompositeMaterials_AddCompositePtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_addcomposite"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBallOptions = (PLib3MFBeamLattice_GetBallOptionsPtr) dlsym(hLibrary, "lib3mf_beamlattice_getballoptions"); + pWrapperTable->m_CompositeMaterials_AddComposite = (PLib3MFCompositeMaterials_AddCompositePtr) dlsym(hLibrary, "lib3mf_compositematerials_addcomposite"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_CompositeMaterials_AddComposite == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_CompositeMaterials_RemoveComposite = (PLib3MFCompositeMaterials_RemoveCompositePtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_removecomposite"); + #else // _WIN32 + pWrapperTable->m_CompositeMaterials_RemoveComposite = (PLib3MFCompositeMaterials_RemoveCompositePtr) dlsym(hLibrary, "lib3mf_compositematerials_removecomposite"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_CompositeMaterials_RemoveComposite == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_CompositeMaterials_GetComposite = (PLib3MFCompositeMaterials_GetCompositePtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getcomposite"); + #else // _WIN32 + pWrapperTable->m_CompositeMaterials_GetComposite = (PLib3MFCompositeMaterials_GetCompositePtr) dlsym(hLibrary, "lib3mf_compositematerials_getcomposite"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_CompositeMaterials_GetComposite == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetCount = (PLib3MFMultiPropertyGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getcount"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetCount = (PLib3MFMultiPropertyGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getcount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_GetCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs = (PLib3MFMultiPropertyGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getallpropertyids"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs = (PLib3MFMultiPropertyGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getallpropertyids"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_AddMultiProperty = (PLib3MFMultiPropertyGroup_AddMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_addmultiproperty"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_AddMultiProperty = (PLib3MFMultiPropertyGroup_AddMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_addmultiproperty"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_AddMultiProperty == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_SetMultiProperty = (PLib3MFMultiPropertyGroup_SetMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_setmultiproperty"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_SetMultiProperty = (PLib3MFMultiPropertyGroup_SetMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_setmultiproperty"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_SetMultiProperty == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetMultiProperty = (PLib3MFMultiPropertyGroup_GetMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getmultiproperty"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetMultiProperty = (PLib3MFMultiPropertyGroup_GetMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getmultiproperty"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_GetMultiProperty == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty = (PLib3MFMultiPropertyGroup_RemoveMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_removemultiproperty"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty = (PLib3MFMultiPropertyGroup_RemoveMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_removemultiproperty"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetLayerCount = (PLib3MFMultiPropertyGroup_GetLayerCountPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getlayercount"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetLayerCount = (PLib3MFMultiPropertyGroup_GetLayerCountPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getlayercount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_GetLayerCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_AddLayer = (PLib3MFMultiPropertyGroup_AddLayerPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_addlayer"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_AddLayer = (PLib3MFMultiPropertyGroup_AddLayerPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_addlayer"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_AddLayer == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetLayer = (PLib3MFMultiPropertyGroup_GetLayerPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getlayer"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetLayer = (PLib3MFMultiPropertyGroup_GetLayerPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getlayer"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_GetLayer == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_RemoveLayer = (PLib3MFMultiPropertyGroup_RemoveLayerPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_removelayer"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_RemoveLayer = (PLib3MFMultiPropertyGroup_RemoveLayerPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_removelayer"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBallOptions == NULL) + if (pWrapperTable->m_MultiPropertyGroup_RemoveLayer == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetBallOptions = (PLib3MFBeamLattice_SetBallOptionsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setballoptions"); + pWrapperTable->m_Attachment_GetPath = (PLib3MFAttachment_GetPathPtr) GetProcAddress(hLibrary, "lib3mf_attachment_getpath"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetBallOptions = (PLib3MFBeamLattice_SetBallOptionsPtr) dlsym(hLibrary, "lib3mf_beamlattice_setballoptions"); + pWrapperTable->m_Attachment_GetPath = (PLib3MFAttachment_GetPathPtr) dlsym(hLibrary, "lib3mf_attachment_getpath"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetBallOptions == NULL) + if (pWrapperTable->m_Attachment_GetPath == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBeamCount = (PLib3MFBeamLattice_GetBeamCountPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeamcount"); + pWrapperTable->m_Attachment_SetPath = (PLib3MFAttachment_SetPathPtr) GetProcAddress(hLibrary, "lib3mf_attachment_setpath"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBeamCount = (PLib3MFBeamLattice_GetBeamCountPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeamcount"); + pWrapperTable->m_Attachment_SetPath = (PLib3MFAttachment_SetPathPtr) dlsym(hLibrary, "lib3mf_attachment_setpath"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBeamCount == NULL) + if (pWrapperTable->m_Attachment_SetPath == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBeam = (PLib3MFBeamLattice_GetBeamPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeam"); + pWrapperTable->m_Attachment_PackagePart = (PLib3MFAttachment_PackagePartPtr) GetProcAddress(hLibrary, "lib3mf_attachment_packagepart"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBeam = (PLib3MFBeamLattice_GetBeamPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeam"); + pWrapperTable->m_Attachment_PackagePart = (PLib3MFAttachment_PackagePartPtr) dlsym(hLibrary, "lib3mf_attachment_packagepart"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBeam == NULL) + if (pWrapperTable->m_Attachment_PackagePart == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_AddBeam = (PLib3MFBeamLattice_AddBeamPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_addbeam"); + pWrapperTable->m_Attachment_GetRelationShipType = (PLib3MFAttachment_GetRelationShipTypePtr) GetProcAddress(hLibrary, "lib3mf_attachment_getrelationshiptype"); #else // _WIN32 - pWrapperTable->m_BeamLattice_AddBeam = (PLib3MFBeamLattice_AddBeamPtr) dlsym(hLibrary, "lib3mf_beamlattice_addbeam"); + pWrapperTable->m_Attachment_GetRelationShipType = (PLib3MFAttachment_GetRelationShipTypePtr) dlsym(hLibrary, "lib3mf_attachment_getrelationshiptype"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_AddBeam == NULL) + if (pWrapperTable->m_Attachment_GetRelationShipType == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetBeam = (PLib3MFBeamLattice_SetBeamPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setbeam"); + pWrapperTable->m_Attachment_SetRelationShipType = (PLib3MFAttachment_SetRelationShipTypePtr) GetProcAddress(hLibrary, "lib3mf_attachment_setrelationshiptype"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetBeam = (PLib3MFBeamLattice_SetBeamPtr) dlsym(hLibrary, "lib3mf_beamlattice_setbeam"); + pWrapperTable->m_Attachment_SetRelationShipType = (PLib3MFAttachment_SetRelationShipTypePtr) dlsym(hLibrary, "lib3mf_attachment_setrelationshiptype"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetBeam == NULL) + if (pWrapperTable->m_Attachment_SetRelationShipType == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetBeams = (PLib3MFBeamLattice_SetBeamsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setbeams"); + pWrapperTable->m_Attachment_WriteToFile = (PLib3MFAttachment_WriteToFilePtr) GetProcAddress(hLibrary, "lib3mf_attachment_writetofile"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetBeams = (PLib3MFBeamLattice_SetBeamsPtr) dlsym(hLibrary, "lib3mf_beamlattice_setbeams"); + pWrapperTable->m_Attachment_WriteToFile = (PLib3MFAttachment_WriteToFilePtr) dlsym(hLibrary, "lib3mf_attachment_writetofile"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetBeams == NULL) + if (pWrapperTable->m_Attachment_WriteToFile == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBeams = (PLib3MFBeamLattice_GetBeamsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeams"); + pWrapperTable->m_Attachment_ReadFromFile = (PLib3MFAttachment_ReadFromFilePtr) GetProcAddress(hLibrary, "lib3mf_attachment_readfromfile"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBeams = (PLib3MFBeamLattice_GetBeamsPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeams"); + pWrapperTable->m_Attachment_ReadFromFile = (PLib3MFAttachment_ReadFromFilePtr) dlsym(hLibrary, "lib3mf_attachment_readfromfile"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBeams == NULL) + if (pWrapperTable->m_Attachment_ReadFromFile == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBallCount = (PLib3MFBeamLattice_GetBallCountPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getballcount"); + pWrapperTable->m_Attachment_ReadFromCallback = (PLib3MFAttachment_ReadFromCallbackPtr) GetProcAddress(hLibrary, "lib3mf_attachment_readfromcallback"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBallCount = (PLib3MFBeamLattice_GetBallCountPtr) dlsym(hLibrary, "lib3mf_beamlattice_getballcount"); + pWrapperTable->m_Attachment_ReadFromCallback = (PLib3MFAttachment_ReadFromCallbackPtr) dlsym(hLibrary, "lib3mf_attachment_readfromcallback"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBallCount == NULL) + if (pWrapperTable->m_Attachment_ReadFromCallback == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBall = (PLib3MFBeamLattice_GetBallPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getball"); + pWrapperTable->m_Attachment_GetStreamSize = (PLib3MFAttachment_GetStreamSizePtr) GetProcAddress(hLibrary, "lib3mf_attachment_getstreamsize"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBall = (PLib3MFBeamLattice_GetBallPtr) dlsym(hLibrary, "lib3mf_beamlattice_getball"); + pWrapperTable->m_Attachment_GetStreamSize = (PLib3MFAttachment_GetStreamSizePtr) dlsym(hLibrary, "lib3mf_attachment_getstreamsize"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBall == NULL) + if (pWrapperTable->m_Attachment_GetStreamSize == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_AddBall = (PLib3MFBeamLattice_AddBallPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_addball"); + pWrapperTable->m_Attachment_WriteToBuffer = (PLib3MFAttachment_WriteToBufferPtr) GetProcAddress(hLibrary, "lib3mf_attachment_writetobuffer"); #else // _WIN32 - pWrapperTable->m_BeamLattice_AddBall = (PLib3MFBeamLattice_AddBallPtr) dlsym(hLibrary, "lib3mf_beamlattice_addball"); + pWrapperTable->m_Attachment_WriteToBuffer = (PLib3MFAttachment_WriteToBufferPtr) dlsym(hLibrary, "lib3mf_attachment_writetobuffer"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_AddBall == NULL) + if (pWrapperTable->m_Attachment_WriteToBuffer == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetBall = (PLib3MFBeamLattice_SetBallPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setball"); + pWrapperTable->m_Attachment_ReadFromBuffer = (PLib3MFAttachment_ReadFromBufferPtr) GetProcAddress(hLibrary, "lib3mf_attachment_readfrombuffer"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetBall = (PLib3MFBeamLattice_SetBallPtr) dlsym(hLibrary, "lib3mf_beamlattice_setball"); + pWrapperTable->m_Attachment_ReadFromBuffer = (PLib3MFAttachment_ReadFromBufferPtr) dlsym(hLibrary, "lib3mf_attachment_readfrombuffer"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetBall == NULL) + if (pWrapperTable->m_Attachment_ReadFromBuffer == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetBalls = (PLib3MFBeamLattice_SetBallsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setballs"); + pWrapperTable->m_Texture2D_GetAttachment = (PLib3MFTexture2D_GetAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_getattachment"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetBalls = (PLib3MFBeamLattice_SetBallsPtr) dlsym(hLibrary, "lib3mf_beamlattice_setballs"); + pWrapperTable->m_Texture2D_GetAttachment = (PLib3MFTexture2D_GetAttachmentPtr) dlsym(hLibrary, "lib3mf_texture2d_getattachment"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetBalls == NULL) + if (pWrapperTable->m_Texture2D_GetAttachment == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBalls = (PLib3MFBeamLattice_GetBallsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getballs"); + pWrapperTable->m_Texture2D_SetAttachment = (PLib3MFTexture2D_SetAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_setattachment"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBalls = (PLib3MFBeamLattice_GetBallsPtr) dlsym(hLibrary, "lib3mf_beamlattice_getballs"); + pWrapperTable->m_Texture2D_SetAttachment = (PLib3MFTexture2D_SetAttachmentPtr) dlsym(hLibrary, "lib3mf_texture2d_setattachment"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBalls == NULL) + if (pWrapperTable->m_Texture2D_SetAttachment == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBeamSetCount = (PLib3MFBeamLattice_GetBeamSetCountPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeamsetcount"); + pWrapperTable->m_Texture2D_GetContentType = (PLib3MFTexture2D_GetContentTypePtr) GetProcAddress(hLibrary, "lib3mf_texture2d_getcontenttype"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBeamSetCount = (PLib3MFBeamLattice_GetBeamSetCountPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeamsetcount"); + pWrapperTable->m_Texture2D_GetContentType = (PLib3MFTexture2D_GetContentTypePtr) dlsym(hLibrary, "lib3mf_texture2d_getcontenttype"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBeamSetCount == NULL) + if (pWrapperTable->m_Texture2D_GetContentType == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_AddBeamSet = (PLib3MFBeamLattice_AddBeamSetPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_addbeamset"); + pWrapperTable->m_Texture2D_SetContentType = (PLib3MFTexture2D_SetContentTypePtr) GetProcAddress(hLibrary, "lib3mf_texture2d_setcontenttype"); #else // _WIN32 - pWrapperTable->m_BeamLattice_AddBeamSet = (PLib3MFBeamLattice_AddBeamSetPtr) dlsym(hLibrary, "lib3mf_beamlattice_addbeamset"); + pWrapperTable->m_Texture2D_SetContentType = (PLib3MFTexture2D_SetContentTypePtr) dlsym(hLibrary, "lib3mf_texture2d_setcontenttype"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_AddBeamSet == NULL) + if (pWrapperTable->m_Texture2D_SetContentType == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBeamSet = (PLib3MFBeamLattice_GetBeamSetPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeamset"); + pWrapperTable->m_Texture2D_GetTileStyleUV = (PLib3MFTexture2D_GetTileStyleUVPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_gettilestyleuv"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBeamSet = (PLib3MFBeamLattice_GetBeamSetPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeamset"); + pWrapperTable->m_Texture2D_GetTileStyleUV = (PLib3MFTexture2D_GetTileStyleUVPtr) dlsym(hLibrary, "lib3mf_texture2d_gettilestyleuv"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBeamSet == NULL) + if (pWrapperTable->m_Texture2D_GetTileStyleUV == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_GetObjectResource = (PLib3MFComponent_GetObjectResourcePtr) GetProcAddress(hLibrary, "lib3mf_component_getobjectresource"); + pWrapperTable->m_Texture2D_SetTileStyleUV = (PLib3MFTexture2D_SetTileStyleUVPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_settilestyleuv"); #else // _WIN32 - pWrapperTable->m_Component_GetObjectResource = (PLib3MFComponent_GetObjectResourcePtr) dlsym(hLibrary, "lib3mf_component_getobjectresource"); + pWrapperTable->m_Texture2D_SetTileStyleUV = (PLib3MFTexture2D_SetTileStyleUVPtr) dlsym(hLibrary, "lib3mf_texture2d_settilestyleuv"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_GetObjectResource == NULL) + if (pWrapperTable->m_Texture2D_SetTileStyleUV == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_GetObjectResourceID = (PLib3MFComponent_GetObjectResourceIDPtr) GetProcAddress(hLibrary, "lib3mf_component_getobjectresourceid"); + pWrapperTable->m_Texture2D_GetFilter = (PLib3MFTexture2D_GetFilterPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_getfilter"); #else // _WIN32 - pWrapperTable->m_Component_GetObjectResourceID = (PLib3MFComponent_GetObjectResourceIDPtr) dlsym(hLibrary, "lib3mf_component_getobjectresourceid"); + pWrapperTable->m_Texture2D_GetFilter = (PLib3MFTexture2D_GetFilterPtr) dlsym(hLibrary, "lib3mf_texture2d_getfilter"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_GetObjectResourceID == NULL) + if (pWrapperTable->m_Texture2D_GetFilter == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_GetUUID = (PLib3MFComponent_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_component_getuuid"); + pWrapperTable->m_Texture2D_SetFilter = (PLib3MFTexture2D_SetFilterPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_setfilter"); #else // _WIN32 - pWrapperTable->m_Component_GetUUID = (PLib3MFComponent_GetUUIDPtr) dlsym(hLibrary, "lib3mf_component_getuuid"); + pWrapperTable->m_Texture2D_SetFilter = (PLib3MFTexture2D_SetFilterPtr) dlsym(hLibrary, "lib3mf_texture2d_setfilter"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_GetUUID == NULL) + if (pWrapperTable->m_Texture2D_SetFilter == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_SetUUID = (PLib3MFComponent_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_component_setuuid"); + pWrapperTable->m_BuildItem_GetObjectResource = (PLib3MFBuildItem_GetObjectResourcePtr) GetProcAddress(hLibrary, "lib3mf_builditem_getobjectresource"); #else // _WIN32 - pWrapperTable->m_Component_SetUUID = (PLib3MFComponent_SetUUIDPtr) dlsym(hLibrary, "lib3mf_component_setuuid"); + pWrapperTable->m_BuildItem_GetObjectResource = (PLib3MFBuildItem_GetObjectResourcePtr) dlsym(hLibrary, "lib3mf_builditem_getobjectresource"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_SetUUID == NULL) + if (pWrapperTable->m_BuildItem_GetObjectResource == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_HasTransform = (PLib3MFComponent_HasTransformPtr) GetProcAddress(hLibrary, "lib3mf_component_hastransform"); + pWrapperTable->m_BuildItem_GetUUID = (PLib3MFBuildItem_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getuuid"); #else // _WIN32 - pWrapperTable->m_Component_HasTransform = (PLib3MFComponent_HasTransformPtr) dlsym(hLibrary, "lib3mf_component_hastransform"); + pWrapperTable->m_BuildItem_GetUUID = (PLib3MFBuildItem_GetUUIDPtr) dlsym(hLibrary, "lib3mf_builditem_getuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_HasTransform == NULL) + if (pWrapperTable->m_BuildItem_GetUUID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_GetTransform = (PLib3MFComponent_GetTransformPtr) GetProcAddress(hLibrary, "lib3mf_component_gettransform"); + pWrapperTable->m_BuildItem_SetUUID = (PLib3MFBuildItem_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_builditem_setuuid"); #else // _WIN32 - pWrapperTable->m_Component_GetTransform = (PLib3MFComponent_GetTransformPtr) dlsym(hLibrary, "lib3mf_component_gettransform"); + pWrapperTable->m_BuildItem_SetUUID = (PLib3MFBuildItem_SetUUIDPtr) dlsym(hLibrary, "lib3mf_builditem_setuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_GetTransform == NULL) + if (pWrapperTable->m_BuildItem_SetUUID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_SetTransform = (PLib3MFComponent_SetTransformPtr) GetProcAddress(hLibrary, "lib3mf_component_settransform"); + pWrapperTable->m_BuildItem_GetObjectResourceID = (PLib3MFBuildItem_GetObjectResourceIDPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getobjectresourceid"); #else // _WIN32 - pWrapperTable->m_Component_SetTransform = (PLib3MFComponent_SetTransformPtr) dlsym(hLibrary, "lib3mf_component_settransform"); + pWrapperTable->m_BuildItem_GetObjectResourceID = (PLib3MFBuildItem_GetObjectResourceIDPtr) dlsym(hLibrary, "lib3mf_builditem_getobjectresourceid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_SetTransform == NULL) + if (pWrapperTable->m_BuildItem_GetObjectResourceID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ComponentsObject_AddComponent = (PLib3MFComponentsObject_AddComponentPtr) GetProcAddress(hLibrary, "lib3mf_componentsobject_addcomponent"); + pWrapperTable->m_BuildItem_HasObjectTransform = (PLib3MFBuildItem_HasObjectTransformPtr) GetProcAddress(hLibrary, "lib3mf_builditem_hasobjecttransform"); #else // _WIN32 - pWrapperTable->m_ComponentsObject_AddComponent = (PLib3MFComponentsObject_AddComponentPtr) dlsym(hLibrary, "lib3mf_componentsobject_addcomponent"); + pWrapperTable->m_BuildItem_HasObjectTransform = (PLib3MFBuildItem_HasObjectTransformPtr) dlsym(hLibrary, "lib3mf_builditem_hasobjecttransform"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ComponentsObject_AddComponent == NULL) + if (pWrapperTable->m_BuildItem_HasObjectTransform == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ComponentsObject_GetComponent = (PLib3MFComponentsObject_GetComponentPtr) GetProcAddress(hLibrary, "lib3mf_componentsobject_getcomponent"); + pWrapperTable->m_BuildItem_GetObjectTransform = (PLib3MFBuildItem_GetObjectTransformPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getobjecttransform"); #else // _WIN32 - pWrapperTable->m_ComponentsObject_GetComponent = (PLib3MFComponentsObject_GetComponentPtr) dlsym(hLibrary, "lib3mf_componentsobject_getcomponent"); + pWrapperTable->m_BuildItem_GetObjectTransform = (PLib3MFBuildItem_GetObjectTransformPtr) dlsym(hLibrary, "lib3mf_builditem_getobjecttransform"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ComponentsObject_GetComponent == NULL) + if (pWrapperTable->m_BuildItem_GetObjectTransform == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ComponentsObject_GetComponentCount = (PLib3MFComponentsObject_GetComponentCountPtr) GetProcAddress(hLibrary, "lib3mf_componentsobject_getcomponentcount"); + pWrapperTable->m_BuildItem_SetObjectTransform = (PLib3MFBuildItem_SetObjectTransformPtr) GetProcAddress(hLibrary, "lib3mf_builditem_setobjecttransform"); #else // _WIN32 - pWrapperTable->m_ComponentsObject_GetComponentCount = (PLib3MFComponentsObject_GetComponentCountPtr) dlsym(hLibrary, "lib3mf_componentsobject_getcomponentcount"); + pWrapperTable->m_BuildItem_SetObjectTransform = (PLib3MFBuildItem_SetObjectTransformPtr) dlsym(hLibrary, "lib3mf_builditem_setobjecttransform"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ComponentsObject_GetComponentCount == NULL) + if (pWrapperTable->m_BuildItem_SetObjectTransform == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_SetName = (PLib3MFBeamSet_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_beamset_setname"); + pWrapperTable->m_BuildItem_GetPartNumber = (PLib3MFBuildItem_GetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getpartnumber"); #else // _WIN32 - pWrapperTable->m_BeamSet_SetName = (PLib3MFBeamSet_SetNamePtr) dlsym(hLibrary, "lib3mf_beamset_setname"); + pWrapperTable->m_BuildItem_GetPartNumber = (PLib3MFBuildItem_GetPartNumberPtr) dlsym(hLibrary, "lib3mf_builditem_getpartnumber"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_SetName == NULL) + if (pWrapperTable->m_BuildItem_GetPartNumber == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_GetName = (PLib3MFBeamSet_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_beamset_getname"); + pWrapperTable->m_BuildItem_SetPartNumber = (PLib3MFBuildItem_SetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_builditem_setpartnumber"); #else // _WIN32 - pWrapperTable->m_BeamSet_GetName = (PLib3MFBeamSet_GetNamePtr) dlsym(hLibrary, "lib3mf_beamset_getname"); + pWrapperTable->m_BuildItem_SetPartNumber = (PLib3MFBuildItem_SetPartNumberPtr) dlsym(hLibrary, "lib3mf_builditem_setpartnumber"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_GetName == NULL) + if (pWrapperTable->m_BuildItem_SetPartNumber == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_SetIdentifier = (PLib3MFBeamSet_SetIdentifierPtr) GetProcAddress(hLibrary, "lib3mf_beamset_setidentifier"); + pWrapperTable->m_BuildItem_GetMetaDataGroup = (PLib3MFBuildItem_GetMetaDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getmetadatagroup"); #else // _WIN32 - pWrapperTable->m_BeamSet_SetIdentifier = (PLib3MFBeamSet_SetIdentifierPtr) dlsym(hLibrary, "lib3mf_beamset_setidentifier"); + pWrapperTable->m_BuildItem_GetMetaDataGroup = (PLib3MFBuildItem_GetMetaDataGroupPtr) dlsym(hLibrary, "lib3mf_builditem_getmetadatagroup"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_SetIdentifier == NULL) + if (pWrapperTable->m_BuildItem_GetMetaDataGroup == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_GetIdentifier = (PLib3MFBeamSet_GetIdentifierPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getidentifier"); + pWrapperTable->m_BuildItem_GetOutbox = (PLib3MFBuildItem_GetOutboxPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getoutbox"); #else // _WIN32 - pWrapperTable->m_BeamSet_GetIdentifier = (PLib3MFBeamSet_GetIdentifierPtr) dlsym(hLibrary, "lib3mf_beamset_getidentifier"); + pWrapperTable->m_BuildItem_GetOutbox = (PLib3MFBuildItem_GetOutboxPtr) dlsym(hLibrary, "lib3mf_builditem_getoutbox"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_GetIdentifier == NULL) + if (pWrapperTable->m_BuildItem_GetOutbox == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_GetReferenceCount = (PLib3MFBeamSet_GetReferenceCountPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getreferencecount"); + pWrapperTable->m_BuildItemIterator_MoveNext = (PLib3MFBuildItemIterator_MoveNextPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_movenext"); #else // _WIN32 - pWrapperTable->m_BeamSet_GetReferenceCount = (PLib3MFBeamSet_GetReferenceCountPtr) dlsym(hLibrary, "lib3mf_beamset_getreferencecount"); + pWrapperTable->m_BuildItemIterator_MoveNext = (PLib3MFBuildItemIterator_MoveNextPtr) dlsym(hLibrary, "lib3mf_builditemiterator_movenext"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_GetReferenceCount == NULL) + if (pWrapperTable->m_BuildItemIterator_MoveNext == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_SetReferences = (PLib3MFBeamSet_SetReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_setreferences"); + pWrapperTable->m_BuildItemIterator_MovePrevious = (PLib3MFBuildItemIterator_MovePreviousPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_moveprevious"); #else // _WIN32 - pWrapperTable->m_BeamSet_SetReferences = (PLib3MFBeamSet_SetReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_setreferences"); + pWrapperTable->m_BuildItemIterator_MovePrevious = (PLib3MFBuildItemIterator_MovePreviousPtr) dlsym(hLibrary, "lib3mf_builditemiterator_moveprevious"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_SetReferences == NULL) + if (pWrapperTable->m_BuildItemIterator_MovePrevious == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_GetReferences = (PLib3MFBeamSet_GetReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getreferences"); + pWrapperTable->m_BuildItemIterator_GetCurrent = (PLib3MFBuildItemIterator_GetCurrentPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_getcurrent"); #else // _WIN32 - pWrapperTable->m_BeamSet_GetReferences = (PLib3MFBeamSet_GetReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_getreferences"); + pWrapperTable->m_BuildItemIterator_GetCurrent = (PLib3MFBuildItemIterator_GetCurrentPtr) dlsym(hLibrary, "lib3mf_builditemiterator_getcurrent"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_GetReferences == NULL) + if (pWrapperTable->m_BuildItemIterator_GetCurrent == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_GetBallReferenceCount = (PLib3MFBeamSet_GetBallReferenceCountPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getballreferencecount"); + pWrapperTable->m_BuildItemIterator_Clone = (PLib3MFBuildItemIterator_ClonePtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_clone"); #else // _WIN32 - pWrapperTable->m_BeamSet_GetBallReferenceCount = (PLib3MFBeamSet_GetBallReferenceCountPtr) dlsym(hLibrary, "lib3mf_beamset_getballreferencecount"); + pWrapperTable->m_BuildItemIterator_Clone = (PLib3MFBuildItemIterator_ClonePtr) dlsym(hLibrary, "lib3mf_builditemiterator_clone"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_GetBallReferenceCount == NULL) + if (pWrapperTable->m_BuildItemIterator_Clone == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_SetBallReferences = (PLib3MFBeamSet_SetBallReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_setballreferences"); + pWrapperTable->m_BuildItemIterator_Count = (PLib3MFBuildItemIterator_CountPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_count"); #else // _WIN32 - pWrapperTable->m_BeamSet_SetBallReferences = (PLib3MFBeamSet_SetBallReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_setballreferences"); + pWrapperTable->m_BuildItemIterator_Count = (PLib3MFBuildItemIterator_CountPtr) dlsym(hLibrary, "lib3mf_builditemiterator_count"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_SetBallReferences == NULL) + if (pWrapperTable->m_BuildItemIterator_Count == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_GetBallReferences = (PLib3MFBeamSet_GetBallReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getballreferences"); + pWrapperTable->m_Slice_SetVertices = (PLib3MFSlice_SetVerticesPtr) GetProcAddress(hLibrary, "lib3mf_slice_setvertices"); #else // _WIN32 - pWrapperTable->m_BeamSet_GetBallReferences = (PLib3MFBeamSet_GetBallReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_getballreferences"); + pWrapperTable->m_Slice_SetVertices = (PLib3MFSlice_SetVerticesPtr) dlsym(hLibrary, "lib3mf_slice_setvertices"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_GetBallReferences == NULL) + if (pWrapperTable->m_Slice_SetVertices == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetCount = (PLib3MFBaseMaterialGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getcount"); + pWrapperTable->m_Slice_GetVertices = (PLib3MFSlice_GetVerticesPtr) GetProcAddress(hLibrary, "lib3mf_slice_getvertices"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetCount = (PLib3MFBaseMaterialGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getcount"); + pWrapperTable->m_Slice_GetVertices = (PLib3MFSlice_GetVerticesPtr) dlsym(hLibrary, "lib3mf_slice_getvertices"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_GetCount == NULL) + if (pWrapperTable->m_Slice_GetVertices == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs = (PLib3MFBaseMaterialGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getallpropertyids"); + pWrapperTable->m_Slice_GetVertexCount = (PLib3MFSlice_GetVertexCountPtr) GetProcAddress(hLibrary, "lib3mf_slice_getvertexcount"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs = (PLib3MFBaseMaterialGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getallpropertyids"); + pWrapperTable->m_Slice_GetVertexCount = (PLib3MFSlice_GetVertexCountPtr) dlsym(hLibrary, "lib3mf_slice_getvertexcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs == NULL) + if (pWrapperTable->m_Slice_GetVertexCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_AddMaterial = (PLib3MFBaseMaterialGroup_AddMaterialPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_addmaterial"); + pWrapperTable->m_Slice_AddPolygon = (PLib3MFSlice_AddPolygonPtr) GetProcAddress(hLibrary, "lib3mf_slice_addpolygon"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_AddMaterial = (PLib3MFBaseMaterialGroup_AddMaterialPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_addmaterial"); + pWrapperTable->m_Slice_AddPolygon = (PLib3MFSlice_AddPolygonPtr) dlsym(hLibrary, "lib3mf_slice_addpolygon"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_AddMaterial == NULL) + if (pWrapperTable->m_Slice_AddPolygon == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_RemoveMaterial = (PLib3MFBaseMaterialGroup_RemoveMaterialPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_removematerial"); + pWrapperTable->m_Slice_GetPolygonCount = (PLib3MFSlice_GetPolygonCountPtr) GetProcAddress(hLibrary, "lib3mf_slice_getpolygoncount"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_RemoveMaterial = (PLib3MFBaseMaterialGroup_RemoveMaterialPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_removematerial"); + pWrapperTable->m_Slice_GetPolygonCount = (PLib3MFSlice_GetPolygonCountPtr) dlsym(hLibrary, "lib3mf_slice_getpolygoncount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_RemoveMaterial == NULL) + if (pWrapperTable->m_Slice_GetPolygonCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetName = (PLib3MFBaseMaterialGroup_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getname"); + pWrapperTable->m_Slice_SetPolygonIndices = (PLib3MFSlice_SetPolygonIndicesPtr) GetProcAddress(hLibrary, "lib3mf_slice_setpolygonindices"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetName = (PLib3MFBaseMaterialGroup_GetNamePtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getname"); + pWrapperTable->m_Slice_SetPolygonIndices = (PLib3MFSlice_SetPolygonIndicesPtr) dlsym(hLibrary, "lib3mf_slice_setpolygonindices"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_GetName == NULL) + if (pWrapperTable->m_Slice_SetPolygonIndices == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_SetName = (PLib3MFBaseMaterialGroup_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_setname"); + pWrapperTable->m_Slice_GetPolygonIndices = (PLib3MFSlice_GetPolygonIndicesPtr) GetProcAddress(hLibrary, "lib3mf_slice_getpolygonindices"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_SetName = (PLib3MFBaseMaterialGroup_SetNamePtr) dlsym(hLibrary, "lib3mf_basematerialgroup_setname"); + pWrapperTable->m_Slice_GetPolygonIndices = (PLib3MFSlice_GetPolygonIndicesPtr) dlsym(hLibrary, "lib3mf_slice_getpolygonindices"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_SetName == NULL) + if (pWrapperTable->m_Slice_GetPolygonIndices == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_SetDisplayColor = (PLib3MFBaseMaterialGroup_SetDisplayColorPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_setdisplaycolor"); + pWrapperTable->m_Slice_GetPolygonIndexCount = (PLib3MFSlice_GetPolygonIndexCountPtr) GetProcAddress(hLibrary, "lib3mf_slice_getpolygonindexcount"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_SetDisplayColor = (PLib3MFBaseMaterialGroup_SetDisplayColorPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_setdisplaycolor"); + pWrapperTable->m_Slice_GetPolygonIndexCount = (PLib3MFSlice_GetPolygonIndexCountPtr) dlsym(hLibrary, "lib3mf_slice_getpolygonindexcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_SetDisplayColor == NULL) + if (pWrapperTable->m_Slice_GetPolygonIndexCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetDisplayColor = (PLib3MFBaseMaterialGroup_GetDisplayColorPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getdisplaycolor"); + pWrapperTable->m_Slice_GetZTop = (PLib3MFSlice_GetZTopPtr) GetProcAddress(hLibrary, "lib3mf_slice_getztop"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetDisplayColor = (PLib3MFBaseMaterialGroup_GetDisplayColorPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getdisplaycolor"); + pWrapperTable->m_Slice_GetZTop = (PLib3MFSlice_GetZTopPtr) dlsym(hLibrary, "lib3mf_slice_getztop"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_GetDisplayColor == NULL) + if (pWrapperTable->m_Slice_GetZTop == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroup_GetCount = (PLib3MFColorGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_getcount"); + pWrapperTable->m_ToolpathProfile_GetUUID = (PLib3MFToolpathProfile_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getuuid"); #else // _WIN32 - pWrapperTable->m_ColorGroup_GetCount = (PLib3MFColorGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_colorgroup_getcount"); + pWrapperTable->m_ToolpathProfile_GetUUID = (PLib3MFToolpathProfile_GetUUIDPtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroup_GetCount == NULL) + if (pWrapperTable->m_ToolpathProfile_GetUUID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroup_GetAllPropertyIDs = (PLib3MFColorGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_getallpropertyids"); + pWrapperTable->m_ToolpathProfile_GetName = (PLib3MFToolpathProfile_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getname"); #else // _WIN32 - pWrapperTable->m_ColorGroup_GetAllPropertyIDs = (PLib3MFColorGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_colorgroup_getallpropertyids"); + pWrapperTable->m_ToolpathProfile_GetName = (PLib3MFToolpathProfile_GetNamePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroup_GetAllPropertyIDs == NULL) + if (pWrapperTable->m_ToolpathProfile_GetName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroup_AddColor = (PLib3MFColorGroup_AddColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_addcolor"); + pWrapperTable->m_ToolpathProfile_GetParameterCount = (PLib3MFToolpathProfile_GetParameterCountPtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparametercount"); #else // _WIN32 - pWrapperTable->m_ColorGroup_AddColor = (PLib3MFColorGroup_AddColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_addcolor"); + pWrapperTable->m_ToolpathProfile_GetParameterCount = (PLib3MFToolpathProfile_GetParameterCountPtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparametercount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroup_AddColor == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroup_RemoveColor = (PLib3MFColorGroup_RemoveColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_removecolor"); + pWrapperTable->m_ToolpathProfile_GetParameterName = (PLib3MFToolpathProfile_GetParameterNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparametername"); #else // _WIN32 - pWrapperTable->m_ColorGroup_RemoveColor = (PLib3MFColorGroup_RemoveColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_removecolor"); + pWrapperTable->m_ToolpathProfile_GetParameterName = (PLib3MFToolpathProfile_GetParameterNamePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparametername"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroup_RemoveColor == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroup_SetColor = (PLib3MFColorGroup_SetColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_setcolor"); + pWrapperTable->m_ToolpathProfile_GetParameterNameSpace = (PLib3MFToolpathProfile_GetParameterNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameternamespace"); #else // _WIN32 - pWrapperTable->m_ColorGroup_SetColor = (PLib3MFColorGroup_SetColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_setcolor"); + pWrapperTable->m_ToolpathProfile_GetParameterNameSpace = (PLib3MFToolpathProfile_GetParameterNameSpacePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameternamespace"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroup_SetColor == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterNameSpace == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroup_GetColor = (PLib3MFColorGroup_GetColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_getcolor"); + pWrapperTable->m_ToolpathProfile_HasParameterValue = (PLib3MFToolpathProfile_HasParameterValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_hasparametervalue"); #else // _WIN32 - pWrapperTable->m_ColorGroup_GetColor = (PLib3MFColorGroup_GetColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_getcolor"); + pWrapperTable->m_ToolpathProfile_HasParameterValue = (PLib3MFToolpathProfile_HasParameterValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_hasparametervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroup_GetColor == NULL) + if (pWrapperTable->m_ToolpathProfile_HasParameterValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroup_GetCount = (PLib3MFTexture2DGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_getcount"); + pWrapperTable->m_ToolpathProfile_GetParameterValue = (PLib3MFToolpathProfile_GetParameterValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparametervalue"); #else // _WIN32 - pWrapperTable->m_Texture2DGroup_GetCount = (PLib3MFTexture2DGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_getcount"); + pWrapperTable->m_ToolpathProfile_GetParameterValue = (PLib3MFToolpathProfile_GetParameterValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparametervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroup_GetCount == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs = (PLib3MFTexture2DGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_getallpropertyids"); + pWrapperTable->m_ToolpathProfile_GetParameterValueDef = (PLib3MFToolpathProfile_GetParameterValueDefPtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparametervaluedef"); #else // _WIN32 - pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs = (PLib3MFTexture2DGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_getallpropertyids"); + pWrapperTable->m_ToolpathProfile_GetParameterValueDef = (PLib3MFToolpathProfile_GetParameterValueDefPtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparametervaluedef"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterValueDef == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroup_AddTex2Coord = (PLib3MFTexture2DGroup_AddTex2CoordPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_addtex2coord"); + pWrapperTable->m_ToolpathProfile_GetParameterDoubleValue = (PLib3MFToolpathProfile_GetParameterDoubleValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameterdoublevalue"); #else // _WIN32 - pWrapperTable->m_Texture2DGroup_AddTex2Coord = (PLib3MFTexture2DGroup_AddTex2CoordPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_addtex2coord"); + pWrapperTable->m_ToolpathProfile_GetParameterDoubleValue = (PLib3MFToolpathProfile_GetParameterDoubleValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameterdoublevalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroup_AddTex2Coord == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterDoubleValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroup_GetTex2Coord = (PLib3MFTexture2DGroup_GetTex2CoordPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_gettex2coord"); + pWrapperTable->m_ToolpathProfile_GetParameterDoubleValueDef = (PLib3MFToolpathProfile_GetParameterDoubleValueDefPtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameterdoublevaluedef"); #else // _WIN32 - pWrapperTable->m_Texture2DGroup_GetTex2Coord = (PLib3MFTexture2DGroup_GetTex2CoordPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_gettex2coord"); + pWrapperTable->m_ToolpathProfile_GetParameterDoubleValueDef = (PLib3MFToolpathProfile_GetParameterDoubleValueDefPtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameterdoublevaluedef"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroup_GetTex2Coord == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterDoubleValueDef == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroup_RemoveTex2Coord = (PLib3MFTexture2DGroup_RemoveTex2CoordPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_removetex2coord"); + pWrapperTable->m_ToolpathProfile_GetParameterIntegerValue = (PLib3MFToolpathProfile_GetParameterIntegerValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameterintegervalue"); #else // _WIN32 - pWrapperTable->m_Texture2DGroup_RemoveTex2Coord = (PLib3MFTexture2DGroup_RemoveTex2CoordPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_removetex2coord"); + pWrapperTable->m_ToolpathProfile_GetParameterIntegerValue = (PLib3MFToolpathProfile_GetParameterIntegerValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameterintegervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroup_RemoveTex2Coord == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterIntegerValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroup_GetTexture2D = (PLib3MFTexture2DGroup_GetTexture2DPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_gettexture2d"); + pWrapperTable->m_ToolpathProfile_GetParameterIntegerValueDef = (PLib3MFToolpathProfile_GetParameterIntegerValueDefPtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameterintegervaluedef"); #else // _WIN32 - pWrapperTable->m_Texture2DGroup_GetTexture2D = (PLib3MFTexture2DGroup_GetTexture2DPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_gettexture2d"); + pWrapperTable->m_ToolpathProfile_GetParameterIntegerValueDef = (PLib3MFToolpathProfile_GetParameterIntegerValueDefPtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameterintegervaluedef"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroup_GetTexture2D == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterIntegerValueDef == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterials_GetCount = (PLib3MFCompositeMaterials_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getcount"); + pWrapperTable->m_ToolpathProfile_GetParameterBoolValue = (PLib3MFToolpathProfile_GetParameterBoolValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameterboolvalue"); #else // _WIN32 - pWrapperTable->m_CompositeMaterials_GetCount = (PLib3MFCompositeMaterials_GetCountPtr) dlsym(hLibrary, "lib3mf_compositematerials_getcount"); + pWrapperTable->m_ToolpathProfile_GetParameterBoolValue = (PLib3MFToolpathProfile_GetParameterBoolValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameterboolvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterials_GetCount == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterBoolValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs = (PLib3MFCompositeMaterials_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getallpropertyids"); + pWrapperTable->m_ToolpathProfile_GetParameterBoolValueDef = (PLib3MFToolpathProfile_GetParameterBoolValueDefPtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameterboolvaluedef"); #else // _WIN32 - pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs = (PLib3MFCompositeMaterials_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_compositematerials_getallpropertyids"); + pWrapperTable->m_ToolpathProfile_GetParameterBoolValueDef = (PLib3MFToolpathProfile_GetParameterBoolValueDefPtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameterboolvaluedef"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterBoolValueDef == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup = (PLib3MFCompositeMaterials_GetBaseMaterialGroupPtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getbasematerialgroup"); + pWrapperTable->m_ToolpathProfile_SetName = (PLib3MFToolpathProfile_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_setname"); #else // _WIN32 - pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup = (PLib3MFCompositeMaterials_GetBaseMaterialGroupPtr) dlsym(hLibrary, "lib3mf_compositematerials_getbasematerialgroup"); + pWrapperTable->m_ToolpathProfile_SetName = (PLib3MFToolpathProfile_SetNamePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_setname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup == NULL) + if (pWrapperTable->m_ToolpathProfile_SetName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterials_AddComposite = (PLib3MFCompositeMaterials_AddCompositePtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_addcomposite"); + pWrapperTable->m_ToolpathProfile_SetParameterValue = (PLib3MFToolpathProfile_SetParameterValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_setparametervalue"); #else // _WIN32 - pWrapperTable->m_CompositeMaterials_AddComposite = (PLib3MFCompositeMaterials_AddCompositePtr) dlsym(hLibrary, "lib3mf_compositematerials_addcomposite"); + pWrapperTable->m_ToolpathProfile_SetParameterValue = (PLib3MFToolpathProfile_SetParameterValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_setparametervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterials_AddComposite == NULL) + if (pWrapperTable->m_ToolpathProfile_SetParameterValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterials_RemoveComposite = (PLib3MFCompositeMaterials_RemoveCompositePtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_removecomposite"); + pWrapperTable->m_ToolpathProfile_SetParameterDoubleValue = (PLib3MFToolpathProfile_SetParameterDoubleValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_setparameterdoublevalue"); #else // _WIN32 - pWrapperTable->m_CompositeMaterials_RemoveComposite = (PLib3MFCompositeMaterials_RemoveCompositePtr) dlsym(hLibrary, "lib3mf_compositematerials_removecomposite"); + pWrapperTable->m_ToolpathProfile_SetParameterDoubleValue = (PLib3MFToolpathProfile_SetParameterDoubleValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_setparameterdoublevalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterials_RemoveComposite == NULL) + if (pWrapperTable->m_ToolpathProfile_SetParameterDoubleValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterials_GetComposite = (PLib3MFCompositeMaterials_GetCompositePtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getcomposite"); + pWrapperTable->m_ToolpathProfile_SetParameterIntegerValue = (PLib3MFToolpathProfile_SetParameterIntegerValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_setparameterintegervalue"); #else // _WIN32 - pWrapperTable->m_CompositeMaterials_GetComposite = (PLib3MFCompositeMaterials_GetCompositePtr) dlsym(hLibrary, "lib3mf_compositematerials_getcomposite"); + pWrapperTable->m_ToolpathProfile_SetParameterIntegerValue = (PLib3MFToolpathProfile_SetParameterIntegerValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_setparameterintegervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterials_GetComposite == NULL) + if (pWrapperTable->m_ToolpathProfile_SetParameterIntegerValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetCount = (PLib3MFMultiPropertyGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getcount"); + pWrapperTable->m_ToolpathProfile_SetParameterBoolValue = (PLib3MFToolpathProfile_SetParameterBoolValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_setparameterboolvalue"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetCount = (PLib3MFMultiPropertyGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getcount"); + pWrapperTable->m_ToolpathProfile_SetParameterBoolValue = (PLib3MFToolpathProfile_SetParameterBoolValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_setparameterboolvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_GetCount == NULL) + if (pWrapperTable->m_ToolpathProfile_SetParameterBoolValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs = (PLib3MFMultiPropertyGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getallpropertyids"); + pWrapperTable->m_ToolpathLayerReader_GetLayerDataUUID = (PLib3MFToolpathLayerReader_GetLayerDataUUIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getlayerdatauuid"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs = (PLib3MFMultiPropertyGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getallpropertyids"); + pWrapperTable->m_ToolpathLayerReader_GetLayerDataUUID = (PLib3MFToolpathLayerReader_GetLayerDataUUIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getlayerdatauuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetLayerDataUUID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_AddMultiProperty = (PLib3MFMultiPropertyGroup_AddMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_addmultiproperty"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentCount = (PLib3MFToolpathLayerReader_GetSegmentCountPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentcount"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_AddMultiProperty = (PLib3MFMultiPropertyGroup_AddMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_addmultiproperty"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentCount = (PLib3MFToolpathLayerReader_GetSegmentCountPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_AddMultiProperty == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_SetMultiProperty = (PLib3MFMultiPropertyGroup_SetMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_setmultiproperty"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentInfo = (PLib3MFToolpathLayerReader_GetSegmentInfoPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentinfo"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_SetMultiProperty = (PLib3MFMultiPropertyGroup_SetMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_setmultiproperty"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentInfo = (PLib3MFToolpathLayerReader_GetSegmentInfoPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentinfo"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_SetMultiProperty == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentInfo == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetMultiProperty = (PLib3MFMultiPropertyGroup_GetMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getmultiproperty"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentProfile = (PLib3MFToolpathLayerReader_GetSegmentProfilePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentprofile"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetMultiProperty = (PLib3MFMultiPropertyGroup_GetMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getmultiproperty"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentProfile = (PLib3MFToolpathLayerReader_GetSegmentProfilePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentprofile"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_GetMultiProperty == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentProfile == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty = (PLib3MFMultiPropertyGroup_RemoveMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_removemultiproperty"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentProfileUUID = (PLib3MFToolpathLayerReader_GetSegmentProfileUUIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentprofileuuid"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty = (PLib3MFMultiPropertyGroup_RemoveMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_removemultiproperty"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentProfileUUID = (PLib3MFToolpathLayerReader_GetSegmentProfileUUIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentprofileuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentProfileUUID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetLayerCount = (PLib3MFMultiPropertyGroup_GetLayerCountPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getlayercount"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentPart = (PLib3MFToolpathLayerReader_GetSegmentPartPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpart"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetLayerCount = (PLib3MFMultiPropertyGroup_GetLayerCountPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getlayercount"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentPart = (PLib3MFToolpathLayerReader_GetSegmentPartPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpart"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_GetLayerCount == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentPart == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_AddLayer = (PLib3MFMultiPropertyGroup_AddLayerPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_addlayer"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentPartUUID = (PLib3MFToolpathLayerReader_GetSegmentPartUUIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpartuuid"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_AddLayer = (PLib3MFMultiPropertyGroup_AddLayerPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_addlayer"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentPartUUID = (PLib3MFToolpathLayerReader_GetSegmentPartUUIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpartuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_AddLayer == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentPartUUID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetLayer = (PLib3MFMultiPropertyGroup_GetLayerPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getlayer"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentLocalPartID = (PLib3MFToolpathLayerReader_GetSegmentLocalPartIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentlocalpartid"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetLayer = (PLib3MFMultiPropertyGroup_GetLayerPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getlayer"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentLocalPartID = (PLib3MFToolpathLayerReader_GetSegmentLocalPartIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentlocalpartid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_GetLayer == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentLocalPartID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_RemoveLayer = (PLib3MFMultiPropertyGroup_RemoveLayerPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_removelayer"); + pWrapperTable->m_ToolpathLayerReader_GetPartUUIDByLocalPartID = (PLib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getpartuuidbylocalpartid"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_RemoveLayer = (PLib3MFMultiPropertyGroup_RemoveLayerPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_removelayer"); + pWrapperTable->m_ToolpathLayerReader_GetPartUUIDByLocalPartID = (PLib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getpartuuidbylocalpartid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_RemoveLayer == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetPartUUIDByLocalPartID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_GetPath = (PLib3MFAttachment_GetPathPtr) GetProcAddress(hLibrary, "lib3mf_attachment_getpath"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentPointData = (PLib3MFToolpathLayerReader_GetSegmentPointDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpointdata"); #else // _WIN32 - pWrapperTable->m_Attachment_GetPath = (PLib3MFAttachment_GetPathPtr) dlsym(hLibrary, "lib3mf_attachment_getpath"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentPointData = (PLib3MFToolpathLayerReader_GetSegmentPointDataPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpointdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_GetPath == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentPointData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_SetPath = (PLib3MFAttachment_SetPathPtr) GetProcAddress(hLibrary, "lib3mf_attachment_setpath"); + pWrapperTable->m_ToolpathLayerReader_FindAttributeInfoByName = (PLib3MFToolpathLayerReader_FindAttributeInfoByNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_findattributeinfobyname"); #else // _WIN32 - pWrapperTable->m_Attachment_SetPath = (PLib3MFAttachment_SetPathPtr) dlsym(hLibrary, "lib3mf_attachment_setpath"); + pWrapperTable->m_ToolpathLayerReader_FindAttributeInfoByName = (PLib3MFToolpathLayerReader_FindAttributeInfoByNamePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_findattributeinfobyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_SetPath == NULL) + if (pWrapperTable->m_ToolpathLayerReader_FindAttributeInfoByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_PackagePart = (PLib3MFAttachment_PackagePartPtr) GetProcAddress(hLibrary, "lib3mf_attachment_packagepart"); + pWrapperTable->m_ToolpathLayerReader_FindAttributeIDByName = (PLib3MFToolpathLayerReader_FindAttributeIDByNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_findattributeidbyname"); #else // _WIN32 - pWrapperTable->m_Attachment_PackagePart = (PLib3MFAttachment_PackagePartPtr) dlsym(hLibrary, "lib3mf_attachment_packagepart"); + pWrapperTable->m_ToolpathLayerReader_FindAttributeIDByName = (PLib3MFToolpathLayerReader_FindAttributeIDByNamePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_findattributeidbyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_PackagePart == NULL) + if (pWrapperTable->m_ToolpathLayerReader_FindAttributeIDByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_GetRelationShipType = (PLib3MFAttachment_GetRelationShipTypePtr) GetProcAddress(hLibrary, "lib3mf_attachment_getrelationshiptype"); + pWrapperTable->m_ToolpathLayerReader_FindAttributeValueByName = (PLib3MFToolpathLayerReader_FindAttributeValueByNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_findattributevaluebyname"); #else // _WIN32 - pWrapperTable->m_Attachment_GetRelationShipType = (PLib3MFAttachment_GetRelationShipTypePtr) dlsym(hLibrary, "lib3mf_attachment_getrelationshiptype"); + pWrapperTable->m_ToolpathLayerReader_FindAttributeValueByName = (PLib3MFToolpathLayerReader_FindAttributeValueByNamePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_findattributevaluebyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_GetRelationShipType == NULL) + if (pWrapperTable->m_ToolpathLayerReader_FindAttributeValueByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_SetRelationShipType = (PLib3MFAttachment_SetRelationShipTypePtr) GetProcAddress(hLibrary, "lib3mf_attachment_setrelationshiptype"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByID = (PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentintegerattributebyid"); #else // _WIN32 - pWrapperTable->m_Attachment_SetRelationShipType = (PLib3MFAttachment_SetRelationShipTypePtr) dlsym(hLibrary, "lib3mf_attachment_setrelationshiptype"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByID = (PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentintegerattributebyid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_SetRelationShipType == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_WriteToFile = (PLib3MFAttachment_WriteToFilePtr) GetProcAddress(hLibrary, "lib3mf_attachment_writetofile"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByName = (PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentintegerattributebyname"); #else // _WIN32 - pWrapperTable->m_Attachment_WriteToFile = (PLib3MFAttachment_WriteToFilePtr) dlsym(hLibrary, "lib3mf_attachment_writetofile"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByName = (PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByNamePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentintegerattributebyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_WriteToFile == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_ReadFromFile = (PLib3MFAttachment_ReadFromFilePtr) GetProcAddress(hLibrary, "lib3mf_attachment_readfromfile"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByID = (PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid"); #else // _WIN32 - pWrapperTable->m_Attachment_ReadFromFile = (PLib3MFAttachment_ReadFromFilePtr) dlsym(hLibrary, "lib3mf_attachment_readfromfile"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByID = (PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_ReadFromFile == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_ReadFromCallback = (PLib3MFAttachment_ReadFromCallbackPtr) GetProcAddress(hLibrary, "lib3mf_attachment_readfromcallback"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByName = (PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname"); #else // _WIN32 - pWrapperTable->m_Attachment_ReadFromCallback = (PLib3MFAttachment_ReadFromCallbackPtr) dlsym(hLibrary, "lib3mf_attachment_readfromcallback"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByName = (PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByNamePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_ReadFromCallback == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_GetStreamSize = (PLib3MFAttachment_GetStreamSizePtr) GetProcAddress(hLibrary, "lib3mf_attachment_getstreamsize"); + pWrapperTable->m_ToolpathLayerReader_GetCustomDataCount = (PLib3MFToolpathLayerReader_GetCustomDataCountPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getcustomdatacount"); #else // _WIN32 - pWrapperTable->m_Attachment_GetStreamSize = (PLib3MFAttachment_GetStreamSizePtr) dlsym(hLibrary, "lib3mf_attachment_getstreamsize"); + pWrapperTable->m_ToolpathLayerReader_GetCustomDataCount = (PLib3MFToolpathLayerReader_GetCustomDataCountPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getcustomdatacount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_GetStreamSize == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetCustomDataCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_WriteToBuffer = (PLib3MFAttachment_WriteToBufferPtr) GetProcAddress(hLibrary, "lib3mf_attachment_writetobuffer"); + pWrapperTable->m_ToolpathLayerReader_GetCustomData = (PLib3MFToolpathLayerReader_GetCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getcustomdata"); #else // _WIN32 - pWrapperTable->m_Attachment_WriteToBuffer = (PLib3MFAttachment_WriteToBufferPtr) dlsym(hLibrary, "lib3mf_attachment_writetobuffer"); + pWrapperTable->m_ToolpathLayerReader_GetCustomData = (PLib3MFToolpathLayerReader_GetCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getcustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_WriteToBuffer == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetCustomData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_ReadFromBuffer = (PLib3MFAttachment_ReadFromBufferPtr) GetProcAddress(hLibrary, "lib3mf_attachment_readfrombuffer"); + pWrapperTable->m_ToolpathLayerReader_GetCustomDataName = (PLib3MFToolpathLayerReader_GetCustomDataNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getcustomdataname"); #else // _WIN32 - pWrapperTable->m_Attachment_ReadFromBuffer = (PLib3MFAttachment_ReadFromBufferPtr) dlsym(hLibrary, "lib3mf_attachment_readfrombuffer"); + pWrapperTable->m_ToolpathLayerReader_GetCustomDataName = (PLib3MFToolpathLayerReader_GetCustomDataNamePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getcustomdataname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_ReadFromBuffer == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetCustomDataName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_GetAttachment = (PLib3MFTexture2D_GetAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_getattachment"); + pWrapperTable->m_ToolpathLayerData_GetLayerDataUUID = (PLib3MFToolpathLayerData_GetLayerDataUUIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_getlayerdatauuid"); #else // _WIN32 - pWrapperTable->m_Texture2D_GetAttachment = (PLib3MFTexture2D_GetAttachmentPtr) dlsym(hLibrary, "lib3mf_texture2d_getattachment"); + pWrapperTable->m_ToolpathLayerData_GetLayerDataUUID = (PLib3MFToolpathLayerData_GetLayerDataUUIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_getlayerdatauuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_GetAttachment == NULL) + if (pWrapperTable->m_ToolpathLayerData_GetLayerDataUUID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_SetAttachment = (PLib3MFTexture2D_SetAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_setattachment"); + pWrapperTable->m_ToolpathLayerData_RegisterProfile = (PLib3MFToolpathLayerData_RegisterProfilePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_registerprofile"); #else // _WIN32 - pWrapperTable->m_Texture2D_SetAttachment = (PLib3MFTexture2D_SetAttachmentPtr) dlsym(hLibrary, "lib3mf_texture2d_setattachment"); + pWrapperTable->m_ToolpathLayerData_RegisterProfile = (PLib3MFToolpathLayerData_RegisterProfilePtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_registerprofile"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_SetAttachment == NULL) + if (pWrapperTable->m_ToolpathLayerData_RegisterProfile == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_GetContentType = (PLib3MFTexture2D_GetContentTypePtr) GetProcAddress(hLibrary, "lib3mf_texture2d_getcontenttype"); + pWrapperTable->m_ToolpathLayerData_RegisterBuildItem = (PLib3MFToolpathLayerData_RegisterBuildItemPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_registerbuilditem"); #else // _WIN32 - pWrapperTable->m_Texture2D_GetContentType = (PLib3MFTexture2D_GetContentTypePtr) dlsym(hLibrary, "lib3mf_texture2d_getcontenttype"); + pWrapperTable->m_ToolpathLayerData_RegisterBuildItem = (PLib3MFToolpathLayerData_RegisterBuildItemPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_registerbuilditem"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_GetContentType == NULL) + if (pWrapperTable->m_ToolpathLayerData_RegisterBuildItem == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_SetContentType = (PLib3MFTexture2D_SetContentTypePtr) GetProcAddress(hLibrary, "lib3mf_texture2d_setcontenttype"); + pWrapperTable->m_ToolpathLayerData_SetSegmentAttribute = (PLib3MFToolpathLayerData_SetSegmentAttributePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_setsegmentattribute"); #else // _WIN32 - pWrapperTable->m_Texture2D_SetContentType = (PLib3MFTexture2D_SetContentTypePtr) dlsym(hLibrary, "lib3mf_texture2d_setcontenttype"); + pWrapperTable->m_ToolpathLayerData_SetSegmentAttribute = (PLib3MFToolpathLayerData_SetSegmentAttributePtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_setsegmentattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_SetContentType == NULL) + if (pWrapperTable->m_ToolpathLayerData_SetSegmentAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_GetTileStyleUV = (PLib3MFTexture2D_GetTileStyleUVPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_gettilestyleuv"); + pWrapperTable->m_ToolpathLayerData_ClearSegmentAttributes = (PLib3MFToolpathLayerData_ClearSegmentAttributesPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_clearsegmentattributes"); #else // _WIN32 - pWrapperTable->m_Texture2D_GetTileStyleUV = (PLib3MFTexture2D_GetTileStyleUVPtr) dlsym(hLibrary, "lib3mf_texture2d_gettilestyleuv"); + pWrapperTable->m_ToolpathLayerData_ClearSegmentAttributes = (PLib3MFToolpathLayerData_ClearSegmentAttributesPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_clearsegmentattributes"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_GetTileStyleUV == NULL) + if (pWrapperTable->m_ToolpathLayerData_ClearSegmentAttributes == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_SetTileStyleUV = (PLib3MFTexture2D_SetTileStyleUVPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_settilestyleuv"); + pWrapperTable->m_ToolpathLayerData_WriteHatchData = (PLib3MFToolpathLayerData_WriteHatchDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_writehatchdata"); #else // _WIN32 - pWrapperTable->m_Texture2D_SetTileStyleUV = (PLib3MFTexture2D_SetTileStyleUVPtr) dlsym(hLibrary, "lib3mf_texture2d_settilestyleuv"); + pWrapperTable->m_ToolpathLayerData_WriteHatchData = (PLib3MFToolpathLayerData_WriteHatchDataPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_writehatchdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_SetTileStyleUV == NULL) + if (pWrapperTable->m_ToolpathLayerData_WriteHatchData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_GetFilter = (PLib3MFTexture2D_GetFilterPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_getfilter"); + pWrapperTable->m_ToolpathLayerData_WriteLoop = (PLib3MFToolpathLayerData_WriteLoopPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_writeloop"); #else // _WIN32 - pWrapperTable->m_Texture2D_GetFilter = (PLib3MFTexture2D_GetFilterPtr) dlsym(hLibrary, "lib3mf_texture2d_getfilter"); + pWrapperTable->m_ToolpathLayerData_WriteLoop = (PLib3MFToolpathLayerData_WriteLoopPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_writeloop"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_GetFilter == NULL) + if (pWrapperTable->m_ToolpathLayerData_WriteLoop == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_SetFilter = (PLib3MFTexture2D_SetFilterPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_setfilter"); + pWrapperTable->m_ToolpathLayerData_WritePolyline = (PLib3MFToolpathLayerData_WritePolylinePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_writepolyline"); #else // _WIN32 - pWrapperTable->m_Texture2D_SetFilter = (PLib3MFTexture2D_SetFilterPtr) dlsym(hLibrary, "lib3mf_texture2d_setfilter"); + pWrapperTable->m_ToolpathLayerData_WritePolyline = (PLib3MFToolpathLayerData_WritePolylinePtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_writepolyline"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_SetFilter == NULL) + if (pWrapperTable->m_ToolpathLayerData_WritePolyline == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetObjectResource = (PLib3MFBuildItem_GetObjectResourcePtr) GetProcAddress(hLibrary, "lib3mf_builditem_getobjectresource"); + pWrapperTable->m_ToolpathLayerData_AddCustomData = (PLib3MFToolpathLayerData_AddCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_addcustomdata"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetObjectResource = (PLib3MFBuildItem_GetObjectResourcePtr) dlsym(hLibrary, "lib3mf_builditem_getobjectresource"); + pWrapperTable->m_ToolpathLayerData_AddCustomData = (PLib3MFToolpathLayerData_AddCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_addcustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetObjectResource == NULL) + if (pWrapperTable->m_ToolpathLayerData_AddCustomData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetUUID = (PLib3MFBuildItem_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getuuid"); + pWrapperTable->m_ToolpathLayerData_Finish = (PLib3MFToolpathLayerData_FinishPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_finish"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetUUID = (PLib3MFBuildItem_GetUUIDPtr) dlsym(hLibrary, "lib3mf_builditem_getuuid"); + pWrapperTable->m_ToolpathLayerData_Finish = (PLib3MFToolpathLayerData_FinishPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_finish"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetUUID == NULL) + if (pWrapperTable->m_ToolpathLayerData_Finish == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_SetUUID = (PLib3MFBuildItem_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_builditem_setuuid"); + pWrapperTable->m_Toolpath_GetUnits = (PLib3MFToolpath_GetUnitsPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getunits"); #else // _WIN32 - pWrapperTable->m_BuildItem_SetUUID = (PLib3MFBuildItem_SetUUIDPtr) dlsym(hLibrary, "lib3mf_builditem_setuuid"); + pWrapperTable->m_Toolpath_GetUnits = (PLib3MFToolpath_GetUnitsPtr) dlsym(hLibrary, "lib3mf_toolpath_getunits"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_SetUUID == NULL) + if (pWrapperTable->m_Toolpath_GetUnits == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetObjectResourceID = (PLib3MFBuildItem_GetObjectResourceIDPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getobjectresourceid"); + pWrapperTable->m_Toolpath_GetLayerCount = (PLib3MFToolpath_GetLayerCountPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getlayercount"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetObjectResourceID = (PLib3MFBuildItem_GetObjectResourceIDPtr) dlsym(hLibrary, "lib3mf_builditem_getobjectresourceid"); + pWrapperTable->m_Toolpath_GetLayerCount = (PLib3MFToolpath_GetLayerCountPtr) dlsym(hLibrary, "lib3mf_toolpath_getlayercount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetObjectResourceID == NULL) + if (pWrapperTable->m_Toolpath_GetLayerCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_HasObjectTransform = (PLib3MFBuildItem_HasObjectTransformPtr) GetProcAddress(hLibrary, "lib3mf_builditem_hasobjecttransform"); + pWrapperTable->m_Toolpath_GetProfileCount = (PLib3MFToolpath_GetProfileCountPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getprofilecount"); #else // _WIN32 - pWrapperTable->m_BuildItem_HasObjectTransform = (PLib3MFBuildItem_HasObjectTransformPtr) dlsym(hLibrary, "lib3mf_builditem_hasobjecttransform"); + pWrapperTable->m_Toolpath_GetProfileCount = (PLib3MFToolpath_GetProfileCountPtr) dlsym(hLibrary, "lib3mf_toolpath_getprofilecount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_HasObjectTransform == NULL) + if (pWrapperTable->m_Toolpath_GetProfileCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetObjectTransform = (PLib3MFBuildItem_GetObjectTransformPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getobjecttransform"); + pWrapperTable->m_Toolpath_AddLayer = (PLib3MFToolpath_AddLayerPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_addlayer"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetObjectTransform = (PLib3MFBuildItem_GetObjectTransformPtr) dlsym(hLibrary, "lib3mf_builditem_getobjecttransform"); + pWrapperTable->m_Toolpath_AddLayer = (PLib3MFToolpath_AddLayerPtr) dlsym(hLibrary, "lib3mf_toolpath_addlayer"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetObjectTransform == NULL) + if (pWrapperTable->m_Toolpath_AddLayer == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_SetObjectTransform = (PLib3MFBuildItem_SetObjectTransformPtr) GetProcAddress(hLibrary, "lib3mf_builditem_setobjecttransform"); + pWrapperTable->m_Toolpath_GetLayerAttachment = (PLib3MFToolpath_GetLayerAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getlayerattachment"); #else // _WIN32 - pWrapperTable->m_BuildItem_SetObjectTransform = (PLib3MFBuildItem_SetObjectTransformPtr) dlsym(hLibrary, "lib3mf_builditem_setobjecttransform"); + pWrapperTable->m_Toolpath_GetLayerAttachment = (PLib3MFToolpath_GetLayerAttachmentPtr) dlsym(hLibrary, "lib3mf_toolpath_getlayerattachment"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_SetObjectTransform == NULL) + if (pWrapperTable->m_Toolpath_GetLayerAttachment == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetPartNumber = (PLib3MFBuildItem_GetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getpartnumber"); + pWrapperTable->m_Toolpath_ReadLayerData = (PLib3MFToolpath_ReadLayerDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_readlayerdata"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetPartNumber = (PLib3MFBuildItem_GetPartNumberPtr) dlsym(hLibrary, "lib3mf_builditem_getpartnumber"); + pWrapperTable->m_Toolpath_ReadLayerData = (PLib3MFToolpath_ReadLayerDataPtr) dlsym(hLibrary, "lib3mf_toolpath_readlayerdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetPartNumber == NULL) + if (pWrapperTable->m_Toolpath_ReadLayerData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_SetPartNumber = (PLib3MFBuildItem_SetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_builditem_setpartnumber"); + pWrapperTable->m_Toolpath_GetLayerPath = (PLib3MFToolpath_GetLayerPathPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getlayerpath"); #else // _WIN32 - pWrapperTable->m_BuildItem_SetPartNumber = (PLib3MFBuildItem_SetPartNumberPtr) dlsym(hLibrary, "lib3mf_builditem_setpartnumber"); + pWrapperTable->m_Toolpath_GetLayerPath = (PLib3MFToolpath_GetLayerPathPtr) dlsym(hLibrary, "lib3mf_toolpath_getlayerpath"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_SetPartNumber == NULL) + if (pWrapperTable->m_Toolpath_GetLayerPath == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetMetaDataGroup = (PLib3MFBuildItem_GetMetaDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getmetadatagroup"); + pWrapperTable->m_Toolpath_GetLayerZMax = (PLib3MFToolpath_GetLayerZMaxPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getlayerzmax"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetMetaDataGroup = (PLib3MFBuildItem_GetMetaDataGroupPtr) dlsym(hLibrary, "lib3mf_builditem_getmetadatagroup"); + pWrapperTable->m_Toolpath_GetLayerZMax = (PLib3MFToolpath_GetLayerZMaxPtr) dlsym(hLibrary, "lib3mf_toolpath_getlayerzmax"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetMetaDataGroup == NULL) + if (pWrapperTable->m_Toolpath_GetLayerZMax == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetOutbox = (PLib3MFBuildItem_GetOutboxPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getoutbox"); + pWrapperTable->m_Toolpath_GetLayerZ = (PLib3MFToolpath_GetLayerZPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getlayerz"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetOutbox = (PLib3MFBuildItem_GetOutboxPtr) dlsym(hLibrary, "lib3mf_builditem_getoutbox"); + pWrapperTable->m_Toolpath_GetLayerZ = (PLib3MFToolpath_GetLayerZPtr) dlsym(hLibrary, "lib3mf_toolpath_getlayerz"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetOutbox == NULL) + if (pWrapperTable->m_Toolpath_GetLayerZ == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItemIterator_MoveNext = (PLib3MFBuildItemIterator_MoveNextPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_movenext"); + pWrapperTable->m_Toolpath_AddProfile = (PLib3MFToolpath_AddProfilePtr) GetProcAddress(hLibrary, "lib3mf_toolpath_addprofile"); #else // _WIN32 - pWrapperTable->m_BuildItemIterator_MoveNext = (PLib3MFBuildItemIterator_MoveNextPtr) dlsym(hLibrary, "lib3mf_builditemiterator_movenext"); + pWrapperTable->m_Toolpath_AddProfile = (PLib3MFToolpath_AddProfilePtr) dlsym(hLibrary, "lib3mf_toolpath_addprofile"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItemIterator_MoveNext == NULL) + if (pWrapperTable->m_Toolpath_AddProfile == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItemIterator_MovePrevious = (PLib3MFBuildItemIterator_MovePreviousPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_moveprevious"); + pWrapperTable->m_Toolpath_GetProfile = (PLib3MFToolpath_GetProfilePtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getprofile"); #else // _WIN32 - pWrapperTable->m_BuildItemIterator_MovePrevious = (PLib3MFBuildItemIterator_MovePreviousPtr) dlsym(hLibrary, "lib3mf_builditemiterator_moveprevious"); + pWrapperTable->m_Toolpath_GetProfile = (PLib3MFToolpath_GetProfilePtr) dlsym(hLibrary, "lib3mf_toolpath_getprofile"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItemIterator_MovePrevious == NULL) + if (pWrapperTable->m_Toolpath_GetProfile == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItemIterator_GetCurrent = (PLib3MFBuildItemIterator_GetCurrentPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_getcurrent"); + pWrapperTable->m_Toolpath_GetProfileUUID = (PLib3MFToolpath_GetProfileUUIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getprofileuuid"); #else // _WIN32 - pWrapperTable->m_BuildItemIterator_GetCurrent = (PLib3MFBuildItemIterator_GetCurrentPtr) dlsym(hLibrary, "lib3mf_builditemiterator_getcurrent"); + pWrapperTable->m_Toolpath_GetProfileUUID = (PLib3MFToolpath_GetProfileUUIDPtr) dlsym(hLibrary, "lib3mf_toolpath_getprofileuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItemIterator_GetCurrent == NULL) + if (pWrapperTable->m_Toolpath_GetProfileUUID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItemIterator_Clone = (PLib3MFBuildItemIterator_ClonePtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_clone"); + pWrapperTable->m_Toolpath_GetCustomDataCount = (PLib3MFToolpath_GetCustomDataCountPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getcustomdatacount"); #else // _WIN32 - pWrapperTable->m_BuildItemIterator_Clone = (PLib3MFBuildItemIterator_ClonePtr) dlsym(hLibrary, "lib3mf_builditemiterator_clone"); + pWrapperTable->m_Toolpath_GetCustomDataCount = (PLib3MFToolpath_GetCustomDataCountPtr) dlsym(hLibrary, "lib3mf_toolpath_getcustomdatacount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItemIterator_Clone == NULL) + if (pWrapperTable->m_Toolpath_GetCustomDataCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItemIterator_Count = (PLib3MFBuildItemIterator_CountPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_count"); + pWrapperTable->m_Toolpath_GetCustomData = (PLib3MFToolpath_GetCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getcustomdata"); #else // _WIN32 - pWrapperTable->m_BuildItemIterator_Count = (PLib3MFBuildItemIterator_CountPtr) dlsym(hLibrary, "lib3mf_builditemiterator_count"); + pWrapperTable->m_Toolpath_GetCustomData = (PLib3MFToolpath_GetCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpath_getcustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItemIterator_Count == NULL) + if (pWrapperTable->m_Toolpath_GetCustomData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_SetVertices = (PLib3MFSlice_SetVerticesPtr) GetProcAddress(hLibrary, "lib3mf_slice_setvertices"); + pWrapperTable->m_Toolpath_GetCustomDataName = (PLib3MFToolpath_GetCustomDataNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getcustomdataname"); #else // _WIN32 - pWrapperTable->m_Slice_SetVertices = (PLib3MFSlice_SetVerticesPtr) dlsym(hLibrary, "lib3mf_slice_setvertices"); + pWrapperTable->m_Toolpath_GetCustomDataName = (PLib3MFToolpath_GetCustomDataNamePtr) dlsym(hLibrary, "lib3mf_toolpath_getcustomdataname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_SetVertices == NULL) + if (pWrapperTable->m_Toolpath_GetCustomDataName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_GetVertices = (PLib3MFSlice_GetVerticesPtr) GetProcAddress(hLibrary, "lib3mf_slice_getvertices"); + pWrapperTable->m_Toolpath_HasUniqueCustomData = (PLib3MFToolpath_HasUniqueCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_hasuniquecustomdata"); #else // _WIN32 - pWrapperTable->m_Slice_GetVertices = (PLib3MFSlice_GetVerticesPtr) dlsym(hLibrary, "lib3mf_slice_getvertices"); + pWrapperTable->m_Toolpath_HasUniqueCustomData = (PLib3MFToolpath_HasUniqueCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpath_hasuniquecustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_GetVertices == NULL) + if (pWrapperTable->m_Toolpath_HasUniqueCustomData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_GetVertexCount = (PLib3MFSlice_GetVertexCountPtr) GetProcAddress(hLibrary, "lib3mf_slice_getvertexcount"); + pWrapperTable->m_Toolpath_FindUniqueCustomData = (PLib3MFToolpath_FindUniqueCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_finduniquecustomdata"); #else // _WIN32 - pWrapperTable->m_Slice_GetVertexCount = (PLib3MFSlice_GetVertexCountPtr) dlsym(hLibrary, "lib3mf_slice_getvertexcount"); + pWrapperTable->m_Toolpath_FindUniqueCustomData = (PLib3MFToolpath_FindUniqueCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpath_finduniquecustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_GetVertexCount == NULL) + if (pWrapperTable->m_Toolpath_FindUniqueCustomData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_AddPolygon = (PLib3MFSlice_AddPolygonPtr) GetProcAddress(hLibrary, "lib3mf_slice_addpolygon"); + pWrapperTable->m_Toolpath_AddCustomData = (PLib3MFToolpath_AddCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_addcustomdata"); #else // _WIN32 - pWrapperTable->m_Slice_AddPolygon = (PLib3MFSlice_AddPolygonPtr) dlsym(hLibrary, "lib3mf_slice_addpolygon"); + pWrapperTable->m_Toolpath_AddCustomData = (PLib3MFToolpath_AddCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpath_addcustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_AddPolygon == NULL) + if (pWrapperTable->m_Toolpath_AddCustomData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_GetPolygonCount = (PLib3MFSlice_GetPolygonCountPtr) GetProcAddress(hLibrary, "lib3mf_slice_getpolygoncount"); + pWrapperTable->m_Toolpath_ClearCustomData = (PLib3MFToolpath_ClearCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_clearcustomdata"); #else // _WIN32 - pWrapperTable->m_Slice_GetPolygonCount = (PLib3MFSlice_GetPolygonCountPtr) dlsym(hLibrary, "lib3mf_slice_getpolygoncount"); + pWrapperTable->m_Toolpath_ClearCustomData = (PLib3MFToolpath_ClearCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpath_clearcustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_GetPolygonCount == NULL) + if (pWrapperTable->m_Toolpath_ClearCustomData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_SetPolygonIndices = (PLib3MFSlice_SetPolygonIndicesPtr) GetProcAddress(hLibrary, "lib3mf_slice_setpolygonindices"); + pWrapperTable->m_Toolpath_DeleteCustomData = (PLib3MFToolpath_DeleteCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_deletecustomdata"); #else // _WIN32 - pWrapperTable->m_Slice_SetPolygonIndices = (PLib3MFSlice_SetPolygonIndicesPtr) dlsym(hLibrary, "lib3mf_slice_setpolygonindices"); + pWrapperTable->m_Toolpath_DeleteCustomData = (PLib3MFToolpath_DeleteCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpath_deletecustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_SetPolygonIndices == NULL) + if (pWrapperTable->m_Toolpath_DeleteCustomData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_GetPolygonIndices = (PLib3MFSlice_GetPolygonIndicesPtr) GetProcAddress(hLibrary, "lib3mf_slice_getpolygonindices"); + pWrapperTable->m_Toolpath_RegisterCustomIntegerAttribute = (PLib3MFToolpath_RegisterCustomIntegerAttributePtr) GetProcAddress(hLibrary, "lib3mf_toolpath_registercustomintegerattribute"); #else // _WIN32 - pWrapperTable->m_Slice_GetPolygonIndices = (PLib3MFSlice_GetPolygonIndicesPtr) dlsym(hLibrary, "lib3mf_slice_getpolygonindices"); + pWrapperTable->m_Toolpath_RegisterCustomIntegerAttribute = (PLib3MFToolpath_RegisterCustomIntegerAttributePtr) dlsym(hLibrary, "lib3mf_toolpath_registercustomintegerattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_GetPolygonIndices == NULL) + if (pWrapperTable->m_Toolpath_RegisterCustomIntegerAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_GetPolygonIndexCount = (PLib3MFSlice_GetPolygonIndexCountPtr) GetProcAddress(hLibrary, "lib3mf_slice_getpolygonindexcount"); + pWrapperTable->m_Toolpath_RegisterCustomDoubleAttribute = (PLib3MFToolpath_RegisterCustomDoubleAttributePtr) GetProcAddress(hLibrary, "lib3mf_toolpath_registercustomdoubleattribute"); #else // _WIN32 - pWrapperTable->m_Slice_GetPolygonIndexCount = (PLib3MFSlice_GetPolygonIndexCountPtr) dlsym(hLibrary, "lib3mf_slice_getpolygonindexcount"); + pWrapperTable->m_Toolpath_RegisterCustomDoubleAttribute = (PLib3MFToolpath_RegisterCustomDoubleAttributePtr) dlsym(hLibrary, "lib3mf_toolpath_registercustomdoubleattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_GetPolygonIndexCount == NULL) + if (pWrapperTable->m_Toolpath_RegisterCustomDoubleAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_GetZTop = (PLib3MFSlice_GetZTopPtr) GetProcAddress(hLibrary, "lib3mf_slice_getztop"); + pWrapperTable->m_ToolpathIterator_GetCurrentToolpath = (PLib3MFToolpathIterator_GetCurrentToolpathPtr) GetProcAddress(hLibrary, "lib3mf_toolpathiterator_getcurrenttoolpath"); #else // _WIN32 - pWrapperTable->m_Slice_GetZTop = (PLib3MFSlice_GetZTopPtr) dlsym(hLibrary, "lib3mf_slice_getztop"); + pWrapperTable->m_ToolpathIterator_GetCurrentToolpath = (PLib3MFToolpathIterator_GetCurrentToolpathPtr) dlsym(hLibrary, "lib3mf_toolpathiterator_getcurrenttoolpath"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_GetZTop == NULL) + if (pWrapperTable->m_ToolpathIterator_GetCurrentToolpath == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 @@ -3278,6 +4593,15 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Model_GetMultiPropertyGroups == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Model_GetToolpaths = (PLib3MFModel_GetToolpathsPtr) GetProcAddress(hLibrary, "lib3mf_model_gettoolpaths"); + #else // _WIN32 + pWrapperTable->m_Model_GetToolpaths = (PLib3MFModel_GetToolpathsPtr) dlsym(hLibrary, "lib3mf_model_gettoolpaths"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetToolpaths == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Model_GetSliceStacks = (PLib3MFModel_GetSliceStacksPtr) GetProcAddress(hLibrary, "lib3mf_model_getslicestacks"); #else // _WIN32 @@ -3395,6 +4719,15 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Model_RemoveBuildItem == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Model_AddToolpath = (PLib3MFModel_AddToolpathPtr) GetProcAddress(hLibrary, "lib3mf_model_addtoolpath"); + #else // _WIN32 + pWrapperTable->m_Model_AddToolpath = (PLib3MFModel_AddToolpathPtr) dlsym(hLibrary, "lib3mf_model_addtoolpath"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_AddToolpath == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Model_GetMetaDataGroup = (PLib3MFModel_GetMetaDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_model_getmetadatagroup"); #else // _WIN32 @@ -3521,6 +4854,33 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Model_GetKeyStore == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Model_CreatePersistentSourceFromFile = (PLib3MFModel_CreatePersistentSourceFromFilePtr) GetProcAddress(hLibrary, "lib3mf_model_createpersistentsourcefromfile"); + #else // _WIN32 + pWrapperTable->m_Model_CreatePersistentSourceFromFile = (PLib3MFModel_CreatePersistentSourceFromFilePtr) dlsym(hLibrary, "lib3mf_model_createpersistentsourcefromfile"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_CreatePersistentSourceFromFile == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Model_CreatePersistentSourceFromBuffer = (PLib3MFModel_CreatePersistentSourceFromBufferPtr) GetProcAddress(hLibrary, "lib3mf_model_createpersistentsourcefrombuffer"); + #else // _WIN32 + pWrapperTable->m_Model_CreatePersistentSourceFromBuffer = (PLib3MFModel_CreatePersistentSourceFromBufferPtr) dlsym(hLibrary, "lib3mf_model_createpersistentsourcefrombuffer"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_CreatePersistentSourceFromBuffer == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Model_CreatePersistentSourceFromCallback = (PLib3MFModel_CreatePersistentSourceFromCallbackPtr) GetProcAddress(hLibrary, "lib3mf_model_createpersistentsourcefromcallback"); + #else // _WIN32 + pWrapperTable->m_Model_CreatePersistentSourceFromCallback = (PLib3MFModel_CreatePersistentSourceFromCallbackPtr) dlsym(hLibrary, "lib3mf_model_createpersistentsourcefromcallback"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_CreatePersistentSourceFromCallback == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_GetLibraryVersion = (PLib3MFGetLibraryVersionPtr) GetProcAddress(hLibrary, "lib3mf_getlibraryversion"); #else // _WIN32 diff --git a/Autogenerated/Bindings/Go/lib3mf_dynamic.h b/Autogenerated/Bindings/Go/lib3mf_dynamic.h index 044c754bb..6d35afa19 100644 --- a/Autogenerated/Bindings/Go/lib3mf_dynamic.h +++ b/Autogenerated/Bindings/Go/lib3mf_dynamic.h @@ -53,6 +53,78 @@ Interface version: 2.3.2 */ typedef Lib3MFResult (*PLib3MFBase_ClassTypeIdPtr) (Lib3MF_Base pBase, Lib3MF_uint64 * pClassTypeId); +/************************************************************************************************************************* + Class definition for BinaryStream +**************************************************************************************************************************/ + +/** +* Retrieves an binary streams package path for the binary data. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of binary streams package binary path., may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_GetBinaryPathPtr) (Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Retrieves an binary streams package path for the index data. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of binary streams package index path., may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_GetIndexPathPtr) (Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Retrieves an binary streams uuid. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of binary streams uuid, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_GetUUIDPtr) (Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); + +/** +* Sets the float compression mode to raw. All subsequent writes will adhere to this mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_DisableDiscretizedArrayCompressionPtr) (Lib3MF_BinaryStream pBinaryStream); + +/** +* Sets the compression mode to a quantized array. All subsequent writes will adhere to this mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] dUnits - Unit factor to use for quantization. +* @param[in] ePredictionType - Prediction type to use for arrays. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_EnableDiscretizedArrayCompressionPtr) (Lib3MF_BinaryStream pBinaryStream, Lib3MF_double dUnits, eLib3MFBinaryStreamPredictionType ePredictionType); + +/** +* Enables LZMA mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nLZMALevel - LZMA Level (0-9) +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_EnableLZMAPtr) (Lib3MF_BinaryStream pBinaryStream, Lib3MF_uint32 nLZMALevel); + +/** +* Disables LZMA mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_DisableLZMAPtr) (Lib3MF_BinaryStream pBinaryStream); + /************************************************************************************************************************* Class definition for Writer **************************************************************************************************************************/ @@ -186,10 +258,80 @@ typedef Lib3MFResult (*PLib3MFWriter_AddKeyWrappingCallbackPtr) (Lib3MF_Writer p */ typedef Lib3MFResult (*PLib3MFWriter_SetContentEncryptionCallbackPtr) (Lib3MF_Writer pWriter, Lib3MFContentEncryptionCallback pTheCallback, Lib3MF_pvoid pUserData); +/** +* Creates a binary stream object. Only applicable for 3MF Writers. +* +* @param[in] pWriter - Writer instance. +* @param[in] pIndexPath - Package path to write the index into +* @param[in] pBinaryPath - Package path to write raw binary data into +* @param[out] pBinaryStream - Returns a package path. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFWriter_CreateBinaryStreamPtr) (Lib3MF_Writer pWriter, const char * pIndexPath, const char * pBinaryPath, Lib3MF_BinaryStream * pBinaryStream); + +/** +* Sets a binary stream for an object. Currently supported objects are Meshes and Toolpath layers. +* +* @param[in] pWriter - Writer instance. +* @param[in] pInstance - Object instance to assign Binary stream to. +* @param[in] pBinaryStream - Binary stream object to use for this layer. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFWriter_AssignBinaryStreamPtr) (Lib3MF_Writer pWriter, Lib3MF_Base pInstance, Lib3MF_BinaryStream pBinaryStream); + +/** +* Registers a custom 3MF Namespace. Fails if Prefix is already registered. +* +* @param[in] pWriter - Writer instance. +* @param[in] pPrefix - Prefix to be used. MUST NOT be empty. MUST be alphanumeric, not starting with a number +* @param[in] pNameSpace - Namespace to be used. MUST NOT be empty. MUST be alphanumeric, not starting with a number +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFWriter_RegisterCustomNamespacePtr) (Lib3MF_Writer pWriter, const char * pPrefix, const char * pNameSpace); + +/************************************************************************************************************************* + Class definition for PersistentReaderSource +**************************************************************************************************************************/ + +/** +* Retrieves the type of source data. +* +* @param[in] pPersistentReaderSource - PersistentReaderSource instance. +* @param[out] pSourceType - Reader Source Type +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFPersistentReaderSource_GetSourceTypePtr) (Lib3MF_PersistentReaderSource pPersistentReaderSource, eLib3MFPersistentReaderSourceType * pSourceType); + +/** +* Invalidates the reader source. Every subsequent read on this data will fail. +* +* @param[in] pPersistentReaderSource - PersistentReaderSource instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFPersistentReaderSource_InvalidateSourceDataPtr) (Lib3MF_PersistentReaderSource pPersistentReaderSource); + +/** +* Checks if the source data is valid. Any read on an invalid source object will fail. +* +* @param[in] pPersistentReaderSource - PersistentReaderSource instance. +* @param[out] pDataIsValid - The source data is valid. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFPersistentReaderSource_SourceDataIsValidPtr) (Lib3MF_PersistentReaderSource pPersistentReaderSource, bool * pDataIsValid); + /************************************************************************************************************************* Class definition for Reader **************************************************************************************************************************/ +/** +* Reads a model from a persistent source object. The object will be referenced until the Model is destroyed or cleared. +* +* @param[in] pReader - Reader instance. +* @param[in] pSource - Source object to read from +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFReader_ReadFromPersistentSourcePtr) (Lib3MF_Reader pReader, Lib3MF_PersistentReaderSource pSource); + /** * Reads a model from a file. The file type is specified by the Model Reader class * @@ -433,1987 +575,3252 @@ typedef Lib3MFResult (*PLib3MFResourceIterator_ClonePtr) (Lib3MF_ResourceIterato typedef Lib3MFResult (*PLib3MFResourceIterator_CountPtr) (Lib3MF_ResourceIterator pResourceIterator, Lib3MF_uint64 * pCount); /************************************************************************************************************************* - Class definition for SliceStackIterator + Class definition for CustomXMLAttribute **************************************************************************************************************************/ /** -* Returns the SliceStack the iterator points at. +* Retrieves name of the attribute. * -* @param[in] pSliceStackIterator - SliceStackIterator instance. -* @param[out] pResource - returns the SliceStack instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the attribute., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSliceStackIterator_GetCurrentSliceStackPtr) (Lib3MF_SliceStackIterator pSliceStackIterator, Lib3MF_SliceStack * pResource); - -/************************************************************************************************************************* - Class definition for ObjectIterator -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_GetNamePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Returns the Object the iterator points at. +* Retrieves value of the attribute as string. * -* @param[in] pObjectIterator - ObjectIterator instance. -* @param[out] pResource - returns the Object instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of returns the value of the attribute., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObjectIterator_GetCurrentObjectPtr) (Lib3MF_ObjectIterator pObjectIterator, Lib3MF_Object * pResource); - -/************************************************************************************************************************* - Class definition for MeshObjectIterator -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_GetValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* Returns the MeshObject the iterator points at. +* Checks if the value is a valid integer in the given range. * -* @param[in] pMeshObjectIterator - MeshObjectIterator instance. -* @param[out] pResource - returns the MeshObject instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nMinValue - Minimum allowed value +* @param[in] nMaxValue - Maximum allowed value +* @param[out] pIsValid - returns if the value is a valid integer. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) (Lib3MF_MeshObjectIterator pMeshObjectIterator, Lib3MF_MeshObject * pResource); - -/************************************************************************************************************************* - Class definition for ComponentsObjectIterator -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_IsValidIntegerPtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nMinValue, Lib3MF_int64 nMaxValue, bool * pIsValid); /** -* Returns the ComponentsObject the iterator points at. +* Returns the value as integer. Fails if the value is not a valid integer in the given range. * -* @param[in] pComponentsObjectIterator - ComponentsObjectIterator instance. -* @param[out] pResource - returns the ComponentsObject instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nMinValue - Minimum allowed value +* @param[in] nMaxValue - Maximum allowed value +* @param[out] pValue - returns the value. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) (Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource); - -/************************************************************************************************************************* - Class definition for Texture2DIterator -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_GetIntegerValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nMinValue, Lib3MF_int64 nMaxValue, Lib3MF_int64 * pValue); /** -* Returns the Texture2D the iterator points at. +* Checks if the value is a valid double in the given range. * -* @param[in] pTexture2DIterator - Texture2DIterator instance. -* @param[out] pResource - returns the Texture2D instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dMinValue - Minimum allowed value +* @param[in] dMaxValue - Maximum allowed value +* @param[out] pIsValid - returns if the value is a valid double. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) (Lib3MF_Texture2DIterator pTexture2DIterator, Lib3MF_Texture2D * pResource); +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_IsValidDoublePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, bool * pIsValid); -/************************************************************************************************************************* - Class definition for BaseMaterialGroupIterator -**************************************************************************************************************************/ +/** +* Returns the value as double. Fails if the value is not a valid double in the given range. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dMinValue - Minimum allowed value +* @param[in] dMaxValue - Maximum allowed value +* @param[out] pValue - returns the value . +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_GetDoubleValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, Lib3MF_double * pValue); /** -* Returns the MaterialGroup the iterator points at. +* Checks if the value is a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. * -* @param[in] pBaseMaterialGroupIterator - BaseMaterialGroupIterator instance. -* @param[out] pResource - returns the BaseMaterialGroup instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[out] pIsValid - returns if the value is a valid bool. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr) (Lib3MF_BaseMaterialGroupIterator pBaseMaterialGroupIterator, Lib3MF_BaseMaterialGroup * pResource); +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_IsValidBoolPtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, bool * pIsValid); -/************************************************************************************************************************* - Class definition for ColorGroupIterator -**************************************************************************************************************************/ +/** +* Returns the value as bool. Fails if the value is not a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dMinValue - Minimum allowed value +* @param[in] dMaxValue - Maximum allowed value +* @param[out] pValue - returns the value . +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_GetBoolValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, bool * pValue); /** -* Returns the ColorGroup the iterator points at. +* Sets the value of the attribute as string. * -* @param[in] pColorGroupIterator - ColorGroupIterator instance. -* @param[out] pResource - returns the ColorGroup instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] pValue - new value of the attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroupIterator_GetCurrentColorGroupPtr) (Lib3MF_ColorGroupIterator pColorGroupIterator, Lib3MF_ColorGroup * pResource); +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_SetValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const char * pValue); -/************************************************************************************************************************* - Class definition for Texture2DGroupIterator -**************************************************************************************************************************/ +/** +* Sets the value of the attribute as integer. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nValue - new value of the attribute. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_SetIntegerValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nValue); /** -* Returns the Texture2DGroup the iterator points at. +* Sets the value of the attribute as double. * -* @param[in] pTexture2DGroupIterator - Texture2DGroupIterator instance. -* @param[out] pResource - returns the Texture2DGroup instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dValue - new value of the attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupPtr) (Lib3MF_Texture2DGroupIterator pTexture2DGroupIterator, Lib3MF_Texture2DGroup * pResource); +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_SetDoubleValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dValue); -/************************************************************************************************************************* - Class definition for CompositeMaterialsIterator -**************************************************************************************************************************/ +/** +* Sets the value of the attribute as bool. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] bValue - new value of the attribute. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_SetBoolValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, bool bValue); /** -* Returns the CompositeMaterials the iterator points at. +* Removes the attribute from its parent node. All subsequent calls to the class will fail. * -* @param[in] pCompositeMaterialsIterator - CompositeMaterialsIterator instance. -* @param[out] pResource - returns the CompositeMaterials instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsPtr) (Lib3MF_CompositeMaterialsIterator pCompositeMaterialsIterator, Lib3MF_CompositeMaterials * pResource); +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_RemovePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute); /************************************************************************************************************************* - Class definition for MultiPropertyGroupIterator + Class definition for CustomXMLNode **************************************************************************************************************************/ /** -* Returns the MultiPropertyGroup the iterator points at. +* Retrieves name of the node. * -* @param[in] pMultiPropertyGroupIterator - MultiPropertyGroupIterator instance. -* @param[out] pResource - returns the MultiPropertyGroup instance. +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the node., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupPtr) (Lib3MF_MultiPropertyGroupIterator pMultiPropertyGroupIterator, Lib3MF_MultiPropertyGroup * pResource); - -/************************************************************************************************************************* - Class definition for MetaData -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLNode_GetNamePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* returns the namespace URL of the metadata +* Retrieves namespace of the node. * -* @param[in] pMetaData - MetaData instance. +* @param[in] pCustomXMLNode - CustomXMLNode instance. * @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) * @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameSpaceBuffer - buffer of the namespace URL of the metadata, may be NULL +* @param[out] pNameSpaceBuffer - buffer of returns the namespace of the node., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_GetNameSpacePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_GetNameSpacePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* sets a new namespace URL of the metadata +* Returns number of attributes. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pNameSpace - the new namespace URL of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[out] pCount - returns the number of attributes. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_SetNameSpacePtr) (Lib3MF_MetaData pMetaData, const char * pNameSpace); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_GetAttributeCountPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 * pCount); /** -* returns the name of a metadata +* Returns attribute instance. Fails if Index is out of range. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of the name of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] nIndex - Index of the attribute to return (0-based). +* @param[out] pAttributeInstance - XML Document attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_GetNamePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_GetAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 nIndex, Lib3MF_CustomXMLAttribute * pAttributeInstance); /** -* sets a new name of a metadata +* Returns if attribute of a specific name exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pName - the new name of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[out] pAttributeExists - Returns if the attribute exists. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_SetNamePtr) (Lib3MF_MetaData pMetaData, const char * pName); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_HasAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pAttributeExists); /** -* returns the (namespace+name) of a metadata +* Returns attribute instance of a specific name. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nKeyBufferSize - size of the buffer (including trailing 0) -* @param[out] pKeyNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pKeyBuffer - buffer of the key (namespace+name) of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] bMustExist - If true, the call fails if attribute does not exist. If falls, the call will return null if the attribute does not exist. +* @param[out] pAttributeInstance - XML Document attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_GetKeyPtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nKeyBufferSize, Lib3MF_uint32* pKeyNeededChars, char * pKeyBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_FindAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bMustExist, Lib3MF_CustomXMLAttribute * pAttributeInstance); /** -* returns, whether a metadata must be preserved +* Removes the attribute with a specific name. Does nothing if attribute does not exist. * -* @param[in] pMetaData - MetaData instance. -* @param[out] pMustPreserve - returns, whether a metadata must be preserved +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[out] pAttributeRemoved - Returns true if an attribute was removed. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_GetMustPreservePtr) (Lib3MF_MetaData pMetaData, bool * pMustPreserve); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_RemoveAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pAttributeRemoved); /** -* sets whether a metadata must be preserved +* Removes the attribute with a specific index. Fails if index is invalid * -* @param[in] pMetaData - MetaData instance. -* @param[in] bMustPreserve - a new value whether a metadata must be preserved +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] nIndex - Index of the attribute to remove (0-based). +* @param[out] pAttributeRemoved - Returns true if an attribute was removed. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_SetMustPreservePtr) (Lib3MF_MetaData pMetaData, bool bMustPreserve); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_RemoveAttributeByIndexPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 nIndex, bool * pAttributeRemoved); /** -* returns the type of a metadata +* Adds an attribute with a specific name and string value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nTypeBufferSize - size of the buffer (including trailing 0) -* @param[out] pTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pTypeBuffer - buffer of the type of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] pValue - Value of the attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_GetTypePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nTypeBufferSize, Lib3MF_uint32* pTypeNeededChars, char * pTypeBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_AddAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, const char * pValue); /** -* sets a new type of a metadata. This must be a simple XML type +* Adds an attribute with a specific name and integer value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pType - a new type of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] nValue - Value of the attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_SetTypePtr) (Lib3MF_MetaData pMetaData, const char * pType); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_AddIntegerAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_int64 nValue); /** -* returns the value of the metadata +* Adds an attribute with a specific name and double value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nValueBufferSize - size of the buffer (including trailing 0) -* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pValueBuffer - buffer of the value of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] dValue - Value of the attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_GetValuePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_AddDoubleAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_double dValue); /** -* sets a new value of the metadata +* Adds an attribute with a specific name and bool value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pValue - a new value of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] bValue - Value of the attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_SetValuePtr) (Lib3MF_MetaData pMetaData, const char * pValue); - -/************************************************************************************************************************* - Class definition for MetaDataGroup -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLNode_AddBoolAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bValue); /** -* returns the number of metadata in this metadatagroup +* Returns all the child nodes of the XML Node. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[out] pCount - returns the number metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[out] pChildNodes - returns the list of child nodes. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaDataGroup_GetMetaDataCountPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_GetChildrenPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_CustomXMLNodes * pChildNodes); /** -* returns a metadata value within this metadatagroup +* Returns how many children of the XML Node have a specific name. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] nIndex - Index of the Metadata. -* @param[out] pMetaData - an instance of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the node. +* @param[out] pCount - returns the number children with the specified name. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaDataGroup_GetMetaDataPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex, Lib3MF_MetaData * pMetaData); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_CountChildrenByNamePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_uint64 * pCount); /** -* returns a metadata value within this metadatagroup +* Returns all the child nodes of the XML Node with a specific name. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] pNameSpace - the namespace of the metadata -* @param[in] pName - the name of the Metadata -* @param[out] pMetaData - an instance of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildNodes - returns the list of child nodes. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaDataGroup_GetMetaDataByKeyPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, Lib3MF_MetaData * pMetaData); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_GetChildrenByNamePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_CustomXMLNodes * pChildNodes); /** -* removes metadata by index from the model. +* Returns if a child with a specific name exist. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] nIndex - Index of the metadata to remove +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildExists - returns if a child with a specific name exists. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaDataGroup_RemoveMetaDataByIndexPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_HasChildPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pChildExists); /** -* removes metadata from the model. +* Returns if a child with a specific name exist once and only once. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] pTheMetaData - The metadata to remove +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildExists - returns if a child with a specific name exists once and only once. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaDataGroup_RemoveMetaDataPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_MetaData pTheMetaData); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_HasUniqueChildPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pChildExists); /** -* adds a new metadata to this metadatagroup +* Returns child with a specific name. Throws an error if name does not exist once and only once. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] pNameSpace - the namespace of the metadata -* @param[in] pName - the name of the metadata -* @param[in] pValue - the value of the metadata -* @param[in] pType - the type of the metadata -* @param[in] bMustPreserve - shuold the metadata be preserved -* @param[out] pMetaData - a new instance of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[in] bMustExist - If true, the call fails if child does not exist. If falls, the call will return null if the child does not exist. +* @param[out] pChildInstance - returns child instance or null. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaDataGroup_AddMetaDataPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, const char * pValue, const char * pType, bool bMustPreserve, Lib3MF_MetaData * pMetaData); - -/************************************************************************************************************************* - Class definition for Object -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLNode_FindChildPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bMustExist, Lib3MF_CustomXMLNode * pChildInstance); /** -* Retrieves an object's type +* Adds a new child with a specific name. * -* @param[in] pObject - Object instance. -* @param[out] pObjectType - returns object type enum. +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildInstance - returns child instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetTypePtr) (Lib3MF_Object pObject, eLib3MFObjectType * pObjectType); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_AddChildPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_CustomXMLNode * pChildInstance); /** -* Sets an object's type +* Removes a specific child. All subsequent calls to the child will fail after the call. * -* @param[in] pObject - Object instance. -* @param[in] eObjectType - object type enum. +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pChildInstance - child instance to remove. Fails if given instance is not a child of the node. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_SetTypePtr) (Lib3MF_Object pObject, eLib3MFObjectType eObjectType); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_RemoveChildPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_CustomXMLNode pChildInstance); /** -* Retrieves an object's name +* Removes all children with a specific name. Does nothing if no child with the name exists. All subsequent calls to the deleted children will fail after the call. * -* @param[in] pObject - Object instance. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of returns object name., may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the children. +* @param[out] pNumberOfDeletedChildren - Returns how many children have been deleted. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetNamePtr) (Lib3MF_Object pObject, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_RemoveChildrenWithNamePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_uint64 * pNumberOfDeletedChildren); /** -* Sets an object's name string +* Removes the node from its parent. The root node of the document can not be removed. Any subsequent call to the node fails after this. * -* @param[in] pObject - Object instance. -* @param[in] pName - new object name. +* @param[in] pCustomXMLNode - CustomXMLNode instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_SetNamePtr) (Lib3MF_Object pObject, const char * pName); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_RemovePtr) (Lib3MF_CustomXMLNode pCustomXMLNode); + +/************************************************************************************************************************* + Class definition for CustomXMLNodes +**************************************************************************************************************************/ /** -* Retrieves an object's part number +* Returns number of nodes. * -* @param[in] pObject - Object instance. -* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) -* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPartNumberBuffer - buffer of returns object part number., may be NULL +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[out] pCount - returns the number of nodes in the list. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetPartNumberPtr) (Lib3MF_Object pObject, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_GetNodeCountPtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, Lib3MF_uint64 * pCount); /** -* Sets an objects partnumber string +* Returns node instance. Fails if Index is out of range. * -* @param[in] pObject - Object instance. -* @param[in] pPartNumber - new object part number. +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] nIndex - Index of the node to return (0-based). +* @param[out] pNodeInstance - XML Node node. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_SetPartNumberPtr) (Lib3MF_Object pObject, const char * pPartNumber); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_GetNodePtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, Lib3MF_uint64 nIndex, Lib3MF_CustomXMLNode * pNodeInstance); /** -* Retrieves, if an object is a mesh object +* Returns how many nodes of the XML Node have a specific name. * -* @param[in] pObject - Object instance. -* @param[out] pIsMeshObject - returns, whether the object is a mesh object +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pCount - returns the number of nodes with the specified name. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_IsMeshObjectPtr) (Lib3MF_Object pObject, bool * pIsMeshObject); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_CountNodesByNamePtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, Lib3MF_uint64 * pCount); /** -* Retrieves, if an object is a components object +* Returns all the nodes nodes of the XML Node with a specific name. * -* @param[in] pObject - Object instance. -* @param[out] pIsComponentsObject - returns, whether the object is a components object +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pNodes - returns the list of node nodes. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_IsComponentsObjectPtr) (Lib3MF_Object pObject, bool * pIsComponentsObject); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_GetNodesByNamePtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, Lib3MF_CustomXMLNodes * pNodes); /** -* Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. +* Returns if a node with a specific name exist. * -* @param[in] pObject - Object instance. -* @param[out] pIsValid - returns whether the object is a valid object description +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pNodeExists - returns if a node with a specific name exists. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_IsValidPtr) (Lib3MF_Object pObject, bool * pIsValid); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_HasNodePtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool * pNodeExists); /** -* Use an existing attachment as thumbnail for this object +* Returns if a node with a specific name exist once and only once. * -* @param[in] pObject - Object instance. -* @param[in] pAttachment - Instance of a new or the existing thumbnailattachment object. +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pNodeExists - returns if a node with a specific name exists once and only once. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_SetAttachmentAsThumbnailPtr) (Lib3MF_Object pObject, Lib3MF_Attachment pAttachment); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_HasUniqueNodePtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool * pNodeExists); /** -* Get the attachment containing the object thumbnail. +* Returns node with a specific name. Throws an error if name does not exist once and only once. * -* @param[in] pObject - Object instance. -* @param[out] pAttachment - Instance of the thumbnailattachment object or NULL. +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[in] bMustExist - If true, the call fails if node does not exist. If falls, the call will return null if the node does not exist. +* @param[out] pNodeInstance - returns node instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetThumbnailAttachmentPtr) (Lib3MF_Object pObject, Lib3MF_Attachment * pAttachment); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_FindNodePtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool bMustExist, Lib3MF_CustomXMLNode * pNodeInstance); + +/************************************************************************************************************************* + Class definition for CustomDOMTree +**************************************************************************************************************************/ /** -* Clears the attachment. The attachment instance is not removed from the package. +* Returns the namespace identifier for the DOM Tree. * -* @param[in] pObject - Object instance. +* @param[in] pCustomDOMTree - CustomDOMTree instance. +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of returns the namespace of the DOM Tree., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_ClearThumbnailAttachmentPtr) (Lib3MF_Object pObject); +typedef Lib3MFResult (*PLib3MFCustomDOMTree_GetNameSpacePtr) (Lib3MF_CustomDOMTree pCustomDOMTree, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* Returns the outbox of a build item +* Returns root node of the tree. * -* @param[in] pObject - Object instance. -* @param[out] pOutbox - Outbox of this build item +* @param[in] pCustomDOMTree - CustomDOMTree instance. +* @param[out] pRootNode - Root node of the document. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetOutboxPtr) (Lib3MF_Object pObject, sLib3MFBox * pOutbox); +typedef Lib3MFResult (*PLib3MFCustomDOMTree_GetRootNodePtr) (Lib3MF_CustomDOMTree pCustomDOMTree, Lib3MF_CustomXMLNode * pRootNode); /** -* Retrieves an object's uuid string (see production extension specification) +* Saves the XML tree into a string. * -* @param[in] pObject - Object instance. -* @param[out] pHasUUID - flag whether the build item has a UUID -* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pUUIDBuffer - buffer of returns object uuid., may be NULL +* @param[in] pCustomDOMTree - CustomDOMTree instance. +* @param[in] nXMLStringBufferSize - size of the buffer (including trailing 0) +* @param[out] pXMLStringNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pXMLStringBuffer - buffer of String with the XML Content., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetUUIDPtr) (Lib3MF_Object pObject, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); +typedef Lib3MFResult (*PLib3MFCustomDOMTree_SaveToStringPtr) (Lib3MF_CustomDOMTree pCustomDOMTree, const Lib3MF_uint32 nXMLStringBufferSize, Lib3MF_uint32* pXMLStringNeededChars, char * pXMLStringBuffer); + +/************************************************************************************************************************* + Class definition for SliceStackIterator +**************************************************************************************************************************/ /** -* Sets a build object's uuid string (see production extension specification) +* Returns the SliceStack the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] pUUID - new object uuid string. +* @param[in] pSliceStackIterator - SliceStackIterator instance. +* @param[out] pResource - returns the SliceStack instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_SetUUIDPtr) (Lib3MF_Object pObject, const char * pUUID); +typedef Lib3MFResult (*PLib3MFSliceStackIterator_GetCurrentSliceStackPtr) (Lib3MF_SliceStackIterator pSliceStackIterator, Lib3MF_SliceStack * pResource); + +/************************************************************************************************************************* + Class definition for ObjectIterator +**************************************************************************************************************************/ /** -* Returns the metadatagroup of this object +* Returns the Object the iterator points at. * -* @param[in] pObject - Object instance. -* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this object +* @param[in] pObjectIterator - ObjectIterator instance. +* @param[out] pResource - returns the Object instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetMetaDataGroupPtr) (Lib3MF_Object pObject, Lib3MF_MetaDataGroup * pMetaDataGroup); +typedef Lib3MFResult (*PLib3MFObjectIterator_GetCurrentObjectPtr) (Lib3MF_ObjectIterator pObjectIterator, Lib3MF_Object * pResource); + +/************************************************************************************************************************* + Class definition for MeshObjectIterator +**************************************************************************************************************************/ /** -* set the meshresolution of the mesh object +* Returns the MeshObject the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] eMeshResolution - meshresolution of this object +* @param[in] pMeshObjectIterator - MeshObjectIterator instance. +* @param[out] pResource - returns the MeshObject instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_SetSlicesMeshResolutionPtr) (Lib3MF_Object pObject, eLib3MFSlicesMeshResolution eMeshResolution); +typedef Lib3MFResult (*PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) (Lib3MF_MeshObjectIterator pMeshObjectIterator, Lib3MF_MeshObject * pResource); + +/************************************************************************************************************************* + Class definition for ComponentsObjectIterator +**************************************************************************************************************************/ /** -* get the meshresolution of the mesh object +* Returns the ComponentsObject the iterator points at. * -* @param[in] pObject - Object instance. -* @param[out] pMeshResolution - meshresolution of this object +* @param[in] pComponentsObjectIterator - ComponentsObjectIterator instance. +* @param[out] pResource - returns the ComponentsObject instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetSlicesMeshResolutionPtr) (Lib3MF_Object pObject, eLib3MFSlicesMeshResolution * pMeshResolution); +typedef Lib3MFResult (*PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) (Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource); + +/************************************************************************************************************************* + Class definition for Texture2DIterator +**************************************************************************************************************************/ /** -* returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack +* Returns the Texture2D the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] bRecursive - check also all referenced objects? -* @param[out] pHasSlices - does the object have a slice stack? +* @param[in] pTexture2DIterator - Texture2DIterator instance. +* @param[out] pResource - returns the Texture2D instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_HasSlicesPtr) (Lib3MF_Object pObject, bool bRecursive, bool * pHasSlices); +typedef Lib3MFResult (*PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) (Lib3MF_Texture2DIterator pTexture2DIterator, Lib3MF_Texture2D * pResource); + +/************************************************************************************************************************* + Class definition for BaseMaterialGroupIterator +**************************************************************************************************************************/ /** -* unlinks the attached slicestack from this object. If no slice stack is attached, do noting. +* Returns the MaterialGroup the iterator points at. * -* @param[in] pObject - Object instance. +* @param[in] pBaseMaterialGroupIterator - BaseMaterialGroupIterator instance. +* @param[out] pResource - returns the BaseMaterialGroup instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_ClearSliceStackPtr) (Lib3MF_Object pObject); +typedef Lib3MFResult (*PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr) (Lib3MF_BaseMaterialGroupIterator pBaseMaterialGroupIterator, Lib3MF_BaseMaterialGroup * pResource); + +/************************************************************************************************************************* + Class definition for ColorGroupIterator +**************************************************************************************************************************/ /** -* get the Slicestack attached to the object +* Returns the ColorGroup the iterator points at. * -* @param[in] pObject - Object instance. -* @param[out] pSliceStackInstance - returns the slicestack instance +* @param[in] pColorGroupIterator - ColorGroupIterator instance. +* @param[out] pResource - returns the ColorGroup instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetSliceStackPtr) (Lib3MF_Object pObject, Lib3MF_SliceStack * pSliceStackInstance); +typedef Lib3MFResult (*PLib3MFColorGroupIterator_GetCurrentColorGroupPtr) (Lib3MF_ColorGroupIterator pColorGroupIterator, Lib3MF_ColorGroup * pResource); + +/************************************************************************************************************************* + Class definition for Texture2DGroupIterator +**************************************************************************************************************************/ /** -* assigns a slicestack to the object +* Returns the Texture2DGroup the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] pSliceStackInstance - the new slice stack of this Object +* @param[in] pTexture2DGroupIterator - Texture2DGroupIterator instance. +* @param[out] pResource - returns the Texture2DGroup instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_AssignSliceStackPtr) (Lib3MF_Object pObject, Lib3MF_SliceStack pSliceStackInstance); +typedef Lib3MFResult (*PLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupPtr) (Lib3MF_Texture2DGroupIterator pTexture2DGroupIterator, Lib3MF_Texture2DGroup * pResource); /************************************************************************************************************************* - Class definition for MeshObject + Class definition for CompositeMaterialsIterator **************************************************************************************************************************/ /** -* Returns the vertex count of a mesh object. +* Returns the CompositeMaterials the iterator points at. * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pVertexCount - filled with the vertex count. +* @param[in] pCompositeMaterialsIterator - CompositeMaterialsIterator instance. +* @param[out] pResource - returns the CompositeMaterials instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetVertexCountPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); +typedef Lib3MFResult (*PLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsPtr) (Lib3MF_CompositeMaterialsIterator pCompositeMaterialsIterator, Lib3MF_CompositeMaterials * pResource); + +/************************************************************************************************************************* + Class definition for MultiPropertyGroupIterator +**************************************************************************************************************************/ /** -* Returns the triangle count of a mesh object. +* Returns the MultiPropertyGroup the iterator points at. * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pVertexCount - filled with the triangle count. +* @param[in] pMultiPropertyGroupIterator - MultiPropertyGroupIterator instance. +* @param[out] pResource - returns the MultiPropertyGroup instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetTriangleCountPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); +typedef Lib3MFResult (*PLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupPtr) (Lib3MF_MultiPropertyGroupIterator pMultiPropertyGroupIterator, Lib3MF_MultiPropertyGroup * pResource); + +/************************************************************************************************************************* + Class definition for MetaData +**************************************************************************************************************************/ /** -* Returns the vertex count of a mesh object. +* returns the namespace URL of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) -* @param[out] pCoordinates - filled with the vertex coordinates. +* @param[in] pMetaData - MetaData instance. +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of the namespace URL of the metadata, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetVertexPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFPosition * pCoordinates); +typedef Lib3MFResult (*PLib3MFMetaData_GetNameSpacePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* Sets the coordinates of a single vertex of a mesh object +* sets a new namespace URL of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) -* @param[in] pCoordinates - contains the vertex coordinates. +* @param[in] pMetaData - MetaData instance. +* @param[in] pNameSpace - the new namespace URL of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_SetVertexPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFPosition * pCoordinates); +typedef Lib3MFResult (*PLib3MFMetaData_SetNameSpacePtr) (Lib3MF_MetaData pMetaData, const char * pNameSpace); /** -* Adds a single vertex to a mesh object +* returns the name of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] pCoordinates - contains the vertex coordinates. -* @param[out] pNewIndex - Index of the new vertex +* @param[in] pMetaData - MetaData instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of the name of the metadata, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_AddVertexPtr) (Lib3MF_MeshObject pMeshObject, const sLib3MFPosition * pCoordinates, Lib3MF_uint32 * pNewIndex); +typedef Lib3MFResult (*PLib3MFMetaData_GetNamePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Obtains all vertex positions of a mesh object +* sets a new name of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pVerticesBuffer - Position buffer of contains the vertex coordinates. +* @param[in] pMetaData - MetaData instance. +* @param[in] pName - the new name of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetVerticesPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, sLib3MFPosition * pVerticesBuffer); +typedef Lib3MFResult (*PLib3MFMetaData_SetNamePtr) (Lib3MF_MetaData pMetaData, const char * pName); /** -* Returns indices of a single triangle of a mesh object. +* returns the (namespace+name) of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[out] pIndices - filled with the triangle indices. +* @param[in] pMetaData - MetaData instance. +* @param[in] nKeyBufferSize - size of the buffer (including trailing 0) +* @param[out] pKeyNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pKeyBuffer - buffer of the key (namespace+name) of the metadata, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetTrianglePtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFTriangle * pIndices); +typedef Lib3MFResult (*PLib3MFMetaData_GetKeyPtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nKeyBufferSize, Lib3MF_uint32* pKeyNeededChars, char * pKeyBuffer); /** -* Sets the indices of a single triangle of a mesh object. +* returns, whether a metadata must be preserved * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[in] pIndices - contains the triangle indices. +* @param[in] pMetaData - MetaData instance. +* @param[out] pMustPreserve - returns, whether a metadata must be preserved * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_SetTrianglePtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFTriangle * pIndices); +typedef Lib3MFResult (*PLib3MFMetaData_GetMustPreservePtr) (Lib3MF_MetaData pMetaData, bool * pMustPreserve); /** -* Adds a single triangle to a mesh object +* sets whether a metadata must be preserved * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] pIndices - contains the triangle indices. -* @param[out] pNewIndex - Index of the new triangle +* @param[in] pMetaData - MetaData instance. +* @param[in] bMustPreserve - a new value whether a metadata must be preserved * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_AddTrianglePtr) (Lib3MF_MeshObject pMeshObject, const sLib3MFTriangle * pIndices, Lib3MF_uint32 * pNewIndex); +typedef Lib3MFResult (*PLib3MFMetaData_SetMustPreservePtr) (Lib3MF_MetaData pMetaData, bool bMustPreserve); /** -* Get all triangles of a mesh object +* returns the type of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @param[in] pMetaData - MetaData instance. +* @param[in] nTypeBufferSize - size of the buffer (including trailing 0) +* @param[out] pTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pTypeBuffer - buffer of the type of the metadata, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetTriangleIndicesPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, sLib3MFTriangle * pIndicesBuffer); +typedef Lib3MFResult (*PLib3MFMetaData_GetTypePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nTypeBufferSize, Lib3MF_uint32* pTypeNeededChars, char * pTypeBuffer); /** -* Sets the property at the object-level of the mesh object. +* sets a new type of a metadata. This must be a simple XML type * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nUniqueResourceID - the object-level Property UniqueResourceID. -* @param[in] nPropertyID - the object-level PropertyID. +* @param[in] pMetaData - MetaData instance. +* @param[in] pType - a new type of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_SetObjectLevelPropertyPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nUniqueResourceID, Lib3MF_uint32 nPropertyID); +typedef Lib3MFResult (*PLib3MFMetaData_SetTypePtr) (Lib3MF_MetaData pMetaData, const char * pType); /** -* Gets the property at the object-level of the mesh object. +* returns the value of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pUniqueResourceID - the object-level Property UniqueResourceID. -* @param[out] pPropertyID - the object-level PropertyID. -* @param[out] pHasObjectLevelProperty - Has an object-level property been specified? +* @param[in] pMetaData - MetaData instance. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of the value of the metadata, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetObjectLevelPropertyPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pUniqueResourceID, Lib3MF_uint32 * pPropertyID, bool * pHasObjectLevelProperty); +typedef Lib3MFResult (*PLib3MFMetaData_GetValuePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* Sets the properties of a single triangle of a mesh object. +* sets a new value of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[in] pProperties - contains the triangle properties. +* @param[in] pMetaData - MetaData instance. +* @param[in] pValue - a new value of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_SetTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFTriangleProperties * pProperties); +typedef Lib3MFResult (*PLib3MFMetaData_SetValuePtr) (Lib3MF_MetaData pMetaData, const char * pValue); -/** -* Gets the properties of a single triangle of a mesh object. -* -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[out] pProperty - returns the triangle properties. -* @return error code or 0 (success) -*/ -typedef Lib3MFResult (*PLib3MFMeshObject_GetTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFTriangleProperties * pProperty); +/************************************************************************************************************************* + Class definition for MetaDataGroup +**************************************************************************************************************************/ /** -* Sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. +* returns the number of metadata in this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer -* @param[in] pPropertiesArrayBuffer - TriangleProperties buffer of contains the triangle properties array. Must have trianglecount elements. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[out] pCount - returns the number metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_SetAllTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nPropertiesArrayBufferSize, const sLib3MFTriangleProperties * pPropertiesArrayBuffer); +typedef Lib3MFResult (*PLib3MFMetaDataGroup_GetMetaDataCountPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 * pCount); /** -* Gets the properties of all triangles of a mesh object. +* returns a metadata value within this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer -* @param[out] pPropertiesArrayNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertiesArrayBuffer - TriangleProperties buffer of returns the triangle properties array. Must have trianglecount elements. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] nIndex - Index of the Metadata. +* @param[out] pMetaData - an instance of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetAllTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nPropertiesArrayBufferSize, Lib3MF_uint64* pPropertiesArrayNeededCount, sLib3MFTriangleProperties * pPropertiesArrayBuffer); +typedef Lib3MFResult (*PLib3MFMetaDataGroup_GetMetaDataPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex, Lib3MF_MetaData * pMetaData); /** -* Clears all properties of this mesh object (triangle and object-level). +* returns a metadata value within this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] pNameSpace - the namespace of the metadata +* @param[in] pName - the name of the Metadata +* @param[out] pMetaData - an instance of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_ClearAllPropertiesPtr) (Lib3MF_MeshObject pMeshObject); +typedef Lib3MFResult (*PLib3MFMetaDataGroup_GetMetaDataByKeyPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, Lib3MF_MetaData * pMetaData); /** -* Set all triangles of a mesh object +* removes metadata by index from the model. * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[in] pVerticesBuffer - Position buffer of contains the positions. -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[in] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] nIndex - Index of the metadata to remove * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_SetGeometryPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nVerticesBufferSize, const sLib3MFPosition * pVerticesBuffer, Lib3MF_uint64 nIndicesBufferSize, const sLib3MFTriangle * pIndicesBuffer); +typedef Lib3MFResult (*PLib3MFMetaDataGroup_RemoveMetaDataByIndexPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex); /** -* Retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. +* removes metadata from the model. * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pIsManifoldAndOriented - returns, if the object is oriented and manifold. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] pTheMetaData - The metadata to remove * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_IsManifoldAndOrientedPtr) (Lib3MF_MeshObject pMeshObject, bool * pIsManifoldAndOriented); +typedef Lib3MFResult (*PLib3MFMetaDataGroup_RemoveMetaDataPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_MetaData pTheMetaData); /** -* Retrieves the BeamLattice within this MeshObject. +* adds a new metadata to this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pTheBeamLattice - the BeamLattice within this MeshObject +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] pNameSpace - the namespace of the metadata +* @param[in] pName - the name of the metadata +* @param[in] pValue - the value of the metadata +* @param[in] pType - the type of the metadata +* @param[in] bMustPreserve - shuold the metadata be preserved +* @param[out] pMetaData - a new instance of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_BeamLatticePtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_BeamLattice * pTheBeamLattice); +typedef Lib3MFResult (*PLib3MFMetaDataGroup_AddMetaDataPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, const char * pValue, const char * pType, bool bMustPreserve, Lib3MF_MetaData * pMetaData); /************************************************************************************************************************* - Class definition for BeamLattice + Class definition for Object **************************************************************************************************************************/ /** -* Returns the minimal length of beams for the beamlattice. +* Retrieves an object's type * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pMinLength - minimal length of beams for the beamlattice +* @param[in] pObject - Object instance. +* @param[out] pObjectType - returns object type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetMinLengthPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_double * pMinLength); +typedef Lib3MFResult (*PLib3MFObject_GetTypePtr) (Lib3MF_Object pObject, eLib3MFObjectType * pObjectType); /** -* Sets the minimal length of beams for the beamlattice. +* Sets an object's type * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] dMinLength - minimal length of beams for the beamlattice +* @param[in] pObject - Object instance. +* @param[in] eObjectType - object type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetMinLengthPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_double dMinLength); +typedef Lib3MFResult (*PLib3MFObject_SetTypePtr) (Lib3MF_Object pObject, eLib3MFObjectType eObjectType); /** -* Returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* Retrieves an object's name * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pClipMode - contains the clip mode of this mesh -* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object or an undefined value if pClipMode is MODELBEAMLATTICECLIPMODE_NONE +* @param[in] pObject - Object instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns object name., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetClippingPtr) (Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode * pClipMode, Lib3MF_uint32 * pUniqueResourceID); +typedef Lib3MFResult (*PLib3MFObject_GetNamePtr) (Lib3MF_Object pObject, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* Sets an object's name string * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] eClipMode - contains the clip mode of this mesh -* @param[in] nUniqueResourceID - the UniqueResourceID of the clipping mesh-object. This mesh-object has to be defined before setting the Clipping. +* @param[in] pObject - Object instance. +* @param[in] pName - new object name. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetClippingPtr) (Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode eClipMode, Lib3MF_uint32 nUniqueResourceID); +typedef Lib3MFResult (*PLib3MFObject_SetNamePtr) (Lib3MF_Object pObject, const char * pName); /** -* Returns the representation-mesh for the beamlattice of this mesh. +* Retrieves an object's part number * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pHasRepresentation - flag whether the beamlattice has a representation mesh. -* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object. +* @param[in] pObject - Object instance. +* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartNumberBuffer - buffer of returns object part number., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetRepresentationPtr) (Lib3MF_BeamLattice pBeamLattice, bool * pHasRepresentation, Lib3MF_uint32 * pUniqueResourceID); +typedef Lib3MFResult (*PLib3MFObject_GetPartNumberPtr) (Lib3MF_Object pObject, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); /** -* Sets the representation-mesh for the beamlattice of this mesh. +* Sets an objects partnumber string * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nUniqueResourceID - the UniqueResourceID of the representation mesh-object. This mesh-object has to be defined before setting the representation. +* @param[in] pObject - Object instance. +* @param[in] pPartNumber - new object part number. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetRepresentationPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nUniqueResourceID); +typedef Lib3MFResult (*PLib3MFObject_SetPartNumberPtr) (Lib3MF_Object pObject, const char * pPartNumber); /** -* Returns the ball mode and the default ball radius for the beamlattice of this mesh. +* Retrieves, if an object is a mesh object * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pBallMode - contains the ball mode of this mesh -* @param[out] pBallRadius - default ball radius of balls for the beamlattice +* @param[in] pObject - Object instance. +* @param[out] pIsMeshObject - returns, whether the object is a mesh object * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallOptionsPtr) (Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode * pBallMode, Lib3MF_double * pBallRadius); +typedef Lib3MFResult (*PLib3MFObject_IsMeshObjectPtr) (Lib3MF_Object pObject, bool * pIsMeshObject); /** -* Sets the ball mode and thedefault ball radius for the beamlattice. +* Retrieves, if an object is a components object * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] eBallMode - contains the ball mode of this mesh -* @param[in] dBallRadius - default ball radius of balls for the beamlattice +* @param[in] pObject - Object instance. +* @param[out] pIsComponentsObject - returns, whether the object is a components object * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetBallOptionsPtr) (Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode eBallMode, Lib3MF_double dBallRadius); +typedef Lib3MFResult (*PLib3MFObject_IsComponentsObjectPtr) (Lib3MF_Object pObject, bool * pIsComponentsObject); /** -* Returns the beam count of a mesh object. +* Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pCount - filled with the beam count. +* @param[in] pObject - Object instance. +* @param[out] pIsValid - returns whether the object is a valid object description * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamCountPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFObject_IsValidPtr) (Lib3MF_Object pObject, bool * pIsValid); /** -* Returns indices, radii and capmodes of a single beam of a mesh object. +* Use an existing attachment as thumbnail for this object * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the beam (0 to beamcount - 1). -* @param[out] pBeamInfo - filled with the beam indices, radii and capmodes. +* @param[in] pObject - Object instance. +* @param[in] pAttachment - Instance of a new or the existing thumbnailattachment object. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBeam * pBeamInfo); +typedef Lib3MFResult (*PLib3MFObject_SetAttachmentAsThumbnailPtr) (Lib3MF_Object pObject, Lib3MF_Attachment pAttachment); /** -* Adds a single beam to a mesh object. +* Get the attachment containing the object thumbnail. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] pBeamInfo - contains the node indices, radii and capmodes. -* @param[out] pIndex - filled with the new Index of the beam. +* @param[in] pObject - Object instance. +* @param[out] pAttachment - Instance of the thumbnailattachment object or NULL. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_AddBeamPtr) (Lib3MF_BeamLattice pBeamLattice, const sLib3MFBeam * pBeamInfo, Lib3MF_uint32 * pIndex); +typedef Lib3MFResult (*PLib3MFObject_GetThumbnailAttachmentPtr) (Lib3MF_Object pObject, Lib3MF_Attachment * pAttachment); /** -* Sets the indices, radii and capmodes of a single beam of a mesh object. +* Clears the attachment. The attachment instance is not removed from the package. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the beam (0 to beamcount - 1). -* @param[in] pBeamInfo - filled with the beam indices, radii and capmodes. +* @param[in] pObject - Object instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetBeamPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBeam * pBeamInfo); +typedef Lib3MFResult (*PLib3MFObject_ClearThumbnailAttachmentPtr) (Lib3MF_Object pObject); /** -* Sets all beam indices, radii and capmodes of a mesh object. +* Returns the outbox of a build item * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBeamInfoBufferSize - Number of elements in buffer -* @param[in] pBeamInfoBuffer - Beam buffer of contains information of a number of beams +* @param[in] pObject - Object instance. +* @param[out] pOutbox - Outbox of this build item * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetBeamsPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBeamInfoBufferSize, const sLib3MFBeam * pBeamInfoBuffer); +typedef Lib3MFResult (*PLib3MFObject_GetOutboxPtr) (Lib3MF_Object pObject, sLib3MFBox * pOutbox); + +/** +* Retrieves an object's uuid string (see production extension specification) +* +* @param[in] pObject - Object instance. +* @param[out] pHasUUID - flag whether the build item has a UUID +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of returns object uuid., may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_GetUUIDPtr) (Lib3MF_Object pObject, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); + +/** +* Sets a build object's uuid string (see production extension specification) +* +* @param[in] pObject - Object instance. +* @param[in] pUUID - new object uuid string. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_SetUUIDPtr) (Lib3MF_Object pObject, const char * pUUID); + +/** +* Returns the metadatagroup of this object +* +* @param[in] pObject - Object instance. +* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_GetMetaDataGroupPtr) (Lib3MF_Object pObject, Lib3MF_MetaDataGroup * pMetaDataGroup); + +/** +* set the meshresolution of the mesh object +* +* @param[in] pObject - Object instance. +* @param[in] eMeshResolution - meshresolution of this object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_SetSlicesMeshResolutionPtr) (Lib3MF_Object pObject, eLib3MFSlicesMeshResolution eMeshResolution); + +/** +* get the meshresolution of the mesh object +* +* @param[in] pObject - Object instance. +* @param[out] pMeshResolution - meshresolution of this object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_GetSlicesMeshResolutionPtr) (Lib3MF_Object pObject, eLib3MFSlicesMeshResolution * pMeshResolution); + +/** +* returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack +* +* @param[in] pObject - Object instance. +* @param[in] bRecursive - check also all referenced objects? +* @param[out] pHasSlices - does the object have a slice stack? +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_HasSlicesPtr) (Lib3MF_Object pObject, bool bRecursive, bool * pHasSlices); + +/** +* unlinks the attached slicestack from this object. If no slice stack is attached, do noting. +* +* @param[in] pObject - Object instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_ClearSliceStackPtr) (Lib3MF_Object pObject); + +/** +* get the Slicestack attached to the object +* +* @param[in] pObject - Object instance. +* @param[out] pSliceStackInstance - returns the slicestack instance +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_GetSliceStackPtr) (Lib3MF_Object pObject, Lib3MF_SliceStack * pSliceStackInstance); + +/** +* assigns a slicestack to the object +* +* @param[in] pObject - Object instance. +* @param[in] pSliceStackInstance - the new slice stack of this Object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_AssignSliceStackPtr) (Lib3MF_Object pObject, Lib3MF_SliceStack pSliceStackInstance); + +/************************************************************************************************************************* + Class definition for MeshObject +**************************************************************************************************************************/ + +/** +* Returns the vertex count of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pVertexCount - filled with the vertex count. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetVertexCountPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); + +/** +* Returns the triangle count of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pVertexCount - filled with the triangle count. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetTriangleCountPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); + +/** +* Returns the vertex count of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) +* @param[out] pCoordinates - filled with the vertex coordinates. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetVertexPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFPosition * pCoordinates); + +/** +* Sets the coordinates of a single vertex of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) +* @param[in] pCoordinates - contains the vertex coordinates. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_SetVertexPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFPosition * pCoordinates); + +/** +* Adds a single vertex to a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] pCoordinates - contains the vertex coordinates. +* @param[out] pNewIndex - Index of the new vertex +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_AddVertexPtr) (Lib3MF_MeshObject pMeshObject, const sLib3MFPosition * pCoordinates, Lib3MF_uint32 * pNewIndex); + +/** +* Obtains all vertex positions of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pVerticesBuffer - Position buffer of contains the vertex coordinates. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetVerticesPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, sLib3MFPosition * pVerticesBuffer); + +/** +* Returns indices of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[out] pIndices - filled with the triangle indices. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetTrianglePtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFTriangle * pIndices); + +/** +* Sets the indices of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[in] pIndices - contains the triangle indices. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_SetTrianglePtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFTriangle * pIndices); + +/** +* Adds a single triangle to a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] pIndices - contains the triangle indices. +* @param[out] pNewIndex - Index of the new triangle +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_AddTrianglePtr) (Lib3MF_MeshObject pMeshObject, const sLib3MFTriangle * pIndices, Lib3MF_uint32 * pNewIndex); + +/** +* Get all triangles of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetTriangleIndicesPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, sLib3MFTriangle * pIndicesBuffer); + +/** +* Sets the property at the object-level of the mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nUniqueResourceID - the object-level Property UniqueResourceID. +* @param[in] nPropertyID - the object-level PropertyID. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_SetObjectLevelPropertyPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nUniqueResourceID, Lib3MF_uint32 nPropertyID); + +/** +* Gets the property at the object-level of the mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pUniqueResourceID - the object-level Property UniqueResourceID. +* @param[out] pPropertyID - the object-level PropertyID. +* @param[out] pHasObjectLevelProperty - Has an object-level property been specified? +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetObjectLevelPropertyPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pUniqueResourceID, Lib3MF_uint32 * pPropertyID, bool * pHasObjectLevelProperty); + +/** +* Sets the properties of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[in] pProperties - contains the triangle properties. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_SetTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFTriangleProperties * pProperties); + +/** +* Gets the properties of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[out] pProperty - returns the triangle properties. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFTriangleProperties * pProperty); + +/** +* Sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer +* @param[in] pPropertiesArrayBuffer - TriangleProperties buffer of contains the triangle properties array. Must have trianglecount elements. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_SetAllTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nPropertiesArrayBufferSize, const sLib3MFTriangleProperties * pPropertiesArrayBuffer); + +/** +* Gets the properties of all triangles of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer +* @param[out] pPropertiesArrayNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertiesArrayBuffer - TriangleProperties buffer of returns the triangle properties array. Must have trianglecount elements. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetAllTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nPropertiesArrayBufferSize, Lib3MF_uint64* pPropertiesArrayNeededCount, sLib3MFTriangleProperties * pPropertiesArrayBuffer); + +/** +* Clears all properties of this mesh object (triangle and object-level). +* +* @param[in] pMeshObject - MeshObject instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_ClearAllPropertiesPtr) (Lib3MF_MeshObject pMeshObject); + +/** +* Set all triangles of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[in] pVerticesBuffer - Position buffer of contains the positions. +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[in] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_SetGeometryPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nVerticesBufferSize, const sLib3MFPosition * pVerticesBuffer, Lib3MF_uint64 nIndicesBufferSize, const sLib3MFTriangle * pIndicesBuffer); + +/** +* Retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pIsManifoldAndOriented - returns, if the object is oriented and manifold. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_IsManifoldAndOrientedPtr) (Lib3MF_MeshObject pMeshObject, bool * pIsManifoldAndOriented); + +/** +* Retrieves the BeamLattice within this MeshObject. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pTheBeamLattice - the BeamLattice within this MeshObject +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_BeamLatticePtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_BeamLattice * pTheBeamLattice); + +/************************************************************************************************************************* + Class definition for BeamLattice +**************************************************************************************************************************/ + +/** +* Returns the minimal length of beams for the beamlattice. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pMinLength - minimal length of beams for the beamlattice +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetMinLengthPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_double * pMinLength); + +/** +* Sets the minimal length of beams for the beamlattice. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] dMinLength - minimal length of beams for the beamlattice +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetMinLengthPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_double dMinLength); + +/** +* Returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pClipMode - contains the clip mode of this mesh +* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object or an undefined value if pClipMode is MODELBEAMLATTICECLIPMODE_NONE +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetClippingPtr) (Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode * pClipMode, Lib3MF_uint32 * pUniqueResourceID); + +/** +* Sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] eClipMode - contains the clip mode of this mesh +* @param[in] nUniqueResourceID - the UniqueResourceID of the clipping mesh-object. This mesh-object has to be defined before setting the Clipping. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetClippingPtr) (Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode eClipMode, Lib3MF_uint32 nUniqueResourceID); + +/** +* Returns the representation-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pHasRepresentation - flag whether the beamlattice has a representation mesh. +* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetRepresentationPtr) (Lib3MF_BeamLattice pBeamLattice, bool * pHasRepresentation, Lib3MF_uint32 * pUniqueResourceID); + +/** +* Sets the representation-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nUniqueResourceID - the UniqueResourceID of the representation mesh-object. This mesh-object has to be defined before setting the representation. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetRepresentationPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nUniqueResourceID); + +/** +* Returns the ball mode and the default ball radius for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pBallMode - contains the ball mode of this mesh +* @param[out] pBallRadius - default ball radius of balls for the beamlattice +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallOptionsPtr) (Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode * pBallMode, Lib3MF_double * pBallRadius); + +/** +* Sets the ball mode and thedefault ball radius for the beamlattice. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] eBallMode - contains the ball mode of this mesh +* @param[in] dBallRadius - default ball radius of balls for the beamlattice +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetBallOptionsPtr) (Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode eBallMode, Lib3MF_double dBallRadius); + +/** +* Returns the beam count of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pCount - filled with the beam count. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamCountPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); + +/** +* Returns indices, radii and capmodes of a single beam of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the beam (0 to beamcount - 1). +* @param[out] pBeamInfo - filled with the beam indices, radii and capmodes. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBeam * pBeamInfo); + +/** +* Adds a single beam to a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] pBeamInfo - contains the node indices, radii and capmodes. +* @param[out] pIndex - filled with the new Index of the beam. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_AddBeamPtr) (Lib3MF_BeamLattice pBeamLattice, const sLib3MFBeam * pBeamInfo, Lib3MF_uint32 * pIndex); + +/** +* Sets the indices, radii and capmodes of a single beam of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the beam (0 to beamcount - 1). +* @param[in] pBeamInfo - filled with the beam indices, radii and capmodes. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetBeamPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBeam * pBeamInfo); + +/** +* Sets all beam indices, radii and capmodes of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBeamInfoBufferSize - Number of elements in buffer +* @param[in] pBeamInfoBuffer - Beam buffer of contains information of a number of beams +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetBeamsPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBeamInfoBufferSize, const sLib3MFBeam * pBeamInfoBuffer); + +/** +* obtains all beam indices, radii and capmodes of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBeamInfoBufferSize - Number of elements in buffer +* @param[out] pBeamInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBeamInfoBuffer - Beam buffer of contains information of all beams +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamsPtr) (Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBeamInfoBufferSize, Lib3MF_uint64* pBeamInfoNeededCount, sLib3MFBeam * pBeamInfoBuffer); + +/** +* Returns the ball count of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pCount - filled with the ball count. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallCountPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); + +/** +* Returns index and radius of a single ball of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the ball (0 to ballcount - 1). +* @param[out] pBallInfo - filled with the ball node index and radius. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBall * pBallInfo); + +/** +* Adds a single ball to a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] pBallInfo - contains the node index and radius. +* @param[out] pIndex - filled with the new Index of the ball. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_AddBallPtr) (Lib3MF_BeamLattice pBeamLattice, const sLib3MFBall * pBallInfo, Lib3MF_uint32 * pIndex); + +/** +* Sets the index and radius of a single ball of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the ball (0 to ballcount - 1). +* @param[in] pBallInfo - filled with the ball node index and radius. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetBallPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBall * pBallInfo); + +/** +* Sets all ball indices and radii of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBallInfoBufferSize - Number of elements in buffer +* @param[in] pBallInfoBuffer - Ball buffer of contains information of a number of balls +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetBallsPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBallInfoBufferSize, const sLib3MFBall * pBallInfoBuffer); + +/** +* obtains all ball indices and radii of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBallInfoBufferSize - Number of elements in buffer +* @param[out] pBallInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBallInfoBuffer - Ball buffer of contains information of all balls +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallsPtr) (Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBallInfoBufferSize, Lib3MF_uint64* pBallInfoNeededCount, sLib3MFBall * pBallInfoBuffer); + +/** +* Returns the number of beamsets of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pCount - filled with the beamset count. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamSetCountPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); + +/** +* Adds an empty beamset to a mesh object +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pBeamSet - the new beamset +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_AddBeamSetPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_BeamSet * pBeamSet); + +/** +* Returns a beamset of a mesh object +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - index of the requested beamset (0 ... beamsetcount-1). +* @param[out] pBeamSet - the requested beamset +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamSetPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF_BeamSet * pBeamSet); + +/************************************************************************************************************************* + Class definition for Component +**************************************************************************************************************************/ + +/** +* Returns the Resource Instance of the component. +* +* @param[in] pComponent - Component instance. +* @param[out] pObjectResource - filled with the Resource Instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_GetObjectResourcePtr) (Lib3MF_Component pComponent, Lib3MF_Object * pObjectResource); + +/** +* Returns the UniqueResourceID of the component. +* +* @param[in] pComponent - Component instance. +* @param[out] pUniqueResourceID - returns the UniqueResourceID. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_GetObjectResourceIDPtr) (Lib3MF_Component pComponent, Lib3MF_uint32 * pUniqueResourceID); + +/** +* returns, whether a component has a UUID and, if true, the component's UUID +* +* @param[in] pComponent - Component instance. +* @param[out] pHasUUID - flag whether the component has a UUID +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_GetUUIDPtr) (Lib3MF_Component pComponent, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); + +/** +* sets the component's UUID +* +* @param[in] pComponent - Component instance. +* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_SetUUIDPtr) (Lib3MF_Component pComponent, const char * pUUID); + +/** +* Returns, if the component has a different transformation than the identity matrix +* +* @param[in] pComponent - Component instance. +* @param[out] pHasTransform - if true is returned, the transformation is not equal than the identity +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_HasTransformPtr) (Lib3MF_Component pComponent, bool * pHasTransform); + +/** +* Returns the transformation matrix of the component. +* +* @param[in] pComponent - Component instance. +* @param[out] pTransform - filled with the component transformation matrix +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_GetTransformPtr) (Lib3MF_Component pComponent, sLib3MFTransform * pTransform); + +/** +* Sets the transformation matrix of the component. +* +* @param[in] pComponent - Component instance. +* @param[in] pTransform - new transformation matrix +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_SetTransformPtr) (Lib3MF_Component pComponent, const sLib3MFTransform * pTransform); + +/************************************************************************************************************************* + Class definition for ComponentsObject +**************************************************************************************************************************/ + +/** +* Adds a new component to a components object. +* +* @param[in] pComponentsObject - ComponentsObject instance. +* @param[in] pObjectResource - object to add as component. Must not lead to circular references! +* @param[in] pTransform - optional transform matrix for the component. +* @param[out] pComponentInstance - new component instance +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponentsObject_AddComponentPtr) (Lib3MF_ComponentsObject pComponentsObject, Lib3MF_Object pObjectResource, const sLib3MFTransform * pTransform, Lib3MF_Component * pComponentInstance); + +/** +* Retrieves a component from a component object. +* +* @param[in] pComponentsObject - ComponentsObject instance. +* @param[in] nIndex - index of the component to retrieve (0 to componentcount - 1) +* @param[out] pComponentInstance - component instance +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponentsObject_GetComponentPtr) (Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 nIndex, Lib3MF_Component * pComponentInstance); + +/** +* Retrieves a component count of a component object. +* +* @param[in] pComponentsObject - ComponentsObject instance. +* @param[out] pCount - returns the component count +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponentsObject_GetComponentCountPtr) (Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 * pCount); + +/************************************************************************************************************************* + Class definition for BeamSet +**************************************************************************************************************************/ + +/** +* Sets a beamset's name string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] pName - new name of the beamset. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_SetNamePtr) (Lib3MF_BeamSet pBeamSet, const char * pName); + +/** +* Retrieves a beamset's name string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the beamset., may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_GetNamePtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); + +/** +* Sets a beamset's identifier string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] pIdentifier - new name of the beamset. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_SetIdentifierPtr) (Lib3MF_BeamSet pBeamSet, const char * pIdentifier); + +/** +* Retrieves a beamset's identifier string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nIdentifierBufferSize - size of the buffer (including trailing 0) +* @param[out] pIdentifierNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pIdentifierBuffer - buffer of returns the identifier of the beamset., may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_GetIdentifierPtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer); + +/** +* Retrieves the reference count of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[out] pCount - returns the reference count +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_GetReferenceCountPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); + +/** +* Sets the references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nReferencesBufferSize - Number of elements in buffer +* @param[in] pReferencesBuffer - uint32 buffer of the new indices of all beams in this beamset +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_SetReferencesPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nReferencesBufferSize, const Lib3MF_uint32 * pReferencesBuffer); + +/** +* Retrieves the references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nReferencesBufferSize - Number of elements in buffer +* @param[out] pReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pReferencesBuffer - uint32 buffer of retrieves the indices of all beams in this beamset +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_GetReferencesPtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nReferencesBufferSize, Lib3MF_uint64* pReferencesNeededCount, Lib3MF_uint32 * pReferencesBuffer); + +/** +* Retrieves the ball reference count of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[out] pCount - returns the ball reference count +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_GetBallReferenceCountPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); + +/** +* Sets the ball references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nBallReferencesBufferSize - Number of elements in buffer +* @param[in] pBallReferencesBuffer - uint32 buffer of the new indices of all balls in this beamset +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_SetBallReferencesPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nBallReferencesBufferSize, const Lib3MF_uint32 * pBallReferencesBuffer); + +/** +* Retrieves the ball references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nBallReferencesBufferSize - Number of elements in buffer +* @param[out] pBallReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBallReferencesBuffer - uint32 buffer of retrieves the indices of all balls in this beamset +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_GetBallReferencesPtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nBallReferencesBufferSize, Lib3MF_uint64* pBallReferencesNeededCount, Lib3MF_uint32 * pBallReferencesBuffer); + +/************************************************************************************************************************* + Class definition for BaseMaterialGroup +**************************************************************************************************************************/ + +/** +* Retrieves the count of base materials in the material group. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[out] pCount - returns the count of base materials. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetCountPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all materials in this group +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the material in the material group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetAllPropertyIDsPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Adds a new material to the material group +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] pName - new name of the base material. +* @param[in] pDisplayColor - Display color of the material +* @param[out] pPropertyID - returns new PropertyID of the new material in the material group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_AddMaterialPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const char * pName, const sLib3MFColor * pDisplayColor, Lib3MF_uint32 * pPropertyID); + +/** +* Removes a material from the material group. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_RemoveMaterialPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID); + +/** +* Returns the base material's name +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the base material., may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetNamePtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); + +/** +* Sets a base material's name +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] pName - new name of the base material. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_SetNamePtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const char * pName); + +/** +* Sets a base material's display color. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] pTheColor - The base material's display color +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_SetDisplayColorPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor); + +/** +* Returns a base material's display color. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[out] pTheColor - The base material's display color +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetDisplayColorPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor); + +/************************************************************************************************************************* + Class definition for ColorGroup +**************************************************************************************************************************/ + +/** +* Retrieves the count of base materials in this Color Group. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[out] pCount - returns the count of colors within this color group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFColorGroup_GetCountPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all colors within this group +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the color in the color group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFColorGroup_GetAllPropertyIDsPtr) (Lib3MF_ColorGroup pColorGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Adds a new value. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] pTheColor - The new color +* @param[out] pPropertyID - PropertyID of the new color within this color group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFColorGroup_AddColorPtr) (Lib3MF_ColorGroup pColorGroup, const sLib3MFColor * pTheColor, Lib3MF_uint32 * pPropertyID); + +/** +* Removes a color from the color group. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyID - PropertyID of the color to be removed from the color group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFColorGroup_RemoveColorPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID); + +/** +* Sets a color value. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyID - PropertyID of a color within this color group. +* @param[in] pTheColor - The color +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFColorGroup_SetColorPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor); + +/** +* Sets a color value. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyID - PropertyID of a color within this color group. +* @param[out] pTheColor - The color +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFColorGroup_GetColorPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor); + +/************************************************************************************************************************* + Class definition for Texture2DGroup +**************************************************************************************************************************/ + +/** +* Retrieves the count of tex2coords in the Texture2DGroup. +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[out] pCount - returns the count of tex2coords. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetCountPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all tex2coords in this Texture2DGroup +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the tex2coords in the Texture2DGroup. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetAllPropertyIDsPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Adds a new tex2coord to the Texture2DGroup +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. +* @param[out] pPropertyID - returns new PropertyID of the new tex2coord in the Texture2DGroup. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFTexture2DGroup_AddTex2CoordPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, const sLib3MFTex2Coord * pUVCoordinate, Lib3MF_uint32 * pPropertyID); + +/** +* Obtains a tex2coord to the Texture2DGroup +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] nPropertyID - the PropertyID of the tex2coord in the Texture2DGroup. +* @param[out] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetTex2CoordPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID, sLib3MFTex2Coord * pUVCoordinate); + +/** +* Removes a tex2coords from the Texture2DGroup. +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] nPropertyID - PropertyID of the tex2coords in the Texture2DGroup. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFTexture2DGroup_RemoveTex2CoordPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID); + +/** +* Obtains the texture2D instance of this group. +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[out] pTexture2DInstance - the texture2D instance of this group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetTexture2DPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_Texture2D * pTexture2DInstance); + +/************************************************************************************************************************* + Class definition for CompositeMaterials +**************************************************************************************************************************/ + +/** +* Retrieves the count of Composite-s in the CompositeMaterials. +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[out] pCount - returns the count of Composite-s +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetCountPtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the Composite-Mixing Values in the CompositeMaterials. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetAllPropertyIDsPtr) (Lib3MF_CompositeMaterials pCompositeMaterials, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Obtains the BaseMaterialGroup instance of this CompositeMaterials. +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[out] pBaseMaterialGroupInstance - returns the BaseMaterialGroup instance of this CompositeMaterials +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetBaseMaterialGroupPtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance); + +/** +* Adds a new Composite-Mixing Values to the CompositeMaterials. +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nCompositeBufferSize - Number of elements in buffer +* @param[in] pCompositeBuffer - CompositeConstituent buffer of The Composite Constituents to be added as composite +* @param[out] pPropertyID - returns new PropertyID of the new Composite in the CompositeMaterials. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCompositeMaterials_AddCompositePtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint64 nCompositeBufferSize, const sLib3MFCompositeConstituent * pCompositeBuffer, Lib3MF_uint32 * pPropertyID); /** -* obtains all beam indices, radii and capmodes of a mesh object. +* Removes a Composite-Maxing Ratio from the CompositeMaterials. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBeamInfoBufferSize - Number of elements in buffer -* @param[out] pBeamInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBeamInfoBuffer - Beam buffer of contains information of all beams +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nPropertyID - PropertyID of the Composite-Mixing Values in the CompositeMaterials to be removed. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamsPtr) (Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBeamInfoBufferSize, Lib3MF_uint64* pBeamInfoNeededCount, sLib3MFBeam * pBeamInfoBuffer); +typedef Lib3MFResult (*PLib3MFCompositeMaterials_RemoveCompositePtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID); /** -* Returns the ball count of a mesh object. +* Obtains a Composite-Maxing Ratio of this CompositeMaterials. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pCount - filled with the ball count. +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nPropertyID - the PropertyID of the Composite-Maxing Ratio in the CompositeMaterials. +* @param[in] nCompositeBufferSize - Number of elements in buffer +* @param[out] pCompositeNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pCompositeBuffer - CompositeConstituent buffer of The Composite-Mixing Values with the given PropertyID * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallCountPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetCompositePtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nCompositeBufferSize, Lib3MF_uint64* pCompositeNeededCount, sLib3MFCompositeConstituent * pCompositeBuffer); + +/************************************************************************************************************************* + Class definition for MultiPropertyGroup +**************************************************************************************************************************/ /** -* Returns index and radius of a single ball of a mesh object. +* Retrieves the count of MultiProperty-s in the MultiPropertyGroup. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the ball (0 to ballcount - 1). -* @param[out] pBallInfo - filled with the ball node index and radius. +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[out] pCount - returns the count of MultiProperty-s * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBall * pBallInfo); +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetCountPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); /** -* Adds a single ball to a mesh object. +* returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] pBallInfo - contains the node index and radius. -* @param[out] pIndex - filled with the new Index of the ball. +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the MultiProperty-s in the MultiPropertyGroup. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_AddBallPtr) (Lib3MF_BeamLattice pBeamLattice, const sLib3MFBall * pBallInfo, Lib3MF_uint32 * pIndex); +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetAllPropertyIDsPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); /** -* Sets the index and radius of a single ball of a mesh object. +* Adds a new MultiProperty to the MultiPropertyGroup. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the ball (0 to ballcount - 1). -* @param[in] pBallInfo - filled with the ball node index and radius. +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[in] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the new MultiProperty. +* @param[out] pPropertyID - returns the PropertyID of the new MultiProperty in the MultiPropertyGroup. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetBallPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBall * pBallInfo); +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_AddMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer, Lib3MF_uint32 * pPropertyID); /** -* Sets all ball indices and radii of a mesh object. +* Sets the PropertyIDs of a MultiProperty. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBallInfoBufferSize - Number of elements in buffer -* @param[in] pBallInfoBuffer - Ball buffer of contains information of a number of balls +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyID - the PropertyID of the MultiProperty to be changed. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[in] pPropertyIDsBuffer - uint32 buffer of The new PropertyIDs of the MultiProperty * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetBallsPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBallInfoBufferSize, const sLib3MFBall * pBallInfoBuffer); +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_SetMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer); /** -* obtains all ball indices and radii of a mesh object. +* Obtains the PropertyIDs of a MultiProperty. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBallInfoBufferSize - Number of elements in buffer -* @param[out] pBallInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBallInfoBuffer - Ball buffer of contains information of all balls +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyID - the PropertyID of the MultiProperty to be queried. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the MultiProperty +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Removes a MultiProperty from this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyID - the PropertyID of the MultiProperty to be removed. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_RemoveMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID); + +/** +* Retrieves the number of layers of this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[out] pCount - returns the number of layers +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetLayerCountPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); + +/** +* Adds a MultiPropertyLayer to this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] pTheLayer - The MultiPropertyLayer to add to this MultiPropertyGroup +* @param[out] pLayerIndex - returns the index of this MultiPropertyLayer +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_AddLayerPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const sLib3MFMultiPropertyLayer * pTheLayer, Lib3MF_uint32 * pLayerIndex); + +/** +* Obtains a MultiPropertyLayer of this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nLayerIndex - The Index of the MultiPropertyLayer queried +* @param[out] pTheLayer - The MultiPropertyLayer with index LayerIndex within MultiPropertyGroup +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetLayerPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex, sLib3MFMultiPropertyLayer * pTheLayer); + +/** +* Removes a MultiPropertyLayer from this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nLayerIndex - The Index of the MultiPropertyLayer to be removed +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_RemoveLayerPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex); + +/************************************************************************************************************************* + Class definition for Attachment +**************************************************************************************************************************/ + +/** +* Retrieves an attachment's package path. This function will be removed in a later release. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of returns the attachment's package path string, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_GetPathPtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Sets an attachment's package path. This function will be removed in a later release. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pPath - new path of the attachment. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_SetPathPtr) (Lib3MF_Attachment pAttachment, const char * pPath); + +/** +* Returns the PackagePart that is this attachment. +* +* @param[in] pAttachment - Attachment instance. +* @param[out] pPackagePart - The PackagePart of this attachment. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_PackagePartPtr) (Lib3MF_Attachment pAttachment, Lib3MF_PackagePart * pPackagePart); + +/** +* Retrieves an attachment's relationship type +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of returns the attachment's package relationship type string, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_GetRelationShipTypePtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Sets an attachment's relationship type. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pPath - new relationship type string. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_SetRelationShipTypePtr) (Lib3MF_Attachment pAttachment, const char * pPath); + +/** +* Writes out the attachment as file. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pFileName - file to write into. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_WriteToFilePtr) (Lib3MF_Attachment pAttachment, const char * pFileName); + +/** +* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pFileName - file to read from. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_ReadFromFilePtr) (Lib3MF_Attachment pAttachment, const char * pFileName); + +/** +* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pTheReadCallback - Callback to call for reading a data chunk +* @param[in] nStreamSize - number of bytes the callback returns +* @param[in] pTheSeekCallback - Callback to call for seeking in the stream. +* @param[in] pUserData - Userdata that is passed to the callback function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_ReadFromCallbackPtr) (Lib3MF_Attachment pAttachment, Lib3MFReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MFSeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData); + +/** +* Retrieves the size of the attachment stream +* +* @param[in] pAttachment - Attachment instance. +* @param[out] pStreamSize - the stream size +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_GetStreamSizePtr) (Lib3MF_Attachment pAttachment, Lib3MF_uint64 * pStreamSize); + +/** +* Writes out the attachment into a buffer +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nBufferBufferSize - Number of elements in buffer +* @param[out] pBufferNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBufferBuffer - uint8 buffer of Buffer to write into +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_WriteToBufferPtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer); + +/** +* Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nBufferBufferSize - Number of elements in buffer +* @param[in] pBufferBuffer - uint8 buffer of Buffer to read from +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_ReadFromBufferPtr) (Lib3MF_Attachment pAttachment, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer); + +/************************************************************************************************************************* + Class definition for Texture2D +**************************************************************************************************************************/ + +/** +* Retrieves the attachment located at the path of the texture. +* +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pAttachment - attachment that holds the texture's image information. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallsPtr) (Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBallInfoBufferSize, Lib3MF_uint64* pBallInfoNeededCount, sLib3MFBall * pBallInfoBuffer); +typedef Lib3MFResult (*PLib3MFTexture2D_GetAttachmentPtr) (Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment * pAttachment); /** -* Returns the number of beamsets of a mesh object. +* Sets the texture's package path to the path of the attachment. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pCount - filled with the beamset count. +* @param[in] pTexture2D - Texture2D instance. +* @param[in] pAttachment - attachment that holds the texture's image information. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamSetCountPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFTexture2D_SetAttachmentPtr) (Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment pAttachment); /** -* Adds an empty beamset to a mesh object +* Retrieves a texture's content type. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pBeamSet - the new beamset +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pContentType - returns content type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_AddBeamSetPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_BeamSet * pBeamSet); +typedef Lib3MFResult (*PLib3MFTexture2D_GetContentTypePtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureType * pContentType); /** -* Returns a beamset of a mesh object +* Retrieves a texture's content type. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - index of the requested beamset (0 ... beamsetcount-1). -* @param[out] pBeamSet - the requested beamset +* @param[in] pTexture2D - Texture2D instance. +* @param[in] eContentType - new Content Type * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamSetPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF_BeamSet * pBeamSet); - -/************************************************************************************************************************* - Class definition for Component -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFTexture2D_SetContentTypePtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureType eContentType); /** -* Returns the Resource Instance of the component. +* Retrieves a texture's tilestyle type. * -* @param[in] pComponent - Component instance. -* @param[out] pObjectResource - filled with the Resource Instance. +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pTileStyleU - returns tilestyle type enum. +* @param[out] pTileStyleV - returns tilestyle type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_GetObjectResourcePtr) (Lib3MF_Component pComponent, Lib3MF_Object * pObjectResource); +typedef Lib3MFResult (*PLib3MFTexture2D_GetTileStyleUVPtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle * pTileStyleU, eLib3MFTextureTileStyle * pTileStyleV); /** -* Returns the UniqueResourceID of the component. +* Sets a texture's tilestyle type. * -* @param[in] pComponent - Component instance. -* @param[out] pUniqueResourceID - returns the UniqueResourceID. +* @param[in] pTexture2D - Texture2D instance. +* @param[in] eTileStyleU - new tilestyle type enum. +* @param[in] eTileStyleV - new tilestyle type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_GetObjectResourceIDPtr) (Lib3MF_Component pComponent, Lib3MF_uint32 * pUniqueResourceID); +typedef Lib3MFResult (*PLib3MFTexture2D_SetTileStyleUVPtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle eTileStyleU, eLib3MFTextureTileStyle eTileStyleV); /** -* returns, whether a component has a UUID and, if true, the component's UUID +* Retrieves a texture's filter type. * -* @param[in] pComponent - Component instance. -* @param[out] pHasUUID - flag whether the component has a UUID -* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pFilter - returns filter type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_GetUUIDPtr) (Lib3MF_Component pComponent, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); +typedef Lib3MFResult (*PLib3MFTexture2D_GetFilterPtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter * pFilter); /** -* sets the component's UUID +* Sets a texture's filter type. * -* @param[in] pComponent - Component instance. -* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' +* @param[in] pTexture2D - Texture2D instance. +* @param[in] eFilter - sets new filter type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_SetUUIDPtr) (Lib3MF_Component pComponent, const char * pUUID); +typedef Lib3MFResult (*PLib3MFTexture2D_SetFilterPtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter eFilter); + +/************************************************************************************************************************* + Class definition for BuildItem +**************************************************************************************************************************/ /** -* Returns, if the component has a different transformation than the identity matrix +* Retrieves the object resource associated to a build item * -* @param[in] pComponent - Component instance. -* @param[out] pHasTransform - if true is returned, the transformation is not equal than the identity +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pObjectResource - returns the associated resource instance * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_HasTransformPtr) (Lib3MF_Component pComponent, bool * pHasTransform); +typedef Lib3MFResult (*PLib3MFBuildItem_GetObjectResourcePtr) (Lib3MF_BuildItem pBuildItem, Lib3MF_Object * pObjectResource); /** -* Returns the transformation matrix of the component. +* returns, whether a build item has a UUID and, if true, the build item's UUID * -* @param[in] pComponent - Component instance. -* @param[out] pTransform - filled with the component transformation matrix +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pHasUUID - flag whether the build item has a UUID +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_GetTransformPtr) (Lib3MF_Component pComponent, sLib3MFTransform * pTransform); +typedef Lib3MFResult (*PLib3MFBuildItem_GetUUIDPtr) (Lib3MF_BuildItem pBuildItem, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* Sets the transformation matrix of the component. +* sets the build item's UUID * -* @param[in] pComponent - Component instance. -* @param[in] pTransform - new transformation matrix +* @param[in] pBuildItem - BuildItem instance. +* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_SetTransformPtr) (Lib3MF_Component pComponent, const sLib3MFTransform * pTransform); - -/************************************************************************************************************************* - Class definition for ComponentsObject -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFBuildItem_SetUUIDPtr) (Lib3MF_BuildItem pBuildItem, const char * pUUID); /** -* Adds a new component to a components object. +* Retrieves the object UniqueResourceID associated to a build item * -* @param[in] pComponentsObject - ComponentsObject instance. -* @param[in] pObjectResource - object to add as component. Must not lead to circular references! -* @param[in] pTransform - optional transform matrix for the component. -* @param[out] pComponentInstance - new component instance +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pUniqueResourceID - returns the UniqueResourceID of the object * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponentsObject_AddComponentPtr) (Lib3MF_ComponentsObject pComponentsObject, Lib3MF_Object pObjectResource, const sLib3MFTransform * pTransform, Lib3MF_Component * pComponentInstance); +typedef Lib3MFResult (*PLib3MFBuildItem_GetObjectResourceIDPtr) (Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pUniqueResourceID); /** -* Retrieves a component from a component object. +* Checks, if a build item has a non-identity transformation matrix * -* @param[in] pComponentsObject - ComponentsObject instance. -* @param[in] nIndex - index of the component to retrieve (0 to componentcount - 1) -* @param[out] pComponentInstance - component instance +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pHasTransform - returns true, if the transformation matrix is not the identity * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponentsObject_GetComponentPtr) (Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 nIndex, Lib3MF_Component * pComponentInstance); +typedef Lib3MFResult (*PLib3MFBuildItem_HasObjectTransformPtr) (Lib3MF_BuildItem pBuildItem, bool * pHasTransform); /** -* Retrieves a component count of a component object. +* Retrieves a build item's transformation matrix. * -* @param[in] pComponentsObject - ComponentsObject instance. -* @param[out] pCount - returns the component count +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pTransform - returns the transformation matrix * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponentsObject_GetComponentCountPtr) (Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 * pCount); - -/************************************************************************************************************************* - Class definition for BeamSet -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFBuildItem_GetObjectTransformPtr) (Lib3MF_BuildItem pBuildItem, sLib3MFTransform * pTransform); /** -* Sets a beamset's name string +* Sets a build item's transformation matrix. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] pName - new name of the beamset. +* @param[in] pBuildItem - BuildItem instance. +* @param[in] pTransform - new transformation matrix * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_SetNamePtr) (Lib3MF_BeamSet pBeamSet, const char * pName); +typedef Lib3MFResult (*PLib3MFBuildItem_SetObjectTransformPtr) (Lib3MF_BuildItem pBuildItem, const sLib3MFTransform * pTransform); /** -* Retrieves a beamset's name string +* Retrieves a build item's part number string * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of returns the name of the beamset., may be NULL +* @param[in] pBuildItem - BuildItem instance. +* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartNumberBuffer - buffer of Returns a build item's part number string, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_GetNamePtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +typedef Lib3MFResult (*PLib3MFBuildItem_GetPartNumberPtr) (Lib3MF_BuildItem pBuildItem, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); /** -* Sets a beamset's identifier string +* Sets a build item's part number string * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] pIdentifier - new name of the beamset. +* @param[in] pBuildItem - BuildItem instance. +* @param[in] pSetPartnumber - new part number string for referencing parts from the outside world * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_SetIdentifierPtr) (Lib3MF_BeamSet pBeamSet, const char * pIdentifier); +typedef Lib3MFResult (*PLib3MFBuildItem_SetPartNumberPtr) (Lib3MF_BuildItem pBuildItem, const char * pSetPartnumber); /** -* Retrieves a beamset's identifier string +* Returns the metadatagroup of this build item * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nIdentifierBufferSize - size of the buffer (including trailing 0) -* @param[out] pIdentifierNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pIdentifierBuffer - buffer of returns the identifier of the beamset., may be NULL +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this build item * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_GetIdentifierPtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer); +typedef Lib3MFResult (*PLib3MFBuildItem_GetMetaDataGroupPtr) (Lib3MF_BuildItem pBuildItem, Lib3MF_MetaDataGroup * pMetaDataGroup); /** -* Retrieves the reference count of a beamset +* Returns the outbox of a build item * -* @param[in] pBeamSet - BeamSet instance. -* @param[out] pCount - returns the reference count +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pOutbox - Outbox of this build item * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_GetReferenceCountPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFBuildItem_GetOutboxPtr) (Lib3MF_BuildItem pBuildItem, sLib3MFBox * pOutbox); + +/************************************************************************************************************************* + Class definition for BuildItemIterator +**************************************************************************************************************************/ /** -* Sets the references of a beamset +* Iterates to the next build item in the list. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nReferencesBufferSize - Number of elements in buffer -* @param[in] pReferencesBuffer - uint32 buffer of the new indices of all beams in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pHasNext - Iterates to the next build item in the list. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_SetReferencesPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nReferencesBufferSize, const Lib3MF_uint32 * pReferencesBuffer); +typedef Lib3MFResult (*PLib3MFBuildItemIterator_MoveNextPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasNext); /** -* Retrieves the references of a beamset +* Iterates to the previous build item in the list. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nReferencesBufferSize - Number of elements in buffer -* @param[out] pReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pReferencesBuffer - uint32 buffer of retrieves the indices of all beams in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pHasPrevious - Iterates to the previous build item in the list. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_GetReferencesPtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nReferencesBufferSize, Lib3MF_uint64* pReferencesNeededCount, Lib3MF_uint32 * pReferencesBuffer); +typedef Lib3MFResult (*PLib3MFBuildItemIterator_MovePreviousPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasPrevious); /** -* Retrieves the ball reference count of a beamset +* Returns the build item the iterator points at. * -* @param[in] pBeamSet - BeamSet instance. -* @param[out] pCount - returns the ball reference count +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pBuildItem - returns the build item instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_GetBallReferenceCountPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFBuildItemIterator_GetCurrentPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItem * pBuildItem); /** -* Sets the ball references of a beamset +* Creates a new build item iterator with the same build item list. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nBallReferencesBufferSize - Number of elements in buffer -* @param[in] pBallReferencesBuffer - uint32 buffer of the new indices of all balls in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pOutBuildItemIterator - returns the cloned Iterator instance * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_SetBallReferencesPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nBallReferencesBufferSize, const Lib3MF_uint32 * pBallReferencesBuffer); +typedef Lib3MFResult (*PLib3MFBuildItemIterator_ClonePtr) (Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItemIterator * pOutBuildItemIterator); /** -* Retrieves the ball references of a beamset +* Returns the number of build items the iterator captures. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nBallReferencesBufferSize - Number of elements in buffer -* @param[out] pBallReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBallReferencesBuffer - uint32 buffer of retrieves the indices of all balls in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pCount - returns the number of build items the iterator captures. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_GetBallReferencesPtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nBallReferencesBufferSize, Lib3MF_uint64* pBallReferencesNeededCount, Lib3MF_uint32 * pBallReferencesBuffer); +typedef Lib3MFResult (*PLib3MFBuildItemIterator_CountPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_uint64 * pCount); /************************************************************************************************************************* - Class definition for BaseMaterialGroup + Class definition for Slice **************************************************************************************************************************/ /** -* Retrieves the count of base materials in the material group. +* Set all vertices of a slice. All polygons will be cleared. * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[out] pCount - returns the count of base materials. +* @param[in] pSlice - Slice instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[in] pVerticesBuffer - Position2D buffer of contains the positions. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetCountPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFSlice_SetVerticesPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nVerticesBufferSize, const sLib3MFPosition2D * pVerticesBuffer); /** -* returns all the PropertyIDs of all materials in this group +* Get all vertices of a slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the material in the material group. +* @param[in] pSlice - Slice instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pVerticesBuffer - Position2D buffer of contains the positions. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFSlice_GetVerticesPtr) (Lib3MF_Slice pSlice, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, sLib3MFPosition2D * pVerticesBuffer); + +/** +* Get the number of vertices in a slice +* +* @param[in] pSlice - Slice instance. +* @param[out] pCount - the number of vertices in the slice * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetAllPropertyIDsPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFSlice_GetVertexCountPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); /** -* Adds a new material to the material group +* Add a new polygon to this slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] pName - new name of the base material. -* @param[in] pDisplayColor - Display color of the material -* @param[out] pPropertyID - returns new PropertyID of the new material in the material group. +* @param[in] pSlice - Slice instance. +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the new polygon +* @param[out] pIndex - the index of the new polygon * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_AddMaterialPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const char * pName, const sLib3MFColor * pDisplayColor, Lib3MF_uint32 * pPropertyID); +typedef Lib3MFResult (*PLib3MFSlice_AddPolygonPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer, Lib3MF_uint64 * pIndex); /** -* Removes a material from the material group. +* Get the number of polygons in the slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] pSlice - Slice instance. +* @param[out] pCount - the number of polygons in the slice * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_RemoveMaterialPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID); +typedef Lib3MFResult (*PLib3MFSlice_GetPolygonCountPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); /** -* Returns the base material's name +* Set all indices of a polygon * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of returns the name of the base material., may be NULL +* @param[in] pSlice - Slice instance. +* @param[in] nIndex - the index of the polygon to manipulate +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the index-th polygon * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetNamePtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +typedef Lib3MFResult (*PLib3MFSlice_SetPolygonIndicesPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer); /** -* Sets a base material's name +* Get all vertices of a slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[in] pName - new name of the base material. +* @param[in] pSlice - Slice instance. +* @param[in] nIndex - the index of the polygon to manipulate +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pIndicesBuffer - uint32 buffer of the indices of the index-th polygon * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_SetNamePtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const char * pName); +typedef Lib3MFResult (*PLib3MFSlice_GetPolygonIndicesPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF_uint32 * pIndicesBuffer); /** -* Sets a base material's display color. +* Get the number of vertices in a slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[in] pTheColor - The base material's display color +* @param[in] pSlice - Slice instance. +* @param[in] nIndex - the index of the polygon to manipulate +* @param[out] pCount - the number of indices of the index-th polygon * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_SetDisplayColorPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor); +typedef Lib3MFResult (*PLib3MFSlice_GetPolygonIndexCountPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 * pCount); /** -* Returns a base material's display color. +* Get the upper Z-Coordinate of this slice. * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[out] pTheColor - The base material's display color +* @param[in] pSlice - Slice instance. +* @param[out] pZTop - the upper Z-Coordinate of this slice * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetDisplayColorPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor); +typedef Lib3MFResult (*PLib3MFSlice_GetZTopPtr) (Lib3MF_Slice pSlice, Lib3MF_double * pZTop); /************************************************************************************************************************* - Class definition for ColorGroup + Class definition for ToolpathProfile **************************************************************************************************************************/ /** -* Retrieves the count of base materials in this Color Group. +* Retrieves the profile's uuid * -* @param[in] pColorGroup - ColorGroup instance. -* @param[out] pCount - returns the count of colors within this color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroup_GetCountPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetUUIDPtr) (Lib3MF_ToolpathProfile pToolpathProfile, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* returns all the PropertyIDs of all colors within this group +* Retrieves the profile's name * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the color in the color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of Returns the name., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroup_GetAllPropertyIDsPtr) (Lib3MF_ColorGroup pColorGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetNamePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Adds a new value. +* Returns the number of parameters. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] pTheColor - The new color -* @param[out] pPropertyID - PropertyID of the new color within this color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[out] pCount - Returns the number of parameters. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroup_AddColorPtr) (Lib3MF_ColorGroup pColorGroup, const sLib3MFColor * pTheColor, Lib3MF_uint32 * pPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterCountPtr) (Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 * pCount); /** -* Removes a color from the color group. +* Returns the Name of a parameter. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyID - PropertyID of the color to be removed from the color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nIndex - Index of Parameter (0-based). Call will fail if an invalid index is given. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of Returns the name of the parameter., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroup_RemoveColorPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterNamePtr) (Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Sets a color value. +* Returns the NameSpace of a parameter. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyID - PropertyID of a color within this color group. -* @param[in] pTheColor - The color +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nIndex - Index of Parameter (0-based). Call will fail if an invalid index is given. +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of Returns the namespace of the parameter., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroup_SetColorPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterNameSpacePtr) (Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* Sets a color value. +* Checks if a parameter value exists. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyID - PropertyID of a color within this color group. -* @param[out] pTheColor - The color +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValueExists - Returns if a value exists. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroup_GetColorPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor); - -/************************************************************************************************************************* - Class definition for Texture2DGroup -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpathProfile_HasParameterValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool * pValueExists); /** -* Retrieves the count of tex2coords in the Texture2DGroup. +* Retrieves a profile's parameter value. Fails if value does not exist. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[out] pCount - returns the count of tex2coords. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of Returns the value of the field., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetCountPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* returns all the PropertyIDs of all tex2coords in this Texture2DGroup +* Retrieves a profile's parameter value * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the tex2coords in the Texture2DGroup. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] pDefaultValue - Default value if value does not exist. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of Returns the value of the field., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetAllPropertyIDsPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterValueDefPtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const char * pDefaultValue, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* Adds a new tex2coord to the Texture2DGroup +* Retrieves a profile's parameter value as double. Fails if value does not exist or is not a double value. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. -* @param[out] pPropertyID - returns new PropertyID of the new tex2coord in the Texture2DGroup. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroup_AddTex2CoordPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, const sLib3MFTex2Coord * pUVCoordinate, Lib3MF_uint32 * pPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterDoubleValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double * pValue); /** -* Obtains a tex2coord to the Texture2DGroup +* Retrieves a profile's parameter value as double. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] nPropertyID - the PropertyID of the tex2coord in the Texture2DGroup. -* @param[out] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] dDefaultValue - Default value if value does not exist or is not a double value. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetTex2CoordPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID, sLib3MFTex2Coord * pUVCoordinate); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterDoubleValueDefPtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double dDefaultValue, Lib3MF_double * pValue); /** -* Removes a tex2coords from the Texture2DGroup. +* Retrieves a profile's parameter value as integer. Fails if value does not exist or is not a integer value. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] nPropertyID - PropertyID of the tex2coords in the Texture2DGroup. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroup_RemoveTex2CoordPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterIntegerValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 * pValue); /** -* Obtains the texture2D instance of this group. +* Retrieves a profile's parameter value as integer. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[out] pTexture2DInstance - the texture2D instance of this group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] nDefaultValue - Default value if value does not exist or is not a integer value. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetTexture2DPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_Texture2D * pTexture2DInstance); - -/************************************************************************************************************************* - Class definition for CompositeMaterials -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterIntegerValueDefPtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 nDefaultValue, Lib3MF_int64 * pValue); /** -* Retrieves the count of Composite-s in the CompositeMaterials. +* Retrieves a profile's parameter value as boolean. Fails if value does not exist or is not a boolean value. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[out] pCount - returns the count of Composite-s +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetCountPtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterBoolValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool * pValue); /** -* returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials +* Retrieves a profile's parameter value as boolean. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the Composite-Mixing Values in the CompositeMaterials. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] bDefaultValue - Default value if value does not exist or is not a boolean value. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetAllPropertyIDsPtr) (Lib3MF_CompositeMaterials pCompositeMaterials, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterBoolValueDefPtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool bDefaultValue, bool * pValue); /** -* Obtains the BaseMaterialGroup instance of this CompositeMaterials. +* Sets the profile's name * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[out] pBaseMaterialGroupInstance - returns the BaseMaterialGroup instance of this CompositeMaterials +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pName - Returns the name. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetBaseMaterialGroupPtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance); +typedef Lib3MFResult (*PLib3MFToolpathProfile_SetNamePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pName); /** -* Adds a new Composite-Mixing Values to the CompositeMaterials. +* Sets a profile's parameter value. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nCompositeBufferSize - Number of elements in buffer -* @param[in] pCompositeBuffer - CompositeConstituent buffer of The Composite Constituents to be added as composite -* @param[out] pPropertyID - returns new PropertyID of the new Composite in the CompositeMaterials. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] pValue - String value of the parameter. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterials_AddCompositePtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint64 nCompositeBufferSize, const sLib3MFCompositeConstituent * pCompositeBuffer, Lib3MF_uint32 * pPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathProfile_SetParameterValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const char * pValue); /** -* Removes a Composite-Maxing Ratio from the CompositeMaterials. +* Sets a profile's parameter value as double. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nPropertyID - PropertyID of the Composite-Mixing Values in the CompositeMaterials to be removed. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] dValue - Double value of the parameter. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterials_RemoveCompositePtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathProfile_SetParameterDoubleValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double dValue); /** -* Obtains a Composite-Maxing Ratio of this CompositeMaterials. +* Sets a profile's parameter value as integer. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nPropertyID - the PropertyID of the Composite-Maxing Ratio in the CompositeMaterials. -* @param[in] nCompositeBufferSize - Number of elements in buffer -* @param[out] pCompositeNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pCompositeBuffer - CompositeConstituent buffer of The Composite-Mixing Values with the given PropertyID +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] nValue - Integer value of the parameter. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetCompositePtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nCompositeBufferSize, Lib3MF_uint64* pCompositeNeededCount, sLib3MFCompositeConstituent * pCompositeBuffer); - -/************************************************************************************************************************* - Class definition for MultiPropertyGroup -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpathProfile_SetParameterIntegerValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 nValue); /** -* Retrieves the count of MultiProperty-s in the MultiPropertyGroup. +* Sets a profile's parameter value as boolean. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[out] pCount - returns the count of MultiProperty-s +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] bValue - Boolean value of the parameter. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetCountPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFToolpathProfile_SetParameterBoolValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool bValue); + +/************************************************************************************************************************* + Class definition for ToolpathLayerReader +**************************************************************************************************************************/ /** -* returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup +* Retrieves the layerdata's uuid * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the MultiProperty-s in the MultiPropertyGroup. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetAllPropertyIDsPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetLayerDataUUIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* Adds a new MultiProperty to the MultiPropertyGroup. +* Retrieves the count of segments. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[in] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the new MultiProperty. -* @param[out] pPropertyID - returns the PropertyID of the new MultiProperty in the MultiPropertyGroup. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[out] pCount - Count * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_AddMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer, Lib3MF_uint32 * pPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentCountPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 * pCount); /** -* Sets the PropertyIDs of a MultiProperty. +* Retrieves the segment type information . * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyID - the PropertyID of the MultiProperty to be changed. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[in] pPropertyIDsBuffer - uint32 buffer of The new PropertyIDs of the MultiProperty +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pType - Segment Type +* @param[out] pPointCount - Point count of segment. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_SetMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentInfoPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, eLib3MFToolpathSegmentType * pType, Lib3MF_uint32 * pPointCount); /** -* Obtains the PropertyIDs of a MultiProperty. +* Retrieves the assigned segment profile. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyID - the PropertyID of the MultiProperty to be queried. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the MultiProperty +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pProfile - Segment Profile * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentProfilePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_ToolpathProfile * pProfile); /** -* Removes a MultiProperty from this MultiPropertyGroup. +* Retrieves the assigned segment profile uuid. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyID - the PropertyID of the MultiProperty to be removed. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[in] nProfileUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pProfileUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pProfileUUIDBuffer - buffer of Segment Profile UUID, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_RemoveMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentProfileUUIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nProfileUUIDBufferSize, Lib3MF_uint32* pProfileUUIDNeededChars, char * pProfileUUIDBuffer); /** -* Retrieves the number of layers of this MultiPropertyGroup. +* Retrieves the assigned segment profile. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[out] pCount - returns the number of layers +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pBuildItem - Segment Build Item * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetLayerCountPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentPartPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_BuildItem * pBuildItem); /** -* Adds a MultiPropertyLayer to this MultiPropertyGroup. +* Retrieves the assigned segment part uuid. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] pTheLayer - The MultiPropertyLayer to add to this MultiPropertyGroup -* @param[out] pLayerIndex - returns the index of this MultiPropertyLayer +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[in] nPartUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartUUIDBuffer - buffer of Segment Part UUID, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_AddLayerPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const sLib3MFMultiPropertyLayer * pTheLayer, Lib3MF_uint32 * pLayerIndex); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentPartUUIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nPartUUIDBufferSize, Lib3MF_uint32* pPartUUIDNeededChars, char * pPartUUIDBuffer); /** -* Obtains a MultiPropertyLayer of this MultiPropertyGroup. +* Retrieves the assigned segment part id. ATTENTION: This ID is only unique within the layer and there is no guarantee to be globally unique or consistent across layers. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nLayerIndex - The Index of the MultiPropertyLayer queried -* @param[out] pTheLayer - The MultiPropertyLayer with index LayerIndex within MultiPropertyGroup +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pLocalPartID - Local Segment Part ID * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetLayerPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex, sLib3MFMultiPropertyLayer * pTheLayer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentLocalPartIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 * pLocalPartID); /** -* Removes a MultiPropertyLayer from this MultiPropertyGroup. +* Retrieves the global part UUID by the local part ID. Fails if part ID does not exist in this layer. ATTENTION: This ID is only unique within the layer and there is no guarantee to be globally unique or consistent across layers. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nLayerIndex - The Index of the MultiPropertyLayer to be removed +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nLocalPartID - Local Segment Part ID +* @param[in] nPartUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartUUIDBuffer - buffer of Segment Part UUID, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_RemoveLayerPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex); - -/************************************************************************************************************************* - Class definition for Attachment -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nLocalPartID, const Lib3MF_uint32 nPartUUIDBufferSize, Lib3MF_uint32* pPartUUIDNeededChars, char * pPartUUIDBuffer); /** -* Retrieves an attachment's package path. This function will be removed in a later release. +* Retrieves the assigned segment point list. For type hatch, the points are taken pairwise. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nPathBufferSize - size of the buffer (including trailing 0) -* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPathBuffer - buffer of returns the attachment's package path string, may be NULL +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[out] pPointDataNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPointDataBuffer - Position2D buffer of The point data array * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_GetPathPtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentPointDataPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint64 nPointDataBufferSize, Lib3MF_uint64* pPointDataNeededCount, sLib3MFPosition2D * pPointDataBuffer); /** -* Sets an attachment's package path. This function will be removed in a later release. +* Retrieves a segment attribute Information by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pPath - new path of the attachment. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pID - Attribute ID. +* @param[out] pAttributeType - Attribute Type. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_SetPathPtr) (Lib3MF_Attachment pAttachment, const char * pPath); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_FindAttributeInfoByNamePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, Lib3MF_uint32 * pID, eLib3MFToolpathAttributeType * pAttributeType); /** -* Returns the PackagePart that is this attachment. +* Retrieves a segment attribute ID by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[out] pPackagePart - The PackagePart of this attachment. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pID - Attribute ID. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_PackagePartPtr) (Lib3MF_Attachment pAttachment, Lib3MF_PackagePart * pPackagePart); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_FindAttributeIDByNamePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, Lib3MF_uint32 * pID); /** -* Retrieves an attachment's relationship type +* Retrieves a segment attribute Type by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nPathBufferSize - size of the buffer (including trailing 0) -* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPathBuffer - buffer of returns the attachment's package relationship type string, may be NULL +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pAttributeType - Attribute Type. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_GetRelationShipTypePtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_FindAttributeValueByNamePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, eLib3MFToolpathAttributeType * pAttributeType); /** -* Sets an attachment's relationship type. +* Retrieves a segment Uint32 attribute by Attribute ID. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pPath - new relationship type string. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] nID - Attribute ID. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_SetRelationShipTypePtr) (Lib3MF_Attachment pAttachment, const char * pPath); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 nID, Lib3MF_int64 * pValue); /** -* Writes out the attachment as file. +* Retrieves a segment integer attribute by Attribute Name. Will fail if Attribute does not exist or is of different type. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pFileName - file to write into. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_WriteToFilePtr) (Lib3MF_Attachment pAttachment, const char * pFileName); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByNamePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const char * pNameSpace, const char * pAttributeName, Lib3MF_int64 * pValue); /** -* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Retrieves a segment Double attribute by Attribute ID. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pFileName - file to read from. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] nID - Attribute ID. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_ReadFromFilePtr) (Lib3MF_Attachment pAttachment, const char * pFileName); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 nID, Lib3MF_double * pValue); /** -* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Retrieves a segment Double attribute by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pTheReadCallback - Callback to call for reading a data chunk -* @param[in] nStreamSize - number of bytes the callback returns -* @param[in] pTheSeekCallback - Callback to call for seeking in the stream. -* @param[in] pUserData - Userdata that is passed to the callback function +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_ReadFromCallbackPtr) (Lib3MF_Attachment pAttachment, Lib3MFReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MFSeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByNamePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const char * pNameSpace, const char * pAttributeName, Lib3MF_double * pValue); /** -* Retrieves the size of the attachment stream +* Retrieves the count of custom data elements. * -* @param[in] pAttachment - Attachment instance. -* @param[out] pStreamSize - the stream size +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[out] pCount - Count * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_GetStreamSizePtr) (Lib3MF_Attachment pAttachment, Lib3MF_uint64 * pStreamSize); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetCustomDataCountPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 * pCount); /** -* Writes out the attachment into a buffer +* Retrieves the custom data. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nBufferBufferSize - Number of elements in buffer -* @param[out] pBufferNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBufferBuffer - uint8 buffer of Buffer to write into +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_WriteToBufferPtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetCustomDataPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_CustomDOMTree * pData); /** -* Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). +* Retrieves the node name of the custom data. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nBufferBufferSize - Number of elements in buffer -* @param[in] pBufferBuffer - uint8 buffer of Buffer to read from +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of Namespace of the custom data tree., may be NULL +* @param[in] nDataNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pDataNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pDataNameBuffer - buffer of Root name of the data tree., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_ReadFromBufferPtr) (Lib3MF_Attachment pAttachment, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetCustomDataNamePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer, const Lib3MF_uint32 nDataNameBufferSize, Lib3MF_uint32* pDataNameNeededChars, char * pDataNameBuffer); /************************************************************************************************************************* - Class definition for Texture2D + Class definition for ToolpathLayerData **************************************************************************************************************************/ /** -* Retrieves the attachment located at the path of the texture. +* Retrieves the layerdata's uuid * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pAttachment - attachment that holds the texture's image information. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_GetAttachmentPtr) (Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment * pAttachment); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_GetLayerDataUUIDPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* Sets the texture's package path to the path of the attachment. +* Registers a toolpath profile * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] pAttachment - attachment that holds the texture's image information. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pProfile - The toolpath profile to register. +* @param[out] pProfileID - returns the local profile ID for the layer. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_SetAttachmentPtr) (Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment pAttachment); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_RegisterProfilePtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_ToolpathProfile pProfile, Lib3MF_uint32 * pProfileID); /** -* Retrieves a texture's content type. +* Registers a Model Build Item * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pContentType - returns content type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pBuildItem - The model build item to use. +* @param[out] pPartID - returns the local part ID for the layer. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_GetContentTypePtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureType * pContentType); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_RegisterBuildItemPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pPartID); /** -* Retrieves a texture's content type. +* Sets Segment Attribute for all following segments that are added. Overrides previously set attribute. * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] eContentType - new Content Type +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pNameSpace - The namespace of the attribute to register. +* @param[in] pAttributeName - The name of the attribute to register. +* @param[in] pValue - The value of the attribute to register. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_SetContentTypePtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureType eContentType); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_SetSegmentAttributePtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pAttributeName, const char * pValue); /** -* Retrieves a texture's tilestyle type. +* Clears current segment attributes. * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pTileStyleU - returns tilestyle type enum. -* @param[out] pTileStyleV - returns tilestyle type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_GetTileStyleUVPtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle * pTileStyleU, eLib3MFTextureTileStyle * pTileStyleV); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_ClearSegmentAttributesPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData); /** -* Sets a texture's tilestyle type. +* writes hatch data to the layer. * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] eTileStyleU - new tilestyle type enum. -* @param[in] eTileStyleV - new tilestyle type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nProfileID - The toolpath profile to use +* @param[in] nPartID - The toolpath part to use +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[in] pPointDataBuffer - Position2D buffer of The point data * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_SetTileStyleUVPtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle eTileStyleU, eLib3MFTextureTileStyle eTileStyleV); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_WriteHatchDataPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const sLib3MFPosition2D * pPointDataBuffer); /** -* Retrieves a texture's filter type. +* writes loop data to the layer. * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pFilter - returns filter type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nProfileID - The toolpath profile to use +* @param[in] nPartID - The toolpath part to use +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[in] pPointDataBuffer - Position2D buffer of The point data * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_GetFilterPtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter * pFilter); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_WriteLoopPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const sLib3MFPosition2D * pPointDataBuffer); /** -* Sets a texture's filter type. +* writes polyline data to the layer. * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] eFilter - sets new filter type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nProfileID - The toolpath profile to use +* @param[in] nPartID - The toolpath part to use +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[in] pPointDataBuffer - Position2D buffer of The point data * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_SetFilterPtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter eFilter); - -/************************************************************************************************************************* - Class definition for BuildItem -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpathLayerData_WritePolylinePtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const sLib3MFPosition2D * pPointDataBuffer); /** -* Retrieves the object resource associated to a build item +* Adds a custom data DOM tree to the layer. Layer MUST not be finished when changing the DOM tree. * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pObjectResource - returns the associated resource instance +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pDataName - Root name of the data tree. MUST not be empty. MUST be a valid XML name string. +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetObjectResourcePtr) (Lib3MF_BuildItem pBuildItem, Lib3MF_Object * pObjectResource); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_AddCustomDataPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData); /** -* returns, whether a build item has a UUID and, if true, the build item's UUID +* finishes all writing of the layer and compresses toolpath data. * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pHasUUID - flag whether the build item has a UUID -* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL +* @param[in] pToolpathLayerData - ToolpathLayerData instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetUUIDPtr) (Lib3MF_BuildItem pBuildItem, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_FinishPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData); + +/************************************************************************************************************************* + Class definition for Toolpath +**************************************************************************************************************************/ /** -* sets the build item's UUID +* Retrieves the unit factor * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' +* @param[in] pToolpath - Toolpath instance. +* @param[out] pUnits - Returns the unit factor. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_SetUUIDPtr) (Lib3MF_BuildItem pBuildItem, const char * pUUID); +typedef Lib3MFResult (*PLib3MFToolpath_GetUnitsPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_double * pUnits); /** -* Retrieves the object UniqueResourceID associated to a build item +* Retrieves the count of layers * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pUniqueResourceID - returns the UniqueResourceID of the object +* @param[in] pToolpath - Toolpath instance. +* @param[out] pCount - Returns the layer count * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetObjectResourceIDPtr) (Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pUniqueResourceID); +typedef Lib3MFResult (*PLib3MFToolpath_GetLayerCountPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount); /** -* Checks, if a build item has a non-identity transformation matrix +* Retrieves the count of profiles * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pHasTransform - returns true, if the transformation matrix is not the identity +* @param[in] pToolpath - Toolpath instance. +* @param[out] pCount - Returns the profile count * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_HasObjectTransformPtr) (Lib3MF_BuildItem pBuildItem, bool * pHasTransform); +typedef Lib3MFResult (*PLib3MFToolpath_GetProfileCountPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount); /** -* Retrieves a build item's transformation matrix. +* Adds a new toolpath layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pTransform - returns the transformation matrix +* @param[in] pToolpath - Toolpath instance. +* @param[in] nZMax - ZMax value +* @param[in] pPath - Package Path +* @param[in] pModelWriter - The model writer that writes out the 3MF. +* @param[out] pLayerData - Returns the layerdata object to write the layer content into. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetObjectTransformPtr) (Lib3MF_BuildItem pBuildItem, sLib3MFTransform * pTransform); +typedef Lib3MFResult (*PLib3MFToolpath_AddLayerPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nZMax, const char * pPath, Lib3MF_Writer pModelWriter, Lib3MF_ToolpathLayerData * pLayerData); /** -* Sets a build item's transformation matrix. +* Retrieves the Attachment of a layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] pTransform - new transformation matrix +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[out] pAttachment - Attachment * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_SetObjectTransformPtr) (Lib3MF_BuildItem pBuildItem, const sLib3MFTransform * pTransform); +typedef Lib3MFResult (*PLib3MFToolpath_GetLayerAttachmentPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_Attachment * pAttachment); /** -* Retrieves a build item's part number string +* Reads the toolpath of a layer. * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) -* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPartNumberBuffer - buffer of Returns a build item's part number string, may be NULL +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[out] pToolpathReader - Toolpath Reader Instance * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetPartNumberPtr) (Lib3MF_BuildItem pBuildItem, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); +typedef Lib3MFResult (*PLib3MFToolpath_ReadLayerDataPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_ToolpathLayerReader * pToolpathReader); /** -* Sets a build item's part number string +* Retrieves the Path of a layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] pSetPartnumber - new part number string for referencing parts from the outside world +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of Package Path, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_SetPartNumberPtr) (Lib3MF_BuildItem pBuildItem, const char * pSetPartnumber); +typedef Lib3MFResult (*PLib3MFToolpath_GetLayerPathPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); /** -* Returns the metadatagroup of this build item +* Retrieves the ZMax of a layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this build item +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[out] pZMax - ZMax value * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetMetaDataGroupPtr) (Lib3MF_BuildItem pBuildItem, Lib3MF_MetaDataGroup * pMetaDataGroup); +typedef Lib3MFResult (*PLib3MFToolpath_GetLayerZMaxPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_uint32 * pZMax); /** -* Returns the outbox of a build item +* Return the z value of a layer in units. * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pOutbox - Outbox of this build item +* @param[in] pToolpath - Toolpath instance. +* @param[in] nLayerIndex - Layer Index. +* @param[out] pZValue - Z Value in Units. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetOutboxPtr) (Lib3MF_BuildItem pBuildItem, sLib3MFBox * pOutbox); - -/************************************************************************************************************************* - Class definition for BuildItemIterator -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpath_GetLayerZPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nLayerIndex, Lib3MF_uint32 * pZValue); /** -* Iterates to the next build item in the list. +* Adds a new profile to the toolpath. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pHasNext - Iterates to the next build item in the list. +* @param[in] pToolpath - Toolpath instance. +* @param[in] pName - the name. +* @param[out] pProfile - Returns the profile. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItemIterator_MoveNextPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasNext); +typedef Lib3MFResult (*PLib3MFToolpath_AddProfilePtr) (Lib3MF_Toolpath pToolpath, const char * pName, Lib3MF_ToolpathProfile * pProfile); /** -* Iterates to the previous build item in the list. +* Returns a profile of the toolpath. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pHasPrevious - Iterates to the previous build item in the list. +* @param[in] pToolpath - Toolpath instance. +* @param[in] nProfileIndex - Layer Index. +* @param[out] pProfile - Returns the profile. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItemIterator_MovePreviousPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasPrevious); +typedef Lib3MFResult (*PLib3MFToolpath_GetProfilePtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nProfileIndex, Lib3MF_ToolpathProfile * pProfile); /** -* Returns the build item the iterator points at. +* Returns a profile of the toolpath by UUID. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pBuildItem - returns the build item instance. +* @param[in] pToolpath - Toolpath instance. +* @param[in] pProfileUUID - UUID string. +* @param[out] pProfile - Returns the profile. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItemIterator_GetCurrentPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItem * pBuildItem); +typedef Lib3MFResult (*PLib3MFToolpath_GetProfileUUIDPtr) (Lib3MF_Toolpath pToolpath, const char * pProfileUUID, Lib3MF_ToolpathProfile * pProfile); /** -* Creates a new build item iterator with the same build item list. +* Retrieves the count of custom data elements. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pOutBuildItemIterator - returns the cloned Iterator instance +* @param[in] pToolpath - Toolpath instance. +* @param[out] pCount - Count * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItemIterator_ClonePtr) (Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItemIterator * pOutBuildItemIterator); +typedef Lib3MFResult (*PLib3MFToolpath_GetCustomDataCountPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount); /** -* Returns the number of build items the iterator captures. +* Retrieves the custom data. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pCount - returns the number of build items the iterator captures. +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItemIterator_CountPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_uint64 * pCount); - -/************************************************************************************************************************* - Class definition for Slice -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpath_GetCustomDataPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_CustomDOMTree * pData); /** -* Set all vertices of a slice. All polygons will be cleared. +* Retrieves the node name of the custom data. * -* @param[in] pSlice - Slice instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[in] pVerticesBuffer - Position2D buffer of contains the positions. +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of Namespace of the custom data tree., may be NULL +* @param[in] nDataNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pDataNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pDataNameBuffer - buffer of Root name of the data tree., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_SetVerticesPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nVerticesBufferSize, const sLib3MFPosition2D * pVerticesBuffer); +typedef Lib3MFResult (*PLib3MFToolpath_GetCustomDataNamePtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer, const Lib3MF_uint32 nDataNameBufferSize, Lib3MF_uint32* pDataNameNeededChars, char * pDataNameBuffer); /** -* Get all vertices of a slice +* Retrieves if custom data with a specific namespace and name combination exists. * -* @param[in] pSlice - Slice instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pVerticesBuffer - Position2D buffer of contains the positions. +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. +* @param[in] pDataName - Root name of the data tree. +* @param[out] pCustomDataExists - Returns true if DOM Tree Exists. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_GetVerticesPtr) (Lib3MF_Slice pSlice, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, sLib3MFPosition2D * pVerticesBuffer); +typedef Lib3MFResult (*PLib3MFToolpath_HasUniqueCustomDataPtr) (Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, bool * pCustomDataExists); /** -* Get the number of vertices in a slice +* Retrieves the custom data with a specific namespace and name combination. Fails if combination is not unique. * -* @param[in] pSlice - Slice instance. -* @param[out] pCount - the number of vertices in the slice +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. +* @param[in] pDataName - Root name of the data tree. +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_GetVertexCountPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); +typedef Lib3MFResult (*PLib3MFToolpath_FindUniqueCustomDataPtr) (Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData); /** -* Add a new polygon to this slice +* Adds a custom data DOM tree to the toolpath. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the new polygon -* @param[out] pIndex - the index of the new polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pDataName - Root name of the data tree. MUST not be empty. MUST be a valid XML name string. +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_AddPolygonPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer, Lib3MF_uint64 * pIndex); +typedef Lib3MFResult (*PLib3MFToolpath_AddCustomDataPtr) (Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData); /** -* Get the number of polygons in the slice +* Deletes all custom data. * -* @param[in] pSlice - Slice instance. -* @param[out] pCount - the number of polygons in the slice +* @param[in] pToolpath - Toolpath instance. +* @param[out] pNumberOfDeletedItems - Returns number of deleted items. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_GetPolygonCountPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); +typedef Lib3MFResult (*PLib3MFToolpath_ClearCustomDataPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pNumberOfDeletedItems); /** -* Set all indices of a polygon +* Deletes a custom data instance from the list. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndex - the index of the polygon to manipulate -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the index-th polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pData - DOM Tree of the data. +* @param[out] pSuccess - Returns if deletion was successful. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_SetPolygonIndicesPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer); +typedef Lib3MFResult (*PLib3MFToolpath_DeleteCustomDataPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_CustomDOMTree pData, bool * pSuccess); /** -* Get all vertices of a slice +* Registers an Integer Attribute that each segment holds. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndex - the index of the polygon to manipulate -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pIndicesBuffer - uint32 buffer of the indices of the index-th polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pAttributeName - Attribute name. MUST not be empty. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_GetPolygonIndicesPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF_uint32 * pIndicesBuffer); +typedef Lib3MFResult (*PLib3MFToolpath_RegisterCustomIntegerAttributePtr) (Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pAttributeName); /** -* Get the number of vertices in a slice +* Registers a Double Attribute that each segment holds. Registering only applies to reader or writer objects created after the call. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndex - the index of the polygon to manipulate -* @param[out] pCount - the number of indices of the index-th polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pAttributeName - Attribute name. MUST not be empty. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_GetPolygonIndexCountPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 * pCount); +typedef Lib3MFResult (*PLib3MFToolpath_RegisterCustomDoubleAttributePtr) (Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pAttributeName); + +/************************************************************************************************************************* + Class definition for ToolpathIterator +**************************************************************************************************************************/ /** -* Get the upper Z-Coordinate of this slice. +* Returns the Toolpath the iterator points at. * -* @param[in] pSlice - Slice instance. -* @param[out] pZTop - the upper Z-Coordinate of this slice +* @param[in] pToolpathIterator - ToolpathIterator instance. +* @param[out] pResource - returns the Toolpath instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_GetZTopPtr) (Lib3MF_Slice pSlice, Lib3MF_double * pZTop); +typedef Lib3MFResult (*PLib3MFToolpathIterator_GetCurrentToolpathPtr) (Lib3MF_ToolpathIterator pToolpathIterator, Lib3MF_Toolpath * pResource); /************************************************************************************************************************* Class definition for SliceStack @@ -3261,6 +4668,15 @@ typedef Lib3MFResult (*PLib3MFModel_GetCompositeMaterialsPtr) (Lib3MF_Model pMod */ typedef Lib3MFResult (*PLib3MFModel_GetMultiPropertyGroupsPtr) (Lib3MF_Model pModel, Lib3MF_MultiPropertyGroupIterator * pResourceIterator); +/** +* creates a Toolpath instance with all toolpath resources. +* +* @param[in] pModel - Model instance. +* @param[out] pResourceIterator - returns the iterator instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_GetToolpathsPtr) (Lib3MF_Model pModel, Lib3MF_ToolpathIterator * pResourceIterator); + /** * creates a resource iterator instance with all slice stack resources. * @@ -3384,6 +4800,16 @@ typedef Lib3MFResult (*PLib3MFModel_AddBuildItemPtr) (Lib3MF_Model pModel, Lib3M */ typedef Lib3MFResult (*PLib3MFModel_RemoveBuildItemPtr) (Lib3MF_Model pModel, Lib3MF_BuildItem pBuildItemInstance); +/** +* adds an empty Toolpath resource to the model. +* +* @param[in] pModel - Model instance. +* @param[in] dUnitFactor - The toolpath instance of the created Toolpath. +* @param[out] pToolpathInstance - The toolpath instance of the created Toolpath. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_AddToolpathPtr) (Lib3MF_Model pModel, Lib3MF_double dUnitFactor, Lib3MF_Toolpath * pToolpathInstance); + /** * Returns the metadata of the model as MetaDataGroup * @@ -3515,6 +4941,40 @@ typedef Lib3MFResult (*PLib3MFModel_SetRandomNumberCallbackPtr) (Lib3MF_Model pM */ typedef Lib3MFResult (*PLib3MFModel_GetKeyStorePtr) (Lib3MF_Model pModel, Lib3MF_KeyStore * pKeyStore); +/** +* Creates an OPC Reader Source from a file. +* +* @param[in] pModel - Model instance. +* @param[in] pFilename - Filename to read from +* @param[out] pInstance - The instance of the created reader source +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_CreatePersistentSourceFromFilePtr) (Lib3MF_Model pModel, const char * pFilename, Lib3MF_PersistentReaderSource * pInstance); + +/** +* Creates an OPC Reader Source from a memory buffer. The memory buffer MUST exist as long as the Source object exists. +* +* @param[in] pModel - Model instance. +* @param[in] nBufferBufferSize - Number of elements in buffer +* @param[in] pBufferBuffer - uint8 buffer of Buffer to read from +* @param[out] pInstance - The instance of the created reader source +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_CreatePersistentSourceFromBufferPtr) (Lib3MF_Model pModel, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer, Lib3MF_PersistentReaderSource * pInstance); + +/** +* Creates an OPC Reader Source from a data provided by a callback function. The callbacks MUST exist as long as the source object exists. +* +* @param[in] pModel - Model instance. +* @param[in] pTheReadCallback - Callback to call for reading a data chunk +* @param[in] nStreamSize - number of bytes the callback returns +* @param[in] pTheSeekCallback - Callback to call for seeking in the stream. +* @param[in] pUserData - Userdata that is passed to the callback function +* @param[out] pInstance - The instance of the created reader source +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_CreatePersistentSourceFromCallbackPtr) (Lib3MF_Model pModel, Lib3MFReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MFSeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData, Lib3MF_PersistentReaderSource * pInstance); + /************************************************************************************************************************* Global functions **************************************************************************************************************************/ @@ -3720,6 +5180,13 @@ typedef Lib3MFResult (*PLib3MFGetTranslationTransformPtr) (Lib3MF_single fVector typedef struct { void * m_LibraryHandle; PLib3MFBase_ClassTypeIdPtr m_Base_ClassTypeId; + PLib3MFBinaryStream_GetBinaryPathPtr m_BinaryStream_GetBinaryPath; + PLib3MFBinaryStream_GetIndexPathPtr m_BinaryStream_GetIndexPath; + PLib3MFBinaryStream_GetUUIDPtr m_BinaryStream_GetUUID; + PLib3MFBinaryStream_DisableDiscretizedArrayCompressionPtr m_BinaryStream_DisableDiscretizedArrayCompression; + PLib3MFBinaryStream_EnableDiscretizedArrayCompressionPtr m_BinaryStream_EnableDiscretizedArrayCompression; + PLib3MFBinaryStream_EnableLZMAPtr m_BinaryStream_EnableLZMA; + PLib3MFBinaryStream_DisableLZMAPtr m_BinaryStream_DisableLZMA; PLib3MFWriter_WriteToFilePtr m_Writer_WriteToFile; PLib3MFWriter_GetStreamSizePtr m_Writer_GetStreamSize; PLib3MFWriter_WriteToBufferPtr m_Writer_WriteToBuffer; @@ -3733,6 +5200,13 @@ typedef struct { PLib3MFWriter_GetWarningCountPtr m_Writer_GetWarningCount; PLib3MFWriter_AddKeyWrappingCallbackPtr m_Writer_AddKeyWrappingCallback; PLib3MFWriter_SetContentEncryptionCallbackPtr m_Writer_SetContentEncryptionCallback; + PLib3MFWriter_CreateBinaryStreamPtr m_Writer_CreateBinaryStream; + PLib3MFWriter_AssignBinaryStreamPtr m_Writer_AssignBinaryStream; + PLib3MFWriter_RegisterCustomNamespacePtr m_Writer_RegisterCustomNamespace; + PLib3MFPersistentReaderSource_GetSourceTypePtr m_PersistentReaderSource_GetSourceType; + PLib3MFPersistentReaderSource_InvalidateSourceDataPtr m_PersistentReaderSource_InvalidateSourceData; + PLib3MFPersistentReaderSource_SourceDataIsValidPtr m_PersistentReaderSource_SourceDataIsValid; + PLib3MFReader_ReadFromPersistentSourcePtr m_Reader_ReadFromPersistentSource; PLib3MFReader_ReadFromFilePtr m_Reader_ReadFromFile; PLib3MFReader_ReadFromBufferPtr m_Reader_ReadFromBuffer; PLib3MFReader_ReadFromCallbackPtr m_Reader_ReadFromCallback; @@ -3757,6 +5231,51 @@ typedef struct { PLib3MFResourceIterator_GetCurrentPtr m_ResourceIterator_GetCurrent; PLib3MFResourceIterator_ClonePtr m_ResourceIterator_Clone; PLib3MFResourceIterator_CountPtr m_ResourceIterator_Count; + PLib3MFCustomXMLAttribute_GetNamePtr m_CustomXMLAttribute_GetName; + PLib3MFCustomXMLAttribute_GetValuePtr m_CustomXMLAttribute_GetValue; + PLib3MFCustomXMLAttribute_IsValidIntegerPtr m_CustomXMLAttribute_IsValidInteger; + PLib3MFCustomXMLAttribute_GetIntegerValuePtr m_CustomXMLAttribute_GetIntegerValue; + PLib3MFCustomXMLAttribute_IsValidDoublePtr m_CustomXMLAttribute_IsValidDouble; + PLib3MFCustomXMLAttribute_GetDoubleValuePtr m_CustomXMLAttribute_GetDoubleValue; + PLib3MFCustomXMLAttribute_IsValidBoolPtr m_CustomXMLAttribute_IsValidBool; + PLib3MFCustomXMLAttribute_GetBoolValuePtr m_CustomXMLAttribute_GetBoolValue; + PLib3MFCustomXMLAttribute_SetValuePtr m_CustomXMLAttribute_SetValue; + PLib3MFCustomXMLAttribute_SetIntegerValuePtr m_CustomXMLAttribute_SetIntegerValue; + PLib3MFCustomXMLAttribute_SetDoubleValuePtr m_CustomXMLAttribute_SetDoubleValue; + PLib3MFCustomXMLAttribute_SetBoolValuePtr m_CustomXMLAttribute_SetBoolValue; + PLib3MFCustomXMLAttribute_RemovePtr m_CustomXMLAttribute_Remove; + PLib3MFCustomXMLNode_GetNamePtr m_CustomXMLNode_GetName; + PLib3MFCustomXMLNode_GetNameSpacePtr m_CustomXMLNode_GetNameSpace; + PLib3MFCustomXMLNode_GetAttributeCountPtr m_CustomXMLNode_GetAttributeCount; + PLib3MFCustomXMLNode_GetAttributePtr m_CustomXMLNode_GetAttribute; + PLib3MFCustomXMLNode_HasAttributePtr m_CustomXMLNode_HasAttribute; + PLib3MFCustomXMLNode_FindAttributePtr m_CustomXMLNode_FindAttribute; + PLib3MFCustomXMLNode_RemoveAttributePtr m_CustomXMLNode_RemoveAttribute; + PLib3MFCustomXMLNode_RemoveAttributeByIndexPtr m_CustomXMLNode_RemoveAttributeByIndex; + PLib3MFCustomXMLNode_AddAttributePtr m_CustomXMLNode_AddAttribute; + PLib3MFCustomXMLNode_AddIntegerAttributePtr m_CustomXMLNode_AddIntegerAttribute; + PLib3MFCustomXMLNode_AddDoubleAttributePtr m_CustomXMLNode_AddDoubleAttribute; + PLib3MFCustomXMLNode_AddBoolAttributePtr m_CustomXMLNode_AddBoolAttribute; + PLib3MFCustomXMLNode_GetChildrenPtr m_CustomXMLNode_GetChildren; + PLib3MFCustomXMLNode_CountChildrenByNamePtr m_CustomXMLNode_CountChildrenByName; + PLib3MFCustomXMLNode_GetChildrenByNamePtr m_CustomXMLNode_GetChildrenByName; + PLib3MFCustomXMLNode_HasChildPtr m_CustomXMLNode_HasChild; + PLib3MFCustomXMLNode_HasUniqueChildPtr m_CustomXMLNode_HasUniqueChild; + PLib3MFCustomXMLNode_FindChildPtr m_CustomXMLNode_FindChild; + PLib3MFCustomXMLNode_AddChildPtr m_CustomXMLNode_AddChild; + PLib3MFCustomXMLNode_RemoveChildPtr m_CustomXMLNode_RemoveChild; + PLib3MFCustomXMLNode_RemoveChildrenWithNamePtr m_CustomXMLNode_RemoveChildrenWithName; + PLib3MFCustomXMLNode_RemovePtr m_CustomXMLNode_Remove; + PLib3MFCustomXMLNodes_GetNodeCountPtr m_CustomXMLNodes_GetNodeCount; + PLib3MFCustomXMLNodes_GetNodePtr m_CustomXMLNodes_GetNode; + PLib3MFCustomXMLNodes_CountNodesByNamePtr m_CustomXMLNodes_CountNodesByName; + PLib3MFCustomXMLNodes_GetNodesByNamePtr m_CustomXMLNodes_GetNodesByName; + PLib3MFCustomXMLNodes_HasNodePtr m_CustomXMLNodes_HasNode; + PLib3MFCustomXMLNodes_HasUniqueNodePtr m_CustomXMLNodes_HasUniqueNode; + PLib3MFCustomXMLNodes_FindNodePtr m_CustomXMLNodes_FindNode; + PLib3MFCustomDOMTree_GetNameSpacePtr m_CustomDOMTree_GetNameSpace; + PLib3MFCustomDOMTree_GetRootNodePtr m_CustomDOMTree_GetRootNode; + PLib3MFCustomDOMTree_SaveToStringPtr m_CustomDOMTree_SaveToString; PLib3MFSliceStackIterator_GetCurrentSliceStackPtr m_SliceStackIterator_GetCurrentSliceStack; PLib3MFObjectIterator_GetCurrentObjectPtr m_ObjectIterator_GetCurrentObject; PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr m_MeshObjectIterator_GetCurrentMeshObject; @@ -3949,6 +5468,78 @@ typedef struct { PLib3MFSlice_GetPolygonIndicesPtr m_Slice_GetPolygonIndices; PLib3MFSlice_GetPolygonIndexCountPtr m_Slice_GetPolygonIndexCount; PLib3MFSlice_GetZTopPtr m_Slice_GetZTop; + PLib3MFToolpathProfile_GetUUIDPtr m_ToolpathProfile_GetUUID; + PLib3MFToolpathProfile_GetNamePtr m_ToolpathProfile_GetName; + PLib3MFToolpathProfile_GetParameterCountPtr m_ToolpathProfile_GetParameterCount; + PLib3MFToolpathProfile_GetParameterNamePtr m_ToolpathProfile_GetParameterName; + PLib3MFToolpathProfile_GetParameterNameSpacePtr m_ToolpathProfile_GetParameterNameSpace; + PLib3MFToolpathProfile_HasParameterValuePtr m_ToolpathProfile_HasParameterValue; + PLib3MFToolpathProfile_GetParameterValuePtr m_ToolpathProfile_GetParameterValue; + PLib3MFToolpathProfile_GetParameterValueDefPtr m_ToolpathProfile_GetParameterValueDef; + PLib3MFToolpathProfile_GetParameterDoubleValuePtr m_ToolpathProfile_GetParameterDoubleValue; + PLib3MFToolpathProfile_GetParameterDoubleValueDefPtr m_ToolpathProfile_GetParameterDoubleValueDef; + PLib3MFToolpathProfile_GetParameterIntegerValuePtr m_ToolpathProfile_GetParameterIntegerValue; + PLib3MFToolpathProfile_GetParameterIntegerValueDefPtr m_ToolpathProfile_GetParameterIntegerValueDef; + PLib3MFToolpathProfile_GetParameterBoolValuePtr m_ToolpathProfile_GetParameterBoolValue; + PLib3MFToolpathProfile_GetParameterBoolValueDefPtr m_ToolpathProfile_GetParameterBoolValueDef; + PLib3MFToolpathProfile_SetNamePtr m_ToolpathProfile_SetName; + PLib3MFToolpathProfile_SetParameterValuePtr m_ToolpathProfile_SetParameterValue; + PLib3MFToolpathProfile_SetParameterDoubleValuePtr m_ToolpathProfile_SetParameterDoubleValue; + PLib3MFToolpathProfile_SetParameterIntegerValuePtr m_ToolpathProfile_SetParameterIntegerValue; + PLib3MFToolpathProfile_SetParameterBoolValuePtr m_ToolpathProfile_SetParameterBoolValue; + PLib3MFToolpathLayerReader_GetLayerDataUUIDPtr m_ToolpathLayerReader_GetLayerDataUUID; + PLib3MFToolpathLayerReader_GetSegmentCountPtr m_ToolpathLayerReader_GetSegmentCount; + PLib3MFToolpathLayerReader_GetSegmentInfoPtr m_ToolpathLayerReader_GetSegmentInfo; + PLib3MFToolpathLayerReader_GetSegmentProfilePtr m_ToolpathLayerReader_GetSegmentProfile; + PLib3MFToolpathLayerReader_GetSegmentProfileUUIDPtr m_ToolpathLayerReader_GetSegmentProfileUUID; + PLib3MFToolpathLayerReader_GetSegmentPartPtr m_ToolpathLayerReader_GetSegmentPart; + PLib3MFToolpathLayerReader_GetSegmentPartUUIDPtr m_ToolpathLayerReader_GetSegmentPartUUID; + PLib3MFToolpathLayerReader_GetSegmentLocalPartIDPtr m_ToolpathLayerReader_GetSegmentLocalPartID; + PLib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDPtr m_ToolpathLayerReader_GetPartUUIDByLocalPartID; + PLib3MFToolpathLayerReader_GetSegmentPointDataPtr m_ToolpathLayerReader_GetSegmentPointData; + PLib3MFToolpathLayerReader_FindAttributeInfoByNamePtr m_ToolpathLayerReader_FindAttributeInfoByName; + PLib3MFToolpathLayerReader_FindAttributeIDByNamePtr m_ToolpathLayerReader_FindAttributeIDByName; + PLib3MFToolpathLayerReader_FindAttributeValueByNamePtr m_ToolpathLayerReader_FindAttributeValueByName; + PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByIDPtr m_ToolpathLayerReader_GetSegmentIntegerAttributeByID; + PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByNamePtr m_ToolpathLayerReader_GetSegmentIntegerAttributeByName; + PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByIDPtr m_ToolpathLayerReader_GetSegmentDoubleAttributeByID; + PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByNamePtr m_ToolpathLayerReader_GetSegmentDoubleAttributeByName; + PLib3MFToolpathLayerReader_GetCustomDataCountPtr m_ToolpathLayerReader_GetCustomDataCount; + PLib3MFToolpathLayerReader_GetCustomDataPtr m_ToolpathLayerReader_GetCustomData; + PLib3MFToolpathLayerReader_GetCustomDataNamePtr m_ToolpathLayerReader_GetCustomDataName; + PLib3MFToolpathLayerData_GetLayerDataUUIDPtr m_ToolpathLayerData_GetLayerDataUUID; + PLib3MFToolpathLayerData_RegisterProfilePtr m_ToolpathLayerData_RegisterProfile; + PLib3MFToolpathLayerData_RegisterBuildItemPtr m_ToolpathLayerData_RegisterBuildItem; + PLib3MFToolpathLayerData_SetSegmentAttributePtr m_ToolpathLayerData_SetSegmentAttribute; + PLib3MFToolpathLayerData_ClearSegmentAttributesPtr m_ToolpathLayerData_ClearSegmentAttributes; + PLib3MFToolpathLayerData_WriteHatchDataPtr m_ToolpathLayerData_WriteHatchData; + PLib3MFToolpathLayerData_WriteLoopPtr m_ToolpathLayerData_WriteLoop; + PLib3MFToolpathLayerData_WritePolylinePtr m_ToolpathLayerData_WritePolyline; + PLib3MFToolpathLayerData_AddCustomDataPtr m_ToolpathLayerData_AddCustomData; + PLib3MFToolpathLayerData_FinishPtr m_ToolpathLayerData_Finish; + PLib3MFToolpath_GetUnitsPtr m_Toolpath_GetUnits; + PLib3MFToolpath_GetLayerCountPtr m_Toolpath_GetLayerCount; + PLib3MFToolpath_GetProfileCountPtr m_Toolpath_GetProfileCount; + PLib3MFToolpath_AddLayerPtr m_Toolpath_AddLayer; + PLib3MFToolpath_GetLayerAttachmentPtr m_Toolpath_GetLayerAttachment; + PLib3MFToolpath_ReadLayerDataPtr m_Toolpath_ReadLayerData; + PLib3MFToolpath_GetLayerPathPtr m_Toolpath_GetLayerPath; + PLib3MFToolpath_GetLayerZMaxPtr m_Toolpath_GetLayerZMax; + PLib3MFToolpath_GetLayerZPtr m_Toolpath_GetLayerZ; + PLib3MFToolpath_AddProfilePtr m_Toolpath_AddProfile; + PLib3MFToolpath_GetProfilePtr m_Toolpath_GetProfile; + PLib3MFToolpath_GetProfileUUIDPtr m_Toolpath_GetProfileUUID; + PLib3MFToolpath_GetCustomDataCountPtr m_Toolpath_GetCustomDataCount; + PLib3MFToolpath_GetCustomDataPtr m_Toolpath_GetCustomData; + PLib3MFToolpath_GetCustomDataNamePtr m_Toolpath_GetCustomDataName; + PLib3MFToolpath_HasUniqueCustomDataPtr m_Toolpath_HasUniqueCustomData; + PLib3MFToolpath_FindUniqueCustomDataPtr m_Toolpath_FindUniqueCustomData; + PLib3MFToolpath_AddCustomDataPtr m_Toolpath_AddCustomData; + PLib3MFToolpath_ClearCustomDataPtr m_Toolpath_ClearCustomData; + PLib3MFToolpath_DeleteCustomDataPtr m_Toolpath_DeleteCustomData; + PLib3MFToolpath_RegisterCustomIntegerAttributePtr m_Toolpath_RegisterCustomIntegerAttribute; + PLib3MFToolpath_RegisterCustomDoubleAttributePtr m_Toolpath_RegisterCustomDoubleAttribute; + PLib3MFToolpathIterator_GetCurrentToolpathPtr m_ToolpathIterator_GetCurrentToolpath; PLib3MFSliceStack_GetBottomZPtr m_SliceStack_GetBottomZ; PLib3MFSliceStack_GetSliceCountPtr m_SliceStack_GetSliceCount; PLib3MFSliceStack_GetSlicePtr m_SliceStack_GetSlice; @@ -4032,6 +5623,7 @@ typedef struct { PLib3MFModel_GetTexture2DGroupsPtr m_Model_GetTexture2DGroups; PLib3MFModel_GetCompositeMaterialsPtr m_Model_GetCompositeMaterials; PLib3MFModel_GetMultiPropertyGroupsPtr m_Model_GetMultiPropertyGroups; + PLib3MFModel_GetToolpathsPtr m_Model_GetToolpaths; PLib3MFModel_GetSliceStacksPtr m_Model_GetSliceStacks; PLib3MFModel_MergeToModelPtr m_Model_MergeToModel; PLib3MFModel_AddMeshObjectPtr m_Model_AddMeshObject; @@ -4045,6 +5637,7 @@ typedef struct { PLib3MFModel_AddMultiPropertyGroupPtr m_Model_AddMultiPropertyGroup; PLib3MFModel_AddBuildItemPtr m_Model_AddBuildItem; PLib3MFModel_RemoveBuildItemPtr m_Model_RemoveBuildItem; + PLib3MFModel_AddToolpathPtr m_Model_AddToolpath; PLib3MFModel_GetMetaDataGroupPtr m_Model_GetMetaDataGroup; PLib3MFModel_AddAttachmentPtr m_Model_AddAttachment; PLib3MFModel_RemoveAttachmentPtr m_Model_RemoveAttachment; @@ -4059,6 +5652,9 @@ typedef struct { PLib3MFModel_RemoveCustomContentTypePtr m_Model_RemoveCustomContentType; PLib3MFModel_SetRandomNumberCallbackPtr m_Model_SetRandomNumberCallback; PLib3MFModel_GetKeyStorePtr m_Model_GetKeyStore; + PLib3MFModel_CreatePersistentSourceFromFilePtr m_Model_CreatePersistentSourceFromFile; + PLib3MFModel_CreatePersistentSourceFromBufferPtr m_Model_CreatePersistentSourceFromBuffer; + PLib3MFModel_CreatePersistentSourceFromCallbackPtr m_Model_CreatePersistentSourceFromCallback; PLib3MFGetLibraryVersionPtr m_GetLibraryVersion; PLib3MFGetPrereleaseInformationPtr m_GetPrereleaseInformation; PLib3MFGetBuildInformationPtr m_GetBuildInformation; diff --git a/Autogenerated/Bindings/Go/lib3mf_impl.go b/Autogenerated/Bindings/Go/lib3mf_impl.go index f91e68c3b..b06afc33d 100644 --- a/Autogenerated/Bindings/Go/lib3mf_impl.go +++ b/Autogenerated/Bindings/Go/lib3mf_impl.go @@ -29,489 +29,534 @@ This file has been generated by the Automatic Component Toolkit (ACT) version 1. Abstract: This is an autogenerated Go implementation file in order to allow an easy use of the 3MF Library -Interface version: 2.3.2 +Interface version: 2.3.0 */ + package lib3mf // #include import "C" import ( - "errors" - "fmt" - "syscall" - "unsafe" + "fmt" + "errors" + "syscall" + "unsafe" ) type Lib3MFImplementation struct { - Initialized bool - DLLHandle syscall.Handle - Lib3MF_writer_writetofile uintptr - Lib3MF_writer_getstreamsize uintptr - Lib3MF_writer_writetobuffer uintptr - Lib3MF_writer_writetocallback uintptr - Lib3MF_writer_setprogresscallback uintptr - Lib3MF_writer_getdecimalprecision uintptr - Lib3MF_writer_setdecimalprecision uintptr - Lib3MF_writer_setstrictmodeactive uintptr - Lib3MF_writer_getstrictmodeactive uintptr - Lib3MF_writer_getwarning uintptr - Lib3MF_writer_getwarningcount uintptr - Lib3MF_writer_addkeywrappingcallback uintptr - Lib3MF_writer_setcontentencryptioncallback uintptr - Lib3MF_reader_readfromfile uintptr - Lib3MF_reader_readfrombuffer uintptr - Lib3MF_reader_readfromcallback uintptr - Lib3MF_reader_setprogresscallback uintptr - Lib3MF_reader_addrelationtoread uintptr - Lib3MF_reader_removerelationtoread uintptr - Lib3MF_reader_setstrictmodeactive uintptr - Lib3MF_reader_getstrictmodeactive uintptr - Lib3MF_reader_getwarning uintptr - Lib3MF_reader_getwarningcount uintptr - Lib3MF_reader_addkeywrappingcallback uintptr - Lib3MF_reader_setcontentencryptioncallback uintptr - Lib3MF_packagepart_getpath uintptr - Lib3MF_packagepart_setpath uintptr - Lib3MF_resource_getresourceid uintptr - Lib3MF_resource_getuniqueresourceid uintptr - Lib3MF_resource_packagepart uintptr - Lib3MF_resource_setpackagepart uintptr - Lib3MF_resource_getmodelresourceid uintptr - Lib3MF_resourceiterator_movenext uintptr - Lib3MF_resourceiterator_moveprevious uintptr - Lib3MF_resourceiterator_getcurrent uintptr - Lib3MF_resourceiterator_clone uintptr - Lib3MF_resourceiterator_count uintptr - Lib3MF_slicestackiterator_getcurrentslicestack uintptr - Lib3MF_objectiterator_getcurrentobject uintptr - Lib3MF_meshobjectiterator_getcurrentmeshobject uintptr - Lib3MF_componentsobjectiterator_getcurrentcomponentsobject uintptr - Lib3MF_texture2diterator_getcurrenttexture2d uintptr - Lib3MF_basematerialgroupiterator_getcurrentbasematerialgroup uintptr - Lib3MF_colorgroupiterator_getcurrentcolorgroup uintptr - Lib3MF_texture2dgroupiterator_getcurrenttexture2dgroup uintptr + Initialized bool + DLLHandle syscall.Handle + Lib3MF_writer_writetofile uintptr + Lib3MF_writer_getstreamsize uintptr + Lib3MF_writer_writetobuffer uintptr + Lib3MF_writer_writetocallback uintptr + Lib3MF_writer_setprogresscallback uintptr + Lib3MF_writer_getdecimalprecision uintptr + Lib3MF_writer_setdecimalprecision uintptr + Lib3MF_writer_setstrictmodeactive uintptr + Lib3MF_writer_getstrictmodeactive uintptr + Lib3MF_writer_getwarning uintptr + Lib3MF_writer_getwarningcount uintptr + Lib3MF_writer_addkeywrappingcallback uintptr + Lib3MF_writer_setcontentencryptioncallback uintptr + Lib3MF_persistentreadersource_getsourcetype uintptr + Lib3MF_persistentreadersource_invalidatesourcedata uintptr + Lib3MF_persistentreadersource_sourcedataisvalid uintptr + Lib3MF_reader_readfrompersistentsource uintptr + Lib3MF_reader_readfromfile uintptr + Lib3MF_reader_readfrombuffer uintptr + Lib3MF_reader_readfromcallback uintptr + Lib3MF_reader_setprogresscallback uintptr + Lib3MF_reader_addrelationtoread uintptr + Lib3MF_reader_removerelationtoread uintptr + Lib3MF_reader_setstrictmodeactive uintptr + Lib3MF_reader_getstrictmodeactive uintptr + Lib3MF_reader_getwarning uintptr + Lib3MF_reader_getwarningcount uintptr + Lib3MF_reader_addkeywrappingcallback uintptr + Lib3MF_reader_setcontentencryptioncallback uintptr + Lib3MF_packagepart_getpath uintptr + Lib3MF_packagepart_setpath uintptr + Lib3MF_resource_getresourceid uintptr + Lib3MF_resource_getuniqueresourceid uintptr + Lib3MF_resource_packagepart uintptr + Lib3MF_resource_setpackagepart uintptr + Lib3MF_resource_getmodelresourceid uintptr + Lib3MF_resourceiterator_movenext uintptr + Lib3MF_resourceiterator_moveprevious uintptr + Lib3MF_resourceiterator_getcurrent uintptr + Lib3MF_resourceiterator_clone uintptr + Lib3MF_resourceiterator_count uintptr + Lib3MF_slicestackiterator_getcurrentslicestack uintptr + Lib3MF_objectiterator_getcurrentobject uintptr + Lib3MF_meshobjectiterator_getcurrentmeshobject uintptr + Lib3MF_componentsobjectiterator_getcurrentcomponentsobject uintptr + Lib3MF_texture2diterator_getcurrenttexture2d uintptr + Lib3MF_basematerialgroupiterator_getcurrentbasematerialgroup uintptr + Lib3MF_colorgroupiterator_getcurrentcolorgroup uintptr + Lib3MF_texture2dgroupiterator_getcurrenttexture2dgroup uintptr Lib3MF_compositematerialsiterator_getcurrentcompositematerials uintptr Lib3MF_multipropertygroupiterator_getcurrentmultipropertygroup uintptr - Lib3MF_metadata_getnamespace uintptr - Lib3MF_metadata_setnamespace uintptr - Lib3MF_metadata_getname uintptr - Lib3MF_metadata_setname uintptr - Lib3MF_metadata_getkey uintptr - Lib3MF_metadata_getmustpreserve uintptr - Lib3MF_metadata_setmustpreserve uintptr - Lib3MF_metadata_gettype uintptr - Lib3MF_metadata_settype uintptr - Lib3MF_metadata_getvalue uintptr - Lib3MF_metadata_setvalue uintptr - Lib3MF_metadatagroup_getmetadatacount uintptr - Lib3MF_metadatagroup_getmetadata uintptr - Lib3MF_metadatagroup_getmetadatabykey uintptr - Lib3MF_metadatagroup_removemetadatabyindex uintptr - Lib3MF_metadatagroup_removemetadata uintptr - Lib3MF_metadatagroup_addmetadata uintptr - Lib3MF_object_gettype uintptr - Lib3MF_object_settype uintptr - Lib3MF_object_getname uintptr - Lib3MF_object_setname uintptr - Lib3MF_object_getpartnumber uintptr - Lib3MF_object_setpartnumber uintptr - Lib3MF_object_ismeshobject uintptr - Lib3MF_object_iscomponentsobject uintptr - Lib3MF_object_isvalid uintptr - Lib3MF_object_setattachmentasthumbnail uintptr - Lib3MF_object_getthumbnailattachment uintptr - Lib3MF_object_clearthumbnailattachment uintptr - Lib3MF_object_getoutbox uintptr - Lib3MF_object_getuuid uintptr - Lib3MF_object_setuuid uintptr - Lib3MF_object_getmetadatagroup uintptr - Lib3MF_object_setslicesmeshresolution uintptr - Lib3MF_object_getslicesmeshresolution uintptr - Lib3MF_object_hasslices uintptr - Lib3MF_object_clearslicestack uintptr - Lib3MF_object_getslicestack uintptr - Lib3MF_object_assignslicestack uintptr - Lib3MF_meshobject_getvertexcount uintptr - Lib3MF_meshobject_gettrianglecount uintptr - Lib3MF_meshobject_getvertex uintptr - Lib3MF_meshobject_setvertex uintptr - Lib3MF_meshobject_addvertex uintptr - Lib3MF_meshobject_getvertices uintptr - Lib3MF_meshobject_gettriangle uintptr - Lib3MF_meshobject_settriangle uintptr - Lib3MF_meshobject_addtriangle uintptr - Lib3MF_meshobject_gettriangleindices uintptr - Lib3MF_meshobject_setobjectlevelproperty uintptr - Lib3MF_meshobject_getobjectlevelproperty uintptr - Lib3MF_meshobject_settriangleproperties uintptr - Lib3MF_meshobject_gettriangleproperties uintptr - Lib3MF_meshobject_setalltriangleproperties uintptr - Lib3MF_meshobject_getalltriangleproperties uintptr - Lib3MF_meshobject_clearallproperties uintptr - Lib3MF_meshobject_setgeometry uintptr - Lib3MF_meshobject_ismanifoldandoriented uintptr - Lib3MF_meshobject_beamlattice uintptr - Lib3MF_beamlattice_getminlength uintptr - Lib3MF_beamlattice_setminlength uintptr - Lib3MF_beamlattice_getclipping uintptr - Lib3MF_beamlattice_setclipping uintptr - Lib3MF_beamlattice_getrepresentation uintptr - Lib3MF_beamlattice_setrepresentation uintptr - Lib3MF_beamlattice_getballoptions uintptr - Lib3MF_beamlattice_setballoptions uintptr - Lib3MF_beamlattice_getbeamcount uintptr - Lib3MF_beamlattice_getbeam uintptr - Lib3MF_beamlattice_addbeam uintptr - Lib3MF_beamlattice_setbeam uintptr - Lib3MF_beamlattice_setbeams uintptr - Lib3MF_beamlattice_getbeams uintptr - Lib3MF_beamlattice_getballcount uintptr - Lib3MF_beamlattice_getball uintptr - Lib3MF_beamlattice_addball uintptr - Lib3MF_beamlattice_setball uintptr - Lib3MF_beamlattice_setballs uintptr - Lib3MF_beamlattice_getballs uintptr - Lib3MF_beamlattice_getbeamsetcount uintptr - Lib3MF_beamlattice_addbeamset uintptr - Lib3MF_beamlattice_getbeamset uintptr - Lib3MF_component_getobjectresource uintptr - Lib3MF_component_getobjectresourceid uintptr - Lib3MF_component_getuuid uintptr - Lib3MF_component_setuuid uintptr - Lib3MF_component_hastransform uintptr - Lib3MF_component_gettransform uintptr - Lib3MF_component_settransform uintptr - Lib3MF_componentsobject_addcomponent uintptr - Lib3MF_componentsobject_getcomponent uintptr - Lib3MF_componentsobject_getcomponentcount uintptr - Lib3MF_beamset_setname uintptr - Lib3MF_beamset_getname uintptr - Lib3MF_beamset_setidentifier uintptr - Lib3MF_beamset_getidentifier uintptr - Lib3MF_beamset_getreferencecount uintptr - Lib3MF_beamset_setreferences uintptr - Lib3MF_beamset_getreferences uintptr - Lib3MF_beamset_getballreferencecount uintptr - Lib3MF_beamset_setballreferences uintptr - Lib3MF_beamset_getballreferences uintptr - Lib3MF_basematerialgroup_getcount uintptr - Lib3MF_basematerialgroup_getallpropertyids uintptr - Lib3MF_basematerialgroup_addmaterial uintptr - Lib3MF_basematerialgroup_removematerial uintptr - Lib3MF_basematerialgroup_getname uintptr - Lib3MF_basematerialgroup_setname uintptr - Lib3MF_basematerialgroup_setdisplaycolor uintptr - Lib3MF_basematerialgroup_getdisplaycolor uintptr - Lib3MF_colorgroup_getcount uintptr - Lib3MF_colorgroup_getallpropertyids uintptr - Lib3MF_colorgroup_addcolor uintptr - Lib3MF_colorgroup_removecolor uintptr - Lib3MF_colorgroup_setcolor uintptr - Lib3MF_colorgroup_getcolor uintptr - Lib3MF_texture2dgroup_getcount uintptr - Lib3MF_texture2dgroup_getallpropertyids uintptr - Lib3MF_texture2dgroup_addtex2coord uintptr - Lib3MF_texture2dgroup_gettex2coord uintptr - Lib3MF_texture2dgroup_removetex2coord uintptr - Lib3MF_texture2dgroup_gettexture2d uintptr - Lib3MF_compositematerials_getcount uintptr - Lib3MF_compositematerials_getallpropertyids uintptr - Lib3MF_compositematerials_getbasematerialgroup uintptr - Lib3MF_compositematerials_addcomposite uintptr - Lib3MF_compositematerials_removecomposite uintptr - Lib3MF_compositematerials_getcomposite uintptr - Lib3MF_multipropertygroup_getcount uintptr - Lib3MF_multipropertygroup_getallpropertyids uintptr - Lib3MF_multipropertygroup_addmultiproperty uintptr - Lib3MF_multipropertygroup_setmultiproperty uintptr - Lib3MF_multipropertygroup_getmultiproperty uintptr - Lib3MF_multipropertygroup_removemultiproperty uintptr - Lib3MF_multipropertygroup_getlayercount uintptr - Lib3MF_multipropertygroup_addlayer uintptr - Lib3MF_multipropertygroup_getlayer uintptr - Lib3MF_multipropertygroup_removelayer uintptr - Lib3MF_attachment_getpath uintptr - Lib3MF_attachment_setpath uintptr - Lib3MF_attachment_packagepart uintptr - Lib3MF_attachment_getrelationshiptype uintptr - Lib3MF_attachment_setrelationshiptype uintptr - Lib3MF_attachment_writetofile uintptr - Lib3MF_attachment_readfromfile uintptr - Lib3MF_attachment_readfromcallback uintptr - Lib3MF_attachment_getstreamsize uintptr - Lib3MF_attachment_writetobuffer uintptr - Lib3MF_attachment_readfrombuffer uintptr - Lib3MF_texture2d_getattachment uintptr - Lib3MF_texture2d_setattachment uintptr - Lib3MF_texture2d_getcontenttype uintptr - Lib3MF_texture2d_setcontenttype uintptr - Lib3MF_texture2d_gettilestyleuv uintptr - Lib3MF_texture2d_settilestyleuv uintptr - Lib3MF_texture2d_getfilter uintptr - Lib3MF_texture2d_setfilter uintptr - Lib3MF_builditem_getobjectresource uintptr - Lib3MF_builditem_getuuid uintptr - Lib3MF_builditem_setuuid uintptr - Lib3MF_builditem_getobjectresourceid uintptr - Lib3MF_builditem_hasobjecttransform uintptr - Lib3MF_builditem_getobjecttransform uintptr - Lib3MF_builditem_setobjecttransform uintptr - Lib3MF_builditem_getpartnumber uintptr - Lib3MF_builditem_setpartnumber uintptr - Lib3MF_builditem_getmetadatagroup uintptr - Lib3MF_builditem_getoutbox uintptr - Lib3MF_builditemiterator_movenext uintptr - Lib3MF_builditemiterator_moveprevious uintptr - Lib3MF_builditemiterator_getcurrent uintptr - Lib3MF_builditemiterator_clone uintptr - Lib3MF_builditemiterator_count uintptr - Lib3MF_slice_setvertices uintptr - Lib3MF_slice_getvertices uintptr - Lib3MF_slice_getvertexcount uintptr - Lib3MF_slice_addpolygon uintptr - Lib3MF_slice_getpolygoncount uintptr - Lib3MF_slice_setpolygonindices uintptr - Lib3MF_slice_getpolygonindices uintptr - Lib3MF_slice_getpolygonindexcount uintptr - Lib3MF_slice_getztop uintptr - Lib3MF_slicestack_getbottomz uintptr - Lib3MF_slicestack_getslicecount uintptr - Lib3MF_slicestack_getslice uintptr - Lib3MF_slicestack_addslice uintptr - Lib3MF_slicestack_getslicerefcount uintptr - Lib3MF_slicestack_addslicestackreference uintptr - Lib3MF_slicestack_getslicestackreference uintptr - Lib3MF_slicestack_collapseslicereferences uintptr - Lib3MF_slicestack_setownpath uintptr - Lib3MF_slicestack_getownpath uintptr - Lib3MF_consumer_getconsumerid uintptr - Lib3MF_consumer_getkeyid uintptr - Lib3MF_consumer_getkeyvalue uintptr - Lib3MF_accessright_getconsumer uintptr - Lib3MF_accessright_getwrappingalgorithm uintptr - Lib3MF_accessright_getmgfalgorithm uintptr - Lib3MF_accessright_getdigestmethod uintptr - Lib3MF_contentencryptionparams_getencryptionalgorithm uintptr - Lib3MF_contentencryptionparams_getkey uintptr - Lib3MF_contentencryptionparams_getinitializationvector uintptr - Lib3MF_contentencryptionparams_getauthenticationtag uintptr - Lib3MF_contentencryptionparams_setauthenticationtag uintptr + Lib3MF_metadata_getnamespace uintptr + Lib3MF_metadata_setnamespace uintptr + Lib3MF_metadata_getname uintptr + Lib3MF_metadata_setname uintptr + Lib3MF_metadata_getkey uintptr + Lib3MF_metadata_getmustpreserve uintptr + Lib3MF_metadata_setmustpreserve uintptr + Lib3MF_metadata_gettype uintptr + Lib3MF_metadata_settype uintptr + Lib3MF_metadata_getvalue uintptr + Lib3MF_metadata_setvalue uintptr + Lib3MF_metadatagroup_getmetadatacount uintptr + Lib3MF_metadatagroup_getmetadata uintptr + Lib3MF_metadatagroup_getmetadatabykey uintptr + Lib3MF_metadatagroup_removemetadatabyindex uintptr + Lib3MF_metadatagroup_removemetadata uintptr + Lib3MF_metadatagroup_addmetadata uintptr + Lib3MF_object_gettype uintptr + Lib3MF_object_settype uintptr + Lib3MF_object_getname uintptr + Lib3MF_object_setname uintptr + Lib3MF_object_getpartnumber uintptr + Lib3MF_object_setpartnumber uintptr + Lib3MF_object_ismeshobject uintptr + Lib3MF_object_iscomponentsobject uintptr + Lib3MF_object_isvalid uintptr + Lib3MF_object_setattachmentasthumbnail uintptr + Lib3MF_object_getthumbnailattachment uintptr + Lib3MF_object_clearthumbnailattachment uintptr + Lib3MF_object_getoutbox uintptr + Lib3MF_object_getuuid uintptr + Lib3MF_object_setuuid uintptr + Lib3MF_object_getmetadatagroup uintptr + Lib3MF_object_setslicesmeshresolution uintptr + Lib3MF_object_getslicesmeshresolution uintptr + Lib3MF_object_hasslices uintptr + Lib3MF_object_clearslicestack uintptr + Lib3MF_object_getslicestack uintptr + Lib3MF_object_assignslicestack uintptr + Lib3MF_meshobject_getvertexcount uintptr + Lib3MF_meshobject_gettrianglecount uintptr + Lib3MF_meshobject_getvertex uintptr + Lib3MF_meshobject_setvertex uintptr + Lib3MF_meshobject_addvertex uintptr + Lib3MF_meshobject_getvertices uintptr + Lib3MF_meshobject_gettriangle uintptr + Lib3MF_meshobject_settriangle uintptr + Lib3MF_meshobject_addtriangle uintptr + Lib3MF_meshobject_gettriangleindices uintptr + Lib3MF_meshobject_setobjectlevelproperty uintptr + Lib3MF_meshobject_getobjectlevelproperty uintptr + Lib3MF_meshobject_settriangleproperties uintptr + Lib3MF_meshobject_gettriangleproperties uintptr + Lib3MF_meshobject_setalltriangleproperties uintptr + Lib3MF_meshobject_getalltriangleproperties uintptr + Lib3MF_meshobject_clearallproperties uintptr + Lib3MF_meshobject_setgeometry uintptr + Lib3MF_meshobject_ismanifoldandoriented uintptr + Lib3MF_meshobject_beamlattice uintptr + Lib3MF_beamlattice_getminlength uintptr + Lib3MF_beamlattice_setminlength uintptr + Lib3MF_beamlattice_getclipping uintptr + Lib3MF_beamlattice_setclipping uintptr + Lib3MF_beamlattice_getrepresentation uintptr + Lib3MF_beamlattice_setrepresentation uintptr + Lib3MF_beamlattice_getballoptions uintptr + Lib3MF_beamlattice_setballoptions uintptr + Lib3MF_beamlattice_getbeamcount uintptr + Lib3MF_beamlattice_getbeam uintptr + Lib3MF_beamlattice_addbeam uintptr + Lib3MF_beamlattice_setbeam uintptr + Lib3MF_beamlattice_setbeams uintptr + Lib3MF_beamlattice_getbeams uintptr + Lib3MF_beamlattice_getballcount uintptr + Lib3MF_beamlattice_getball uintptr + Lib3MF_beamlattice_addball uintptr + Lib3MF_beamlattice_setball uintptr + Lib3MF_beamlattice_setballs uintptr + Lib3MF_beamlattice_getballs uintptr + Lib3MF_beamlattice_getbeamsetcount uintptr + Lib3MF_beamlattice_addbeamset uintptr + Lib3MF_beamlattice_getbeamset uintptr + Lib3MF_component_getobjectresource uintptr + Lib3MF_component_getobjectresourceid uintptr + Lib3MF_component_getuuid uintptr + Lib3MF_component_setuuid uintptr + Lib3MF_component_hastransform uintptr + Lib3MF_component_gettransform uintptr + Lib3MF_component_settransform uintptr + Lib3MF_componentsobject_addcomponent uintptr + Lib3MF_componentsobject_getcomponent uintptr + Lib3MF_componentsobject_getcomponentcount uintptr + Lib3MF_beamset_setname uintptr + Lib3MF_beamset_getname uintptr + Lib3MF_beamset_setidentifier uintptr + Lib3MF_beamset_getidentifier uintptr + Lib3MF_beamset_getreferencecount uintptr + Lib3MF_beamset_setreferences uintptr + Lib3MF_beamset_getreferences uintptr + Lib3MF_beamset_getballreferencecount uintptr + Lib3MF_beamset_setballreferences uintptr + Lib3MF_beamset_getballreferences uintptr + Lib3MF_basematerialgroup_getcount uintptr + Lib3MF_basematerialgroup_getallpropertyids uintptr + Lib3MF_basematerialgroup_addmaterial uintptr + Lib3MF_basematerialgroup_removematerial uintptr + Lib3MF_basematerialgroup_getname uintptr + Lib3MF_basematerialgroup_setname uintptr + Lib3MF_basematerialgroup_setdisplaycolor uintptr + Lib3MF_basematerialgroup_getdisplaycolor uintptr + Lib3MF_colorgroup_getcount uintptr + Lib3MF_colorgroup_getallpropertyids uintptr + Lib3MF_colorgroup_addcolor uintptr + Lib3MF_colorgroup_removecolor uintptr + Lib3MF_colorgroup_setcolor uintptr + Lib3MF_colorgroup_getcolor uintptr + Lib3MF_texture2dgroup_getcount uintptr + Lib3MF_texture2dgroup_getallpropertyids uintptr + Lib3MF_texture2dgroup_addtex2coord uintptr + Lib3MF_texture2dgroup_gettex2coord uintptr + Lib3MF_texture2dgroup_removetex2coord uintptr + Lib3MF_texture2dgroup_gettexture2d uintptr + Lib3MF_compositematerials_getcount uintptr + Lib3MF_compositematerials_getallpropertyids uintptr + Lib3MF_compositematerials_getbasematerialgroup uintptr + Lib3MF_compositematerials_addcomposite uintptr + Lib3MF_compositematerials_removecomposite uintptr + Lib3MF_compositematerials_getcomposite uintptr + Lib3MF_multipropertygroup_getcount uintptr + Lib3MF_multipropertygroup_getallpropertyids uintptr + Lib3MF_multipropertygroup_addmultiproperty uintptr + Lib3MF_multipropertygroup_setmultiproperty uintptr + Lib3MF_multipropertygroup_getmultiproperty uintptr + Lib3MF_multipropertygroup_removemultiproperty uintptr + Lib3MF_multipropertygroup_getlayercount uintptr + Lib3MF_multipropertygroup_addlayer uintptr + Lib3MF_multipropertygroup_getlayer uintptr + Lib3MF_multipropertygroup_removelayer uintptr + Lib3MF_attachment_getpath uintptr + Lib3MF_attachment_setpath uintptr + Lib3MF_attachment_packagepart uintptr + Lib3MF_attachment_getrelationshiptype uintptr + Lib3MF_attachment_setrelationshiptype uintptr + Lib3MF_attachment_writetofile uintptr + Lib3MF_attachment_readfromfile uintptr + Lib3MF_attachment_readfromcallback uintptr + Lib3MF_attachment_getstreamsize uintptr + Lib3MF_attachment_writetobuffer uintptr + Lib3MF_attachment_readfrombuffer uintptr + Lib3MF_texture2d_getattachment uintptr + Lib3MF_texture2d_setattachment uintptr + Lib3MF_texture2d_getcontenttype uintptr + Lib3MF_texture2d_setcontenttype uintptr + Lib3MF_texture2d_gettilestyleuv uintptr + Lib3MF_texture2d_settilestyleuv uintptr + Lib3MF_texture2d_getfilter uintptr + Lib3MF_texture2d_setfilter uintptr + Lib3MF_builditem_getobjectresource uintptr + Lib3MF_builditem_getuuid uintptr + Lib3MF_builditem_setuuid uintptr + Lib3MF_builditem_getobjectresourceid uintptr + Lib3MF_builditem_hasobjecttransform uintptr + Lib3MF_builditem_getobjecttransform uintptr + Lib3MF_builditem_setobjecttransform uintptr + Lib3MF_builditem_getpartnumber uintptr + Lib3MF_builditem_setpartnumber uintptr + Lib3MF_builditem_getmetadatagroup uintptr + Lib3MF_builditem_getoutbox uintptr + Lib3MF_builditemiterator_movenext uintptr + Lib3MF_builditemiterator_moveprevious uintptr + Lib3MF_builditemiterator_getcurrent uintptr + Lib3MF_builditemiterator_clone uintptr + Lib3MF_builditemiterator_count uintptr + Lib3MF_slice_setvertices uintptr + Lib3MF_slice_getvertices uintptr + Lib3MF_slice_getvertexcount uintptr + Lib3MF_slice_addpolygon uintptr + Lib3MF_slice_getpolygoncount uintptr + Lib3MF_slice_setpolygonindices uintptr + Lib3MF_slice_getpolygonindices uintptr + Lib3MF_slice_getpolygonindexcount uintptr + Lib3MF_slice_getztop uintptr + Lib3MF_toolpathprofile_getuuid uintptr + Lib3MF_toolpathprofile_getname uintptr + Lib3MF_toolpathprofile_hasparametervalue uintptr + Lib3MF_toolpathprofile_getparameterdoublevalue uintptr + Lib3MF_toolpathprofile_getparameterdoublevaluedef uintptr + Lib3MF_toolpathprofile_setname uintptr + Lib3MF_toolpathprofile_setparameterdoublevalue uintptr + Lib3MF_toolpathlayerreader_getlayerdatauuid uintptr + Lib3MF_toolpathlayerreader_getsegmentcount uintptr + Lib3MF_toolpathlayerreader_getsegmentinfo uintptr + Lib3MF_toolpathlayerreader_getsegmentprofile uintptr + Lib3MF_toolpathlayerreader_getsegmentprofileuuid uintptr + Lib3MF_toolpathlayerreader_getsegmentpart uintptr + Lib3MF_toolpathlayerreader_getsegmentpartuuid uintptr + Lib3MF_toolpathlayerreader_getsegmentpointdata uintptr + Lib3MF_toolpathlayerdata_getlayerdatauuid uintptr + Lib3MF_toolpathlayerdata_registerprofile uintptr + Lib3MF_toolpathlayerdata_registerbuilditem uintptr + Lib3MF_toolpathlayerdata_writehatchdata uintptr + Lib3MF_toolpathlayerdata_writeloop uintptr + Lib3MF_toolpathlayerdata_writepolyline uintptr + Lib3MF_toolpathlayerdata_finish uintptr + Lib3MF_toolpath_getunits uintptr + Lib3MF_toolpath_getlayercount uintptr + Lib3MF_toolpath_getprofilecount uintptr + Lib3MF_toolpath_addlayer uintptr + Lib3MF_toolpath_getlayerattachment uintptr + Lib3MF_toolpath_readlayerdata uintptr + Lib3MF_toolpath_getlayerpath uintptr + Lib3MF_toolpath_getlayerzmax uintptr + Lib3MF_toolpath_getlayerz uintptr + Lib3MF_toolpath_addprofile uintptr + Lib3MF_toolpath_getprofile uintptr + Lib3MF_toolpath_getprofileuuid uintptr + Lib3MF_toolpathiterator_getcurrenttoolpath uintptr + Lib3MF_slicestack_getbottomz uintptr + Lib3MF_slicestack_getslicecount uintptr + Lib3MF_slicestack_getslice uintptr + Lib3MF_slicestack_addslice uintptr + Lib3MF_slicestack_getslicerefcount uintptr + Lib3MF_slicestack_addslicestackreference uintptr + Lib3MF_slicestack_getslicestackreference uintptr + Lib3MF_slicestack_collapseslicereferences uintptr + Lib3MF_slicestack_setownpath uintptr + Lib3MF_slicestack_getownpath uintptr + Lib3MF_consumer_getconsumerid uintptr + Lib3MF_consumer_getkeyid uintptr + Lib3MF_consumer_getkeyvalue uintptr + Lib3MF_accessright_getconsumer uintptr + Lib3MF_accessright_getwrappingalgorithm uintptr + Lib3MF_accessright_getmgfalgorithm uintptr + Lib3MF_accessright_getdigestmethod uintptr + Lib3MF_contentencryptionparams_getencryptionalgorithm uintptr + Lib3MF_contentencryptionparams_getkey uintptr + Lib3MF_contentencryptionparams_getinitializationvector uintptr + Lib3MF_contentencryptionparams_getauthenticationtag uintptr + Lib3MF_contentencryptionparams_setauthenticationtag uintptr Lib3MF_contentencryptionparams_getadditionalauthenticationdata uintptr - Lib3MF_contentencryptionparams_getdescriptor uintptr - Lib3MF_contentencryptionparams_getkeyuuid uintptr - Lib3MF_resourcedata_getpath uintptr - Lib3MF_resourcedata_getencryptionalgorithm uintptr - Lib3MF_resourcedata_getcompression uintptr - Lib3MF_resourcedata_getadditionalauthenticationdata uintptr - Lib3MF_resourcedatagroup_getkeyuuid uintptr - Lib3MF_resourcedatagroup_addaccessright uintptr - Lib3MF_resourcedatagroup_findaccessrightbyconsumer uintptr - Lib3MF_resourcedatagroup_removeaccessright uintptr - Lib3MF_keystore_addconsumer uintptr - Lib3MF_keystore_getconsumercount uintptr - Lib3MF_keystore_getconsumer uintptr - Lib3MF_keystore_removeconsumer uintptr - Lib3MF_keystore_findconsumer uintptr - Lib3MF_keystore_getresourcedatagroupcount uintptr - Lib3MF_keystore_addresourcedatagroup uintptr - Lib3MF_keystore_getresourcedatagroup uintptr - Lib3MF_keystore_removeresourcedatagroup uintptr - Lib3MF_keystore_findresourcedatagroup uintptr - Lib3MF_keystore_addresourcedata uintptr - Lib3MF_keystore_removeresourcedata uintptr - Lib3MF_keystore_findresourcedata uintptr - Lib3MF_keystore_getresourcedatacount uintptr - Lib3MF_keystore_getresourcedata uintptr - Lib3MF_keystore_getuuid uintptr - Lib3MF_keystore_setuuid uintptr - Lib3MF_model_rootmodelpart uintptr - Lib3MF_model_findorcreatepackagepart uintptr - Lib3MF_model_setunit uintptr - Lib3MF_model_getunit uintptr - Lib3MF_model_getlanguage uintptr - Lib3MF_model_setlanguage uintptr - Lib3MF_model_querywriter uintptr - Lib3MF_model_queryreader uintptr - Lib3MF_model_gettexture2dbyid uintptr - Lib3MF_model_getpropertytypebyid uintptr - Lib3MF_model_getbasematerialgroupbyid uintptr - Lib3MF_model_gettexture2dgroupbyid uintptr - Lib3MF_model_getcompositematerialsbyid uintptr - Lib3MF_model_getmultipropertygroupbyid uintptr - Lib3MF_model_getmeshobjectbyid uintptr - Lib3MF_model_getcomponentsobjectbyid uintptr - Lib3MF_model_getcolorgroupbyid uintptr - Lib3MF_model_getslicestackbyid uintptr - Lib3MF_model_getbuilduuid uintptr - Lib3MF_model_setbuilduuid uintptr - Lib3MF_model_getbuilditems uintptr - Lib3MF_model_getoutbox uintptr - Lib3MF_model_getresources uintptr - Lib3MF_model_getobjects uintptr - Lib3MF_model_getmeshobjects uintptr - Lib3MF_model_getcomponentsobjects uintptr - Lib3MF_model_gettexture2ds uintptr - Lib3MF_model_getbasematerialgroups uintptr - Lib3MF_model_getcolorgroups uintptr - Lib3MF_model_gettexture2dgroups uintptr - Lib3MF_model_getcompositematerials uintptr - Lib3MF_model_getmultipropertygroups uintptr - Lib3MF_model_getslicestacks uintptr - Lib3MF_model_mergetomodel uintptr - Lib3MF_model_addmeshobject uintptr - Lib3MF_model_addcomponentsobject uintptr - Lib3MF_model_addslicestack uintptr - Lib3MF_model_addtexture2dfromattachment uintptr - Lib3MF_model_addbasematerialgroup uintptr - Lib3MF_model_addcolorgroup uintptr - Lib3MF_model_addtexture2dgroup uintptr - Lib3MF_model_addcompositematerials uintptr - Lib3MF_model_addmultipropertygroup uintptr - Lib3MF_model_addbuilditem uintptr - Lib3MF_model_removebuilditem uintptr - Lib3MF_model_getmetadatagroup uintptr - Lib3MF_model_addattachment uintptr - Lib3MF_model_removeattachment uintptr - Lib3MF_model_getattachment uintptr - Lib3MF_model_findattachment uintptr - Lib3MF_model_getattachmentcount uintptr - Lib3MF_model_haspackagethumbnailattachment uintptr - Lib3MF_model_createpackagethumbnailattachment uintptr - Lib3MF_model_getpackagethumbnailattachment uintptr - Lib3MF_model_removepackagethumbnailattachment uintptr - Lib3MF_model_addcustomcontenttype uintptr - Lib3MF_model_removecustomcontenttype uintptr - Lib3MF_model_setrandomnumbercallback uintptr - Lib3MF_model_getkeystore uintptr - Lib3MF_getlibraryversion uintptr - Lib3MF_getprereleaseinformation uintptr - Lib3MF_getbuildinformation uintptr - Lib3MF_getspecificationversion uintptr - Lib3MF_createmodel uintptr - Lib3MF_release uintptr - Lib3MF_acquire uintptr - Lib3MF_setjournal uintptr - Lib3MF_getlasterror uintptr - Lib3MF_getsymbollookupmethod uintptr - Lib3MF_retrieveprogressmessage uintptr - Lib3MF_rgbatocolor uintptr - Lib3MF_floatrgbatocolor uintptr - Lib3MF_colortorgba uintptr - Lib3MF_colortofloatrgba uintptr - Lib3MF_getidentitytransform uintptr - Lib3MF_getuniformscaletransform uintptr - Lib3MF_getscaletransform uintptr - Lib3MF_gettranslationtransform uintptr + Lib3MF_contentencryptionparams_getdescriptor uintptr + Lib3MF_contentencryptionparams_getkeyuuid uintptr + Lib3MF_resourcedata_getpath uintptr + Lib3MF_resourcedata_getencryptionalgorithm uintptr + Lib3MF_resourcedata_getcompression uintptr + Lib3MF_resourcedata_getadditionalauthenticationdata uintptr + Lib3MF_resourcedatagroup_getkeyuuid uintptr + Lib3MF_resourcedatagroup_addaccessright uintptr + Lib3MF_resourcedatagroup_findaccessrightbyconsumer uintptr + Lib3MF_resourcedatagroup_removeaccessright uintptr + Lib3MF_keystore_addconsumer uintptr + Lib3MF_keystore_getconsumercount uintptr + Lib3MF_keystore_getconsumer uintptr + Lib3MF_keystore_removeconsumer uintptr + Lib3MF_keystore_findconsumer uintptr + Lib3MF_keystore_getresourcedatagroupcount uintptr + Lib3MF_keystore_addresourcedatagroup uintptr + Lib3MF_keystore_getresourcedatagroup uintptr + Lib3MF_keystore_removeresourcedatagroup uintptr + Lib3MF_keystore_findresourcedatagroup uintptr + Lib3MF_keystore_addresourcedata uintptr + Lib3MF_keystore_removeresourcedata uintptr + Lib3MF_keystore_findresourcedata uintptr + Lib3MF_keystore_getresourcedatacount uintptr + Lib3MF_keystore_getresourcedata uintptr + Lib3MF_keystore_getuuid uintptr + Lib3MF_keystore_setuuid uintptr + Lib3MF_model_rootmodelpart uintptr + Lib3MF_model_findorcreatepackagepart uintptr + Lib3MF_model_setunit uintptr + Lib3MF_model_getunit uintptr + Lib3MF_model_getlanguage uintptr + Lib3MF_model_setlanguage uintptr + Lib3MF_model_querywriter uintptr + Lib3MF_model_queryreader uintptr + Lib3MF_model_gettexture2dbyid uintptr + Lib3MF_model_getpropertytypebyid uintptr + Lib3MF_model_getbasematerialgroupbyid uintptr + Lib3MF_model_gettexture2dgroupbyid uintptr + Lib3MF_model_getcompositematerialsbyid uintptr + Lib3MF_model_getmultipropertygroupbyid uintptr + Lib3MF_model_getmeshobjectbyid uintptr + Lib3MF_model_getcomponentsobjectbyid uintptr + Lib3MF_model_getcolorgroupbyid uintptr + Lib3MF_model_getslicestackbyid uintptr + Lib3MF_model_getbuilduuid uintptr + Lib3MF_model_setbuilduuid uintptr + Lib3MF_model_getbuilditems uintptr + Lib3MF_model_getoutbox uintptr + Lib3MF_model_getresources uintptr + Lib3MF_model_getobjects uintptr + Lib3MF_model_getmeshobjects uintptr + Lib3MF_model_getcomponentsobjects uintptr + Lib3MF_model_gettexture2ds uintptr + Lib3MF_model_getbasematerialgroups uintptr + Lib3MF_model_getcolorgroups uintptr + Lib3MF_model_gettexture2dgroups uintptr + Lib3MF_model_getcompositematerials uintptr + Lib3MF_model_getmultipropertygroups uintptr + Lib3MF_model_gettoolpaths uintptr + Lib3MF_model_getslicestacks uintptr + Lib3MF_model_mergetomodel uintptr + Lib3MF_model_addmeshobject uintptr + Lib3MF_model_addcomponentsobject uintptr + Lib3MF_model_addslicestack uintptr + Lib3MF_model_addtexture2dfromattachment uintptr + Lib3MF_model_addbasematerialgroup uintptr + Lib3MF_model_addcolorgroup uintptr + Lib3MF_model_addtexture2dgroup uintptr + Lib3MF_model_addcompositematerials uintptr + Lib3MF_model_addmultipropertygroup uintptr + Lib3MF_model_addbuilditem uintptr + Lib3MF_model_removebuilditem uintptr + Lib3MF_model_addtoolpath uintptr + Lib3MF_model_getmetadatagroup uintptr + Lib3MF_model_addattachment uintptr + Lib3MF_model_removeattachment uintptr + Lib3MF_model_getattachment uintptr + Lib3MF_model_findattachment uintptr + Lib3MF_model_getattachmentcount uintptr + Lib3MF_model_haspackagethumbnailattachment uintptr + Lib3MF_model_createpackagethumbnailattachment uintptr + Lib3MF_model_getpackagethumbnailattachment uintptr + Lib3MF_model_removepackagethumbnailattachment uintptr + Lib3MF_model_addcustomcontenttype uintptr + Lib3MF_model_removecustomcontenttype uintptr + Lib3MF_model_setrandomnumbercallback uintptr + Lib3MF_model_getkeystore uintptr + Lib3MF_model_createpersistentsourcefromfile uintptr + Lib3MF_model_createpersistentsourcefrombuffer uintptr + Lib3MF_model_createpersistentsourcefromcallback uintptr + Lib3MF_getlibraryversion uintptr + Lib3MF_getprereleaseinformation uintptr + Lib3MF_getbuildinformation uintptr + Lib3MF_getspecificationversion uintptr + Lib3MF_createmodel uintptr + Lib3MF_release uintptr + Lib3MF_acquire uintptr + Lib3MF_setjournal uintptr + Lib3MF_getlasterror uintptr + Lib3MF_getsymbollookupmethod uintptr + Lib3MF_retrieveprogressmessage uintptr + Lib3MF_rgbatocolor uintptr + Lib3MF_floatrgbatocolor uintptr + Lib3MF_colortorgba uintptr + Lib3MF_colortofloatrgba uintptr + Lib3MF_getidentitytransform uintptr + Lib3MF_getuniformscaletransform uintptr + Lib3MF_getscaletransform uintptr + Lib3MF_gettranslationtransform uintptr } type Lib3MFImplementationHandle interface { Lib3MFHandle - GetDLLInHandle() uintptr - GetDLLOutHandle() uintptr - GetWrapper() *Lib3MFImplementation + GetDLLInHandle() (uintptr) + GetDLLOutHandle() (uintptr) + GetWrapper() (*Lib3MFImplementation) } type Lib3MFImplementationHandleStruct struct { - Implementation *Lib3MFImplementation - DLLhandle uintptr + Implementation * Lib3MFImplementation + DLLhandle uintptr } -func (handle *Lib3MFImplementationHandleStruct) Close() error { - if handle.DLLhandle != 0 { - if handle.Implementation == nil { +func (handle *Lib3MFImplementationHandleStruct) Close() (error) { + if (handle.DLLhandle != 0) { + if (handle.Implementation == nil) { return errors.New("Uninitialized DLL Implementation Handle") } - + dllhandle := handle.DLLhandle - handle.DLLhandle = 0 - + handle.DLLhandle = 0; + return handle.Implementation.CallFunction(handle.Implementation.Lib3MF_release, dllhandle) } - + return nil } -func (handle *Lib3MFImplementationHandleStruct) IsValid() bool { +func (handle *Lib3MFImplementationHandleStruct) IsValid() (bool) { return (handle.DLLhandle != 0) } -func (handle *Lib3MFImplementationHandleStruct) GetDLLInHandle() uintptr { - return handle.DLLhandle +func (handle *Lib3MFImplementationHandleStruct) GetDLLInHandle() (uintptr) { + return handle.DLLhandle; } -func (handle *Lib3MFImplementationHandleStruct) GetDLLOutHandle() uintptr { - return uintptr(unsafe.Pointer(&handle.DLLhandle)) +func (handle *Lib3MFImplementationHandleStruct) GetDLLOutHandle() (uintptr) { + return uintptr(unsafe.Pointer(&handle.DLLhandle)); } -func (handle *Lib3MFImplementationHandleStruct) GetWrapper() *Lib3MFImplementation { - return handle.Implementation +func (handle *Lib3MFImplementationHandleStruct) GetWrapper() (*Lib3MFImplementation) { + return handle.Implementation; } -func Int8OutValue(reference *int8) uintptr { +func Int8OutValue(reference * int8) uintptr { return uintptr(unsafe.Pointer(reference)) } func Int8InValue(value int8) uintptr { return uintptr(value) } -func Int16OutValue(reference *int16) uintptr { +func Int16OutValue(reference * int16) uintptr { return uintptr(unsafe.Pointer(reference)) } func Int16InValue(value int16) uintptr { return uintptr(value) } -func Int32OutValue(reference *int32) uintptr { +func Int32OutValue(reference * int32) uintptr { return uintptr(unsafe.Pointer(reference)) } func Int32InValue(value int32) uintptr { return uintptr(value) } -func Int64OutValue(reference *int64) uintptr { +func Int64OutValue(reference * int64) uintptr { return uintptr(unsafe.Pointer(reference)) } func Int64InValue(value int64) uintptr { return uintptr(value) } -func UInt8OutValue(reference *uint8) uintptr { +func UInt8OutValue(reference * uint8) uintptr { return uintptr(unsafe.Pointer(reference)) } func UInt8InValue(value uint8) uintptr { return uintptr(value) } -func UInt16OutValue(reference *uint16) uintptr { +func UInt16OutValue(reference * uint16) uintptr { return uintptr(unsafe.Pointer(reference)) } func UInt16InValue(value uint16) uintptr { return uintptr(value) } -func UInt32OutValue(reference *uint32) uintptr { +func UInt32OutValue(reference * uint32) uintptr { return uintptr(unsafe.Pointer(reference)) } func UInt32InValue(value uint32) uintptr { return uintptr(value) } -func UInt64OutValue(reference *uint64) uintptr { +func UInt64OutValue(reference * uint64) uintptr { return uintptr(unsafe.Pointer(reference)) } func UInt64InValue(value uint64) uintptr { return uintptr(value) } -func Float32OutValue(reference *float32) uintptr { +func Float32OutValue(reference * float32) uintptr { return uintptr(unsafe.Pointer(reference)) } func Float32InValue(value float32) uintptr { return uintptr(value) } -func Float64OutValue(reference *float64) uintptr { +func Float64OutValue(reference * float64) uintptr { return uintptr(unsafe.Pointer(reference)) } func Float64InValue(value float64) uintptr { return uintptr(value) } -func StringInValue(value string) uintptr { +func StringInValue (value string) uintptr { bytePtr, err := syscall.BytePtrFromString(value) if err != nil { return 0 @@ -519,108 +564,73 @@ func StringInValue(value string) uintptr { return uintptr(unsafe.Pointer(bytePtr)) } -func PtrOutValue(ptr *uintptr) uintptr { - return uintptr(unsafe.Pointer(ptr)) -} - -func BytesOutValue(bytePtr *[]byte) uintptr { - return uintptr(unsafe.Pointer(bytePtr)) -} - -func GetLib3MFErrorMessage(errorcode uint32) string { - switch errorcode { - case 1: - return "NOTIMPLEMENTED" - case 2: - return "INVALIDPARAM" - case 3: - return "INVALIDCAST" - case 4: - return "BUFFERTOOSMALL" - case 5: - return "GENERICEXCEPTION" - case 6: - return "COULDNOTLOADLIBRARY" - case 7: - return "COULDNOTFINDLIBRARYEXPORT" - case 8: - return "INCOMPATIBLEBINARYVERSION" - case 10: - return "CALCULATIONABORTED" - case 11: - return "SHOULDNOTBECALLED" - case 100: - return "READERCLASSUNKNOWN" - case 101: - return "WRITERCLASSUNKNOWN" - case 102: - return "ITERATORINVALIDINDEX" - case 103: - return "INVALIDMODELRESOURCE" - case 104: - return "RESOURCENOTFOUND" - case 105: - return "INVALIDMODEL" - case 106: - return "INVALIDOBJECT" - case 107: - return "INVALIDMESHOBJECT" - case 108: - return "INVALIDCOMPONENTSOBJECT" - case 109: - return "INVALIDCOMPONENT" - case 110: - return "INVALIDBUILDITEM" - case 111: - return "INVALIDBASEMATERIALGROUP" - case 112: - return "INVALIDSLICESTACKRESOURCE" - case 113: - return "INVALIDTEXTURERESOURCE" - case 114: - return "INVALIDCOLORGROUP" - case 115: - return "INVALIDTEXTURE2DGROUP" - case 116: - return "INVALIDCOMPOSITEMATERIALS" - case 117: - return "INVALIDMULTIPROPERTYGROUP" - case 120: - return "INVALIDRESOURCEINDEX" - case 121: - return "ATTACHMENTNOTFOUND" - case 130: - return "FORBIDDENCYCLICREFERENCE" - case 131: - return "INVALIDATTACHMENTSTREAM" - case 132: - return "INVALIDPROPERTYCOUNT" - case 140: - return "UNKOWNPROGRESSIDENTIFIER" - case 141: - return "ELEMENTCOUNTEXCEEDSLIMIT" - case 2000: - return "BEAMLATTICE_INVALID_OBJECTTYPE" - case 3000: - return "INVALIDKEYSTORE" - case 3001: - return "INVALIDKEYSTORECONSUMER" - case 3002: - return "KEYSTORECONSUMERNOTFOUND" - case 3003: - return "KEYSTORERESOURCEDATANOTFOUND" - case 3004: - return "SECURECONTEXTNOTREGISTERED" +func PtrOutValue(ptr * uintptr) uintptr { + return uintptr(unsafe.Pointer(ptr)) +} + +func BytesOutValue(bytePtr * []byte) uintptr { + return uintptr(unsafe.Pointer(bytePtr)) +} + + +func GetLib3MFErrorMessage(errorcode uint32) (string) { + switch (errorcode) { + case 1: return "NOTIMPLEMENTED"; + case 2: return "INVALIDPARAM"; + case 3: return "INVALIDCAST"; + case 4: return "BUFFERTOOSMALL"; + case 5: return "GENERICEXCEPTION"; + case 6: return "COULDNOTLOADLIBRARY"; + case 7: return "COULDNOTFINDLIBRARYEXPORT"; + case 8: return "INCOMPATIBLEBINARYVERSION"; + case 10: return "CALCULATIONABORTED"; + case 11: return "SHOULDNOTBECALLED"; + case 100: return "READERCLASSUNKNOWN"; + case 101: return "WRITERCLASSUNKNOWN"; + case 102: return "ITERATORINVALIDINDEX"; + case 103: return "INVALIDMODELRESOURCE"; + case 104: return "RESOURCENOTFOUND"; + case 105: return "INVALIDMODEL"; + case 106: return "INVALIDOBJECT"; + case 107: return "INVALIDMESHOBJECT"; + case 108: return "INVALIDCOMPONENTSOBJECT"; + case 109: return "INVALIDCOMPONENT"; + case 110: return "INVALIDBUILDITEM"; + case 111: return "INVALIDBASEMATERIALGROUP"; + case 112: return "INVALIDSLICESTACKRESOURCE"; + case 113: return "INVALIDTEXTURERESOURCE"; + case 114: return "INVALIDCOLORGROUP"; + case 115: return "INVALIDTEXTURE2DGROUP"; + case 116: return "INVALIDCOMPOSITEMATERIALS"; + case 117: return "INVALIDMULTIPROPERTYGROUP"; + case 120: return "INVALIDRESOURCEINDEX"; + case 121: return "ATTACHMENTNOTFOUND"; + case 130: return "FORBIDDENCYCLICREFERENCE"; + case 131: return "INVALIDATTACHMENTSTREAM"; + case 132: return "INVALIDPROPERTYCOUNT"; + case 140: return "UNKOWNPROGRESSIDENTIFIER"; + case 141: return "ELEMENTCOUNTEXCEEDSLIMIT"; + case 2000: return "BEAMLATTICE_INVALID_OBJECTTYPE"; + case 3000: return "INVALIDKEYSTORE"; + case 3001: return "INVALIDKEYSTORECONSUMER"; + case 3002: return "KEYSTORECONSUMERNOTFOUND"; + case 3003: return "KEYSTORERESOURCEDATANOTFOUND"; + case 3004: return "SECURECONTEXTNOTREGISTERED"; + case 4000: return "TOOLPATH_NOTWRITINGHEADER"; + case 4001: return "TOOLPATH_NOTWRITINGDATA"; + case 4002: return "TOOLPATH_DATAHASBEENWRITTEN"; + case 4003: return "TOOLPATH_INVALIDPOINTCOUNT"; default: - return "unknown" + return "unknown"; } } + func (implementation *Lib3MFImplementation) GetWrapperHandle(handle Lib3MFHandle) (Lib3MFImplementationHandle, error) { implementation_handle, ok := handle.(Lib3MFImplementationHandle) if ok { handle_implementation := implementation_handle.GetWrapper() - if handle_implementation == implementation { + if (handle_implementation == implementation) { return implementation_handle, nil } return nil, errors.New("Invalid Implementation for DLL handle.") @@ -629,1885 +639,2093 @@ func (implementation *Lib3MFImplementation) GetWrapperHandle(handle Lib3MFHandle } func (implementation *Lib3MFImplementation) Initialize(DLLFileName string) error { - implementation.Initialized = false - implementation.DLLHandle = 0 + implementation.Initialized = false; + implementation.DLLHandle = 0; - dllHandle, err := syscall.LoadLibrary(DLLFileName) - if err != nil { - return err + dllHandle, err := syscall.LoadLibrary(DLLFileName); + if (err != nil) { + return err; } implementation.Lib3MF_writer_writetofile, err = syscall.GetProcAddress(dllHandle, "lib3mf_writer_writetofile") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_writer_writetofile: " + err.Error()) } - + implementation.Lib3MF_writer_getstreamsize, err = syscall.GetProcAddress(dllHandle, "lib3mf_writer_getstreamsize") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_writer_getstreamsize: " + err.Error()) } - + implementation.Lib3MF_writer_writetobuffer, err = syscall.GetProcAddress(dllHandle, "lib3mf_writer_writetobuffer") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_writer_writetobuffer: " + err.Error()) } - + implementation.Lib3MF_writer_writetocallback, err = syscall.GetProcAddress(dllHandle, "lib3mf_writer_writetocallback") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_writer_writetocallback: " + err.Error()) } - + implementation.Lib3MF_writer_setprogresscallback, err = syscall.GetProcAddress(dllHandle, "lib3mf_writer_setprogresscallback") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_writer_setprogresscallback: " + err.Error()) } - + implementation.Lib3MF_writer_getdecimalprecision, err = syscall.GetProcAddress(dllHandle, "lib3mf_writer_getdecimalprecision") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_writer_getdecimalprecision: " + err.Error()) } - + implementation.Lib3MF_writer_setdecimalprecision, err = syscall.GetProcAddress(dllHandle, "lib3mf_writer_setdecimalprecision") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_writer_setdecimalprecision: " + err.Error()) } - + implementation.Lib3MF_writer_setstrictmodeactive, err = syscall.GetProcAddress(dllHandle, "lib3mf_writer_setstrictmodeactive") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_writer_setstrictmodeactive: " + err.Error()) } - + implementation.Lib3MF_writer_getstrictmodeactive, err = syscall.GetProcAddress(dllHandle, "lib3mf_writer_getstrictmodeactive") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_writer_getstrictmodeactive: " + err.Error()) } - + implementation.Lib3MF_writer_getwarning, err = syscall.GetProcAddress(dllHandle, "lib3mf_writer_getwarning") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_writer_getwarning: " + err.Error()) } - + implementation.Lib3MF_writer_getwarningcount, err = syscall.GetProcAddress(dllHandle, "lib3mf_writer_getwarningcount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_writer_getwarningcount: " + err.Error()) } - + implementation.Lib3MF_writer_addkeywrappingcallback, err = syscall.GetProcAddress(dllHandle, "lib3mf_writer_addkeywrappingcallback") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_writer_addkeywrappingcallback: " + err.Error()) } - + implementation.Lib3MF_writer_setcontentencryptioncallback, err = syscall.GetProcAddress(dllHandle, "lib3mf_writer_setcontentencryptioncallback") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_writer_setcontentencryptioncallback: " + err.Error()) } - + + implementation.Lib3MF_persistentreadersource_getsourcetype, err = syscall.GetProcAddress(dllHandle, "lib3mf_persistentreadersource_getsourcetype") + if (err != nil) { + return errors.New("Could not get function lib3mf_persistentreadersource_getsourcetype: " + err.Error()) + } + + implementation.Lib3MF_persistentreadersource_invalidatesourcedata, err = syscall.GetProcAddress(dllHandle, "lib3mf_persistentreadersource_invalidatesourcedata") + if (err != nil) { + return errors.New("Could not get function lib3mf_persistentreadersource_invalidatesourcedata: " + err.Error()) + } + + implementation.Lib3MF_persistentreadersource_sourcedataisvalid, err = syscall.GetProcAddress(dllHandle, "lib3mf_persistentreadersource_sourcedataisvalid") + if (err != nil) { + return errors.New("Could not get function lib3mf_persistentreadersource_sourcedataisvalid: " + err.Error()) + } + + implementation.Lib3MF_reader_readfrompersistentsource, err = syscall.GetProcAddress(dllHandle, "lib3mf_reader_readfrompersistentsource") + if (err != nil) { + return errors.New("Could not get function lib3mf_reader_readfrompersistentsource: " + err.Error()) + } + implementation.Lib3MF_reader_readfromfile, err = syscall.GetProcAddress(dllHandle, "lib3mf_reader_readfromfile") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_reader_readfromfile: " + err.Error()) } - + implementation.Lib3MF_reader_readfrombuffer, err = syscall.GetProcAddress(dllHandle, "lib3mf_reader_readfrombuffer") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_reader_readfrombuffer: " + err.Error()) } - + implementation.Lib3MF_reader_readfromcallback, err = syscall.GetProcAddress(dllHandle, "lib3mf_reader_readfromcallback") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_reader_readfromcallback: " + err.Error()) } - + implementation.Lib3MF_reader_setprogresscallback, err = syscall.GetProcAddress(dllHandle, "lib3mf_reader_setprogresscallback") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_reader_setprogresscallback: " + err.Error()) } - + implementation.Lib3MF_reader_addrelationtoread, err = syscall.GetProcAddress(dllHandle, "lib3mf_reader_addrelationtoread") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_reader_addrelationtoread: " + err.Error()) } - + implementation.Lib3MF_reader_removerelationtoread, err = syscall.GetProcAddress(dllHandle, "lib3mf_reader_removerelationtoread") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_reader_removerelationtoread: " + err.Error()) } - + implementation.Lib3MF_reader_setstrictmodeactive, err = syscall.GetProcAddress(dllHandle, "lib3mf_reader_setstrictmodeactive") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_reader_setstrictmodeactive: " + err.Error()) } - + implementation.Lib3MF_reader_getstrictmodeactive, err = syscall.GetProcAddress(dllHandle, "lib3mf_reader_getstrictmodeactive") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_reader_getstrictmodeactive: " + err.Error()) } - + implementation.Lib3MF_reader_getwarning, err = syscall.GetProcAddress(dllHandle, "lib3mf_reader_getwarning") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_reader_getwarning: " + err.Error()) } - + implementation.Lib3MF_reader_getwarningcount, err = syscall.GetProcAddress(dllHandle, "lib3mf_reader_getwarningcount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_reader_getwarningcount: " + err.Error()) } - + implementation.Lib3MF_reader_addkeywrappingcallback, err = syscall.GetProcAddress(dllHandle, "lib3mf_reader_addkeywrappingcallback") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_reader_addkeywrappingcallback: " + err.Error()) } - + implementation.Lib3MF_reader_setcontentencryptioncallback, err = syscall.GetProcAddress(dllHandle, "lib3mf_reader_setcontentencryptioncallback") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_reader_setcontentencryptioncallback: " + err.Error()) } - + implementation.Lib3MF_packagepart_getpath, err = syscall.GetProcAddress(dllHandle, "lib3mf_packagepart_getpath") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_packagepart_getpath: " + err.Error()) } - + implementation.Lib3MF_packagepart_setpath, err = syscall.GetProcAddress(dllHandle, "lib3mf_packagepart_setpath") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_packagepart_setpath: " + err.Error()) } - + implementation.Lib3MF_resource_getresourceid, err = syscall.GetProcAddress(dllHandle, "lib3mf_resource_getresourceid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_resource_getresourceid: " + err.Error()) } - + implementation.Lib3MF_resource_getuniqueresourceid, err = syscall.GetProcAddress(dllHandle, "lib3mf_resource_getuniqueresourceid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_resource_getuniqueresourceid: " + err.Error()) } - + implementation.Lib3MF_resource_packagepart, err = syscall.GetProcAddress(dllHandle, "lib3mf_resource_packagepart") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_resource_packagepart: " + err.Error()) } - + implementation.Lib3MF_resource_setpackagepart, err = syscall.GetProcAddress(dllHandle, "lib3mf_resource_setpackagepart") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_resource_setpackagepart: " + err.Error()) } - + implementation.Lib3MF_resource_getmodelresourceid, err = syscall.GetProcAddress(dllHandle, "lib3mf_resource_getmodelresourceid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_resource_getmodelresourceid: " + err.Error()) } - + implementation.Lib3MF_resourceiterator_movenext, err = syscall.GetProcAddress(dllHandle, "lib3mf_resourceiterator_movenext") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_resourceiterator_movenext: " + err.Error()) } - + implementation.Lib3MF_resourceiterator_moveprevious, err = syscall.GetProcAddress(dllHandle, "lib3mf_resourceiterator_moveprevious") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_resourceiterator_moveprevious: " + err.Error()) } - + implementation.Lib3MF_resourceiterator_getcurrent, err = syscall.GetProcAddress(dllHandle, "lib3mf_resourceiterator_getcurrent") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_resourceiterator_getcurrent: " + err.Error()) } - + implementation.Lib3MF_resourceiterator_clone, err = syscall.GetProcAddress(dllHandle, "lib3mf_resourceiterator_clone") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_resourceiterator_clone: " + err.Error()) } - + implementation.Lib3MF_resourceiterator_count, err = syscall.GetProcAddress(dllHandle, "lib3mf_resourceiterator_count") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_resourceiterator_count: " + err.Error()) } - + implementation.Lib3MF_slicestackiterator_getcurrentslicestack, err = syscall.GetProcAddress(dllHandle, "lib3mf_slicestackiterator_getcurrentslicestack") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_slicestackiterator_getcurrentslicestack: " + err.Error()) } - + implementation.Lib3MF_objectiterator_getcurrentobject, err = syscall.GetProcAddress(dllHandle, "lib3mf_objectiterator_getcurrentobject") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_objectiterator_getcurrentobject: " + err.Error()) } - + implementation.Lib3MF_meshobjectiterator_getcurrentmeshobject, err = syscall.GetProcAddress(dllHandle, "lib3mf_meshobjectiterator_getcurrentmeshobject") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_meshobjectiterator_getcurrentmeshobject: " + err.Error()) } - + implementation.Lib3MF_componentsobjectiterator_getcurrentcomponentsobject, err = syscall.GetProcAddress(dllHandle, "lib3mf_componentsobjectiterator_getcurrentcomponentsobject") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_componentsobjectiterator_getcurrentcomponentsobject: " + err.Error()) } - + implementation.Lib3MF_texture2diterator_getcurrenttexture2d, err = syscall.GetProcAddress(dllHandle, "lib3mf_texture2diterator_getcurrenttexture2d") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_texture2diterator_getcurrenttexture2d: " + err.Error()) } - + implementation.Lib3MF_basematerialgroupiterator_getcurrentbasematerialgroup, err = syscall.GetProcAddress(dllHandle, "lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup: " + err.Error()) } - + implementation.Lib3MF_colorgroupiterator_getcurrentcolorgroup, err = syscall.GetProcAddress(dllHandle, "lib3mf_colorgroupiterator_getcurrentcolorgroup") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_colorgroupiterator_getcurrentcolorgroup: " + err.Error()) } - + implementation.Lib3MF_texture2dgroupiterator_getcurrenttexture2dgroup, err = syscall.GetProcAddress(dllHandle, "lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup: " + err.Error()) } - + implementation.Lib3MF_compositematerialsiterator_getcurrentcompositematerials, err = syscall.GetProcAddress(dllHandle, "lib3mf_compositematerialsiterator_getcurrentcompositematerials") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_compositematerialsiterator_getcurrentcompositematerials: " + err.Error()) } - + implementation.Lib3MF_multipropertygroupiterator_getcurrentmultipropertygroup, err = syscall.GetProcAddress(dllHandle, "lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup: " + err.Error()) } - + implementation.Lib3MF_metadata_getnamespace, err = syscall.GetProcAddress(dllHandle, "lib3mf_metadata_getnamespace") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_metadata_getnamespace: " + err.Error()) } - + implementation.Lib3MF_metadata_setnamespace, err = syscall.GetProcAddress(dllHandle, "lib3mf_metadata_setnamespace") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_metadata_setnamespace: " + err.Error()) } - + implementation.Lib3MF_metadata_getname, err = syscall.GetProcAddress(dllHandle, "lib3mf_metadata_getname") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_metadata_getname: " + err.Error()) } - + implementation.Lib3MF_metadata_setname, err = syscall.GetProcAddress(dllHandle, "lib3mf_metadata_setname") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_metadata_setname: " + err.Error()) } - + implementation.Lib3MF_metadata_getkey, err = syscall.GetProcAddress(dllHandle, "lib3mf_metadata_getkey") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_metadata_getkey: " + err.Error()) } - + implementation.Lib3MF_metadata_getmustpreserve, err = syscall.GetProcAddress(dllHandle, "lib3mf_metadata_getmustpreserve") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_metadata_getmustpreserve: " + err.Error()) } - + implementation.Lib3MF_metadata_setmustpreserve, err = syscall.GetProcAddress(dllHandle, "lib3mf_metadata_setmustpreserve") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_metadata_setmustpreserve: " + err.Error()) } - + implementation.Lib3MF_metadata_gettype, err = syscall.GetProcAddress(dllHandle, "lib3mf_metadata_gettype") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_metadata_gettype: " + err.Error()) } - + implementation.Lib3MF_metadata_settype, err = syscall.GetProcAddress(dllHandle, "lib3mf_metadata_settype") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_metadata_settype: " + err.Error()) } - + implementation.Lib3MF_metadata_getvalue, err = syscall.GetProcAddress(dllHandle, "lib3mf_metadata_getvalue") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_metadata_getvalue: " + err.Error()) } - + implementation.Lib3MF_metadata_setvalue, err = syscall.GetProcAddress(dllHandle, "lib3mf_metadata_setvalue") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_metadata_setvalue: " + err.Error()) } - + implementation.Lib3MF_metadatagroup_getmetadatacount, err = syscall.GetProcAddress(dllHandle, "lib3mf_metadatagroup_getmetadatacount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_metadatagroup_getmetadatacount: " + err.Error()) } - + implementation.Lib3MF_metadatagroup_getmetadata, err = syscall.GetProcAddress(dllHandle, "lib3mf_metadatagroup_getmetadata") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_metadatagroup_getmetadata: " + err.Error()) } - + implementation.Lib3MF_metadatagroup_getmetadatabykey, err = syscall.GetProcAddress(dllHandle, "lib3mf_metadatagroup_getmetadatabykey") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_metadatagroup_getmetadatabykey: " + err.Error()) } - + implementation.Lib3MF_metadatagroup_removemetadatabyindex, err = syscall.GetProcAddress(dllHandle, "lib3mf_metadatagroup_removemetadatabyindex") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_metadatagroup_removemetadatabyindex: " + err.Error()) } - + implementation.Lib3MF_metadatagroup_removemetadata, err = syscall.GetProcAddress(dllHandle, "lib3mf_metadatagroup_removemetadata") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_metadatagroup_removemetadata: " + err.Error()) } - + implementation.Lib3MF_metadatagroup_addmetadata, err = syscall.GetProcAddress(dllHandle, "lib3mf_metadatagroup_addmetadata") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_metadatagroup_addmetadata: " + err.Error()) } - + implementation.Lib3MF_object_gettype, err = syscall.GetProcAddress(dllHandle, "lib3mf_object_gettype") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_object_gettype: " + err.Error()) } - + implementation.Lib3MF_object_settype, err = syscall.GetProcAddress(dllHandle, "lib3mf_object_settype") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_object_settype: " + err.Error()) } - + implementation.Lib3MF_object_getname, err = syscall.GetProcAddress(dllHandle, "lib3mf_object_getname") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_object_getname: " + err.Error()) } - + implementation.Lib3MF_object_setname, err = syscall.GetProcAddress(dllHandle, "lib3mf_object_setname") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_object_setname: " + err.Error()) } - + implementation.Lib3MF_object_getpartnumber, err = syscall.GetProcAddress(dllHandle, "lib3mf_object_getpartnumber") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_object_getpartnumber: " + err.Error()) } - + implementation.Lib3MF_object_setpartnumber, err = syscall.GetProcAddress(dllHandle, "lib3mf_object_setpartnumber") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_object_setpartnumber: " + err.Error()) } - + implementation.Lib3MF_object_ismeshobject, err = syscall.GetProcAddress(dllHandle, "lib3mf_object_ismeshobject") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_object_ismeshobject: " + err.Error()) } - + implementation.Lib3MF_object_iscomponentsobject, err = syscall.GetProcAddress(dllHandle, "lib3mf_object_iscomponentsobject") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_object_iscomponentsobject: " + err.Error()) } - + implementation.Lib3MF_object_isvalid, err = syscall.GetProcAddress(dllHandle, "lib3mf_object_isvalid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_object_isvalid: " + err.Error()) } - + implementation.Lib3MF_object_setattachmentasthumbnail, err = syscall.GetProcAddress(dllHandle, "lib3mf_object_setattachmentasthumbnail") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_object_setattachmentasthumbnail: " + err.Error()) } - + implementation.Lib3MF_object_getthumbnailattachment, err = syscall.GetProcAddress(dllHandle, "lib3mf_object_getthumbnailattachment") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_object_getthumbnailattachment: " + err.Error()) } - + implementation.Lib3MF_object_clearthumbnailattachment, err = syscall.GetProcAddress(dllHandle, "lib3mf_object_clearthumbnailattachment") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_object_clearthumbnailattachment: " + err.Error()) } - + implementation.Lib3MF_object_getoutbox, err = syscall.GetProcAddress(dllHandle, "lib3mf_object_getoutbox") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_object_getoutbox: " + err.Error()) } - + implementation.Lib3MF_object_getuuid, err = syscall.GetProcAddress(dllHandle, "lib3mf_object_getuuid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_object_getuuid: " + err.Error()) } - + implementation.Lib3MF_object_setuuid, err = syscall.GetProcAddress(dllHandle, "lib3mf_object_setuuid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_object_setuuid: " + err.Error()) } - + implementation.Lib3MF_object_getmetadatagroup, err = syscall.GetProcAddress(dllHandle, "lib3mf_object_getmetadatagroup") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_object_getmetadatagroup: " + err.Error()) } - + implementation.Lib3MF_object_setslicesmeshresolution, err = syscall.GetProcAddress(dllHandle, "lib3mf_object_setslicesmeshresolution") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_object_setslicesmeshresolution: " + err.Error()) } - + implementation.Lib3MF_object_getslicesmeshresolution, err = syscall.GetProcAddress(dllHandle, "lib3mf_object_getslicesmeshresolution") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_object_getslicesmeshresolution: " + err.Error()) } - + implementation.Lib3MF_object_hasslices, err = syscall.GetProcAddress(dllHandle, "lib3mf_object_hasslices") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_object_hasslices: " + err.Error()) } - + implementation.Lib3MF_object_clearslicestack, err = syscall.GetProcAddress(dllHandle, "lib3mf_object_clearslicestack") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_object_clearslicestack: " + err.Error()) } - + implementation.Lib3MF_object_getslicestack, err = syscall.GetProcAddress(dllHandle, "lib3mf_object_getslicestack") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_object_getslicestack: " + err.Error()) } - + implementation.Lib3MF_object_assignslicestack, err = syscall.GetProcAddress(dllHandle, "lib3mf_object_assignslicestack") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_object_assignslicestack: " + err.Error()) } - + implementation.Lib3MF_meshobject_getvertexcount, err = syscall.GetProcAddress(dllHandle, "lib3mf_meshobject_getvertexcount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_meshobject_getvertexcount: " + err.Error()) } - + implementation.Lib3MF_meshobject_gettrianglecount, err = syscall.GetProcAddress(dllHandle, "lib3mf_meshobject_gettrianglecount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_meshobject_gettrianglecount: " + err.Error()) } - + implementation.Lib3MF_meshobject_getvertex, err = syscall.GetProcAddress(dllHandle, "lib3mf_meshobject_getvertex") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_meshobject_getvertex: " + err.Error()) } - + implementation.Lib3MF_meshobject_setvertex, err = syscall.GetProcAddress(dllHandle, "lib3mf_meshobject_setvertex") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_meshobject_setvertex: " + err.Error()) } - + implementation.Lib3MF_meshobject_addvertex, err = syscall.GetProcAddress(dllHandle, "lib3mf_meshobject_addvertex") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_meshobject_addvertex: " + err.Error()) } - + implementation.Lib3MF_meshobject_getvertices, err = syscall.GetProcAddress(dllHandle, "lib3mf_meshobject_getvertices") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_meshobject_getvertices: " + err.Error()) } - + implementation.Lib3MF_meshobject_gettriangle, err = syscall.GetProcAddress(dllHandle, "lib3mf_meshobject_gettriangle") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_meshobject_gettriangle: " + err.Error()) } - + implementation.Lib3MF_meshobject_settriangle, err = syscall.GetProcAddress(dllHandle, "lib3mf_meshobject_settriangle") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_meshobject_settriangle: " + err.Error()) } - + implementation.Lib3MF_meshobject_addtriangle, err = syscall.GetProcAddress(dllHandle, "lib3mf_meshobject_addtriangle") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_meshobject_addtriangle: " + err.Error()) } - + implementation.Lib3MF_meshobject_gettriangleindices, err = syscall.GetProcAddress(dllHandle, "lib3mf_meshobject_gettriangleindices") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_meshobject_gettriangleindices: " + err.Error()) } - + implementation.Lib3MF_meshobject_setobjectlevelproperty, err = syscall.GetProcAddress(dllHandle, "lib3mf_meshobject_setobjectlevelproperty") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_meshobject_setobjectlevelproperty: " + err.Error()) } - + implementation.Lib3MF_meshobject_getobjectlevelproperty, err = syscall.GetProcAddress(dllHandle, "lib3mf_meshobject_getobjectlevelproperty") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_meshobject_getobjectlevelproperty: " + err.Error()) } - + implementation.Lib3MF_meshobject_settriangleproperties, err = syscall.GetProcAddress(dllHandle, "lib3mf_meshobject_settriangleproperties") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_meshobject_settriangleproperties: " + err.Error()) } - + implementation.Lib3MF_meshobject_gettriangleproperties, err = syscall.GetProcAddress(dllHandle, "lib3mf_meshobject_gettriangleproperties") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_meshobject_gettriangleproperties: " + err.Error()) } - + implementation.Lib3MF_meshobject_setalltriangleproperties, err = syscall.GetProcAddress(dllHandle, "lib3mf_meshobject_setalltriangleproperties") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_meshobject_setalltriangleproperties: " + err.Error()) } - + implementation.Lib3MF_meshobject_getalltriangleproperties, err = syscall.GetProcAddress(dllHandle, "lib3mf_meshobject_getalltriangleproperties") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_meshobject_getalltriangleproperties: " + err.Error()) } - + implementation.Lib3MF_meshobject_clearallproperties, err = syscall.GetProcAddress(dllHandle, "lib3mf_meshobject_clearallproperties") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_meshobject_clearallproperties: " + err.Error()) } - + implementation.Lib3MF_meshobject_setgeometry, err = syscall.GetProcAddress(dllHandle, "lib3mf_meshobject_setgeometry") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_meshobject_setgeometry: " + err.Error()) } - + implementation.Lib3MF_meshobject_ismanifoldandoriented, err = syscall.GetProcAddress(dllHandle, "lib3mf_meshobject_ismanifoldandoriented") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_meshobject_ismanifoldandoriented: " + err.Error()) } - + implementation.Lib3MF_meshobject_beamlattice, err = syscall.GetProcAddress(dllHandle, "lib3mf_meshobject_beamlattice") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_meshobject_beamlattice: " + err.Error()) } - + implementation.Lib3MF_beamlattice_getminlength, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamlattice_getminlength") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamlattice_getminlength: " + err.Error()) } - + implementation.Lib3MF_beamlattice_setminlength, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamlattice_setminlength") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamlattice_setminlength: " + err.Error()) } - + implementation.Lib3MF_beamlattice_getclipping, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamlattice_getclipping") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamlattice_getclipping: " + err.Error()) } - + implementation.Lib3MF_beamlattice_setclipping, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamlattice_setclipping") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamlattice_setclipping: " + err.Error()) } - + implementation.Lib3MF_beamlattice_getrepresentation, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamlattice_getrepresentation") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamlattice_getrepresentation: " + err.Error()) } - + implementation.Lib3MF_beamlattice_setrepresentation, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamlattice_setrepresentation") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamlattice_setrepresentation: " + err.Error()) } - + implementation.Lib3MF_beamlattice_getballoptions, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamlattice_getballoptions") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamlattice_getballoptions: " + err.Error()) } - + implementation.Lib3MF_beamlattice_setballoptions, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamlattice_setballoptions") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamlattice_setballoptions: " + err.Error()) } - + implementation.Lib3MF_beamlattice_getbeamcount, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamlattice_getbeamcount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamlattice_getbeamcount: " + err.Error()) } - + implementation.Lib3MF_beamlattice_getbeam, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamlattice_getbeam") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamlattice_getbeam: " + err.Error()) } - + implementation.Lib3MF_beamlattice_addbeam, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamlattice_addbeam") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamlattice_addbeam: " + err.Error()) } - + implementation.Lib3MF_beamlattice_setbeam, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamlattice_setbeam") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamlattice_setbeam: " + err.Error()) } - + implementation.Lib3MF_beamlattice_setbeams, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamlattice_setbeams") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamlattice_setbeams: " + err.Error()) } - + implementation.Lib3MF_beamlattice_getbeams, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamlattice_getbeams") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamlattice_getbeams: " + err.Error()) } - + implementation.Lib3MF_beamlattice_getballcount, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamlattice_getballcount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamlattice_getballcount: " + err.Error()) } - + implementation.Lib3MF_beamlattice_getball, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamlattice_getball") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamlattice_getball: " + err.Error()) } - + implementation.Lib3MF_beamlattice_addball, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamlattice_addball") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamlattice_addball: " + err.Error()) } - + implementation.Lib3MF_beamlattice_setball, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamlattice_setball") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamlattice_setball: " + err.Error()) } - + implementation.Lib3MF_beamlattice_setballs, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamlattice_setballs") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamlattice_setballs: " + err.Error()) } - + implementation.Lib3MF_beamlattice_getballs, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamlattice_getballs") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamlattice_getballs: " + err.Error()) } - + implementation.Lib3MF_beamlattice_getbeamsetcount, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamlattice_getbeamsetcount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamlattice_getbeamsetcount: " + err.Error()) } - + implementation.Lib3MF_beamlattice_addbeamset, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamlattice_addbeamset") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamlattice_addbeamset: " + err.Error()) } - + implementation.Lib3MF_beamlattice_getbeamset, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamlattice_getbeamset") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamlattice_getbeamset: " + err.Error()) } - + implementation.Lib3MF_component_getobjectresource, err = syscall.GetProcAddress(dllHandle, "lib3mf_component_getobjectresource") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_component_getobjectresource: " + err.Error()) } - + implementation.Lib3MF_component_getobjectresourceid, err = syscall.GetProcAddress(dllHandle, "lib3mf_component_getobjectresourceid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_component_getobjectresourceid: " + err.Error()) } - + implementation.Lib3MF_component_getuuid, err = syscall.GetProcAddress(dllHandle, "lib3mf_component_getuuid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_component_getuuid: " + err.Error()) } - + implementation.Lib3MF_component_setuuid, err = syscall.GetProcAddress(dllHandle, "lib3mf_component_setuuid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_component_setuuid: " + err.Error()) } - + implementation.Lib3MF_component_hastransform, err = syscall.GetProcAddress(dllHandle, "lib3mf_component_hastransform") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_component_hastransform: " + err.Error()) } - + implementation.Lib3MF_component_gettransform, err = syscall.GetProcAddress(dllHandle, "lib3mf_component_gettransform") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_component_gettransform: " + err.Error()) } - + implementation.Lib3MF_component_settransform, err = syscall.GetProcAddress(dllHandle, "lib3mf_component_settransform") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_component_settransform: " + err.Error()) } - + implementation.Lib3MF_componentsobject_addcomponent, err = syscall.GetProcAddress(dllHandle, "lib3mf_componentsobject_addcomponent") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_componentsobject_addcomponent: " + err.Error()) } - + implementation.Lib3MF_componentsobject_getcomponent, err = syscall.GetProcAddress(dllHandle, "lib3mf_componentsobject_getcomponent") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_componentsobject_getcomponent: " + err.Error()) } - + implementation.Lib3MF_componentsobject_getcomponentcount, err = syscall.GetProcAddress(dllHandle, "lib3mf_componentsobject_getcomponentcount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_componentsobject_getcomponentcount: " + err.Error()) } - + implementation.Lib3MF_beamset_setname, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamset_setname") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamset_setname: " + err.Error()) } - + implementation.Lib3MF_beamset_getname, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamset_getname") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamset_getname: " + err.Error()) } - + implementation.Lib3MF_beamset_setidentifier, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamset_setidentifier") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamset_setidentifier: " + err.Error()) } - + implementation.Lib3MF_beamset_getidentifier, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamset_getidentifier") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamset_getidentifier: " + err.Error()) } - + implementation.Lib3MF_beamset_getreferencecount, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamset_getreferencecount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamset_getreferencecount: " + err.Error()) } - + implementation.Lib3MF_beamset_setreferences, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamset_setreferences") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamset_setreferences: " + err.Error()) } - + implementation.Lib3MF_beamset_getreferences, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamset_getreferences") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamset_getreferences: " + err.Error()) } - + implementation.Lib3MF_beamset_getballreferencecount, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamset_getballreferencecount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamset_getballreferencecount: " + err.Error()) } - + implementation.Lib3MF_beamset_setballreferences, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamset_setballreferences") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamset_setballreferences: " + err.Error()) } - + implementation.Lib3MF_beamset_getballreferences, err = syscall.GetProcAddress(dllHandle, "lib3mf_beamset_getballreferences") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_beamset_getballreferences: " + err.Error()) } - + implementation.Lib3MF_basematerialgroup_getcount, err = syscall.GetProcAddress(dllHandle, "lib3mf_basematerialgroup_getcount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_basematerialgroup_getcount: " + err.Error()) } - + implementation.Lib3MF_basematerialgroup_getallpropertyids, err = syscall.GetProcAddress(dllHandle, "lib3mf_basematerialgroup_getallpropertyids") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_basematerialgroup_getallpropertyids: " + err.Error()) } - + implementation.Lib3MF_basematerialgroup_addmaterial, err = syscall.GetProcAddress(dllHandle, "lib3mf_basematerialgroup_addmaterial") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_basematerialgroup_addmaterial: " + err.Error()) } - + implementation.Lib3MF_basematerialgroup_removematerial, err = syscall.GetProcAddress(dllHandle, "lib3mf_basematerialgroup_removematerial") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_basematerialgroup_removematerial: " + err.Error()) } - + implementation.Lib3MF_basematerialgroup_getname, err = syscall.GetProcAddress(dllHandle, "lib3mf_basematerialgroup_getname") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_basematerialgroup_getname: " + err.Error()) } - + implementation.Lib3MF_basematerialgroup_setname, err = syscall.GetProcAddress(dllHandle, "lib3mf_basematerialgroup_setname") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_basematerialgroup_setname: " + err.Error()) } - + implementation.Lib3MF_basematerialgroup_setdisplaycolor, err = syscall.GetProcAddress(dllHandle, "lib3mf_basematerialgroup_setdisplaycolor") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_basematerialgroup_setdisplaycolor: " + err.Error()) } - + implementation.Lib3MF_basematerialgroup_getdisplaycolor, err = syscall.GetProcAddress(dllHandle, "lib3mf_basematerialgroup_getdisplaycolor") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_basematerialgroup_getdisplaycolor: " + err.Error()) } - + implementation.Lib3MF_colorgroup_getcount, err = syscall.GetProcAddress(dllHandle, "lib3mf_colorgroup_getcount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_colorgroup_getcount: " + err.Error()) } - + implementation.Lib3MF_colorgroup_getallpropertyids, err = syscall.GetProcAddress(dllHandle, "lib3mf_colorgroup_getallpropertyids") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_colorgroup_getallpropertyids: " + err.Error()) } - + implementation.Lib3MF_colorgroup_addcolor, err = syscall.GetProcAddress(dllHandle, "lib3mf_colorgroup_addcolor") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_colorgroup_addcolor: " + err.Error()) } - + implementation.Lib3MF_colorgroup_removecolor, err = syscall.GetProcAddress(dllHandle, "lib3mf_colorgroup_removecolor") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_colorgroup_removecolor: " + err.Error()) } - + implementation.Lib3MF_colorgroup_setcolor, err = syscall.GetProcAddress(dllHandle, "lib3mf_colorgroup_setcolor") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_colorgroup_setcolor: " + err.Error()) } - + implementation.Lib3MF_colorgroup_getcolor, err = syscall.GetProcAddress(dllHandle, "lib3mf_colorgroup_getcolor") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_colorgroup_getcolor: " + err.Error()) } - + implementation.Lib3MF_texture2dgroup_getcount, err = syscall.GetProcAddress(dllHandle, "lib3mf_texture2dgroup_getcount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_texture2dgroup_getcount: " + err.Error()) } - + implementation.Lib3MF_texture2dgroup_getallpropertyids, err = syscall.GetProcAddress(dllHandle, "lib3mf_texture2dgroup_getallpropertyids") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_texture2dgroup_getallpropertyids: " + err.Error()) } - + implementation.Lib3MF_texture2dgroup_addtex2coord, err = syscall.GetProcAddress(dllHandle, "lib3mf_texture2dgroup_addtex2coord") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_texture2dgroup_addtex2coord: " + err.Error()) } - + implementation.Lib3MF_texture2dgroup_gettex2coord, err = syscall.GetProcAddress(dllHandle, "lib3mf_texture2dgroup_gettex2coord") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_texture2dgroup_gettex2coord: " + err.Error()) } - + implementation.Lib3MF_texture2dgroup_removetex2coord, err = syscall.GetProcAddress(dllHandle, "lib3mf_texture2dgroup_removetex2coord") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_texture2dgroup_removetex2coord: " + err.Error()) } - + implementation.Lib3MF_texture2dgroup_gettexture2d, err = syscall.GetProcAddress(dllHandle, "lib3mf_texture2dgroup_gettexture2d") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_texture2dgroup_gettexture2d: " + err.Error()) } - + implementation.Lib3MF_compositematerials_getcount, err = syscall.GetProcAddress(dllHandle, "lib3mf_compositematerials_getcount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_compositematerials_getcount: " + err.Error()) } - + implementation.Lib3MF_compositematerials_getallpropertyids, err = syscall.GetProcAddress(dllHandle, "lib3mf_compositematerials_getallpropertyids") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_compositematerials_getallpropertyids: " + err.Error()) } - + implementation.Lib3MF_compositematerials_getbasematerialgroup, err = syscall.GetProcAddress(dllHandle, "lib3mf_compositematerials_getbasematerialgroup") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_compositematerials_getbasematerialgroup: " + err.Error()) } - + implementation.Lib3MF_compositematerials_addcomposite, err = syscall.GetProcAddress(dllHandle, "lib3mf_compositematerials_addcomposite") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_compositematerials_addcomposite: " + err.Error()) } - + implementation.Lib3MF_compositematerials_removecomposite, err = syscall.GetProcAddress(dllHandle, "lib3mf_compositematerials_removecomposite") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_compositematerials_removecomposite: " + err.Error()) } - + implementation.Lib3MF_compositematerials_getcomposite, err = syscall.GetProcAddress(dllHandle, "lib3mf_compositematerials_getcomposite") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_compositematerials_getcomposite: " + err.Error()) } - + implementation.Lib3MF_multipropertygroup_getcount, err = syscall.GetProcAddress(dllHandle, "lib3mf_multipropertygroup_getcount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_multipropertygroup_getcount: " + err.Error()) } - + implementation.Lib3MF_multipropertygroup_getallpropertyids, err = syscall.GetProcAddress(dllHandle, "lib3mf_multipropertygroup_getallpropertyids") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_multipropertygroup_getallpropertyids: " + err.Error()) } - + implementation.Lib3MF_multipropertygroup_addmultiproperty, err = syscall.GetProcAddress(dllHandle, "lib3mf_multipropertygroup_addmultiproperty") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_multipropertygroup_addmultiproperty: " + err.Error()) } - + implementation.Lib3MF_multipropertygroup_setmultiproperty, err = syscall.GetProcAddress(dllHandle, "lib3mf_multipropertygroup_setmultiproperty") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_multipropertygroup_setmultiproperty: " + err.Error()) } - + implementation.Lib3MF_multipropertygroup_getmultiproperty, err = syscall.GetProcAddress(dllHandle, "lib3mf_multipropertygroup_getmultiproperty") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_multipropertygroup_getmultiproperty: " + err.Error()) } - + implementation.Lib3MF_multipropertygroup_removemultiproperty, err = syscall.GetProcAddress(dllHandle, "lib3mf_multipropertygroup_removemultiproperty") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_multipropertygroup_removemultiproperty: " + err.Error()) } - + implementation.Lib3MF_multipropertygroup_getlayercount, err = syscall.GetProcAddress(dllHandle, "lib3mf_multipropertygroup_getlayercount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_multipropertygroup_getlayercount: " + err.Error()) } - + implementation.Lib3MF_multipropertygroup_addlayer, err = syscall.GetProcAddress(dllHandle, "lib3mf_multipropertygroup_addlayer") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_multipropertygroup_addlayer: " + err.Error()) } - + implementation.Lib3MF_multipropertygroup_getlayer, err = syscall.GetProcAddress(dllHandle, "lib3mf_multipropertygroup_getlayer") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_multipropertygroup_getlayer: " + err.Error()) } - + implementation.Lib3MF_multipropertygroup_removelayer, err = syscall.GetProcAddress(dllHandle, "lib3mf_multipropertygroup_removelayer") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_multipropertygroup_removelayer: " + err.Error()) } - + implementation.Lib3MF_attachment_getpath, err = syscall.GetProcAddress(dllHandle, "lib3mf_attachment_getpath") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_attachment_getpath: " + err.Error()) } - + implementation.Lib3MF_attachment_setpath, err = syscall.GetProcAddress(dllHandle, "lib3mf_attachment_setpath") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_attachment_setpath: " + err.Error()) } - + implementation.Lib3MF_attachment_packagepart, err = syscall.GetProcAddress(dllHandle, "lib3mf_attachment_packagepart") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_attachment_packagepart: " + err.Error()) } - + implementation.Lib3MF_attachment_getrelationshiptype, err = syscall.GetProcAddress(dllHandle, "lib3mf_attachment_getrelationshiptype") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_attachment_getrelationshiptype: " + err.Error()) } - + implementation.Lib3MF_attachment_setrelationshiptype, err = syscall.GetProcAddress(dllHandle, "lib3mf_attachment_setrelationshiptype") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_attachment_setrelationshiptype: " + err.Error()) } - + implementation.Lib3MF_attachment_writetofile, err = syscall.GetProcAddress(dllHandle, "lib3mf_attachment_writetofile") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_attachment_writetofile: " + err.Error()) } - + implementation.Lib3MF_attachment_readfromfile, err = syscall.GetProcAddress(dllHandle, "lib3mf_attachment_readfromfile") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_attachment_readfromfile: " + err.Error()) } - + implementation.Lib3MF_attachment_readfromcallback, err = syscall.GetProcAddress(dllHandle, "lib3mf_attachment_readfromcallback") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_attachment_readfromcallback: " + err.Error()) } - + implementation.Lib3MF_attachment_getstreamsize, err = syscall.GetProcAddress(dllHandle, "lib3mf_attachment_getstreamsize") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_attachment_getstreamsize: " + err.Error()) } - + implementation.Lib3MF_attachment_writetobuffer, err = syscall.GetProcAddress(dllHandle, "lib3mf_attachment_writetobuffer") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_attachment_writetobuffer: " + err.Error()) } - + implementation.Lib3MF_attachment_readfrombuffer, err = syscall.GetProcAddress(dllHandle, "lib3mf_attachment_readfrombuffer") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_attachment_readfrombuffer: " + err.Error()) } - + implementation.Lib3MF_texture2d_getattachment, err = syscall.GetProcAddress(dllHandle, "lib3mf_texture2d_getattachment") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_texture2d_getattachment: " + err.Error()) } - + implementation.Lib3MF_texture2d_setattachment, err = syscall.GetProcAddress(dllHandle, "lib3mf_texture2d_setattachment") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_texture2d_setattachment: " + err.Error()) } - + implementation.Lib3MF_texture2d_getcontenttype, err = syscall.GetProcAddress(dllHandle, "lib3mf_texture2d_getcontenttype") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_texture2d_getcontenttype: " + err.Error()) } - + implementation.Lib3MF_texture2d_setcontenttype, err = syscall.GetProcAddress(dllHandle, "lib3mf_texture2d_setcontenttype") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_texture2d_setcontenttype: " + err.Error()) } - + implementation.Lib3MF_texture2d_gettilestyleuv, err = syscall.GetProcAddress(dllHandle, "lib3mf_texture2d_gettilestyleuv") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_texture2d_gettilestyleuv: " + err.Error()) } - + implementation.Lib3MF_texture2d_settilestyleuv, err = syscall.GetProcAddress(dllHandle, "lib3mf_texture2d_settilestyleuv") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_texture2d_settilestyleuv: " + err.Error()) } - + implementation.Lib3MF_texture2d_getfilter, err = syscall.GetProcAddress(dllHandle, "lib3mf_texture2d_getfilter") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_texture2d_getfilter: " + err.Error()) } - + implementation.Lib3MF_texture2d_setfilter, err = syscall.GetProcAddress(dllHandle, "lib3mf_texture2d_setfilter") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_texture2d_setfilter: " + err.Error()) } - + implementation.Lib3MF_builditem_getobjectresource, err = syscall.GetProcAddress(dllHandle, "lib3mf_builditem_getobjectresource") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_builditem_getobjectresource: " + err.Error()) } - + implementation.Lib3MF_builditem_getuuid, err = syscall.GetProcAddress(dllHandle, "lib3mf_builditem_getuuid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_builditem_getuuid: " + err.Error()) } - + implementation.Lib3MF_builditem_setuuid, err = syscall.GetProcAddress(dllHandle, "lib3mf_builditem_setuuid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_builditem_setuuid: " + err.Error()) } - + implementation.Lib3MF_builditem_getobjectresourceid, err = syscall.GetProcAddress(dllHandle, "lib3mf_builditem_getobjectresourceid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_builditem_getobjectresourceid: " + err.Error()) } - + implementation.Lib3MF_builditem_hasobjecttransform, err = syscall.GetProcAddress(dllHandle, "lib3mf_builditem_hasobjecttransform") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_builditem_hasobjecttransform: " + err.Error()) } - + implementation.Lib3MF_builditem_getobjecttransform, err = syscall.GetProcAddress(dllHandle, "lib3mf_builditem_getobjecttransform") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_builditem_getobjecttransform: " + err.Error()) } - + implementation.Lib3MF_builditem_setobjecttransform, err = syscall.GetProcAddress(dllHandle, "lib3mf_builditem_setobjecttransform") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_builditem_setobjecttransform: " + err.Error()) } - + implementation.Lib3MF_builditem_getpartnumber, err = syscall.GetProcAddress(dllHandle, "lib3mf_builditem_getpartnumber") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_builditem_getpartnumber: " + err.Error()) } - + implementation.Lib3MF_builditem_setpartnumber, err = syscall.GetProcAddress(dllHandle, "lib3mf_builditem_setpartnumber") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_builditem_setpartnumber: " + err.Error()) } - + implementation.Lib3MF_builditem_getmetadatagroup, err = syscall.GetProcAddress(dllHandle, "lib3mf_builditem_getmetadatagroup") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_builditem_getmetadatagroup: " + err.Error()) } - + implementation.Lib3MF_builditem_getoutbox, err = syscall.GetProcAddress(dllHandle, "lib3mf_builditem_getoutbox") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_builditem_getoutbox: " + err.Error()) } - + implementation.Lib3MF_builditemiterator_movenext, err = syscall.GetProcAddress(dllHandle, "lib3mf_builditemiterator_movenext") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_builditemiterator_movenext: " + err.Error()) } - + implementation.Lib3MF_builditemiterator_moveprevious, err = syscall.GetProcAddress(dllHandle, "lib3mf_builditemiterator_moveprevious") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_builditemiterator_moveprevious: " + err.Error()) } - + implementation.Lib3MF_builditemiterator_getcurrent, err = syscall.GetProcAddress(dllHandle, "lib3mf_builditemiterator_getcurrent") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_builditemiterator_getcurrent: " + err.Error()) } - + implementation.Lib3MF_builditemiterator_clone, err = syscall.GetProcAddress(dllHandle, "lib3mf_builditemiterator_clone") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_builditemiterator_clone: " + err.Error()) } - + implementation.Lib3MF_builditemiterator_count, err = syscall.GetProcAddress(dllHandle, "lib3mf_builditemiterator_count") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_builditemiterator_count: " + err.Error()) } - + implementation.Lib3MF_slice_setvertices, err = syscall.GetProcAddress(dllHandle, "lib3mf_slice_setvertices") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_slice_setvertices: " + err.Error()) } - + implementation.Lib3MF_slice_getvertices, err = syscall.GetProcAddress(dllHandle, "lib3mf_slice_getvertices") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_slice_getvertices: " + err.Error()) } - + implementation.Lib3MF_slice_getvertexcount, err = syscall.GetProcAddress(dllHandle, "lib3mf_slice_getvertexcount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_slice_getvertexcount: " + err.Error()) } - + implementation.Lib3MF_slice_addpolygon, err = syscall.GetProcAddress(dllHandle, "lib3mf_slice_addpolygon") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_slice_addpolygon: " + err.Error()) } - + implementation.Lib3MF_slice_getpolygoncount, err = syscall.GetProcAddress(dllHandle, "lib3mf_slice_getpolygoncount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_slice_getpolygoncount: " + err.Error()) } - + implementation.Lib3MF_slice_setpolygonindices, err = syscall.GetProcAddress(dllHandle, "lib3mf_slice_setpolygonindices") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_slice_setpolygonindices: " + err.Error()) } - + implementation.Lib3MF_slice_getpolygonindices, err = syscall.GetProcAddress(dllHandle, "lib3mf_slice_getpolygonindices") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_slice_getpolygonindices: " + err.Error()) } - + implementation.Lib3MF_slice_getpolygonindexcount, err = syscall.GetProcAddress(dllHandle, "lib3mf_slice_getpolygonindexcount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_slice_getpolygonindexcount: " + err.Error()) } - + implementation.Lib3MF_slice_getztop, err = syscall.GetProcAddress(dllHandle, "lib3mf_slice_getztop") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_slice_getztop: " + err.Error()) } - + + implementation.Lib3MF_toolpathprofile_getuuid, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpathprofile_getuuid") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpathprofile_getuuid: " + err.Error()) + } + + implementation.Lib3MF_toolpathprofile_getname, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpathprofile_getname") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpathprofile_getname: " + err.Error()) + } + + implementation.Lib3MF_toolpathprofile_hasparametervalue, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpathprofile_hasparametervalue") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpathprofile_hasparametervalue: " + err.Error()) + } + + implementation.Lib3MF_toolpathprofile_getparameterdoublevalue, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpathprofile_getparameterdoublevalue") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpathprofile_getparameterdoublevalue: " + err.Error()) + } + + implementation.Lib3MF_toolpathprofile_getparameterdoublevaluedef, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpathprofile_getparameterdoublevaluedef") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpathprofile_getparameterdoublevaluedef: " + err.Error()) + } + + implementation.Lib3MF_toolpathprofile_setname, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpathprofile_setname") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpathprofile_setname: " + err.Error()) + } + + implementation.Lib3MF_toolpathprofile_setparameterdoublevalue, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpathprofile_setparameterdoublevalue") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpathprofile_setparameterdoublevalue: " + err.Error()) + } + + implementation.Lib3MF_toolpathlayerreader_getlayerdatauuid, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpathlayerreader_getlayerdatauuid") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpathlayerreader_getlayerdatauuid: " + err.Error()) + } + + implementation.Lib3MF_toolpathlayerreader_getsegmentcount, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpathlayerreader_getsegmentcount") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpathlayerreader_getsegmentcount: " + err.Error()) + } + + implementation.Lib3MF_toolpathlayerreader_getsegmentinfo, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpathlayerreader_getsegmentinfo") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpathlayerreader_getsegmentinfo: " + err.Error()) + } + + implementation.Lib3MF_toolpathlayerreader_getsegmentprofile, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpathlayerreader_getsegmentprofile") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpathlayerreader_getsegmentprofile: " + err.Error()) + } + + implementation.Lib3MF_toolpathlayerreader_getsegmentprofileuuid, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpathlayerreader_getsegmentprofileuuid") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpathlayerreader_getsegmentprofileuuid: " + err.Error()) + } + + implementation.Lib3MF_toolpathlayerreader_getsegmentpart, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpathlayerreader_getsegmentpart") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpathlayerreader_getsegmentpart: " + err.Error()) + } + + implementation.Lib3MF_toolpathlayerreader_getsegmentpartuuid, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpathlayerreader_getsegmentpartuuid") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpathlayerreader_getsegmentpartuuid: " + err.Error()) + } + + implementation.Lib3MF_toolpathlayerreader_getsegmentpointdata, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpathlayerreader_getsegmentpointdata") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpathlayerreader_getsegmentpointdata: " + err.Error()) + } + + implementation.Lib3MF_toolpathlayerdata_getlayerdatauuid, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpathlayerdata_getlayerdatauuid") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpathlayerdata_getlayerdatauuid: " + err.Error()) + } + + implementation.Lib3MF_toolpathlayerdata_registerprofile, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpathlayerdata_registerprofile") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpathlayerdata_registerprofile: " + err.Error()) + } + + implementation.Lib3MF_toolpathlayerdata_registerbuilditem, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpathlayerdata_registerbuilditem") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpathlayerdata_registerbuilditem: " + err.Error()) + } + + implementation.Lib3MF_toolpathlayerdata_writehatchdata, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpathlayerdata_writehatchdata") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpathlayerdata_writehatchdata: " + err.Error()) + } + + implementation.Lib3MF_toolpathlayerdata_writeloop, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpathlayerdata_writeloop") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpathlayerdata_writeloop: " + err.Error()) + } + + implementation.Lib3MF_toolpathlayerdata_writepolyline, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpathlayerdata_writepolyline") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpathlayerdata_writepolyline: " + err.Error()) + } + + implementation.Lib3MF_toolpathlayerdata_finish, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpathlayerdata_finish") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpathlayerdata_finish: " + err.Error()) + } + + implementation.Lib3MF_toolpath_getunits, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpath_getunits") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpath_getunits: " + err.Error()) + } + + implementation.Lib3MF_toolpath_getlayercount, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpath_getlayercount") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpath_getlayercount: " + err.Error()) + } + + implementation.Lib3MF_toolpath_getprofilecount, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpath_getprofilecount") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpath_getprofilecount: " + err.Error()) + } + + implementation.Lib3MF_toolpath_addlayer, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpath_addlayer") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpath_addlayer: " + err.Error()) + } + + implementation.Lib3MF_toolpath_getlayerattachment, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpath_getlayerattachment") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpath_getlayerattachment: " + err.Error()) + } + + implementation.Lib3MF_toolpath_readlayerdata, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpath_readlayerdata") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpath_readlayerdata: " + err.Error()) + } + + implementation.Lib3MF_toolpath_getlayerpath, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpath_getlayerpath") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpath_getlayerpath: " + err.Error()) + } + + implementation.Lib3MF_toolpath_getlayerzmax, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpath_getlayerzmax") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpath_getlayerzmax: " + err.Error()) + } + + implementation.Lib3MF_toolpath_getlayerz, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpath_getlayerz") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpath_getlayerz: " + err.Error()) + } + + implementation.Lib3MF_toolpath_addprofile, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpath_addprofile") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpath_addprofile: " + err.Error()) + } + + implementation.Lib3MF_toolpath_getprofile, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpath_getprofile") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpath_getprofile: " + err.Error()) + } + + implementation.Lib3MF_toolpath_getprofileuuid, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpath_getprofileuuid") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpath_getprofileuuid: " + err.Error()) + } + + implementation.Lib3MF_toolpathiterator_getcurrenttoolpath, err = syscall.GetProcAddress(dllHandle, "lib3mf_toolpathiterator_getcurrenttoolpath") + if (err != nil) { + return errors.New("Could not get function lib3mf_toolpathiterator_getcurrenttoolpath: " + err.Error()) + } + implementation.Lib3MF_slicestack_getbottomz, err = syscall.GetProcAddress(dllHandle, "lib3mf_slicestack_getbottomz") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_slicestack_getbottomz: " + err.Error()) } - + implementation.Lib3MF_slicestack_getslicecount, err = syscall.GetProcAddress(dllHandle, "lib3mf_slicestack_getslicecount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_slicestack_getslicecount: " + err.Error()) } - + implementation.Lib3MF_slicestack_getslice, err = syscall.GetProcAddress(dllHandle, "lib3mf_slicestack_getslice") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_slicestack_getslice: " + err.Error()) } - + implementation.Lib3MF_slicestack_addslice, err = syscall.GetProcAddress(dllHandle, "lib3mf_slicestack_addslice") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_slicestack_addslice: " + err.Error()) } - + implementation.Lib3MF_slicestack_getslicerefcount, err = syscall.GetProcAddress(dllHandle, "lib3mf_slicestack_getslicerefcount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_slicestack_getslicerefcount: " + err.Error()) } - + implementation.Lib3MF_slicestack_addslicestackreference, err = syscall.GetProcAddress(dllHandle, "lib3mf_slicestack_addslicestackreference") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_slicestack_addslicestackreference: " + err.Error()) } - + implementation.Lib3MF_slicestack_getslicestackreference, err = syscall.GetProcAddress(dllHandle, "lib3mf_slicestack_getslicestackreference") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_slicestack_getslicestackreference: " + err.Error()) } - + implementation.Lib3MF_slicestack_collapseslicereferences, err = syscall.GetProcAddress(dllHandle, "lib3mf_slicestack_collapseslicereferences") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_slicestack_collapseslicereferences: " + err.Error()) } - + implementation.Lib3MF_slicestack_setownpath, err = syscall.GetProcAddress(dllHandle, "lib3mf_slicestack_setownpath") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_slicestack_setownpath: " + err.Error()) } - + implementation.Lib3MF_slicestack_getownpath, err = syscall.GetProcAddress(dllHandle, "lib3mf_slicestack_getownpath") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_slicestack_getownpath: " + err.Error()) } - + implementation.Lib3MF_consumer_getconsumerid, err = syscall.GetProcAddress(dllHandle, "lib3mf_consumer_getconsumerid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_consumer_getconsumerid: " + err.Error()) } - + implementation.Lib3MF_consumer_getkeyid, err = syscall.GetProcAddress(dllHandle, "lib3mf_consumer_getkeyid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_consumer_getkeyid: " + err.Error()) } - + implementation.Lib3MF_consumer_getkeyvalue, err = syscall.GetProcAddress(dllHandle, "lib3mf_consumer_getkeyvalue") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_consumer_getkeyvalue: " + err.Error()) } - + implementation.Lib3MF_accessright_getconsumer, err = syscall.GetProcAddress(dllHandle, "lib3mf_accessright_getconsumer") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_accessright_getconsumer: " + err.Error()) } - + implementation.Lib3MF_accessright_getwrappingalgorithm, err = syscall.GetProcAddress(dllHandle, "lib3mf_accessright_getwrappingalgorithm") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_accessright_getwrappingalgorithm: " + err.Error()) } - + implementation.Lib3MF_accessright_getmgfalgorithm, err = syscall.GetProcAddress(dllHandle, "lib3mf_accessright_getmgfalgorithm") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_accessright_getmgfalgorithm: " + err.Error()) } - + implementation.Lib3MF_accessright_getdigestmethod, err = syscall.GetProcAddress(dllHandle, "lib3mf_accessright_getdigestmethod") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_accessright_getdigestmethod: " + err.Error()) } - + implementation.Lib3MF_contentencryptionparams_getencryptionalgorithm, err = syscall.GetProcAddress(dllHandle, "lib3mf_contentencryptionparams_getencryptionalgorithm") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_contentencryptionparams_getencryptionalgorithm: " + err.Error()) } - + implementation.Lib3MF_contentencryptionparams_getkey, err = syscall.GetProcAddress(dllHandle, "lib3mf_contentencryptionparams_getkey") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_contentencryptionparams_getkey: " + err.Error()) } - + implementation.Lib3MF_contentencryptionparams_getinitializationvector, err = syscall.GetProcAddress(dllHandle, "lib3mf_contentencryptionparams_getinitializationvector") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_contentencryptionparams_getinitializationvector: " + err.Error()) } - + implementation.Lib3MF_contentencryptionparams_getauthenticationtag, err = syscall.GetProcAddress(dllHandle, "lib3mf_contentencryptionparams_getauthenticationtag") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_contentencryptionparams_getauthenticationtag: " + err.Error()) } - + implementation.Lib3MF_contentencryptionparams_setauthenticationtag, err = syscall.GetProcAddress(dllHandle, "lib3mf_contentencryptionparams_setauthenticationtag") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_contentencryptionparams_setauthenticationtag: " + err.Error()) } - + implementation.Lib3MF_contentencryptionparams_getadditionalauthenticationdata, err = syscall.GetProcAddress(dllHandle, "lib3mf_contentencryptionparams_getadditionalauthenticationdata") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_contentencryptionparams_getadditionalauthenticationdata: " + err.Error()) } - + implementation.Lib3MF_contentencryptionparams_getdescriptor, err = syscall.GetProcAddress(dllHandle, "lib3mf_contentencryptionparams_getdescriptor") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_contentencryptionparams_getdescriptor: " + err.Error()) } - + implementation.Lib3MF_contentencryptionparams_getkeyuuid, err = syscall.GetProcAddress(dllHandle, "lib3mf_contentencryptionparams_getkeyuuid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_contentencryptionparams_getkeyuuid: " + err.Error()) } - + implementation.Lib3MF_resourcedata_getpath, err = syscall.GetProcAddress(dllHandle, "lib3mf_resourcedata_getpath") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_resourcedata_getpath: " + err.Error()) } - + implementation.Lib3MF_resourcedata_getencryptionalgorithm, err = syscall.GetProcAddress(dllHandle, "lib3mf_resourcedata_getencryptionalgorithm") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_resourcedata_getencryptionalgorithm: " + err.Error()) } - + implementation.Lib3MF_resourcedata_getcompression, err = syscall.GetProcAddress(dllHandle, "lib3mf_resourcedata_getcompression") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_resourcedata_getcompression: " + err.Error()) } - + implementation.Lib3MF_resourcedata_getadditionalauthenticationdata, err = syscall.GetProcAddress(dllHandle, "lib3mf_resourcedata_getadditionalauthenticationdata") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_resourcedata_getadditionalauthenticationdata: " + err.Error()) } - + implementation.Lib3MF_resourcedatagroup_getkeyuuid, err = syscall.GetProcAddress(dllHandle, "lib3mf_resourcedatagroup_getkeyuuid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_resourcedatagroup_getkeyuuid: " + err.Error()) } - + implementation.Lib3MF_resourcedatagroup_addaccessright, err = syscall.GetProcAddress(dllHandle, "lib3mf_resourcedatagroup_addaccessright") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_resourcedatagroup_addaccessright: " + err.Error()) } - + implementation.Lib3MF_resourcedatagroup_findaccessrightbyconsumer, err = syscall.GetProcAddress(dllHandle, "lib3mf_resourcedatagroup_findaccessrightbyconsumer") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_resourcedatagroup_findaccessrightbyconsumer: " + err.Error()) } - + implementation.Lib3MF_resourcedatagroup_removeaccessright, err = syscall.GetProcAddress(dllHandle, "lib3mf_resourcedatagroup_removeaccessright") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_resourcedatagroup_removeaccessright: " + err.Error()) } - + implementation.Lib3MF_keystore_addconsumer, err = syscall.GetProcAddress(dllHandle, "lib3mf_keystore_addconsumer") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_keystore_addconsumer: " + err.Error()) } - + implementation.Lib3MF_keystore_getconsumercount, err = syscall.GetProcAddress(dllHandle, "lib3mf_keystore_getconsumercount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_keystore_getconsumercount: " + err.Error()) } - + implementation.Lib3MF_keystore_getconsumer, err = syscall.GetProcAddress(dllHandle, "lib3mf_keystore_getconsumer") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_keystore_getconsumer: " + err.Error()) } - + implementation.Lib3MF_keystore_removeconsumer, err = syscall.GetProcAddress(dllHandle, "lib3mf_keystore_removeconsumer") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_keystore_removeconsumer: " + err.Error()) } - + implementation.Lib3MF_keystore_findconsumer, err = syscall.GetProcAddress(dllHandle, "lib3mf_keystore_findconsumer") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_keystore_findconsumer: " + err.Error()) } - + implementation.Lib3MF_keystore_getresourcedatagroupcount, err = syscall.GetProcAddress(dllHandle, "lib3mf_keystore_getresourcedatagroupcount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_keystore_getresourcedatagroupcount: " + err.Error()) } - + implementation.Lib3MF_keystore_addresourcedatagroup, err = syscall.GetProcAddress(dllHandle, "lib3mf_keystore_addresourcedatagroup") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_keystore_addresourcedatagroup: " + err.Error()) } - + implementation.Lib3MF_keystore_getresourcedatagroup, err = syscall.GetProcAddress(dllHandle, "lib3mf_keystore_getresourcedatagroup") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_keystore_getresourcedatagroup: " + err.Error()) } - + implementation.Lib3MF_keystore_removeresourcedatagroup, err = syscall.GetProcAddress(dllHandle, "lib3mf_keystore_removeresourcedatagroup") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_keystore_removeresourcedatagroup: " + err.Error()) } - + implementation.Lib3MF_keystore_findresourcedatagroup, err = syscall.GetProcAddress(dllHandle, "lib3mf_keystore_findresourcedatagroup") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_keystore_findresourcedatagroup: " + err.Error()) } - + implementation.Lib3MF_keystore_addresourcedata, err = syscall.GetProcAddress(dllHandle, "lib3mf_keystore_addresourcedata") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_keystore_addresourcedata: " + err.Error()) } - + implementation.Lib3MF_keystore_removeresourcedata, err = syscall.GetProcAddress(dllHandle, "lib3mf_keystore_removeresourcedata") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_keystore_removeresourcedata: " + err.Error()) } - + implementation.Lib3MF_keystore_findresourcedata, err = syscall.GetProcAddress(dllHandle, "lib3mf_keystore_findresourcedata") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_keystore_findresourcedata: " + err.Error()) } - + implementation.Lib3MF_keystore_getresourcedatacount, err = syscall.GetProcAddress(dllHandle, "lib3mf_keystore_getresourcedatacount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_keystore_getresourcedatacount: " + err.Error()) } - + implementation.Lib3MF_keystore_getresourcedata, err = syscall.GetProcAddress(dllHandle, "lib3mf_keystore_getresourcedata") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_keystore_getresourcedata: " + err.Error()) } - + implementation.Lib3MF_keystore_getuuid, err = syscall.GetProcAddress(dllHandle, "lib3mf_keystore_getuuid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_keystore_getuuid: " + err.Error()) } - + implementation.Lib3MF_keystore_setuuid, err = syscall.GetProcAddress(dllHandle, "lib3mf_keystore_setuuid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_keystore_setuuid: " + err.Error()) } - + implementation.Lib3MF_model_rootmodelpart, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_rootmodelpart") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_rootmodelpart: " + err.Error()) } - + implementation.Lib3MF_model_findorcreatepackagepart, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_findorcreatepackagepart") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_findorcreatepackagepart: " + err.Error()) } - + implementation.Lib3MF_model_setunit, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_setunit") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_setunit: " + err.Error()) } - + implementation.Lib3MF_model_getunit, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getunit") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getunit: " + err.Error()) } - + implementation.Lib3MF_model_getlanguage, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getlanguage") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getlanguage: " + err.Error()) } - + implementation.Lib3MF_model_setlanguage, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_setlanguage") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_setlanguage: " + err.Error()) } - + implementation.Lib3MF_model_querywriter, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_querywriter") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_querywriter: " + err.Error()) } - + implementation.Lib3MF_model_queryreader, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_queryreader") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_queryreader: " + err.Error()) } - + implementation.Lib3MF_model_gettexture2dbyid, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_gettexture2dbyid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_gettexture2dbyid: " + err.Error()) } - + implementation.Lib3MF_model_getpropertytypebyid, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getpropertytypebyid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getpropertytypebyid: " + err.Error()) } - + implementation.Lib3MF_model_getbasematerialgroupbyid, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getbasematerialgroupbyid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getbasematerialgroupbyid: " + err.Error()) } - + implementation.Lib3MF_model_gettexture2dgroupbyid, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_gettexture2dgroupbyid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_gettexture2dgroupbyid: " + err.Error()) } - + implementation.Lib3MF_model_getcompositematerialsbyid, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getcompositematerialsbyid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getcompositematerialsbyid: " + err.Error()) } - + implementation.Lib3MF_model_getmultipropertygroupbyid, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getmultipropertygroupbyid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getmultipropertygroupbyid: " + err.Error()) } - + implementation.Lib3MF_model_getmeshobjectbyid, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getmeshobjectbyid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getmeshobjectbyid: " + err.Error()) } - + implementation.Lib3MF_model_getcomponentsobjectbyid, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getcomponentsobjectbyid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getcomponentsobjectbyid: " + err.Error()) } - + implementation.Lib3MF_model_getcolorgroupbyid, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getcolorgroupbyid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getcolorgroupbyid: " + err.Error()) } - + implementation.Lib3MF_model_getslicestackbyid, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getslicestackbyid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getslicestackbyid: " + err.Error()) } - + implementation.Lib3MF_model_getbuilduuid, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getbuilduuid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getbuilduuid: " + err.Error()) } - + implementation.Lib3MF_model_setbuilduuid, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_setbuilduuid") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_setbuilduuid: " + err.Error()) } - + implementation.Lib3MF_model_getbuilditems, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getbuilditems") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getbuilditems: " + err.Error()) } - + implementation.Lib3MF_model_getoutbox, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getoutbox") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getoutbox: " + err.Error()) } - + implementation.Lib3MF_model_getresources, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getresources") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getresources: " + err.Error()) } - + implementation.Lib3MF_model_getobjects, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getobjects") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getobjects: " + err.Error()) } - + implementation.Lib3MF_model_getmeshobjects, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getmeshobjects") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getmeshobjects: " + err.Error()) } - + implementation.Lib3MF_model_getcomponentsobjects, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getcomponentsobjects") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getcomponentsobjects: " + err.Error()) } - + implementation.Lib3MF_model_gettexture2ds, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_gettexture2ds") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_gettexture2ds: " + err.Error()) } - + implementation.Lib3MF_model_getbasematerialgroups, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getbasematerialgroups") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getbasematerialgroups: " + err.Error()) } - + implementation.Lib3MF_model_getcolorgroups, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getcolorgroups") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getcolorgroups: " + err.Error()) } - + implementation.Lib3MF_model_gettexture2dgroups, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_gettexture2dgroups") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_gettexture2dgroups: " + err.Error()) } - + implementation.Lib3MF_model_getcompositematerials, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getcompositematerials") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getcompositematerials: " + err.Error()) } - + implementation.Lib3MF_model_getmultipropertygroups, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getmultipropertygroups") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getmultipropertygroups: " + err.Error()) } - + + implementation.Lib3MF_model_gettoolpaths, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_gettoolpaths") + if (err != nil) { + return errors.New("Could not get function lib3mf_model_gettoolpaths: " + err.Error()) + } + implementation.Lib3MF_model_getslicestacks, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getslicestacks") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getslicestacks: " + err.Error()) } - + implementation.Lib3MF_model_mergetomodel, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_mergetomodel") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_mergetomodel: " + err.Error()) } - + implementation.Lib3MF_model_addmeshobject, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_addmeshobject") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_addmeshobject: " + err.Error()) } - + implementation.Lib3MF_model_addcomponentsobject, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_addcomponentsobject") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_addcomponentsobject: " + err.Error()) } - + implementation.Lib3MF_model_addslicestack, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_addslicestack") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_addslicestack: " + err.Error()) } - + implementation.Lib3MF_model_addtexture2dfromattachment, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_addtexture2dfromattachment") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_addtexture2dfromattachment: " + err.Error()) } - + implementation.Lib3MF_model_addbasematerialgroup, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_addbasematerialgroup") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_addbasematerialgroup: " + err.Error()) } - + implementation.Lib3MF_model_addcolorgroup, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_addcolorgroup") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_addcolorgroup: " + err.Error()) } - + implementation.Lib3MF_model_addtexture2dgroup, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_addtexture2dgroup") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_addtexture2dgroup: " + err.Error()) } - + implementation.Lib3MF_model_addcompositematerials, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_addcompositematerials") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_addcompositematerials: " + err.Error()) } - + implementation.Lib3MF_model_addmultipropertygroup, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_addmultipropertygroup") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_addmultipropertygroup: " + err.Error()) } - + implementation.Lib3MF_model_addbuilditem, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_addbuilditem") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_addbuilditem: " + err.Error()) } - + implementation.Lib3MF_model_removebuilditem, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_removebuilditem") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_removebuilditem: " + err.Error()) } - + + implementation.Lib3MF_model_addtoolpath, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_addtoolpath") + if (err != nil) { + return errors.New("Could not get function lib3mf_model_addtoolpath: " + err.Error()) + } + implementation.Lib3MF_model_getmetadatagroup, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getmetadatagroup") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getmetadatagroup: " + err.Error()) } - + implementation.Lib3MF_model_addattachment, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_addattachment") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_addattachment: " + err.Error()) } - + implementation.Lib3MF_model_removeattachment, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_removeattachment") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_removeattachment: " + err.Error()) } - + implementation.Lib3MF_model_getattachment, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getattachment") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getattachment: " + err.Error()) } - + implementation.Lib3MF_model_findattachment, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_findattachment") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_findattachment: " + err.Error()) } - + implementation.Lib3MF_model_getattachmentcount, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getattachmentcount") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getattachmentcount: " + err.Error()) } - + implementation.Lib3MF_model_haspackagethumbnailattachment, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_haspackagethumbnailattachment") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_haspackagethumbnailattachment: " + err.Error()) } - + implementation.Lib3MF_model_createpackagethumbnailattachment, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_createpackagethumbnailattachment") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_createpackagethumbnailattachment: " + err.Error()) } - + implementation.Lib3MF_model_getpackagethumbnailattachment, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getpackagethumbnailattachment") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getpackagethumbnailattachment: " + err.Error()) } - + implementation.Lib3MF_model_removepackagethumbnailattachment, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_removepackagethumbnailattachment") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_removepackagethumbnailattachment: " + err.Error()) } - + implementation.Lib3MF_model_addcustomcontenttype, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_addcustomcontenttype") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_addcustomcontenttype: " + err.Error()) } - + implementation.Lib3MF_model_removecustomcontenttype, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_removecustomcontenttype") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_removecustomcontenttype: " + err.Error()) } - + implementation.Lib3MF_model_setrandomnumbercallback, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_setrandomnumbercallback") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_setrandomnumbercallback: " + err.Error()) } - + implementation.Lib3MF_model_getkeystore, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_getkeystore") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_model_getkeystore: " + err.Error()) } - + + implementation.Lib3MF_model_createpersistentsourcefromfile, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_createpersistentsourcefromfile") + if (err != nil) { + return errors.New("Could not get function lib3mf_model_createpersistentsourcefromfile: " + err.Error()) + } + + implementation.Lib3MF_model_createpersistentsourcefrombuffer, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_createpersistentsourcefrombuffer") + if (err != nil) { + return errors.New("Could not get function lib3mf_model_createpersistentsourcefrombuffer: " + err.Error()) + } + + implementation.Lib3MF_model_createpersistentsourcefromcallback, err = syscall.GetProcAddress(dllHandle, "lib3mf_model_createpersistentsourcefromcallback") + if (err != nil) { + return errors.New("Could not get function lib3mf_model_createpersistentsourcefromcallback: " + err.Error()) + } + implementation.Lib3MF_getlibraryversion, err = syscall.GetProcAddress(dllHandle, "lib3mf_getlibraryversion") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_getlibraryversion: " + err.Error()) } - + implementation.Lib3MF_getprereleaseinformation, err = syscall.GetProcAddress(dllHandle, "lib3mf_getprereleaseinformation") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_getprereleaseinformation: " + err.Error()) } - + implementation.Lib3MF_getbuildinformation, err = syscall.GetProcAddress(dllHandle, "lib3mf_getbuildinformation") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_getbuildinformation: " + err.Error()) } - + implementation.Lib3MF_getspecificationversion, err = syscall.GetProcAddress(dllHandle, "lib3mf_getspecificationversion") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_getspecificationversion: " + err.Error()) } - + implementation.Lib3MF_createmodel, err = syscall.GetProcAddress(dllHandle, "lib3mf_createmodel") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_createmodel: " + err.Error()) } - + implementation.Lib3MF_release, err = syscall.GetProcAddress(dllHandle, "lib3mf_release") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_release: " + err.Error()) } - + implementation.Lib3MF_acquire, err = syscall.GetProcAddress(dllHandle, "lib3mf_acquire") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_acquire: " + err.Error()) } - + implementation.Lib3MF_setjournal, err = syscall.GetProcAddress(dllHandle, "lib3mf_setjournal") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_setjournal: " + err.Error()) } - + implementation.Lib3MF_getlasterror, err = syscall.GetProcAddress(dllHandle, "lib3mf_getlasterror") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_getlasterror: " + err.Error()) } - + implementation.Lib3MF_getsymbollookupmethod, err = syscall.GetProcAddress(dllHandle, "lib3mf_getsymbollookupmethod") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_getsymbollookupmethod: " + err.Error()) } - + implementation.Lib3MF_retrieveprogressmessage, err = syscall.GetProcAddress(dllHandle, "lib3mf_retrieveprogressmessage") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_retrieveprogressmessage: " + err.Error()) } - + implementation.Lib3MF_rgbatocolor, err = syscall.GetProcAddress(dllHandle, "lib3mf_rgbatocolor") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_rgbatocolor: " + err.Error()) } - + implementation.Lib3MF_floatrgbatocolor, err = syscall.GetProcAddress(dllHandle, "lib3mf_floatrgbatocolor") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_floatrgbatocolor: " + err.Error()) } - + implementation.Lib3MF_colortorgba, err = syscall.GetProcAddress(dllHandle, "lib3mf_colortorgba") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_colortorgba: " + err.Error()) } - + implementation.Lib3MF_colortofloatrgba, err = syscall.GetProcAddress(dllHandle, "lib3mf_colortofloatrgba") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_colortofloatrgba: " + err.Error()) } - + implementation.Lib3MF_getidentitytransform, err = syscall.GetProcAddress(dllHandle, "lib3mf_getidentitytransform") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_getidentitytransform: " + err.Error()) } - + implementation.Lib3MF_getuniformscaletransform, err = syscall.GetProcAddress(dllHandle, "lib3mf_getuniformscaletransform") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_getuniformscaletransform: " + err.Error()) } - + implementation.Lib3MF_getscaletransform, err = syscall.GetProcAddress(dllHandle, "lib3mf_getscaletransform") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_getscaletransform: " + err.Error()) } - + implementation.Lib3MF_gettranslationtransform, err = syscall.GetProcAddress(dllHandle, "lib3mf_gettranslationtransform") - if err != nil { + if (err != nil) { return errors.New("Could not get function lib3mf_gettranslationtransform: " + err.Error()) } - - implementation.DLLHandle = dllHandle + + implementation.DLLHandle = dllHandle implementation.Initialized = true return nil } -func (implementation *Lib3MFImplementation) NewHandle() Lib3MFImplementationHandle { - handle := new(Lib3MFImplementationHandleStruct) +func (implementation *Lib3MFImplementation) NewHandle() (Lib3MFImplementationHandle) { + handle := new (Lib3MFImplementationHandleStruct) handle.Implementation = implementation handle.DLLhandle = 0 return handle } -func (implementation *Lib3MFImplementation) CallFunction(funcptr uintptr, parameters ...uintptr) error { - var ret uintptr - if !implementation.Initialized { +func (implementation *Lib3MFImplementation) CallFunction(funcptr uintptr, parameters ... uintptr) (error) { + var ret uintptr; + if (!implementation.Initialized) { return errors.New("Lib3MF Implementation has not been initialized!") } - - switch len(parameters) { - case 0: - ret, _, _ = syscall.Syscall(funcptr, 0, 0, 0, 0) - case 1: - ret, _, _ = syscall.Syscall(funcptr, 1, uintptr(parameters[0]), 0, 0) - case 2: - ret, _, _ = syscall.Syscall(funcptr, 2, uintptr(parameters[0]), uintptr(parameters[1]), 0) - case 3: - ret, _, _ = syscall.Syscall(funcptr, 3, uintptr(parameters[0]), uintptr(parameters[1]), uintptr(parameters[2])) - case 4: - ret, _, _ = syscall.Syscall6(funcptr, 4, uintptr(parameters[0]), uintptr(parameters[1]), uintptr(parameters[2]), uintptr(parameters[3]), 0, 0) - case 5: - ret, _, _ = syscall.Syscall6(funcptr, 5, uintptr(parameters[0]), uintptr(parameters[1]), uintptr(parameters[2]), uintptr(parameters[3]), uintptr(parameters[4]), 0) - case 6: - ret, _, _ = syscall.Syscall6(funcptr, 6, uintptr(parameters[0]), uintptr(parameters[1]), uintptr(parameters[2]), uintptr(parameters[3]), uintptr(parameters[4]), uintptr(parameters[5])) - case 7: - ret, _, _ = syscall.Syscall9(funcptr, 7, uintptr(parameters[0]), uintptr(parameters[1]), uintptr(parameters[2]), uintptr(parameters[3]), uintptr(parameters[4]), uintptr(parameters[5]), uintptr(parameters[6]), 0, 0) - case 8: - ret, _, _ = syscall.Syscall9(funcptr, 8, uintptr(parameters[0]), uintptr(parameters[1]), uintptr(parameters[2]), uintptr(parameters[3]), uintptr(parameters[4]), uintptr(parameters[5]), uintptr(parameters[6]), uintptr(parameters[7]), 0) - case 9: - ret, _, _ = syscall.Syscall9(funcptr, 9, uintptr(parameters[0]), uintptr(parameters[1]), uintptr(parameters[2]), uintptr(parameters[3]), uintptr(parameters[4]), uintptr(parameters[5]), uintptr(parameters[6]), uintptr(parameters[7]), uintptr(parameters[8])) - case 10: - ret, _, _ = syscall.Syscall12(funcptr, 10, uintptr(parameters[0]), uintptr(parameters[1]), uintptr(parameters[2]), uintptr(parameters[3]), uintptr(parameters[4]), uintptr(parameters[5]), uintptr(parameters[6]), uintptr(parameters[7]), uintptr(parameters[8]), uintptr(parameters[9]), 0, 0) - case 11: - ret, _, _ = syscall.Syscall12(funcptr, 11, uintptr(parameters[0]), uintptr(parameters[1]), uintptr(parameters[2]), uintptr(parameters[3]), uintptr(parameters[4]), uintptr(parameters[5]), uintptr(parameters[6]), uintptr(parameters[7]), uintptr(parameters[8]), uintptr(parameters[9]), uintptr(parameters[10]), 0) - case 12: - ret, _, _ = syscall.Syscall12(funcptr, 12, uintptr(parameters[0]), uintptr(parameters[1]), uintptr(parameters[2]), uintptr(parameters[3]), uintptr(parameters[4]), uintptr(parameters[5]), uintptr(parameters[6]), uintptr(parameters[7]), uintptr(parameters[8]), uintptr(parameters[9]), uintptr(parameters[10]), uintptr(parameters[11])) - default: - return errors.New("Invalid DLL function parameter count!") - } - - if int(ret) != 0 { + + switch len(parameters) { + case 0: ret, _, _ = syscall.Syscall(funcptr, 0, 0, 0, 0) + case 1: ret, _, _ = syscall.Syscall(funcptr, 1, uintptr(parameters[0]), 0, 0) + case 2: ret, _, _ = syscall.Syscall(funcptr, 2, uintptr(parameters[0]), uintptr(parameters[1]), 0) + case 3: ret, _, _ = syscall.Syscall(funcptr, 3, uintptr(parameters[0]), uintptr(parameters[1]), uintptr(parameters[2])) + case 4: ret, _, _ = syscall.Syscall6(funcptr, 4, uintptr(parameters[0]), uintptr(parameters[1]), uintptr(parameters[2]), uintptr(parameters[3]), 0, 0) + case 5: ret, _, _ = syscall.Syscall6(funcptr, 5, uintptr(parameters[0]), uintptr(parameters[1]), uintptr(parameters[2]), uintptr(parameters[3]), uintptr(parameters[4]), 0) + case 6: ret, _, _ = syscall.Syscall6(funcptr, 6, uintptr(parameters[0]), uintptr(parameters[1]), uintptr(parameters[2]), uintptr(parameters[3]), uintptr(parameters[4]), uintptr(parameters[5])) + case 7: ret, _, _ = syscall.Syscall9(funcptr, 7, uintptr(parameters[0]), uintptr(parameters[1]), uintptr(parameters[2]), uintptr(parameters[3]), uintptr(parameters[4]), uintptr(parameters[5]), uintptr(parameters[6]), 0, 0) + case 8: ret, _, _ = syscall.Syscall9(funcptr, 8, uintptr(parameters[0]), uintptr(parameters[1]), uintptr(parameters[2]), uintptr(parameters[3]), uintptr(parameters[4]), uintptr(parameters[5]), uintptr(parameters[6]), uintptr(parameters[7]), 0) + case 9: ret, _, _ = syscall.Syscall9(funcptr, 9, uintptr(parameters[0]), uintptr(parameters[1]), uintptr(parameters[2]), uintptr(parameters[3]), uintptr(parameters[4]), uintptr(parameters[5]), uintptr(parameters[6]), uintptr(parameters[7]), uintptr(parameters[8])) + case 10: ret, _, _ = syscall.Syscall12(funcptr, 10, uintptr(parameters[0]), uintptr(parameters[1]), uintptr(parameters[2]), uintptr(parameters[3]), uintptr(parameters[4]), uintptr(parameters[5]), uintptr(parameters[6]), uintptr(parameters[7]), uintptr(parameters[8]), uintptr(parameters[9]), 0, 0) + case 11: ret, _, _ = syscall.Syscall12(funcptr, 11, uintptr(parameters[0]), uintptr(parameters[1]), uintptr(parameters[2]), uintptr(parameters[3]), uintptr(parameters[4]), uintptr(parameters[5]), uintptr(parameters[6]), uintptr(parameters[7]), uintptr(parameters[8]), uintptr(parameters[9]), uintptr(parameters[10]), 0) + case 12: ret, _, _ = syscall.Syscall12(funcptr, 12, uintptr(parameters[0]), uintptr(parameters[1]), uintptr(parameters[2]), uintptr(parameters[3]), uintptr(parameters[4]), uintptr(parameters[5]), uintptr(parameters[6]), uintptr(parameters[7]), uintptr(parameters[8]), uintptr(parameters[9]), uintptr(parameters[10]), uintptr(parameters[11])) + default: + return errors.New("Invalid DLL function parameter count!"); + } + + if (int(ret) != 0) { return errors.New(fmt.Sprintf("Lib3MF Error: %.04x (%s)", int(ret), GetLib3MFErrorMessage(uint32(ret)))) } - + return nil } -func (implementation *Lib3MFImplementation) Writer_WriteToFile(Writer Lib3MFHandle, sFilename string) error { - var err error = nil +func (implementation *Lib3MFImplementation) Writer_WriteToFile(Writer Lib3MFHandle, sFilename string) (error) { + var err error = nil + implementation_writer, err := implementation.GetWrapperHandle(Writer) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_writer_writetofile, implementation_writer.GetDLLInHandle(), StringInValue(sFilename)) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Writer_GetStreamSize(Writer Lib3MFHandle) (uint64, error) { var err error = nil var nStreamSize uint64 = 0 - + implementation_writer, err := implementation.GetWrapperHandle(Writer) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_writer_getstreamsize, implementation_writer.GetDLLInHandle(), UInt64OutValue(&nStreamSize)) - if err != nil { + if (err != nil) { return 0, err } - + return uint64(nStreamSize), err } @@ -2516,125 +2734,126 @@ func (implementation *Lib3MFImplementation) Writer_WriteToBuffer(Writer Lib3MFHa var neededforBuffer int64 = 0 var filledinBuffer int64 = 0 bufferBuffer := make([]uint8, 0) - + implementation_writer, err := implementation.GetWrapperHandle(Writer) - if err != nil { + if (err != nil) { return make([]uint8, 0), err } err = implementation.CallFunction(implementation.Lib3MF_writer_writetobuffer, implementation_writer.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforBuffer), Int64InValue(0)) - if err != nil { + if (err != nil) { return make([]uint8, 0), err } bufferSizeBuffer := neededforBuffer bufferBuffer = make([]uint8, bufferSizeBuffer) err = implementation.CallFunction(implementation.Lib3MF_writer_writetobuffer, implementation_writer.GetDLLInHandle(), Int64InValue(bufferSizeBuffer), Int64OutValue(&filledinBuffer), uintptr(unsafe.Pointer(&bufferBuffer[0]))) - if err != nil { + if (err != nil) { return make([]uint8, 0), err } - + return bufferBuffer, err } -func (implementation *Lib3MFImplementation) Writer_WriteToCallback(Writer Lib3MFHandle, pTheWriteCallback int64, pTheSeekCallback int64, nUserData uint64) error { +func (implementation *Lib3MFImplementation) Writer_WriteToCallback(Writer Lib3MFHandle, pTheWriteCallback int64, pTheSeekCallback int64, nUserData uint64) (error) { var err error = nil - + implementation_writer, err := implementation.GetWrapperHandle(Writer) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_writer_writetocallback, implementation_writer.GetDLLInHandle(), 0, 0, UInt64InValue(nUserData)) - if err != nil { + if (err != nil) { return err } - + return err } -func (implementation *Lib3MFImplementation) Writer_SetProgressCallback(Writer Lib3MFHandle, pProgressCallback int64, nUserData uint64) error { +func (implementation *Lib3MFImplementation) Writer_SetProgressCallback(Writer Lib3MFHandle, pProgressCallback int64, nUserData uint64) (error) { var err error = nil - + implementation_writer, err := implementation.GetWrapperHandle(Writer) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_writer_setprogresscallback, implementation_writer.GetDLLInHandle(), 0, UInt64InValue(nUserData)) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Writer_GetDecimalPrecision(Writer Lib3MFHandle) (uint32, error) { var err error = nil var nDecimalPrecision uint32 = 0 - + implementation_writer, err := implementation.GetWrapperHandle(Writer) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_writer_getdecimalprecision, implementation_writer.GetDLLInHandle(), UInt32OutValue(&nDecimalPrecision)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nDecimalPrecision), err } -func (implementation *Lib3MFImplementation) Writer_SetDecimalPrecision(Writer Lib3MFHandle, nDecimalPrecision uint32) error { +func (implementation *Lib3MFImplementation) Writer_SetDecimalPrecision(Writer Lib3MFHandle, nDecimalPrecision uint32) (error) { var err error = nil - + implementation_writer, err := implementation.GetWrapperHandle(Writer) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_writer_setdecimalprecision, implementation_writer.GetDLLInHandle(), UInt32InValue(nDecimalPrecision)) - if err != nil { + if (err != nil) { return err } - + return err } -func (implementation *Lib3MFImplementation) Writer_SetStrictModeActive(Writer Lib3MFHandle, bStrictModeActive bool) error { +func (implementation *Lib3MFImplementation) Writer_SetStrictModeActive(Writer Lib3MFHandle, bStrictModeActive bool) (error) { var err error = nil var nStrictModeActive uint8 = 0 - if bStrictModeActive { + if (bStrictModeActive) { nStrictModeActive = 1 } - + + implementation_writer, err := implementation.GetWrapperHandle(Writer) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_writer_setstrictmodeactive, implementation_writer.GetDLLInHandle(), UInt8InValue(nStrictModeActive)) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Writer_GetStrictModeActive(Writer Lib3MFHandle) (bool, error) { var err error = nil var bStrictModeActive int64 = 0 - + implementation_writer, err := implementation.GetWrapperHandle(Writer) - if err != nil { + if (err != nil) { return false, err } err = implementation.CallFunction(implementation.Lib3MF_writer_getstrictmodeactive, implementation_writer.GetDLLInHandle(), Int64OutValue(&bStrictModeActive)) - if err != nil { + if (err != nil) { return false, err } - + return (bStrictModeActive != 0), err } @@ -2643,205 +2862,282 @@ func (implementation *Lib3MFImplementation) Writer_GetWarning(Writer Lib3MFHandl var nErrorCode uint32 = 0 var neededforWarning int64 = 0 var filledinWarning int64 = 0 - + implementation_writer, err := implementation.GetWrapperHandle(Writer) - if err != nil { + if (err != nil) { return 0, "", err } err = implementation.CallFunction(implementation.Lib3MF_writer_getwarning, implementation_writer.GetDLLInHandle(), UInt32InValue(nIndex), UInt32OutValue(&nErrorCode), Int64InValue(0), Int64OutValue(&neededforWarning), Int64InValue(0)) - if err != nil { + if (err != nil) { return 0, "", err } bufferSizeWarning := neededforWarning bufferWarning := make([]byte, bufferSizeWarning) err = implementation.CallFunction(implementation.Lib3MF_writer_getwarning, implementation_writer.GetDLLInHandle(), UInt32InValue(nIndex), UInt32OutValue(&nErrorCode), Int64InValue(bufferSizeWarning), Int64OutValue(&filledinWarning), uintptr(unsafe.Pointer(&bufferWarning[0]))) - if err != nil { + if (err != nil) { return 0, "", err } - - return uint32(nErrorCode), string(bufferWarning[:(filledinWarning - 1)]), err + + return uint32(nErrorCode), string(bufferWarning[:(filledinWarning-1)]), err } func (implementation *Lib3MFImplementation) Writer_GetWarningCount(Writer Lib3MFHandle) (uint32, error) { var err error = nil var nCount uint32 = 0 - + implementation_writer, err := implementation.GetWrapperHandle(Writer) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_writer_getwarningcount, implementation_writer.GetDLLInHandle(), UInt32OutValue(&nCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nCount), err } -func (implementation *Lib3MFImplementation) Writer_AddKeyWrappingCallback(Writer Lib3MFHandle, sConsumerID string, pTheCallback int64, nUserData uint64) error { +func (implementation *Lib3MFImplementation) Writer_AddKeyWrappingCallback(Writer Lib3MFHandle, sConsumerID string, pTheCallback int64, nUserData uint64) (error) { var err error = nil - + implementation_writer, err := implementation.GetWrapperHandle(Writer) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_writer_addkeywrappingcallback, implementation_writer.GetDLLInHandle(), StringInValue(sConsumerID), 0, UInt64InValue(nUserData)) - if err != nil { + if (err != nil) { return err } - + return err } -func (implementation *Lib3MFImplementation) Writer_SetContentEncryptionCallback(Writer Lib3MFHandle, pTheCallback int64, nUserData uint64) error { +func (implementation *Lib3MFImplementation) Writer_SetContentEncryptionCallback(Writer Lib3MFHandle, pTheCallback int64, nUserData uint64) (error) { var err error = nil - + implementation_writer, err := implementation.GetWrapperHandle(Writer) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_writer_setcontentencryptioncallback, implementation_writer.GetDLLInHandle(), 0, UInt64InValue(nUserData)) - if err != nil { + if (err != nil) { + return err + } + + return err +} + +func (implementation *Lib3MFImplementation) PersistentReaderSource_GetSourceType(PersistentReaderSource Lib3MFHandle) (ELib3MFPersistentReaderSourceType, error) { + var err error = nil + var eSourceType uint64 = 0 + + implementation_persistentreadersource, err := implementation.GetWrapperHandle(PersistentReaderSource) + if (err != nil) { + return 0, err + } + + err = implementation.CallFunction(implementation.Lib3MF_persistentreadersource_getsourcetype, implementation_persistentreadersource.GetDLLInHandle(), UInt64OutValue(&eSourceType)) + if (err != nil) { + return 0, err + } + + return ELib3MFPersistentReaderSourceType (eSourceType), err +} + +func (implementation *Lib3MFImplementation) PersistentReaderSource_InvalidateSourceData(PersistentReaderSource Lib3MFHandle) (error) { + var err error = nil + + implementation_persistentreadersource, err := implementation.GetWrapperHandle(PersistentReaderSource) + if (err != nil) { return err } + err = implementation.CallFunction(implementation.Lib3MF_persistentreadersource_invalidatesourcedata, implementation_persistentreadersource.GetDLLInHandle()) + if (err != nil) { + return err + } + return err } -func (implementation *Lib3MFImplementation) Reader_ReadFromFile(Reader Lib3MFHandle, sFilename string) error { +func (implementation *Lib3MFImplementation) PersistentReaderSource_SourceDataIsValid(PersistentReaderSource Lib3MFHandle) (bool, error) { var err error = nil + var bDataIsValid int64 = 0 + + implementation_persistentreadersource, err := implementation.GetWrapperHandle(PersistentReaderSource) + if (err != nil) { + return false, err + } + + err = implementation.CallFunction(implementation.Lib3MF_persistentreadersource_sourcedataisvalid, implementation_persistentreadersource.GetDLLInHandle(), Int64OutValue(&bDataIsValid)) + if (err != nil) { + return false, err + } + + return (bDataIsValid != 0), err +} +func (implementation *Lib3MFImplementation) Reader_ReadFromPersistentSource(Reader Lib3MFHandle, Source Lib3MFHandle) (error) { + var err error = nil + implementation_reader, err := implementation.GetWrapperHandle(Reader) - if err != nil { + if (err != nil) { return err } - - err = implementation.CallFunction(implementation.Lib3MF_reader_readfromfile, implementation_reader.GetDLLInHandle(), StringInValue(sFilename)) - if err != nil { + implementation_source, err := implementation.GetWrapperHandle(Source) + if (err != nil) { + return err + } + + SourceDLLHandle := implementation_source.GetDLLInHandle() + if (SourceDLLHandle == 0) { + err := fmt.Errorf("Handle must not be 0.") return err } + err = implementation.CallFunction(implementation.Lib3MF_reader_readfrompersistentsource, implementation_reader.GetDLLInHandle(), SourceDLLHandle) + if (err != nil) { + return err + } + return err } -func (implementation *Lib3MFImplementation) Reader_ReadFromBuffer(Reader Lib3MFHandle, Buffer []uint8) error { +func (implementation *Lib3MFImplementation) Reader_ReadFromFile(Reader Lib3MFHandle, sFilename string) (error) { var err error = nil + + implementation_reader, err := implementation.GetWrapperHandle(Reader) + if (err != nil) { + return err + } + + err = implementation.CallFunction(implementation.Lib3MF_reader_readfromfile, implementation_reader.GetDLLInHandle(), StringInValue(sFilename)) + if (err != nil) { + return err + } + + return err +} +func (implementation *Lib3MFImplementation) Reader_ReadFromBuffer(Reader Lib3MFHandle, Buffer []uint8) (error) { + var err error = nil + implementation_reader, err := implementation.GetWrapperHandle(Reader) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_reader_readfrombuffer, implementation_reader.GetDLLInHandle(), 0, 0) - if err != nil { + if (err != nil) { return err } - + return err } -func (implementation *Lib3MFImplementation) Reader_ReadFromCallback(Reader Lib3MFHandle, pTheReadCallback int64, nStreamSize uint64, pTheSeekCallback int64, nUserData uint64) error { +func (implementation *Lib3MFImplementation) Reader_ReadFromCallback(Reader Lib3MFHandle, pTheReadCallback int64, nStreamSize uint64, pTheSeekCallback int64, nUserData uint64) (error) { var err error = nil - + implementation_reader, err := implementation.GetWrapperHandle(Reader) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_reader_readfromcallback, implementation_reader.GetDLLInHandle(), 0, UInt64InValue(nStreamSize), 0, UInt64InValue(nUserData)) - if err != nil { + if (err != nil) { return err } - + return err } -func (implementation *Lib3MFImplementation) Reader_SetProgressCallback(Reader Lib3MFHandle, pProgressCallback int64, nUserData uint64) error { +func (implementation *Lib3MFImplementation) Reader_SetProgressCallback(Reader Lib3MFHandle, pProgressCallback int64, nUserData uint64) (error) { var err error = nil - + implementation_reader, err := implementation.GetWrapperHandle(Reader) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_reader_setprogresscallback, implementation_reader.GetDLLInHandle(), 0, UInt64InValue(nUserData)) - if err != nil { + if (err != nil) { return err } - + return err } -func (implementation *Lib3MFImplementation) Reader_AddRelationToRead(Reader Lib3MFHandle, sRelationShipType string) error { +func (implementation *Lib3MFImplementation) Reader_AddRelationToRead(Reader Lib3MFHandle, sRelationShipType string) (error) { var err error = nil - + implementation_reader, err := implementation.GetWrapperHandle(Reader) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_reader_addrelationtoread, implementation_reader.GetDLLInHandle(), StringInValue(sRelationShipType)) - if err != nil { + if (err != nil) { return err } - + return err } -func (implementation *Lib3MFImplementation) Reader_RemoveRelationToRead(Reader Lib3MFHandle, sRelationShipType string) error { +func (implementation *Lib3MFImplementation) Reader_RemoveRelationToRead(Reader Lib3MFHandle, sRelationShipType string) (error) { var err error = nil - + implementation_reader, err := implementation.GetWrapperHandle(Reader) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_reader_removerelationtoread, implementation_reader.GetDLLInHandle(), StringInValue(sRelationShipType)) - if err != nil { + if (err != nil) { return err } - + return err } -func (implementation *Lib3MFImplementation) Reader_SetStrictModeActive(Reader Lib3MFHandle, bStrictModeActive bool) error { +func (implementation *Lib3MFImplementation) Reader_SetStrictModeActive(Reader Lib3MFHandle, bStrictModeActive bool) (error) { var err error = nil var nStrictModeActive uint8 = 0 - if bStrictModeActive { + if (bStrictModeActive) { nStrictModeActive = 1 } - + + implementation_reader, err := implementation.GetWrapperHandle(Reader) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_reader_setstrictmodeactive, implementation_reader.GetDLLInHandle(), UInt8InValue(nStrictModeActive)) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Reader_GetStrictModeActive(Reader Lib3MFHandle) (bool, error) { var err error = nil var bStrictModeActive int64 = 0 - + implementation_reader, err := implementation.GetWrapperHandle(Reader) - if err != nil { + if (err != nil) { return false, err } err = implementation.CallFunction(implementation.Lib3MF_reader_getstrictmodeactive, implementation_reader.GetDLLInHandle(), Int64OutValue(&bStrictModeActive)) - if err != nil { + if (err != nil) { return false, err } - + return (bStrictModeActive != 0), err } @@ -2850,72 +3146,72 @@ func (implementation *Lib3MFImplementation) Reader_GetWarning(Reader Lib3MFHandl var nErrorCode uint32 = 0 var neededforWarning int64 = 0 var filledinWarning int64 = 0 - + implementation_reader, err := implementation.GetWrapperHandle(Reader) - if err != nil { + if (err != nil) { return 0, "", err } err = implementation.CallFunction(implementation.Lib3MF_reader_getwarning, implementation_reader.GetDLLInHandle(), UInt32InValue(nIndex), UInt32OutValue(&nErrorCode), Int64InValue(0), Int64OutValue(&neededforWarning), Int64InValue(0)) - if err != nil { + if (err != nil) { return 0, "", err } bufferSizeWarning := neededforWarning bufferWarning := make([]byte, bufferSizeWarning) err = implementation.CallFunction(implementation.Lib3MF_reader_getwarning, implementation_reader.GetDLLInHandle(), UInt32InValue(nIndex), UInt32OutValue(&nErrorCode), Int64InValue(bufferSizeWarning), Int64OutValue(&filledinWarning), uintptr(unsafe.Pointer(&bufferWarning[0]))) - if err != nil { + if (err != nil) { return 0, "", err } - - return uint32(nErrorCode), string(bufferWarning[:(filledinWarning - 1)]), err + + return uint32(nErrorCode), string(bufferWarning[:(filledinWarning-1)]), err } func (implementation *Lib3MFImplementation) Reader_GetWarningCount(Reader Lib3MFHandle) (uint32, error) { var err error = nil var nCount uint32 = 0 - + implementation_reader, err := implementation.GetWrapperHandle(Reader) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_reader_getwarningcount, implementation_reader.GetDLLInHandle(), UInt32OutValue(&nCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nCount), err } -func (implementation *Lib3MFImplementation) Reader_AddKeyWrappingCallback(Reader Lib3MFHandle, sConsumerID string, pTheCallback int64, nUserData uint64) error { +func (implementation *Lib3MFImplementation) Reader_AddKeyWrappingCallback(Reader Lib3MFHandle, sConsumerID string, pTheCallback int64, nUserData uint64) (error) { var err error = nil - + implementation_reader, err := implementation.GetWrapperHandle(Reader) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_reader_addkeywrappingcallback, implementation_reader.GetDLLInHandle(), StringInValue(sConsumerID), 0, UInt64InValue(nUserData)) - if err != nil { + if (err != nil) { return err } - + return err } -func (implementation *Lib3MFImplementation) Reader_SetContentEncryptionCallback(Reader Lib3MFHandle, pTheCallback int64, nUserData uint64) error { +func (implementation *Lib3MFImplementation) Reader_SetContentEncryptionCallback(Reader Lib3MFHandle, pTheCallback int64, nUserData uint64) (error) { var err error = nil - + implementation_reader, err := implementation.GetWrapperHandle(Reader) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_reader_setcontentencryptioncallback, implementation_reader.GetDLLInHandle(), 0, UInt64InValue(nUserData)) - if err != nil { + if (err != nil) { return err } - + return err } @@ -2923,388 +3219,388 @@ func (implementation *Lib3MFImplementation) PackagePart_GetPath(PackagePart Lib3 var err error = nil var neededforPath int64 = 0 var filledinPath int64 = 0 - + implementation_packagepart, err := implementation.GetWrapperHandle(PackagePart) - if err != nil { + if (err != nil) { return "", err } err = implementation.CallFunction(implementation.Lib3MF_packagepart_getpath, implementation_packagepart.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforPath), Int64InValue(0)) - if err != nil { + if (err != nil) { return "", err } bufferSizePath := neededforPath bufferPath := make([]byte, bufferSizePath) err = implementation.CallFunction(implementation.Lib3MF_packagepart_getpath, implementation_packagepart.GetDLLInHandle(), Int64InValue(bufferSizePath), Int64OutValue(&filledinPath), uintptr(unsafe.Pointer(&bufferPath[0]))) - if err != nil { + if (err != nil) { return "", err } - - return string(bufferPath[:(filledinPath - 1)]), err + + return string(bufferPath[:(filledinPath-1)]), err } -func (implementation *Lib3MFImplementation) PackagePart_SetPath(PackagePart Lib3MFHandle, sPath string) error { +func (implementation *Lib3MFImplementation) PackagePart_SetPath(PackagePart Lib3MFHandle, sPath string) (error) { var err error = nil - + implementation_packagepart, err := implementation.GetWrapperHandle(PackagePart) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_packagepart_setpath, implementation_packagepart.GetDLLInHandle(), StringInValue(sPath)) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Resource_GetResourceID(Resource Lib3MFHandle) (uint32, error) { var err error = nil var nUniqueResourceID uint32 = 0 - + implementation_resource, err := implementation.GetWrapperHandle(Resource) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_resource_getresourceid, implementation_resource.GetDLLInHandle(), UInt32OutValue(&nUniqueResourceID)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nUniqueResourceID), err } func (implementation *Lib3MFImplementation) Resource_GetUniqueResourceID(Resource Lib3MFHandle) (uint32, error) { var err error = nil var nUniqueResourceID uint32 = 0 - + implementation_resource, err := implementation.GetWrapperHandle(Resource) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_resource_getuniqueresourceid, implementation_resource.GetDLLInHandle(), UInt32OutValue(&nUniqueResourceID)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nUniqueResourceID), err } func (implementation *Lib3MFImplementation) Resource_PackagePart(Resource Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hPackagePart := implementation.NewHandle() - + implementation_resource, err := implementation.GetWrapperHandle(Resource) - if err != nil { + if (err != nil) { return hPackagePart, err } err = implementation.CallFunction(implementation.Lib3MF_resource_packagepart, implementation_resource.GetDLLInHandle(), hPackagePart.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hPackagePart, err } - + return hPackagePart, err } -func (implementation *Lib3MFImplementation) Resource_SetPackagePart(Resource Lib3MFHandle, PackagePart Lib3MFHandle) error { +func (implementation *Lib3MFImplementation) Resource_SetPackagePart(Resource Lib3MFHandle, PackagePart Lib3MFHandle) (error) { var err error = nil - + implementation_resource, err := implementation.GetWrapperHandle(Resource) - if err != nil { + if (err != nil) { return err } implementation_packagepart, err := implementation.GetWrapperHandle(PackagePart) - if err != nil { + if (err != nil) { return err } - + PackagePartDLLHandle := implementation_packagepart.GetDLLInHandle() - if PackagePartDLLHandle == 0 { + if (PackagePartDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return err } err = implementation.CallFunction(implementation.Lib3MF_resource_setpackagepart, implementation_resource.GetDLLInHandle(), PackagePartDLLHandle) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Resource_GetModelResourceID(Resource Lib3MFHandle) (uint32, error) { var err error = nil var nModelResourceId uint32 = 0 - + implementation_resource, err := implementation.GetWrapperHandle(Resource) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_resource_getmodelresourceid, implementation_resource.GetDLLInHandle(), UInt32OutValue(&nModelResourceId)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nModelResourceId), err } func (implementation *Lib3MFImplementation) ResourceIterator_MoveNext(ResourceIterator Lib3MFHandle) (bool, error) { var err error = nil var bHasNext int64 = 0 - + implementation_resourceiterator, err := implementation.GetWrapperHandle(ResourceIterator) - if err != nil { + if (err != nil) { return false, err } err = implementation.CallFunction(implementation.Lib3MF_resourceiterator_movenext, implementation_resourceiterator.GetDLLInHandle(), Int64OutValue(&bHasNext)) - if err != nil { + if (err != nil) { return false, err } - + return (bHasNext != 0), err } func (implementation *Lib3MFImplementation) ResourceIterator_MovePrevious(ResourceIterator Lib3MFHandle) (bool, error) { var err error = nil var bHasPrevious int64 = 0 - + implementation_resourceiterator, err := implementation.GetWrapperHandle(ResourceIterator) - if err != nil { + if (err != nil) { return false, err } err = implementation.CallFunction(implementation.Lib3MF_resourceiterator_moveprevious, implementation_resourceiterator.GetDLLInHandle(), Int64OutValue(&bHasPrevious)) - if err != nil { + if (err != nil) { return false, err } - + return (bHasPrevious != 0), err } func (implementation *Lib3MFImplementation) ResourceIterator_GetCurrent(ResourceIterator Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hResource := implementation.NewHandle() - + implementation_resourceiterator, err := implementation.GetWrapperHandle(ResourceIterator) - if err != nil { + if (err != nil) { return hResource, err } err = implementation.CallFunction(implementation.Lib3MF_resourceiterator_getcurrent, implementation_resourceiterator.GetDLLInHandle(), hResource.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResource, err } - + return hResource, err } func (implementation *Lib3MFImplementation) ResourceIterator_Clone(ResourceIterator Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hOutResourceIterator := implementation.NewHandle() - + implementation_resourceiterator, err := implementation.GetWrapperHandle(ResourceIterator) - if err != nil { + if (err != nil) { return hOutResourceIterator, err } err = implementation.CallFunction(implementation.Lib3MF_resourceiterator_clone, implementation_resourceiterator.GetDLLInHandle(), hOutResourceIterator.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hOutResourceIterator, err } - + return hOutResourceIterator, err } func (implementation *Lib3MFImplementation) ResourceIterator_Count(ResourceIterator Lib3MFHandle) (uint64, error) { var err error = nil var nCount uint64 = 0 - + implementation_resourceiterator, err := implementation.GetWrapperHandle(ResourceIterator) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_resourceiterator_count, implementation_resourceiterator.GetDLLInHandle(), UInt64OutValue(&nCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint64(nCount), err } func (implementation *Lib3MFImplementation) SliceStackIterator_GetCurrentSliceStack(SliceStackIterator Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hResource := implementation.NewHandle() - + implementation_slicestackiterator, err := implementation.GetWrapperHandle(SliceStackIterator) - if err != nil { + if (err != nil) { return hResource, err } err = implementation.CallFunction(implementation.Lib3MF_slicestackiterator_getcurrentslicestack, implementation_slicestackiterator.GetDLLInHandle(), hResource.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResource, err } - + return hResource, err } func (implementation *Lib3MFImplementation) ObjectIterator_GetCurrentObject(ObjectIterator Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hResource := implementation.NewHandle() - + implementation_objectiterator, err := implementation.GetWrapperHandle(ObjectIterator) - if err != nil { + if (err != nil) { return hResource, err } err = implementation.CallFunction(implementation.Lib3MF_objectiterator_getcurrentobject, implementation_objectiterator.GetDLLInHandle(), hResource.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResource, err } - + return hResource, err } func (implementation *Lib3MFImplementation) MeshObjectIterator_GetCurrentMeshObject(MeshObjectIterator Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hResource := implementation.NewHandle() - + implementation_meshobjectiterator, err := implementation.GetWrapperHandle(MeshObjectIterator) - if err != nil { + if (err != nil) { return hResource, err } err = implementation.CallFunction(implementation.Lib3MF_meshobjectiterator_getcurrentmeshobject, implementation_meshobjectiterator.GetDLLInHandle(), hResource.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResource, err } - + return hResource, err } func (implementation *Lib3MFImplementation) ComponentsObjectIterator_GetCurrentComponentsObject(ComponentsObjectIterator Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hResource := implementation.NewHandle() - + implementation_componentsobjectiterator, err := implementation.GetWrapperHandle(ComponentsObjectIterator) - if err != nil { + if (err != nil) { return hResource, err } err = implementation.CallFunction(implementation.Lib3MF_componentsobjectiterator_getcurrentcomponentsobject, implementation_componentsobjectiterator.GetDLLInHandle(), hResource.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResource, err } - + return hResource, err } func (implementation *Lib3MFImplementation) Texture2DIterator_GetCurrentTexture2D(Texture2DIterator Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hResource := implementation.NewHandle() - + implementation_texture2diterator, err := implementation.GetWrapperHandle(Texture2DIterator) - if err != nil { + if (err != nil) { return hResource, err } err = implementation.CallFunction(implementation.Lib3MF_texture2diterator_getcurrenttexture2d, implementation_texture2diterator.GetDLLInHandle(), hResource.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResource, err } - + return hResource, err } func (implementation *Lib3MFImplementation) BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup(BaseMaterialGroupIterator Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hResource := implementation.NewHandle() - + implementation_basematerialgroupiterator, err := implementation.GetWrapperHandle(BaseMaterialGroupIterator) - if err != nil { + if (err != nil) { return hResource, err } err = implementation.CallFunction(implementation.Lib3MF_basematerialgroupiterator_getcurrentbasematerialgroup, implementation_basematerialgroupiterator.GetDLLInHandle(), hResource.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResource, err } - + return hResource, err } func (implementation *Lib3MFImplementation) ColorGroupIterator_GetCurrentColorGroup(ColorGroupIterator Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hResource := implementation.NewHandle() - + implementation_colorgroupiterator, err := implementation.GetWrapperHandle(ColorGroupIterator) - if err != nil { + if (err != nil) { return hResource, err } err = implementation.CallFunction(implementation.Lib3MF_colorgroupiterator_getcurrentcolorgroup, implementation_colorgroupiterator.GetDLLInHandle(), hResource.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResource, err } - + return hResource, err } func (implementation *Lib3MFImplementation) Texture2DGroupIterator_GetCurrentTexture2DGroup(Texture2DGroupIterator Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hResource := implementation.NewHandle() - + implementation_texture2dgroupiterator, err := implementation.GetWrapperHandle(Texture2DGroupIterator) - if err != nil { + if (err != nil) { return hResource, err } err = implementation.CallFunction(implementation.Lib3MF_texture2dgroupiterator_getcurrenttexture2dgroup, implementation_texture2dgroupiterator.GetDLLInHandle(), hResource.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResource, err } - + return hResource, err } func (implementation *Lib3MFImplementation) CompositeMaterialsIterator_GetCurrentCompositeMaterials(CompositeMaterialsIterator Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hResource := implementation.NewHandle() - + implementation_compositematerialsiterator, err := implementation.GetWrapperHandle(CompositeMaterialsIterator) - if err != nil { + if (err != nil) { return hResource, err } err = implementation.CallFunction(implementation.Lib3MF_compositematerialsiterator_getcurrentcompositematerials, implementation_compositematerialsiterator.GetDLLInHandle(), hResource.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResource, err } - + return hResource, err } func (implementation *Lib3MFImplementation) MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup(MultiPropertyGroupIterator Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hResource := implementation.NewHandle() - + implementation_multipropertygroupiterator, err := implementation.GetWrapperHandle(MultiPropertyGroupIterator) - if err != nil { + if (err != nil) { return hResource, err } err = implementation.CallFunction(implementation.Lib3MF_multipropertygroupiterator_getcurrentmultipropertygroup, implementation_multipropertygroupiterator.GetDLLInHandle(), hResource.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResource, err } - + return hResource, err } @@ -3312,39 +3608,39 @@ func (implementation *Lib3MFImplementation) MetaData_GetNameSpace(MetaData Lib3M var err error = nil var neededforNameSpace int64 = 0 var filledinNameSpace int64 = 0 - + implementation_metadata, err := implementation.GetWrapperHandle(MetaData) - if err != nil { + if (err != nil) { return "", err } err = implementation.CallFunction(implementation.Lib3MF_metadata_getnamespace, implementation_metadata.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforNameSpace), Int64InValue(0)) - if err != nil { + if (err != nil) { return "", err } bufferSizeNameSpace := neededforNameSpace bufferNameSpace := make([]byte, bufferSizeNameSpace) err = implementation.CallFunction(implementation.Lib3MF_metadata_getnamespace, implementation_metadata.GetDLLInHandle(), Int64InValue(bufferSizeNameSpace), Int64OutValue(&filledinNameSpace), uintptr(unsafe.Pointer(&bufferNameSpace[0]))) - if err != nil { + if (err != nil) { return "", err } - - return string(bufferNameSpace[:(filledinNameSpace - 1)]), err + + return string(bufferNameSpace[:(filledinNameSpace-1)]), err } -func (implementation *Lib3MFImplementation) MetaData_SetNameSpace(MetaData Lib3MFHandle, sNameSpace string) error { +func (implementation *Lib3MFImplementation) MetaData_SetNameSpace(MetaData Lib3MFHandle, sNameSpace string) (error) { var err error = nil - + implementation_metadata, err := implementation.GetWrapperHandle(MetaData) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_metadata_setnamespace, implementation_metadata.GetDLLInHandle(), StringInValue(sNameSpace)) - if err != nil { + if (err != nil) { return err } - + return err } @@ -3352,39 +3648,39 @@ func (implementation *Lib3MFImplementation) MetaData_GetName(MetaData Lib3MFHand var err error = nil var neededforName int64 = 0 var filledinName int64 = 0 - + implementation_metadata, err := implementation.GetWrapperHandle(MetaData) - if err != nil { + if (err != nil) { return "", err } err = implementation.CallFunction(implementation.Lib3MF_metadata_getname, implementation_metadata.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforName), Int64InValue(0)) - if err != nil { + if (err != nil) { return "", err } bufferSizeName := neededforName bufferName := make([]byte, bufferSizeName) err = implementation.CallFunction(implementation.Lib3MF_metadata_getname, implementation_metadata.GetDLLInHandle(), Int64InValue(bufferSizeName), Int64OutValue(&filledinName), uintptr(unsafe.Pointer(&bufferName[0]))) - if err != nil { + if (err != nil) { return "", err } - - return string(bufferName[:(filledinName - 1)]), err + + return string(bufferName[:(filledinName-1)]), err } -func (implementation *Lib3MFImplementation) MetaData_SetName(MetaData Lib3MFHandle, sName string) error { +func (implementation *Lib3MFImplementation) MetaData_SetName(MetaData Lib3MFHandle, sName string) (error) { var err error = nil - + implementation_metadata, err := implementation.GetWrapperHandle(MetaData) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_metadata_setname, implementation_metadata.GetDLLInHandle(), StringInValue(sName)) - if err != nil { + if (err != nil) { return err } - + return err } @@ -3392,60 +3688,61 @@ func (implementation *Lib3MFImplementation) MetaData_GetKey(MetaData Lib3MFHandl var err error = nil var neededforKey int64 = 0 var filledinKey int64 = 0 - + implementation_metadata, err := implementation.GetWrapperHandle(MetaData) - if err != nil { + if (err != nil) { return "", err } err = implementation.CallFunction(implementation.Lib3MF_metadata_getkey, implementation_metadata.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforKey), Int64InValue(0)) - if err != nil { + if (err != nil) { return "", err } bufferSizeKey := neededforKey bufferKey := make([]byte, bufferSizeKey) err = implementation.CallFunction(implementation.Lib3MF_metadata_getkey, implementation_metadata.GetDLLInHandle(), Int64InValue(bufferSizeKey), Int64OutValue(&filledinKey), uintptr(unsafe.Pointer(&bufferKey[0]))) - if err != nil { + if (err != nil) { return "", err } - - return string(bufferKey[:(filledinKey - 1)]), err + + return string(bufferKey[:(filledinKey-1)]), err } func (implementation *Lib3MFImplementation) MetaData_GetMustPreserve(MetaData Lib3MFHandle) (bool, error) { var err error = nil var bMustPreserve int64 = 0 - + implementation_metadata, err := implementation.GetWrapperHandle(MetaData) - if err != nil { + if (err != nil) { return false, err } err = implementation.CallFunction(implementation.Lib3MF_metadata_getmustpreserve, implementation_metadata.GetDLLInHandle(), Int64OutValue(&bMustPreserve)) - if err != nil { + if (err != nil) { return false, err } - + return (bMustPreserve != 0), err } -func (implementation *Lib3MFImplementation) MetaData_SetMustPreserve(MetaData Lib3MFHandle, bMustPreserve bool) error { +func (implementation *Lib3MFImplementation) MetaData_SetMustPreserve(MetaData Lib3MFHandle, bMustPreserve bool) (error) { var err error = nil var nMustPreserve uint8 = 0 - if bMustPreserve { + if (bMustPreserve) { nMustPreserve = 1 } - + + implementation_metadata, err := implementation.GetWrapperHandle(MetaData) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_metadata_setmustpreserve, implementation_metadata.GetDLLInHandle(), UInt8InValue(nMustPreserve)) - if err != nil { + if (err != nil) { return err } - + return err } @@ -3453,39 +3750,39 @@ func (implementation *Lib3MFImplementation) MetaData_GetType(MetaData Lib3MFHand var err error = nil var neededforType int64 = 0 var filledinType int64 = 0 - + implementation_metadata, err := implementation.GetWrapperHandle(MetaData) - if err != nil { + if (err != nil) { return "", err } err = implementation.CallFunction(implementation.Lib3MF_metadata_gettype, implementation_metadata.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforType), Int64InValue(0)) - if err != nil { + if (err != nil) { return "", err } bufferSizeType := neededforType bufferType := make([]byte, bufferSizeType) err = implementation.CallFunction(implementation.Lib3MF_metadata_gettype, implementation_metadata.GetDLLInHandle(), Int64InValue(bufferSizeType), Int64OutValue(&filledinType), uintptr(unsafe.Pointer(&bufferType[0]))) - if err != nil { + if (err != nil) { return "", err } - - return string(bufferType[:(filledinType - 1)]), err + + return string(bufferType[:(filledinType-1)]), err } -func (implementation *Lib3MFImplementation) MetaData_SetType(MetaData Lib3MFHandle, sType string) error { +func (implementation *Lib3MFImplementation) MetaData_SetType(MetaData Lib3MFHandle, sType string) (error) { var err error = nil - + implementation_metadata, err := implementation.GetWrapperHandle(MetaData) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_metadata_settype, implementation_metadata.GetDLLInHandle(), StringInValue(sType)) - if err != nil { + if (err != nil) { return err } - + return err } @@ -3493,187 +3790,187 @@ func (implementation *Lib3MFImplementation) MetaData_GetValue(MetaData Lib3MFHan var err error = nil var neededforValue int64 = 0 var filledinValue int64 = 0 - + implementation_metadata, err := implementation.GetWrapperHandle(MetaData) - if err != nil { + if (err != nil) { return "", err } err = implementation.CallFunction(implementation.Lib3MF_metadata_getvalue, implementation_metadata.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforValue), Int64InValue(0)) - if err != nil { + if (err != nil) { return "", err } bufferSizeValue := neededforValue bufferValue := make([]byte, bufferSizeValue) err = implementation.CallFunction(implementation.Lib3MF_metadata_getvalue, implementation_metadata.GetDLLInHandle(), Int64InValue(bufferSizeValue), Int64OutValue(&filledinValue), uintptr(unsafe.Pointer(&bufferValue[0]))) - if err != nil { + if (err != nil) { return "", err } - - return string(bufferValue[:(filledinValue - 1)]), err + + return string(bufferValue[:(filledinValue-1)]), err } -func (implementation *Lib3MFImplementation) MetaData_SetValue(MetaData Lib3MFHandle, sValue string) error { +func (implementation *Lib3MFImplementation) MetaData_SetValue(MetaData Lib3MFHandle, sValue string) (error) { var err error = nil - + implementation_metadata, err := implementation.GetWrapperHandle(MetaData) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_metadata_setvalue, implementation_metadata.GetDLLInHandle(), StringInValue(sValue)) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) MetaDataGroup_GetMetaDataCount(MetaDataGroup Lib3MFHandle) (uint32, error) { var err error = nil var nCount uint32 = 0 - + implementation_metadatagroup, err := implementation.GetWrapperHandle(MetaDataGroup) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_metadatagroup_getmetadatacount, implementation_metadatagroup.GetDLLInHandle(), UInt32OutValue(&nCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nCount), err } func (implementation *Lib3MFImplementation) MetaDataGroup_GetMetaData(MetaDataGroup Lib3MFHandle, nIndex uint32) (Lib3MFHandle, error) { var err error = nil hMetaData := implementation.NewHandle() - + implementation_metadatagroup, err := implementation.GetWrapperHandle(MetaDataGroup) - if err != nil { + if (err != nil) { return hMetaData, err } err = implementation.CallFunction(implementation.Lib3MF_metadatagroup_getmetadata, implementation_metadatagroup.GetDLLInHandle(), UInt32InValue(nIndex), hMetaData.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hMetaData, err } - + return hMetaData, err } func (implementation *Lib3MFImplementation) MetaDataGroup_GetMetaDataByKey(MetaDataGroup Lib3MFHandle, sNameSpace string, sName string) (Lib3MFHandle, error) { var err error = nil hMetaData := implementation.NewHandle() - + implementation_metadatagroup, err := implementation.GetWrapperHandle(MetaDataGroup) - if err != nil { + if (err != nil) { return hMetaData, err } err = implementation.CallFunction(implementation.Lib3MF_metadatagroup_getmetadatabykey, implementation_metadatagroup.GetDLLInHandle(), StringInValue(sNameSpace), StringInValue(sName), hMetaData.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hMetaData, err } - + return hMetaData, err } -func (implementation *Lib3MFImplementation) MetaDataGroup_RemoveMetaDataByIndex(MetaDataGroup Lib3MFHandle, nIndex uint32) error { +func (implementation *Lib3MFImplementation) MetaDataGroup_RemoveMetaDataByIndex(MetaDataGroup Lib3MFHandle, nIndex uint32) (error) { var err error = nil - + implementation_metadatagroup, err := implementation.GetWrapperHandle(MetaDataGroup) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_metadatagroup_removemetadatabyindex, implementation_metadatagroup.GetDLLInHandle(), UInt32InValue(nIndex)) - if err != nil { + if (err != nil) { return err } - + return err } -func (implementation *Lib3MFImplementation) MetaDataGroup_RemoveMetaData(MetaDataGroup Lib3MFHandle, TheMetaData Lib3MFHandle) error { +func (implementation *Lib3MFImplementation) MetaDataGroup_RemoveMetaData(MetaDataGroup Lib3MFHandle, TheMetaData Lib3MFHandle) (error) { var err error = nil - + implementation_metadatagroup, err := implementation.GetWrapperHandle(MetaDataGroup) - if err != nil { + if (err != nil) { return err } implementation_themetadata, err := implementation.GetWrapperHandle(TheMetaData) - if err != nil { + if (err != nil) { return err } - + TheMetaDataDLLHandle := implementation_themetadata.GetDLLInHandle() - if TheMetaDataDLLHandle == 0 { + if (TheMetaDataDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return err } err = implementation.CallFunction(implementation.Lib3MF_metadatagroup_removemetadata, implementation_metadatagroup.GetDLLInHandle(), TheMetaDataDLLHandle) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) MetaDataGroup_AddMetaData(MetaDataGroup Lib3MFHandle, sNameSpace string, sName string, sValue string, sType string, bMustPreserve bool) (Lib3MFHandle, error) { var err error = nil var nMustPreserve uint8 = 0 - if bMustPreserve { + if (bMustPreserve) { nMustPreserve = 1 } - + hMetaData := implementation.NewHandle() - + implementation_metadatagroup, err := implementation.GetWrapperHandle(MetaDataGroup) - if err != nil { + if (err != nil) { return hMetaData, err } err = implementation.CallFunction(implementation.Lib3MF_metadatagroup_addmetadata, implementation_metadatagroup.GetDLLInHandle(), StringInValue(sNameSpace), StringInValue(sName), StringInValue(sValue), StringInValue(sType), UInt8InValue(nMustPreserve), hMetaData.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hMetaData, err } - + return hMetaData, err } func (implementation *Lib3MFImplementation) Object_GetType(Object Lib3MFHandle) (ELib3MFObjectType, error) { var err error = nil var eObjectType uint64 = 0 - + implementation_object, err := implementation.GetWrapperHandle(Object) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_object_gettype, implementation_object.GetDLLInHandle(), UInt64OutValue(&eObjectType)) - if err != nil { + if (err != nil) { return 0, err } - - return ELib3MFObjectType(eObjectType), err + + return ELib3MFObjectType (eObjectType), err } -func (implementation *Lib3MFImplementation) Object_SetType(Object Lib3MFHandle, eObjectType ELib3MFObjectType) error { +func (implementation *Lib3MFImplementation) Object_SetType(Object Lib3MFHandle, eObjectType ELib3MFObjectType) (error) { var err error = nil - + implementation_object, err := implementation.GetWrapperHandle(Object) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_object_settype, implementation_object.GetDLLInHandle(), uintptr(eObjectType)) - if err != nil { + if (err != nil) { return err } - + return err } @@ -3681,39 +3978,39 @@ func (implementation *Lib3MFImplementation) Object_GetName(Object Lib3MFHandle) var err error = nil var neededforName int64 = 0 var filledinName int64 = 0 - + implementation_object, err := implementation.GetWrapperHandle(Object) - if err != nil { + if (err != nil) { return "", err } err = implementation.CallFunction(implementation.Lib3MF_object_getname, implementation_object.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforName), Int64InValue(0)) - if err != nil { + if (err != nil) { return "", err } bufferSizeName := neededforName bufferName := make([]byte, bufferSizeName) err = implementation.CallFunction(implementation.Lib3MF_object_getname, implementation_object.GetDLLInHandle(), Int64InValue(bufferSizeName), Int64OutValue(&filledinName), uintptr(unsafe.Pointer(&bufferName[0]))) - if err != nil { + if (err != nil) { return "", err } - - return string(bufferName[:(filledinName - 1)]), err + + return string(bufferName[:(filledinName-1)]), err } -func (implementation *Lib3MFImplementation) Object_SetName(Object Lib3MFHandle, sName string) error { +func (implementation *Lib3MFImplementation) Object_SetName(Object Lib3MFHandle, sName string) (error) { var err error = nil - + implementation_object, err := implementation.GetWrapperHandle(Object) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_object_setname, implementation_object.GetDLLInHandle(), StringInValue(sName)) - if err != nil { + if (err != nil) { return err } - + return err } @@ -3721,166 +4018,166 @@ func (implementation *Lib3MFImplementation) Object_GetPartNumber(Object Lib3MFHa var err error = nil var neededforPartNumber int64 = 0 var filledinPartNumber int64 = 0 - + implementation_object, err := implementation.GetWrapperHandle(Object) - if err != nil { + if (err != nil) { return "", err } err = implementation.CallFunction(implementation.Lib3MF_object_getpartnumber, implementation_object.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforPartNumber), Int64InValue(0)) - if err != nil { + if (err != nil) { return "", err } bufferSizePartNumber := neededforPartNumber bufferPartNumber := make([]byte, bufferSizePartNumber) err = implementation.CallFunction(implementation.Lib3MF_object_getpartnumber, implementation_object.GetDLLInHandle(), Int64InValue(bufferSizePartNumber), Int64OutValue(&filledinPartNumber), uintptr(unsafe.Pointer(&bufferPartNumber[0]))) - if err != nil { + if (err != nil) { return "", err } - - return string(bufferPartNumber[:(filledinPartNumber - 1)]), err + + return string(bufferPartNumber[:(filledinPartNumber-1)]), err } -func (implementation *Lib3MFImplementation) Object_SetPartNumber(Object Lib3MFHandle, sPartNumber string) error { +func (implementation *Lib3MFImplementation) Object_SetPartNumber(Object Lib3MFHandle, sPartNumber string) (error) { var err error = nil - + implementation_object, err := implementation.GetWrapperHandle(Object) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_object_setpartnumber, implementation_object.GetDLLInHandle(), StringInValue(sPartNumber)) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Object_IsMeshObject(Object Lib3MFHandle) (bool, error) { var err error = nil var bIsMeshObject int64 = 0 - + implementation_object, err := implementation.GetWrapperHandle(Object) - if err != nil { + if (err != nil) { return false, err } err = implementation.CallFunction(implementation.Lib3MF_object_ismeshobject, implementation_object.GetDLLInHandle(), Int64OutValue(&bIsMeshObject)) - if err != nil { + if (err != nil) { return false, err } - + return (bIsMeshObject != 0), err } func (implementation *Lib3MFImplementation) Object_IsComponentsObject(Object Lib3MFHandle) (bool, error) { var err error = nil var bIsComponentsObject int64 = 0 - + implementation_object, err := implementation.GetWrapperHandle(Object) - if err != nil { + if (err != nil) { return false, err } err = implementation.CallFunction(implementation.Lib3MF_object_iscomponentsobject, implementation_object.GetDLLInHandle(), Int64OutValue(&bIsComponentsObject)) - if err != nil { + if (err != nil) { return false, err } - + return (bIsComponentsObject != 0), err } func (implementation *Lib3MFImplementation) Object_IsValid(Object Lib3MFHandle) (bool, error) { var err error = nil var bIsValid int64 = 0 - + implementation_object, err := implementation.GetWrapperHandle(Object) - if err != nil { + if (err != nil) { return false, err } err = implementation.CallFunction(implementation.Lib3MF_object_isvalid, implementation_object.GetDLLInHandle(), Int64OutValue(&bIsValid)) - if err != nil { + if (err != nil) { return false, err } - + return (bIsValid != 0), err } -func (implementation *Lib3MFImplementation) Object_SetAttachmentAsThumbnail(Object Lib3MFHandle, Attachment Lib3MFHandle) error { +func (implementation *Lib3MFImplementation) Object_SetAttachmentAsThumbnail(Object Lib3MFHandle, Attachment Lib3MFHandle) (error) { var err error = nil - + implementation_object, err := implementation.GetWrapperHandle(Object) - if err != nil { + if (err != nil) { return err } implementation_attachment, err := implementation.GetWrapperHandle(Attachment) - if err != nil { + if (err != nil) { return err } - + AttachmentDLLHandle := implementation_attachment.GetDLLInHandle() - if AttachmentDLLHandle == 0 { + if (AttachmentDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return err } err = implementation.CallFunction(implementation.Lib3MF_object_setattachmentasthumbnail, implementation_object.GetDLLInHandle(), AttachmentDLLHandle) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Object_GetThumbnailAttachment(Object Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hAttachment := implementation.NewHandle() - + implementation_object, err := implementation.GetWrapperHandle(Object) - if err != nil { + if (err != nil) { return hAttachment, err } err = implementation.CallFunction(implementation.Lib3MF_object_getthumbnailattachment, implementation_object.GetDLLInHandle(), hAttachment.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hAttachment, err } - + return hAttachment, err } -func (implementation *Lib3MFImplementation) Object_ClearThumbnailAttachment(Object Lib3MFHandle) error { +func (implementation *Lib3MFImplementation) Object_ClearThumbnailAttachment(Object Lib3MFHandle) (error) { var err error = nil - + implementation_object, err := implementation.GetWrapperHandle(Object) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_object_clearthumbnailattachment, implementation_object.GetDLLInHandle()) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Object_GetOutbox(Object Lib3MFHandle) (sLib3MFBox, error) { var err error = nil var sOutbox sLib3MFBox - + implementation_object, err := implementation.GetWrapperHandle(Object) - if err != nil { + if (err != nil) { return sOutbox, err } err = implementation.CallFunction(implementation.Lib3MF_object_getoutbox, implementation_object.GetDLLInHandle(), 0) - if err != nil { + if (err != nil) { return sOutbox, err } - + return sOutbox, err } @@ -3889,362 +4186,362 @@ func (implementation *Lib3MFImplementation) Object_GetUUID(Object Lib3MFHandle) var bHasUUID int64 = 0 var neededforUUID int64 = 0 var filledinUUID int64 = 0 - + implementation_object, err := implementation.GetWrapperHandle(Object) - if err != nil { + if (err != nil) { return false, "", err } err = implementation.CallFunction(implementation.Lib3MF_object_getuuid, implementation_object.GetDLLInHandle(), Int64OutValue(&bHasUUID), Int64InValue(0), Int64OutValue(&neededforUUID), Int64InValue(0)) - if err != nil { + if (err != nil) { return false, "", err } bufferSizeUUID := neededforUUID bufferUUID := make([]byte, bufferSizeUUID) err = implementation.CallFunction(implementation.Lib3MF_object_getuuid, implementation_object.GetDLLInHandle(), Int64OutValue(&bHasUUID), Int64InValue(bufferSizeUUID), Int64OutValue(&filledinUUID), uintptr(unsafe.Pointer(&bufferUUID[0]))) - if err != nil { + if (err != nil) { return false, "", err } - - return (bHasUUID != 0), string(bufferUUID[:(filledinUUID - 1)]), err + + return (bHasUUID != 0), string(bufferUUID[:(filledinUUID-1)]), err } -func (implementation *Lib3MFImplementation) Object_SetUUID(Object Lib3MFHandle, sUUID string) error { +func (implementation *Lib3MFImplementation) Object_SetUUID(Object Lib3MFHandle, sUUID string) (error) { var err error = nil - + implementation_object, err := implementation.GetWrapperHandle(Object) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_object_setuuid, implementation_object.GetDLLInHandle(), StringInValue(sUUID)) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Object_GetMetaDataGroup(Object Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hMetaDataGroup := implementation.NewHandle() - + implementation_object, err := implementation.GetWrapperHandle(Object) - if err != nil { + if (err != nil) { return hMetaDataGroup, err } err = implementation.CallFunction(implementation.Lib3MF_object_getmetadatagroup, implementation_object.GetDLLInHandle(), hMetaDataGroup.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hMetaDataGroup, err } - + return hMetaDataGroup, err } -func (implementation *Lib3MFImplementation) Object_SetSlicesMeshResolution(Object Lib3MFHandle, eMeshResolution ELib3MFSlicesMeshResolution) error { +func (implementation *Lib3MFImplementation) Object_SetSlicesMeshResolution(Object Lib3MFHandle, eMeshResolution ELib3MFSlicesMeshResolution) (error) { var err error = nil - + implementation_object, err := implementation.GetWrapperHandle(Object) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_object_setslicesmeshresolution, implementation_object.GetDLLInHandle(), uintptr(eMeshResolution)) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Object_GetSlicesMeshResolution(Object Lib3MFHandle) (ELib3MFSlicesMeshResolution, error) { var err error = nil var eMeshResolution uint64 = 0 - + implementation_object, err := implementation.GetWrapperHandle(Object) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_object_getslicesmeshresolution, implementation_object.GetDLLInHandle(), UInt64OutValue(&eMeshResolution)) - if err != nil { + if (err != nil) { return 0, err } - - return ELib3MFSlicesMeshResolution(eMeshResolution), err + + return ELib3MFSlicesMeshResolution (eMeshResolution), err } func (implementation *Lib3MFImplementation) Object_HasSlices(Object Lib3MFHandle, bRecursive bool) (bool, error) { var err error = nil var nRecursive uint8 = 0 - if bRecursive { + if (bRecursive) { nRecursive = 1 } - + var bHasSlices int64 = 0 - + implementation_object, err := implementation.GetWrapperHandle(Object) - if err != nil { + if (err != nil) { return false, err } err = implementation.CallFunction(implementation.Lib3MF_object_hasslices, implementation_object.GetDLLInHandle(), UInt8InValue(nRecursive), Int64OutValue(&bHasSlices)) - if err != nil { + if (err != nil) { return false, err } - + return (bHasSlices != 0), err } -func (implementation *Lib3MFImplementation) Object_ClearSliceStack(Object Lib3MFHandle) error { +func (implementation *Lib3MFImplementation) Object_ClearSliceStack(Object Lib3MFHandle) (error) { var err error = nil - + implementation_object, err := implementation.GetWrapperHandle(Object) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_object_clearslicestack, implementation_object.GetDLLInHandle()) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Object_GetSliceStack(Object Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hSliceStackInstance := implementation.NewHandle() - + implementation_object, err := implementation.GetWrapperHandle(Object) - if err != nil { + if (err != nil) { return hSliceStackInstance, err } err = implementation.CallFunction(implementation.Lib3MF_object_getslicestack, implementation_object.GetDLLInHandle(), hSliceStackInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hSliceStackInstance, err } - + return hSliceStackInstance, err } -func (implementation *Lib3MFImplementation) Object_AssignSliceStack(Object Lib3MFHandle, SliceStackInstance Lib3MFHandle) error { +func (implementation *Lib3MFImplementation) Object_AssignSliceStack(Object Lib3MFHandle, SliceStackInstance Lib3MFHandle) (error) { var err error = nil - + implementation_object, err := implementation.GetWrapperHandle(Object) - if err != nil { + if (err != nil) { return err } implementation_slicestackinstance, err := implementation.GetWrapperHandle(SliceStackInstance) - if err != nil { + if (err != nil) { return err } - + SliceStackInstanceDLLHandle := implementation_slicestackinstance.GetDLLInHandle() - if SliceStackInstanceDLLHandle == 0 { + if (SliceStackInstanceDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return err } err = implementation.CallFunction(implementation.Lib3MF_object_assignslicestack, implementation_object.GetDLLInHandle(), SliceStackInstanceDLLHandle) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) MeshObject_GetVertexCount(MeshObject Lib3MFHandle) (uint32, error) { var err error = nil var nVertexCount uint32 = 0 - + implementation_meshobject, err := implementation.GetWrapperHandle(MeshObject) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_meshobject_getvertexcount, implementation_meshobject.GetDLLInHandle(), UInt32OutValue(&nVertexCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nVertexCount), err } func (implementation *Lib3MFImplementation) MeshObject_GetTriangleCount(MeshObject Lib3MFHandle) (uint32, error) { var err error = nil var nVertexCount uint32 = 0 - + implementation_meshobject, err := implementation.GetWrapperHandle(MeshObject) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_meshobject_gettrianglecount, implementation_meshobject.GetDLLInHandle(), UInt32OutValue(&nVertexCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nVertexCount), err } func (implementation *Lib3MFImplementation) MeshObject_GetVertex(MeshObject Lib3MFHandle, nIndex uint32) (sLib3MFPosition, error) { var err error = nil var sCoordinates sLib3MFPosition - + implementation_meshobject, err := implementation.GetWrapperHandle(MeshObject) - if err != nil { + if (err != nil) { return sCoordinates, err } err = implementation.CallFunction(implementation.Lib3MF_meshobject_getvertex, implementation_meshobject.GetDLLInHandle(), UInt32InValue(nIndex), 0) - if err != nil { + if (err != nil) { return sCoordinates, err } - + return sCoordinates, err } -func (implementation *Lib3MFImplementation) MeshObject_SetVertex(MeshObject Lib3MFHandle, nIndex uint32, sCoordinates sLib3MFPosition) error { +func (implementation *Lib3MFImplementation) MeshObject_SetVertex(MeshObject Lib3MFHandle, nIndex uint32, sCoordinates sLib3MFPosition) (error) { var err error = nil - + implementation_meshobject, err := implementation.GetWrapperHandle(MeshObject) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_meshobject_setvertex, implementation_meshobject.GetDLLInHandle(), UInt32InValue(nIndex), uintptr(unsafe.Pointer(&sCoordinates))) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) MeshObject_AddVertex(MeshObject Lib3MFHandle, sCoordinates sLib3MFPosition) (uint32, error) { var err error = nil var nNewIndex uint32 = 0 - + implementation_meshobject, err := implementation.GetWrapperHandle(MeshObject) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_meshobject_addvertex, implementation_meshobject.GetDLLInHandle(), uintptr(unsafe.Pointer(&sCoordinates)), UInt32OutValue(&nNewIndex)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nNewIndex), err } func (implementation *Lib3MFImplementation) MeshObject_GetVertices(MeshObject Lib3MFHandle) ([]sLib3MFPosition, error) { var err error = nil arrayVertices := make([]sLib3MFPosition, 0) - + implementation_meshobject, err := implementation.GetWrapperHandle(MeshObject) - if err != nil { + if (err != nil) { return make([]sLib3MFPosition, 0), err } err = implementation.CallFunction(implementation.Lib3MF_meshobject_getvertices, implementation_meshobject.GetDLLInHandle(), 0, 0, 0) - if err != nil { + if (err != nil) { return make([]sLib3MFPosition, 0), err } err = implementation.CallFunction(implementation.Lib3MF_meshobject_getvertices, implementation_meshobject.GetDLLInHandle(), 0, 0, 0) - if err != nil { + if (err != nil) { return make([]sLib3MFPosition, 0), err } - + return arrayVertices, err } func (implementation *Lib3MFImplementation) MeshObject_GetTriangle(MeshObject Lib3MFHandle, nIndex uint32) (sLib3MFTriangle, error) { var err error = nil var sIndices sLib3MFTriangle - + implementation_meshobject, err := implementation.GetWrapperHandle(MeshObject) - if err != nil { + if (err != nil) { return sIndices, err } err = implementation.CallFunction(implementation.Lib3MF_meshobject_gettriangle, implementation_meshobject.GetDLLInHandle(), UInt32InValue(nIndex), 0) - if err != nil { + if (err != nil) { return sIndices, err } - + return sIndices, err } -func (implementation *Lib3MFImplementation) MeshObject_SetTriangle(MeshObject Lib3MFHandle, nIndex uint32, sIndices sLib3MFTriangle) error { +func (implementation *Lib3MFImplementation) MeshObject_SetTriangle(MeshObject Lib3MFHandle, nIndex uint32, sIndices sLib3MFTriangle) (error) { var err error = nil - + implementation_meshobject, err := implementation.GetWrapperHandle(MeshObject) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_meshobject_settriangle, implementation_meshobject.GetDLLInHandle(), UInt32InValue(nIndex), uintptr(unsafe.Pointer(&sIndices))) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) MeshObject_AddTriangle(MeshObject Lib3MFHandle, sIndices sLib3MFTriangle) (uint32, error) { var err error = nil var nNewIndex uint32 = 0 - + implementation_meshobject, err := implementation.GetWrapperHandle(MeshObject) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_meshobject_addtriangle, implementation_meshobject.GetDLLInHandle(), uintptr(unsafe.Pointer(&sIndices)), UInt32OutValue(&nNewIndex)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nNewIndex), err } func (implementation *Lib3MFImplementation) MeshObject_GetTriangleIndices(MeshObject Lib3MFHandle) ([]sLib3MFTriangle, error) { var err error = nil arrayIndices := make([]sLib3MFTriangle, 0) - + implementation_meshobject, err := implementation.GetWrapperHandle(MeshObject) - if err != nil { + if (err != nil) { return make([]sLib3MFTriangle, 0), err } err = implementation.CallFunction(implementation.Lib3MF_meshobject_gettriangleindices, implementation_meshobject.GetDLLInHandle(), 0, 0, 0) - if err != nil { + if (err != nil) { return make([]sLib3MFTriangle, 0), err } err = implementation.CallFunction(implementation.Lib3MF_meshobject_gettriangleindices, implementation_meshobject.GetDLLInHandle(), 0, 0, 0) - if err != nil { + if (err != nil) { return make([]sLib3MFTriangle, 0), err } - + return arrayIndices, err } -func (implementation *Lib3MFImplementation) MeshObject_SetObjectLevelProperty(MeshObject Lib3MFHandle, nUniqueResourceID uint32, nPropertyID uint32) error { +func (implementation *Lib3MFImplementation) MeshObject_SetObjectLevelProperty(MeshObject Lib3MFHandle, nUniqueResourceID uint32, nPropertyID uint32) (error) { var err error = nil - + implementation_meshobject, err := implementation.GetWrapperHandle(MeshObject) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_meshobject_setobjectlevelproperty, implementation_meshobject.GetDLLInHandle(), UInt32InValue(nUniqueResourceID), UInt32InValue(nPropertyID)) - if err != nil { + if (err != nil) { return err } - + return err } @@ -4253,186 +4550,186 @@ func (implementation *Lib3MFImplementation) MeshObject_GetObjectLevelProperty(Me var nUniqueResourceID uint32 = 0 var nPropertyID uint32 = 0 var bHasObjectLevelProperty int64 = 0 - + implementation_meshobject, err := implementation.GetWrapperHandle(MeshObject) - if err != nil { + if (err != nil) { return 0, 0, false, err } err = implementation.CallFunction(implementation.Lib3MF_meshobject_getobjectlevelproperty, implementation_meshobject.GetDLLInHandle(), UInt32OutValue(&nUniqueResourceID), UInt32OutValue(&nPropertyID), Int64OutValue(&bHasObjectLevelProperty)) - if err != nil { + if (err != nil) { return 0, 0, false, err } - + return uint32(nUniqueResourceID), uint32(nPropertyID), (bHasObjectLevelProperty != 0), err } -func (implementation *Lib3MFImplementation) MeshObject_SetTriangleProperties(MeshObject Lib3MFHandle, nIndex uint32, sProperties sLib3MFTriangleProperties) error { +func (implementation *Lib3MFImplementation) MeshObject_SetTriangleProperties(MeshObject Lib3MFHandle, nIndex uint32, sProperties sLib3MFTriangleProperties) (error) { var err error = nil - + implementation_meshobject, err := implementation.GetWrapperHandle(MeshObject) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_meshobject_settriangleproperties, implementation_meshobject.GetDLLInHandle(), UInt32InValue(nIndex), uintptr(unsafe.Pointer(&sProperties))) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) MeshObject_GetTriangleProperties(MeshObject Lib3MFHandle, nIndex uint32) (sLib3MFTriangleProperties, error) { var err error = nil var sProperty sLib3MFTriangleProperties - + implementation_meshobject, err := implementation.GetWrapperHandle(MeshObject) - if err != nil { + if (err != nil) { return sProperty, err } err = implementation.CallFunction(implementation.Lib3MF_meshobject_gettriangleproperties, implementation_meshobject.GetDLLInHandle(), UInt32InValue(nIndex), 0) - if err != nil { + if (err != nil) { return sProperty, err } - + return sProperty, err } -func (implementation *Lib3MFImplementation) MeshObject_SetAllTriangleProperties(MeshObject Lib3MFHandle, PropertiesArray []sLib3MFTriangleProperties) error { +func (implementation *Lib3MFImplementation) MeshObject_SetAllTriangleProperties(MeshObject Lib3MFHandle, PropertiesArray []sLib3MFTriangleProperties) (error) { var err error = nil - + implementation_meshobject, err := implementation.GetWrapperHandle(MeshObject) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_meshobject_setalltriangleproperties, implementation_meshobject.GetDLLInHandle(), 0, 0) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) MeshObject_GetAllTriangleProperties(MeshObject Lib3MFHandle) ([]sLib3MFTriangleProperties, error) { var err error = nil arrayPropertiesArray := make([]sLib3MFTriangleProperties, 0) - + implementation_meshobject, err := implementation.GetWrapperHandle(MeshObject) - if err != nil { + if (err != nil) { return make([]sLib3MFTriangleProperties, 0), err } err = implementation.CallFunction(implementation.Lib3MF_meshobject_getalltriangleproperties, implementation_meshobject.GetDLLInHandle(), 0, 0, 0) - if err != nil { + if (err != nil) { return make([]sLib3MFTriangleProperties, 0), err } err = implementation.CallFunction(implementation.Lib3MF_meshobject_getalltriangleproperties, implementation_meshobject.GetDLLInHandle(), 0, 0, 0) - if err != nil { + if (err != nil) { return make([]sLib3MFTriangleProperties, 0), err } - + return arrayPropertiesArray, err } -func (implementation *Lib3MFImplementation) MeshObject_ClearAllProperties(MeshObject Lib3MFHandle) error { +func (implementation *Lib3MFImplementation) MeshObject_ClearAllProperties(MeshObject Lib3MFHandle) (error) { var err error = nil - + implementation_meshobject, err := implementation.GetWrapperHandle(MeshObject) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_meshobject_clearallproperties, implementation_meshobject.GetDLLInHandle()) - if err != nil { + if (err != nil) { return err } - + return err } -func (implementation *Lib3MFImplementation) MeshObject_SetGeometry(MeshObject Lib3MFHandle, Vertices []sLib3MFPosition, Indices []sLib3MFTriangle) error { +func (implementation *Lib3MFImplementation) MeshObject_SetGeometry(MeshObject Lib3MFHandle, Vertices []sLib3MFPosition, Indices []sLib3MFTriangle) (error) { var err error = nil - + implementation_meshobject, err := implementation.GetWrapperHandle(MeshObject) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_meshobject_setgeometry, implementation_meshobject.GetDLLInHandle(), 0, 0, 0, 0) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) MeshObject_IsManifoldAndOriented(MeshObject Lib3MFHandle) (bool, error) { var err error = nil var bIsManifoldAndOriented int64 = 0 - + implementation_meshobject, err := implementation.GetWrapperHandle(MeshObject) - if err != nil { + if (err != nil) { return false, err } err = implementation.CallFunction(implementation.Lib3MF_meshobject_ismanifoldandoriented, implementation_meshobject.GetDLLInHandle(), Int64OutValue(&bIsManifoldAndOriented)) - if err != nil { + if (err != nil) { return false, err } - + return (bIsManifoldAndOriented != 0), err } func (implementation *Lib3MFImplementation) MeshObject_BeamLattice(MeshObject Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hTheBeamLattice := implementation.NewHandle() - + implementation_meshobject, err := implementation.GetWrapperHandle(MeshObject) - if err != nil { + if (err != nil) { return hTheBeamLattice, err } err = implementation.CallFunction(implementation.Lib3MF_meshobject_beamlattice, implementation_meshobject.GetDLLInHandle(), hTheBeamLattice.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hTheBeamLattice, err } - + return hTheBeamLattice, err } func (implementation *Lib3MFImplementation) BeamLattice_GetMinLength(BeamLattice Lib3MFHandle) (float64, error) { var err error = nil var dMinLength float64 = 0 - + implementation_beamlattice, err := implementation.GetWrapperHandle(BeamLattice) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_beamlattice_getminlength, implementation_beamlattice.GetDLLInHandle(), Float64OutValue(&dMinLength)) - if err != nil { + if (err != nil) { return 0, err } - + return dMinLength, err } -func (implementation *Lib3MFImplementation) BeamLattice_SetMinLength(BeamLattice Lib3MFHandle, dMinLength float64) error { +func (implementation *Lib3MFImplementation) BeamLattice_SetMinLength(BeamLattice Lib3MFHandle, dMinLength float64) (error) { var err error = nil - + implementation_beamlattice, err := implementation.GetWrapperHandle(BeamLattice) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_beamlattice_setminlength, implementation_beamlattice.GetDLLInHandle(), Float64InValue(dMinLength)) - if err != nil { + if (err != nil) { return err } - + return err } @@ -4440,33 +4737,33 @@ func (implementation *Lib3MFImplementation) BeamLattice_GetClipping(BeamLattice var err error = nil var eClipMode uint64 = 0 var nUniqueResourceID uint32 = 0 - + implementation_beamlattice, err := implementation.GetWrapperHandle(BeamLattice) - if err != nil { + if (err != nil) { return 0, 0, err } err = implementation.CallFunction(implementation.Lib3MF_beamlattice_getclipping, implementation_beamlattice.GetDLLInHandle(), UInt64OutValue(&eClipMode), UInt32OutValue(&nUniqueResourceID)) - if err != nil { + if (err != nil) { return 0, 0, err } - - return ELib3MFBeamLatticeClipMode(eClipMode), uint32(nUniqueResourceID), err + + return ELib3MFBeamLatticeClipMode (eClipMode), uint32(nUniqueResourceID), err } -func (implementation *Lib3MFImplementation) BeamLattice_SetClipping(BeamLattice Lib3MFHandle, eClipMode ELib3MFBeamLatticeClipMode, nUniqueResourceID uint32) error { +func (implementation *Lib3MFImplementation) BeamLattice_SetClipping(BeamLattice Lib3MFHandle, eClipMode ELib3MFBeamLatticeClipMode, nUniqueResourceID uint32) (error) { var err error = nil - + implementation_beamlattice, err := implementation.GetWrapperHandle(BeamLattice) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_beamlattice_setclipping, implementation_beamlattice.GetDLLInHandle(), uintptr(eClipMode), UInt32InValue(nUniqueResourceID)) - if err != nil { + if (err != nil) { return err } - + return err } @@ -4474,33 +4771,33 @@ func (implementation *Lib3MFImplementation) BeamLattice_GetRepresentation(BeamLa var err error = nil var bHasRepresentation int64 = 0 var nUniqueResourceID uint32 = 0 - + implementation_beamlattice, err := implementation.GetWrapperHandle(BeamLattice) - if err != nil { + if (err != nil) { return false, 0, err } err = implementation.CallFunction(implementation.Lib3MF_beamlattice_getrepresentation, implementation_beamlattice.GetDLLInHandle(), Int64OutValue(&bHasRepresentation), UInt32OutValue(&nUniqueResourceID)) - if err != nil { + if (err != nil) { return false, 0, err } - + return (bHasRepresentation != 0), uint32(nUniqueResourceID), err } -func (implementation *Lib3MFImplementation) BeamLattice_SetRepresentation(BeamLattice Lib3MFHandle, nUniqueResourceID uint32) error { +func (implementation *Lib3MFImplementation) BeamLattice_SetRepresentation(BeamLattice Lib3MFHandle, nUniqueResourceID uint32) (error) { var err error = nil - + implementation_beamlattice, err := implementation.GetWrapperHandle(BeamLattice) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_beamlattice_setrepresentation, implementation_beamlattice.GetDLLInHandle(), UInt32InValue(nUniqueResourceID)) - if err != nil { + if (err != nil) { return err } - + return err } @@ -4508,326 +4805,326 @@ func (implementation *Lib3MFImplementation) BeamLattice_GetBallOptions(BeamLatti var err error = nil var eBallMode uint64 = 0 var dBallRadius float64 = 0 - + implementation_beamlattice, err := implementation.GetWrapperHandle(BeamLattice) - if err != nil { + if (err != nil) { return 0, 0, err } err = implementation.CallFunction(implementation.Lib3MF_beamlattice_getballoptions, implementation_beamlattice.GetDLLInHandle(), UInt64OutValue(&eBallMode), Float64OutValue(&dBallRadius)) - if err != nil { + if (err != nil) { return 0, 0, err } - - return ELib3MFBeamLatticeBallMode(eBallMode), dBallRadius, err + + return ELib3MFBeamLatticeBallMode (eBallMode), dBallRadius, err } -func (implementation *Lib3MFImplementation) BeamLattice_SetBallOptions(BeamLattice Lib3MFHandle, eBallMode ELib3MFBeamLatticeBallMode, dBallRadius float64) error { +func (implementation *Lib3MFImplementation) BeamLattice_SetBallOptions(BeamLattice Lib3MFHandle, eBallMode ELib3MFBeamLatticeBallMode, dBallRadius float64) (error) { var err error = nil - + implementation_beamlattice, err := implementation.GetWrapperHandle(BeamLattice) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_beamlattice_setballoptions, implementation_beamlattice.GetDLLInHandle(), uintptr(eBallMode), Float64InValue(dBallRadius)) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) BeamLattice_GetBeamCount(BeamLattice Lib3MFHandle) (uint32, error) { var err error = nil var nCount uint32 = 0 - + implementation_beamlattice, err := implementation.GetWrapperHandle(BeamLattice) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_beamlattice_getbeamcount, implementation_beamlattice.GetDLLInHandle(), UInt32OutValue(&nCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nCount), err } func (implementation *Lib3MFImplementation) BeamLattice_GetBeam(BeamLattice Lib3MFHandle, nIndex uint32) (sLib3MFBeam, error) { var err error = nil var sBeamInfo sLib3MFBeam - + implementation_beamlattice, err := implementation.GetWrapperHandle(BeamLattice) - if err != nil { + if (err != nil) { return sBeamInfo, err } err = implementation.CallFunction(implementation.Lib3MF_beamlattice_getbeam, implementation_beamlattice.GetDLLInHandle(), UInt32InValue(nIndex), 0) - if err != nil { + if (err != nil) { return sBeamInfo, err } - + return sBeamInfo, err } func (implementation *Lib3MFImplementation) BeamLattice_AddBeam(BeamLattice Lib3MFHandle, sBeamInfo sLib3MFBeam) (uint32, error) { var err error = nil var nIndex uint32 = 0 - + implementation_beamlattice, err := implementation.GetWrapperHandle(BeamLattice) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_beamlattice_addbeam, implementation_beamlattice.GetDLLInHandle(), uintptr(unsafe.Pointer(&sBeamInfo)), UInt32OutValue(&nIndex)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nIndex), err } -func (implementation *Lib3MFImplementation) BeamLattice_SetBeam(BeamLattice Lib3MFHandle, nIndex uint32, sBeamInfo sLib3MFBeam) error { +func (implementation *Lib3MFImplementation) BeamLattice_SetBeam(BeamLattice Lib3MFHandle, nIndex uint32, sBeamInfo sLib3MFBeam) (error) { var err error = nil - + implementation_beamlattice, err := implementation.GetWrapperHandle(BeamLattice) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_beamlattice_setbeam, implementation_beamlattice.GetDLLInHandle(), UInt32InValue(nIndex), uintptr(unsafe.Pointer(&sBeamInfo))) - if err != nil { + if (err != nil) { return err } - + return err } -func (implementation *Lib3MFImplementation) BeamLattice_SetBeams(BeamLattice Lib3MFHandle, BeamInfo []sLib3MFBeam) error { +func (implementation *Lib3MFImplementation) BeamLattice_SetBeams(BeamLattice Lib3MFHandle, BeamInfo []sLib3MFBeam) (error) { var err error = nil - + implementation_beamlattice, err := implementation.GetWrapperHandle(BeamLattice) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_beamlattice_setbeams, implementation_beamlattice.GetDLLInHandle(), 0, 0) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) BeamLattice_GetBeams(BeamLattice Lib3MFHandle) ([]sLib3MFBeam, error) { var err error = nil arrayBeamInfo := make([]sLib3MFBeam, 0) - + implementation_beamlattice, err := implementation.GetWrapperHandle(BeamLattice) - if err != nil { + if (err != nil) { return make([]sLib3MFBeam, 0), err } err = implementation.CallFunction(implementation.Lib3MF_beamlattice_getbeams, implementation_beamlattice.GetDLLInHandle(), 0, 0, 0) - if err != nil { + if (err != nil) { return make([]sLib3MFBeam, 0), err } err = implementation.CallFunction(implementation.Lib3MF_beamlattice_getbeams, implementation_beamlattice.GetDLLInHandle(), 0, 0, 0) - if err != nil { + if (err != nil) { return make([]sLib3MFBeam, 0), err } - + return arrayBeamInfo, err } func (implementation *Lib3MFImplementation) BeamLattice_GetBallCount(BeamLattice Lib3MFHandle) (uint32, error) { var err error = nil var nCount uint32 = 0 - + implementation_beamlattice, err := implementation.GetWrapperHandle(BeamLattice) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_beamlattice_getballcount, implementation_beamlattice.GetDLLInHandle(), UInt32OutValue(&nCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nCount), err } func (implementation *Lib3MFImplementation) BeamLattice_GetBall(BeamLattice Lib3MFHandle, nIndex uint32) (sLib3MFBall, error) { var err error = nil var sBallInfo sLib3MFBall - + implementation_beamlattice, err := implementation.GetWrapperHandle(BeamLattice) - if err != nil { + if (err != nil) { return sBallInfo, err } err = implementation.CallFunction(implementation.Lib3MF_beamlattice_getball, implementation_beamlattice.GetDLLInHandle(), UInt32InValue(nIndex), 0) - if err != nil { + if (err != nil) { return sBallInfo, err } - + return sBallInfo, err } func (implementation *Lib3MFImplementation) BeamLattice_AddBall(BeamLattice Lib3MFHandle, sBallInfo sLib3MFBall) (uint32, error) { var err error = nil var nIndex uint32 = 0 - + implementation_beamlattice, err := implementation.GetWrapperHandle(BeamLattice) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_beamlattice_addball, implementation_beamlattice.GetDLLInHandle(), uintptr(unsafe.Pointer(&sBallInfo)), UInt32OutValue(&nIndex)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nIndex), err } -func (implementation *Lib3MFImplementation) BeamLattice_SetBall(BeamLattice Lib3MFHandle, nIndex uint32, sBallInfo sLib3MFBall) error { +func (implementation *Lib3MFImplementation) BeamLattice_SetBall(BeamLattice Lib3MFHandle, nIndex uint32, sBallInfo sLib3MFBall) (error) { var err error = nil - + implementation_beamlattice, err := implementation.GetWrapperHandle(BeamLattice) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_beamlattice_setball, implementation_beamlattice.GetDLLInHandle(), UInt32InValue(nIndex), uintptr(unsafe.Pointer(&sBallInfo))) - if err != nil { + if (err != nil) { return err } - + return err } -func (implementation *Lib3MFImplementation) BeamLattice_SetBalls(BeamLattice Lib3MFHandle, BallInfo []sLib3MFBall) error { +func (implementation *Lib3MFImplementation) BeamLattice_SetBalls(BeamLattice Lib3MFHandle, BallInfo []sLib3MFBall) (error) { var err error = nil - + implementation_beamlattice, err := implementation.GetWrapperHandle(BeamLattice) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_beamlattice_setballs, implementation_beamlattice.GetDLLInHandle(), 0, 0) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) BeamLattice_GetBalls(BeamLattice Lib3MFHandle) ([]sLib3MFBall, error) { var err error = nil arrayBallInfo := make([]sLib3MFBall, 0) - + implementation_beamlattice, err := implementation.GetWrapperHandle(BeamLattice) - if err != nil { + if (err != nil) { return make([]sLib3MFBall, 0), err } err = implementation.CallFunction(implementation.Lib3MF_beamlattice_getballs, implementation_beamlattice.GetDLLInHandle(), 0, 0, 0) - if err != nil { + if (err != nil) { return make([]sLib3MFBall, 0), err } err = implementation.CallFunction(implementation.Lib3MF_beamlattice_getballs, implementation_beamlattice.GetDLLInHandle(), 0, 0, 0) - if err != nil { + if (err != nil) { return make([]sLib3MFBall, 0), err } - + return arrayBallInfo, err } func (implementation *Lib3MFImplementation) BeamLattice_GetBeamSetCount(BeamLattice Lib3MFHandle) (uint32, error) { var err error = nil var nCount uint32 = 0 - + implementation_beamlattice, err := implementation.GetWrapperHandle(BeamLattice) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_beamlattice_getbeamsetcount, implementation_beamlattice.GetDLLInHandle(), UInt32OutValue(&nCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nCount), err } func (implementation *Lib3MFImplementation) BeamLattice_AddBeamSet(BeamLattice Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hBeamSet := implementation.NewHandle() - + implementation_beamlattice, err := implementation.GetWrapperHandle(BeamLattice) - if err != nil { + if (err != nil) { return hBeamSet, err } err = implementation.CallFunction(implementation.Lib3MF_beamlattice_addbeamset, implementation_beamlattice.GetDLLInHandle(), hBeamSet.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hBeamSet, err } - + return hBeamSet, err } func (implementation *Lib3MFImplementation) BeamLattice_GetBeamSet(BeamLattice Lib3MFHandle, nIndex uint32) (Lib3MFHandle, error) { var err error = nil hBeamSet := implementation.NewHandle() - + implementation_beamlattice, err := implementation.GetWrapperHandle(BeamLattice) - if err != nil { + if (err != nil) { return hBeamSet, err } err = implementation.CallFunction(implementation.Lib3MF_beamlattice_getbeamset, implementation_beamlattice.GetDLLInHandle(), UInt32InValue(nIndex), hBeamSet.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hBeamSet, err } - + return hBeamSet, err } func (implementation *Lib3MFImplementation) Component_GetObjectResource(Component Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hObjectResource := implementation.NewHandle() - + implementation_component, err := implementation.GetWrapperHandle(Component) - if err != nil { + if (err != nil) { return hObjectResource, err } err = implementation.CallFunction(implementation.Lib3MF_component_getobjectresource, implementation_component.GetDLLInHandle(), hObjectResource.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hObjectResource, err } - + return hObjectResource, err } func (implementation *Lib3MFImplementation) Component_GetObjectResourceID(Component Lib3MFHandle) (uint32, error) { var err error = nil var nUniqueResourceID uint32 = 0 - + implementation_component, err := implementation.GetWrapperHandle(Component) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_component_getobjectresourceid, implementation_component.GetDLLInHandle(), UInt32OutValue(&nUniqueResourceID)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nUniqueResourceID), err } @@ -4836,166 +5133,166 @@ func (implementation *Lib3MFImplementation) Component_GetUUID(Component Lib3MFHa var bHasUUID int64 = 0 var neededforUUID int64 = 0 var filledinUUID int64 = 0 - + implementation_component, err := implementation.GetWrapperHandle(Component) - if err != nil { + if (err != nil) { return false, "", err } err = implementation.CallFunction(implementation.Lib3MF_component_getuuid, implementation_component.GetDLLInHandle(), Int64OutValue(&bHasUUID), Int64InValue(0), Int64OutValue(&neededforUUID), Int64InValue(0)) - if err != nil { + if (err != nil) { return false, "", err } bufferSizeUUID := neededforUUID bufferUUID := make([]byte, bufferSizeUUID) err = implementation.CallFunction(implementation.Lib3MF_component_getuuid, implementation_component.GetDLLInHandle(), Int64OutValue(&bHasUUID), Int64InValue(bufferSizeUUID), Int64OutValue(&filledinUUID), uintptr(unsafe.Pointer(&bufferUUID[0]))) - if err != nil { + if (err != nil) { return false, "", err } - - return (bHasUUID != 0), string(bufferUUID[:(filledinUUID - 1)]), err + + return (bHasUUID != 0), string(bufferUUID[:(filledinUUID-1)]), err } -func (implementation *Lib3MFImplementation) Component_SetUUID(Component Lib3MFHandle, sUUID string) error { +func (implementation *Lib3MFImplementation) Component_SetUUID(Component Lib3MFHandle, sUUID string) (error) { var err error = nil - + implementation_component, err := implementation.GetWrapperHandle(Component) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_component_setuuid, implementation_component.GetDLLInHandle(), StringInValue(sUUID)) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Component_HasTransform(Component Lib3MFHandle) (bool, error) { var err error = nil var bHasTransform int64 = 0 - + implementation_component, err := implementation.GetWrapperHandle(Component) - if err != nil { + if (err != nil) { return false, err } err = implementation.CallFunction(implementation.Lib3MF_component_hastransform, implementation_component.GetDLLInHandle(), Int64OutValue(&bHasTransform)) - if err != nil { + if (err != nil) { return false, err } - + return (bHasTransform != 0), err } func (implementation *Lib3MFImplementation) Component_GetTransform(Component Lib3MFHandle) (sLib3MFTransform, error) { var err error = nil var sTransform sLib3MFTransform - + implementation_component, err := implementation.GetWrapperHandle(Component) - if err != nil { + if (err != nil) { return sTransform, err } err = implementation.CallFunction(implementation.Lib3MF_component_gettransform, implementation_component.GetDLLInHandle(), 0) - if err != nil { + if (err != nil) { return sTransform, err } - + return sTransform, err } -func (implementation *Lib3MFImplementation) Component_SetTransform(Component Lib3MFHandle, sTransform sLib3MFTransform) error { +func (implementation *Lib3MFImplementation) Component_SetTransform(Component Lib3MFHandle, sTransform sLib3MFTransform) (error) { var err error = nil - + implementation_component, err := implementation.GetWrapperHandle(Component) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_component_settransform, implementation_component.GetDLLInHandle(), uintptr(unsafe.Pointer(&sTransform))) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) ComponentsObject_AddComponent(ComponentsObject Lib3MFHandle, ObjectResource Lib3MFHandle, sTransform sLib3MFTransform) (Lib3MFHandle, error) { var err error = nil hComponentInstance := implementation.NewHandle() - + implementation_componentsobject, err := implementation.GetWrapperHandle(ComponentsObject) - if err != nil { + if (err != nil) { return hComponentInstance, err } implementation_objectresource, err := implementation.GetWrapperHandle(ObjectResource) - if err != nil { + if (err != nil) { return hComponentInstance, err } - + ObjectResourceDLLHandle := implementation_objectresource.GetDLLInHandle() - if ObjectResourceDLLHandle == 0 { + if (ObjectResourceDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return hComponentInstance, err } err = implementation.CallFunction(implementation.Lib3MF_componentsobject_addcomponent, implementation_componentsobject.GetDLLInHandle(), ObjectResourceDLLHandle, uintptr(unsafe.Pointer(&sTransform)), hComponentInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hComponentInstance, err } - + return hComponentInstance, err } func (implementation *Lib3MFImplementation) ComponentsObject_GetComponent(ComponentsObject Lib3MFHandle, nIndex uint32) (Lib3MFHandle, error) { var err error = nil hComponentInstance := implementation.NewHandle() - + implementation_componentsobject, err := implementation.GetWrapperHandle(ComponentsObject) - if err != nil { + if (err != nil) { return hComponentInstance, err } err = implementation.CallFunction(implementation.Lib3MF_componentsobject_getcomponent, implementation_componentsobject.GetDLLInHandle(), UInt32InValue(nIndex), hComponentInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hComponentInstance, err } - + return hComponentInstance, err } func (implementation *Lib3MFImplementation) ComponentsObject_GetComponentCount(ComponentsObject Lib3MFHandle) (uint32, error) { var err error = nil var nCount uint32 = 0 - + implementation_componentsobject, err := implementation.GetWrapperHandle(ComponentsObject) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_componentsobject_getcomponentcount, implementation_componentsobject.GetDLLInHandle(), UInt32OutValue(&nCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nCount), err } -func (implementation *Lib3MFImplementation) BeamSet_SetName(BeamSet Lib3MFHandle, sName string) error { +func (implementation *Lib3MFImplementation) BeamSet_SetName(BeamSet Lib3MFHandle, sName string) (error) { var err error = nil - + implementation_beamset, err := implementation.GetWrapperHandle(BeamSet) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_beamset_setname, implementation_beamset.GetDLLInHandle(), StringInValue(sName)) - if err != nil { + if (err != nil) { return err } - + return err } @@ -5003,39 +5300,39 @@ func (implementation *Lib3MFImplementation) BeamSet_GetName(BeamSet Lib3MFHandle var err error = nil var neededforName int64 = 0 var filledinName int64 = 0 - + implementation_beamset, err := implementation.GetWrapperHandle(BeamSet) - if err != nil { + if (err != nil) { return "", err } err = implementation.CallFunction(implementation.Lib3MF_beamset_getname, implementation_beamset.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforName), Int64InValue(0)) - if err != nil { + if (err != nil) { return "", err } bufferSizeName := neededforName bufferName := make([]byte, bufferSizeName) err = implementation.CallFunction(implementation.Lib3MF_beamset_getname, implementation_beamset.GetDLLInHandle(), Int64InValue(bufferSizeName), Int64OutValue(&filledinName), uintptr(unsafe.Pointer(&bufferName[0]))) - if err != nil { + if (err != nil) { return "", err } - - return string(bufferName[:(filledinName - 1)]), err + + return string(bufferName[:(filledinName-1)]), err } -func (implementation *Lib3MFImplementation) BeamSet_SetIdentifier(BeamSet Lib3MFHandle, sIdentifier string) error { +func (implementation *Lib3MFImplementation) BeamSet_SetIdentifier(BeamSet Lib3MFHandle, sIdentifier string) (error) { var err error = nil - + implementation_beamset, err := implementation.GetWrapperHandle(BeamSet) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_beamset_setidentifier, implementation_beamset.GetDLLInHandle(), StringInValue(sIdentifier)) - if err != nil { + if (err != nil) { return err } - + return err } @@ -5043,56 +5340,56 @@ func (implementation *Lib3MFImplementation) BeamSet_GetIdentifier(BeamSet Lib3MF var err error = nil var neededforIdentifier int64 = 0 var filledinIdentifier int64 = 0 - + implementation_beamset, err := implementation.GetWrapperHandle(BeamSet) - if err != nil { + if (err != nil) { return "", err } err = implementation.CallFunction(implementation.Lib3MF_beamset_getidentifier, implementation_beamset.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforIdentifier), Int64InValue(0)) - if err != nil { + if (err != nil) { return "", err } bufferSizeIdentifier := neededforIdentifier bufferIdentifier := make([]byte, bufferSizeIdentifier) err = implementation.CallFunction(implementation.Lib3MF_beamset_getidentifier, implementation_beamset.GetDLLInHandle(), Int64InValue(bufferSizeIdentifier), Int64OutValue(&filledinIdentifier), uintptr(unsafe.Pointer(&bufferIdentifier[0]))) - if err != nil { + if (err != nil) { return "", err } - - return string(bufferIdentifier[:(filledinIdentifier - 1)]), err + + return string(bufferIdentifier[:(filledinIdentifier-1)]), err } func (implementation *Lib3MFImplementation) BeamSet_GetReferenceCount(BeamSet Lib3MFHandle) (uint32, error) { var err error = nil var nCount uint32 = 0 - + implementation_beamset, err := implementation.GetWrapperHandle(BeamSet) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_beamset_getreferencecount, implementation_beamset.GetDLLInHandle(), UInt32OutValue(&nCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nCount), err } -func (implementation *Lib3MFImplementation) BeamSet_SetReferences(BeamSet Lib3MFHandle, References []uint32) error { +func (implementation *Lib3MFImplementation) BeamSet_SetReferences(BeamSet Lib3MFHandle, References []uint32) (error) { var err error = nil - + implementation_beamset, err := implementation.GetWrapperHandle(BeamSet) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_beamset_setreferences, implementation_beamset.GetDLLInHandle(), 0, 0) - if err != nil { + if (err != nil) { return err } - + return err } @@ -5101,56 +5398,56 @@ func (implementation *Lib3MFImplementation) BeamSet_GetReferences(BeamSet Lib3MF var neededforReferences int64 = 0 var filledinReferences int64 = 0 bufferReferences := make([]uint32, 0) - + implementation_beamset, err := implementation.GetWrapperHandle(BeamSet) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } err = implementation.CallFunction(implementation.Lib3MF_beamset_getreferences, implementation_beamset.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforReferences), Int64InValue(0)) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } bufferSizeReferences := neededforReferences bufferReferences = make([]uint32, bufferSizeReferences) err = implementation.CallFunction(implementation.Lib3MF_beamset_getreferences, implementation_beamset.GetDLLInHandle(), Int64InValue(bufferSizeReferences), Int64OutValue(&filledinReferences), uintptr(unsafe.Pointer(&bufferReferences[0]))) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } - + return bufferReferences, err } func (implementation *Lib3MFImplementation) BeamSet_GetBallReferenceCount(BeamSet Lib3MFHandle) (uint32, error) { var err error = nil var nCount uint32 = 0 - + implementation_beamset, err := implementation.GetWrapperHandle(BeamSet) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_beamset_getballreferencecount, implementation_beamset.GetDLLInHandle(), UInt32OutValue(&nCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nCount), err } -func (implementation *Lib3MFImplementation) BeamSet_SetBallReferences(BeamSet Lib3MFHandle, BallReferences []uint32) error { +func (implementation *Lib3MFImplementation) BeamSet_SetBallReferences(BeamSet Lib3MFHandle, BallReferences []uint32) (error) { var err error = nil - + implementation_beamset, err := implementation.GetWrapperHandle(BeamSet) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_beamset_setballreferences, implementation_beamset.GetDLLInHandle(), 0, 0) - if err != nil { + if (err != nil) { return err } - + return err } @@ -5159,40 +5456,40 @@ func (implementation *Lib3MFImplementation) BeamSet_GetBallReferences(BeamSet Li var neededforBallReferences int64 = 0 var filledinBallReferences int64 = 0 bufferBallReferences := make([]uint32, 0) - + implementation_beamset, err := implementation.GetWrapperHandle(BeamSet) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } err = implementation.CallFunction(implementation.Lib3MF_beamset_getballreferences, implementation_beamset.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforBallReferences), Int64InValue(0)) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } bufferSizeBallReferences := neededforBallReferences bufferBallReferences = make([]uint32, bufferSizeBallReferences) err = implementation.CallFunction(implementation.Lib3MF_beamset_getballreferences, implementation_beamset.GetDLLInHandle(), Int64InValue(bufferSizeBallReferences), Int64OutValue(&filledinBallReferences), uintptr(unsafe.Pointer(&bufferBallReferences[0]))) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } - + return bufferBallReferences, err } func (implementation *Lib3MFImplementation) BaseMaterialGroup_GetCount(BaseMaterialGroup Lib3MFHandle) (uint32, error) { var err error = nil var nCount uint32 = 0 - + implementation_basematerialgroup, err := implementation.GetWrapperHandle(BaseMaterialGroup) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_basematerialgroup_getcount, implementation_basematerialgroup.GetDLLInHandle(), UInt32OutValue(&nCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nCount), err } @@ -5201,56 +5498,56 @@ func (implementation *Lib3MFImplementation) BaseMaterialGroup_GetAllPropertyIDs( var neededforPropertyIDs int64 = 0 var filledinPropertyIDs int64 = 0 bufferPropertyIDs := make([]uint32, 0) - + implementation_basematerialgroup, err := implementation.GetWrapperHandle(BaseMaterialGroup) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } err = implementation.CallFunction(implementation.Lib3MF_basematerialgroup_getallpropertyids, implementation_basematerialgroup.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforPropertyIDs), Int64InValue(0)) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } bufferSizePropertyIDs := neededforPropertyIDs bufferPropertyIDs = make([]uint32, bufferSizePropertyIDs) err = implementation.CallFunction(implementation.Lib3MF_basematerialgroup_getallpropertyids, implementation_basematerialgroup.GetDLLInHandle(), Int64InValue(bufferSizePropertyIDs), Int64OutValue(&filledinPropertyIDs), uintptr(unsafe.Pointer(&bufferPropertyIDs[0]))) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } - + return bufferPropertyIDs, err } func (implementation *Lib3MFImplementation) BaseMaterialGroup_AddMaterial(BaseMaterialGroup Lib3MFHandle, sName string, sDisplayColor sLib3MFColor) (uint32, error) { var err error = nil var nPropertyID uint32 = 0 - + implementation_basematerialgroup, err := implementation.GetWrapperHandle(BaseMaterialGroup) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_basematerialgroup_addmaterial, implementation_basematerialgroup.GetDLLInHandle(), StringInValue(sName), uintptr(unsafe.Pointer(&sDisplayColor)), UInt32OutValue(&nPropertyID)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nPropertyID), err } -func (implementation *Lib3MFImplementation) BaseMaterialGroup_RemoveMaterial(BaseMaterialGroup Lib3MFHandle, nPropertyID uint32) error { +func (implementation *Lib3MFImplementation) BaseMaterialGroup_RemoveMaterial(BaseMaterialGroup Lib3MFHandle, nPropertyID uint32) (error) { var err error = nil - + implementation_basematerialgroup, err := implementation.GetWrapperHandle(BaseMaterialGroup) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_basematerialgroup_removematerial, implementation_basematerialgroup.GetDLLInHandle(), UInt32InValue(nPropertyID)) - if err != nil { + if (err != nil) { return err } - + return err } @@ -5258,89 +5555,89 @@ func (implementation *Lib3MFImplementation) BaseMaterialGroup_GetName(BaseMateri var err error = nil var neededforName int64 = 0 var filledinName int64 = 0 - + implementation_basematerialgroup, err := implementation.GetWrapperHandle(BaseMaterialGroup) - if err != nil { + if (err != nil) { return "", err } err = implementation.CallFunction(implementation.Lib3MF_basematerialgroup_getname, implementation_basematerialgroup.GetDLLInHandle(), UInt32InValue(nPropertyID), Int64InValue(0), Int64OutValue(&neededforName), Int64InValue(0)) - if err != nil { + if (err != nil) { return "", err } bufferSizeName := neededforName bufferName := make([]byte, bufferSizeName) err = implementation.CallFunction(implementation.Lib3MF_basematerialgroup_getname, implementation_basematerialgroup.GetDLLInHandle(), UInt32InValue(nPropertyID), Int64InValue(bufferSizeName), Int64OutValue(&filledinName), uintptr(unsafe.Pointer(&bufferName[0]))) - if err != nil { + if (err != nil) { return "", err } - - return string(bufferName[:(filledinName - 1)]), err + + return string(bufferName[:(filledinName-1)]), err } -func (implementation *Lib3MFImplementation) BaseMaterialGroup_SetName(BaseMaterialGroup Lib3MFHandle, nPropertyID uint32, sName string) error { +func (implementation *Lib3MFImplementation) BaseMaterialGroup_SetName(BaseMaterialGroup Lib3MFHandle, nPropertyID uint32, sName string) (error) { var err error = nil - + implementation_basematerialgroup, err := implementation.GetWrapperHandle(BaseMaterialGroup) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_basematerialgroup_setname, implementation_basematerialgroup.GetDLLInHandle(), UInt32InValue(nPropertyID), StringInValue(sName)) - if err != nil { + if (err != nil) { return err } - + return err } -func (implementation *Lib3MFImplementation) BaseMaterialGroup_SetDisplayColor(BaseMaterialGroup Lib3MFHandle, nPropertyID uint32, sTheColor sLib3MFColor) error { +func (implementation *Lib3MFImplementation) BaseMaterialGroup_SetDisplayColor(BaseMaterialGroup Lib3MFHandle, nPropertyID uint32, sTheColor sLib3MFColor) (error) { var err error = nil - + implementation_basematerialgroup, err := implementation.GetWrapperHandle(BaseMaterialGroup) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_basematerialgroup_setdisplaycolor, implementation_basematerialgroup.GetDLLInHandle(), UInt32InValue(nPropertyID), uintptr(unsafe.Pointer(&sTheColor))) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) BaseMaterialGroup_GetDisplayColor(BaseMaterialGroup Lib3MFHandle, nPropertyID uint32) (sLib3MFColor, error) { var err error = nil var sTheColor sLib3MFColor - + implementation_basematerialgroup, err := implementation.GetWrapperHandle(BaseMaterialGroup) - if err != nil { + if (err != nil) { return sTheColor, err } err = implementation.CallFunction(implementation.Lib3MF_basematerialgroup_getdisplaycolor, implementation_basematerialgroup.GetDLLInHandle(), UInt32InValue(nPropertyID), 0) - if err != nil { + if (err != nil) { return sTheColor, err } - + return sTheColor, err } func (implementation *Lib3MFImplementation) ColorGroup_GetCount(ColorGroup Lib3MFHandle) (uint32, error) { var err error = nil var nCount uint32 = 0 - + implementation_colorgroup, err := implementation.GetWrapperHandle(ColorGroup) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_colorgroup_getcount, implementation_colorgroup.GetDLLInHandle(), UInt32OutValue(&nCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nCount), err } @@ -5349,106 +5646,106 @@ func (implementation *Lib3MFImplementation) ColorGroup_GetAllPropertyIDs(ColorGr var neededforPropertyIDs int64 = 0 var filledinPropertyIDs int64 = 0 bufferPropertyIDs := make([]uint32, 0) - + implementation_colorgroup, err := implementation.GetWrapperHandle(ColorGroup) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } err = implementation.CallFunction(implementation.Lib3MF_colorgroup_getallpropertyids, implementation_colorgroup.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforPropertyIDs), Int64InValue(0)) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } bufferSizePropertyIDs := neededforPropertyIDs bufferPropertyIDs = make([]uint32, bufferSizePropertyIDs) err = implementation.CallFunction(implementation.Lib3MF_colorgroup_getallpropertyids, implementation_colorgroup.GetDLLInHandle(), Int64InValue(bufferSizePropertyIDs), Int64OutValue(&filledinPropertyIDs), uintptr(unsafe.Pointer(&bufferPropertyIDs[0]))) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } - + return bufferPropertyIDs, err } func (implementation *Lib3MFImplementation) ColorGroup_AddColor(ColorGroup Lib3MFHandle, sTheColor sLib3MFColor) (uint32, error) { var err error = nil var nPropertyID uint32 = 0 - + implementation_colorgroup, err := implementation.GetWrapperHandle(ColorGroup) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_colorgroup_addcolor, implementation_colorgroup.GetDLLInHandle(), uintptr(unsafe.Pointer(&sTheColor)), UInt32OutValue(&nPropertyID)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nPropertyID), err } -func (implementation *Lib3MFImplementation) ColorGroup_RemoveColor(ColorGroup Lib3MFHandle, nPropertyID uint32) error { +func (implementation *Lib3MFImplementation) ColorGroup_RemoveColor(ColorGroup Lib3MFHandle, nPropertyID uint32) (error) { var err error = nil - + implementation_colorgroup, err := implementation.GetWrapperHandle(ColorGroup) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_colorgroup_removecolor, implementation_colorgroup.GetDLLInHandle(), UInt32InValue(nPropertyID)) - if err != nil { + if (err != nil) { return err } - + return err } -func (implementation *Lib3MFImplementation) ColorGroup_SetColor(ColorGroup Lib3MFHandle, nPropertyID uint32, sTheColor sLib3MFColor) error { +func (implementation *Lib3MFImplementation) ColorGroup_SetColor(ColorGroup Lib3MFHandle, nPropertyID uint32, sTheColor sLib3MFColor) (error) { var err error = nil - + implementation_colorgroup, err := implementation.GetWrapperHandle(ColorGroup) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_colorgroup_setcolor, implementation_colorgroup.GetDLLInHandle(), UInt32InValue(nPropertyID), uintptr(unsafe.Pointer(&sTheColor))) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) ColorGroup_GetColor(ColorGroup Lib3MFHandle, nPropertyID uint32) (sLib3MFColor, error) { var err error = nil var sTheColor sLib3MFColor - + implementation_colorgroup, err := implementation.GetWrapperHandle(ColorGroup) - if err != nil { + if (err != nil) { return sTheColor, err } err = implementation.CallFunction(implementation.Lib3MF_colorgroup_getcolor, implementation_colorgroup.GetDLLInHandle(), UInt32InValue(nPropertyID), 0) - if err != nil { + if (err != nil) { return sTheColor, err } - + return sTheColor, err } func (implementation *Lib3MFImplementation) Texture2DGroup_GetCount(Texture2DGroup Lib3MFHandle) (uint32, error) { var err error = nil var nCount uint32 = 0 - + implementation_texture2dgroup, err := implementation.GetWrapperHandle(Texture2DGroup) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_texture2dgroup_getcount, implementation_texture2dgroup.GetDLLInHandle(), UInt32OutValue(&nCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nCount), err } @@ -5457,107 +5754,107 @@ func (implementation *Lib3MFImplementation) Texture2DGroup_GetAllPropertyIDs(Tex var neededforPropertyIDs int64 = 0 var filledinPropertyIDs int64 = 0 bufferPropertyIDs := make([]uint32, 0) - + implementation_texture2dgroup, err := implementation.GetWrapperHandle(Texture2DGroup) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } err = implementation.CallFunction(implementation.Lib3MF_texture2dgroup_getallpropertyids, implementation_texture2dgroup.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforPropertyIDs), Int64InValue(0)) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } bufferSizePropertyIDs := neededforPropertyIDs bufferPropertyIDs = make([]uint32, bufferSizePropertyIDs) err = implementation.CallFunction(implementation.Lib3MF_texture2dgroup_getallpropertyids, implementation_texture2dgroup.GetDLLInHandle(), Int64InValue(bufferSizePropertyIDs), Int64OutValue(&filledinPropertyIDs), uintptr(unsafe.Pointer(&bufferPropertyIDs[0]))) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } - + return bufferPropertyIDs, err } func (implementation *Lib3MFImplementation) Texture2DGroup_AddTex2Coord(Texture2DGroup Lib3MFHandle, sUVCoordinate sLib3MFTex2Coord) (uint32, error) { var err error = nil var nPropertyID uint32 = 0 - + implementation_texture2dgroup, err := implementation.GetWrapperHandle(Texture2DGroup) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_texture2dgroup_addtex2coord, implementation_texture2dgroup.GetDLLInHandle(), uintptr(unsafe.Pointer(&sUVCoordinate)), UInt32OutValue(&nPropertyID)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nPropertyID), err } func (implementation *Lib3MFImplementation) Texture2DGroup_GetTex2Coord(Texture2DGroup Lib3MFHandle, nPropertyID uint32) (sLib3MFTex2Coord, error) { var err error = nil var sUVCoordinate sLib3MFTex2Coord - + implementation_texture2dgroup, err := implementation.GetWrapperHandle(Texture2DGroup) - if err != nil { + if (err != nil) { return sUVCoordinate, err } err = implementation.CallFunction(implementation.Lib3MF_texture2dgroup_gettex2coord, implementation_texture2dgroup.GetDLLInHandle(), UInt32InValue(nPropertyID), 0) - if err != nil { + if (err != nil) { return sUVCoordinate, err } - + return sUVCoordinate, err } -func (implementation *Lib3MFImplementation) Texture2DGroup_RemoveTex2Coord(Texture2DGroup Lib3MFHandle, nPropertyID uint32) error { +func (implementation *Lib3MFImplementation) Texture2DGroup_RemoveTex2Coord(Texture2DGroup Lib3MFHandle, nPropertyID uint32) (error) { var err error = nil - + implementation_texture2dgroup, err := implementation.GetWrapperHandle(Texture2DGroup) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_texture2dgroup_removetex2coord, implementation_texture2dgroup.GetDLLInHandle(), UInt32InValue(nPropertyID)) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Texture2DGroup_GetTexture2D(Texture2DGroup Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hTexture2DInstance := implementation.NewHandle() - + implementation_texture2dgroup, err := implementation.GetWrapperHandle(Texture2DGroup) - if err != nil { + if (err != nil) { return hTexture2DInstance, err } err = implementation.CallFunction(implementation.Lib3MF_texture2dgroup_gettexture2d, implementation_texture2dgroup.GetDLLInHandle(), hTexture2DInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hTexture2DInstance, err } - + return hTexture2DInstance, err } func (implementation *Lib3MFImplementation) CompositeMaterials_GetCount(CompositeMaterials Lib3MFHandle) (uint32, error) { var err error = nil var nCount uint32 = 0 - + implementation_compositematerials, err := implementation.GetWrapperHandle(CompositeMaterials) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_compositematerials_getcount, implementation_compositematerials.GetDLLInHandle(), UInt32OutValue(&nCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nCount), err } @@ -5566,111 +5863,111 @@ func (implementation *Lib3MFImplementation) CompositeMaterials_GetAllPropertyIDs var neededforPropertyIDs int64 = 0 var filledinPropertyIDs int64 = 0 bufferPropertyIDs := make([]uint32, 0) - + implementation_compositematerials, err := implementation.GetWrapperHandle(CompositeMaterials) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } err = implementation.CallFunction(implementation.Lib3MF_compositematerials_getallpropertyids, implementation_compositematerials.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforPropertyIDs), Int64InValue(0)) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } bufferSizePropertyIDs := neededforPropertyIDs bufferPropertyIDs = make([]uint32, bufferSizePropertyIDs) err = implementation.CallFunction(implementation.Lib3MF_compositematerials_getallpropertyids, implementation_compositematerials.GetDLLInHandle(), Int64InValue(bufferSizePropertyIDs), Int64OutValue(&filledinPropertyIDs), uintptr(unsafe.Pointer(&bufferPropertyIDs[0]))) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } - + return bufferPropertyIDs, err } func (implementation *Lib3MFImplementation) CompositeMaterials_GetBaseMaterialGroup(CompositeMaterials Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hBaseMaterialGroupInstance := implementation.NewHandle() - + implementation_compositematerials, err := implementation.GetWrapperHandle(CompositeMaterials) - if err != nil { + if (err != nil) { return hBaseMaterialGroupInstance, err } err = implementation.CallFunction(implementation.Lib3MF_compositematerials_getbasematerialgroup, implementation_compositematerials.GetDLLInHandle(), hBaseMaterialGroupInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hBaseMaterialGroupInstance, err } - + return hBaseMaterialGroupInstance, err } func (implementation *Lib3MFImplementation) CompositeMaterials_AddComposite(CompositeMaterials Lib3MFHandle, Composite []sLib3MFCompositeConstituent) (uint32, error) { var err error = nil var nPropertyID uint32 = 0 - + implementation_compositematerials, err := implementation.GetWrapperHandle(CompositeMaterials) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_compositematerials_addcomposite, implementation_compositematerials.GetDLLInHandle(), 0, 0, UInt32OutValue(&nPropertyID)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nPropertyID), err } -func (implementation *Lib3MFImplementation) CompositeMaterials_RemoveComposite(CompositeMaterials Lib3MFHandle, nPropertyID uint32) error { +func (implementation *Lib3MFImplementation) CompositeMaterials_RemoveComposite(CompositeMaterials Lib3MFHandle, nPropertyID uint32) (error) { var err error = nil - + implementation_compositematerials, err := implementation.GetWrapperHandle(CompositeMaterials) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_compositematerials_removecomposite, implementation_compositematerials.GetDLLInHandle(), UInt32InValue(nPropertyID)) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) CompositeMaterials_GetComposite(CompositeMaterials Lib3MFHandle, nPropertyID uint32) ([]sLib3MFCompositeConstituent, error) { var err error = nil arrayComposite := make([]sLib3MFCompositeConstituent, 0) - + implementation_compositematerials, err := implementation.GetWrapperHandle(CompositeMaterials) - if err != nil { + if (err != nil) { return make([]sLib3MFCompositeConstituent, 0), err } err = implementation.CallFunction(implementation.Lib3MF_compositematerials_getcomposite, implementation_compositematerials.GetDLLInHandle(), UInt32InValue(nPropertyID), 0, 0, 0) - if err != nil { + if (err != nil) { return make([]sLib3MFCompositeConstituent, 0), err } err = implementation.CallFunction(implementation.Lib3MF_compositematerials_getcomposite, implementation_compositematerials.GetDLLInHandle(), UInt32InValue(nPropertyID), 0, 0, 0) - if err != nil { + if (err != nil) { return make([]sLib3MFCompositeConstituent, 0), err } - + return arrayComposite, err } func (implementation *Lib3MFImplementation) MultiPropertyGroup_GetCount(MultiPropertyGroup Lib3MFHandle) (uint32, error) { var err error = nil var nCount uint32 = 0 - + implementation_multipropertygroup, err := implementation.GetWrapperHandle(MultiPropertyGroup) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_multipropertygroup_getcount, implementation_multipropertygroup.GetDLLInHandle(), UInt32OutValue(&nCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nCount), err } @@ -5679,56 +5976,56 @@ func (implementation *Lib3MFImplementation) MultiPropertyGroup_GetAllPropertyIDs var neededforPropertyIDs int64 = 0 var filledinPropertyIDs int64 = 0 bufferPropertyIDs := make([]uint32, 0) - + implementation_multipropertygroup, err := implementation.GetWrapperHandle(MultiPropertyGroup) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } err = implementation.CallFunction(implementation.Lib3MF_multipropertygroup_getallpropertyids, implementation_multipropertygroup.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforPropertyIDs), Int64InValue(0)) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } bufferSizePropertyIDs := neededforPropertyIDs bufferPropertyIDs = make([]uint32, bufferSizePropertyIDs) err = implementation.CallFunction(implementation.Lib3MF_multipropertygroup_getallpropertyids, implementation_multipropertygroup.GetDLLInHandle(), Int64InValue(bufferSizePropertyIDs), Int64OutValue(&filledinPropertyIDs), uintptr(unsafe.Pointer(&bufferPropertyIDs[0]))) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } - + return bufferPropertyIDs, err } func (implementation *Lib3MFImplementation) MultiPropertyGroup_AddMultiProperty(MultiPropertyGroup Lib3MFHandle, PropertyIDs []uint32) (uint32, error) { var err error = nil var nPropertyID uint32 = 0 - + implementation_multipropertygroup, err := implementation.GetWrapperHandle(MultiPropertyGroup) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_multipropertygroup_addmultiproperty, implementation_multipropertygroup.GetDLLInHandle(), 0, 0, UInt32OutValue(&nPropertyID)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nPropertyID), err } -func (implementation *Lib3MFImplementation) MultiPropertyGroup_SetMultiProperty(MultiPropertyGroup Lib3MFHandle, nPropertyID uint32, PropertyIDs []uint32) error { +func (implementation *Lib3MFImplementation) MultiPropertyGroup_SetMultiProperty(MultiPropertyGroup Lib3MFHandle, nPropertyID uint32, PropertyIDs []uint32) (error) { var err error = nil - + implementation_multipropertygroup, err := implementation.GetWrapperHandle(MultiPropertyGroup) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_multipropertygroup_setmultiproperty, implementation_multipropertygroup.GetDLLInHandle(), UInt32InValue(nPropertyID), 0, 0) - if err != nil { + if (err != nil) { return err } - + return err } @@ -5737,106 +6034,106 @@ func (implementation *Lib3MFImplementation) MultiPropertyGroup_GetMultiProperty( var neededforPropertyIDs int64 = 0 var filledinPropertyIDs int64 = 0 bufferPropertyIDs := make([]uint32, 0) - + implementation_multipropertygroup, err := implementation.GetWrapperHandle(MultiPropertyGroup) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } err = implementation.CallFunction(implementation.Lib3MF_multipropertygroup_getmultiproperty, implementation_multipropertygroup.GetDLLInHandle(), UInt32InValue(nPropertyID), Int64InValue(0), Int64OutValue(&neededforPropertyIDs), Int64InValue(0)) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } bufferSizePropertyIDs := neededforPropertyIDs bufferPropertyIDs = make([]uint32, bufferSizePropertyIDs) err = implementation.CallFunction(implementation.Lib3MF_multipropertygroup_getmultiproperty, implementation_multipropertygroup.GetDLLInHandle(), UInt32InValue(nPropertyID), Int64InValue(bufferSizePropertyIDs), Int64OutValue(&filledinPropertyIDs), uintptr(unsafe.Pointer(&bufferPropertyIDs[0]))) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } - + return bufferPropertyIDs, err } -func (implementation *Lib3MFImplementation) MultiPropertyGroup_RemoveMultiProperty(MultiPropertyGroup Lib3MFHandle, nPropertyID uint32) error { +func (implementation *Lib3MFImplementation) MultiPropertyGroup_RemoveMultiProperty(MultiPropertyGroup Lib3MFHandle, nPropertyID uint32) (error) { var err error = nil - + implementation_multipropertygroup, err := implementation.GetWrapperHandle(MultiPropertyGroup) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_multipropertygroup_removemultiproperty, implementation_multipropertygroup.GetDLLInHandle(), UInt32InValue(nPropertyID)) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) MultiPropertyGroup_GetLayerCount(MultiPropertyGroup Lib3MFHandle) (uint32, error) { var err error = nil var nCount uint32 = 0 - + implementation_multipropertygroup, err := implementation.GetWrapperHandle(MultiPropertyGroup) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_multipropertygroup_getlayercount, implementation_multipropertygroup.GetDLLInHandle(), UInt32OutValue(&nCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nCount), err } func (implementation *Lib3MFImplementation) MultiPropertyGroup_AddLayer(MultiPropertyGroup Lib3MFHandle, sTheLayer sLib3MFMultiPropertyLayer) (uint32, error) { var err error = nil var nLayerIndex uint32 = 0 - + implementation_multipropertygroup, err := implementation.GetWrapperHandle(MultiPropertyGroup) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_multipropertygroup_addlayer, implementation_multipropertygroup.GetDLLInHandle(), uintptr(unsafe.Pointer(&sTheLayer)), UInt32OutValue(&nLayerIndex)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nLayerIndex), err } func (implementation *Lib3MFImplementation) MultiPropertyGroup_GetLayer(MultiPropertyGroup Lib3MFHandle, nLayerIndex uint32) (sLib3MFMultiPropertyLayer, error) { var err error = nil var sTheLayer sLib3MFMultiPropertyLayer - + implementation_multipropertygroup, err := implementation.GetWrapperHandle(MultiPropertyGroup) - if err != nil { + if (err != nil) { return sTheLayer, err } err = implementation.CallFunction(implementation.Lib3MF_multipropertygroup_getlayer, implementation_multipropertygroup.GetDLLInHandle(), UInt32InValue(nLayerIndex), 0) - if err != nil { + if (err != nil) { return sTheLayer, err } - + return sTheLayer, err } -func (implementation *Lib3MFImplementation) MultiPropertyGroup_RemoveLayer(MultiPropertyGroup Lib3MFHandle, nLayerIndex uint32) error { +func (implementation *Lib3MFImplementation) MultiPropertyGroup_RemoveLayer(MultiPropertyGroup Lib3MFHandle, nLayerIndex uint32) (error) { var err error = nil - + implementation_multipropertygroup, err := implementation.GetWrapperHandle(MultiPropertyGroup) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_multipropertygroup_removelayer, implementation_multipropertygroup.GetDLLInHandle(), UInt32InValue(nLayerIndex)) - if err != nil { + if (err != nil) { return err } - + return err } @@ -5844,56 +6141,56 @@ func (implementation *Lib3MFImplementation) Attachment_GetPath(Attachment Lib3MF var err error = nil var neededforPath int64 = 0 var filledinPath int64 = 0 - + implementation_attachment, err := implementation.GetWrapperHandle(Attachment) - if err != nil { + if (err != nil) { return "", err } err = implementation.CallFunction(implementation.Lib3MF_attachment_getpath, implementation_attachment.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforPath), Int64InValue(0)) - if err != nil { + if (err != nil) { return "", err } bufferSizePath := neededforPath bufferPath := make([]byte, bufferSizePath) err = implementation.CallFunction(implementation.Lib3MF_attachment_getpath, implementation_attachment.GetDLLInHandle(), Int64InValue(bufferSizePath), Int64OutValue(&filledinPath), uintptr(unsafe.Pointer(&bufferPath[0]))) - if err != nil { + if (err != nil) { return "", err } - - return string(bufferPath[:(filledinPath - 1)]), err + + return string(bufferPath[:(filledinPath-1)]), err } -func (implementation *Lib3MFImplementation) Attachment_SetPath(Attachment Lib3MFHandle, sPath string) error { +func (implementation *Lib3MFImplementation) Attachment_SetPath(Attachment Lib3MFHandle, sPath string) (error) { var err error = nil - + implementation_attachment, err := implementation.GetWrapperHandle(Attachment) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_attachment_setpath, implementation_attachment.GetDLLInHandle(), StringInValue(sPath)) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Attachment_PackagePart(Attachment Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hPackagePart := implementation.NewHandle() - + implementation_attachment, err := implementation.GetWrapperHandle(Attachment) - if err != nil { + if (err != nil) { return hPackagePart, err } err = implementation.CallFunction(implementation.Lib3MF_attachment_packagepart, implementation_attachment.GetDLLInHandle(), hPackagePart.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hPackagePart, err } - + return hPackagePart, err } @@ -5901,104 +6198,104 @@ func (implementation *Lib3MFImplementation) Attachment_GetRelationShipType(Attac var err error = nil var neededforPath int64 = 0 var filledinPath int64 = 0 - + implementation_attachment, err := implementation.GetWrapperHandle(Attachment) - if err != nil { + if (err != nil) { return "", err } err = implementation.CallFunction(implementation.Lib3MF_attachment_getrelationshiptype, implementation_attachment.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforPath), Int64InValue(0)) - if err != nil { + if (err != nil) { return "", err } bufferSizePath := neededforPath bufferPath := make([]byte, bufferSizePath) err = implementation.CallFunction(implementation.Lib3MF_attachment_getrelationshiptype, implementation_attachment.GetDLLInHandle(), Int64InValue(bufferSizePath), Int64OutValue(&filledinPath), uintptr(unsafe.Pointer(&bufferPath[0]))) - if err != nil { + if (err != nil) { return "", err } - - return string(bufferPath[:(filledinPath - 1)]), err + + return string(bufferPath[:(filledinPath-1)]), err } -func (implementation *Lib3MFImplementation) Attachment_SetRelationShipType(Attachment Lib3MFHandle, sPath string) error { +func (implementation *Lib3MFImplementation) Attachment_SetRelationShipType(Attachment Lib3MFHandle, sPath string) (error) { var err error = nil - + implementation_attachment, err := implementation.GetWrapperHandle(Attachment) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_attachment_setrelationshiptype, implementation_attachment.GetDLLInHandle(), StringInValue(sPath)) - if err != nil { + if (err != nil) { return err } - + return err } -func (implementation *Lib3MFImplementation) Attachment_WriteToFile(Attachment Lib3MFHandle, sFileName string) error { +func (implementation *Lib3MFImplementation) Attachment_WriteToFile(Attachment Lib3MFHandle, sFileName string) (error) { var err error = nil - + implementation_attachment, err := implementation.GetWrapperHandle(Attachment) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_attachment_writetofile, implementation_attachment.GetDLLInHandle(), StringInValue(sFileName)) - if err != nil { + if (err != nil) { return err } - + return err } -func (implementation *Lib3MFImplementation) Attachment_ReadFromFile(Attachment Lib3MFHandle, sFileName string) error { +func (implementation *Lib3MFImplementation) Attachment_ReadFromFile(Attachment Lib3MFHandle, sFileName string) (error) { var err error = nil - + implementation_attachment, err := implementation.GetWrapperHandle(Attachment) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_attachment_readfromfile, implementation_attachment.GetDLLInHandle(), StringInValue(sFileName)) - if err != nil { + if (err != nil) { return err } - + return err } -func (implementation *Lib3MFImplementation) Attachment_ReadFromCallback(Attachment Lib3MFHandle, pTheReadCallback int64, nStreamSize uint64, pTheSeekCallback int64, nUserData uint64) error { +func (implementation *Lib3MFImplementation) Attachment_ReadFromCallback(Attachment Lib3MFHandle, pTheReadCallback int64, nStreamSize uint64, pTheSeekCallback int64, nUserData uint64) (error) { var err error = nil - + implementation_attachment, err := implementation.GetWrapperHandle(Attachment) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_attachment_readfromcallback, implementation_attachment.GetDLLInHandle(), 0, UInt64InValue(nStreamSize), 0, UInt64InValue(nUserData)) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Attachment_GetStreamSize(Attachment Lib3MFHandle) (uint64, error) { var err error = nil var nStreamSize uint64 = 0 - + implementation_attachment, err := implementation.GetWrapperHandle(Attachment) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_attachment_getstreamsize, implementation_attachment.GetDLLInHandle(), UInt64OutValue(&nStreamSize)) - if err != nil { + if (err != nil) { return 0, err } - + return uint64(nStreamSize), err } @@ -6007,115 +6304,115 @@ func (implementation *Lib3MFImplementation) Attachment_WriteToBuffer(Attachment var neededforBuffer int64 = 0 var filledinBuffer int64 = 0 bufferBuffer := make([]uint8, 0) - + implementation_attachment, err := implementation.GetWrapperHandle(Attachment) - if err != nil { + if (err != nil) { return make([]uint8, 0), err } err = implementation.CallFunction(implementation.Lib3MF_attachment_writetobuffer, implementation_attachment.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforBuffer), Int64InValue(0)) - if err != nil { + if (err != nil) { return make([]uint8, 0), err } bufferSizeBuffer := neededforBuffer bufferBuffer = make([]uint8, bufferSizeBuffer) err = implementation.CallFunction(implementation.Lib3MF_attachment_writetobuffer, implementation_attachment.GetDLLInHandle(), Int64InValue(bufferSizeBuffer), Int64OutValue(&filledinBuffer), uintptr(unsafe.Pointer(&bufferBuffer[0]))) - if err != nil { + if (err != nil) { return make([]uint8, 0), err } - + return bufferBuffer, err } -func (implementation *Lib3MFImplementation) Attachment_ReadFromBuffer(Attachment Lib3MFHandle, Buffer []uint8) error { +func (implementation *Lib3MFImplementation) Attachment_ReadFromBuffer(Attachment Lib3MFHandle, Buffer []uint8) (error) { var err error = nil - + implementation_attachment, err := implementation.GetWrapperHandle(Attachment) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_attachment_readfrombuffer, implementation_attachment.GetDLLInHandle(), 0, 0) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Texture2D_GetAttachment(Texture2D Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hAttachment := implementation.NewHandle() - + implementation_texture2d, err := implementation.GetWrapperHandle(Texture2D) - if err != nil { + if (err != nil) { return hAttachment, err } err = implementation.CallFunction(implementation.Lib3MF_texture2d_getattachment, implementation_texture2d.GetDLLInHandle(), hAttachment.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hAttachment, err } - + return hAttachment, err } -func (implementation *Lib3MFImplementation) Texture2D_SetAttachment(Texture2D Lib3MFHandle, Attachment Lib3MFHandle) error { +func (implementation *Lib3MFImplementation) Texture2D_SetAttachment(Texture2D Lib3MFHandle, Attachment Lib3MFHandle) (error) { var err error = nil - + implementation_texture2d, err := implementation.GetWrapperHandle(Texture2D) - if err != nil { + if (err != nil) { return err } implementation_attachment, err := implementation.GetWrapperHandle(Attachment) - if err != nil { + if (err != nil) { return err } - + AttachmentDLLHandle := implementation_attachment.GetDLLInHandle() - if AttachmentDLLHandle == 0 { + if (AttachmentDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return err } err = implementation.CallFunction(implementation.Lib3MF_texture2d_setattachment, implementation_texture2d.GetDLLInHandle(), AttachmentDLLHandle) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Texture2D_GetContentType(Texture2D Lib3MFHandle) (ELib3MFTextureType, error) { var err error = nil var eContentType uint64 = 0 - + implementation_texture2d, err := implementation.GetWrapperHandle(Texture2D) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_texture2d_getcontenttype, implementation_texture2d.GetDLLInHandle(), UInt64OutValue(&eContentType)) - if err != nil { + if (err != nil) { return 0, err } - - return ELib3MFTextureType(eContentType), err + + return ELib3MFTextureType (eContentType), err } -func (implementation *Lib3MFImplementation) Texture2D_SetContentType(Texture2D Lib3MFHandle, eContentType ELib3MFTextureType) error { +func (implementation *Lib3MFImplementation) Texture2D_SetContentType(Texture2D Lib3MFHandle, eContentType ELib3MFTextureType) (error) { var err error = nil - + implementation_texture2d, err := implementation.GetWrapperHandle(Texture2D) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_texture2d_setcontenttype, implementation_texture2d.GetDLLInHandle(), uintptr(eContentType)) - if err != nil { + if (err != nil) { return err } - + return err } @@ -6123,83 +6420,83 @@ func (implementation *Lib3MFImplementation) Texture2D_GetTileStyleUV(Texture2D L var err error = nil var eTileStyleU uint64 = 0 var eTileStyleV uint64 = 0 - + implementation_texture2d, err := implementation.GetWrapperHandle(Texture2D) - if err != nil { + if (err != nil) { return 0, 0, err } err = implementation.CallFunction(implementation.Lib3MF_texture2d_gettilestyleuv, implementation_texture2d.GetDLLInHandle(), UInt64OutValue(&eTileStyleU), UInt64OutValue(&eTileStyleV)) - if err != nil { + if (err != nil) { return 0, 0, err } - - return ELib3MFTextureTileStyle(eTileStyleU), ELib3MFTextureTileStyle(eTileStyleV), err + + return ELib3MFTextureTileStyle (eTileStyleU), ELib3MFTextureTileStyle (eTileStyleV), err } -func (implementation *Lib3MFImplementation) Texture2D_SetTileStyleUV(Texture2D Lib3MFHandle, eTileStyleU ELib3MFTextureTileStyle, eTileStyleV ELib3MFTextureTileStyle) error { +func (implementation *Lib3MFImplementation) Texture2D_SetTileStyleUV(Texture2D Lib3MFHandle, eTileStyleU ELib3MFTextureTileStyle, eTileStyleV ELib3MFTextureTileStyle) (error) { var err error = nil - + implementation_texture2d, err := implementation.GetWrapperHandle(Texture2D) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_texture2d_settilestyleuv, implementation_texture2d.GetDLLInHandle(), uintptr(eTileStyleU), uintptr(eTileStyleV)) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Texture2D_GetFilter(Texture2D Lib3MFHandle) (ELib3MFTextureFilter, error) { var err error = nil var eFilter uint64 = 0 - + implementation_texture2d, err := implementation.GetWrapperHandle(Texture2D) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_texture2d_getfilter, implementation_texture2d.GetDLLInHandle(), UInt64OutValue(&eFilter)) - if err != nil { + if (err != nil) { return 0, err } - - return ELib3MFTextureFilter(eFilter), err + + return ELib3MFTextureFilter (eFilter), err } -func (implementation *Lib3MFImplementation) Texture2D_SetFilter(Texture2D Lib3MFHandle, eFilter ELib3MFTextureFilter) error { +func (implementation *Lib3MFImplementation) Texture2D_SetFilter(Texture2D Lib3MFHandle, eFilter ELib3MFTextureFilter) (error) { var err error = nil - + implementation_texture2d, err := implementation.GetWrapperHandle(Texture2D) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_texture2d_setfilter, implementation_texture2d.GetDLLInHandle(), uintptr(eFilter)) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) BuildItem_GetObjectResource(BuildItem Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hObjectResource := implementation.NewHandle() - + implementation_builditem, err := implementation.GetWrapperHandle(BuildItem) - if err != nil { + if (err != nil) { return hObjectResource, err } err = implementation.CallFunction(implementation.Lib3MF_builditem_getobjectresource, implementation_builditem.GetDLLInHandle(), hObjectResource.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hObjectResource, err } - + return hObjectResource, err } @@ -6208,106 +6505,106 @@ func (implementation *Lib3MFImplementation) BuildItem_GetUUID(BuildItem Lib3MFHa var bHasUUID int64 = 0 var neededforUUID int64 = 0 var filledinUUID int64 = 0 - + implementation_builditem, err := implementation.GetWrapperHandle(BuildItem) - if err != nil { + if (err != nil) { return false, "", err } err = implementation.CallFunction(implementation.Lib3MF_builditem_getuuid, implementation_builditem.GetDLLInHandle(), Int64OutValue(&bHasUUID), Int64InValue(0), Int64OutValue(&neededforUUID), Int64InValue(0)) - if err != nil { + if (err != nil) { return false, "", err } bufferSizeUUID := neededforUUID bufferUUID := make([]byte, bufferSizeUUID) err = implementation.CallFunction(implementation.Lib3MF_builditem_getuuid, implementation_builditem.GetDLLInHandle(), Int64OutValue(&bHasUUID), Int64InValue(bufferSizeUUID), Int64OutValue(&filledinUUID), uintptr(unsafe.Pointer(&bufferUUID[0]))) - if err != nil { + if (err != nil) { return false, "", err } - - return (bHasUUID != 0), string(bufferUUID[:(filledinUUID - 1)]), err + + return (bHasUUID != 0), string(bufferUUID[:(filledinUUID-1)]), err } -func (implementation *Lib3MFImplementation) BuildItem_SetUUID(BuildItem Lib3MFHandle, sUUID string) error { +func (implementation *Lib3MFImplementation) BuildItem_SetUUID(BuildItem Lib3MFHandle, sUUID string) (error) { var err error = nil - + implementation_builditem, err := implementation.GetWrapperHandle(BuildItem) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_builditem_setuuid, implementation_builditem.GetDLLInHandle(), StringInValue(sUUID)) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) BuildItem_GetObjectResourceID(BuildItem Lib3MFHandle) (uint32, error) { var err error = nil var nUniqueResourceID uint32 = 0 - + implementation_builditem, err := implementation.GetWrapperHandle(BuildItem) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_builditem_getobjectresourceid, implementation_builditem.GetDLLInHandle(), UInt32OutValue(&nUniqueResourceID)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nUniqueResourceID), err } func (implementation *Lib3MFImplementation) BuildItem_HasObjectTransform(BuildItem Lib3MFHandle) (bool, error) { var err error = nil var bHasTransform int64 = 0 - + implementation_builditem, err := implementation.GetWrapperHandle(BuildItem) - if err != nil { + if (err != nil) { return false, err } err = implementation.CallFunction(implementation.Lib3MF_builditem_hasobjecttransform, implementation_builditem.GetDLLInHandle(), Int64OutValue(&bHasTransform)) - if err != nil { + if (err != nil) { return false, err } - + return (bHasTransform != 0), err } func (implementation *Lib3MFImplementation) BuildItem_GetObjectTransform(BuildItem Lib3MFHandle) (sLib3MFTransform, error) { var err error = nil var sTransform sLib3MFTransform - + implementation_builditem, err := implementation.GetWrapperHandle(BuildItem) - if err != nil { + if (err != nil) { return sTransform, err } err = implementation.CallFunction(implementation.Lib3MF_builditem_getobjecttransform, implementation_builditem.GetDLLInHandle(), 0) - if err != nil { + if (err != nil) { return sTransform, err } - + return sTransform, err } -func (implementation *Lib3MFImplementation) BuildItem_SetObjectTransform(BuildItem Lib3MFHandle, sTransform sLib3MFTransform) error { +func (implementation *Lib3MFImplementation) BuildItem_SetObjectTransform(BuildItem Lib3MFHandle, sTransform sLib3MFTransform) (error) { var err error = nil - + implementation_builditem, err := implementation.GetWrapperHandle(BuildItem) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_builditem_setobjecttransform, implementation_builditem.GetDLLInHandle(), uintptr(unsafe.Pointer(&sTransform))) - if err != nil { + if (err != nil) { return err } - + return err } @@ -6315,262 +6612,262 @@ func (implementation *Lib3MFImplementation) BuildItem_GetPartNumber(BuildItem Li var err error = nil var neededforPartNumber int64 = 0 var filledinPartNumber int64 = 0 - + implementation_builditem, err := implementation.GetWrapperHandle(BuildItem) - if err != nil { + if (err != nil) { return "", err } err = implementation.CallFunction(implementation.Lib3MF_builditem_getpartnumber, implementation_builditem.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforPartNumber), Int64InValue(0)) - if err != nil { + if (err != nil) { return "", err } bufferSizePartNumber := neededforPartNumber bufferPartNumber := make([]byte, bufferSizePartNumber) err = implementation.CallFunction(implementation.Lib3MF_builditem_getpartnumber, implementation_builditem.GetDLLInHandle(), Int64InValue(bufferSizePartNumber), Int64OutValue(&filledinPartNumber), uintptr(unsafe.Pointer(&bufferPartNumber[0]))) - if err != nil { + if (err != nil) { return "", err } - - return string(bufferPartNumber[:(filledinPartNumber - 1)]), err + + return string(bufferPartNumber[:(filledinPartNumber-1)]), err } -func (implementation *Lib3MFImplementation) BuildItem_SetPartNumber(BuildItem Lib3MFHandle, sSetPartnumber string) error { +func (implementation *Lib3MFImplementation) BuildItem_SetPartNumber(BuildItem Lib3MFHandle, sSetPartnumber string) (error) { var err error = nil - + implementation_builditem, err := implementation.GetWrapperHandle(BuildItem) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_builditem_setpartnumber, implementation_builditem.GetDLLInHandle(), StringInValue(sSetPartnumber)) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) BuildItem_GetMetaDataGroup(BuildItem Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hMetaDataGroup := implementation.NewHandle() - + implementation_builditem, err := implementation.GetWrapperHandle(BuildItem) - if err != nil { + if (err != nil) { return hMetaDataGroup, err } err = implementation.CallFunction(implementation.Lib3MF_builditem_getmetadatagroup, implementation_builditem.GetDLLInHandle(), hMetaDataGroup.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hMetaDataGroup, err } - + return hMetaDataGroup, err } func (implementation *Lib3MFImplementation) BuildItem_GetOutbox(BuildItem Lib3MFHandle) (sLib3MFBox, error) { var err error = nil var sOutbox sLib3MFBox - + implementation_builditem, err := implementation.GetWrapperHandle(BuildItem) - if err != nil { + if (err != nil) { return sOutbox, err } err = implementation.CallFunction(implementation.Lib3MF_builditem_getoutbox, implementation_builditem.GetDLLInHandle(), 0) - if err != nil { + if (err != nil) { return sOutbox, err } - + return sOutbox, err } func (implementation *Lib3MFImplementation) BuildItemIterator_MoveNext(BuildItemIterator Lib3MFHandle) (bool, error) { var err error = nil var bHasNext int64 = 0 - + implementation_builditemiterator, err := implementation.GetWrapperHandle(BuildItemIterator) - if err != nil { + if (err != nil) { return false, err } err = implementation.CallFunction(implementation.Lib3MF_builditemiterator_movenext, implementation_builditemiterator.GetDLLInHandle(), Int64OutValue(&bHasNext)) - if err != nil { + if (err != nil) { return false, err } - + return (bHasNext != 0), err } func (implementation *Lib3MFImplementation) BuildItemIterator_MovePrevious(BuildItemIterator Lib3MFHandle) (bool, error) { var err error = nil var bHasPrevious int64 = 0 - + implementation_builditemiterator, err := implementation.GetWrapperHandle(BuildItemIterator) - if err != nil { + if (err != nil) { return false, err } err = implementation.CallFunction(implementation.Lib3MF_builditemiterator_moveprevious, implementation_builditemiterator.GetDLLInHandle(), Int64OutValue(&bHasPrevious)) - if err != nil { + if (err != nil) { return false, err } - + return (bHasPrevious != 0), err } func (implementation *Lib3MFImplementation) BuildItemIterator_GetCurrent(BuildItemIterator Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hBuildItem := implementation.NewHandle() - + implementation_builditemiterator, err := implementation.GetWrapperHandle(BuildItemIterator) - if err != nil { + if (err != nil) { return hBuildItem, err } err = implementation.CallFunction(implementation.Lib3MF_builditemiterator_getcurrent, implementation_builditemiterator.GetDLLInHandle(), hBuildItem.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hBuildItem, err } - + return hBuildItem, err } func (implementation *Lib3MFImplementation) BuildItemIterator_Clone(BuildItemIterator Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hOutBuildItemIterator := implementation.NewHandle() - + implementation_builditemiterator, err := implementation.GetWrapperHandle(BuildItemIterator) - if err != nil { + if (err != nil) { return hOutBuildItemIterator, err } err = implementation.CallFunction(implementation.Lib3MF_builditemiterator_clone, implementation_builditemiterator.GetDLLInHandle(), hOutBuildItemIterator.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hOutBuildItemIterator, err } - + return hOutBuildItemIterator, err } func (implementation *Lib3MFImplementation) BuildItemIterator_Count(BuildItemIterator Lib3MFHandle) (uint64, error) { var err error = nil var nCount uint64 = 0 - + implementation_builditemiterator, err := implementation.GetWrapperHandle(BuildItemIterator) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_builditemiterator_count, implementation_builditemiterator.GetDLLInHandle(), UInt64OutValue(&nCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint64(nCount), err } -func (implementation *Lib3MFImplementation) Slice_SetVertices(Slice Lib3MFHandle, Vertices []sLib3MFPosition2D) error { +func (implementation *Lib3MFImplementation) Slice_SetVertices(Slice Lib3MFHandle, Vertices []sLib3MFPosition2D) (error) { var err error = nil - + implementation_slice, err := implementation.GetWrapperHandle(Slice) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_slice_setvertices, implementation_slice.GetDLLInHandle(), 0, 0) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Slice_GetVertices(Slice Lib3MFHandle) ([]sLib3MFPosition2D, error) { var err error = nil arrayVertices := make([]sLib3MFPosition2D, 0) - + implementation_slice, err := implementation.GetWrapperHandle(Slice) - if err != nil { + if (err != nil) { return make([]sLib3MFPosition2D, 0), err } err = implementation.CallFunction(implementation.Lib3MF_slice_getvertices, implementation_slice.GetDLLInHandle(), 0, 0, 0) - if err != nil { + if (err != nil) { return make([]sLib3MFPosition2D, 0), err } err = implementation.CallFunction(implementation.Lib3MF_slice_getvertices, implementation_slice.GetDLLInHandle(), 0, 0, 0) - if err != nil { + if (err != nil) { return make([]sLib3MFPosition2D, 0), err } - + return arrayVertices, err } func (implementation *Lib3MFImplementation) Slice_GetVertexCount(Slice Lib3MFHandle) (uint64, error) { var err error = nil var nCount uint64 = 0 - + implementation_slice, err := implementation.GetWrapperHandle(Slice) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_slice_getvertexcount, implementation_slice.GetDLLInHandle(), UInt64OutValue(&nCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint64(nCount), err } func (implementation *Lib3MFImplementation) Slice_AddPolygon(Slice Lib3MFHandle, Indices []uint32) (uint64, error) { var err error = nil var nIndex uint64 = 0 - + implementation_slice, err := implementation.GetWrapperHandle(Slice) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_slice_addpolygon, implementation_slice.GetDLLInHandle(), 0, 0, UInt64OutValue(&nIndex)) - if err != nil { + if (err != nil) { return 0, err } - + return uint64(nIndex), err } func (implementation *Lib3MFImplementation) Slice_GetPolygonCount(Slice Lib3MFHandle) (uint64, error) { var err error = nil var nCount uint64 = 0 - + implementation_slice, err := implementation.GetWrapperHandle(Slice) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_slice_getpolygoncount, implementation_slice.GetDLLInHandle(), UInt64OutValue(&nCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint64(nCount), err } -func (implementation *Lib3MFImplementation) Slice_SetPolygonIndices(Slice Lib3MFHandle, nIndex uint64, Indices []uint32) error { +func (implementation *Lib3MFImplementation) Slice_SetPolygonIndices(Slice Lib3MFHandle, nIndex uint64, Indices []uint32) (error) { var err error = nil - + implementation_slice, err := implementation.GetWrapperHandle(Slice) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_slice_setpolygonindices, implementation_slice.GetDLLInHandle(), UInt64InValue(nIndex), 0, 0) - if err != nil { + if (err != nil) { return err } - + return err } @@ -6579,217 +6876,890 @@ func (implementation *Lib3MFImplementation) Slice_GetPolygonIndices(Slice Lib3MF var neededforIndices int64 = 0 var filledinIndices int64 = 0 bufferIndices := make([]uint32, 0) - + implementation_slice, err := implementation.GetWrapperHandle(Slice) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } err = implementation.CallFunction(implementation.Lib3MF_slice_getpolygonindices, implementation_slice.GetDLLInHandle(), UInt64InValue(nIndex), Int64InValue(0), Int64OutValue(&neededforIndices), Int64InValue(0)) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } bufferSizeIndices := neededforIndices bufferIndices = make([]uint32, bufferSizeIndices) err = implementation.CallFunction(implementation.Lib3MF_slice_getpolygonindices, implementation_slice.GetDLLInHandle(), UInt64InValue(nIndex), Int64InValue(bufferSizeIndices), Int64OutValue(&filledinIndices), uintptr(unsafe.Pointer(&bufferIndices[0]))) - if err != nil { + if (err != nil) { return make([]uint32, 0), err } - + return bufferIndices, err } func (implementation *Lib3MFImplementation) Slice_GetPolygonIndexCount(Slice Lib3MFHandle, nIndex uint64) (uint64, error) { var err error = nil var nCount uint64 = 0 - + implementation_slice, err := implementation.GetWrapperHandle(Slice) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_slice_getpolygonindexcount, implementation_slice.GetDLLInHandle(), UInt64InValue(nIndex), UInt64OutValue(&nCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint64(nCount), err } func (implementation *Lib3MFImplementation) Slice_GetZTop(Slice Lib3MFHandle) (float64, error) { var err error = nil var dZTop float64 = 0 - + implementation_slice, err := implementation.GetWrapperHandle(Slice) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_slice_getztop, implementation_slice.GetDLLInHandle(), Float64OutValue(&dZTop)) - if err != nil { + if (err != nil) { return 0, err } - + return dZTop, err } -func (implementation *Lib3MFImplementation) SliceStack_GetBottomZ(SliceStack Lib3MFHandle) (float64, error) { +func (implementation *Lib3MFImplementation) ToolpathProfile_GetUUID(ToolpathProfile Lib3MFHandle) (string, error) { var err error = nil - var dZBottom float64 = 0 + var neededforUUID int64 = 0 + var filledinUUID int64 = 0 + + implementation_toolpathprofile, err := implementation.GetWrapperHandle(ToolpathProfile) + if (err != nil) { + return "", err + } - implementation_slicestack, err := implementation.GetWrapperHandle(SliceStack) - if err != nil { - return 0, err + err = implementation.CallFunction(implementation.Lib3MF_toolpathprofile_getuuid, implementation_toolpathprofile.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforUUID), Int64InValue(0)) + if (err != nil) { + return "", err + } + bufferSizeUUID := neededforUUID + bufferUUID := make([]byte, bufferSizeUUID) + err = implementation.CallFunction(implementation.Lib3MF_toolpathprofile_getuuid, implementation_toolpathprofile.GetDLLInHandle(), Int64InValue(bufferSizeUUID), Int64OutValue(&filledinUUID), uintptr(unsafe.Pointer(&bufferUUID[0]))) + if (err != nil) { + return "", err } + + return string(bufferUUID[:(filledinUUID-1)]), err +} - err = implementation.CallFunction(implementation.Lib3MF_slicestack_getbottomz, implementation_slicestack.GetDLLInHandle(), Float64OutValue(&dZBottom)) - if err != nil { - return 0, err +func (implementation *Lib3MFImplementation) ToolpathProfile_GetName(ToolpathProfile Lib3MFHandle) (string, error) { + var err error = nil + var neededforName int64 = 0 + var filledinName int64 = 0 + + implementation_toolpathprofile, err := implementation.GetWrapperHandle(ToolpathProfile) + if (err != nil) { + return "", err } - return dZBottom, err + err = implementation.CallFunction(implementation.Lib3MF_toolpathprofile_getname, implementation_toolpathprofile.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforName), Int64InValue(0)) + if (err != nil) { + return "", err + } + bufferSizeName := neededforName + bufferName := make([]byte, bufferSizeName) + err = implementation.CallFunction(implementation.Lib3MF_toolpathprofile_getname, implementation_toolpathprofile.GetDLLInHandle(), Int64InValue(bufferSizeName), Int64OutValue(&filledinName), uintptr(unsafe.Pointer(&bufferName[0]))) + if (err != nil) { + return "", err + } + + return string(bufferName[:(filledinName-1)]), err } -func (implementation *Lib3MFImplementation) SliceStack_GetSliceCount(SliceStack Lib3MFHandle) (uint64, error) { +func (implementation *Lib3MFImplementation) ToolpathProfile_HasParameterValue(ToolpathProfile Lib3MFHandle, sNameSpaceName string, sValueName string) (bool, error) { var err error = nil - var nCount uint64 = 0 + var bValueExists int64 = 0 + + implementation_toolpathprofile, err := implementation.GetWrapperHandle(ToolpathProfile) + if (err != nil) { + return false, err + } - implementation_slicestack, err := implementation.GetWrapperHandle(SliceStack) - if err != nil { - return 0, err + err = implementation.CallFunction(implementation.Lib3MF_toolpathprofile_hasparametervalue, implementation_toolpathprofile.GetDLLInHandle(), StringInValue(sNameSpaceName), StringInValue(sValueName), Int64OutValue(&bValueExists)) + if (err != nil) { + return false, err } + + return (bValueExists != 0), err +} - err = implementation.CallFunction(implementation.Lib3MF_slicestack_getslicecount, implementation_slicestack.GetDLLInHandle(), UInt64OutValue(&nCount)) - if err != nil { +func (implementation *Lib3MFImplementation) ToolpathProfile_GetParameterDoubleValue(ToolpathProfile Lib3MFHandle, sNameSpaceName string, sValueName string) (float64, error) { + var err error = nil + var dValue float64 = 0 + + implementation_toolpathprofile, err := implementation.GetWrapperHandle(ToolpathProfile) + if (err != nil) { return 0, err } - return uint64(nCount), err + err = implementation.CallFunction(implementation.Lib3MF_toolpathprofile_getparameterdoublevalue, implementation_toolpathprofile.GetDLLInHandle(), StringInValue(sNameSpaceName), StringInValue(sValueName), Float64OutValue(&dValue)) + if (err != nil) { + return 0, err + } + + return dValue, err } -func (implementation *Lib3MFImplementation) SliceStack_GetSlice(SliceStack Lib3MFHandle, nSliceIndex uint64) (Lib3MFHandle, error) { +func (implementation *Lib3MFImplementation) ToolpathProfile_GetParameterDoubleValueDef(ToolpathProfile Lib3MFHandle, sNameSpaceName string, sValueName string, dDefaultValue float64) (float64, error) { var err error = nil - hTheSlice := implementation.NewHandle() + var dValue float64 = 0 + + implementation_toolpathprofile, err := implementation.GetWrapperHandle(ToolpathProfile) + if (err != nil) { + return 0, err + } + err = implementation.CallFunction(implementation.Lib3MF_toolpathprofile_getparameterdoublevaluedef, implementation_toolpathprofile.GetDLLInHandle(), StringInValue(sNameSpaceName), StringInValue(sValueName), Float64InValue(dDefaultValue), Float64OutValue(&dValue)) + if (err != nil) { + return 0, err + } + + return dValue, err +} + +func (implementation *Lib3MFImplementation) ToolpathProfile_SetName(ToolpathProfile Lib3MFHandle, sName string) (error) { + var err error = nil + + implementation_toolpathprofile, err := implementation.GetWrapperHandle(ToolpathProfile) + if (err != nil) { + return err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpathprofile_setname, implementation_toolpathprofile.GetDLLInHandle(), StringInValue(sName)) + if (err != nil) { + return err + } + + return err +} + +func (implementation *Lib3MFImplementation) ToolpathProfile_SetParameterDoubleValue(ToolpathProfile Lib3MFHandle, sNameSpaceName string, sValueName string, dValue float64) (error) { + var err error = nil + + implementation_toolpathprofile, err := implementation.GetWrapperHandle(ToolpathProfile) + if (err != nil) { + return err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpathprofile_setparameterdoublevalue, implementation_toolpathprofile.GetDLLInHandle(), StringInValue(sNameSpaceName), StringInValue(sValueName), Float64InValue(dValue)) + if (err != nil) { + return err + } + + return err +} + +func (implementation *Lib3MFImplementation) ToolpathLayerReader_GetLayerDataUUID(ToolpathLayerReader Lib3MFHandle) (string, error) { + var err error = nil + var neededforUUID int64 = 0 + var filledinUUID int64 = 0 + + implementation_toolpathlayerreader, err := implementation.GetWrapperHandle(ToolpathLayerReader) + if (err != nil) { + return "", err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpathlayerreader_getlayerdatauuid, implementation_toolpathlayerreader.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforUUID), Int64InValue(0)) + if (err != nil) { + return "", err + } + bufferSizeUUID := neededforUUID + bufferUUID := make([]byte, bufferSizeUUID) + err = implementation.CallFunction(implementation.Lib3MF_toolpathlayerreader_getlayerdatauuid, implementation_toolpathlayerreader.GetDLLInHandle(), Int64InValue(bufferSizeUUID), Int64OutValue(&filledinUUID), uintptr(unsafe.Pointer(&bufferUUID[0]))) + if (err != nil) { + return "", err + } + + return string(bufferUUID[:(filledinUUID-1)]), err +} + +func (implementation *Lib3MFImplementation) ToolpathLayerReader_GetSegmentCount(ToolpathLayerReader Lib3MFHandle) (uint32, error) { + var err error = nil + var nCount uint32 = 0 + + implementation_toolpathlayerreader, err := implementation.GetWrapperHandle(ToolpathLayerReader) + if (err != nil) { + return 0, err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpathlayerreader_getsegmentcount, implementation_toolpathlayerreader.GetDLLInHandle(), UInt32OutValue(&nCount)) + if (err != nil) { + return 0, err + } + + return uint32(nCount), err +} + +func (implementation *Lib3MFImplementation) ToolpathLayerReader_GetSegmentInfo(ToolpathLayerReader Lib3MFHandle, nIndex uint32) (ELib3MFToolpathSegmentType, uint32, error) { + var err error = nil + var eType uint64 = 0 + var nPointCount uint32 = 0 + + implementation_toolpathlayerreader, err := implementation.GetWrapperHandle(ToolpathLayerReader) + if (err != nil) { + return 0, 0, err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpathlayerreader_getsegmentinfo, implementation_toolpathlayerreader.GetDLLInHandle(), UInt32InValue(nIndex), UInt64OutValue(&eType), UInt32OutValue(&nPointCount)) + if (err != nil) { + return 0, 0, err + } + + return ELib3MFToolpathSegmentType (eType), uint32(nPointCount), err +} + +func (implementation *Lib3MFImplementation) ToolpathLayerReader_GetSegmentProfile(ToolpathLayerReader Lib3MFHandle, nIndex uint32) (Lib3MFHandle, error) { + var err error = nil + hProfile := implementation.NewHandle() + + implementation_toolpathlayerreader, err := implementation.GetWrapperHandle(ToolpathLayerReader) + if (err != nil) { + return hProfile, err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpathlayerreader_getsegmentprofile, implementation_toolpathlayerreader.GetDLLInHandle(), UInt32InValue(nIndex), hProfile.GetDLLOutHandle()) + if (err != nil) { + return hProfile, err + } + + return hProfile, err +} + +func (implementation *Lib3MFImplementation) ToolpathLayerReader_GetSegmentProfileUUID(ToolpathLayerReader Lib3MFHandle, nIndex uint32) (string, error) { + var err error = nil + var neededforProfileUUID int64 = 0 + var filledinProfileUUID int64 = 0 + + implementation_toolpathlayerreader, err := implementation.GetWrapperHandle(ToolpathLayerReader) + if (err != nil) { + return "", err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpathlayerreader_getsegmentprofileuuid, implementation_toolpathlayerreader.GetDLLInHandle(), UInt32InValue(nIndex), Int64InValue(0), Int64OutValue(&neededforProfileUUID), Int64InValue(0)) + if (err != nil) { + return "", err + } + bufferSizeProfileUUID := neededforProfileUUID + bufferProfileUUID := make([]byte, bufferSizeProfileUUID) + err = implementation.CallFunction(implementation.Lib3MF_toolpathlayerreader_getsegmentprofileuuid, implementation_toolpathlayerreader.GetDLLInHandle(), UInt32InValue(nIndex), Int64InValue(bufferSizeProfileUUID), Int64OutValue(&filledinProfileUUID), uintptr(unsafe.Pointer(&bufferProfileUUID[0]))) + if (err != nil) { + return "", err + } + + return string(bufferProfileUUID[:(filledinProfileUUID-1)]), err +} + +func (implementation *Lib3MFImplementation) ToolpathLayerReader_GetSegmentPart(ToolpathLayerReader Lib3MFHandle, nIndex uint32) (Lib3MFHandle, error) { + var err error = nil + hBuildItem := implementation.NewHandle() + + implementation_toolpathlayerreader, err := implementation.GetWrapperHandle(ToolpathLayerReader) + if (err != nil) { + return hBuildItem, err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpathlayerreader_getsegmentpart, implementation_toolpathlayerreader.GetDLLInHandle(), UInt32InValue(nIndex), hBuildItem.GetDLLOutHandle()) + if (err != nil) { + return hBuildItem, err + } + + return hBuildItem, err +} + +func (implementation *Lib3MFImplementation) ToolpathLayerReader_GetSegmentPartUUID(ToolpathLayerReader Lib3MFHandle, nIndex uint32) (string, error) { + var err error = nil + var neededforPartUUID int64 = 0 + var filledinPartUUID int64 = 0 + + implementation_toolpathlayerreader, err := implementation.GetWrapperHandle(ToolpathLayerReader) + if (err != nil) { + return "", err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpathlayerreader_getsegmentpartuuid, implementation_toolpathlayerreader.GetDLLInHandle(), UInt32InValue(nIndex), Int64InValue(0), Int64OutValue(&neededforPartUUID), Int64InValue(0)) + if (err != nil) { + return "", err + } + bufferSizePartUUID := neededforPartUUID + bufferPartUUID := make([]byte, bufferSizePartUUID) + err = implementation.CallFunction(implementation.Lib3MF_toolpathlayerreader_getsegmentpartuuid, implementation_toolpathlayerreader.GetDLLInHandle(), UInt32InValue(nIndex), Int64InValue(bufferSizePartUUID), Int64OutValue(&filledinPartUUID), uintptr(unsafe.Pointer(&bufferPartUUID[0]))) + if (err != nil) { + return "", err + } + + return string(bufferPartUUID[:(filledinPartUUID-1)]), err +} + +func (implementation *Lib3MFImplementation) ToolpathLayerReader_GetSegmentPointData(ToolpathLayerReader Lib3MFHandle, nIndex uint32) ([]sLib3MFPosition2D, error) { + var err error = nil + arrayPointData := make([]sLib3MFPosition2D, 0) + + implementation_toolpathlayerreader, err := implementation.GetWrapperHandle(ToolpathLayerReader) + if (err != nil) { + return make([]sLib3MFPosition2D, 0), err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpathlayerreader_getsegmentpointdata, implementation_toolpathlayerreader.GetDLLInHandle(), UInt32InValue(nIndex), 0, 0, 0) + if (err != nil) { + return make([]sLib3MFPosition2D, 0), err + } + err = implementation.CallFunction(implementation.Lib3MF_toolpathlayerreader_getsegmentpointdata, implementation_toolpathlayerreader.GetDLLInHandle(), UInt32InValue(nIndex), 0, 0, 0) + if (err != nil) { + return make([]sLib3MFPosition2D, 0), err + } + + return arrayPointData, err +} + +func (implementation *Lib3MFImplementation) ToolpathLayerData_GetLayerDataUUID(ToolpathLayerData Lib3MFHandle) (string, error) { + var err error = nil + var neededforUUID int64 = 0 + var filledinUUID int64 = 0 + + implementation_toolpathlayerdata, err := implementation.GetWrapperHandle(ToolpathLayerData) + if (err != nil) { + return "", err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpathlayerdata_getlayerdatauuid, implementation_toolpathlayerdata.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforUUID), Int64InValue(0)) + if (err != nil) { + return "", err + } + bufferSizeUUID := neededforUUID + bufferUUID := make([]byte, bufferSizeUUID) + err = implementation.CallFunction(implementation.Lib3MF_toolpathlayerdata_getlayerdatauuid, implementation_toolpathlayerdata.GetDLLInHandle(), Int64InValue(bufferSizeUUID), Int64OutValue(&filledinUUID), uintptr(unsafe.Pointer(&bufferUUID[0]))) + if (err != nil) { + return "", err + } + + return string(bufferUUID[:(filledinUUID-1)]), err +} + +func (implementation *Lib3MFImplementation) ToolpathLayerData_RegisterProfile(ToolpathLayerData Lib3MFHandle, Profile Lib3MFHandle) (uint32, error) { + var err error = nil + var nProfileID uint32 = 0 + + implementation_toolpathlayerdata, err := implementation.GetWrapperHandle(ToolpathLayerData) + if (err != nil) { + return 0, err + } + implementation_profile, err := implementation.GetWrapperHandle(Profile) + if (err != nil) { + return 0, err + } + + ProfileDLLHandle := implementation_profile.GetDLLInHandle() + if (ProfileDLLHandle == 0) { + err := fmt.Errorf("Handle must not be 0.") + return 0, err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpathlayerdata_registerprofile, implementation_toolpathlayerdata.GetDLLInHandle(), ProfileDLLHandle, UInt32OutValue(&nProfileID)) + if (err != nil) { + return 0, err + } + + return uint32(nProfileID), err +} + +func (implementation *Lib3MFImplementation) ToolpathLayerData_RegisterBuildItem(ToolpathLayerData Lib3MFHandle, BuildItem Lib3MFHandle) (uint32, error) { + var err error = nil + var nPartID uint32 = 0 + + implementation_toolpathlayerdata, err := implementation.GetWrapperHandle(ToolpathLayerData) + if (err != nil) { + return 0, err + } + implementation_builditem, err := implementation.GetWrapperHandle(BuildItem) + if (err != nil) { + return 0, err + } + + BuildItemDLLHandle := implementation_builditem.GetDLLInHandle() + if (BuildItemDLLHandle == 0) { + err := fmt.Errorf("Handle must not be 0.") + return 0, err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpathlayerdata_registerbuilditem, implementation_toolpathlayerdata.GetDLLInHandle(), BuildItemDLLHandle, UInt32OutValue(&nPartID)) + if (err != nil) { + return 0, err + } + + return uint32(nPartID), err +} + +func (implementation *Lib3MFImplementation) ToolpathLayerData_WriteHatchData(ToolpathLayerData Lib3MFHandle, nProfileID uint32, nPartID uint32, PointData []sLib3MFPosition2D) (error) { + var err error = nil + + implementation_toolpathlayerdata, err := implementation.GetWrapperHandle(ToolpathLayerData) + if (err != nil) { + return err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpathlayerdata_writehatchdata, implementation_toolpathlayerdata.GetDLLInHandle(), UInt32InValue(nProfileID), UInt32InValue(nPartID), 0, 0) + if (err != nil) { + return err + } + + return err +} + +func (implementation *Lib3MFImplementation) ToolpathLayerData_WriteLoop(ToolpathLayerData Lib3MFHandle, nProfileID uint32, nPartID uint32, PointData []sLib3MFPosition2D) (error) { + var err error = nil + + implementation_toolpathlayerdata, err := implementation.GetWrapperHandle(ToolpathLayerData) + if (err != nil) { + return err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpathlayerdata_writeloop, implementation_toolpathlayerdata.GetDLLInHandle(), UInt32InValue(nProfileID), UInt32InValue(nPartID), 0, 0) + if (err != nil) { + return err + } + + return err +} + +func (implementation *Lib3MFImplementation) ToolpathLayerData_WritePolyline(ToolpathLayerData Lib3MFHandle, nProfileID uint32, nPartID uint32, PointData []sLib3MFPosition2D) (error) { + var err error = nil + + implementation_toolpathlayerdata, err := implementation.GetWrapperHandle(ToolpathLayerData) + if (err != nil) { + return err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpathlayerdata_writepolyline, implementation_toolpathlayerdata.GetDLLInHandle(), UInt32InValue(nProfileID), UInt32InValue(nPartID), 0, 0) + if (err != nil) { + return err + } + + return err +} + +func (implementation *Lib3MFImplementation) ToolpathLayerData_Finish(ToolpathLayerData Lib3MFHandle) (error) { + var err error = nil + + implementation_toolpathlayerdata, err := implementation.GetWrapperHandle(ToolpathLayerData) + if (err != nil) { + return err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpathlayerdata_finish, implementation_toolpathlayerdata.GetDLLInHandle()) + if (err != nil) { + return err + } + + return err +} + +func (implementation *Lib3MFImplementation) Toolpath_GetUnits(Toolpath Lib3MFHandle) (float64, error) { + var err error = nil + var dUnits float64 = 0 + + implementation_toolpath, err := implementation.GetWrapperHandle(Toolpath) + if (err != nil) { + return 0, err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpath_getunits, implementation_toolpath.GetDLLInHandle(), Float64OutValue(&dUnits)) + if (err != nil) { + return 0, err + } + + return dUnits, err +} + +func (implementation *Lib3MFImplementation) Toolpath_GetLayerCount(Toolpath Lib3MFHandle) (uint32, error) { + var err error = nil + var nCount uint32 = 0 + + implementation_toolpath, err := implementation.GetWrapperHandle(Toolpath) + if (err != nil) { + return 0, err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpath_getlayercount, implementation_toolpath.GetDLLInHandle(), UInt32OutValue(&nCount)) + if (err != nil) { + return 0, err + } + + return uint32(nCount), err +} + +func (implementation *Lib3MFImplementation) Toolpath_GetProfileCount(Toolpath Lib3MFHandle) (uint32, error) { + var err error = nil + var nCount uint32 = 0 + + implementation_toolpath, err := implementation.GetWrapperHandle(Toolpath) + if (err != nil) { + return 0, err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpath_getprofilecount, implementation_toolpath.GetDLLInHandle(), UInt32OutValue(&nCount)) + if (err != nil) { + return 0, err + } + + return uint32(nCount), err +} + +func (implementation *Lib3MFImplementation) Toolpath_AddLayer(Toolpath Lib3MFHandle, nZMax uint32, sPath string, ModelWriter Lib3MFHandle) (Lib3MFHandle, error) { + var err error = nil + hLayerData := implementation.NewHandle() + + implementation_toolpath, err := implementation.GetWrapperHandle(Toolpath) + if (err != nil) { + return hLayerData, err + } + implementation_modelwriter, err := implementation.GetWrapperHandle(ModelWriter) + if (err != nil) { + return hLayerData, err + } + + ModelWriterDLLHandle := implementation_modelwriter.GetDLLInHandle() + if (ModelWriterDLLHandle == 0) { + err := fmt.Errorf("Handle must not be 0.") + return hLayerData, err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpath_addlayer, implementation_toolpath.GetDLLInHandle(), UInt32InValue(nZMax), StringInValue(sPath), ModelWriterDLLHandle, hLayerData.GetDLLOutHandle()) + if (err != nil) { + return hLayerData, err + } + + return hLayerData, err +} + +func (implementation *Lib3MFImplementation) Toolpath_GetLayerAttachment(Toolpath Lib3MFHandle, nIndex uint32) (Lib3MFHandle, error) { + var err error = nil + hAttachment := implementation.NewHandle() + + implementation_toolpath, err := implementation.GetWrapperHandle(Toolpath) + if (err != nil) { + return hAttachment, err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpath_getlayerattachment, implementation_toolpath.GetDLLInHandle(), UInt32InValue(nIndex), hAttachment.GetDLLOutHandle()) + if (err != nil) { + return hAttachment, err + } + + return hAttachment, err +} + +func (implementation *Lib3MFImplementation) Toolpath_ReadLayerData(Toolpath Lib3MFHandle, nIndex uint32) (Lib3MFHandle, error) { + var err error = nil + hToolpathReader := implementation.NewHandle() + + implementation_toolpath, err := implementation.GetWrapperHandle(Toolpath) + if (err != nil) { + return hToolpathReader, err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpath_readlayerdata, implementation_toolpath.GetDLLInHandle(), UInt32InValue(nIndex), hToolpathReader.GetDLLOutHandle()) + if (err != nil) { + return hToolpathReader, err + } + + return hToolpathReader, err +} + +func (implementation *Lib3MFImplementation) Toolpath_GetLayerPath(Toolpath Lib3MFHandle, nIndex uint32) (string, error) { + var err error = nil + var neededforPath int64 = 0 + var filledinPath int64 = 0 + + implementation_toolpath, err := implementation.GetWrapperHandle(Toolpath) + if (err != nil) { + return "", err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpath_getlayerpath, implementation_toolpath.GetDLLInHandle(), UInt32InValue(nIndex), Int64InValue(0), Int64OutValue(&neededforPath), Int64InValue(0)) + if (err != nil) { + return "", err + } + bufferSizePath := neededforPath + bufferPath := make([]byte, bufferSizePath) + err = implementation.CallFunction(implementation.Lib3MF_toolpath_getlayerpath, implementation_toolpath.GetDLLInHandle(), UInt32InValue(nIndex), Int64InValue(bufferSizePath), Int64OutValue(&filledinPath), uintptr(unsafe.Pointer(&bufferPath[0]))) + if (err != nil) { + return "", err + } + + return string(bufferPath[:(filledinPath-1)]), err +} + +func (implementation *Lib3MFImplementation) Toolpath_GetLayerZMax(Toolpath Lib3MFHandle, nIndex uint32) (uint32, error) { + var err error = nil + var nZMax uint32 = 0 + + implementation_toolpath, err := implementation.GetWrapperHandle(Toolpath) + if (err != nil) { + return 0, err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpath_getlayerzmax, implementation_toolpath.GetDLLInHandle(), UInt32InValue(nIndex), UInt32OutValue(&nZMax)) + if (err != nil) { + return 0, err + } + + return uint32(nZMax), err +} + +func (implementation *Lib3MFImplementation) Toolpath_GetLayerZ(Toolpath Lib3MFHandle, nLayerIndex uint32) (uint32, error) { + var err error = nil + var nZValue uint32 = 0 + + implementation_toolpath, err := implementation.GetWrapperHandle(Toolpath) + if (err != nil) { + return 0, err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpath_getlayerz, implementation_toolpath.GetDLLInHandle(), UInt32InValue(nLayerIndex), UInt32OutValue(&nZValue)) + if (err != nil) { + return 0, err + } + + return uint32(nZValue), err +} + +func (implementation *Lib3MFImplementation) Toolpath_AddProfile(Toolpath Lib3MFHandle, sName string) (Lib3MFHandle, error) { + var err error = nil + hProfile := implementation.NewHandle() + + implementation_toolpath, err := implementation.GetWrapperHandle(Toolpath) + if (err != nil) { + return hProfile, err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpath_addprofile, implementation_toolpath.GetDLLInHandle(), StringInValue(sName), hProfile.GetDLLOutHandle()) + if (err != nil) { + return hProfile, err + } + + return hProfile, err +} + +func (implementation *Lib3MFImplementation) Toolpath_GetProfile(Toolpath Lib3MFHandle, nProfileIndex uint32) (Lib3MFHandle, error) { + var err error = nil + hProfile := implementation.NewHandle() + + implementation_toolpath, err := implementation.GetWrapperHandle(Toolpath) + if (err != nil) { + return hProfile, err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpath_getprofile, implementation_toolpath.GetDLLInHandle(), UInt32InValue(nProfileIndex), hProfile.GetDLLOutHandle()) + if (err != nil) { + return hProfile, err + } + + return hProfile, err +} + +func (implementation *Lib3MFImplementation) Toolpath_GetProfileUUID(Toolpath Lib3MFHandle, sProfileUUID string) (Lib3MFHandle, error) { + var err error = nil + hProfile := implementation.NewHandle() + + implementation_toolpath, err := implementation.GetWrapperHandle(Toolpath) + if (err != nil) { + return hProfile, err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpath_getprofileuuid, implementation_toolpath.GetDLLInHandle(), StringInValue(sProfileUUID), hProfile.GetDLLOutHandle()) + if (err != nil) { + return hProfile, err + } + + return hProfile, err +} + +func (implementation *Lib3MFImplementation) ToolpathIterator_GetCurrentToolpath(ToolpathIterator Lib3MFHandle) (Lib3MFHandle, error) { + var err error = nil + hResource := implementation.NewHandle() + + implementation_toolpathiterator, err := implementation.GetWrapperHandle(ToolpathIterator) + if (err != nil) { + return hResource, err + } + + err = implementation.CallFunction(implementation.Lib3MF_toolpathiterator_getcurrenttoolpath, implementation_toolpathiterator.GetDLLInHandle(), hResource.GetDLLOutHandle()) + if (err != nil) { + return hResource, err + } + + return hResource, err +} + +func (implementation *Lib3MFImplementation) SliceStack_GetBottomZ(SliceStack Lib3MFHandle) (float64, error) { + var err error = nil + var dZBottom float64 = 0 + implementation_slicestack, err := implementation.GetWrapperHandle(SliceStack) - if err != nil { + if (err != nil) { + return 0, err + } + + err = implementation.CallFunction(implementation.Lib3MF_slicestack_getbottomz, implementation_slicestack.GetDLLInHandle(), Float64OutValue(&dZBottom)) + if (err != nil) { + return 0, err + } + + return dZBottom, err +} + +func (implementation *Lib3MFImplementation) SliceStack_GetSliceCount(SliceStack Lib3MFHandle) (uint64, error) { + var err error = nil + var nCount uint64 = 0 + + implementation_slicestack, err := implementation.GetWrapperHandle(SliceStack) + if (err != nil) { + return 0, err + } + + err = implementation.CallFunction(implementation.Lib3MF_slicestack_getslicecount, implementation_slicestack.GetDLLInHandle(), UInt64OutValue(&nCount)) + if (err != nil) { + return 0, err + } + + return uint64(nCount), err +} + +func (implementation *Lib3MFImplementation) SliceStack_GetSlice(SliceStack Lib3MFHandle, nSliceIndex uint64) (Lib3MFHandle, error) { + var err error = nil + hTheSlice := implementation.NewHandle() + + implementation_slicestack, err := implementation.GetWrapperHandle(SliceStack) + if (err != nil) { return hTheSlice, err } err = implementation.CallFunction(implementation.Lib3MF_slicestack_getslice, implementation_slicestack.GetDLLInHandle(), UInt64InValue(nSliceIndex), hTheSlice.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hTheSlice, err } - + return hTheSlice, err } func (implementation *Lib3MFImplementation) SliceStack_AddSlice(SliceStack Lib3MFHandle, dZTop float64) (Lib3MFHandle, error) { var err error = nil hTheSlice := implementation.NewHandle() - + implementation_slicestack, err := implementation.GetWrapperHandle(SliceStack) - if err != nil { + if (err != nil) { return hTheSlice, err } err = implementation.CallFunction(implementation.Lib3MF_slicestack_addslice, implementation_slicestack.GetDLLInHandle(), Float64InValue(dZTop), hTheSlice.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hTheSlice, err } - + return hTheSlice, err } func (implementation *Lib3MFImplementation) SliceStack_GetSliceRefCount(SliceStack Lib3MFHandle) (uint64, error) { var err error = nil var nCount uint64 = 0 - + implementation_slicestack, err := implementation.GetWrapperHandle(SliceStack) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_slicestack_getslicerefcount, implementation_slicestack.GetDLLInHandle(), UInt64OutValue(&nCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint64(nCount), err } -func (implementation *Lib3MFImplementation) SliceStack_AddSliceStackReference(SliceStack Lib3MFHandle, TheSliceStack Lib3MFHandle) error { +func (implementation *Lib3MFImplementation) SliceStack_AddSliceStackReference(SliceStack Lib3MFHandle, TheSliceStack Lib3MFHandle) (error) { var err error = nil - + implementation_slicestack, err := implementation.GetWrapperHandle(SliceStack) - if err != nil { + if (err != nil) { return err } implementation_theslicestack, err := implementation.GetWrapperHandle(TheSliceStack) - if err != nil { + if (err != nil) { return err } - + TheSliceStackDLLHandle := implementation_theslicestack.GetDLLInHandle() - if TheSliceStackDLLHandle == 0 { + if (TheSliceStackDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return err } err = implementation.CallFunction(implementation.Lib3MF_slicestack_addslicestackreference, implementation_slicestack.GetDLLInHandle(), TheSliceStackDLLHandle) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) SliceStack_GetSliceStackReference(SliceStack Lib3MFHandle, nSliceRefIndex uint64) (Lib3MFHandle, error) { var err error = nil hTheSliceStack := implementation.NewHandle() - + implementation_slicestack, err := implementation.GetWrapperHandle(SliceStack) - if err != nil { + if (err != nil) { return hTheSliceStack, err } err = implementation.CallFunction(implementation.Lib3MF_slicestack_getslicestackreference, implementation_slicestack.GetDLLInHandle(), UInt64InValue(nSliceRefIndex), hTheSliceStack.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hTheSliceStack, err } - + return hTheSliceStack, err } -func (implementation *Lib3MFImplementation) SliceStack_CollapseSliceReferences(SliceStack Lib3MFHandle) error { +func (implementation *Lib3MFImplementation) SliceStack_CollapseSliceReferences(SliceStack Lib3MFHandle) (error) { var err error = nil - + implementation_slicestack, err := implementation.GetWrapperHandle(SliceStack) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_slicestack_collapseslicereferences, implementation_slicestack.GetDLLInHandle()) - if err != nil { + if (err != nil) { return err } - + return err } -func (implementation *Lib3MFImplementation) SliceStack_SetOwnPath(SliceStack Lib3MFHandle, sPath string) error { +func (implementation *Lib3MFImplementation) SliceStack_SetOwnPath(SliceStack Lib3MFHandle, sPath string) (error) { var err error = nil - + implementation_slicestack, err := implementation.GetWrapperHandle(SliceStack) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_slicestack_setownpath, implementation_slicestack.GetDLLInHandle(), StringInValue(sPath)) - if err != nil { + if (err != nil) { return err } - + return err } @@ -6797,181 +7767,181 @@ func (implementation *Lib3MFImplementation) SliceStack_GetOwnPath(SliceStack Lib var err error = nil var neededforPath int64 = 0 var filledinPath int64 = 0 - + implementation_slicestack, err := implementation.GetWrapperHandle(SliceStack) - if err != nil { + if (err != nil) { return "", err } err = implementation.CallFunction(implementation.Lib3MF_slicestack_getownpath, implementation_slicestack.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforPath), Int64InValue(0)) - if err != nil { + if (err != nil) { return "", err } bufferSizePath := neededforPath bufferPath := make([]byte, bufferSizePath) err = implementation.CallFunction(implementation.Lib3MF_slicestack_getownpath, implementation_slicestack.GetDLLInHandle(), Int64InValue(bufferSizePath), Int64OutValue(&filledinPath), uintptr(unsafe.Pointer(&bufferPath[0]))) - if err != nil { + if (err != nil) { return "", err } - - return string(bufferPath[:(filledinPath - 1)]), err + + return string(bufferPath[:(filledinPath-1)]), err } func (implementation *Lib3MFImplementation) Consumer_GetConsumerID(Consumer Lib3MFHandle) (string, error) { var err error = nil var neededforConsumerID int64 = 0 var filledinConsumerID int64 = 0 - + implementation_consumer, err := implementation.GetWrapperHandle(Consumer) - if err != nil { + if (err != nil) { return "", err } err = implementation.CallFunction(implementation.Lib3MF_consumer_getconsumerid, implementation_consumer.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforConsumerID), Int64InValue(0)) - if err != nil { + if (err != nil) { return "", err } bufferSizeConsumerID := neededforConsumerID bufferConsumerID := make([]byte, bufferSizeConsumerID) err = implementation.CallFunction(implementation.Lib3MF_consumer_getconsumerid, implementation_consumer.GetDLLInHandle(), Int64InValue(bufferSizeConsumerID), Int64OutValue(&filledinConsumerID), uintptr(unsafe.Pointer(&bufferConsumerID[0]))) - if err != nil { + if (err != nil) { return "", err } - - return string(bufferConsumerID[:(filledinConsumerID - 1)]), err + + return string(bufferConsumerID[:(filledinConsumerID-1)]), err } func (implementation *Lib3MFImplementation) Consumer_GetKeyID(Consumer Lib3MFHandle) (string, error) { var err error = nil var neededforKeyID int64 = 0 var filledinKeyID int64 = 0 - + implementation_consumer, err := implementation.GetWrapperHandle(Consumer) - if err != nil { + if (err != nil) { return "", err } err = implementation.CallFunction(implementation.Lib3MF_consumer_getkeyid, implementation_consumer.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforKeyID), Int64InValue(0)) - if err != nil { + if (err != nil) { return "", err } bufferSizeKeyID := neededforKeyID bufferKeyID := make([]byte, bufferSizeKeyID) err = implementation.CallFunction(implementation.Lib3MF_consumer_getkeyid, implementation_consumer.GetDLLInHandle(), Int64InValue(bufferSizeKeyID), Int64OutValue(&filledinKeyID), uintptr(unsafe.Pointer(&bufferKeyID[0]))) - if err != nil { + if (err != nil) { return "", err } - - return string(bufferKeyID[:(filledinKeyID - 1)]), err + + return string(bufferKeyID[:(filledinKeyID-1)]), err } func (implementation *Lib3MFImplementation) Consumer_GetKeyValue(Consumer Lib3MFHandle) (string, error) { var err error = nil var neededforKeyValue int64 = 0 var filledinKeyValue int64 = 0 - + implementation_consumer, err := implementation.GetWrapperHandle(Consumer) - if err != nil { + if (err != nil) { return "", err } err = implementation.CallFunction(implementation.Lib3MF_consumer_getkeyvalue, implementation_consumer.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforKeyValue), Int64InValue(0)) - if err != nil { + if (err != nil) { return "", err } bufferSizeKeyValue := neededforKeyValue bufferKeyValue := make([]byte, bufferSizeKeyValue) err = implementation.CallFunction(implementation.Lib3MF_consumer_getkeyvalue, implementation_consumer.GetDLLInHandle(), Int64InValue(bufferSizeKeyValue), Int64OutValue(&filledinKeyValue), uintptr(unsafe.Pointer(&bufferKeyValue[0]))) - if err != nil { + if (err != nil) { return "", err } - - return string(bufferKeyValue[:(filledinKeyValue - 1)]), err + + return string(bufferKeyValue[:(filledinKeyValue-1)]), err } func (implementation *Lib3MFImplementation) AccessRight_GetConsumer(AccessRight Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hConsumer := implementation.NewHandle() - + implementation_accessright, err := implementation.GetWrapperHandle(AccessRight) - if err != nil { + if (err != nil) { return hConsumer, err } err = implementation.CallFunction(implementation.Lib3MF_accessright_getconsumer, implementation_accessright.GetDLLInHandle(), hConsumer.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hConsumer, err } - + return hConsumer, err } func (implementation *Lib3MFImplementation) AccessRight_GetWrappingAlgorithm(AccessRight Lib3MFHandle) (ELib3MFWrappingAlgorithm, error) { var err error = nil var eAlgorithm uint64 = 0 - + implementation_accessright, err := implementation.GetWrapperHandle(AccessRight) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_accessright_getwrappingalgorithm, implementation_accessright.GetDLLInHandle(), UInt64OutValue(&eAlgorithm)) - if err != nil { + if (err != nil) { return 0, err } - - return ELib3MFWrappingAlgorithm(eAlgorithm), err + + return ELib3MFWrappingAlgorithm (eAlgorithm), err } func (implementation *Lib3MFImplementation) AccessRight_GetMgfAlgorithm(AccessRight Lib3MFHandle) (ELib3MFMgfAlgorithm, error) { var err error = nil var eAlgorithm uint64 = 0 - + implementation_accessright, err := implementation.GetWrapperHandle(AccessRight) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_accessright_getmgfalgorithm, implementation_accessright.GetDLLInHandle(), UInt64OutValue(&eAlgorithm)) - if err != nil { + if (err != nil) { return 0, err } - - return ELib3MFMgfAlgorithm(eAlgorithm), err + + return ELib3MFMgfAlgorithm (eAlgorithm), err } func (implementation *Lib3MFImplementation) AccessRight_GetDigestMethod(AccessRight Lib3MFHandle) (ELib3MFDigestMethod, error) { var err error = nil var eAlgorithm uint64 = 0 - + implementation_accessright, err := implementation.GetWrapperHandle(AccessRight) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_accessright_getdigestmethod, implementation_accessright.GetDLLInHandle(), UInt64OutValue(&eAlgorithm)) - if err != nil { + if (err != nil) { return 0, err } - - return ELib3MFDigestMethod(eAlgorithm), err + + return ELib3MFDigestMethod (eAlgorithm), err } func (implementation *Lib3MFImplementation) ContentEncryptionParams_GetEncryptionAlgorithm(ContentEncryptionParams Lib3MFHandle) (ELib3MFEncryptionAlgorithm, error) { var err error = nil var eAlgorithm uint64 = 0 - + implementation_contentencryptionparams, err := implementation.GetWrapperHandle(ContentEncryptionParams) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_contentencryptionparams_getencryptionalgorithm, implementation_contentencryptionparams.GetDLLInHandle(), UInt64OutValue(&eAlgorithm)) - if err != nil { + if (err != nil) { return 0, err } - - return ELib3MFEncryptionAlgorithm(eAlgorithm), err + + return ELib3MFEncryptionAlgorithm (eAlgorithm), err } func (implementation *Lib3MFImplementation) ContentEncryptionParams_GetKey(ContentEncryptionParams Lib3MFHandle) ([]uint8, error) { @@ -6979,23 +7949,23 @@ func (implementation *Lib3MFImplementation) ContentEncryptionParams_GetKey(Conte var neededforByteData int64 = 0 var filledinByteData int64 = 0 bufferByteData := make([]uint8, 0) - + implementation_contentencryptionparams, err := implementation.GetWrapperHandle(ContentEncryptionParams) - if err != nil { + if (err != nil) { return make([]uint8, 0), err } err = implementation.CallFunction(implementation.Lib3MF_contentencryptionparams_getkey, implementation_contentencryptionparams.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforByteData), Int64InValue(0)) - if err != nil { + if (err != nil) { return make([]uint8, 0), err } bufferSizeByteData := neededforByteData bufferByteData = make([]uint8, bufferSizeByteData) err = implementation.CallFunction(implementation.Lib3MF_contentencryptionparams_getkey, implementation_contentencryptionparams.GetDLLInHandle(), Int64InValue(bufferSizeByteData), Int64OutValue(&filledinByteData), uintptr(unsafe.Pointer(&bufferByteData[0]))) - if err != nil { + if (err != nil) { return make([]uint8, 0), err } - + return bufferByteData, err } @@ -7004,23 +7974,23 @@ func (implementation *Lib3MFImplementation) ContentEncryptionParams_GetInitializ var neededforByteData int64 = 0 var filledinByteData int64 = 0 bufferByteData := make([]uint8, 0) - + implementation_contentencryptionparams, err := implementation.GetWrapperHandle(ContentEncryptionParams) - if err != nil { + if (err != nil) { return make([]uint8, 0), err } err = implementation.CallFunction(implementation.Lib3MF_contentencryptionparams_getinitializationvector, implementation_contentencryptionparams.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforByteData), Int64InValue(0)) - if err != nil { + if (err != nil) { return make([]uint8, 0), err } bufferSizeByteData := neededforByteData bufferByteData = make([]uint8, bufferSizeByteData) err = implementation.CallFunction(implementation.Lib3MF_contentencryptionparams_getinitializationvector, implementation_contentencryptionparams.GetDLLInHandle(), Int64InValue(bufferSizeByteData), Int64OutValue(&filledinByteData), uintptr(unsafe.Pointer(&bufferByteData[0]))) - if err != nil { + if (err != nil) { return make([]uint8, 0), err } - + return bufferByteData, err } @@ -7029,39 +7999,39 @@ func (implementation *Lib3MFImplementation) ContentEncryptionParams_GetAuthentic var neededforByteData int64 = 0 var filledinByteData int64 = 0 bufferByteData := make([]uint8, 0) - + implementation_contentencryptionparams, err := implementation.GetWrapperHandle(ContentEncryptionParams) - if err != nil { + if (err != nil) { return make([]uint8, 0), err } err = implementation.CallFunction(implementation.Lib3MF_contentencryptionparams_getauthenticationtag, implementation_contentencryptionparams.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforByteData), Int64InValue(0)) - if err != nil { + if (err != nil) { return make([]uint8, 0), err } bufferSizeByteData := neededforByteData bufferByteData = make([]uint8, bufferSizeByteData) err = implementation.CallFunction(implementation.Lib3MF_contentencryptionparams_getauthenticationtag, implementation_contentencryptionparams.GetDLLInHandle(), Int64InValue(bufferSizeByteData), Int64OutValue(&filledinByteData), uintptr(unsafe.Pointer(&bufferByteData[0]))) - if err != nil { + if (err != nil) { return make([]uint8, 0), err } - + return bufferByteData, err } -func (implementation *Lib3MFImplementation) ContentEncryptionParams_SetAuthenticationTag(ContentEncryptionParams Lib3MFHandle, ByteData []uint8) error { +func (implementation *Lib3MFImplementation) ContentEncryptionParams_SetAuthenticationTag(ContentEncryptionParams Lib3MFHandle, ByteData []uint8) (error) { var err error = nil - + implementation_contentencryptionparams, err := implementation.GetWrapperHandle(ContentEncryptionParams) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_contentencryptionparams_setauthenticationtag, implementation_contentencryptionparams.GetDLLInHandle(), 0, 0) - if err != nil { + if (err != nil) { return err } - + return err } @@ -7070,40 +8040,40 @@ func (implementation *Lib3MFImplementation) ContentEncryptionParams_GetAdditiona var neededforByteData int64 = 0 var filledinByteData int64 = 0 bufferByteData := make([]uint8, 0) - + implementation_contentencryptionparams, err := implementation.GetWrapperHandle(ContentEncryptionParams) - if err != nil { + if (err != nil) { return make([]uint8, 0), err } err = implementation.CallFunction(implementation.Lib3MF_contentencryptionparams_getadditionalauthenticationdata, implementation_contentencryptionparams.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforByteData), Int64InValue(0)) - if err != nil { + if (err != nil) { return make([]uint8, 0), err } bufferSizeByteData := neededforByteData bufferByteData = make([]uint8, bufferSizeByteData) err = implementation.CallFunction(implementation.Lib3MF_contentencryptionparams_getadditionalauthenticationdata, implementation_contentencryptionparams.GetDLLInHandle(), Int64InValue(bufferSizeByteData), Int64OutValue(&filledinByteData), uintptr(unsafe.Pointer(&bufferByteData[0]))) - if err != nil { + if (err != nil) { return make([]uint8, 0), err } - + return bufferByteData, err } func (implementation *Lib3MFImplementation) ContentEncryptionParams_GetDescriptor(ContentEncryptionParams Lib3MFHandle) (uint64, error) { var err error = nil var nDescriptor uint64 = 0 - + implementation_contentencryptionparams, err := implementation.GetWrapperHandle(ContentEncryptionParams) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_contentencryptionparams_getdescriptor, implementation_contentencryptionparams.GetDLLInHandle(), UInt64OutValue(&nDescriptor)) - if err != nil { + if (err != nil) { return 0, err } - + return uint64(nDescriptor), err } @@ -7111,75 +8081,75 @@ func (implementation *Lib3MFImplementation) ContentEncryptionParams_GetKeyUUID(C var err error = nil var neededforUUID int64 = 0 var filledinUUID int64 = 0 - + implementation_contentencryptionparams, err := implementation.GetWrapperHandle(ContentEncryptionParams) - if err != nil { + if (err != nil) { return "", err } err = implementation.CallFunction(implementation.Lib3MF_contentencryptionparams_getkeyuuid, implementation_contentencryptionparams.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforUUID), Int64InValue(0)) - if err != nil { + if (err != nil) { return "", err } bufferSizeUUID := neededforUUID bufferUUID := make([]byte, bufferSizeUUID) err = implementation.CallFunction(implementation.Lib3MF_contentencryptionparams_getkeyuuid, implementation_contentencryptionparams.GetDLLInHandle(), Int64InValue(bufferSizeUUID), Int64OutValue(&filledinUUID), uintptr(unsafe.Pointer(&bufferUUID[0]))) - if err != nil { + if (err != nil) { return "", err } - - return string(bufferUUID[:(filledinUUID - 1)]), err + + return string(bufferUUID[:(filledinUUID-1)]), err } func (implementation *Lib3MFImplementation) ResourceData_GetPath(ResourceData Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hPath := implementation.NewHandle() - + implementation_resourcedata, err := implementation.GetWrapperHandle(ResourceData) - if err != nil { + if (err != nil) { return hPath, err } err = implementation.CallFunction(implementation.Lib3MF_resourcedata_getpath, implementation_resourcedata.GetDLLInHandle(), hPath.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hPath, err } - + return hPath, err } func (implementation *Lib3MFImplementation) ResourceData_GetEncryptionAlgorithm(ResourceData Lib3MFHandle) (ELib3MFEncryptionAlgorithm, error) { var err error = nil var eEncryptionAlgorithm uint64 = 0 - + implementation_resourcedata, err := implementation.GetWrapperHandle(ResourceData) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_resourcedata_getencryptionalgorithm, implementation_resourcedata.GetDLLInHandle(), UInt64OutValue(&eEncryptionAlgorithm)) - if err != nil { + if (err != nil) { return 0, err } - - return ELib3MFEncryptionAlgorithm(eEncryptionAlgorithm), err + + return ELib3MFEncryptionAlgorithm (eEncryptionAlgorithm), err } func (implementation *Lib3MFImplementation) ResourceData_GetCompression(ResourceData Lib3MFHandle) (ELib3MFCompression, error) { var err error = nil var eCompression uint64 = 0 - + implementation_resourcedata, err := implementation.GetWrapperHandle(ResourceData) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_resourcedata_getcompression, implementation_resourcedata.GetDLLInHandle(), UInt64OutValue(&eCompression)) - if err != nil { + if (err != nil) { return 0, err } - - return ELib3MFCompression(eCompression), err + + return ELib3MFCompression (eCompression), err } func (implementation *Lib3MFImplementation) ResourceData_GetAdditionalAuthenticationData(ResourceData Lib3MFHandle) ([]uint8, error) { @@ -7187,23 +8157,23 @@ func (implementation *Lib3MFImplementation) ResourceData_GetAdditionalAuthentica var neededforByteData int64 = 0 var filledinByteData int64 = 0 bufferByteData := make([]uint8, 0) - + implementation_resourcedata, err := implementation.GetWrapperHandle(ResourceData) - if err != nil { + if (err != nil) { return make([]uint8, 0), err } err = implementation.CallFunction(implementation.Lib3MF_resourcedata_getadditionalauthenticationdata, implementation_resourcedata.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforByteData), Int64InValue(0)) - if err != nil { + if (err != nil) { return make([]uint8, 0), err } bufferSizeByteData := neededforByteData bufferByteData = make([]uint8, bufferSizeByteData) err = implementation.CallFunction(implementation.Lib3MF_resourcedata_getadditionalauthenticationdata, implementation_resourcedata.GetDLLInHandle(), Int64InValue(bufferSizeByteData), Int64OutValue(&filledinByteData), uintptr(unsafe.Pointer(&bufferByteData[0]))) - if err != nil { + if (err != nil) { return make([]uint8, 0), err } - + return bufferByteData, err } @@ -7211,425 +8181,425 @@ func (implementation *Lib3MFImplementation) ResourceDataGroup_GetKeyUUID(Resourc var err error = nil var neededforUUID int64 = 0 var filledinUUID int64 = 0 - + implementation_resourcedatagroup, err := implementation.GetWrapperHandle(ResourceDataGroup) - if err != nil { + if (err != nil) { return "", err } err = implementation.CallFunction(implementation.Lib3MF_resourcedatagroup_getkeyuuid, implementation_resourcedatagroup.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforUUID), Int64InValue(0)) - if err != nil { + if (err != nil) { return "", err } bufferSizeUUID := neededforUUID bufferUUID := make([]byte, bufferSizeUUID) err = implementation.CallFunction(implementation.Lib3MF_resourcedatagroup_getkeyuuid, implementation_resourcedatagroup.GetDLLInHandle(), Int64InValue(bufferSizeUUID), Int64OutValue(&filledinUUID), uintptr(unsafe.Pointer(&bufferUUID[0]))) - if err != nil { + if (err != nil) { return "", err } - - return string(bufferUUID[:(filledinUUID - 1)]), err + + return string(bufferUUID[:(filledinUUID-1)]), err } func (implementation *Lib3MFImplementation) ResourceDataGroup_AddAccessRight(ResourceDataGroup Lib3MFHandle, Consumer Lib3MFHandle, eWrappingAlgorithm ELib3MFWrappingAlgorithm, eMgfAlgorithm ELib3MFMgfAlgorithm, eDigestMethod ELib3MFDigestMethod) (Lib3MFHandle, error) { var err error = nil hTheAccessRight := implementation.NewHandle() - + implementation_resourcedatagroup, err := implementation.GetWrapperHandle(ResourceDataGroup) - if err != nil { + if (err != nil) { return hTheAccessRight, err } implementation_consumer, err := implementation.GetWrapperHandle(Consumer) - if err != nil { + if (err != nil) { return hTheAccessRight, err } - + ConsumerDLLHandle := implementation_consumer.GetDLLInHandle() - if ConsumerDLLHandle == 0 { + if (ConsumerDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return hTheAccessRight, err } err = implementation.CallFunction(implementation.Lib3MF_resourcedatagroup_addaccessright, implementation_resourcedatagroup.GetDLLInHandle(), ConsumerDLLHandle, uintptr(eWrappingAlgorithm), uintptr(eMgfAlgorithm), uintptr(eDigestMethod), hTheAccessRight.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hTheAccessRight, err } - + return hTheAccessRight, err } func (implementation *Lib3MFImplementation) ResourceDataGroup_FindAccessRightByConsumer(ResourceDataGroup Lib3MFHandle, Consumer Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hTheAccessRight := implementation.NewHandle() - + implementation_resourcedatagroup, err := implementation.GetWrapperHandle(ResourceDataGroup) - if err != nil { + if (err != nil) { return hTheAccessRight, err } implementation_consumer, err := implementation.GetWrapperHandle(Consumer) - if err != nil { + if (err != nil) { return hTheAccessRight, err } - + ConsumerDLLHandle := implementation_consumer.GetDLLInHandle() - if ConsumerDLLHandle == 0 { + if (ConsumerDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return hTheAccessRight, err } err = implementation.CallFunction(implementation.Lib3MF_resourcedatagroup_findaccessrightbyconsumer, implementation_resourcedatagroup.GetDLLInHandle(), ConsumerDLLHandle, hTheAccessRight.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hTheAccessRight, err } - + return hTheAccessRight, err } -func (implementation *Lib3MFImplementation) ResourceDataGroup_RemoveAccessRight(ResourceDataGroup Lib3MFHandle, Consumer Lib3MFHandle) error { +func (implementation *Lib3MFImplementation) ResourceDataGroup_RemoveAccessRight(ResourceDataGroup Lib3MFHandle, Consumer Lib3MFHandle) (error) { var err error = nil - + implementation_resourcedatagroup, err := implementation.GetWrapperHandle(ResourceDataGroup) - if err != nil { + if (err != nil) { return err } implementation_consumer, err := implementation.GetWrapperHandle(Consumer) - if err != nil { + if (err != nil) { return err } - + ConsumerDLLHandle := implementation_consumer.GetDLLInHandle() - if ConsumerDLLHandle == 0 { + if (ConsumerDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return err } err = implementation.CallFunction(implementation.Lib3MF_resourcedatagroup_removeaccessright, implementation_resourcedatagroup.GetDLLInHandle(), ConsumerDLLHandle) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) KeyStore_AddConsumer(KeyStore Lib3MFHandle, sConsumerID string, sKeyID string, sKeyValue string) (Lib3MFHandle, error) { var err error = nil hConsumer := implementation.NewHandle() - + implementation_keystore, err := implementation.GetWrapperHandle(KeyStore) - if err != nil { + if (err != nil) { return hConsumer, err } err = implementation.CallFunction(implementation.Lib3MF_keystore_addconsumer, implementation_keystore.GetDLLInHandle(), StringInValue(sConsumerID), StringInValue(sKeyID), StringInValue(sKeyValue), hConsumer.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hConsumer, err } - + return hConsumer, err } func (implementation *Lib3MFImplementation) KeyStore_GetConsumerCount(KeyStore Lib3MFHandle) (uint64, error) { var err error = nil var nCount uint64 = 0 - + implementation_keystore, err := implementation.GetWrapperHandle(KeyStore) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_keystore_getconsumercount, implementation_keystore.GetDLLInHandle(), UInt64OutValue(&nCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint64(nCount), err } func (implementation *Lib3MFImplementation) KeyStore_GetConsumer(KeyStore Lib3MFHandle, nConsumerIndex uint64) (Lib3MFHandle, error) { var err error = nil hConsumer := implementation.NewHandle() - + implementation_keystore, err := implementation.GetWrapperHandle(KeyStore) - if err != nil { + if (err != nil) { return hConsumer, err } err = implementation.CallFunction(implementation.Lib3MF_keystore_getconsumer, implementation_keystore.GetDLLInHandle(), UInt64InValue(nConsumerIndex), hConsumer.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hConsumer, err } - + return hConsumer, err } -func (implementation *Lib3MFImplementation) KeyStore_RemoveConsumer(KeyStore Lib3MFHandle, Consumer Lib3MFHandle) error { +func (implementation *Lib3MFImplementation) KeyStore_RemoveConsumer(KeyStore Lib3MFHandle, Consumer Lib3MFHandle) (error) { var err error = nil - + implementation_keystore, err := implementation.GetWrapperHandle(KeyStore) - if err != nil { + if (err != nil) { return err } implementation_consumer, err := implementation.GetWrapperHandle(Consumer) - if err != nil { + if (err != nil) { return err } - + ConsumerDLLHandle := implementation_consumer.GetDLLInHandle() - if ConsumerDLLHandle == 0 { + if (ConsumerDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return err } err = implementation.CallFunction(implementation.Lib3MF_keystore_removeconsumer, implementation_keystore.GetDLLInHandle(), ConsumerDLLHandle) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) KeyStore_FindConsumer(KeyStore Lib3MFHandle, sConsumerID string) (Lib3MFHandle, error) { var err error = nil hConsumer := implementation.NewHandle() - + implementation_keystore, err := implementation.GetWrapperHandle(KeyStore) - if err != nil { + if (err != nil) { return hConsumer, err } err = implementation.CallFunction(implementation.Lib3MF_keystore_findconsumer, implementation_keystore.GetDLLInHandle(), StringInValue(sConsumerID), hConsumer.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hConsumer, err } - + return hConsumer, err } func (implementation *Lib3MFImplementation) KeyStore_GetResourceDataGroupCount(KeyStore Lib3MFHandle) (uint64, error) { var err error = nil var nCount uint64 = 0 - + implementation_keystore, err := implementation.GetWrapperHandle(KeyStore) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_keystore_getresourcedatagroupcount, implementation_keystore.GetDLLInHandle(), UInt64OutValue(&nCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint64(nCount), err } func (implementation *Lib3MFImplementation) KeyStore_AddResourceDataGroup(KeyStore Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hResourceDataGroup := implementation.NewHandle() - + implementation_keystore, err := implementation.GetWrapperHandle(KeyStore) - if err != nil { + if (err != nil) { return hResourceDataGroup, err } err = implementation.CallFunction(implementation.Lib3MF_keystore_addresourcedatagroup, implementation_keystore.GetDLLInHandle(), hResourceDataGroup.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResourceDataGroup, err } - + return hResourceDataGroup, err } func (implementation *Lib3MFImplementation) KeyStore_GetResourceDataGroup(KeyStore Lib3MFHandle, nResourceDataIndex uint64) (Lib3MFHandle, error) { var err error = nil hResourceDataGroup := implementation.NewHandle() - + implementation_keystore, err := implementation.GetWrapperHandle(KeyStore) - if err != nil { + if (err != nil) { return hResourceDataGroup, err } err = implementation.CallFunction(implementation.Lib3MF_keystore_getresourcedatagroup, implementation_keystore.GetDLLInHandle(), UInt64InValue(nResourceDataIndex), hResourceDataGroup.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResourceDataGroup, err } - + return hResourceDataGroup, err } -func (implementation *Lib3MFImplementation) KeyStore_RemoveResourceDataGroup(KeyStore Lib3MFHandle, ResourceDataGroup Lib3MFHandle) error { +func (implementation *Lib3MFImplementation) KeyStore_RemoveResourceDataGroup(KeyStore Lib3MFHandle, ResourceDataGroup Lib3MFHandle) (error) { var err error = nil - + implementation_keystore, err := implementation.GetWrapperHandle(KeyStore) - if err != nil { + if (err != nil) { return err } implementation_resourcedatagroup, err := implementation.GetWrapperHandle(ResourceDataGroup) - if err != nil { + if (err != nil) { return err } - + ResourceDataGroupDLLHandle := implementation_resourcedatagroup.GetDLLInHandle() - if ResourceDataGroupDLLHandle == 0 { + if (ResourceDataGroupDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return err } err = implementation.CallFunction(implementation.Lib3MF_keystore_removeresourcedatagroup, implementation_keystore.GetDLLInHandle(), ResourceDataGroupDLLHandle) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) KeyStore_FindResourceDataGroup(KeyStore Lib3MFHandle, PartPath Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hResourceDataGroup := implementation.NewHandle() - + implementation_keystore, err := implementation.GetWrapperHandle(KeyStore) - if err != nil { + if (err != nil) { return hResourceDataGroup, err } implementation_partpath, err := implementation.GetWrapperHandle(PartPath) - if err != nil { + if (err != nil) { return hResourceDataGroup, err } - + PartPathDLLHandle := implementation_partpath.GetDLLInHandle() - if PartPathDLLHandle == 0 { + if (PartPathDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return hResourceDataGroup, err } err = implementation.CallFunction(implementation.Lib3MF_keystore_findresourcedatagroup, implementation_keystore.GetDLLInHandle(), PartPathDLLHandle, hResourceDataGroup.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResourceDataGroup, err } - + return hResourceDataGroup, err } func (implementation *Lib3MFImplementation) KeyStore_AddResourceData(KeyStore Lib3MFHandle, ResourceDataGroup Lib3MFHandle, PartPath Lib3MFHandle, eAlgorithm ELib3MFEncryptionAlgorithm, eCompression ELib3MFCompression, AdditionalAuthenticationData []uint8) (Lib3MFHandle, error) { var err error = nil hResourceData := implementation.NewHandle() - + implementation_keystore, err := implementation.GetWrapperHandle(KeyStore) - if err != nil { + if (err != nil) { return hResourceData, err } implementation_resourcedatagroup, err := implementation.GetWrapperHandle(ResourceDataGroup) - if err != nil { + if (err != nil) { return hResourceData, err } - + ResourceDataGroupDLLHandle := implementation_resourcedatagroup.GetDLLInHandle() - if ResourceDataGroupDLLHandle == 0 { + if (ResourceDataGroupDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return hResourceData, err } implementation_partpath, err := implementation.GetWrapperHandle(PartPath) - if err != nil { + if (err != nil) { return hResourceData, err } - + PartPathDLLHandle := implementation_partpath.GetDLLInHandle() - if PartPathDLLHandle == 0 { + if (PartPathDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return hResourceData, err } err = implementation.CallFunction(implementation.Lib3MF_keystore_addresourcedata, implementation_keystore.GetDLLInHandle(), ResourceDataGroupDLLHandle, PartPathDLLHandle, uintptr(eAlgorithm), uintptr(eCompression), 0, 0, hResourceData.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResourceData, err } - + return hResourceData, err } -func (implementation *Lib3MFImplementation) KeyStore_RemoveResourceData(KeyStore Lib3MFHandle, ResourceData Lib3MFHandle) error { +func (implementation *Lib3MFImplementation) KeyStore_RemoveResourceData(KeyStore Lib3MFHandle, ResourceData Lib3MFHandle) (error) { var err error = nil - + implementation_keystore, err := implementation.GetWrapperHandle(KeyStore) - if err != nil { + if (err != nil) { return err } implementation_resourcedata, err := implementation.GetWrapperHandle(ResourceData) - if err != nil { + if (err != nil) { return err } - + ResourceDataDLLHandle := implementation_resourcedata.GetDLLInHandle() - if ResourceDataDLLHandle == 0 { + if (ResourceDataDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return err } err = implementation.CallFunction(implementation.Lib3MF_keystore_removeresourcedata, implementation_keystore.GetDLLInHandle(), ResourceDataDLLHandle) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) KeyStore_FindResourceData(KeyStore Lib3MFHandle, ResourcePath Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hResourceData := implementation.NewHandle() - + implementation_keystore, err := implementation.GetWrapperHandle(KeyStore) - if err != nil { + if (err != nil) { return hResourceData, err } implementation_resourcepath, err := implementation.GetWrapperHandle(ResourcePath) - if err != nil { + if (err != nil) { return hResourceData, err } - + ResourcePathDLLHandle := implementation_resourcepath.GetDLLInHandle() - if ResourcePathDLLHandle == 0 { + if (ResourcePathDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return hResourceData, err } err = implementation.CallFunction(implementation.Lib3MF_keystore_findresourcedata, implementation_keystore.GetDLLInHandle(), ResourcePathDLLHandle, hResourceData.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResourceData, err } - + return hResourceData, err } func (implementation *Lib3MFImplementation) KeyStore_GetResourceDataCount(KeyStore Lib3MFHandle) (uint64, error) { var err error = nil var nCount uint64 = 0 - + implementation_keystore, err := implementation.GetWrapperHandle(KeyStore) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_keystore_getresourcedatacount, implementation_keystore.GetDLLInHandle(), UInt64OutValue(&nCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint64(nCount), err } func (implementation *Lib3MFImplementation) KeyStore_GetResourceData(KeyStore Lib3MFHandle, nResourceDataIndex uint64) (Lib3MFHandle, error) { var err error = nil hResourceData := implementation.NewHandle() - + implementation_keystore, err := implementation.GetWrapperHandle(KeyStore) - if err != nil { + if (err != nil) { return hResourceData, err } err = implementation.CallFunction(implementation.Lib3MF_keystore_getresourcedata, implementation_keystore.GetDLLInHandle(), UInt64InValue(nResourceDataIndex), hResourceData.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResourceData, err } - + return hResourceData, err } @@ -7638,350 +8608,350 @@ func (implementation *Lib3MFImplementation) KeyStore_GetUUID(KeyStore Lib3MFHand var bHasUUID int64 = 0 var neededforUUID int64 = 0 var filledinUUID int64 = 0 - + implementation_keystore, err := implementation.GetWrapperHandle(KeyStore) - if err != nil { + if (err != nil) { return false, "", err } err = implementation.CallFunction(implementation.Lib3MF_keystore_getuuid, implementation_keystore.GetDLLInHandle(), Int64OutValue(&bHasUUID), Int64InValue(0), Int64OutValue(&neededforUUID), Int64InValue(0)) - if err != nil { + if (err != nil) { return false, "", err } bufferSizeUUID := neededforUUID bufferUUID := make([]byte, bufferSizeUUID) err = implementation.CallFunction(implementation.Lib3MF_keystore_getuuid, implementation_keystore.GetDLLInHandle(), Int64OutValue(&bHasUUID), Int64InValue(bufferSizeUUID), Int64OutValue(&filledinUUID), uintptr(unsafe.Pointer(&bufferUUID[0]))) - if err != nil { + if (err != nil) { return false, "", err } - - return (bHasUUID != 0), string(bufferUUID[:(filledinUUID - 1)]), err + + return (bHasUUID != 0), string(bufferUUID[:(filledinUUID-1)]), err } -func (implementation *Lib3MFImplementation) KeyStore_SetUUID(KeyStore Lib3MFHandle, sUUID string) error { +func (implementation *Lib3MFImplementation) KeyStore_SetUUID(KeyStore Lib3MFHandle, sUUID string) (error) { var err error = nil - + implementation_keystore, err := implementation.GetWrapperHandle(KeyStore) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_keystore_setuuid, implementation_keystore.GetDLLInHandle(), StringInValue(sUUID)) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Model_RootModelPart(Model Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hRootModelPart := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hRootModelPart, err } err = implementation.CallFunction(implementation.Lib3MF_model_rootmodelpart, implementation_model.GetDLLInHandle(), hRootModelPart.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hRootModelPart, err } - + return hRootModelPart, err } func (implementation *Lib3MFImplementation) Model_FindOrCreatePackagePart(Model Lib3MFHandle, sAbsolutePath string) (Lib3MFHandle, error) { var err error = nil hModelPart := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hModelPart, err } err = implementation.CallFunction(implementation.Lib3MF_model_findorcreatepackagepart, implementation_model.GetDLLInHandle(), StringInValue(sAbsolutePath), hModelPart.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hModelPart, err } - + return hModelPart, err } -func (implementation *Lib3MFImplementation) Model_SetUnit(Model Lib3MFHandle, eUnit ELib3MFModelUnit) error { +func (implementation *Lib3MFImplementation) Model_SetUnit(Model Lib3MFHandle, eUnit ELib3MFModelUnit) (error) { var err error = nil - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_model_setunit, implementation_model.GetDLLInHandle(), uintptr(eUnit)) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Model_GetUnit(Model Lib3MFHandle) (ELib3MFModelUnit, error) { var err error = nil var eUnit uint64 = 0 - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_model_getunit, implementation_model.GetDLLInHandle(), UInt64OutValue(&eUnit)) - if err != nil { + if (err != nil) { return 0, err } - - return ELib3MFModelUnit(eUnit), err + + return ELib3MFModelUnit (eUnit), err } func (implementation *Lib3MFImplementation) Model_GetLanguage(Model Lib3MFHandle) (string, error) { var err error = nil var neededforLanguage int64 = 0 var filledinLanguage int64 = 0 - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return "", err } err = implementation.CallFunction(implementation.Lib3MF_model_getlanguage, implementation_model.GetDLLInHandle(), Int64InValue(0), Int64OutValue(&neededforLanguage), Int64InValue(0)) - if err != nil { + if (err != nil) { return "", err } bufferSizeLanguage := neededforLanguage bufferLanguage := make([]byte, bufferSizeLanguage) err = implementation.CallFunction(implementation.Lib3MF_model_getlanguage, implementation_model.GetDLLInHandle(), Int64InValue(bufferSizeLanguage), Int64OutValue(&filledinLanguage), uintptr(unsafe.Pointer(&bufferLanguage[0]))) - if err != nil { + if (err != nil) { return "", err } - - return string(bufferLanguage[:(filledinLanguage - 1)]), err + + return string(bufferLanguage[:(filledinLanguage-1)]), err } -func (implementation *Lib3MFImplementation) Model_SetLanguage(Model Lib3MFHandle, sLanguage string) error { +func (implementation *Lib3MFImplementation) Model_SetLanguage(Model Lib3MFHandle, sLanguage string) (error) { var err error = nil - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_model_setlanguage, implementation_model.GetDLLInHandle(), StringInValue(sLanguage)) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Model_QueryWriter(Model Lib3MFHandle, sWriterClass string) (Lib3MFHandle, error) { var err error = nil hWriterInstance := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hWriterInstance, err } err = implementation.CallFunction(implementation.Lib3MF_model_querywriter, implementation_model.GetDLLInHandle(), StringInValue(sWriterClass), hWriterInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hWriterInstance, err } - + return hWriterInstance, err } func (implementation *Lib3MFImplementation) Model_QueryReader(Model Lib3MFHandle, sReaderClass string) (Lib3MFHandle, error) { var err error = nil hReaderInstance := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hReaderInstance, err } err = implementation.CallFunction(implementation.Lib3MF_model_queryreader, implementation_model.GetDLLInHandle(), StringInValue(sReaderClass), hReaderInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hReaderInstance, err } - + return hReaderInstance, err } func (implementation *Lib3MFImplementation) Model_GetTexture2DByID(Model Lib3MFHandle, nUniqueResourceID uint32) (Lib3MFHandle, error) { var err error = nil hTextureInstance := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hTextureInstance, err } err = implementation.CallFunction(implementation.Lib3MF_model_gettexture2dbyid, implementation_model.GetDLLInHandle(), UInt32InValue(nUniqueResourceID), hTextureInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hTextureInstance, err } - + return hTextureInstance, err } func (implementation *Lib3MFImplementation) Model_GetPropertyTypeByID(Model Lib3MFHandle, nUniqueResourceID uint32) (ELib3MFPropertyType, error) { var err error = nil var eThePropertyType uint64 = 0 - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_model_getpropertytypebyid, implementation_model.GetDLLInHandle(), UInt32InValue(nUniqueResourceID), UInt64OutValue(&eThePropertyType)) - if err != nil { + if (err != nil) { return 0, err } - - return ELib3MFPropertyType(eThePropertyType), err + + return ELib3MFPropertyType (eThePropertyType), err } func (implementation *Lib3MFImplementation) Model_GetBaseMaterialGroupByID(Model Lib3MFHandle, nUniqueResourceID uint32) (Lib3MFHandle, error) { var err error = nil hBaseMaterialGroupInstance := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hBaseMaterialGroupInstance, err } err = implementation.CallFunction(implementation.Lib3MF_model_getbasematerialgroupbyid, implementation_model.GetDLLInHandle(), UInt32InValue(nUniqueResourceID), hBaseMaterialGroupInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hBaseMaterialGroupInstance, err } - + return hBaseMaterialGroupInstance, err } func (implementation *Lib3MFImplementation) Model_GetTexture2DGroupByID(Model Lib3MFHandle, nUniqueResourceID uint32) (Lib3MFHandle, error) { var err error = nil hTexture2DGroupInstance := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hTexture2DGroupInstance, err } err = implementation.CallFunction(implementation.Lib3MF_model_gettexture2dgroupbyid, implementation_model.GetDLLInHandle(), UInt32InValue(nUniqueResourceID), hTexture2DGroupInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hTexture2DGroupInstance, err } - + return hTexture2DGroupInstance, err } func (implementation *Lib3MFImplementation) Model_GetCompositeMaterialsByID(Model Lib3MFHandle, nUniqueResourceID uint32) (Lib3MFHandle, error) { var err error = nil hCompositeMaterialsInstance := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hCompositeMaterialsInstance, err } err = implementation.CallFunction(implementation.Lib3MF_model_getcompositematerialsbyid, implementation_model.GetDLLInHandle(), UInt32InValue(nUniqueResourceID), hCompositeMaterialsInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hCompositeMaterialsInstance, err } - + return hCompositeMaterialsInstance, err } func (implementation *Lib3MFImplementation) Model_GetMultiPropertyGroupByID(Model Lib3MFHandle, nUniqueResourceID uint32) (Lib3MFHandle, error) { var err error = nil hMultiPropertyGroupInstance := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hMultiPropertyGroupInstance, err } err = implementation.CallFunction(implementation.Lib3MF_model_getmultipropertygroupbyid, implementation_model.GetDLLInHandle(), UInt32InValue(nUniqueResourceID), hMultiPropertyGroupInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hMultiPropertyGroupInstance, err } - + return hMultiPropertyGroupInstance, err } func (implementation *Lib3MFImplementation) Model_GetMeshObjectByID(Model Lib3MFHandle, nUniqueResourceID uint32) (Lib3MFHandle, error) { var err error = nil hMeshObjectInstance := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hMeshObjectInstance, err } err = implementation.CallFunction(implementation.Lib3MF_model_getmeshobjectbyid, implementation_model.GetDLLInHandle(), UInt32InValue(nUniqueResourceID), hMeshObjectInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hMeshObjectInstance, err } - + return hMeshObjectInstance, err } func (implementation *Lib3MFImplementation) Model_GetComponentsObjectByID(Model Lib3MFHandle, nUniqueResourceID uint32) (Lib3MFHandle, error) { var err error = nil hComponentsObjectInstance := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hComponentsObjectInstance, err } err = implementation.CallFunction(implementation.Lib3MF_model_getcomponentsobjectbyid, implementation_model.GetDLLInHandle(), UInt32InValue(nUniqueResourceID), hComponentsObjectInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hComponentsObjectInstance, err } - + return hComponentsObjectInstance, err } func (implementation *Lib3MFImplementation) Model_GetColorGroupByID(Model Lib3MFHandle, nUniqueResourceID uint32) (Lib3MFHandle, error) { var err error = nil hColorGroupInstance := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hColorGroupInstance, err } err = implementation.CallFunction(implementation.Lib3MF_model_getcolorgroupbyid, implementation_model.GetDLLInHandle(), UInt32InValue(nUniqueResourceID), hColorGroupInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hColorGroupInstance, err } - + return hColorGroupInstance, err } func (implementation *Lib3MFImplementation) Model_GetSliceStackByID(Model Lib3MFHandle, nUniqueResourceID uint32) (Lib3MFHandle, error) { var err error = nil hSliceStacInstance := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hSliceStacInstance, err } err = implementation.CallFunction(implementation.Lib3MF_model_getslicestackbyid, implementation_model.GetDLLInHandle(), UInt32InValue(nUniqueResourceID), hSliceStacInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hSliceStacInstance, err } - + return hSliceStacInstance, err } @@ -7990,770 +8960,851 @@ func (implementation *Lib3MFImplementation) Model_GetBuildUUID(Model Lib3MFHandl var bHasUUID int64 = 0 var neededforUUID int64 = 0 var filledinUUID int64 = 0 - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return false, "", err } err = implementation.CallFunction(implementation.Lib3MF_model_getbuilduuid, implementation_model.GetDLLInHandle(), Int64OutValue(&bHasUUID), Int64InValue(0), Int64OutValue(&neededforUUID), Int64InValue(0)) - if err != nil { + if (err != nil) { return false, "", err } bufferSizeUUID := neededforUUID bufferUUID := make([]byte, bufferSizeUUID) err = implementation.CallFunction(implementation.Lib3MF_model_getbuilduuid, implementation_model.GetDLLInHandle(), Int64OutValue(&bHasUUID), Int64InValue(bufferSizeUUID), Int64OutValue(&filledinUUID), uintptr(unsafe.Pointer(&bufferUUID[0]))) - if err != nil { + if (err != nil) { return false, "", err } - - return (bHasUUID != 0), string(bufferUUID[:(filledinUUID - 1)]), err + + return (bHasUUID != 0), string(bufferUUID[:(filledinUUID-1)]), err } -func (implementation *Lib3MFImplementation) Model_SetBuildUUID(Model Lib3MFHandle, sUUID string) error { +func (implementation *Lib3MFImplementation) Model_SetBuildUUID(Model Lib3MFHandle, sUUID string) (error) { var err error = nil - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_model_setbuilduuid, implementation_model.GetDLLInHandle(), StringInValue(sUUID)) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Model_GetBuildItems(Model Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hBuildItemIterator := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hBuildItemIterator, err } err = implementation.CallFunction(implementation.Lib3MF_model_getbuilditems, implementation_model.GetDLLInHandle(), hBuildItemIterator.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hBuildItemIterator, err } - + return hBuildItemIterator, err } func (implementation *Lib3MFImplementation) Model_GetOutbox(Model Lib3MFHandle) (sLib3MFBox, error) { var err error = nil var sOutbox sLib3MFBox - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return sOutbox, err } err = implementation.CallFunction(implementation.Lib3MF_model_getoutbox, implementation_model.GetDLLInHandle(), 0) - if err != nil { + if (err != nil) { return sOutbox, err } - + return sOutbox, err } func (implementation *Lib3MFImplementation) Model_GetResources(Model Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hResourceIterator := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hResourceIterator, err } err = implementation.CallFunction(implementation.Lib3MF_model_getresources, implementation_model.GetDLLInHandle(), hResourceIterator.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResourceIterator, err } - + return hResourceIterator, err } func (implementation *Lib3MFImplementation) Model_GetObjects(Model Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hResourceIterator := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hResourceIterator, err } err = implementation.CallFunction(implementation.Lib3MF_model_getobjects, implementation_model.GetDLLInHandle(), hResourceIterator.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResourceIterator, err } - + return hResourceIterator, err } func (implementation *Lib3MFImplementation) Model_GetMeshObjects(Model Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hResourceIterator := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hResourceIterator, err } err = implementation.CallFunction(implementation.Lib3MF_model_getmeshobjects, implementation_model.GetDLLInHandle(), hResourceIterator.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResourceIterator, err } - + return hResourceIterator, err } func (implementation *Lib3MFImplementation) Model_GetComponentsObjects(Model Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hResourceIterator := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hResourceIterator, err } err = implementation.CallFunction(implementation.Lib3MF_model_getcomponentsobjects, implementation_model.GetDLLInHandle(), hResourceIterator.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResourceIterator, err } - + return hResourceIterator, err } func (implementation *Lib3MFImplementation) Model_GetTexture2Ds(Model Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hResourceIterator := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hResourceIterator, err } err = implementation.CallFunction(implementation.Lib3MF_model_gettexture2ds, implementation_model.GetDLLInHandle(), hResourceIterator.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResourceIterator, err } - + return hResourceIterator, err } func (implementation *Lib3MFImplementation) Model_GetBaseMaterialGroups(Model Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hResourceIterator := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hResourceIterator, err } err = implementation.CallFunction(implementation.Lib3MF_model_getbasematerialgroups, implementation_model.GetDLLInHandle(), hResourceIterator.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResourceIterator, err } - + return hResourceIterator, err } func (implementation *Lib3MFImplementation) Model_GetColorGroups(Model Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hResourceIterator := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hResourceIterator, err } err = implementation.CallFunction(implementation.Lib3MF_model_getcolorgroups, implementation_model.GetDLLInHandle(), hResourceIterator.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResourceIterator, err } - + return hResourceIterator, err } func (implementation *Lib3MFImplementation) Model_GetTexture2DGroups(Model Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hResourceIterator := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hResourceIterator, err } err = implementation.CallFunction(implementation.Lib3MF_model_gettexture2dgroups, implementation_model.GetDLLInHandle(), hResourceIterator.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResourceIterator, err } - + return hResourceIterator, err } func (implementation *Lib3MFImplementation) Model_GetCompositeMaterials(Model Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hResourceIterator := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hResourceIterator, err } err = implementation.CallFunction(implementation.Lib3MF_model_getcompositematerials, implementation_model.GetDLLInHandle(), hResourceIterator.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResourceIterator, err } - + return hResourceIterator, err } func (implementation *Lib3MFImplementation) Model_GetMultiPropertyGroups(Model Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hResourceIterator := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hResourceIterator, err } err = implementation.CallFunction(implementation.Lib3MF_model_getmultipropertygroups, implementation_model.GetDLLInHandle(), hResourceIterator.GetDLLOutHandle()) - if err != nil { + if (err != nil) { + return hResourceIterator, err + } + + return hResourceIterator, err +} + +func (implementation *Lib3MFImplementation) Model_GetToolpaths(Model Lib3MFHandle) (Lib3MFHandle, error) { + var err error = nil + hResourceIterator := implementation.NewHandle() + + implementation_model, err := implementation.GetWrapperHandle(Model) + if (err != nil) { return hResourceIterator, err } + err = implementation.CallFunction(implementation.Lib3MF_model_gettoolpaths, implementation_model.GetDLLInHandle(), hResourceIterator.GetDLLOutHandle()) + if (err != nil) { + return hResourceIterator, err + } + return hResourceIterator, err } func (implementation *Lib3MFImplementation) Model_GetSliceStacks(Model Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hResourceIterator := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hResourceIterator, err } err = implementation.CallFunction(implementation.Lib3MF_model_getslicestacks, implementation_model.GetDLLInHandle(), hResourceIterator.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hResourceIterator, err } - + return hResourceIterator, err } func (implementation *Lib3MFImplementation) Model_MergeToModel(Model Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hMergedModelInstance := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hMergedModelInstance, err } err = implementation.CallFunction(implementation.Lib3MF_model_mergetomodel, implementation_model.GetDLLInHandle(), hMergedModelInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hMergedModelInstance, err } - + return hMergedModelInstance, err } func (implementation *Lib3MFImplementation) Model_AddMeshObject(Model Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hMeshObjectInstance := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hMeshObjectInstance, err } err = implementation.CallFunction(implementation.Lib3MF_model_addmeshobject, implementation_model.GetDLLInHandle(), hMeshObjectInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hMeshObjectInstance, err } - + return hMeshObjectInstance, err } func (implementation *Lib3MFImplementation) Model_AddComponentsObject(Model Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hComponentsObjectInstance := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hComponentsObjectInstance, err } err = implementation.CallFunction(implementation.Lib3MF_model_addcomponentsobject, implementation_model.GetDLLInHandle(), hComponentsObjectInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hComponentsObjectInstance, err } - + return hComponentsObjectInstance, err } func (implementation *Lib3MFImplementation) Model_AddSliceStack(Model Lib3MFHandle, dZBottom float64) (Lib3MFHandle, error) { var err error = nil hSliceStackInstance := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hSliceStackInstance, err } err = implementation.CallFunction(implementation.Lib3MF_model_addslicestack, implementation_model.GetDLLInHandle(), Float64InValue(dZBottom), hSliceStackInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hSliceStackInstance, err } - + return hSliceStackInstance, err } func (implementation *Lib3MFImplementation) Model_AddTexture2DFromAttachment(Model Lib3MFHandle, TextureAttachment Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hTexture2DInstance := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hTexture2DInstance, err } implementation_textureattachment, err := implementation.GetWrapperHandle(TextureAttachment) - if err != nil { + if (err != nil) { return hTexture2DInstance, err } - + TextureAttachmentDLLHandle := implementation_textureattachment.GetDLLInHandle() - if TextureAttachmentDLLHandle == 0 { + if (TextureAttachmentDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return hTexture2DInstance, err } err = implementation.CallFunction(implementation.Lib3MF_model_addtexture2dfromattachment, implementation_model.GetDLLInHandle(), TextureAttachmentDLLHandle, hTexture2DInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hTexture2DInstance, err } - + return hTexture2DInstance, err } func (implementation *Lib3MFImplementation) Model_AddBaseMaterialGroup(Model Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hBaseMaterialGroupInstance := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hBaseMaterialGroupInstance, err } err = implementation.CallFunction(implementation.Lib3MF_model_addbasematerialgroup, implementation_model.GetDLLInHandle(), hBaseMaterialGroupInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hBaseMaterialGroupInstance, err } - + return hBaseMaterialGroupInstance, err } func (implementation *Lib3MFImplementation) Model_AddColorGroup(Model Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hColorGroupInstance := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hColorGroupInstance, err } err = implementation.CallFunction(implementation.Lib3MF_model_addcolorgroup, implementation_model.GetDLLInHandle(), hColorGroupInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hColorGroupInstance, err } - + return hColorGroupInstance, err } func (implementation *Lib3MFImplementation) Model_AddTexture2DGroup(Model Lib3MFHandle, Texture2DInstance Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hTexture2DGroupInstance := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hTexture2DGroupInstance, err } implementation_texture2dinstance, err := implementation.GetWrapperHandle(Texture2DInstance) - if err != nil { + if (err != nil) { return hTexture2DGroupInstance, err } - + Texture2DInstanceDLLHandle := implementation_texture2dinstance.GetDLLInHandle() - if Texture2DInstanceDLLHandle == 0 { + if (Texture2DInstanceDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return hTexture2DGroupInstance, err } err = implementation.CallFunction(implementation.Lib3MF_model_addtexture2dgroup, implementation_model.GetDLLInHandle(), Texture2DInstanceDLLHandle, hTexture2DGroupInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hTexture2DGroupInstance, err } - + return hTexture2DGroupInstance, err } func (implementation *Lib3MFImplementation) Model_AddCompositeMaterials(Model Lib3MFHandle, BaseMaterialGroupInstance Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hCompositeMaterialsInstance := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hCompositeMaterialsInstance, err } implementation_basematerialgroupinstance, err := implementation.GetWrapperHandle(BaseMaterialGroupInstance) - if err != nil { + if (err != nil) { return hCompositeMaterialsInstance, err } - + BaseMaterialGroupInstanceDLLHandle := implementation_basematerialgroupinstance.GetDLLInHandle() - if BaseMaterialGroupInstanceDLLHandle == 0 { + if (BaseMaterialGroupInstanceDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return hCompositeMaterialsInstance, err } err = implementation.CallFunction(implementation.Lib3MF_model_addcompositematerials, implementation_model.GetDLLInHandle(), BaseMaterialGroupInstanceDLLHandle, hCompositeMaterialsInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hCompositeMaterialsInstance, err } - + return hCompositeMaterialsInstance, err } func (implementation *Lib3MFImplementation) Model_AddMultiPropertyGroup(Model Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hMultiPropertyGroupInstance := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hMultiPropertyGroupInstance, err } err = implementation.CallFunction(implementation.Lib3MF_model_addmultipropertygroup, implementation_model.GetDLLInHandle(), hMultiPropertyGroupInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hMultiPropertyGroupInstance, err } - + return hMultiPropertyGroupInstance, err } func (implementation *Lib3MFImplementation) Model_AddBuildItem(Model Lib3MFHandle, Object Lib3MFHandle, sTransform sLib3MFTransform) (Lib3MFHandle, error) { var err error = nil hBuildItemInstance := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hBuildItemInstance, err } implementation_object, err := implementation.GetWrapperHandle(Object) - if err != nil { + if (err != nil) { return hBuildItemInstance, err } - + ObjectDLLHandle := implementation_object.GetDLLInHandle() - if ObjectDLLHandle == 0 { + if (ObjectDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return hBuildItemInstance, err } err = implementation.CallFunction(implementation.Lib3MF_model_addbuilditem, implementation_model.GetDLLInHandle(), ObjectDLLHandle, uintptr(unsafe.Pointer(&sTransform)), hBuildItemInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hBuildItemInstance, err } - + return hBuildItemInstance, err } -func (implementation *Lib3MFImplementation) Model_RemoveBuildItem(Model Lib3MFHandle, BuildItemInstance Lib3MFHandle) error { +func (implementation *Lib3MFImplementation) Model_RemoveBuildItem(Model Lib3MFHandle, BuildItemInstance Lib3MFHandle) (error) { var err error = nil - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return err } implementation_builditeminstance, err := implementation.GetWrapperHandle(BuildItemInstance) - if err != nil { + if (err != nil) { return err } - + BuildItemInstanceDLLHandle := implementation_builditeminstance.GetDLLInHandle() - if BuildItemInstanceDLLHandle == 0 { + if (BuildItemInstanceDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return err } err = implementation.CallFunction(implementation.Lib3MF_model_removebuilditem, implementation_model.GetDLLInHandle(), BuildItemInstanceDLLHandle) - if err != nil { + if (err != nil) { return err } - + return err } +func (implementation *Lib3MFImplementation) Model_AddToolpath(Model Lib3MFHandle, dUnitFactor float64) (Lib3MFHandle, error) { + var err error = nil + hToolpathInstance := implementation.NewHandle() + + implementation_model, err := implementation.GetWrapperHandle(Model) + if (err != nil) { + return hToolpathInstance, err + } + + err = implementation.CallFunction(implementation.Lib3MF_model_addtoolpath, implementation_model.GetDLLInHandle(), Float64InValue(dUnitFactor), hToolpathInstance.GetDLLOutHandle()) + if (err != nil) { + return hToolpathInstance, err + } + + return hToolpathInstance, err +} + func (implementation *Lib3MFImplementation) Model_GetMetaDataGroup(Model Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hTheMetaDataGroup := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hTheMetaDataGroup, err } err = implementation.CallFunction(implementation.Lib3MF_model_getmetadatagroup, implementation_model.GetDLLInHandle(), hTheMetaDataGroup.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hTheMetaDataGroup, err } - + return hTheMetaDataGroup, err } func (implementation *Lib3MFImplementation) Model_AddAttachment(Model Lib3MFHandle, sURI string, sRelationShipType string) (Lib3MFHandle, error) { var err error = nil hAttachmentInstance := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hAttachmentInstance, err } err = implementation.CallFunction(implementation.Lib3MF_model_addattachment, implementation_model.GetDLLInHandle(), StringInValue(sURI), StringInValue(sRelationShipType), hAttachmentInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hAttachmentInstance, err } - + return hAttachmentInstance, err } -func (implementation *Lib3MFImplementation) Model_RemoveAttachment(Model Lib3MFHandle, AttachmentInstance Lib3MFHandle) error { +func (implementation *Lib3MFImplementation) Model_RemoveAttachment(Model Lib3MFHandle, AttachmentInstance Lib3MFHandle) (error) { var err error = nil - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return err } implementation_attachmentinstance, err := implementation.GetWrapperHandle(AttachmentInstance) - if err != nil { + if (err != nil) { return err } - + AttachmentInstanceDLLHandle := implementation_attachmentinstance.GetDLLInHandle() - if AttachmentInstanceDLLHandle == 0 { + if (AttachmentInstanceDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return err } err = implementation.CallFunction(implementation.Lib3MF_model_removeattachment, implementation_model.GetDLLInHandle(), AttachmentInstanceDLLHandle) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Model_GetAttachment(Model Lib3MFHandle, nIndex uint32) (Lib3MFHandle, error) { var err error = nil hAttachmentInstance := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hAttachmentInstance, err } err = implementation.CallFunction(implementation.Lib3MF_model_getattachment, implementation_model.GetDLLInHandle(), UInt32InValue(nIndex), hAttachmentInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hAttachmentInstance, err } - + return hAttachmentInstance, err } func (implementation *Lib3MFImplementation) Model_FindAttachment(Model Lib3MFHandle, sURI string) (Lib3MFHandle, error) { var err error = nil hAttachmentInstance := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hAttachmentInstance, err } err = implementation.CallFunction(implementation.Lib3MF_model_findattachment, implementation_model.GetDLLInHandle(), StringInValue(sURI), hAttachmentInstance.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hAttachmentInstance, err } - + return hAttachmentInstance, err } func (implementation *Lib3MFImplementation) Model_GetAttachmentCount(Model Lib3MFHandle) (uint32, error) { var err error = nil var nAttachmentCount uint32 = 0 - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return 0, err } err = implementation.CallFunction(implementation.Lib3MF_model_getattachmentcount, implementation_model.GetDLLInHandle(), UInt32OutValue(&nAttachmentCount)) - if err != nil { + if (err != nil) { return 0, err } - + return uint32(nAttachmentCount), err } func (implementation *Lib3MFImplementation) Model_HasPackageThumbnailAttachment(Model Lib3MFHandle) (bool, error) { var err error = nil var bHasThumbnail int64 = 0 - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return false, err } err = implementation.CallFunction(implementation.Lib3MF_model_haspackagethumbnailattachment, implementation_model.GetDLLInHandle(), Int64OutValue(&bHasThumbnail)) - if err != nil { + if (err != nil) { return false, err } - + return (bHasThumbnail != 0), err } func (implementation *Lib3MFImplementation) Model_CreatePackageThumbnailAttachment(Model Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hAttachment := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hAttachment, err } err = implementation.CallFunction(implementation.Lib3MF_model_createpackagethumbnailattachment, implementation_model.GetDLLInHandle(), hAttachment.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hAttachment, err } - + return hAttachment, err } func (implementation *Lib3MFImplementation) Model_GetPackageThumbnailAttachment(Model Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hAttachment := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hAttachment, err } err = implementation.CallFunction(implementation.Lib3MF_model_getpackagethumbnailattachment, implementation_model.GetDLLInHandle(), hAttachment.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hAttachment, err } - + return hAttachment, err } -func (implementation *Lib3MFImplementation) Model_RemovePackageThumbnailAttachment(Model Lib3MFHandle) error { +func (implementation *Lib3MFImplementation) Model_RemovePackageThumbnailAttachment(Model Lib3MFHandle) (error) { var err error = nil - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_model_removepackagethumbnailattachment, implementation_model.GetDLLInHandle()) - if err != nil { + if (err != nil) { return err } - + return err } -func (implementation *Lib3MFImplementation) Model_AddCustomContentType(Model Lib3MFHandle, sExtension string, sContentType string) error { +func (implementation *Lib3MFImplementation) Model_AddCustomContentType(Model Lib3MFHandle, sExtension string, sContentType string) (error) { var err error = nil - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_model_addcustomcontenttype, implementation_model.GetDLLInHandle(), StringInValue(sExtension), StringInValue(sContentType)) - if err != nil { + if (err != nil) { return err } - + return err } -func (implementation *Lib3MFImplementation) Model_RemoveCustomContentType(Model Lib3MFHandle, sExtension string) error { +func (implementation *Lib3MFImplementation) Model_RemoveCustomContentType(Model Lib3MFHandle, sExtension string) (error) { var err error = nil - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_model_removecustomcontenttype, implementation_model.GetDLLInHandle(), StringInValue(sExtension)) - if err != nil { + if (err != nil) { return err } - + return err } -func (implementation *Lib3MFImplementation) Model_SetRandomNumberCallback(Model Lib3MFHandle, pTheCallback int64, nUserData uint64) error { +func (implementation *Lib3MFImplementation) Model_SetRandomNumberCallback(Model Lib3MFHandle, pTheCallback int64, nUserData uint64) (error) { var err error = nil - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return err } err = implementation.CallFunction(implementation.Lib3MF_model_setrandomnumbercallback, implementation_model.GetDLLInHandle(), 0, UInt64InValue(nUserData)) - if err != nil { + if (err != nil) { return err } - + return err } func (implementation *Lib3MFImplementation) Model_GetKeyStore(Model Lib3MFHandle) (Lib3MFHandle, error) { var err error = nil hKeyStore := implementation.NewHandle() - + implementation_model, err := implementation.GetWrapperHandle(Model) - if err != nil { + if (err != nil) { return hKeyStore, err } err = implementation.CallFunction(implementation.Lib3MF_model_getkeystore, implementation_model.GetDLLInHandle(), hKeyStore.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hKeyStore, err } - + return hKeyStore, err } -/* -************************************************************************************************************************ +func (implementation *Lib3MFImplementation) Model_CreatePersistentSourceFromFile(Model Lib3MFHandle, sFilename string) (Lib3MFHandle, error) { + var err error = nil + hInstance := implementation.NewHandle() + + implementation_model, err := implementation.GetWrapperHandle(Model) + if (err != nil) { + return hInstance, err + } - Class definition Lib3MFWrapper + err = implementation.CallFunction(implementation.Lib3MF_model_createpersistentsourcefromfile, implementation_model.GetDLLInHandle(), StringInValue(sFilename), hInstance.GetDLLOutHandle()) + if (err != nil) { + return hInstance, err + } + + return hInstance, err +} -************************************************************************************************************************* -*/ +func (implementation *Lib3MFImplementation) Model_CreatePersistentSourceFromBuffer(Model Lib3MFHandle, Buffer []uint8) (Lib3MFHandle, error) { + var err error = nil + hInstance := implementation.NewHandle() + + implementation_model, err := implementation.GetWrapperHandle(Model) + if (err != nil) { + return hInstance, err + } + + err = implementation.CallFunction(implementation.Lib3MF_model_createpersistentsourcefrombuffer, implementation_model.GetDLLInHandle(), 0, 0, hInstance.GetDLLOutHandle()) + if (err != nil) { + return hInstance, err + } + + return hInstance, err +} + +func (implementation *Lib3MFImplementation) Model_CreatePersistentSourceFromCallback(Model Lib3MFHandle, pTheReadCallback int64, nStreamSize uint64, pTheSeekCallback int64, nUserData uint64) (Lib3MFHandle, error) { + var err error = nil + hInstance := implementation.NewHandle() + + implementation_model, err := implementation.GetWrapperHandle(Model) + if (err != nil) { + return hInstance, err + } + + err = implementation.CallFunction(implementation.Lib3MF_model_createpersistentsourcefromcallback, implementation_model.GetDLLInHandle(), 0, UInt64InValue(nStreamSize), 0, UInt64InValue(nUserData), hInstance.GetDLLOutHandle()) + if (err != nil) { + return hInstance, err + } + + return hInstance, err +} + + +/************************************************************************************************************************* + Class definition Lib3MFWrapper +**************************************************************************************************************************/ type Lib3MFWrapper struct { Interface Lib3MFGoInterface } - func (implementation *Lib3MFImplementation) GetLibraryVersion() (uint32, uint32, uint32, error) { var err error = nil var nMajor uint32 = 0 @@ -8761,10 +9812,10 @@ func (implementation *Lib3MFImplementation) GetLibraryVersion() (uint32, uint32, var nMicro uint32 = 0 err = implementation.CallFunction(implementation.Lib3MF_getlibraryversion, UInt32OutValue(&nMajor), UInt32OutValue(&nMinor), UInt32OutValue(&nMicro)) - if err != nil { + if (err != nil) { return 0, 0, 0, err } - + return uint32(nMajor), uint32(nMinor), uint32(nMicro), err } @@ -8775,17 +9826,17 @@ func (implementation *Lib3MFImplementation) GetPrereleaseInformation() (bool, st var filledinPrereleaseInfo int64 = 0 err = implementation.CallFunction(implementation.Lib3MF_getprereleaseinformation, Int64OutValue(&bHasPrereleaseInfo), Int64InValue(0), Int64OutValue(&neededforPrereleaseInfo), Int64InValue(0)) - if err != nil { + if (err != nil) { return false, "", err } bufferSizePrereleaseInfo := neededforPrereleaseInfo bufferPrereleaseInfo := make([]byte, bufferSizePrereleaseInfo) err = implementation.CallFunction(implementation.Lib3MF_getprereleaseinformation, Int64OutValue(&bHasPrereleaseInfo), Int64InValue(bufferSizePrereleaseInfo), Int64OutValue(&filledinPrereleaseInfo), uintptr(unsafe.Pointer(&bufferPrereleaseInfo[0]))) - if err != nil { + if (err != nil) { return false, "", err } - - return (bHasPrereleaseInfo != 0), string(bufferPrereleaseInfo[:(filledinPrereleaseInfo - 1)]), err + + return (bHasPrereleaseInfo != 0), string(bufferPrereleaseInfo[:(filledinPrereleaseInfo-1)]), err } func (implementation *Lib3MFImplementation) GetBuildInformation() (bool, string, error) { @@ -8795,17 +9846,17 @@ func (implementation *Lib3MFImplementation) GetBuildInformation() (bool, string, var filledinBuildInformation int64 = 0 err = implementation.CallFunction(implementation.Lib3MF_getbuildinformation, Int64OutValue(&bHasBuildInfo), Int64InValue(0), Int64OutValue(&neededforBuildInformation), Int64InValue(0)) - if err != nil { + if (err != nil) { return false, "", err } bufferSizeBuildInformation := neededforBuildInformation bufferBuildInformation := make([]byte, bufferSizeBuildInformation) err = implementation.CallFunction(implementation.Lib3MF_getbuildinformation, Int64OutValue(&bHasBuildInfo), Int64InValue(bufferSizeBuildInformation), Int64OutValue(&filledinBuildInformation), uintptr(unsafe.Pointer(&bufferBuildInformation[0]))) - if err != nil { + if (err != nil) { return false, "", err } - - return (bHasBuildInfo != 0), string(bufferBuildInformation[:(filledinBuildInformation - 1)]), err + + return (bHasBuildInfo != 0), string(bufferBuildInformation[:(filledinBuildInformation-1)]), err } func (implementation *Lib3MFImplementation) GetSpecificationVersion(sSpecificationURL string) (bool, uint32, uint32, uint32, error) { @@ -8816,10 +9867,10 @@ func (implementation *Lib3MFImplementation) GetSpecificationVersion(sSpecificati var nMicro uint32 = 0 err = implementation.CallFunction(implementation.Lib3MF_getspecificationversion, StringInValue(sSpecificationURL), Int64OutValue(&bIsSupported), UInt32OutValue(&nMajor), UInt32OutValue(&nMinor), UInt32OutValue(&nMicro)) - if err != nil { + if (err != nil) { return false, 0, 0, 0, err } - + return (bIsSupported != 0), uint32(nMajor), uint32(nMinor), uint32(nMicro), err } @@ -8828,63 +9879,63 @@ func (implementation *Lib3MFImplementation) CreateModel() (Lib3MFHandle, error) hModel := implementation.NewHandle() err = implementation.CallFunction(implementation.Lib3MF_createmodel, hModel.GetDLLOutHandle()) - if err != nil { + if (err != nil) { return hModel, err } - + return hModel, err } -func (implementation *Lib3MFImplementation) Release(Instance Lib3MFHandle) error { +func (implementation *Lib3MFImplementation) Release(Instance Lib3MFHandle) (error) { var err error = nil implementation_instance, err := implementation.GetWrapperHandle(Instance) - if err != nil { + if (err != nil) { return err } - + InstanceDLLHandle := implementation_instance.GetDLLInHandle() - if InstanceDLLHandle == 0 { + if (InstanceDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return err } err = implementation.CallFunction(implementation.Lib3MF_release, InstanceDLLHandle) - if err != nil { + if (err != nil) { return err } - + return err } -func (implementation *Lib3MFImplementation) Acquire(Instance Lib3MFHandle) error { +func (implementation *Lib3MFImplementation) Acquire(Instance Lib3MFHandle) (error) { var err error = nil implementation_instance, err := implementation.GetWrapperHandle(Instance) - if err != nil { + if (err != nil) { return err } - + InstanceDLLHandle := implementation_instance.GetDLLInHandle() - if InstanceDLLHandle == 0 { + if (InstanceDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return err } err = implementation.CallFunction(implementation.Lib3MF_acquire, InstanceDLLHandle) - if err != nil { + if (err != nil) { return err } - + return err } -func (implementation *Lib3MFImplementation) SetJournal(sJournalPath string) error { +func (implementation *Lib3MFImplementation) SetJournal(sJournalPath string) (error) { var err error = nil err = implementation.CallFunction(implementation.Lib3MF_setjournal, StringInValue(sJournalPath)) - if err != nil { + if (err != nil) { return err } - + return err } @@ -8894,28 +9945,28 @@ func (implementation *Lib3MFImplementation) GetLastError(Instance Lib3MFHandle) var filledinLastErrorString int64 = 0 var bHasLastError int64 = 0 implementation_instance, err := implementation.GetWrapperHandle(Instance) - if err != nil { + if (err != nil) { return "", false, err } - + InstanceDLLHandle := implementation_instance.GetDLLInHandle() - if InstanceDLLHandle == 0 { + if (InstanceDLLHandle == 0) { err := fmt.Errorf("Handle must not be 0.") return "", false, err } err = implementation.CallFunction(implementation.Lib3MF_getlasterror, InstanceDLLHandle, Int64InValue(0), Int64OutValue(&neededforLastErrorString), Int64InValue(0), Int64OutValue(&bHasLastError)) - if err != nil { + if (err != nil) { return "", false, err } bufferSizeLastErrorString := neededforLastErrorString bufferLastErrorString := make([]byte, bufferSizeLastErrorString) err = implementation.CallFunction(implementation.Lib3MF_getlasterror, InstanceDLLHandle, Int64InValue(bufferSizeLastErrorString), Int64OutValue(&filledinLastErrorString), uintptr(unsafe.Pointer(&bufferLastErrorString[0])), Int64OutValue(&bHasLastError)) - if err != nil { + if (err != nil) { return "", false, err } - - return string(bufferLastErrorString[:(filledinLastErrorString - 1)]), (bHasLastError != 0), err + + return string(bufferLastErrorString[:(filledinLastErrorString-1)]), (bHasLastError != 0), err } func (implementation *Lib3MFImplementation) GetSymbolLookupMethod() (uint64, error) { @@ -8923,10 +9974,10 @@ func (implementation *Lib3MFImplementation) GetSymbolLookupMethod() (uint64, err var nSymbolLookupMethod uint64 = 0 err = implementation.CallFunction(implementation.Lib3MF_getsymbollookupmethod, UInt64OutValue(&nSymbolLookupMethod)) - if err != nil { + if (err != nil) { return 0, err } - + return nSymbolLookupMethod, err } @@ -8936,17 +9987,17 @@ func (implementation *Lib3MFImplementation) RetrieveProgressMessage(eTheProgress var filledinProgressMessage int64 = 0 err = implementation.CallFunction(implementation.Lib3MF_retrieveprogressmessage, uintptr(eTheProgressIdentifier), Int64InValue(0), Int64OutValue(&neededforProgressMessage), Int64InValue(0)) - if err != nil { + if (err != nil) { return "", err } bufferSizeProgressMessage := neededforProgressMessage bufferProgressMessage := make([]byte, bufferSizeProgressMessage) err = implementation.CallFunction(implementation.Lib3MF_retrieveprogressmessage, uintptr(eTheProgressIdentifier), Int64InValue(bufferSizeProgressMessage), Int64OutValue(&filledinProgressMessage), uintptr(unsafe.Pointer(&bufferProgressMessage[0]))) - if err != nil { + if (err != nil) { return "", err } - - return string(bufferProgressMessage[:(filledinProgressMessage - 1)]), err + + return string(bufferProgressMessage[:(filledinProgressMessage-1)]), err } func (implementation *Lib3MFImplementation) RGBAToColor(nRed uint8, nGreen uint8, nBlue uint8, nAlpha uint8) (sLib3MFColor, error) { @@ -8954,10 +10005,10 @@ func (implementation *Lib3MFImplementation) RGBAToColor(nRed uint8, nGreen uint8 var sTheColor sLib3MFColor err = implementation.CallFunction(implementation.Lib3MF_rgbatocolor, UInt8InValue(nRed), UInt8InValue(nGreen), UInt8InValue(nBlue), UInt8InValue(nAlpha), 0) - if err != nil { + if (err != nil) { return sTheColor, err } - + return sTheColor, err } @@ -8966,10 +10017,10 @@ func (implementation *Lib3MFImplementation) FloatRGBAToColor(fRed float32, fGree var sTheColor sLib3MFColor err = implementation.CallFunction(implementation.Lib3MF_floatrgbatocolor, Float32InValue(fRed), Float32InValue(fGreen), Float32InValue(fBlue), Float32InValue(fAlpha), 0) - if err != nil { + if (err != nil) { return sTheColor, err } - + return sTheColor, err } @@ -8981,10 +10032,10 @@ func (implementation *Lib3MFImplementation) ColorToRGBA(sTheColor sLib3MFColor) var nAlpha uint8 = 0 err = implementation.CallFunction(implementation.Lib3MF_colortorgba, uintptr(unsafe.Pointer(&sTheColor)), UInt8OutValue(&nRed), UInt8OutValue(&nGreen), UInt8OutValue(&nBlue), UInt8OutValue(&nAlpha)) - if err != nil { + if (err != nil) { return 0, 0, 0, 0, err } - + return uint8(nRed), uint8(nGreen), uint8(nBlue), uint8(nAlpha), err } @@ -8996,10 +10047,10 @@ func (implementation *Lib3MFImplementation) ColorToFloatRGBA(sTheColor sLib3MFCo var fAlpha float32 = 0 err = implementation.CallFunction(implementation.Lib3MF_colortofloatrgba, uintptr(unsafe.Pointer(&sTheColor)), Float32OutValue(&fRed), Float32OutValue(&fGreen), Float32OutValue(&fBlue), Float32OutValue(&fAlpha)) - if err != nil { + if (err != nil) { return 0, 0, 0, 0, err } - + return fRed, fGreen, fBlue, fAlpha, err } @@ -9008,10 +10059,10 @@ func (implementation *Lib3MFImplementation) GetIdentityTransform() (sLib3MFTrans var sTransform sLib3MFTransform err = implementation.CallFunction(implementation.Lib3MF_getidentitytransform, 0) - if err != nil { + if (err != nil) { return sTransform, err } - + return sTransform, err } @@ -9020,10 +10071,10 @@ func (implementation *Lib3MFImplementation) GetUniformScaleTransform(fFactor flo var sTransform sLib3MFTransform err = implementation.CallFunction(implementation.Lib3MF_getuniformscaletransform, Float32InValue(fFactor), 0) - if err != nil { + if (err != nil) { return sTransform, err } - + return sTransform, err } @@ -9032,10 +10083,10 @@ func (implementation *Lib3MFImplementation) GetScaleTransform(fFactorX float32, var sTransform sLib3MFTransform err = implementation.CallFunction(implementation.Lib3MF_getscaletransform, Float32InValue(fFactorX), Float32InValue(fFactorY), Float32InValue(fFactorZ), 0) - if err != nil { + if (err != nil) { return sTransform, err } - + return sTransform, err } @@ -9044,39 +10095,41 @@ func (implementation *Lib3MFImplementation) GetTranslationTransform(fVectorX flo var sTransform sLib3MFTransform err = implementation.CallFunction(implementation.Lib3MF_gettranslationtransform, Float32InValue(fVectorX), Float32InValue(fVectorY), Float32InValue(fVectorZ), 0) - if err != nil { + if (err != nil) { return sTransform, err } - + return sTransform, err } -func (implementation *Lib3MFImplementation) checkBinaryVersion() error { - var nBindingMajor uint32 = 2 - var nBindingMinor uint32 = 3 + +func (implementation *Lib3MFImplementation) checkBinaryVersion() (error) { + var nBindingMajor uint32 = 2; + var nBindingMinor uint32 = 3; nMajor, nMinor, _, err := implementation.GetLibraryVersion() - if err != nil { - return err + if (err != nil) { + return err; } - if (nMajor != nBindingMajor) || (nMinor < nBindingMinor) { - return fmt.Errorf("Lib3MF Error: 25 (%s)", int(0), GetLib3MFErrorMessage(uint32(0))) + if ( (nMajor != nBindingMajor) || (nMinor < nBindingMinor) ) { + return fmt.Errorf("Lib3MF Error: 25 (%s)", int(0), GetLib3MFErrorMessage(uint32(0))); } return nil } func Lib3MFLoadWrapper(DllFileName string) (Lib3MFWrapper, error) { - var Wrapper Lib3MFWrapper - var Instance Lib3MFImplementation - - err := Instance.Initialize(DllFileName) - if err != nil { - return Wrapper, err + var Wrapper Lib3MFWrapper; + var Instance Lib3MFImplementation; + + err := Instance.Initialize(DllFileName); + if (err != nil) { + return Wrapper, err; } err = Instance.checkBinaryVersion() - if err != nil { - return Wrapper, err + if (err != nil) { + return Wrapper, err; } - Wrapper.Interface = &Instance - - return Wrapper, nil + Wrapper.Interface = &Instance; + + return Wrapper, nil; } + diff --git a/Autogenerated/Bindings/Go/lib3mf_types.h b/Autogenerated/Bindings/Go/lib3mf_types.h index 6f2dcf6a4..ed4941824 100644 --- a/Autogenerated/Bindings/Go/lib3mf_types.h +++ b/Autogenerated/Bindings/Go/lib3mf_types.h @@ -130,13 +130,27 @@ typedef void * Lib3MF_pvoid; #define LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER 140 /** A progress identifier is unknown */ #define LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT 141 /** An element buffer exceeds its spec limit */ #define LIB3MF_ERROR_INVALIDRESOURCE 142 /** A resource is invalid */ +#define LIB3MF_ERROR_INVALIDNODEINDEX 143 /** Invalid node index */ +#define LIB3MF_ERROR_INVALIDATTRIBUTEINDEX 144 /** Invalid attribute index */ +#define LIB3MF_ERROR_DUPLICATECUSTOMDATA 145 /** Duplicate custom data */ +#define LIB3MF_ERROR_CUSTOMDATANOTFOUND 146 /** Custom data not found */ #define LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE 2000 /** This object type is not valid for beamlattices */ #define LIB3MF_ERROR_INVALIDKEYSTORE 3000 /** The keystore object is invalid */ #define LIB3MF_ERROR_INVALIDKEYSTORECONSUMER 3001 /** The consumer keystore object is invalid */ #define LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND 3002 /** A consumer has not been found */ #define LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND 3003 /** A resource data has not been found */ #define LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED 3004 /** A Key or Conentent encryption callback has not been registered */ -#define LIB3MF_ERROR_INVALIDKEYSIZE 3005 /** The key siue is invalid */ +#define LIB3MF_ERROR_INVALIDKEYSIZE 3005 /** The key size is invalid */ +#define LIB3MF_ERROR_TOOLPATH_NOTWRITINGHEADER 4000 /** Not in toolpath header writing mode */ +#define LIB3MF_ERROR_TOOLPATH_NOTWRITINGDATA 4001 /** Not in toolpath data writing mode */ +#define LIB3MF_ERROR_TOOLPATH_DATAHASBEENWRITTEN 4002 /** Toolpath has already been written out */ +#define LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT 4003 /** Toolpath has an invalid number of points */ +#define LIB3MF_ERROR_TOOLPATH_ATTRIBUTEALREADYDEFINED 4004 /** Toolpath attribute already defined */ +#define LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE 4005 /** Toolpath attribute is of invalid type */ +#define LIB3MF_ERROR_EMPTYNAMESPACEPREFIX 4006 /** Empty namespace prefix. */ +#define LIB3MF_ERROR_EMPTYNAMESPACE 4007 /** Empty namespace. */ +#define LIB3MF_ERROR_INVALIDNAMESPACEPREFIX 4008 /** Invalid namespace prefix. */ +#define LIB3MF_ERROR_WRITERDOESNOTSUPPORTNAMESPACES 4009 /** Writer does not support namespaces. */ /************************************************************************************************************************* Error strings for Lib3MF @@ -181,13 +195,27 @@ inline const char * LIB3MF_GETERRORSTRING (Lib3MFResult nErrorCode) { case LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER: return "A progress identifier is unknown"; case LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT: return "An element buffer exceeds its spec limit"; case LIB3MF_ERROR_INVALIDRESOURCE: return "A resource is invalid"; + case LIB3MF_ERROR_INVALIDNODEINDEX: return "Invalid node index"; + case LIB3MF_ERROR_INVALIDATTRIBUTEINDEX: return "Invalid attribute index"; + case LIB3MF_ERROR_DUPLICATECUSTOMDATA: return "Duplicate custom data"; + case LIB3MF_ERROR_CUSTOMDATANOTFOUND: return "Custom data not found"; case LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE: return "This object type is not valid for beamlattices"; case LIB3MF_ERROR_INVALIDKEYSTORE: return "The keystore object is invalid"; case LIB3MF_ERROR_INVALIDKEYSTORECONSUMER: return "The consumer keystore object is invalid"; case LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND: return "A consumer has not been found"; case LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND: return "A resource data has not been found"; case LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED: return "A Key or Conentent encryption callback has not been registered"; - case LIB3MF_ERROR_INVALIDKEYSIZE: return "The key siue is invalid"; + case LIB3MF_ERROR_INVALIDKEYSIZE: return "The key size is invalid"; + case LIB3MF_ERROR_TOOLPATH_NOTWRITINGHEADER: return "Not in toolpath header writing mode"; + case LIB3MF_ERROR_TOOLPATH_NOTWRITINGDATA: return "Not in toolpath data writing mode"; + case LIB3MF_ERROR_TOOLPATH_DATAHASBEENWRITTEN: return "Toolpath has already been written out"; + case LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT: return "Toolpath has an invalid number of points"; + case LIB3MF_ERROR_TOOLPATH_ATTRIBUTEALREADYDEFINED: return "Toolpath attribute already defined"; + case LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE: return "Toolpath attribute is of invalid type"; + case LIB3MF_ERROR_EMPTYNAMESPACEPREFIX: return "Empty namespace prefix."; + case LIB3MF_ERROR_EMPTYNAMESPACE: return "Empty namespace."; + case LIB3MF_ERROR_INVALIDNAMESPACEPREFIX: return "Invalid namespace prefix."; + case LIB3MF_ERROR_WRITERDOESNOTSUPPORTNAMESPACES: return "Writer does not support namespaces."; default: return "unknown error"; } } @@ -197,11 +225,17 @@ inline const char * LIB3MF_GETERRORSTRING (Lib3MFResult nErrorCode) { **************************************************************************************************************************/ typedef Lib3MFHandle Lib3MF_Base; +typedef Lib3MFHandle Lib3MF_BinaryStream; typedef Lib3MFHandle Lib3MF_Writer; +typedef Lib3MFHandle Lib3MF_PersistentReaderSource; typedef Lib3MFHandle Lib3MF_Reader; typedef Lib3MFHandle Lib3MF_PackagePart; typedef Lib3MFHandle Lib3MF_Resource; typedef Lib3MFHandle Lib3MF_ResourceIterator; +typedef Lib3MFHandle Lib3MF_CustomXMLAttribute; +typedef Lib3MFHandle Lib3MF_CustomXMLNode; +typedef Lib3MFHandle Lib3MF_CustomXMLNodes; +typedef Lib3MFHandle Lib3MF_CustomDOMTree; typedef Lib3MFHandle Lib3MF_SliceStackIterator; typedef Lib3MFHandle Lib3MF_ObjectIterator; typedef Lib3MFHandle Lib3MF_MeshObjectIterator; @@ -230,6 +264,11 @@ typedef Lib3MFHandle Lib3MF_Texture2D; typedef Lib3MFHandle Lib3MF_BuildItem; typedef Lib3MFHandle Lib3MF_BuildItemIterator; typedef Lib3MFHandle Lib3MF_Slice; +typedef Lib3MFHandle Lib3MF_ToolpathProfile; +typedef Lib3MFHandle Lib3MF_ToolpathLayerReader; +typedef Lib3MFHandle Lib3MF_ToolpathLayerData; +typedef Lib3MFHandle Lib3MF_Toolpath; +typedef Lib3MFHandle Lib3MF_ToolpathIterator; typedef Lib3MFHandle Lib3MF_SliceStack; typedef Lib3MFHandle Lib3MF_Consumer; typedef Lib3MFHandle Lib3MF_AccessRight; @@ -257,6 +296,13 @@ typedef enum eLib3MFSlicesMeshResolution { eSlicesMeshResolutionLowres = 1 } eLib3MFSlicesMeshResolution; +typedef enum eLib3MFPersistentReaderSourceType { + ePersistentReaderSourceTypeUnknown = 0, + ePersistentReaderSourceTypeFileOnDisk = 1, + ePersistentReaderSourceTypeMemoryBuffer = 2, + ePersistentReaderSourceTypeCallback = 3 +} eLib3MFPersistentReaderSourceType; + typedef enum eLib3MFModelUnit { eModelUnitMicroMeter = 0, eModelUnitMilliMeter = 1, @@ -310,6 +356,11 @@ typedef enum eLib3MFBeamLatticeBallMode { eBeamLatticeBallModeAll = 2 } eLib3MFBeamLatticeBallMode; +typedef enum eLib3MFBinaryStreamPredictionType { + eBinaryStreamPredictionTypeNoPrediction = 0, + eBinaryStreamPredictionTypeDeltaPrediction = 1 +} eLib3MFBinaryStreamPredictionType; + typedef enum eLib3MFProgressIdentifier { eProgressIdentifierQUERYCANCELED = 0, eProgressIdentifierDONE = 1, @@ -343,6 +394,19 @@ typedef enum eLib3MFBlendMethod { eBlendMethodMultiply = 2 } eLib3MFBlendMethod; +typedef enum eLib3MFToolpathSegmentType { + eToolpathSegmentTypeUnknown = 0, + eToolpathSegmentTypeHatch = 1, + eToolpathSegmentTypeLoop = 2, + eToolpathSegmentTypePolyline = 3 +} eLib3MFToolpathSegmentType; + +typedef enum eLib3MFToolpathAttributeType { + eToolpathAttributeTypeUnknown = 0, + eToolpathAttributeTypeInteger = 1, + eToolpathAttributeTypeDouble = 2 +} eLib3MFToolpathAttributeType; + typedef enum eLib3MFEncryptionAlgorithm { eEncryptionAlgorithmAES256_GCM = 1 /** http://www.w3.org/2009/xmlenc11#aes256-gcm */ } eLib3MFEncryptionAlgorithm; @@ -383,6 +447,11 @@ typedef union { int m_code; } structEnumLib3MFSlicesMeshResolution; +typedef union { + eLib3MFPersistentReaderSourceType m_enum; + int m_code; +} structEnumLib3MFPersistentReaderSourceType; + typedef union { eLib3MFModelUnit m_enum; int m_code; @@ -423,6 +492,11 @@ typedef union { int m_code; } structEnumLib3MFBeamLatticeBallMode; +typedef union { + eLib3MFBinaryStreamPredictionType m_enum; + int m_code; +} structEnumLib3MFBinaryStreamPredictionType; + typedef union { eLib3MFProgressIdentifier m_enum; int m_code; @@ -433,6 +507,16 @@ typedef union { int m_code; } structEnumLib3MFBlendMethod; +typedef union { + eLib3MFToolpathSegmentType m_enum; + int m_code; +} structEnumLib3MFToolpathSegmentType; + +typedef union { + eLib3MFToolpathAttributeType m_enum; + int m_code; +} structEnumLib3MFToolpathAttributeType; + typedef union { eLib3MFEncryptionAlgorithm m_enum; int m_code; diff --git a/Autogenerated/Bindings/NodeJS/lib3mf_dynamic.cc b/Autogenerated/Bindings/NodeJS/lib3mf_dynamic.cc index e1cec341d..c561fda7f 100644 --- a/Autogenerated/Bindings/NodeJS/lib3mf_dynamic.cc +++ b/Autogenerated/Bindings/NodeJS/lib3mf_dynamic.cc @@ -49,6 +49,13 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_LibraryHandle = NULL; pWrapperTable->m_Base_ClassTypeId = NULL; + pWrapperTable->m_BinaryStream_GetBinaryPath = NULL; + pWrapperTable->m_BinaryStream_GetIndexPath = NULL; + pWrapperTable->m_BinaryStream_GetUUID = NULL; + pWrapperTable->m_BinaryStream_DisableDiscretizedArrayCompression = NULL; + pWrapperTable->m_BinaryStream_EnableDiscretizedArrayCompression = NULL; + pWrapperTable->m_BinaryStream_EnableLZMA = NULL; + pWrapperTable->m_BinaryStream_DisableLZMA = NULL; pWrapperTable->m_Writer_WriteToFile = NULL; pWrapperTable->m_Writer_GetStreamSize = NULL; pWrapperTable->m_Writer_WriteToBuffer = NULL; @@ -62,6 +69,13 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Writer_GetWarningCount = NULL; pWrapperTable->m_Writer_AddKeyWrappingCallback = NULL; pWrapperTable->m_Writer_SetContentEncryptionCallback = NULL; + pWrapperTable->m_Writer_CreateBinaryStream = NULL; + pWrapperTable->m_Writer_AssignBinaryStream = NULL; + pWrapperTable->m_Writer_RegisterCustomNamespace = NULL; + pWrapperTable->m_PersistentReaderSource_GetSourceType = NULL; + pWrapperTable->m_PersistentReaderSource_InvalidateSourceData = NULL; + pWrapperTable->m_PersistentReaderSource_SourceDataIsValid = NULL; + pWrapperTable->m_Reader_ReadFromPersistentSource = NULL; pWrapperTable->m_Reader_ReadFromFile = NULL; pWrapperTable->m_Reader_ReadFromBuffer = NULL; pWrapperTable->m_Reader_ReadFromCallback = NULL; @@ -86,6 +100,51 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_ResourceIterator_GetCurrent = NULL; pWrapperTable->m_ResourceIterator_Clone = NULL; pWrapperTable->m_ResourceIterator_Count = NULL; + pWrapperTable->m_CustomXMLAttribute_GetName = NULL; + pWrapperTable->m_CustomXMLAttribute_GetValue = NULL; + pWrapperTable->m_CustomXMLAttribute_IsValidInteger = NULL; + pWrapperTable->m_CustomXMLAttribute_GetIntegerValue = NULL; + pWrapperTable->m_CustomXMLAttribute_IsValidDouble = NULL; + pWrapperTable->m_CustomXMLAttribute_GetDoubleValue = NULL; + pWrapperTable->m_CustomXMLAttribute_IsValidBool = NULL; + pWrapperTable->m_CustomXMLAttribute_GetBoolValue = NULL; + pWrapperTable->m_CustomXMLAttribute_SetValue = NULL; + pWrapperTable->m_CustomXMLAttribute_SetIntegerValue = NULL; + pWrapperTable->m_CustomXMLAttribute_SetDoubleValue = NULL; + pWrapperTable->m_CustomXMLAttribute_SetBoolValue = NULL; + pWrapperTable->m_CustomXMLAttribute_Remove = NULL; + pWrapperTable->m_CustomXMLNode_GetName = NULL; + pWrapperTable->m_CustomXMLNode_GetNameSpace = NULL; + pWrapperTable->m_CustomXMLNode_GetAttributeCount = NULL; + pWrapperTable->m_CustomXMLNode_GetAttribute = NULL; + pWrapperTable->m_CustomXMLNode_HasAttribute = NULL; + pWrapperTable->m_CustomXMLNode_FindAttribute = NULL; + pWrapperTable->m_CustomXMLNode_RemoveAttribute = NULL; + pWrapperTable->m_CustomXMLNode_RemoveAttributeByIndex = NULL; + pWrapperTable->m_CustomXMLNode_AddAttribute = NULL; + pWrapperTable->m_CustomXMLNode_AddIntegerAttribute = NULL; + pWrapperTable->m_CustomXMLNode_AddDoubleAttribute = NULL; + pWrapperTable->m_CustomXMLNode_AddBoolAttribute = NULL; + pWrapperTable->m_CustomXMLNode_GetChildren = NULL; + pWrapperTable->m_CustomXMLNode_CountChildrenByName = NULL; + pWrapperTable->m_CustomXMLNode_GetChildrenByName = NULL; + pWrapperTable->m_CustomXMLNode_HasChild = NULL; + pWrapperTable->m_CustomXMLNode_HasUniqueChild = NULL; + pWrapperTable->m_CustomXMLNode_FindChild = NULL; + pWrapperTable->m_CustomXMLNode_AddChild = NULL; + pWrapperTable->m_CustomXMLNode_RemoveChild = NULL; + pWrapperTable->m_CustomXMLNode_RemoveChildrenWithName = NULL; + pWrapperTable->m_CustomXMLNode_Remove = NULL; + pWrapperTable->m_CustomXMLNodes_GetNodeCount = NULL; + pWrapperTable->m_CustomXMLNodes_GetNode = NULL; + pWrapperTable->m_CustomXMLNodes_CountNodesByName = NULL; + pWrapperTable->m_CustomXMLNodes_GetNodesByName = NULL; + pWrapperTable->m_CustomXMLNodes_HasNode = NULL; + pWrapperTable->m_CustomXMLNodes_HasUniqueNode = NULL; + pWrapperTable->m_CustomXMLNodes_FindNode = NULL; + pWrapperTable->m_CustomDOMTree_GetNameSpace = NULL; + pWrapperTable->m_CustomDOMTree_GetRootNode = NULL; + pWrapperTable->m_CustomDOMTree_SaveToString = NULL; pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack = NULL; pWrapperTable->m_ObjectIterator_GetCurrentObject = NULL; pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject = NULL; @@ -278,6 +337,78 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Slice_GetPolygonIndices = NULL; pWrapperTable->m_Slice_GetPolygonIndexCount = NULL; pWrapperTable->m_Slice_GetZTop = NULL; + pWrapperTable->m_ToolpathProfile_GetUUID = NULL; + pWrapperTable->m_ToolpathProfile_GetName = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterCount = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterName = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterNameSpace = NULL; + pWrapperTable->m_ToolpathProfile_HasParameterValue = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterValue = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterValueDef = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterDoubleValue = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterDoubleValueDef = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterIntegerValue = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterIntegerValueDef = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterBoolValue = NULL; + pWrapperTable->m_ToolpathProfile_GetParameterBoolValueDef = NULL; + pWrapperTable->m_ToolpathProfile_SetName = NULL; + pWrapperTable->m_ToolpathProfile_SetParameterValue = NULL; + pWrapperTable->m_ToolpathProfile_SetParameterDoubleValue = NULL; + pWrapperTable->m_ToolpathProfile_SetParameterIntegerValue = NULL; + pWrapperTable->m_ToolpathProfile_SetParameterBoolValue = NULL; + pWrapperTable->m_ToolpathLayerReader_GetLayerDataUUID = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentCount = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentInfo = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentProfile = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentProfileUUID = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentPart = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentPartUUID = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentLocalPartID = NULL; + pWrapperTable->m_ToolpathLayerReader_GetPartUUIDByLocalPartID = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentPointData = NULL; + pWrapperTable->m_ToolpathLayerReader_FindAttributeInfoByName = NULL; + pWrapperTable->m_ToolpathLayerReader_FindAttributeIDByName = NULL; + pWrapperTable->m_ToolpathLayerReader_FindAttributeValueByName = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByID = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByName = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByID = NULL; + pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByName = NULL; + pWrapperTable->m_ToolpathLayerReader_GetCustomDataCount = NULL; + pWrapperTable->m_ToolpathLayerReader_GetCustomData = NULL; + pWrapperTable->m_ToolpathLayerReader_GetCustomDataName = NULL; + pWrapperTable->m_ToolpathLayerData_GetLayerDataUUID = NULL; + pWrapperTable->m_ToolpathLayerData_RegisterProfile = NULL; + pWrapperTable->m_ToolpathLayerData_RegisterBuildItem = NULL; + pWrapperTable->m_ToolpathLayerData_SetSegmentAttribute = NULL; + pWrapperTable->m_ToolpathLayerData_ClearSegmentAttributes = NULL; + pWrapperTable->m_ToolpathLayerData_WriteHatchData = NULL; + pWrapperTable->m_ToolpathLayerData_WriteLoop = NULL; + pWrapperTable->m_ToolpathLayerData_WritePolyline = NULL; + pWrapperTable->m_ToolpathLayerData_AddCustomData = NULL; + pWrapperTable->m_ToolpathLayerData_Finish = NULL; + pWrapperTable->m_Toolpath_GetUnits = NULL; + pWrapperTable->m_Toolpath_GetLayerCount = NULL; + pWrapperTable->m_Toolpath_GetProfileCount = NULL; + pWrapperTable->m_Toolpath_AddLayer = NULL; + pWrapperTable->m_Toolpath_GetLayerAttachment = NULL; + pWrapperTable->m_Toolpath_ReadLayerData = NULL; + pWrapperTable->m_Toolpath_GetLayerPath = NULL; + pWrapperTable->m_Toolpath_GetLayerZMax = NULL; + pWrapperTable->m_Toolpath_GetLayerZ = NULL; + pWrapperTable->m_Toolpath_AddProfile = NULL; + pWrapperTable->m_Toolpath_GetProfile = NULL; + pWrapperTable->m_Toolpath_GetProfileUUID = NULL; + pWrapperTable->m_Toolpath_GetCustomDataCount = NULL; + pWrapperTable->m_Toolpath_GetCustomData = NULL; + pWrapperTable->m_Toolpath_GetCustomDataName = NULL; + pWrapperTable->m_Toolpath_HasUniqueCustomData = NULL; + pWrapperTable->m_Toolpath_FindUniqueCustomData = NULL; + pWrapperTable->m_Toolpath_AddCustomData = NULL; + pWrapperTable->m_Toolpath_ClearCustomData = NULL; + pWrapperTable->m_Toolpath_DeleteCustomData = NULL; + pWrapperTable->m_Toolpath_RegisterCustomIntegerAttribute = NULL; + pWrapperTable->m_Toolpath_RegisterCustomDoubleAttribute = NULL; + pWrapperTable->m_ToolpathIterator_GetCurrentToolpath = NULL; pWrapperTable->m_SliceStack_GetBottomZ = NULL; pWrapperTable->m_SliceStack_GetSliceCount = NULL; pWrapperTable->m_SliceStack_GetSlice = NULL; @@ -361,6 +492,7 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Model_GetTexture2DGroups = NULL; pWrapperTable->m_Model_GetCompositeMaterials = NULL; pWrapperTable->m_Model_GetMultiPropertyGroups = NULL; + pWrapperTable->m_Model_GetToolpaths = NULL; pWrapperTable->m_Model_GetSliceStacks = NULL; pWrapperTable->m_Model_MergeToModel = NULL; pWrapperTable->m_Model_AddMeshObject = NULL; @@ -374,6 +506,7 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Model_AddMultiPropertyGroup = NULL; pWrapperTable->m_Model_AddBuildItem = NULL; pWrapperTable->m_Model_RemoveBuildItem = NULL; + pWrapperTable->m_Model_AddToolpath = NULL; pWrapperTable->m_Model_GetMetaDataGroup = NULL; pWrapperTable->m_Model_AddAttachment = NULL; pWrapperTable->m_Model_RemoveAttachment = NULL; @@ -388,6 +521,9 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable) pWrapperTable->m_Model_RemoveCustomContentType = NULL; pWrapperTable->m_Model_SetRandomNumberCallback = NULL; pWrapperTable->m_Model_GetKeyStore = NULL; + pWrapperTable->m_Model_CreatePersistentSourceFromFile = NULL; + pWrapperTable->m_Model_CreatePersistentSourceFromBuffer = NULL; + pWrapperTable->m_Model_CreatePersistentSourceFromCallback = NULL; pWrapperTable->m_GetLibraryVersion = NULL; pWrapperTable->m_GetPrereleaseInformation = NULL; pWrapperTable->m_GetBuildInformation = NULL; @@ -470,6 +606,69 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Base_ClassTypeId == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_GetBinaryPath = (PLib3MFBinaryStream_GetBinaryPathPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_getbinarypath"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_GetBinaryPath = (PLib3MFBinaryStream_GetBinaryPathPtr) dlsym(hLibrary, "lib3mf_binarystream_getbinarypath"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_GetBinaryPath == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_GetIndexPath = (PLib3MFBinaryStream_GetIndexPathPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_getindexpath"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_GetIndexPath = (PLib3MFBinaryStream_GetIndexPathPtr) dlsym(hLibrary, "lib3mf_binarystream_getindexpath"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_GetIndexPath == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_GetUUID = (PLib3MFBinaryStream_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_getuuid"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_GetUUID = (PLib3MFBinaryStream_GetUUIDPtr) dlsym(hLibrary, "lib3mf_binarystream_getuuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_GetUUID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_DisableDiscretizedArrayCompression = (PLib3MFBinaryStream_DisableDiscretizedArrayCompressionPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_disablediscretizedarraycompression"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_DisableDiscretizedArrayCompression = (PLib3MFBinaryStream_DisableDiscretizedArrayCompressionPtr) dlsym(hLibrary, "lib3mf_binarystream_disablediscretizedarraycompression"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_DisableDiscretizedArrayCompression == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_EnableDiscretizedArrayCompression = (PLib3MFBinaryStream_EnableDiscretizedArrayCompressionPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_enablediscretizedarraycompression"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_EnableDiscretizedArrayCompression = (PLib3MFBinaryStream_EnableDiscretizedArrayCompressionPtr) dlsym(hLibrary, "lib3mf_binarystream_enablediscretizedarraycompression"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_EnableDiscretizedArrayCompression == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_EnableLZMA = (PLib3MFBinaryStream_EnableLZMAPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_enablelzma"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_EnableLZMA = (PLib3MFBinaryStream_EnableLZMAPtr) dlsym(hLibrary, "lib3mf_binarystream_enablelzma"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_EnableLZMA == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BinaryStream_DisableLZMA = (PLib3MFBinaryStream_DisableLZMAPtr) GetProcAddress(hLibrary, "lib3mf_binarystream_disablelzma"); + #else // _WIN32 + pWrapperTable->m_BinaryStream_DisableLZMA = (PLib3MFBinaryStream_DisableLZMAPtr) dlsym(hLibrary, "lib3mf_binarystream_disablelzma"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BinaryStream_DisableLZMA == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Writer_WriteToFile = (PLib3MFWriter_WriteToFilePtr) GetProcAddress(hLibrary, "lib3mf_writer_writetofile"); #else // _WIN32 @@ -587,6 +786,69 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Writer_SetContentEncryptionCallback == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Writer_CreateBinaryStream = (PLib3MFWriter_CreateBinaryStreamPtr) GetProcAddress(hLibrary, "lib3mf_writer_createbinarystream"); + #else // _WIN32 + pWrapperTable->m_Writer_CreateBinaryStream = (PLib3MFWriter_CreateBinaryStreamPtr) dlsym(hLibrary, "lib3mf_writer_createbinarystream"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Writer_CreateBinaryStream == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Writer_AssignBinaryStream = (PLib3MFWriter_AssignBinaryStreamPtr) GetProcAddress(hLibrary, "lib3mf_writer_assignbinarystream"); + #else // _WIN32 + pWrapperTable->m_Writer_AssignBinaryStream = (PLib3MFWriter_AssignBinaryStreamPtr) dlsym(hLibrary, "lib3mf_writer_assignbinarystream"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Writer_AssignBinaryStream == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Writer_RegisterCustomNamespace = (PLib3MFWriter_RegisterCustomNamespacePtr) GetProcAddress(hLibrary, "lib3mf_writer_registercustomnamespace"); + #else // _WIN32 + pWrapperTable->m_Writer_RegisterCustomNamespace = (PLib3MFWriter_RegisterCustomNamespacePtr) dlsym(hLibrary, "lib3mf_writer_registercustomnamespace"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Writer_RegisterCustomNamespace == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_PersistentReaderSource_GetSourceType = (PLib3MFPersistentReaderSource_GetSourceTypePtr) GetProcAddress(hLibrary, "lib3mf_persistentreadersource_getsourcetype"); + #else // _WIN32 + pWrapperTable->m_PersistentReaderSource_GetSourceType = (PLib3MFPersistentReaderSource_GetSourceTypePtr) dlsym(hLibrary, "lib3mf_persistentreadersource_getsourcetype"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_PersistentReaderSource_GetSourceType == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_PersistentReaderSource_InvalidateSourceData = (PLib3MFPersistentReaderSource_InvalidateSourceDataPtr) GetProcAddress(hLibrary, "lib3mf_persistentreadersource_invalidatesourcedata"); + #else // _WIN32 + pWrapperTable->m_PersistentReaderSource_InvalidateSourceData = (PLib3MFPersistentReaderSource_InvalidateSourceDataPtr) dlsym(hLibrary, "lib3mf_persistentreadersource_invalidatesourcedata"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_PersistentReaderSource_InvalidateSourceData == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_PersistentReaderSource_SourceDataIsValid = (PLib3MFPersistentReaderSource_SourceDataIsValidPtr) GetProcAddress(hLibrary, "lib3mf_persistentreadersource_sourcedataisvalid"); + #else // _WIN32 + pWrapperTable->m_PersistentReaderSource_SourceDataIsValid = (PLib3MFPersistentReaderSource_SourceDataIsValidPtr) dlsym(hLibrary, "lib3mf_persistentreadersource_sourcedataisvalid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_PersistentReaderSource_SourceDataIsValid == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Reader_ReadFromPersistentSource = (PLib3MFReader_ReadFromPersistentSourcePtr) GetProcAddress(hLibrary, "lib3mf_reader_readfrompersistentsource"); + #else // _WIN32 + pWrapperTable->m_Reader_ReadFromPersistentSource = (PLib3MFReader_ReadFromPersistentSourcePtr) dlsym(hLibrary, "lib3mf_reader_readfrompersistentsource"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Reader_ReadFromPersistentSource == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Reader_ReadFromFile = (PLib3MFReader_ReadFromFilePtr) GetProcAddress(hLibrary, "lib3mf_reader_readfromfile"); #else // _WIN32 @@ -804,1731 +1066,2784 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack = (PLib3MFSliceStackIterator_GetCurrentSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_slicestackiterator_getcurrentslicestack"); + pWrapperTable->m_CustomXMLAttribute_GetName = (PLib3MFCustomXMLAttribute_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_getname"); #else // _WIN32 - pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack = (PLib3MFSliceStackIterator_GetCurrentSliceStackPtr) dlsym(hLibrary, "lib3mf_slicestackiterator_getcurrentslicestack"); + pWrapperTable->m_CustomXMLAttribute_GetName = (PLib3MFCustomXMLAttribute_GetNamePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_getname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack == NULL) + if (pWrapperTable->m_CustomXMLAttribute_GetName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ObjectIterator_GetCurrentObject = (PLib3MFObjectIterator_GetCurrentObjectPtr) GetProcAddress(hLibrary, "lib3mf_objectiterator_getcurrentobject"); + pWrapperTable->m_CustomXMLAttribute_GetValue = (PLib3MFCustomXMLAttribute_GetValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_getvalue"); #else // _WIN32 - pWrapperTable->m_ObjectIterator_GetCurrentObject = (PLib3MFObjectIterator_GetCurrentObjectPtr) dlsym(hLibrary, "lib3mf_objectiterator_getcurrentobject"); + pWrapperTable->m_CustomXMLAttribute_GetValue = (PLib3MFCustomXMLAttribute_GetValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_getvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ObjectIterator_GetCurrentObject == NULL) + if (pWrapperTable->m_CustomXMLAttribute_GetValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject = (PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) GetProcAddress(hLibrary, "lib3mf_meshobjectiterator_getcurrentmeshobject"); + pWrapperTable->m_CustomXMLAttribute_IsValidInteger = (PLib3MFCustomXMLAttribute_IsValidIntegerPtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_isvalidinteger"); #else // _WIN32 - pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject = (PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) dlsym(hLibrary, "lib3mf_meshobjectiterator_getcurrentmeshobject"); + pWrapperTable->m_CustomXMLAttribute_IsValidInteger = (PLib3MFCustomXMLAttribute_IsValidIntegerPtr) dlsym(hLibrary, "lib3mf_customxmlattribute_isvalidinteger"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject == NULL) + if (pWrapperTable->m_CustomXMLAttribute_IsValidInteger == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject = (PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) GetProcAddress(hLibrary, "lib3mf_componentsobjectiterator_getcurrentcomponentsobject"); + pWrapperTable->m_CustomXMLAttribute_GetIntegerValue = (PLib3MFCustomXMLAttribute_GetIntegerValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_getintegervalue"); #else // _WIN32 - pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject = (PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) dlsym(hLibrary, "lib3mf_componentsobjectiterator_getcurrentcomponentsobject"); + pWrapperTable->m_CustomXMLAttribute_GetIntegerValue = (PLib3MFCustomXMLAttribute_GetIntegerValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_getintegervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject == NULL) + if (pWrapperTable->m_CustomXMLAttribute_GetIntegerValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D = (PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) GetProcAddress(hLibrary, "lib3mf_texture2diterator_getcurrenttexture2d"); + pWrapperTable->m_CustomXMLAttribute_IsValidDouble = (PLib3MFCustomXMLAttribute_IsValidDoublePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_isvaliddouble"); #else // _WIN32 - pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D = (PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) dlsym(hLibrary, "lib3mf_texture2diterator_getcurrenttexture2d"); + pWrapperTable->m_CustomXMLAttribute_IsValidDouble = (PLib3MFCustomXMLAttribute_IsValidDoublePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_isvaliddouble"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D == NULL) + if (pWrapperTable->m_CustomXMLAttribute_IsValidDouble == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup = (PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup"); + pWrapperTable->m_CustomXMLAttribute_GetDoubleValue = (PLib3MFCustomXMLAttribute_GetDoubleValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_getdoublevalue"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup = (PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr) dlsym(hLibrary, "lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup"); + pWrapperTable->m_CustomXMLAttribute_GetDoubleValue = (PLib3MFCustomXMLAttribute_GetDoubleValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_getdoublevalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup == NULL) + if (pWrapperTable->m_CustomXMLAttribute_GetDoubleValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup = (PLib3MFColorGroupIterator_GetCurrentColorGroupPtr) GetProcAddress(hLibrary, "lib3mf_colorgroupiterator_getcurrentcolorgroup"); + pWrapperTable->m_CustomXMLAttribute_IsValidBool = (PLib3MFCustomXMLAttribute_IsValidBoolPtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_isvalidbool"); #else // _WIN32 - pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup = (PLib3MFColorGroupIterator_GetCurrentColorGroupPtr) dlsym(hLibrary, "lib3mf_colorgroupiterator_getcurrentcolorgroup"); + pWrapperTable->m_CustomXMLAttribute_IsValidBool = (PLib3MFCustomXMLAttribute_IsValidBoolPtr) dlsym(hLibrary, "lib3mf_customxmlattribute_isvalidbool"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup == NULL) + if (pWrapperTable->m_CustomXMLAttribute_IsValidBool == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup = (PLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup"); + pWrapperTable->m_CustomXMLAttribute_GetBoolValue = (PLib3MFCustomXMLAttribute_GetBoolValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_getboolvalue"); #else // _WIN32 - pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup = (PLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupPtr) dlsym(hLibrary, "lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup"); + pWrapperTable->m_CustomXMLAttribute_GetBoolValue = (PLib3MFCustomXMLAttribute_GetBoolValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_getboolvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup == NULL) + if (pWrapperTable->m_CustomXMLAttribute_GetBoolValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials = (PLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsPtr) GetProcAddress(hLibrary, "lib3mf_compositematerialsiterator_getcurrentcompositematerials"); + pWrapperTable->m_CustomXMLAttribute_SetValue = (PLib3MFCustomXMLAttribute_SetValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_setvalue"); #else // _WIN32 - pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials = (PLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsPtr) dlsym(hLibrary, "lib3mf_compositematerialsiterator_getcurrentcompositematerials"); + pWrapperTable->m_CustomXMLAttribute_SetValue = (PLib3MFCustomXMLAttribute_SetValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_setvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials == NULL) + if (pWrapperTable->m_CustomXMLAttribute_SetValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup = (PLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup"); + pWrapperTable->m_CustomXMLAttribute_SetIntegerValue = (PLib3MFCustomXMLAttribute_SetIntegerValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_setintegervalue"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup = (PLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupPtr) dlsym(hLibrary, "lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup"); + pWrapperTable->m_CustomXMLAttribute_SetIntegerValue = (PLib3MFCustomXMLAttribute_SetIntegerValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_setintegervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup == NULL) + if (pWrapperTable->m_CustomXMLAttribute_SetIntegerValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_GetNameSpace = (PLib3MFMetaData_GetNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getnamespace"); + pWrapperTable->m_CustomXMLAttribute_SetDoubleValue = (PLib3MFCustomXMLAttribute_SetDoubleValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_setdoublevalue"); #else // _WIN32 - pWrapperTable->m_MetaData_GetNameSpace = (PLib3MFMetaData_GetNameSpacePtr) dlsym(hLibrary, "lib3mf_metadata_getnamespace"); + pWrapperTable->m_CustomXMLAttribute_SetDoubleValue = (PLib3MFCustomXMLAttribute_SetDoubleValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_setdoublevalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_GetNameSpace == NULL) + if (pWrapperTable->m_CustomXMLAttribute_SetDoubleValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_SetNameSpace = (PLib3MFMetaData_SetNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setnamespace"); + pWrapperTable->m_CustomXMLAttribute_SetBoolValue = (PLib3MFCustomXMLAttribute_SetBoolValuePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_setboolvalue"); #else // _WIN32 - pWrapperTable->m_MetaData_SetNameSpace = (PLib3MFMetaData_SetNameSpacePtr) dlsym(hLibrary, "lib3mf_metadata_setnamespace"); + pWrapperTable->m_CustomXMLAttribute_SetBoolValue = (PLib3MFCustomXMLAttribute_SetBoolValuePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_setboolvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_SetNameSpace == NULL) + if (pWrapperTable->m_CustomXMLAttribute_SetBoolValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_GetName = (PLib3MFMetaData_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getname"); + pWrapperTable->m_CustomXMLAttribute_Remove = (PLib3MFCustomXMLAttribute_RemovePtr) GetProcAddress(hLibrary, "lib3mf_customxmlattribute_remove"); #else // _WIN32 - pWrapperTable->m_MetaData_GetName = (PLib3MFMetaData_GetNamePtr) dlsym(hLibrary, "lib3mf_metadata_getname"); + pWrapperTable->m_CustomXMLAttribute_Remove = (PLib3MFCustomXMLAttribute_RemovePtr) dlsym(hLibrary, "lib3mf_customxmlattribute_remove"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_GetName == NULL) + if (pWrapperTable->m_CustomXMLAttribute_Remove == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_SetName = (PLib3MFMetaData_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setname"); + pWrapperTable->m_CustomXMLNode_GetName = (PLib3MFCustomXMLNode_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_getname"); #else // _WIN32 - pWrapperTable->m_MetaData_SetName = (PLib3MFMetaData_SetNamePtr) dlsym(hLibrary, "lib3mf_metadata_setname"); + pWrapperTable->m_CustomXMLNode_GetName = (PLib3MFCustomXMLNode_GetNamePtr) dlsym(hLibrary, "lib3mf_customxmlnode_getname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_SetName == NULL) + if (pWrapperTable->m_CustomXMLNode_GetName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_GetKey = (PLib3MFMetaData_GetKeyPtr) GetProcAddress(hLibrary, "lib3mf_metadata_getkey"); + pWrapperTable->m_CustomXMLNode_GetNameSpace = (PLib3MFCustomXMLNode_GetNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_getnamespace"); #else // _WIN32 - pWrapperTable->m_MetaData_GetKey = (PLib3MFMetaData_GetKeyPtr) dlsym(hLibrary, "lib3mf_metadata_getkey"); + pWrapperTable->m_CustomXMLNode_GetNameSpace = (PLib3MFCustomXMLNode_GetNameSpacePtr) dlsym(hLibrary, "lib3mf_customxmlnode_getnamespace"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_GetKey == NULL) + if (pWrapperTable->m_CustomXMLNode_GetNameSpace == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_GetMustPreserve = (PLib3MFMetaData_GetMustPreservePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getmustpreserve"); + pWrapperTable->m_CustomXMLNode_GetAttributeCount = (PLib3MFCustomXMLNode_GetAttributeCountPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_getattributecount"); #else // _WIN32 - pWrapperTable->m_MetaData_GetMustPreserve = (PLib3MFMetaData_GetMustPreservePtr) dlsym(hLibrary, "lib3mf_metadata_getmustpreserve"); + pWrapperTable->m_CustomXMLNode_GetAttributeCount = (PLib3MFCustomXMLNode_GetAttributeCountPtr) dlsym(hLibrary, "lib3mf_customxmlnode_getattributecount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_GetMustPreserve == NULL) + if (pWrapperTable->m_CustomXMLNode_GetAttributeCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_SetMustPreserve = (PLib3MFMetaData_SetMustPreservePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setmustpreserve"); + pWrapperTable->m_CustomXMLNode_GetAttribute = (PLib3MFCustomXMLNode_GetAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_getattribute"); #else // _WIN32 - pWrapperTable->m_MetaData_SetMustPreserve = (PLib3MFMetaData_SetMustPreservePtr) dlsym(hLibrary, "lib3mf_metadata_setmustpreserve"); + pWrapperTable->m_CustomXMLNode_GetAttribute = (PLib3MFCustomXMLNode_GetAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_getattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_SetMustPreserve == NULL) + if (pWrapperTable->m_CustomXMLNode_GetAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_GetType = (PLib3MFMetaData_GetTypePtr) GetProcAddress(hLibrary, "lib3mf_metadata_gettype"); + pWrapperTable->m_CustomXMLNode_HasAttribute = (PLib3MFCustomXMLNode_HasAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_hasattribute"); #else // _WIN32 - pWrapperTable->m_MetaData_GetType = (PLib3MFMetaData_GetTypePtr) dlsym(hLibrary, "lib3mf_metadata_gettype"); + pWrapperTable->m_CustomXMLNode_HasAttribute = (PLib3MFCustomXMLNode_HasAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_hasattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_GetType == NULL) + if (pWrapperTable->m_CustomXMLNode_HasAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_SetType = (PLib3MFMetaData_SetTypePtr) GetProcAddress(hLibrary, "lib3mf_metadata_settype"); + pWrapperTable->m_CustomXMLNode_FindAttribute = (PLib3MFCustomXMLNode_FindAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_findattribute"); #else // _WIN32 - pWrapperTable->m_MetaData_SetType = (PLib3MFMetaData_SetTypePtr) dlsym(hLibrary, "lib3mf_metadata_settype"); + pWrapperTable->m_CustomXMLNode_FindAttribute = (PLib3MFCustomXMLNode_FindAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_findattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_SetType == NULL) + if (pWrapperTable->m_CustomXMLNode_FindAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_GetValue = (PLib3MFMetaData_GetValuePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getvalue"); + pWrapperTable->m_CustomXMLNode_RemoveAttribute = (PLib3MFCustomXMLNode_RemoveAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_removeattribute"); #else // _WIN32 - pWrapperTable->m_MetaData_GetValue = (PLib3MFMetaData_GetValuePtr) dlsym(hLibrary, "lib3mf_metadata_getvalue"); + pWrapperTable->m_CustomXMLNode_RemoveAttribute = (PLib3MFCustomXMLNode_RemoveAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_removeattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_GetValue == NULL) + if (pWrapperTable->m_CustomXMLNode_RemoveAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaData_SetValue = (PLib3MFMetaData_SetValuePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setvalue"); + pWrapperTable->m_CustomXMLNode_RemoveAttributeByIndex = (PLib3MFCustomXMLNode_RemoveAttributeByIndexPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_removeattributebyindex"); #else // _WIN32 - pWrapperTable->m_MetaData_SetValue = (PLib3MFMetaData_SetValuePtr) dlsym(hLibrary, "lib3mf_metadata_setvalue"); + pWrapperTable->m_CustomXMLNode_RemoveAttributeByIndex = (PLib3MFCustomXMLNode_RemoveAttributeByIndexPtr) dlsym(hLibrary, "lib3mf_customxmlnode_removeattributebyindex"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaData_SetValue == NULL) + if (pWrapperTable->m_CustomXMLNode_RemoveAttributeByIndex == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaDataGroup_GetMetaDataCount = (PLib3MFMetaDataGroup_GetMetaDataCountPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_getmetadatacount"); + pWrapperTable->m_CustomXMLNode_AddAttribute = (PLib3MFCustomXMLNode_AddAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_addattribute"); #else // _WIN32 - pWrapperTable->m_MetaDataGroup_GetMetaDataCount = (PLib3MFMetaDataGroup_GetMetaDataCountPtr) dlsym(hLibrary, "lib3mf_metadatagroup_getmetadatacount"); + pWrapperTable->m_CustomXMLNode_AddAttribute = (PLib3MFCustomXMLNode_AddAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_addattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaDataGroup_GetMetaDataCount == NULL) + if (pWrapperTable->m_CustomXMLNode_AddAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaDataGroup_GetMetaData = (PLib3MFMetaDataGroup_GetMetaDataPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_getmetadata"); + pWrapperTable->m_CustomXMLNode_AddIntegerAttribute = (PLib3MFCustomXMLNode_AddIntegerAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_addintegerattribute"); #else // _WIN32 - pWrapperTable->m_MetaDataGroup_GetMetaData = (PLib3MFMetaDataGroup_GetMetaDataPtr) dlsym(hLibrary, "lib3mf_metadatagroup_getmetadata"); + pWrapperTable->m_CustomXMLNode_AddIntegerAttribute = (PLib3MFCustomXMLNode_AddIntegerAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_addintegerattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaDataGroup_GetMetaData == NULL) + if (pWrapperTable->m_CustomXMLNode_AddIntegerAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaDataGroup_GetMetaDataByKey = (PLib3MFMetaDataGroup_GetMetaDataByKeyPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_getmetadatabykey"); + pWrapperTable->m_CustomXMLNode_AddDoubleAttribute = (PLib3MFCustomXMLNode_AddDoubleAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_adddoubleattribute"); #else // _WIN32 - pWrapperTable->m_MetaDataGroup_GetMetaDataByKey = (PLib3MFMetaDataGroup_GetMetaDataByKeyPtr) dlsym(hLibrary, "lib3mf_metadatagroup_getmetadatabykey"); + pWrapperTable->m_CustomXMLNode_AddDoubleAttribute = (PLib3MFCustomXMLNode_AddDoubleAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_adddoubleattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaDataGroup_GetMetaDataByKey == NULL) + if (pWrapperTable->m_CustomXMLNode_AddDoubleAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex = (PLib3MFMetaDataGroup_RemoveMetaDataByIndexPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_removemetadatabyindex"); + pWrapperTable->m_CustomXMLNode_AddBoolAttribute = (PLib3MFCustomXMLNode_AddBoolAttributePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_addboolattribute"); #else // _WIN32 - pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex = (PLib3MFMetaDataGroup_RemoveMetaDataByIndexPtr) dlsym(hLibrary, "lib3mf_metadatagroup_removemetadatabyindex"); + pWrapperTable->m_CustomXMLNode_AddBoolAttribute = (PLib3MFCustomXMLNode_AddBoolAttributePtr) dlsym(hLibrary, "lib3mf_customxmlnode_addboolattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex == NULL) + if (pWrapperTable->m_CustomXMLNode_AddBoolAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaDataGroup_RemoveMetaData = (PLib3MFMetaDataGroup_RemoveMetaDataPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_removemetadata"); + pWrapperTable->m_CustomXMLNode_GetChildren = (PLib3MFCustomXMLNode_GetChildrenPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_getchildren"); #else // _WIN32 - pWrapperTable->m_MetaDataGroup_RemoveMetaData = (PLib3MFMetaDataGroup_RemoveMetaDataPtr) dlsym(hLibrary, "lib3mf_metadatagroup_removemetadata"); + pWrapperTable->m_CustomXMLNode_GetChildren = (PLib3MFCustomXMLNode_GetChildrenPtr) dlsym(hLibrary, "lib3mf_customxmlnode_getchildren"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaDataGroup_RemoveMetaData == NULL) + if (pWrapperTable->m_CustomXMLNode_GetChildren == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MetaDataGroup_AddMetaData = (PLib3MFMetaDataGroup_AddMetaDataPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_addmetadata"); + pWrapperTable->m_CustomXMLNode_CountChildrenByName = (PLib3MFCustomXMLNode_CountChildrenByNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_countchildrenbyname"); #else // _WIN32 - pWrapperTable->m_MetaDataGroup_AddMetaData = (PLib3MFMetaDataGroup_AddMetaDataPtr) dlsym(hLibrary, "lib3mf_metadatagroup_addmetadata"); + pWrapperTable->m_CustomXMLNode_CountChildrenByName = (PLib3MFCustomXMLNode_CountChildrenByNamePtr) dlsym(hLibrary, "lib3mf_customxmlnode_countchildrenbyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MetaDataGroup_AddMetaData == NULL) + if (pWrapperTable->m_CustomXMLNode_CountChildrenByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetType = (PLib3MFObject_GetTypePtr) GetProcAddress(hLibrary, "lib3mf_object_gettype"); + pWrapperTable->m_CustomXMLNode_GetChildrenByName = (PLib3MFCustomXMLNode_GetChildrenByNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_getchildrenbyname"); #else // _WIN32 - pWrapperTable->m_Object_GetType = (PLib3MFObject_GetTypePtr) dlsym(hLibrary, "lib3mf_object_gettype"); + pWrapperTable->m_CustomXMLNode_GetChildrenByName = (PLib3MFCustomXMLNode_GetChildrenByNamePtr) dlsym(hLibrary, "lib3mf_customxmlnode_getchildrenbyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetType == NULL) + if (pWrapperTable->m_CustomXMLNode_GetChildrenByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_SetType = (PLib3MFObject_SetTypePtr) GetProcAddress(hLibrary, "lib3mf_object_settype"); + pWrapperTable->m_CustomXMLNode_HasChild = (PLib3MFCustomXMLNode_HasChildPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_haschild"); #else // _WIN32 - pWrapperTable->m_Object_SetType = (PLib3MFObject_SetTypePtr) dlsym(hLibrary, "lib3mf_object_settype"); + pWrapperTable->m_CustomXMLNode_HasChild = (PLib3MFCustomXMLNode_HasChildPtr) dlsym(hLibrary, "lib3mf_customxmlnode_haschild"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_SetType == NULL) + if (pWrapperTable->m_CustomXMLNode_HasChild == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetName = (PLib3MFObject_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_object_getname"); + pWrapperTable->m_CustomXMLNode_HasUniqueChild = (PLib3MFCustomXMLNode_HasUniqueChildPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_hasuniquechild"); #else // _WIN32 - pWrapperTable->m_Object_GetName = (PLib3MFObject_GetNamePtr) dlsym(hLibrary, "lib3mf_object_getname"); + pWrapperTable->m_CustomXMLNode_HasUniqueChild = (PLib3MFCustomXMLNode_HasUniqueChildPtr) dlsym(hLibrary, "lib3mf_customxmlnode_hasuniquechild"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetName == NULL) + if (pWrapperTable->m_CustomXMLNode_HasUniqueChild == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_SetName = (PLib3MFObject_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_object_setname"); + pWrapperTable->m_CustomXMLNode_FindChild = (PLib3MFCustomXMLNode_FindChildPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_findchild"); #else // _WIN32 - pWrapperTable->m_Object_SetName = (PLib3MFObject_SetNamePtr) dlsym(hLibrary, "lib3mf_object_setname"); + pWrapperTable->m_CustomXMLNode_FindChild = (PLib3MFCustomXMLNode_FindChildPtr) dlsym(hLibrary, "lib3mf_customxmlnode_findchild"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_SetName == NULL) + if (pWrapperTable->m_CustomXMLNode_FindChild == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetPartNumber = (PLib3MFObject_GetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_object_getpartnumber"); + pWrapperTable->m_CustomXMLNode_AddChild = (PLib3MFCustomXMLNode_AddChildPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_addchild"); #else // _WIN32 - pWrapperTable->m_Object_GetPartNumber = (PLib3MFObject_GetPartNumberPtr) dlsym(hLibrary, "lib3mf_object_getpartnumber"); + pWrapperTable->m_CustomXMLNode_AddChild = (PLib3MFCustomXMLNode_AddChildPtr) dlsym(hLibrary, "lib3mf_customxmlnode_addchild"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetPartNumber == NULL) + if (pWrapperTable->m_CustomXMLNode_AddChild == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_SetPartNumber = (PLib3MFObject_SetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_object_setpartnumber"); + pWrapperTable->m_CustomXMLNode_RemoveChild = (PLib3MFCustomXMLNode_RemoveChildPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_removechild"); #else // _WIN32 - pWrapperTable->m_Object_SetPartNumber = (PLib3MFObject_SetPartNumberPtr) dlsym(hLibrary, "lib3mf_object_setpartnumber"); + pWrapperTable->m_CustomXMLNode_RemoveChild = (PLib3MFCustomXMLNode_RemoveChildPtr) dlsym(hLibrary, "lib3mf_customxmlnode_removechild"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_SetPartNumber == NULL) + if (pWrapperTable->m_CustomXMLNode_RemoveChild == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_IsMeshObject = (PLib3MFObject_IsMeshObjectPtr) GetProcAddress(hLibrary, "lib3mf_object_ismeshobject"); + pWrapperTable->m_CustomXMLNode_RemoveChildrenWithName = (PLib3MFCustomXMLNode_RemoveChildrenWithNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_removechildrenwithname"); #else // _WIN32 - pWrapperTable->m_Object_IsMeshObject = (PLib3MFObject_IsMeshObjectPtr) dlsym(hLibrary, "lib3mf_object_ismeshobject"); + pWrapperTable->m_CustomXMLNode_RemoveChildrenWithName = (PLib3MFCustomXMLNode_RemoveChildrenWithNamePtr) dlsym(hLibrary, "lib3mf_customxmlnode_removechildrenwithname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_IsMeshObject == NULL) + if (pWrapperTable->m_CustomXMLNode_RemoveChildrenWithName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_IsComponentsObject = (PLib3MFObject_IsComponentsObjectPtr) GetProcAddress(hLibrary, "lib3mf_object_iscomponentsobject"); + pWrapperTable->m_CustomXMLNode_Remove = (PLib3MFCustomXMLNode_RemovePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnode_remove"); #else // _WIN32 - pWrapperTable->m_Object_IsComponentsObject = (PLib3MFObject_IsComponentsObjectPtr) dlsym(hLibrary, "lib3mf_object_iscomponentsobject"); + pWrapperTable->m_CustomXMLNode_Remove = (PLib3MFCustomXMLNode_RemovePtr) dlsym(hLibrary, "lib3mf_customxmlnode_remove"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_IsComponentsObject == NULL) + if (pWrapperTable->m_CustomXMLNode_Remove == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_IsValid = (PLib3MFObject_IsValidPtr) GetProcAddress(hLibrary, "lib3mf_object_isvalid"); + pWrapperTable->m_CustomXMLNodes_GetNodeCount = (PLib3MFCustomXMLNodes_GetNodeCountPtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_getnodecount"); #else // _WIN32 - pWrapperTable->m_Object_IsValid = (PLib3MFObject_IsValidPtr) dlsym(hLibrary, "lib3mf_object_isvalid"); + pWrapperTable->m_CustomXMLNodes_GetNodeCount = (PLib3MFCustomXMLNodes_GetNodeCountPtr) dlsym(hLibrary, "lib3mf_customxmlnodes_getnodecount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_IsValid == NULL) + if (pWrapperTable->m_CustomXMLNodes_GetNodeCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_SetAttachmentAsThumbnail = (PLib3MFObject_SetAttachmentAsThumbnailPtr) GetProcAddress(hLibrary, "lib3mf_object_setattachmentasthumbnail"); + pWrapperTable->m_CustomXMLNodes_GetNode = (PLib3MFCustomXMLNodes_GetNodePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_getnode"); #else // _WIN32 - pWrapperTable->m_Object_SetAttachmentAsThumbnail = (PLib3MFObject_SetAttachmentAsThumbnailPtr) dlsym(hLibrary, "lib3mf_object_setattachmentasthumbnail"); + pWrapperTable->m_CustomXMLNodes_GetNode = (PLib3MFCustomXMLNodes_GetNodePtr) dlsym(hLibrary, "lib3mf_customxmlnodes_getnode"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_SetAttachmentAsThumbnail == NULL) + if (pWrapperTable->m_CustomXMLNodes_GetNode == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetThumbnailAttachment = (PLib3MFObject_GetThumbnailAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_object_getthumbnailattachment"); + pWrapperTable->m_CustomXMLNodes_CountNodesByName = (PLib3MFCustomXMLNodes_CountNodesByNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_countnodesbyname"); #else // _WIN32 - pWrapperTable->m_Object_GetThumbnailAttachment = (PLib3MFObject_GetThumbnailAttachmentPtr) dlsym(hLibrary, "lib3mf_object_getthumbnailattachment"); + pWrapperTable->m_CustomXMLNodes_CountNodesByName = (PLib3MFCustomXMLNodes_CountNodesByNamePtr) dlsym(hLibrary, "lib3mf_customxmlnodes_countnodesbyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetThumbnailAttachment == NULL) + if (pWrapperTable->m_CustomXMLNodes_CountNodesByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_ClearThumbnailAttachment = (PLib3MFObject_ClearThumbnailAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_object_clearthumbnailattachment"); + pWrapperTable->m_CustomXMLNodes_GetNodesByName = (PLib3MFCustomXMLNodes_GetNodesByNamePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_getnodesbyname"); #else // _WIN32 - pWrapperTable->m_Object_ClearThumbnailAttachment = (PLib3MFObject_ClearThumbnailAttachmentPtr) dlsym(hLibrary, "lib3mf_object_clearthumbnailattachment"); + pWrapperTable->m_CustomXMLNodes_GetNodesByName = (PLib3MFCustomXMLNodes_GetNodesByNamePtr) dlsym(hLibrary, "lib3mf_customxmlnodes_getnodesbyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_ClearThumbnailAttachment == NULL) + if (pWrapperTable->m_CustomXMLNodes_GetNodesByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetOutbox = (PLib3MFObject_GetOutboxPtr) GetProcAddress(hLibrary, "lib3mf_object_getoutbox"); + pWrapperTable->m_CustomXMLNodes_HasNode = (PLib3MFCustomXMLNodes_HasNodePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_hasnode"); #else // _WIN32 - pWrapperTable->m_Object_GetOutbox = (PLib3MFObject_GetOutboxPtr) dlsym(hLibrary, "lib3mf_object_getoutbox"); + pWrapperTable->m_CustomXMLNodes_HasNode = (PLib3MFCustomXMLNodes_HasNodePtr) dlsym(hLibrary, "lib3mf_customxmlnodes_hasnode"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetOutbox == NULL) + if (pWrapperTable->m_CustomXMLNodes_HasNode == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetUUID = (PLib3MFObject_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_object_getuuid"); + pWrapperTable->m_CustomXMLNodes_HasUniqueNode = (PLib3MFCustomXMLNodes_HasUniqueNodePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_hasuniquenode"); #else // _WIN32 - pWrapperTable->m_Object_GetUUID = (PLib3MFObject_GetUUIDPtr) dlsym(hLibrary, "lib3mf_object_getuuid"); + pWrapperTable->m_CustomXMLNodes_HasUniqueNode = (PLib3MFCustomXMLNodes_HasUniqueNodePtr) dlsym(hLibrary, "lib3mf_customxmlnodes_hasuniquenode"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetUUID == NULL) + if (pWrapperTable->m_CustomXMLNodes_HasUniqueNode == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_SetUUID = (PLib3MFObject_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_object_setuuid"); + pWrapperTable->m_CustomXMLNodes_FindNode = (PLib3MFCustomXMLNodes_FindNodePtr) GetProcAddress(hLibrary, "lib3mf_customxmlnodes_findnode"); #else // _WIN32 - pWrapperTable->m_Object_SetUUID = (PLib3MFObject_SetUUIDPtr) dlsym(hLibrary, "lib3mf_object_setuuid"); + pWrapperTable->m_CustomXMLNodes_FindNode = (PLib3MFCustomXMLNodes_FindNodePtr) dlsym(hLibrary, "lib3mf_customxmlnodes_findnode"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_SetUUID == NULL) + if (pWrapperTable->m_CustomXMLNodes_FindNode == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetMetaDataGroup = (PLib3MFObject_GetMetaDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_object_getmetadatagroup"); + pWrapperTable->m_CustomDOMTree_GetNameSpace = (PLib3MFCustomDOMTree_GetNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_customdomtree_getnamespace"); #else // _WIN32 - pWrapperTable->m_Object_GetMetaDataGroup = (PLib3MFObject_GetMetaDataGroupPtr) dlsym(hLibrary, "lib3mf_object_getmetadatagroup"); + pWrapperTable->m_CustomDOMTree_GetNameSpace = (PLib3MFCustomDOMTree_GetNameSpacePtr) dlsym(hLibrary, "lib3mf_customdomtree_getnamespace"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetMetaDataGroup == NULL) + if (pWrapperTable->m_CustomDOMTree_GetNameSpace == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_SetSlicesMeshResolution = (PLib3MFObject_SetSlicesMeshResolutionPtr) GetProcAddress(hLibrary, "lib3mf_object_setslicesmeshresolution"); + pWrapperTable->m_CustomDOMTree_GetRootNode = (PLib3MFCustomDOMTree_GetRootNodePtr) GetProcAddress(hLibrary, "lib3mf_customdomtree_getrootnode"); #else // _WIN32 - pWrapperTable->m_Object_SetSlicesMeshResolution = (PLib3MFObject_SetSlicesMeshResolutionPtr) dlsym(hLibrary, "lib3mf_object_setslicesmeshresolution"); + pWrapperTable->m_CustomDOMTree_GetRootNode = (PLib3MFCustomDOMTree_GetRootNodePtr) dlsym(hLibrary, "lib3mf_customdomtree_getrootnode"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_SetSlicesMeshResolution == NULL) + if (pWrapperTable->m_CustomDOMTree_GetRootNode == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetSlicesMeshResolution = (PLib3MFObject_GetSlicesMeshResolutionPtr) GetProcAddress(hLibrary, "lib3mf_object_getslicesmeshresolution"); + pWrapperTable->m_CustomDOMTree_SaveToString = (PLib3MFCustomDOMTree_SaveToStringPtr) GetProcAddress(hLibrary, "lib3mf_customdomtree_savetostring"); #else // _WIN32 - pWrapperTable->m_Object_GetSlicesMeshResolution = (PLib3MFObject_GetSlicesMeshResolutionPtr) dlsym(hLibrary, "lib3mf_object_getslicesmeshresolution"); + pWrapperTable->m_CustomDOMTree_SaveToString = (PLib3MFCustomDOMTree_SaveToStringPtr) dlsym(hLibrary, "lib3mf_customdomtree_savetostring"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetSlicesMeshResolution == NULL) + if (pWrapperTable->m_CustomDOMTree_SaveToString == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_HasSlices = (PLib3MFObject_HasSlicesPtr) GetProcAddress(hLibrary, "lib3mf_object_hasslices"); + pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack = (PLib3MFSliceStackIterator_GetCurrentSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_slicestackiterator_getcurrentslicestack"); #else // _WIN32 - pWrapperTable->m_Object_HasSlices = (PLib3MFObject_HasSlicesPtr) dlsym(hLibrary, "lib3mf_object_hasslices"); + pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack = (PLib3MFSliceStackIterator_GetCurrentSliceStackPtr) dlsym(hLibrary, "lib3mf_slicestackiterator_getcurrentslicestack"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_HasSlices == NULL) + if (pWrapperTable->m_SliceStackIterator_GetCurrentSliceStack == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_ClearSliceStack = (PLib3MFObject_ClearSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_object_clearslicestack"); + pWrapperTable->m_ObjectIterator_GetCurrentObject = (PLib3MFObjectIterator_GetCurrentObjectPtr) GetProcAddress(hLibrary, "lib3mf_objectiterator_getcurrentobject"); #else // _WIN32 - pWrapperTable->m_Object_ClearSliceStack = (PLib3MFObject_ClearSliceStackPtr) dlsym(hLibrary, "lib3mf_object_clearslicestack"); + pWrapperTable->m_ObjectIterator_GetCurrentObject = (PLib3MFObjectIterator_GetCurrentObjectPtr) dlsym(hLibrary, "lib3mf_objectiterator_getcurrentobject"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_ClearSliceStack == NULL) + if (pWrapperTable->m_ObjectIterator_GetCurrentObject == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_GetSliceStack = (PLib3MFObject_GetSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_object_getslicestack"); + pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject = (PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) GetProcAddress(hLibrary, "lib3mf_meshobjectiterator_getcurrentmeshobject"); #else // _WIN32 - pWrapperTable->m_Object_GetSliceStack = (PLib3MFObject_GetSliceStackPtr) dlsym(hLibrary, "lib3mf_object_getslicestack"); + pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject = (PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) dlsym(hLibrary, "lib3mf_meshobjectiterator_getcurrentmeshobject"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_GetSliceStack == NULL) + if (pWrapperTable->m_MeshObjectIterator_GetCurrentMeshObject == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Object_AssignSliceStack = (PLib3MFObject_AssignSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_object_assignslicestack"); + pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject = (PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) GetProcAddress(hLibrary, "lib3mf_componentsobjectiterator_getcurrentcomponentsobject"); #else // _WIN32 - pWrapperTable->m_Object_AssignSliceStack = (PLib3MFObject_AssignSliceStackPtr) dlsym(hLibrary, "lib3mf_object_assignslicestack"); + pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject = (PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) dlsym(hLibrary, "lib3mf_componentsobjectiterator_getcurrentcomponentsobject"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Object_AssignSliceStack == NULL) + if (pWrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetVertexCount = (PLib3MFMeshObject_GetVertexCountPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getvertexcount"); + pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D = (PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) GetProcAddress(hLibrary, "lib3mf_texture2diterator_getcurrenttexture2d"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetVertexCount = (PLib3MFMeshObject_GetVertexCountPtr) dlsym(hLibrary, "lib3mf_meshobject_getvertexcount"); + pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D = (PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) dlsym(hLibrary, "lib3mf_texture2diterator_getcurrenttexture2d"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetVertexCount == NULL) + if (pWrapperTable->m_Texture2DIterator_GetCurrentTexture2D == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetTriangleCount = (PLib3MFMeshObject_GetTriangleCountPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettrianglecount"); + pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup = (PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetTriangleCount = (PLib3MFMeshObject_GetTriangleCountPtr) dlsym(hLibrary, "lib3mf_meshobject_gettrianglecount"); + pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup = (PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr) dlsym(hLibrary, "lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetTriangleCount == NULL) + if (pWrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetVertex = (PLib3MFMeshObject_GetVertexPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getvertex"); + pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup = (PLib3MFColorGroupIterator_GetCurrentColorGroupPtr) GetProcAddress(hLibrary, "lib3mf_colorgroupiterator_getcurrentcolorgroup"); + #else // _WIN32 + pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup = (PLib3MFColorGroupIterator_GetCurrentColorGroupPtr) dlsym(hLibrary, "lib3mf_colorgroupiterator_getcurrentcolorgroup"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ColorGroupIterator_GetCurrentColorGroup == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup = (PLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup"); + #else // _WIN32 + pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup = (PLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupPtr) dlsym(hLibrary, "lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials = (PLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsPtr) GetProcAddress(hLibrary, "lib3mf_compositematerialsiterator_getcurrentcompositematerials"); + #else // _WIN32 + pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials = (PLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsPtr) dlsym(hLibrary, "lib3mf_compositematerialsiterator_getcurrentcompositematerials"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup = (PLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup = (PLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupPtr) dlsym(hLibrary, "lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_GetNameSpace = (PLib3MFMetaData_GetNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getnamespace"); + #else // _WIN32 + pWrapperTable->m_MetaData_GetNameSpace = (PLib3MFMetaData_GetNameSpacePtr) dlsym(hLibrary, "lib3mf_metadata_getnamespace"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_GetNameSpace == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_SetNameSpace = (PLib3MFMetaData_SetNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setnamespace"); + #else // _WIN32 + pWrapperTable->m_MetaData_SetNameSpace = (PLib3MFMetaData_SetNameSpacePtr) dlsym(hLibrary, "lib3mf_metadata_setnamespace"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_SetNameSpace == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_GetName = (PLib3MFMetaData_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getname"); + #else // _WIN32 + pWrapperTable->m_MetaData_GetName = (PLib3MFMetaData_GetNamePtr) dlsym(hLibrary, "lib3mf_metadata_getname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_GetName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_SetName = (PLib3MFMetaData_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setname"); + #else // _WIN32 + pWrapperTable->m_MetaData_SetName = (PLib3MFMetaData_SetNamePtr) dlsym(hLibrary, "lib3mf_metadata_setname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_SetName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_GetKey = (PLib3MFMetaData_GetKeyPtr) GetProcAddress(hLibrary, "lib3mf_metadata_getkey"); + #else // _WIN32 + pWrapperTable->m_MetaData_GetKey = (PLib3MFMetaData_GetKeyPtr) dlsym(hLibrary, "lib3mf_metadata_getkey"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_GetKey == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_GetMustPreserve = (PLib3MFMetaData_GetMustPreservePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getmustpreserve"); + #else // _WIN32 + pWrapperTable->m_MetaData_GetMustPreserve = (PLib3MFMetaData_GetMustPreservePtr) dlsym(hLibrary, "lib3mf_metadata_getmustpreserve"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_GetMustPreserve == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_SetMustPreserve = (PLib3MFMetaData_SetMustPreservePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setmustpreserve"); + #else // _WIN32 + pWrapperTable->m_MetaData_SetMustPreserve = (PLib3MFMetaData_SetMustPreservePtr) dlsym(hLibrary, "lib3mf_metadata_setmustpreserve"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_SetMustPreserve == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_GetType = (PLib3MFMetaData_GetTypePtr) GetProcAddress(hLibrary, "lib3mf_metadata_gettype"); + #else // _WIN32 + pWrapperTable->m_MetaData_GetType = (PLib3MFMetaData_GetTypePtr) dlsym(hLibrary, "lib3mf_metadata_gettype"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_GetType == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_SetType = (PLib3MFMetaData_SetTypePtr) GetProcAddress(hLibrary, "lib3mf_metadata_settype"); + #else // _WIN32 + pWrapperTable->m_MetaData_SetType = (PLib3MFMetaData_SetTypePtr) dlsym(hLibrary, "lib3mf_metadata_settype"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_SetType == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_GetValue = (PLib3MFMetaData_GetValuePtr) GetProcAddress(hLibrary, "lib3mf_metadata_getvalue"); + #else // _WIN32 + pWrapperTable->m_MetaData_GetValue = (PLib3MFMetaData_GetValuePtr) dlsym(hLibrary, "lib3mf_metadata_getvalue"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_GetValue == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaData_SetValue = (PLib3MFMetaData_SetValuePtr) GetProcAddress(hLibrary, "lib3mf_metadata_setvalue"); + #else // _WIN32 + pWrapperTable->m_MetaData_SetValue = (PLib3MFMetaData_SetValuePtr) dlsym(hLibrary, "lib3mf_metadata_setvalue"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaData_SetValue == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaDataGroup_GetMetaDataCount = (PLib3MFMetaDataGroup_GetMetaDataCountPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_getmetadatacount"); + #else // _WIN32 + pWrapperTable->m_MetaDataGroup_GetMetaDataCount = (PLib3MFMetaDataGroup_GetMetaDataCountPtr) dlsym(hLibrary, "lib3mf_metadatagroup_getmetadatacount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaDataGroup_GetMetaDataCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaDataGroup_GetMetaData = (PLib3MFMetaDataGroup_GetMetaDataPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_getmetadata"); + #else // _WIN32 + pWrapperTable->m_MetaDataGroup_GetMetaData = (PLib3MFMetaDataGroup_GetMetaDataPtr) dlsym(hLibrary, "lib3mf_metadatagroup_getmetadata"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaDataGroup_GetMetaData == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaDataGroup_GetMetaDataByKey = (PLib3MFMetaDataGroup_GetMetaDataByKeyPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_getmetadatabykey"); + #else // _WIN32 + pWrapperTable->m_MetaDataGroup_GetMetaDataByKey = (PLib3MFMetaDataGroup_GetMetaDataByKeyPtr) dlsym(hLibrary, "lib3mf_metadatagroup_getmetadatabykey"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaDataGroup_GetMetaDataByKey == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex = (PLib3MFMetaDataGroup_RemoveMetaDataByIndexPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_removemetadatabyindex"); + #else // _WIN32 + pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex = (PLib3MFMetaDataGroup_RemoveMetaDataByIndexPtr) dlsym(hLibrary, "lib3mf_metadatagroup_removemetadatabyindex"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaDataGroup_RemoveMetaData = (PLib3MFMetaDataGroup_RemoveMetaDataPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_removemetadata"); + #else // _WIN32 + pWrapperTable->m_MetaDataGroup_RemoveMetaData = (PLib3MFMetaDataGroup_RemoveMetaDataPtr) dlsym(hLibrary, "lib3mf_metadatagroup_removemetadata"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaDataGroup_RemoveMetaData == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MetaDataGroup_AddMetaData = (PLib3MFMetaDataGroup_AddMetaDataPtr) GetProcAddress(hLibrary, "lib3mf_metadatagroup_addmetadata"); + #else // _WIN32 + pWrapperTable->m_MetaDataGroup_AddMetaData = (PLib3MFMetaDataGroup_AddMetaDataPtr) dlsym(hLibrary, "lib3mf_metadatagroup_addmetadata"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MetaDataGroup_AddMetaData == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetType = (PLib3MFObject_GetTypePtr) GetProcAddress(hLibrary, "lib3mf_object_gettype"); + #else // _WIN32 + pWrapperTable->m_Object_GetType = (PLib3MFObject_GetTypePtr) dlsym(hLibrary, "lib3mf_object_gettype"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetType == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_SetType = (PLib3MFObject_SetTypePtr) GetProcAddress(hLibrary, "lib3mf_object_settype"); + #else // _WIN32 + pWrapperTable->m_Object_SetType = (PLib3MFObject_SetTypePtr) dlsym(hLibrary, "lib3mf_object_settype"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_SetType == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetName = (PLib3MFObject_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_object_getname"); + #else // _WIN32 + pWrapperTable->m_Object_GetName = (PLib3MFObject_GetNamePtr) dlsym(hLibrary, "lib3mf_object_getname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_SetName = (PLib3MFObject_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_object_setname"); + #else // _WIN32 + pWrapperTable->m_Object_SetName = (PLib3MFObject_SetNamePtr) dlsym(hLibrary, "lib3mf_object_setname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_SetName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetPartNumber = (PLib3MFObject_GetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_object_getpartnumber"); + #else // _WIN32 + pWrapperTable->m_Object_GetPartNumber = (PLib3MFObject_GetPartNumberPtr) dlsym(hLibrary, "lib3mf_object_getpartnumber"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetPartNumber == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_SetPartNumber = (PLib3MFObject_SetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_object_setpartnumber"); + #else // _WIN32 + pWrapperTable->m_Object_SetPartNumber = (PLib3MFObject_SetPartNumberPtr) dlsym(hLibrary, "lib3mf_object_setpartnumber"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_SetPartNumber == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_IsMeshObject = (PLib3MFObject_IsMeshObjectPtr) GetProcAddress(hLibrary, "lib3mf_object_ismeshobject"); + #else // _WIN32 + pWrapperTable->m_Object_IsMeshObject = (PLib3MFObject_IsMeshObjectPtr) dlsym(hLibrary, "lib3mf_object_ismeshobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_IsMeshObject == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_IsComponentsObject = (PLib3MFObject_IsComponentsObjectPtr) GetProcAddress(hLibrary, "lib3mf_object_iscomponentsobject"); + #else // _WIN32 + pWrapperTable->m_Object_IsComponentsObject = (PLib3MFObject_IsComponentsObjectPtr) dlsym(hLibrary, "lib3mf_object_iscomponentsobject"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_IsComponentsObject == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_IsValid = (PLib3MFObject_IsValidPtr) GetProcAddress(hLibrary, "lib3mf_object_isvalid"); + #else // _WIN32 + pWrapperTable->m_Object_IsValid = (PLib3MFObject_IsValidPtr) dlsym(hLibrary, "lib3mf_object_isvalid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_IsValid == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_SetAttachmentAsThumbnail = (PLib3MFObject_SetAttachmentAsThumbnailPtr) GetProcAddress(hLibrary, "lib3mf_object_setattachmentasthumbnail"); + #else // _WIN32 + pWrapperTable->m_Object_SetAttachmentAsThumbnail = (PLib3MFObject_SetAttachmentAsThumbnailPtr) dlsym(hLibrary, "lib3mf_object_setattachmentasthumbnail"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_SetAttachmentAsThumbnail == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetThumbnailAttachment = (PLib3MFObject_GetThumbnailAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_object_getthumbnailattachment"); + #else // _WIN32 + pWrapperTable->m_Object_GetThumbnailAttachment = (PLib3MFObject_GetThumbnailAttachmentPtr) dlsym(hLibrary, "lib3mf_object_getthumbnailattachment"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetThumbnailAttachment == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_ClearThumbnailAttachment = (PLib3MFObject_ClearThumbnailAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_object_clearthumbnailattachment"); + #else // _WIN32 + pWrapperTable->m_Object_ClearThumbnailAttachment = (PLib3MFObject_ClearThumbnailAttachmentPtr) dlsym(hLibrary, "lib3mf_object_clearthumbnailattachment"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_ClearThumbnailAttachment == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetOutbox = (PLib3MFObject_GetOutboxPtr) GetProcAddress(hLibrary, "lib3mf_object_getoutbox"); + #else // _WIN32 + pWrapperTable->m_Object_GetOutbox = (PLib3MFObject_GetOutboxPtr) dlsym(hLibrary, "lib3mf_object_getoutbox"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetOutbox == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetUUID = (PLib3MFObject_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_object_getuuid"); + #else // _WIN32 + pWrapperTable->m_Object_GetUUID = (PLib3MFObject_GetUUIDPtr) dlsym(hLibrary, "lib3mf_object_getuuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetUUID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_SetUUID = (PLib3MFObject_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_object_setuuid"); + #else // _WIN32 + pWrapperTable->m_Object_SetUUID = (PLib3MFObject_SetUUIDPtr) dlsym(hLibrary, "lib3mf_object_setuuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_SetUUID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetMetaDataGroup = (PLib3MFObject_GetMetaDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_object_getmetadatagroup"); + #else // _WIN32 + pWrapperTable->m_Object_GetMetaDataGroup = (PLib3MFObject_GetMetaDataGroupPtr) dlsym(hLibrary, "lib3mf_object_getmetadatagroup"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetMetaDataGroup == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_SetSlicesMeshResolution = (PLib3MFObject_SetSlicesMeshResolutionPtr) GetProcAddress(hLibrary, "lib3mf_object_setslicesmeshresolution"); + #else // _WIN32 + pWrapperTable->m_Object_SetSlicesMeshResolution = (PLib3MFObject_SetSlicesMeshResolutionPtr) dlsym(hLibrary, "lib3mf_object_setslicesmeshresolution"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_SetSlicesMeshResolution == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetSlicesMeshResolution = (PLib3MFObject_GetSlicesMeshResolutionPtr) GetProcAddress(hLibrary, "lib3mf_object_getslicesmeshresolution"); + #else // _WIN32 + pWrapperTable->m_Object_GetSlicesMeshResolution = (PLib3MFObject_GetSlicesMeshResolutionPtr) dlsym(hLibrary, "lib3mf_object_getslicesmeshresolution"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetSlicesMeshResolution == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_HasSlices = (PLib3MFObject_HasSlicesPtr) GetProcAddress(hLibrary, "lib3mf_object_hasslices"); + #else // _WIN32 + pWrapperTable->m_Object_HasSlices = (PLib3MFObject_HasSlicesPtr) dlsym(hLibrary, "lib3mf_object_hasslices"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_HasSlices == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_ClearSliceStack = (PLib3MFObject_ClearSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_object_clearslicestack"); + #else // _WIN32 + pWrapperTable->m_Object_ClearSliceStack = (PLib3MFObject_ClearSliceStackPtr) dlsym(hLibrary, "lib3mf_object_clearslicestack"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_ClearSliceStack == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_GetSliceStack = (PLib3MFObject_GetSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_object_getslicestack"); + #else // _WIN32 + pWrapperTable->m_Object_GetSliceStack = (PLib3MFObject_GetSliceStackPtr) dlsym(hLibrary, "lib3mf_object_getslicestack"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_GetSliceStack == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Object_AssignSliceStack = (PLib3MFObject_AssignSliceStackPtr) GetProcAddress(hLibrary, "lib3mf_object_assignslicestack"); + #else // _WIN32 + pWrapperTable->m_Object_AssignSliceStack = (PLib3MFObject_AssignSliceStackPtr) dlsym(hLibrary, "lib3mf_object_assignslicestack"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Object_AssignSliceStack == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetVertexCount = (PLib3MFMeshObject_GetVertexCountPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getvertexcount"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetVertexCount = (PLib3MFMeshObject_GetVertexCountPtr) dlsym(hLibrary, "lib3mf_meshobject_getvertexcount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetVertexCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetTriangleCount = (PLib3MFMeshObject_GetTriangleCountPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettrianglecount"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetTriangleCount = (PLib3MFMeshObject_GetTriangleCountPtr) dlsym(hLibrary, "lib3mf_meshobject_gettrianglecount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetTriangleCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetVertex = (PLib3MFMeshObject_GetVertexPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getvertex"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetVertex = (PLib3MFMeshObject_GetVertexPtr) dlsym(hLibrary, "lib3mf_meshobject_getvertex"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetVertex == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_SetVertex = (PLib3MFMeshObject_SetVertexPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setvertex"); + #else // _WIN32 + pWrapperTable->m_MeshObject_SetVertex = (PLib3MFMeshObject_SetVertexPtr) dlsym(hLibrary, "lib3mf_meshobject_setvertex"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_SetVertex == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_AddVertex = (PLib3MFMeshObject_AddVertexPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_addvertex"); + #else // _WIN32 + pWrapperTable->m_MeshObject_AddVertex = (PLib3MFMeshObject_AddVertexPtr) dlsym(hLibrary, "lib3mf_meshobject_addvertex"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_AddVertex == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetVertices = (PLib3MFMeshObject_GetVerticesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getvertices"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetVertices = (PLib3MFMeshObject_GetVerticesPtr) dlsym(hLibrary, "lib3mf_meshobject_getvertices"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetVertices == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetTriangle = (PLib3MFMeshObject_GetTrianglePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettriangle"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetTriangle = (PLib3MFMeshObject_GetTrianglePtr) dlsym(hLibrary, "lib3mf_meshobject_gettriangle"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetTriangle == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_SetTriangle = (PLib3MFMeshObject_SetTrianglePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_settriangle"); + #else // _WIN32 + pWrapperTable->m_MeshObject_SetTriangle = (PLib3MFMeshObject_SetTrianglePtr) dlsym(hLibrary, "lib3mf_meshobject_settriangle"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_SetTriangle == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_AddTriangle = (PLib3MFMeshObject_AddTrianglePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_addtriangle"); + #else // _WIN32 + pWrapperTable->m_MeshObject_AddTriangle = (PLib3MFMeshObject_AddTrianglePtr) dlsym(hLibrary, "lib3mf_meshobject_addtriangle"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_AddTriangle == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetTriangleIndices = (PLib3MFMeshObject_GetTriangleIndicesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettriangleindices"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetTriangleIndices = (PLib3MFMeshObject_GetTriangleIndicesPtr) dlsym(hLibrary, "lib3mf_meshobject_gettriangleindices"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetTriangleIndices == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_SetObjectLevelProperty = (PLib3MFMeshObject_SetObjectLevelPropertyPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setobjectlevelproperty"); + #else // _WIN32 + pWrapperTable->m_MeshObject_SetObjectLevelProperty = (PLib3MFMeshObject_SetObjectLevelPropertyPtr) dlsym(hLibrary, "lib3mf_meshobject_setobjectlevelproperty"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_SetObjectLevelProperty == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetObjectLevelProperty = (PLib3MFMeshObject_GetObjectLevelPropertyPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getobjectlevelproperty"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetObjectLevelProperty = (PLib3MFMeshObject_GetObjectLevelPropertyPtr) dlsym(hLibrary, "lib3mf_meshobject_getobjectlevelproperty"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetObjectLevelProperty == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_SetTriangleProperties = (PLib3MFMeshObject_SetTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_settriangleproperties"); + #else // _WIN32 + pWrapperTable->m_MeshObject_SetTriangleProperties = (PLib3MFMeshObject_SetTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_settriangleproperties"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_SetTriangleProperties == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetTriangleProperties = (PLib3MFMeshObject_GetTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettriangleproperties"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetTriangleProperties = (PLib3MFMeshObject_GetTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_gettriangleproperties"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetTriangleProperties == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_SetAllTriangleProperties = (PLib3MFMeshObject_SetAllTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setalltriangleproperties"); + #else // _WIN32 + pWrapperTable->m_MeshObject_SetAllTriangleProperties = (PLib3MFMeshObject_SetAllTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_setalltriangleproperties"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_SetAllTriangleProperties == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_GetAllTriangleProperties = (PLib3MFMeshObject_GetAllTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getalltriangleproperties"); + #else // _WIN32 + pWrapperTable->m_MeshObject_GetAllTriangleProperties = (PLib3MFMeshObject_GetAllTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_getalltriangleproperties"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_GetAllTriangleProperties == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_ClearAllProperties = (PLib3MFMeshObject_ClearAllPropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_clearallproperties"); + #else // _WIN32 + pWrapperTable->m_MeshObject_ClearAllProperties = (PLib3MFMeshObject_ClearAllPropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_clearallproperties"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_ClearAllProperties == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_SetGeometry = (PLib3MFMeshObject_SetGeometryPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setgeometry"); + #else // _WIN32 + pWrapperTable->m_MeshObject_SetGeometry = (PLib3MFMeshObject_SetGeometryPtr) dlsym(hLibrary, "lib3mf_meshobject_setgeometry"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_SetGeometry == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_IsManifoldAndOriented = (PLib3MFMeshObject_IsManifoldAndOrientedPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_ismanifoldandoriented"); + #else // _WIN32 + pWrapperTable->m_MeshObject_IsManifoldAndOriented = (PLib3MFMeshObject_IsManifoldAndOrientedPtr) dlsym(hLibrary, "lib3mf_meshobject_ismanifoldandoriented"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_IsManifoldAndOriented == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MeshObject_BeamLattice = (PLib3MFMeshObject_BeamLatticePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_beamlattice"); + #else // _WIN32 + pWrapperTable->m_MeshObject_BeamLattice = (PLib3MFMeshObject_BeamLatticePtr) dlsym(hLibrary, "lib3mf_meshobject_beamlattice"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MeshObject_BeamLattice == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetMinLength = (PLib3MFBeamLattice_GetMinLengthPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getminlength"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetMinLength = (PLib3MFBeamLattice_GetMinLengthPtr) dlsym(hLibrary, "lib3mf_beamlattice_getminlength"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetMinLength == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_SetMinLength = (PLib3MFBeamLattice_SetMinLengthPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setminlength"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_SetMinLength = (PLib3MFBeamLattice_SetMinLengthPtr) dlsym(hLibrary, "lib3mf_beamlattice_setminlength"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_SetMinLength == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetClipping = (PLib3MFBeamLattice_GetClippingPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getclipping"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetClipping = (PLib3MFBeamLattice_GetClippingPtr) dlsym(hLibrary, "lib3mf_beamlattice_getclipping"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetClipping == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_SetClipping = (PLib3MFBeamLattice_SetClippingPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setclipping"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_SetClipping = (PLib3MFBeamLattice_SetClippingPtr) dlsym(hLibrary, "lib3mf_beamlattice_setclipping"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_SetClipping == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetRepresentation = (PLib3MFBeamLattice_GetRepresentationPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getrepresentation"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetRepresentation = (PLib3MFBeamLattice_GetRepresentationPtr) dlsym(hLibrary, "lib3mf_beamlattice_getrepresentation"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetRepresentation == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_SetRepresentation = (PLib3MFBeamLattice_SetRepresentationPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setrepresentation"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_SetRepresentation = (PLib3MFBeamLattice_SetRepresentationPtr) dlsym(hLibrary, "lib3mf_beamlattice_setrepresentation"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_SetRepresentation == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBallOptions = (PLib3MFBeamLattice_GetBallOptionsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getballoptions"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBallOptions = (PLib3MFBeamLattice_GetBallOptionsPtr) dlsym(hLibrary, "lib3mf_beamlattice_getballoptions"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBallOptions == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_SetBallOptions = (PLib3MFBeamLattice_SetBallOptionsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setballoptions"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_SetBallOptions = (PLib3MFBeamLattice_SetBallOptionsPtr) dlsym(hLibrary, "lib3mf_beamlattice_setballoptions"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_SetBallOptions == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBeamCount = (PLib3MFBeamLattice_GetBeamCountPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeamcount"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBeamCount = (PLib3MFBeamLattice_GetBeamCountPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeamcount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBeamCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBeam = (PLib3MFBeamLattice_GetBeamPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeam"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBeam = (PLib3MFBeamLattice_GetBeamPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeam"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBeam == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_AddBeam = (PLib3MFBeamLattice_AddBeamPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_addbeam"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_AddBeam = (PLib3MFBeamLattice_AddBeamPtr) dlsym(hLibrary, "lib3mf_beamlattice_addbeam"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_AddBeam == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_SetBeam = (PLib3MFBeamLattice_SetBeamPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setbeam"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_SetBeam = (PLib3MFBeamLattice_SetBeamPtr) dlsym(hLibrary, "lib3mf_beamlattice_setbeam"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_SetBeam == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_SetBeams = (PLib3MFBeamLattice_SetBeamsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setbeams"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_SetBeams = (PLib3MFBeamLattice_SetBeamsPtr) dlsym(hLibrary, "lib3mf_beamlattice_setbeams"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_SetBeams == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBeams = (PLib3MFBeamLattice_GetBeamsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeams"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBeams = (PLib3MFBeamLattice_GetBeamsPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeams"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBeams == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBallCount = (PLib3MFBeamLattice_GetBallCountPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getballcount"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBallCount = (PLib3MFBeamLattice_GetBallCountPtr) dlsym(hLibrary, "lib3mf_beamlattice_getballcount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBallCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBall = (PLib3MFBeamLattice_GetBallPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getball"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBall = (PLib3MFBeamLattice_GetBallPtr) dlsym(hLibrary, "lib3mf_beamlattice_getball"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBall == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_AddBall = (PLib3MFBeamLattice_AddBallPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_addball"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_AddBall = (PLib3MFBeamLattice_AddBallPtr) dlsym(hLibrary, "lib3mf_beamlattice_addball"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_AddBall == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_SetBall = (PLib3MFBeamLattice_SetBallPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setball"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_SetBall = (PLib3MFBeamLattice_SetBallPtr) dlsym(hLibrary, "lib3mf_beamlattice_setball"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_SetBall == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_SetBalls = (PLib3MFBeamLattice_SetBallsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setballs"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_SetBalls = (PLib3MFBeamLattice_SetBallsPtr) dlsym(hLibrary, "lib3mf_beamlattice_setballs"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_SetBalls == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBalls = (PLib3MFBeamLattice_GetBallsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getballs"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBalls = (PLib3MFBeamLattice_GetBallsPtr) dlsym(hLibrary, "lib3mf_beamlattice_getballs"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBalls == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBeamSetCount = (PLib3MFBeamLattice_GetBeamSetCountPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeamsetcount"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBeamSetCount = (PLib3MFBeamLattice_GetBeamSetCountPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeamsetcount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBeamSetCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_AddBeamSet = (PLib3MFBeamLattice_AddBeamSetPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_addbeamset"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_AddBeamSet = (PLib3MFBeamLattice_AddBeamSetPtr) dlsym(hLibrary, "lib3mf_beamlattice_addbeamset"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_AddBeamSet == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamLattice_GetBeamSet = (PLib3MFBeamLattice_GetBeamSetPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeamset"); + #else // _WIN32 + pWrapperTable->m_BeamLattice_GetBeamSet = (PLib3MFBeamLattice_GetBeamSetPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeamset"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamLattice_GetBeamSet == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Component_GetObjectResource = (PLib3MFComponent_GetObjectResourcePtr) GetProcAddress(hLibrary, "lib3mf_component_getobjectresource"); + #else // _WIN32 + pWrapperTable->m_Component_GetObjectResource = (PLib3MFComponent_GetObjectResourcePtr) dlsym(hLibrary, "lib3mf_component_getobjectresource"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Component_GetObjectResource == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Component_GetObjectResourceID = (PLib3MFComponent_GetObjectResourceIDPtr) GetProcAddress(hLibrary, "lib3mf_component_getobjectresourceid"); + #else // _WIN32 + pWrapperTable->m_Component_GetObjectResourceID = (PLib3MFComponent_GetObjectResourceIDPtr) dlsym(hLibrary, "lib3mf_component_getobjectresourceid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Component_GetObjectResourceID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Component_GetUUID = (PLib3MFComponent_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_component_getuuid"); + #else // _WIN32 + pWrapperTable->m_Component_GetUUID = (PLib3MFComponent_GetUUIDPtr) dlsym(hLibrary, "lib3mf_component_getuuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Component_GetUUID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Component_SetUUID = (PLib3MFComponent_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_component_setuuid"); + #else // _WIN32 + pWrapperTable->m_Component_SetUUID = (PLib3MFComponent_SetUUIDPtr) dlsym(hLibrary, "lib3mf_component_setuuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Component_SetUUID == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Component_HasTransform = (PLib3MFComponent_HasTransformPtr) GetProcAddress(hLibrary, "lib3mf_component_hastransform"); + #else // _WIN32 + pWrapperTable->m_Component_HasTransform = (PLib3MFComponent_HasTransformPtr) dlsym(hLibrary, "lib3mf_component_hastransform"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Component_HasTransform == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Component_GetTransform = (PLib3MFComponent_GetTransformPtr) GetProcAddress(hLibrary, "lib3mf_component_gettransform"); + #else // _WIN32 + pWrapperTable->m_Component_GetTransform = (PLib3MFComponent_GetTransformPtr) dlsym(hLibrary, "lib3mf_component_gettransform"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Component_GetTransform == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Component_SetTransform = (PLib3MFComponent_SetTransformPtr) GetProcAddress(hLibrary, "lib3mf_component_settransform"); + #else // _WIN32 + pWrapperTable->m_Component_SetTransform = (PLib3MFComponent_SetTransformPtr) dlsym(hLibrary, "lib3mf_component_settransform"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Component_SetTransform == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ComponentsObject_AddComponent = (PLib3MFComponentsObject_AddComponentPtr) GetProcAddress(hLibrary, "lib3mf_componentsobject_addcomponent"); + #else // _WIN32 + pWrapperTable->m_ComponentsObject_AddComponent = (PLib3MFComponentsObject_AddComponentPtr) dlsym(hLibrary, "lib3mf_componentsobject_addcomponent"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ComponentsObject_AddComponent == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ComponentsObject_GetComponent = (PLib3MFComponentsObject_GetComponentPtr) GetProcAddress(hLibrary, "lib3mf_componentsobject_getcomponent"); + #else // _WIN32 + pWrapperTable->m_ComponentsObject_GetComponent = (PLib3MFComponentsObject_GetComponentPtr) dlsym(hLibrary, "lib3mf_componentsobject_getcomponent"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ComponentsObject_GetComponent == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_ComponentsObject_GetComponentCount = (PLib3MFComponentsObject_GetComponentCountPtr) GetProcAddress(hLibrary, "lib3mf_componentsobject_getcomponentcount"); + #else // _WIN32 + pWrapperTable->m_ComponentsObject_GetComponentCount = (PLib3MFComponentsObject_GetComponentCountPtr) dlsym(hLibrary, "lib3mf_componentsobject_getcomponentcount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_ComponentsObject_GetComponentCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_SetName = (PLib3MFBeamSet_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_beamset_setname"); + #else // _WIN32 + pWrapperTable->m_BeamSet_SetName = (PLib3MFBeamSet_SetNamePtr) dlsym(hLibrary, "lib3mf_beamset_setname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_SetName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_GetName = (PLib3MFBeamSet_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_beamset_getname"); + #else // _WIN32 + pWrapperTable->m_BeamSet_GetName = (PLib3MFBeamSet_GetNamePtr) dlsym(hLibrary, "lib3mf_beamset_getname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_GetName == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_SetIdentifier = (PLib3MFBeamSet_SetIdentifierPtr) GetProcAddress(hLibrary, "lib3mf_beamset_setidentifier"); + #else // _WIN32 + pWrapperTable->m_BeamSet_SetIdentifier = (PLib3MFBeamSet_SetIdentifierPtr) dlsym(hLibrary, "lib3mf_beamset_setidentifier"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_SetIdentifier == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_GetIdentifier = (PLib3MFBeamSet_GetIdentifierPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getidentifier"); + #else // _WIN32 + pWrapperTable->m_BeamSet_GetIdentifier = (PLib3MFBeamSet_GetIdentifierPtr) dlsym(hLibrary, "lib3mf_beamset_getidentifier"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_GetIdentifier == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_GetReferenceCount = (PLib3MFBeamSet_GetReferenceCountPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getreferencecount"); + #else // _WIN32 + pWrapperTable->m_BeamSet_GetReferenceCount = (PLib3MFBeamSet_GetReferenceCountPtr) dlsym(hLibrary, "lib3mf_beamset_getreferencecount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_GetReferenceCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_SetReferences = (PLib3MFBeamSet_SetReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_setreferences"); + #else // _WIN32 + pWrapperTable->m_BeamSet_SetReferences = (PLib3MFBeamSet_SetReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_setreferences"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_SetReferences == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_GetReferences = (PLib3MFBeamSet_GetReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getreferences"); + #else // _WIN32 + pWrapperTable->m_BeamSet_GetReferences = (PLib3MFBeamSet_GetReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_getreferences"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_GetReferences == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_GetBallReferenceCount = (PLib3MFBeamSet_GetBallReferenceCountPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getballreferencecount"); + #else // _WIN32 + pWrapperTable->m_BeamSet_GetBallReferenceCount = (PLib3MFBeamSet_GetBallReferenceCountPtr) dlsym(hLibrary, "lib3mf_beamset_getballreferencecount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_GetBallReferenceCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_SetBallReferences = (PLib3MFBeamSet_SetBallReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_setballreferences"); + #else // _WIN32 + pWrapperTable->m_BeamSet_SetBallReferences = (PLib3MFBeamSet_SetBallReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_setballreferences"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_BeamSet_SetBallReferences == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_BeamSet_GetBallReferences = (PLib3MFBeamSet_GetBallReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getballreferences"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetVertex = (PLib3MFMeshObject_GetVertexPtr) dlsym(hLibrary, "lib3mf_meshobject_getvertex"); + pWrapperTable->m_BeamSet_GetBallReferences = (PLib3MFBeamSet_GetBallReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_getballreferences"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetVertex == NULL) + if (pWrapperTable->m_BeamSet_GetBallReferences == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_SetVertex = (PLib3MFMeshObject_SetVertexPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setvertex"); + pWrapperTable->m_BaseMaterialGroup_GetCount = (PLib3MFBaseMaterialGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getcount"); #else // _WIN32 - pWrapperTable->m_MeshObject_SetVertex = (PLib3MFMeshObject_SetVertexPtr) dlsym(hLibrary, "lib3mf_meshobject_setvertex"); + pWrapperTable->m_BaseMaterialGroup_GetCount = (PLib3MFBaseMaterialGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_SetVertex == NULL) + if (pWrapperTable->m_BaseMaterialGroup_GetCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_AddVertex = (PLib3MFMeshObject_AddVertexPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_addvertex"); + pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs = (PLib3MFBaseMaterialGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getallpropertyids"); #else // _WIN32 - pWrapperTable->m_MeshObject_AddVertex = (PLib3MFMeshObject_AddVertexPtr) dlsym(hLibrary, "lib3mf_meshobject_addvertex"); + pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs = (PLib3MFBaseMaterialGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getallpropertyids"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_AddVertex == NULL) + if (pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetVertices = (PLib3MFMeshObject_GetVerticesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getvertices"); + pWrapperTable->m_BaseMaterialGroup_AddMaterial = (PLib3MFBaseMaterialGroup_AddMaterialPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_addmaterial"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetVertices = (PLib3MFMeshObject_GetVerticesPtr) dlsym(hLibrary, "lib3mf_meshobject_getvertices"); + pWrapperTable->m_BaseMaterialGroup_AddMaterial = (PLib3MFBaseMaterialGroup_AddMaterialPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_addmaterial"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetVertices == NULL) + if (pWrapperTable->m_BaseMaterialGroup_AddMaterial == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetTriangle = (PLib3MFMeshObject_GetTrianglePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettriangle"); + pWrapperTable->m_BaseMaterialGroup_RemoveMaterial = (PLib3MFBaseMaterialGroup_RemoveMaterialPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_removematerial"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetTriangle = (PLib3MFMeshObject_GetTrianglePtr) dlsym(hLibrary, "lib3mf_meshobject_gettriangle"); + pWrapperTable->m_BaseMaterialGroup_RemoveMaterial = (PLib3MFBaseMaterialGroup_RemoveMaterialPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_removematerial"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetTriangle == NULL) + if (pWrapperTable->m_BaseMaterialGroup_RemoveMaterial == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_SetTriangle = (PLib3MFMeshObject_SetTrianglePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_settriangle"); + pWrapperTable->m_BaseMaterialGroup_GetName = (PLib3MFBaseMaterialGroup_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getname"); #else // _WIN32 - pWrapperTable->m_MeshObject_SetTriangle = (PLib3MFMeshObject_SetTrianglePtr) dlsym(hLibrary, "lib3mf_meshobject_settriangle"); + pWrapperTable->m_BaseMaterialGroup_GetName = (PLib3MFBaseMaterialGroup_GetNamePtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_SetTriangle == NULL) + if (pWrapperTable->m_BaseMaterialGroup_GetName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_AddTriangle = (PLib3MFMeshObject_AddTrianglePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_addtriangle"); + pWrapperTable->m_BaseMaterialGroup_SetName = (PLib3MFBaseMaterialGroup_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_setname"); #else // _WIN32 - pWrapperTable->m_MeshObject_AddTriangle = (PLib3MFMeshObject_AddTrianglePtr) dlsym(hLibrary, "lib3mf_meshobject_addtriangle"); + pWrapperTable->m_BaseMaterialGroup_SetName = (PLib3MFBaseMaterialGroup_SetNamePtr) dlsym(hLibrary, "lib3mf_basematerialgroup_setname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_AddTriangle == NULL) + if (pWrapperTable->m_BaseMaterialGroup_SetName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetTriangleIndices = (PLib3MFMeshObject_GetTriangleIndicesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettriangleindices"); + pWrapperTable->m_BaseMaterialGroup_SetDisplayColor = (PLib3MFBaseMaterialGroup_SetDisplayColorPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_setdisplaycolor"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetTriangleIndices = (PLib3MFMeshObject_GetTriangleIndicesPtr) dlsym(hLibrary, "lib3mf_meshobject_gettriangleindices"); + pWrapperTable->m_BaseMaterialGroup_SetDisplayColor = (PLib3MFBaseMaterialGroup_SetDisplayColorPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_setdisplaycolor"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetTriangleIndices == NULL) + if (pWrapperTable->m_BaseMaterialGroup_SetDisplayColor == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_SetObjectLevelProperty = (PLib3MFMeshObject_SetObjectLevelPropertyPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setobjectlevelproperty"); + pWrapperTable->m_BaseMaterialGroup_GetDisplayColor = (PLib3MFBaseMaterialGroup_GetDisplayColorPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getdisplaycolor"); #else // _WIN32 - pWrapperTable->m_MeshObject_SetObjectLevelProperty = (PLib3MFMeshObject_SetObjectLevelPropertyPtr) dlsym(hLibrary, "lib3mf_meshobject_setobjectlevelproperty"); + pWrapperTable->m_BaseMaterialGroup_GetDisplayColor = (PLib3MFBaseMaterialGroup_GetDisplayColorPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getdisplaycolor"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_SetObjectLevelProperty == NULL) + if (pWrapperTable->m_BaseMaterialGroup_GetDisplayColor == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetObjectLevelProperty = (PLib3MFMeshObject_GetObjectLevelPropertyPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getobjectlevelproperty"); + pWrapperTable->m_ColorGroup_GetCount = (PLib3MFColorGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_getcount"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetObjectLevelProperty = (PLib3MFMeshObject_GetObjectLevelPropertyPtr) dlsym(hLibrary, "lib3mf_meshobject_getobjectlevelproperty"); + pWrapperTable->m_ColorGroup_GetCount = (PLib3MFColorGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_colorgroup_getcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetObjectLevelProperty == NULL) + if (pWrapperTable->m_ColorGroup_GetCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_SetTriangleProperties = (PLib3MFMeshObject_SetTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_settriangleproperties"); + pWrapperTable->m_ColorGroup_GetAllPropertyIDs = (PLib3MFColorGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_getallpropertyids"); #else // _WIN32 - pWrapperTable->m_MeshObject_SetTriangleProperties = (PLib3MFMeshObject_SetTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_settriangleproperties"); + pWrapperTable->m_ColorGroup_GetAllPropertyIDs = (PLib3MFColorGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_colorgroup_getallpropertyids"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_SetTriangleProperties == NULL) + if (pWrapperTable->m_ColorGroup_GetAllPropertyIDs == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetTriangleProperties = (PLib3MFMeshObject_GetTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_gettriangleproperties"); + pWrapperTable->m_ColorGroup_AddColor = (PLib3MFColorGroup_AddColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_addcolor"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetTriangleProperties = (PLib3MFMeshObject_GetTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_gettriangleproperties"); + pWrapperTable->m_ColorGroup_AddColor = (PLib3MFColorGroup_AddColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_addcolor"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetTriangleProperties == NULL) + if (pWrapperTable->m_ColorGroup_AddColor == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_SetAllTriangleProperties = (PLib3MFMeshObject_SetAllTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setalltriangleproperties"); + pWrapperTable->m_ColorGroup_RemoveColor = (PLib3MFColorGroup_RemoveColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_removecolor"); #else // _WIN32 - pWrapperTable->m_MeshObject_SetAllTriangleProperties = (PLib3MFMeshObject_SetAllTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_setalltriangleproperties"); + pWrapperTable->m_ColorGroup_RemoveColor = (PLib3MFColorGroup_RemoveColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_removecolor"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_SetAllTriangleProperties == NULL) + if (pWrapperTable->m_ColorGroup_RemoveColor == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_GetAllTriangleProperties = (PLib3MFMeshObject_GetAllTrianglePropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_getalltriangleproperties"); + pWrapperTable->m_ColorGroup_SetColor = (PLib3MFColorGroup_SetColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_setcolor"); #else // _WIN32 - pWrapperTable->m_MeshObject_GetAllTriangleProperties = (PLib3MFMeshObject_GetAllTrianglePropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_getalltriangleproperties"); + pWrapperTable->m_ColorGroup_SetColor = (PLib3MFColorGroup_SetColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_setcolor"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_GetAllTriangleProperties == NULL) + if (pWrapperTable->m_ColorGroup_SetColor == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_ClearAllProperties = (PLib3MFMeshObject_ClearAllPropertiesPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_clearallproperties"); + pWrapperTable->m_ColorGroup_GetColor = (PLib3MFColorGroup_GetColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_getcolor"); #else // _WIN32 - pWrapperTable->m_MeshObject_ClearAllProperties = (PLib3MFMeshObject_ClearAllPropertiesPtr) dlsym(hLibrary, "lib3mf_meshobject_clearallproperties"); + pWrapperTable->m_ColorGroup_GetColor = (PLib3MFColorGroup_GetColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_getcolor"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_ClearAllProperties == NULL) + if (pWrapperTable->m_ColorGroup_GetColor == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_SetGeometry = (PLib3MFMeshObject_SetGeometryPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_setgeometry"); + pWrapperTable->m_Texture2DGroup_GetCount = (PLib3MFTexture2DGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_getcount"); #else // _WIN32 - pWrapperTable->m_MeshObject_SetGeometry = (PLib3MFMeshObject_SetGeometryPtr) dlsym(hLibrary, "lib3mf_meshobject_setgeometry"); + pWrapperTable->m_Texture2DGroup_GetCount = (PLib3MFTexture2DGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_getcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_SetGeometry == NULL) + if (pWrapperTable->m_Texture2DGroup_GetCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_IsManifoldAndOriented = (PLib3MFMeshObject_IsManifoldAndOrientedPtr) GetProcAddress(hLibrary, "lib3mf_meshobject_ismanifoldandoriented"); + pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs = (PLib3MFTexture2DGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_getallpropertyids"); #else // _WIN32 - pWrapperTable->m_MeshObject_IsManifoldAndOriented = (PLib3MFMeshObject_IsManifoldAndOrientedPtr) dlsym(hLibrary, "lib3mf_meshobject_ismanifoldandoriented"); + pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs = (PLib3MFTexture2DGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_getallpropertyids"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_IsManifoldAndOriented == NULL) + if (pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MeshObject_BeamLattice = (PLib3MFMeshObject_BeamLatticePtr) GetProcAddress(hLibrary, "lib3mf_meshobject_beamlattice"); + pWrapperTable->m_Texture2DGroup_AddTex2Coord = (PLib3MFTexture2DGroup_AddTex2CoordPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_addtex2coord"); #else // _WIN32 - pWrapperTable->m_MeshObject_BeamLattice = (PLib3MFMeshObject_BeamLatticePtr) dlsym(hLibrary, "lib3mf_meshobject_beamlattice"); + pWrapperTable->m_Texture2DGroup_AddTex2Coord = (PLib3MFTexture2DGroup_AddTex2CoordPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_addtex2coord"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MeshObject_BeamLattice == NULL) + if (pWrapperTable->m_Texture2DGroup_AddTex2Coord == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetMinLength = (PLib3MFBeamLattice_GetMinLengthPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getminlength"); + pWrapperTable->m_Texture2DGroup_GetTex2Coord = (PLib3MFTexture2DGroup_GetTex2CoordPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_gettex2coord"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetMinLength = (PLib3MFBeamLattice_GetMinLengthPtr) dlsym(hLibrary, "lib3mf_beamlattice_getminlength"); + pWrapperTable->m_Texture2DGroup_GetTex2Coord = (PLib3MFTexture2DGroup_GetTex2CoordPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_gettex2coord"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetMinLength == NULL) + if (pWrapperTable->m_Texture2DGroup_GetTex2Coord == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetMinLength = (PLib3MFBeamLattice_SetMinLengthPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setminlength"); + pWrapperTable->m_Texture2DGroup_RemoveTex2Coord = (PLib3MFTexture2DGroup_RemoveTex2CoordPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_removetex2coord"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetMinLength = (PLib3MFBeamLattice_SetMinLengthPtr) dlsym(hLibrary, "lib3mf_beamlattice_setminlength"); + pWrapperTable->m_Texture2DGroup_RemoveTex2Coord = (PLib3MFTexture2DGroup_RemoveTex2CoordPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_removetex2coord"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetMinLength == NULL) + if (pWrapperTable->m_Texture2DGroup_RemoveTex2Coord == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetClipping = (PLib3MFBeamLattice_GetClippingPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getclipping"); + pWrapperTable->m_Texture2DGroup_GetTexture2D = (PLib3MFTexture2DGroup_GetTexture2DPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_gettexture2d"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetClipping = (PLib3MFBeamLattice_GetClippingPtr) dlsym(hLibrary, "lib3mf_beamlattice_getclipping"); + pWrapperTable->m_Texture2DGroup_GetTexture2D = (PLib3MFTexture2DGroup_GetTexture2DPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_gettexture2d"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetClipping == NULL) + if (pWrapperTable->m_Texture2DGroup_GetTexture2D == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetClipping = (PLib3MFBeamLattice_SetClippingPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setclipping"); + pWrapperTable->m_CompositeMaterials_GetCount = (PLib3MFCompositeMaterials_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getcount"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetClipping = (PLib3MFBeamLattice_SetClippingPtr) dlsym(hLibrary, "lib3mf_beamlattice_setclipping"); + pWrapperTable->m_CompositeMaterials_GetCount = (PLib3MFCompositeMaterials_GetCountPtr) dlsym(hLibrary, "lib3mf_compositematerials_getcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetClipping == NULL) + if (pWrapperTable->m_CompositeMaterials_GetCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetRepresentation = (PLib3MFBeamLattice_GetRepresentationPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getrepresentation"); + pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs = (PLib3MFCompositeMaterials_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getallpropertyids"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetRepresentation = (PLib3MFBeamLattice_GetRepresentationPtr) dlsym(hLibrary, "lib3mf_beamlattice_getrepresentation"); + pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs = (PLib3MFCompositeMaterials_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_compositematerials_getallpropertyids"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetRepresentation == NULL) + if (pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetRepresentation = (PLib3MFBeamLattice_SetRepresentationPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setrepresentation"); + pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup = (PLib3MFCompositeMaterials_GetBaseMaterialGroupPtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getbasematerialgroup"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetRepresentation = (PLib3MFBeamLattice_SetRepresentationPtr) dlsym(hLibrary, "lib3mf_beamlattice_setrepresentation"); + pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup = (PLib3MFCompositeMaterials_GetBaseMaterialGroupPtr) dlsym(hLibrary, "lib3mf_compositematerials_getbasematerialgroup"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetRepresentation == NULL) + if (pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBallOptions = (PLib3MFBeamLattice_GetBallOptionsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getballoptions"); + pWrapperTable->m_CompositeMaterials_AddComposite = (PLib3MFCompositeMaterials_AddCompositePtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_addcomposite"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBallOptions = (PLib3MFBeamLattice_GetBallOptionsPtr) dlsym(hLibrary, "lib3mf_beamlattice_getballoptions"); + pWrapperTable->m_CompositeMaterials_AddComposite = (PLib3MFCompositeMaterials_AddCompositePtr) dlsym(hLibrary, "lib3mf_compositematerials_addcomposite"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_CompositeMaterials_AddComposite == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_CompositeMaterials_RemoveComposite = (PLib3MFCompositeMaterials_RemoveCompositePtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_removecomposite"); + #else // _WIN32 + pWrapperTable->m_CompositeMaterials_RemoveComposite = (PLib3MFCompositeMaterials_RemoveCompositePtr) dlsym(hLibrary, "lib3mf_compositematerials_removecomposite"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_CompositeMaterials_RemoveComposite == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_CompositeMaterials_GetComposite = (PLib3MFCompositeMaterials_GetCompositePtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getcomposite"); + #else // _WIN32 + pWrapperTable->m_CompositeMaterials_GetComposite = (PLib3MFCompositeMaterials_GetCompositePtr) dlsym(hLibrary, "lib3mf_compositematerials_getcomposite"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_CompositeMaterials_GetComposite == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetCount = (PLib3MFMultiPropertyGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getcount"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetCount = (PLib3MFMultiPropertyGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getcount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_GetCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs = (PLib3MFMultiPropertyGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getallpropertyids"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs = (PLib3MFMultiPropertyGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getallpropertyids"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_AddMultiProperty = (PLib3MFMultiPropertyGroup_AddMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_addmultiproperty"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_AddMultiProperty = (PLib3MFMultiPropertyGroup_AddMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_addmultiproperty"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_AddMultiProperty == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_SetMultiProperty = (PLib3MFMultiPropertyGroup_SetMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_setmultiproperty"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_SetMultiProperty = (PLib3MFMultiPropertyGroup_SetMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_setmultiproperty"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_SetMultiProperty == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetMultiProperty = (PLib3MFMultiPropertyGroup_GetMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getmultiproperty"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetMultiProperty = (PLib3MFMultiPropertyGroup_GetMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getmultiproperty"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_GetMultiProperty == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty = (PLib3MFMultiPropertyGroup_RemoveMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_removemultiproperty"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty = (PLib3MFMultiPropertyGroup_RemoveMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_removemultiproperty"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetLayerCount = (PLib3MFMultiPropertyGroup_GetLayerCountPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getlayercount"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetLayerCount = (PLib3MFMultiPropertyGroup_GetLayerCountPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getlayercount"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_GetLayerCount == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_AddLayer = (PLib3MFMultiPropertyGroup_AddLayerPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_addlayer"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_AddLayer = (PLib3MFMultiPropertyGroup_AddLayerPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_addlayer"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_AddLayer == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetLayer = (PLib3MFMultiPropertyGroup_GetLayerPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getlayer"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_GetLayer = (PLib3MFMultiPropertyGroup_GetLayerPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getlayer"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MultiPropertyGroup_GetLayer == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MultiPropertyGroup_RemoveLayer = (PLib3MFMultiPropertyGroup_RemoveLayerPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_removelayer"); + #else // _WIN32 + pWrapperTable->m_MultiPropertyGroup_RemoveLayer = (PLib3MFMultiPropertyGroup_RemoveLayerPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_removelayer"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBallOptions == NULL) + if (pWrapperTable->m_MultiPropertyGroup_RemoveLayer == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetBallOptions = (PLib3MFBeamLattice_SetBallOptionsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setballoptions"); + pWrapperTable->m_Attachment_GetPath = (PLib3MFAttachment_GetPathPtr) GetProcAddress(hLibrary, "lib3mf_attachment_getpath"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetBallOptions = (PLib3MFBeamLattice_SetBallOptionsPtr) dlsym(hLibrary, "lib3mf_beamlattice_setballoptions"); + pWrapperTable->m_Attachment_GetPath = (PLib3MFAttachment_GetPathPtr) dlsym(hLibrary, "lib3mf_attachment_getpath"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetBallOptions == NULL) + if (pWrapperTable->m_Attachment_GetPath == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBeamCount = (PLib3MFBeamLattice_GetBeamCountPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeamcount"); + pWrapperTable->m_Attachment_SetPath = (PLib3MFAttachment_SetPathPtr) GetProcAddress(hLibrary, "lib3mf_attachment_setpath"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBeamCount = (PLib3MFBeamLattice_GetBeamCountPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeamcount"); + pWrapperTable->m_Attachment_SetPath = (PLib3MFAttachment_SetPathPtr) dlsym(hLibrary, "lib3mf_attachment_setpath"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBeamCount == NULL) + if (pWrapperTable->m_Attachment_SetPath == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBeam = (PLib3MFBeamLattice_GetBeamPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeam"); + pWrapperTable->m_Attachment_PackagePart = (PLib3MFAttachment_PackagePartPtr) GetProcAddress(hLibrary, "lib3mf_attachment_packagepart"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBeam = (PLib3MFBeamLattice_GetBeamPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeam"); + pWrapperTable->m_Attachment_PackagePart = (PLib3MFAttachment_PackagePartPtr) dlsym(hLibrary, "lib3mf_attachment_packagepart"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBeam == NULL) + if (pWrapperTable->m_Attachment_PackagePart == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_AddBeam = (PLib3MFBeamLattice_AddBeamPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_addbeam"); + pWrapperTable->m_Attachment_GetRelationShipType = (PLib3MFAttachment_GetRelationShipTypePtr) GetProcAddress(hLibrary, "lib3mf_attachment_getrelationshiptype"); #else // _WIN32 - pWrapperTable->m_BeamLattice_AddBeam = (PLib3MFBeamLattice_AddBeamPtr) dlsym(hLibrary, "lib3mf_beamlattice_addbeam"); + pWrapperTable->m_Attachment_GetRelationShipType = (PLib3MFAttachment_GetRelationShipTypePtr) dlsym(hLibrary, "lib3mf_attachment_getrelationshiptype"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_AddBeam == NULL) + if (pWrapperTable->m_Attachment_GetRelationShipType == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetBeam = (PLib3MFBeamLattice_SetBeamPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setbeam"); + pWrapperTable->m_Attachment_SetRelationShipType = (PLib3MFAttachment_SetRelationShipTypePtr) GetProcAddress(hLibrary, "lib3mf_attachment_setrelationshiptype"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetBeam = (PLib3MFBeamLattice_SetBeamPtr) dlsym(hLibrary, "lib3mf_beamlattice_setbeam"); + pWrapperTable->m_Attachment_SetRelationShipType = (PLib3MFAttachment_SetRelationShipTypePtr) dlsym(hLibrary, "lib3mf_attachment_setrelationshiptype"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetBeam == NULL) + if (pWrapperTable->m_Attachment_SetRelationShipType == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetBeams = (PLib3MFBeamLattice_SetBeamsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setbeams"); + pWrapperTable->m_Attachment_WriteToFile = (PLib3MFAttachment_WriteToFilePtr) GetProcAddress(hLibrary, "lib3mf_attachment_writetofile"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetBeams = (PLib3MFBeamLattice_SetBeamsPtr) dlsym(hLibrary, "lib3mf_beamlattice_setbeams"); + pWrapperTable->m_Attachment_WriteToFile = (PLib3MFAttachment_WriteToFilePtr) dlsym(hLibrary, "lib3mf_attachment_writetofile"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetBeams == NULL) + if (pWrapperTable->m_Attachment_WriteToFile == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBeams = (PLib3MFBeamLattice_GetBeamsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeams"); + pWrapperTable->m_Attachment_ReadFromFile = (PLib3MFAttachment_ReadFromFilePtr) GetProcAddress(hLibrary, "lib3mf_attachment_readfromfile"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBeams = (PLib3MFBeamLattice_GetBeamsPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeams"); + pWrapperTable->m_Attachment_ReadFromFile = (PLib3MFAttachment_ReadFromFilePtr) dlsym(hLibrary, "lib3mf_attachment_readfromfile"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBeams == NULL) + if (pWrapperTable->m_Attachment_ReadFromFile == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBallCount = (PLib3MFBeamLattice_GetBallCountPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getballcount"); + pWrapperTable->m_Attachment_ReadFromCallback = (PLib3MFAttachment_ReadFromCallbackPtr) GetProcAddress(hLibrary, "lib3mf_attachment_readfromcallback"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBallCount = (PLib3MFBeamLattice_GetBallCountPtr) dlsym(hLibrary, "lib3mf_beamlattice_getballcount"); + pWrapperTable->m_Attachment_ReadFromCallback = (PLib3MFAttachment_ReadFromCallbackPtr) dlsym(hLibrary, "lib3mf_attachment_readfromcallback"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBallCount == NULL) + if (pWrapperTable->m_Attachment_ReadFromCallback == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBall = (PLib3MFBeamLattice_GetBallPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getball"); + pWrapperTable->m_Attachment_GetStreamSize = (PLib3MFAttachment_GetStreamSizePtr) GetProcAddress(hLibrary, "lib3mf_attachment_getstreamsize"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBall = (PLib3MFBeamLattice_GetBallPtr) dlsym(hLibrary, "lib3mf_beamlattice_getball"); + pWrapperTable->m_Attachment_GetStreamSize = (PLib3MFAttachment_GetStreamSizePtr) dlsym(hLibrary, "lib3mf_attachment_getstreamsize"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBall == NULL) + if (pWrapperTable->m_Attachment_GetStreamSize == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_AddBall = (PLib3MFBeamLattice_AddBallPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_addball"); + pWrapperTable->m_Attachment_WriteToBuffer = (PLib3MFAttachment_WriteToBufferPtr) GetProcAddress(hLibrary, "lib3mf_attachment_writetobuffer"); #else // _WIN32 - pWrapperTable->m_BeamLattice_AddBall = (PLib3MFBeamLattice_AddBallPtr) dlsym(hLibrary, "lib3mf_beamlattice_addball"); + pWrapperTable->m_Attachment_WriteToBuffer = (PLib3MFAttachment_WriteToBufferPtr) dlsym(hLibrary, "lib3mf_attachment_writetobuffer"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_AddBall == NULL) + if (pWrapperTable->m_Attachment_WriteToBuffer == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetBall = (PLib3MFBeamLattice_SetBallPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setball"); + pWrapperTable->m_Attachment_ReadFromBuffer = (PLib3MFAttachment_ReadFromBufferPtr) GetProcAddress(hLibrary, "lib3mf_attachment_readfrombuffer"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetBall = (PLib3MFBeamLattice_SetBallPtr) dlsym(hLibrary, "lib3mf_beamlattice_setball"); + pWrapperTable->m_Attachment_ReadFromBuffer = (PLib3MFAttachment_ReadFromBufferPtr) dlsym(hLibrary, "lib3mf_attachment_readfrombuffer"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetBall == NULL) + if (pWrapperTable->m_Attachment_ReadFromBuffer == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_SetBalls = (PLib3MFBeamLattice_SetBallsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_setballs"); + pWrapperTable->m_Texture2D_GetAttachment = (PLib3MFTexture2D_GetAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_getattachment"); #else // _WIN32 - pWrapperTable->m_BeamLattice_SetBalls = (PLib3MFBeamLattice_SetBallsPtr) dlsym(hLibrary, "lib3mf_beamlattice_setballs"); + pWrapperTable->m_Texture2D_GetAttachment = (PLib3MFTexture2D_GetAttachmentPtr) dlsym(hLibrary, "lib3mf_texture2d_getattachment"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_SetBalls == NULL) + if (pWrapperTable->m_Texture2D_GetAttachment == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBalls = (PLib3MFBeamLattice_GetBallsPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getballs"); + pWrapperTable->m_Texture2D_SetAttachment = (PLib3MFTexture2D_SetAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_setattachment"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBalls = (PLib3MFBeamLattice_GetBallsPtr) dlsym(hLibrary, "lib3mf_beamlattice_getballs"); + pWrapperTable->m_Texture2D_SetAttachment = (PLib3MFTexture2D_SetAttachmentPtr) dlsym(hLibrary, "lib3mf_texture2d_setattachment"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBalls == NULL) + if (pWrapperTable->m_Texture2D_SetAttachment == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBeamSetCount = (PLib3MFBeamLattice_GetBeamSetCountPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeamsetcount"); + pWrapperTable->m_Texture2D_GetContentType = (PLib3MFTexture2D_GetContentTypePtr) GetProcAddress(hLibrary, "lib3mf_texture2d_getcontenttype"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBeamSetCount = (PLib3MFBeamLattice_GetBeamSetCountPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeamsetcount"); + pWrapperTable->m_Texture2D_GetContentType = (PLib3MFTexture2D_GetContentTypePtr) dlsym(hLibrary, "lib3mf_texture2d_getcontenttype"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBeamSetCount == NULL) + if (pWrapperTable->m_Texture2D_GetContentType == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_AddBeamSet = (PLib3MFBeamLattice_AddBeamSetPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_addbeamset"); + pWrapperTable->m_Texture2D_SetContentType = (PLib3MFTexture2D_SetContentTypePtr) GetProcAddress(hLibrary, "lib3mf_texture2d_setcontenttype"); #else // _WIN32 - pWrapperTable->m_BeamLattice_AddBeamSet = (PLib3MFBeamLattice_AddBeamSetPtr) dlsym(hLibrary, "lib3mf_beamlattice_addbeamset"); + pWrapperTable->m_Texture2D_SetContentType = (PLib3MFTexture2D_SetContentTypePtr) dlsym(hLibrary, "lib3mf_texture2d_setcontenttype"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_AddBeamSet == NULL) + if (pWrapperTable->m_Texture2D_SetContentType == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamLattice_GetBeamSet = (PLib3MFBeamLattice_GetBeamSetPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getbeamset"); + pWrapperTable->m_Texture2D_GetTileStyleUV = (PLib3MFTexture2D_GetTileStyleUVPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_gettilestyleuv"); #else // _WIN32 - pWrapperTable->m_BeamLattice_GetBeamSet = (PLib3MFBeamLattice_GetBeamSetPtr) dlsym(hLibrary, "lib3mf_beamlattice_getbeamset"); + pWrapperTable->m_Texture2D_GetTileStyleUV = (PLib3MFTexture2D_GetTileStyleUVPtr) dlsym(hLibrary, "lib3mf_texture2d_gettilestyleuv"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamLattice_GetBeamSet == NULL) + if (pWrapperTable->m_Texture2D_GetTileStyleUV == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_GetObjectResource = (PLib3MFComponent_GetObjectResourcePtr) GetProcAddress(hLibrary, "lib3mf_component_getobjectresource"); + pWrapperTable->m_Texture2D_SetTileStyleUV = (PLib3MFTexture2D_SetTileStyleUVPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_settilestyleuv"); #else // _WIN32 - pWrapperTable->m_Component_GetObjectResource = (PLib3MFComponent_GetObjectResourcePtr) dlsym(hLibrary, "lib3mf_component_getobjectresource"); + pWrapperTable->m_Texture2D_SetTileStyleUV = (PLib3MFTexture2D_SetTileStyleUVPtr) dlsym(hLibrary, "lib3mf_texture2d_settilestyleuv"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_GetObjectResource == NULL) + if (pWrapperTable->m_Texture2D_SetTileStyleUV == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_GetObjectResourceID = (PLib3MFComponent_GetObjectResourceIDPtr) GetProcAddress(hLibrary, "lib3mf_component_getobjectresourceid"); + pWrapperTable->m_Texture2D_GetFilter = (PLib3MFTexture2D_GetFilterPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_getfilter"); #else // _WIN32 - pWrapperTable->m_Component_GetObjectResourceID = (PLib3MFComponent_GetObjectResourceIDPtr) dlsym(hLibrary, "lib3mf_component_getobjectresourceid"); + pWrapperTable->m_Texture2D_GetFilter = (PLib3MFTexture2D_GetFilterPtr) dlsym(hLibrary, "lib3mf_texture2d_getfilter"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_GetObjectResourceID == NULL) + if (pWrapperTable->m_Texture2D_GetFilter == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_GetUUID = (PLib3MFComponent_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_component_getuuid"); + pWrapperTable->m_Texture2D_SetFilter = (PLib3MFTexture2D_SetFilterPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_setfilter"); #else // _WIN32 - pWrapperTable->m_Component_GetUUID = (PLib3MFComponent_GetUUIDPtr) dlsym(hLibrary, "lib3mf_component_getuuid"); + pWrapperTable->m_Texture2D_SetFilter = (PLib3MFTexture2D_SetFilterPtr) dlsym(hLibrary, "lib3mf_texture2d_setfilter"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_GetUUID == NULL) + if (pWrapperTable->m_Texture2D_SetFilter == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_SetUUID = (PLib3MFComponent_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_component_setuuid"); + pWrapperTable->m_BuildItem_GetObjectResource = (PLib3MFBuildItem_GetObjectResourcePtr) GetProcAddress(hLibrary, "lib3mf_builditem_getobjectresource"); #else // _WIN32 - pWrapperTable->m_Component_SetUUID = (PLib3MFComponent_SetUUIDPtr) dlsym(hLibrary, "lib3mf_component_setuuid"); + pWrapperTable->m_BuildItem_GetObjectResource = (PLib3MFBuildItem_GetObjectResourcePtr) dlsym(hLibrary, "lib3mf_builditem_getobjectresource"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_SetUUID == NULL) + if (pWrapperTable->m_BuildItem_GetObjectResource == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_HasTransform = (PLib3MFComponent_HasTransformPtr) GetProcAddress(hLibrary, "lib3mf_component_hastransform"); + pWrapperTable->m_BuildItem_GetUUID = (PLib3MFBuildItem_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getuuid"); #else // _WIN32 - pWrapperTable->m_Component_HasTransform = (PLib3MFComponent_HasTransformPtr) dlsym(hLibrary, "lib3mf_component_hastransform"); + pWrapperTable->m_BuildItem_GetUUID = (PLib3MFBuildItem_GetUUIDPtr) dlsym(hLibrary, "lib3mf_builditem_getuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_HasTransform == NULL) + if (pWrapperTable->m_BuildItem_GetUUID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_GetTransform = (PLib3MFComponent_GetTransformPtr) GetProcAddress(hLibrary, "lib3mf_component_gettransform"); + pWrapperTable->m_BuildItem_SetUUID = (PLib3MFBuildItem_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_builditem_setuuid"); #else // _WIN32 - pWrapperTable->m_Component_GetTransform = (PLib3MFComponent_GetTransformPtr) dlsym(hLibrary, "lib3mf_component_gettransform"); + pWrapperTable->m_BuildItem_SetUUID = (PLib3MFBuildItem_SetUUIDPtr) dlsym(hLibrary, "lib3mf_builditem_setuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_GetTransform == NULL) + if (pWrapperTable->m_BuildItem_SetUUID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Component_SetTransform = (PLib3MFComponent_SetTransformPtr) GetProcAddress(hLibrary, "lib3mf_component_settransform"); + pWrapperTable->m_BuildItem_GetObjectResourceID = (PLib3MFBuildItem_GetObjectResourceIDPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getobjectresourceid"); #else // _WIN32 - pWrapperTable->m_Component_SetTransform = (PLib3MFComponent_SetTransformPtr) dlsym(hLibrary, "lib3mf_component_settransform"); + pWrapperTable->m_BuildItem_GetObjectResourceID = (PLib3MFBuildItem_GetObjectResourceIDPtr) dlsym(hLibrary, "lib3mf_builditem_getobjectresourceid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Component_SetTransform == NULL) + if (pWrapperTable->m_BuildItem_GetObjectResourceID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ComponentsObject_AddComponent = (PLib3MFComponentsObject_AddComponentPtr) GetProcAddress(hLibrary, "lib3mf_componentsobject_addcomponent"); + pWrapperTable->m_BuildItem_HasObjectTransform = (PLib3MFBuildItem_HasObjectTransformPtr) GetProcAddress(hLibrary, "lib3mf_builditem_hasobjecttransform"); #else // _WIN32 - pWrapperTable->m_ComponentsObject_AddComponent = (PLib3MFComponentsObject_AddComponentPtr) dlsym(hLibrary, "lib3mf_componentsobject_addcomponent"); + pWrapperTable->m_BuildItem_HasObjectTransform = (PLib3MFBuildItem_HasObjectTransformPtr) dlsym(hLibrary, "lib3mf_builditem_hasobjecttransform"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ComponentsObject_AddComponent == NULL) + if (pWrapperTable->m_BuildItem_HasObjectTransform == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ComponentsObject_GetComponent = (PLib3MFComponentsObject_GetComponentPtr) GetProcAddress(hLibrary, "lib3mf_componentsobject_getcomponent"); + pWrapperTable->m_BuildItem_GetObjectTransform = (PLib3MFBuildItem_GetObjectTransformPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getobjecttransform"); #else // _WIN32 - pWrapperTable->m_ComponentsObject_GetComponent = (PLib3MFComponentsObject_GetComponentPtr) dlsym(hLibrary, "lib3mf_componentsobject_getcomponent"); + pWrapperTable->m_BuildItem_GetObjectTransform = (PLib3MFBuildItem_GetObjectTransformPtr) dlsym(hLibrary, "lib3mf_builditem_getobjecttransform"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ComponentsObject_GetComponent == NULL) + if (pWrapperTable->m_BuildItem_GetObjectTransform == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ComponentsObject_GetComponentCount = (PLib3MFComponentsObject_GetComponentCountPtr) GetProcAddress(hLibrary, "lib3mf_componentsobject_getcomponentcount"); + pWrapperTable->m_BuildItem_SetObjectTransform = (PLib3MFBuildItem_SetObjectTransformPtr) GetProcAddress(hLibrary, "lib3mf_builditem_setobjecttransform"); #else // _WIN32 - pWrapperTable->m_ComponentsObject_GetComponentCount = (PLib3MFComponentsObject_GetComponentCountPtr) dlsym(hLibrary, "lib3mf_componentsobject_getcomponentcount"); + pWrapperTable->m_BuildItem_SetObjectTransform = (PLib3MFBuildItem_SetObjectTransformPtr) dlsym(hLibrary, "lib3mf_builditem_setobjecttransform"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ComponentsObject_GetComponentCount == NULL) + if (pWrapperTable->m_BuildItem_SetObjectTransform == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_SetName = (PLib3MFBeamSet_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_beamset_setname"); + pWrapperTable->m_BuildItem_GetPartNumber = (PLib3MFBuildItem_GetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getpartnumber"); #else // _WIN32 - pWrapperTable->m_BeamSet_SetName = (PLib3MFBeamSet_SetNamePtr) dlsym(hLibrary, "lib3mf_beamset_setname"); + pWrapperTable->m_BuildItem_GetPartNumber = (PLib3MFBuildItem_GetPartNumberPtr) dlsym(hLibrary, "lib3mf_builditem_getpartnumber"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_SetName == NULL) + if (pWrapperTable->m_BuildItem_GetPartNumber == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_GetName = (PLib3MFBeamSet_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_beamset_getname"); + pWrapperTable->m_BuildItem_SetPartNumber = (PLib3MFBuildItem_SetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_builditem_setpartnumber"); #else // _WIN32 - pWrapperTable->m_BeamSet_GetName = (PLib3MFBeamSet_GetNamePtr) dlsym(hLibrary, "lib3mf_beamset_getname"); + pWrapperTable->m_BuildItem_SetPartNumber = (PLib3MFBuildItem_SetPartNumberPtr) dlsym(hLibrary, "lib3mf_builditem_setpartnumber"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_GetName == NULL) + if (pWrapperTable->m_BuildItem_SetPartNumber == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_SetIdentifier = (PLib3MFBeamSet_SetIdentifierPtr) GetProcAddress(hLibrary, "lib3mf_beamset_setidentifier"); + pWrapperTable->m_BuildItem_GetMetaDataGroup = (PLib3MFBuildItem_GetMetaDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getmetadatagroup"); #else // _WIN32 - pWrapperTable->m_BeamSet_SetIdentifier = (PLib3MFBeamSet_SetIdentifierPtr) dlsym(hLibrary, "lib3mf_beamset_setidentifier"); + pWrapperTable->m_BuildItem_GetMetaDataGroup = (PLib3MFBuildItem_GetMetaDataGroupPtr) dlsym(hLibrary, "lib3mf_builditem_getmetadatagroup"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_SetIdentifier == NULL) + if (pWrapperTable->m_BuildItem_GetMetaDataGroup == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_GetIdentifier = (PLib3MFBeamSet_GetIdentifierPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getidentifier"); + pWrapperTable->m_BuildItem_GetOutbox = (PLib3MFBuildItem_GetOutboxPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getoutbox"); #else // _WIN32 - pWrapperTable->m_BeamSet_GetIdentifier = (PLib3MFBeamSet_GetIdentifierPtr) dlsym(hLibrary, "lib3mf_beamset_getidentifier"); + pWrapperTable->m_BuildItem_GetOutbox = (PLib3MFBuildItem_GetOutboxPtr) dlsym(hLibrary, "lib3mf_builditem_getoutbox"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_GetIdentifier == NULL) + if (pWrapperTable->m_BuildItem_GetOutbox == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_GetReferenceCount = (PLib3MFBeamSet_GetReferenceCountPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getreferencecount"); + pWrapperTable->m_BuildItemIterator_MoveNext = (PLib3MFBuildItemIterator_MoveNextPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_movenext"); #else // _WIN32 - pWrapperTable->m_BeamSet_GetReferenceCount = (PLib3MFBeamSet_GetReferenceCountPtr) dlsym(hLibrary, "lib3mf_beamset_getreferencecount"); + pWrapperTable->m_BuildItemIterator_MoveNext = (PLib3MFBuildItemIterator_MoveNextPtr) dlsym(hLibrary, "lib3mf_builditemiterator_movenext"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_GetReferenceCount == NULL) + if (pWrapperTable->m_BuildItemIterator_MoveNext == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_SetReferences = (PLib3MFBeamSet_SetReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_setreferences"); + pWrapperTable->m_BuildItemIterator_MovePrevious = (PLib3MFBuildItemIterator_MovePreviousPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_moveprevious"); #else // _WIN32 - pWrapperTable->m_BeamSet_SetReferences = (PLib3MFBeamSet_SetReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_setreferences"); + pWrapperTable->m_BuildItemIterator_MovePrevious = (PLib3MFBuildItemIterator_MovePreviousPtr) dlsym(hLibrary, "lib3mf_builditemiterator_moveprevious"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_SetReferences == NULL) + if (pWrapperTable->m_BuildItemIterator_MovePrevious == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_GetReferences = (PLib3MFBeamSet_GetReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getreferences"); + pWrapperTable->m_BuildItemIterator_GetCurrent = (PLib3MFBuildItemIterator_GetCurrentPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_getcurrent"); #else // _WIN32 - pWrapperTable->m_BeamSet_GetReferences = (PLib3MFBeamSet_GetReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_getreferences"); + pWrapperTable->m_BuildItemIterator_GetCurrent = (PLib3MFBuildItemIterator_GetCurrentPtr) dlsym(hLibrary, "lib3mf_builditemiterator_getcurrent"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_GetReferences == NULL) + if (pWrapperTable->m_BuildItemIterator_GetCurrent == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_GetBallReferenceCount = (PLib3MFBeamSet_GetBallReferenceCountPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getballreferencecount"); + pWrapperTable->m_BuildItemIterator_Clone = (PLib3MFBuildItemIterator_ClonePtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_clone"); #else // _WIN32 - pWrapperTable->m_BeamSet_GetBallReferenceCount = (PLib3MFBeamSet_GetBallReferenceCountPtr) dlsym(hLibrary, "lib3mf_beamset_getballreferencecount"); + pWrapperTable->m_BuildItemIterator_Clone = (PLib3MFBuildItemIterator_ClonePtr) dlsym(hLibrary, "lib3mf_builditemiterator_clone"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_GetBallReferenceCount == NULL) + if (pWrapperTable->m_BuildItemIterator_Clone == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_SetBallReferences = (PLib3MFBeamSet_SetBallReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_setballreferences"); + pWrapperTable->m_BuildItemIterator_Count = (PLib3MFBuildItemIterator_CountPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_count"); #else // _WIN32 - pWrapperTable->m_BeamSet_SetBallReferences = (PLib3MFBeamSet_SetBallReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_setballreferences"); + pWrapperTable->m_BuildItemIterator_Count = (PLib3MFBuildItemIterator_CountPtr) dlsym(hLibrary, "lib3mf_builditemiterator_count"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_SetBallReferences == NULL) + if (pWrapperTable->m_BuildItemIterator_Count == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BeamSet_GetBallReferences = (PLib3MFBeamSet_GetBallReferencesPtr) GetProcAddress(hLibrary, "lib3mf_beamset_getballreferences"); + pWrapperTable->m_Slice_SetVertices = (PLib3MFSlice_SetVerticesPtr) GetProcAddress(hLibrary, "lib3mf_slice_setvertices"); #else // _WIN32 - pWrapperTable->m_BeamSet_GetBallReferences = (PLib3MFBeamSet_GetBallReferencesPtr) dlsym(hLibrary, "lib3mf_beamset_getballreferences"); + pWrapperTable->m_Slice_SetVertices = (PLib3MFSlice_SetVerticesPtr) dlsym(hLibrary, "lib3mf_slice_setvertices"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BeamSet_GetBallReferences == NULL) + if (pWrapperTable->m_Slice_SetVertices == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetCount = (PLib3MFBaseMaterialGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getcount"); + pWrapperTable->m_Slice_GetVertices = (PLib3MFSlice_GetVerticesPtr) GetProcAddress(hLibrary, "lib3mf_slice_getvertices"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetCount = (PLib3MFBaseMaterialGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getcount"); + pWrapperTable->m_Slice_GetVertices = (PLib3MFSlice_GetVerticesPtr) dlsym(hLibrary, "lib3mf_slice_getvertices"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_GetCount == NULL) + if (pWrapperTable->m_Slice_GetVertices == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs = (PLib3MFBaseMaterialGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getallpropertyids"); + pWrapperTable->m_Slice_GetVertexCount = (PLib3MFSlice_GetVertexCountPtr) GetProcAddress(hLibrary, "lib3mf_slice_getvertexcount"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs = (PLib3MFBaseMaterialGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getallpropertyids"); + pWrapperTable->m_Slice_GetVertexCount = (PLib3MFSlice_GetVertexCountPtr) dlsym(hLibrary, "lib3mf_slice_getvertexcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs == NULL) + if (pWrapperTable->m_Slice_GetVertexCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_AddMaterial = (PLib3MFBaseMaterialGroup_AddMaterialPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_addmaterial"); + pWrapperTable->m_Slice_AddPolygon = (PLib3MFSlice_AddPolygonPtr) GetProcAddress(hLibrary, "lib3mf_slice_addpolygon"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_AddMaterial = (PLib3MFBaseMaterialGroup_AddMaterialPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_addmaterial"); + pWrapperTable->m_Slice_AddPolygon = (PLib3MFSlice_AddPolygonPtr) dlsym(hLibrary, "lib3mf_slice_addpolygon"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_AddMaterial == NULL) + if (pWrapperTable->m_Slice_AddPolygon == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_RemoveMaterial = (PLib3MFBaseMaterialGroup_RemoveMaterialPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_removematerial"); + pWrapperTable->m_Slice_GetPolygonCount = (PLib3MFSlice_GetPolygonCountPtr) GetProcAddress(hLibrary, "lib3mf_slice_getpolygoncount"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_RemoveMaterial = (PLib3MFBaseMaterialGroup_RemoveMaterialPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_removematerial"); + pWrapperTable->m_Slice_GetPolygonCount = (PLib3MFSlice_GetPolygonCountPtr) dlsym(hLibrary, "lib3mf_slice_getpolygoncount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_RemoveMaterial == NULL) + if (pWrapperTable->m_Slice_GetPolygonCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetName = (PLib3MFBaseMaterialGroup_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getname"); + pWrapperTable->m_Slice_SetPolygonIndices = (PLib3MFSlice_SetPolygonIndicesPtr) GetProcAddress(hLibrary, "lib3mf_slice_setpolygonindices"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetName = (PLib3MFBaseMaterialGroup_GetNamePtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getname"); + pWrapperTable->m_Slice_SetPolygonIndices = (PLib3MFSlice_SetPolygonIndicesPtr) dlsym(hLibrary, "lib3mf_slice_setpolygonindices"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_GetName == NULL) + if (pWrapperTable->m_Slice_SetPolygonIndices == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_SetName = (PLib3MFBaseMaterialGroup_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_setname"); + pWrapperTable->m_Slice_GetPolygonIndices = (PLib3MFSlice_GetPolygonIndicesPtr) GetProcAddress(hLibrary, "lib3mf_slice_getpolygonindices"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_SetName = (PLib3MFBaseMaterialGroup_SetNamePtr) dlsym(hLibrary, "lib3mf_basematerialgroup_setname"); + pWrapperTable->m_Slice_GetPolygonIndices = (PLib3MFSlice_GetPolygonIndicesPtr) dlsym(hLibrary, "lib3mf_slice_getpolygonindices"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_SetName == NULL) + if (pWrapperTable->m_Slice_GetPolygonIndices == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_SetDisplayColor = (PLib3MFBaseMaterialGroup_SetDisplayColorPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_setdisplaycolor"); + pWrapperTable->m_Slice_GetPolygonIndexCount = (PLib3MFSlice_GetPolygonIndexCountPtr) GetProcAddress(hLibrary, "lib3mf_slice_getpolygonindexcount"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_SetDisplayColor = (PLib3MFBaseMaterialGroup_SetDisplayColorPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_setdisplaycolor"); + pWrapperTable->m_Slice_GetPolygonIndexCount = (PLib3MFSlice_GetPolygonIndexCountPtr) dlsym(hLibrary, "lib3mf_slice_getpolygonindexcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_SetDisplayColor == NULL) + if (pWrapperTable->m_Slice_GetPolygonIndexCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetDisplayColor = (PLib3MFBaseMaterialGroup_GetDisplayColorPtr) GetProcAddress(hLibrary, "lib3mf_basematerialgroup_getdisplaycolor"); + pWrapperTable->m_Slice_GetZTop = (PLib3MFSlice_GetZTopPtr) GetProcAddress(hLibrary, "lib3mf_slice_getztop"); #else // _WIN32 - pWrapperTable->m_BaseMaterialGroup_GetDisplayColor = (PLib3MFBaseMaterialGroup_GetDisplayColorPtr) dlsym(hLibrary, "lib3mf_basematerialgroup_getdisplaycolor"); + pWrapperTable->m_Slice_GetZTop = (PLib3MFSlice_GetZTopPtr) dlsym(hLibrary, "lib3mf_slice_getztop"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BaseMaterialGroup_GetDisplayColor == NULL) + if (pWrapperTable->m_Slice_GetZTop == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroup_GetCount = (PLib3MFColorGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_getcount"); + pWrapperTable->m_ToolpathProfile_GetUUID = (PLib3MFToolpathProfile_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getuuid"); #else // _WIN32 - pWrapperTable->m_ColorGroup_GetCount = (PLib3MFColorGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_colorgroup_getcount"); + pWrapperTable->m_ToolpathProfile_GetUUID = (PLib3MFToolpathProfile_GetUUIDPtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroup_GetCount == NULL) + if (pWrapperTable->m_ToolpathProfile_GetUUID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroup_GetAllPropertyIDs = (PLib3MFColorGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_getallpropertyids"); + pWrapperTable->m_ToolpathProfile_GetName = (PLib3MFToolpathProfile_GetNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getname"); #else // _WIN32 - pWrapperTable->m_ColorGroup_GetAllPropertyIDs = (PLib3MFColorGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_colorgroup_getallpropertyids"); + pWrapperTable->m_ToolpathProfile_GetName = (PLib3MFToolpathProfile_GetNamePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroup_GetAllPropertyIDs == NULL) + if (pWrapperTable->m_ToolpathProfile_GetName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroup_AddColor = (PLib3MFColorGroup_AddColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_addcolor"); + pWrapperTable->m_ToolpathProfile_GetParameterCount = (PLib3MFToolpathProfile_GetParameterCountPtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparametercount"); #else // _WIN32 - pWrapperTable->m_ColorGroup_AddColor = (PLib3MFColorGroup_AddColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_addcolor"); + pWrapperTable->m_ToolpathProfile_GetParameterCount = (PLib3MFToolpathProfile_GetParameterCountPtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparametercount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroup_AddColor == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroup_RemoveColor = (PLib3MFColorGroup_RemoveColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_removecolor"); + pWrapperTable->m_ToolpathProfile_GetParameterName = (PLib3MFToolpathProfile_GetParameterNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparametername"); #else // _WIN32 - pWrapperTable->m_ColorGroup_RemoveColor = (PLib3MFColorGroup_RemoveColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_removecolor"); + pWrapperTable->m_ToolpathProfile_GetParameterName = (PLib3MFToolpathProfile_GetParameterNamePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparametername"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroup_RemoveColor == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroup_SetColor = (PLib3MFColorGroup_SetColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_setcolor"); + pWrapperTable->m_ToolpathProfile_GetParameterNameSpace = (PLib3MFToolpathProfile_GetParameterNameSpacePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameternamespace"); #else // _WIN32 - pWrapperTable->m_ColorGroup_SetColor = (PLib3MFColorGroup_SetColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_setcolor"); + pWrapperTable->m_ToolpathProfile_GetParameterNameSpace = (PLib3MFToolpathProfile_GetParameterNameSpacePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameternamespace"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroup_SetColor == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterNameSpace == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_ColorGroup_GetColor = (PLib3MFColorGroup_GetColorPtr) GetProcAddress(hLibrary, "lib3mf_colorgroup_getcolor"); + pWrapperTable->m_ToolpathProfile_HasParameterValue = (PLib3MFToolpathProfile_HasParameterValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_hasparametervalue"); #else // _WIN32 - pWrapperTable->m_ColorGroup_GetColor = (PLib3MFColorGroup_GetColorPtr) dlsym(hLibrary, "lib3mf_colorgroup_getcolor"); + pWrapperTable->m_ToolpathProfile_HasParameterValue = (PLib3MFToolpathProfile_HasParameterValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_hasparametervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_ColorGroup_GetColor == NULL) + if (pWrapperTable->m_ToolpathProfile_HasParameterValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroup_GetCount = (PLib3MFTexture2DGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_getcount"); + pWrapperTable->m_ToolpathProfile_GetParameterValue = (PLib3MFToolpathProfile_GetParameterValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparametervalue"); #else // _WIN32 - pWrapperTable->m_Texture2DGroup_GetCount = (PLib3MFTexture2DGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_getcount"); + pWrapperTable->m_ToolpathProfile_GetParameterValue = (PLib3MFToolpathProfile_GetParameterValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparametervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroup_GetCount == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs = (PLib3MFTexture2DGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_getallpropertyids"); + pWrapperTable->m_ToolpathProfile_GetParameterValueDef = (PLib3MFToolpathProfile_GetParameterValueDefPtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparametervaluedef"); #else // _WIN32 - pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs = (PLib3MFTexture2DGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_getallpropertyids"); + pWrapperTable->m_ToolpathProfile_GetParameterValueDef = (PLib3MFToolpathProfile_GetParameterValueDefPtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparametervaluedef"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroup_GetAllPropertyIDs == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterValueDef == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroup_AddTex2Coord = (PLib3MFTexture2DGroup_AddTex2CoordPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_addtex2coord"); + pWrapperTable->m_ToolpathProfile_GetParameterDoubleValue = (PLib3MFToolpathProfile_GetParameterDoubleValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameterdoublevalue"); #else // _WIN32 - pWrapperTable->m_Texture2DGroup_AddTex2Coord = (PLib3MFTexture2DGroup_AddTex2CoordPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_addtex2coord"); + pWrapperTable->m_ToolpathProfile_GetParameterDoubleValue = (PLib3MFToolpathProfile_GetParameterDoubleValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameterdoublevalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroup_AddTex2Coord == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterDoubleValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroup_GetTex2Coord = (PLib3MFTexture2DGroup_GetTex2CoordPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_gettex2coord"); + pWrapperTable->m_ToolpathProfile_GetParameterDoubleValueDef = (PLib3MFToolpathProfile_GetParameterDoubleValueDefPtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameterdoublevaluedef"); #else // _WIN32 - pWrapperTable->m_Texture2DGroup_GetTex2Coord = (PLib3MFTexture2DGroup_GetTex2CoordPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_gettex2coord"); + pWrapperTable->m_ToolpathProfile_GetParameterDoubleValueDef = (PLib3MFToolpathProfile_GetParameterDoubleValueDefPtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameterdoublevaluedef"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroup_GetTex2Coord == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterDoubleValueDef == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroup_RemoveTex2Coord = (PLib3MFTexture2DGroup_RemoveTex2CoordPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_removetex2coord"); + pWrapperTable->m_ToolpathProfile_GetParameterIntegerValue = (PLib3MFToolpathProfile_GetParameterIntegerValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameterintegervalue"); #else // _WIN32 - pWrapperTable->m_Texture2DGroup_RemoveTex2Coord = (PLib3MFTexture2DGroup_RemoveTex2CoordPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_removetex2coord"); + pWrapperTable->m_ToolpathProfile_GetParameterIntegerValue = (PLib3MFToolpathProfile_GetParameterIntegerValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameterintegervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroup_RemoveTex2Coord == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterIntegerValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2DGroup_GetTexture2D = (PLib3MFTexture2DGroup_GetTexture2DPtr) GetProcAddress(hLibrary, "lib3mf_texture2dgroup_gettexture2d"); + pWrapperTable->m_ToolpathProfile_GetParameterIntegerValueDef = (PLib3MFToolpathProfile_GetParameterIntegerValueDefPtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameterintegervaluedef"); #else // _WIN32 - pWrapperTable->m_Texture2DGroup_GetTexture2D = (PLib3MFTexture2DGroup_GetTexture2DPtr) dlsym(hLibrary, "lib3mf_texture2dgroup_gettexture2d"); + pWrapperTable->m_ToolpathProfile_GetParameterIntegerValueDef = (PLib3MFToolpathProfile_GetParameterIntegerValueDefPtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameterintegervaluedef"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2DGroup_GetTexture2D == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterIntegerValueDef == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterials_GetCount = (PLib3MFCompositeMaterials_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getcount"); + pWrapperTable->m_ToolpathProfile_GetParameterBoolValue = (PLib3MFToolpathProfile_GetParameterBoolValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameterboolvalue"); #else // _WIN32 - pWrapperTable->m_CompositeMaterials_GetCount = (PLib3MFCompositeMaterials_GetCountPtr) dlsym(hLibrary, "lib3mf_compositematerials_getcount"); + pWrapperTable->m_ToolpathProfile_GetParameterBoolValue = (PLib3MFToolpathProfile_GetParameterBoolValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameterboolvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterials_GetCount == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterBoolValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs = (PLib3MFCompositeMaterials_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getallpropertyids"); + pWrapperTable->m_ToolpathProfile_GetParameterBoolValueDef = (PLib3MFToolpathProfile_GetParameterBoolValueDefPtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_getparameterboolvaluedef"); #else // _WIN32 - pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs = (PLib3MFCompositeMaterials_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_compositematerials_getallpropertyids"); + pWrapperTable->m_ToolpathProfile_GetParameterBoolValueDef = (PLib3MFToolpathProfile_GetParameterBoolValueDefPtr) dlsym(hLibrary, "lib3mf_toolpathprofile_getparameterboolvaluedef"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterials_GetAllPropertyIDs == NULL) + if (pWrapperTable->m_ToolpathProfile_GetParameterBoolValueDef == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup = (PLib3MFCompositeMaterials_GetBaseMaterialGroupPtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getbasematerialgroup"); + pWrapperTable->m_ToolpathProfile_SetName = (PLib3MFToolpathProfile_SetNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_setname"); #else // _WIN32 - pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup = (PLib3MFCompositeMaterials_GetBaseMaterialGroupPtr) dlsym(hLibrary, "lib3mf_compositematerials_getbasematerialgroup"); + pWrapperTable->m_ToolpathProfile_SetName = (PLib3MFToolpathProfile_SetNamePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_setname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterials_GetBaseMaterialGroup == NULL) + if (pWrapperTable->m_ToolpathProfile_SetName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterials_AddComposite = (PLib3MFCompositeMaterials_AddCompositePtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_addcomposite"); + pWrapperTable->m_ToolpathProfile_SetParameterValue = (PLib3MFToolpathProfile_SetParameterValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_setparametervalue"); #else // _WIN32 - pWrapperTable->m_CompositeMaterials_AddComposite = (PLib3MFCompositeMaterials_AddCompositePtr) dlsym(hLibrary, "lib3mf_compositematerials_addcomposite"); + pWrapperTable->m_ToolpathProfile_SetParameterValue = (PLib3MFToolpathProfile_SetParameterValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_setparametervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterials_AddComposite == NULL) + if (pWrapperTable->m_ToolpathProfile_SetParameterValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterials_RemoveComposite = (PLib3MFCompositeMaterials_RemoveCompositePtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_removecomposite"); + pWrapperTable->m_ToolpathProfile_SetParameterDoubleValue = (PLib3MFToolpathProfile_SetParameterDoubleValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_setparameterdoublevalue"); #else // _WIN32 - pWrapperTable->m_CompositeMaterials_RemoveComposite = (PLib3MFCompositeMaterials_RemoveCompositePtr) dlsym(hLibrary, "lib3mf_compositematerials_removecomposite"); + pWrapperTable->m_ToolpathProfile_SetParameterDoubleValue = (PLib3MFToolpathProfile_SetParameterDoubleValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_setparameterdoublevalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterials_RemoveComposite == NULL) + if (pWrapperTable->m_ToolpathProfile_SetParameterDoubleValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_CompositeMaterials_GetComposite = (PLib3MFCompositeMaterials_GetCompositePtr) GetProcAddress(hLibrary, "lib3mf_compositematerials_getcomposite"); + pWrapperTable->m_ToolpathProfile_SetParameterIntegerValue = (PLib3MFToolpathProfile_SetParameterIntegerValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_setparameterintegervalue"); #else // _WIN32 - pWrapperTable->m_CompositeMaterials_GetComposite = (PLib3MFCompositeMaterials_GetCompositePtr) dlsym(hLibrary, "lib3mf_compositematerials_getcomposite"); + pWrapperTable->m_ToolpathProfile_SetParameterIntegerValue = (PLib3MFToolpathProfile_SetParameterIntegerValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_setparameterintegervalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_CompositeMaterials_GetComposite == NULL) + if (pWrapperTable->m_ToolpathProfile_SetParameterIntegerValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetCount = (PLib3MFMultiPropertyGroup_GetCountPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getcount"); + pWrapperTable->m_ToolpathProfile_SetParameterBoolValue = (PLib3MFToolpathProfile_SetParameterBoolValuePtr) GetProcAddress(hLibrary, "lib3mf_toolpathprofile_setparameterboolvalue"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetCount = (PLib3MFMultiPropertyGroup_GetCountPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getcount"); + pWrapperTable->m_ToolpathProfile_SetParameterBoolValue = (PLib3MFToolpathProfile_SetParameterBoolValuePtr) dlsym(hLibrary, "lib3mf_toolpathprofile_setparameterboolvalue"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_GetCount == NULL) + if (pWrapperTable->m_ToolpathProfile_SetParameterBoolValue == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs = (PLib3MFMultiPropertyGroup_GetAllPropertyIDsPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getallpropertyids"); + pWrapperTable->m_ToolpathLayerReader_GetLayerDataUUID = (PLib3MFToolpathLayerReader_GetLayerDataUUIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getlayerdatauuid"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs = (PLib3MFMultiPropertyGroup_GetAllPropertyIDsPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getallpropertyids"); + pWrapperTable->m_ToolpathLayerReader_GetLayerDataUUID = (PLib3MFToolpathLayerReader_GetLayerDataUUIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getlayerdatauuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetLayerDataUUID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_AddMultiProperty = (PLib3MFMultiPropertyGroup_AddMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_addmultiproperty"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentCount = (PLib3MFToolpathLayerReader_GetSegmentCountPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentcount"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_AddMultiProperty = (PLib3MFMultiPropertyGroup_AddMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_addmultiproperty"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentCount = (PLib3MFToolpathLayerReader_GetSegmentCountPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentcount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_AddMultiProperty == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_SetMultiProperty = (PLib3MFMultiPropertyGroup_SetMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_setmultiproperty"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentInfo = (PLib3MFToolpathLayerReader_GetSegmentInfoPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentinfo"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_SetMultiProperty = (PLib3MFMultiPropertyGroup_SetMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_setmultiproperty"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentInfo = (PLib3MFToolpathLayerReader_GetSegmentInfoPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentinfo"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_SetMultiProperty == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentInfo == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetMultiProperty = (PLib3MFMultiPropertyGroup_GetMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getmultiproperty"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentProfile = (PLib3MFToolpathLayerReader_GetSegmentProfilePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentprofile"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetMultiProperty = (PLib3MFMultiPropertyGroup_GetMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getmultiproperty"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentProfile = (PLib3MFToolpathLayerReader_GetSegmentProfilePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentprofile"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_GetMultiProperty == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentProfile == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty = (PLib3MFMultiPropertyGroup_RemoveMultiPropertyPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_removemultiproperty"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentProfileUUID = (PLib3MFToolpathLayerReader_GetSegmentProfileUUIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentprofileuuid"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty = (PLib3MFMultiPropertyGroup_RemoveMultiPropertyPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_removemultiproperty"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentProfileUUID = (PLib3MFToolpathLayerReader_GetSegmentProfileUUIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentprofileuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_RemoveMultiProperty == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentProfileUUID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetLayerCount = (PLib3MFMultiPropertyGroup_GetLayerCountPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getlayercount"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentPart = (PLib3MFToolpathLayerReader_GetSegmentPartPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpart"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetLayerCount = (PLib3MFMultiPropertyGroup_GetLayerCountPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getlayercount"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentPart = (PLib3MFToolpathLayerReader_GetSegmentPartPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpart"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_GetLayerCount == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentPart == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_AddLayer = (PLib3MFMultiPropertyGroup_AddLayerPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_addlayer"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentPartUUID = (PLib3MFToolpathLayerReader_GetSegmentPartUUIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpartuuid"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_AddLayer = (PLib3MFMultiPropertyGroup_AddLayerPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_addlayer"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentPartUUID = (PLib3MFToolpathLayerReader_GetSegmentPartUUIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpartuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_AddLayer == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentPartUUID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetLayer = (PLib3MFMultiPropertyGroup_GetLayerPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_getlayer"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentLocalPartID = (PLib3MFToolpathLayerReader_GetSegmentLocalPartIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentlocalpartid"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_GetLayer = (PLib3MFMultiPropertyGroup_GetLayerPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_getlayer"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentLocalPartID = (PLib3MFToolpathLayerReader_GetSegmentLocalPartIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentlocalpartid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_GetLayer == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentLocalPartID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MultiPropertyGroup_RemoveLayer = (PLib3MFMultiPropertyGroup_RemoveLayerPtr) GetProcAddress(hLibrary, "lib3mf_multipropertygroup_removelayer"); + pWrapperTable->m_ToolpathLayerReader_GetPartUUIDByLocalPartID = (PLib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getpartuuidbylocalpartid"); #else // _WIN32 - pWrapperTable->m_MultiPropertyGroup_RemoveLayer = (PLib3MFMultiPropertyGroup_RemoveLayerPtr) dlsym(hLibrary, "lib3mf_multipropertygroup_removelayer"); + pWrapperTable->m_ToolpathLayerReader_GetPartUUIDByLocalPartID = (PLib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getpartuuidbylocalpartid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MultiPropertyGroup_RemoveLayer == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetPartUUIDByLocalPartID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_GetPath = (PLib3MFAttachment_GetPathPtr) GetProcAddress(hLibrary, "lib3mf_attachment_getpath"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentPointData = (PLib3MFToolpathLayerReader_GetSegmentPointDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpointdata"); #else // _WIN32 - pWrapperTable->m_Attachment_GetPath = (PLib3MFAttachment_GetPathPtr) dlsym(hLibrary, "lib3mf_attachment_getpath"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentPointData = (PLib3MFToolpathLayerReader_GetSegmentPointDataPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentpointdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_GetPath == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentPointData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_SetPath = (PLib3MFAttachment_SetPathPtr) GetProcAddress(hLibrary, "lib3mf_attachment_setpath"); + pWrapperTable->m_ToolpathLayerReader_FindAttributeInfoByName = (PLib3MFToolpathLayerReader_FindAttributeInfoByNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_findattributeinfobyname"); #else // _WIN32 - pWrapperTable->m_Attachment_SetPath = (PLib3MFAttachment_SetPathPtr) dlsym(hLibrary, "lib3mf_attachment_setpath"); + pWrapperTable->m_ToolpathLayerReader_FindAttributeInfoByName = (PLib3MFToolpathLayerReader_FindAttributeInfoByNamePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_findattributeinfobyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_SetPath == NULL) + if (pWrapperTable->m_ToolpathLayerReader_FindAttributeInfoByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_PackagePart = (PLib3MFAttachment_PackagePartPtr) GetProcAddress(hLibrary, "lib3mf_attachment_packagepart"); + pWrapperTable->m_ToolpathLayerReader_FindAttributeIDByName = (PLib3MFToolpathLayerReader_FindAttributeIDByNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_findattributeidbyname"); #else // _WIN32 - pWrapperTable->m_Attachment_PackagePart = (PLib3MFAttachment_PackagePartPtr) dlsym(hLibrary, "lib3mf_attachment_packagepart"); + pWrapperTable->m_ToolpathLayerReader_FindAttributeIDByName = (PLib3MFToolpathLayerReader_FindAttributeIDByNamePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_findattributeidbyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_PackagePart == NULL) + if (pWrapperTable->m_ToolpathLayerReader_FindAttributeIDByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_GetRelationShipType = (PLib3MFAttachment_GetRelationShipTypePtr) GetProcAddress(hLibrary, "lib3mf_attachment_getrelationshiptype"); + pWrapperTable->m_ToolpathLayerReader_FindAttributeValueByName = (PLib3MFToolpathLayerReader_FindAttributeValueByNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_findattributevaluebyname"); #else // _WIN32 - pWrapperTable->m_Attachment_GetRelationShipType = (PLib3MFAttachment_GetRelationShipTypePtr) dlsym(hLibrary, "lib3mf_attachment_getrelationshiptype"); + pWrapperTable->m_ToolpathLayerReader_FindAttributeValueByName = (PLib3MFToolpathLayerReader_FindAttributeValueByNamePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_findattributevaluebyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_GetRelationShipType == NULL) + if (pWrapperTable->m_ToolpathLayerReader_FindAttributeValueByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_SetRelationShipType = (PLib3MFAttachment_SetRelationShipTypePtr) GetProcAddress(hLibrary, "lib3mf_attachment_setrelationshiptype"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByID = (PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentintegerattributebyid"); #else // _WIN32 - pWrapperTable->m_Attachment_SetRelationShipType = (PLib3MFAttachment_SetRelationShipTypePtr) dlsym(hLibrary, "lib3mf_attachment_setrelationshiptype"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByID = (PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentintegerattributebyid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_SetRelationShipType == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_WriteToFile = (PLib3MFAttachment_WriteToFilePtr) GetProcAddress(hLibrary, "lib3mf_attachment_writetofile"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByName = (PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentintegerattributebyname"); #else // _WIN32 - pWrapperTable->m_Attachment_WriteToFile = (PLib3MFAttachment_WriteToFilePtr) dlsym(hLibrary, "lib3mf_attachment_writetofile"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByName = (PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByNamePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentintegerattributebyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_WriteToFile == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_ReadFromFile = (PLib3MFAttachment_ReadFromFilePtr) GetProcAddress(hLibrary, "lib3mf_attachment_readfromfile"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByID = (PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid"); #else // _WIN32 - pWrapperTable->m_Attachment_ReadFromFile = (PLib3MFAttachment_ReadFromFilePtr) dlsym(hLibrary, "lib3mf_attachment_readfromfile"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByID = (PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_ReadFromFile == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_ReadFromCallback = (PLib3MFAttachment_ReadFromCallbackPtr) GetProcAddress(hLibrary, "lib3mf_attachment_readfromcallback"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByName = (PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname"); #else // _WIN32 - pWrapperTable->m_Attachment_ReadFromCallback = (PLib3MFAttachment_ReadFromCallbackPtr) dlsym(hLibrary, "lib3mf_attachment_readfromcallback"); + pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByName = (PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByNamePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_ReadFromCallback == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_GetStreamSize = (PLib3MFAttachment_GetStreamSizePtr) GetProcAddress(hLibrary, "lib3mf_attachment_getstreamsize"); + pWrapperTable->m_ToolpathLayerReader_GetCustomDataCount = (PLib3MFToolpathLayerReader_GetCustomDataCountPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getcustomdatacount"); #else // _WIN32 - pWrapperTable->m_Attachment_GetStreamSize = (PLib3MFAttachment_GetStreamSizePtr) dlsym(hLibrary, "lib3mf_attachment_getstreamsize"); + pWrapperTable->m_ToolpathLayerReader_GetCustomDataCount = (PLib3MFToolpathLayerReader_GetCustomDataCountPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getcustomdatacount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_GetStreamSize == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetCustomDataCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_WriteToBuffer = (PLib3MFAttachment_WriteToBufferPtr) GetProcAddress(hLibrary, "lib3mf_attachment_writetobuffer"); + pWrapperTable->m_ToolpathLayerReader_GetCustomData = (PLib3MFToolpathLayerReader_GetCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getcustomdata"); #else // _WIN32 - pWrapperTable->m_Attachment_WriteToBuffer = (PLib3MFAttachment_WriteToBufferPtr) dlsym(hLibrary, "lib3mf_attachment_writetobuffer"); + pWrapperTable->m_ToolpathLayerReader_GetCustomData = (PLib3MFToolpathLayerReader_GetCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getcustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_WriteToBuffer == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetCustomData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Attachment_ReadFromBuffer = (PLib3MFAttachment_ReadFromBufferPtr) GetProcAddress(hLibrary, "lib3mf_attachment_readfrombuffer"); + pWrapperTable->m_ToolpathLayerReader_GetCustomDataName = (PLib3MFToolpathLayerReader_GetCustomDataNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerreader_getcustomdataname"); #else // _WIN32 - pWrapperTable->m_Attachment_ReadFromBuffer = (PLib3MFAttachment_ReadFromBufferPtr) dlsym(hLibrary, "lib3mf_attachment_readfrombuffer"); + pWrapperTable->m_ToolpathLayerReader_GetCustomDataName = (PLib3MFToolpathLayerReader_GetCustomDataNamePtr) dlsym(hLibrary, "lib3mf_toolpathlayerreader_getcustomdataname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Attachment_ReadFromBuffer == NULL) + if (pWrapperTable->m_ToolpathLayerReader_GetCustomDataName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_GetAttachment = (PLib3MFTexture2D_GetAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_getattachment"); + pWrapperTable->m_ToolpathLayerData_GetLayerDataUUID = (PLib3MFToolpathLayerData_GetLayerDataUUIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_getlayerdatauuid"); #else // _WIN32 - pWrapperTable->m_Texture2D_GetAttachment = (PLib3MFTexture2D_GetAttachmentPtr) dlsym(hLibrary, "lib3mf_texture2d_getattachment"); + pWrapperTable->m_ToolpathLayerData_GetLayerDataUUID = (PLib3MFToolpathLayerData_GetLayerDataUUIDPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_getlayerdatauuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_GetAttachment == NULL) + if (pWrapperTable->m_ToolpathLayerData_GetLayerDataUUID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_SetAttachment = (PLib3MFTexture2D_SetAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_setattachment"); + pWrapperTable->m_ToolpathLayerData_RegisterProfile = (PLib3MFToolpathLayerData_RegisterProfilePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_registerprofile"); #else // _WIN32 - pWrapperTable->m_Texture2D_SetAttachment = (PLib3MFTexture2D_SetAttachmentPtr) dlsym(hLibrary, "lib3mf_texture2d_setattachment"); + pWrapperTable->m_ToolpathLayerData_RegisterProfile = (PLib3MFToolpathLayerData_RegisterProfilePtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_registerprofile"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_SetAttachment == NULL) + if (pWrapperTable->m_ToolpathLayerData_RegisterProfile == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_GetContentType = (PLib3MFTexture2D_GetContentTypePtr) GetProcAddress(hLibrary, "lib3mf_texture2d_getcontenttype"); + pWrapperTable->m_ToolpathLayerData_RegisterBuildItem = (PLib3MFToolpathLayerData_RegisterBuildItemPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_registerbuilditem"); #else // _WIN32 - pWrapperTable->m_Texture2D_GetContentType = (PLib3MFTexture2D_GetContentTypePtr) dlsym(hLibrary, "lib3mf_texture2d_getcontenttype"); + pWrapperTable->m_ToolpathLayerData_RegisterBuildItem = (PLib3MFToolpathLayerData_RegisterBuildItemPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_registerbuilditem"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_GetContentType == NULL) + if (pWrapperTable->m_ToolpathLayerData_RegisterBuildItem == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_SetContentType = (PLib3MFTexture2D_SetContentTypePtr) GetProcAddress(hLibrary, "lib3mf_texture2d_setcontenttype"); + pWrapperTable->m_ToolpathLayerData_SetSegmentAttribute = (PLib3MFToolpathLayerData_SetSegmentAttributePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_setsegmentattribute"); #else // _WIN32 - pWrapperTable->m_Texture2D_SetContentType = (PLib3MFTexture2D_SetContentTypePtr) dlsym(hLibrary, "lib3mf_texture2d_setcontenttype"); + pWrapperTable->m_ToolpathLayerData_SetSegmentAttribute = (PLib3MFToolpathLayerData_SetSegmentAttributePtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_setsegmentattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_SetContentType == NULL) + if (pWrapperTable->m_ToolpathLayerData_SetSegmentAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_GetTileStyleUV = (PLib3MFTexture2D_GetTileStyleUVPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_gettilestyleuv"); + pWrapperTable->m_ToolpathLayerData_ClearSegmentAttributes = (PLib3MFToolpathLayerData_ClearSegmentAttributesPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_clearsegmentattributes"); #else // _WIN32 - pWrapperTable->m_Texture2D_GetTileStyleUV = (PLib3MFTexture2D_GetTileStyleUVPtr) dlsym(hLibrary, "lib3mf_texture2d_gettilestyleuv"); + pWrapperTable->m_ToolpathLayerData_ClearSegmentAttributes = (PLib3MFToolpathLayerData_ClearSegmentAttributesPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_clearsegmentattributes"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_GetTileStyleUV == NULL) + if (pWrapperTable->m_ToolpathLayerData_ClearSegmentAttributes == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_SetTileStyleUV = (PLib3MFTexture2D_SetTileStyleUVPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_settilestyleuv"); + pWrapperTable->m_ToolpathLayerData_WriteHatchData = (PLib3MFToolpathLayerData_WriteHatchDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_writehatchdata"); #else // _WIN32 - pWrapperTable->m_Texture2D_SetTileStyleUV = (PLib3MFTexture2D_SetTileStyleUVPtr) dlsym(hLibrary, "lib3mf_texture2d_settilestyleuv"); + pWrapperTable->m_ToolpathLayerData_WriteHatchData = (PLib3MFToolpathLayerData_WriteHatchDataPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_writehatchdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_SetTileStyleUV == NULL) + if (pWrapperTable->m_ToolpathLayerData_WriteHatchData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_GetFilter = (PLib3MFTexture2D_GetFilterPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_getfilter"); + pWrapperTable->m_ToolpathLayerData_WriteLoop = (PLib3MFToolpathLayerData_WriteLoopPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_writeloop"); #else // _WIN32 - pWrapperTable->m_Texture2D_GetFilter = (PLib3MFTexture2D_GetFilterPtr) dlsym(hLibrary, "lib3mf_texture2d_getfilter"); + pWrapperTable->m_ToolpathLayerData_WriteLoop = (PLib3MFToolpathLayerData_WriteLoopPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_writeloop"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_GetFilter == NULL) + if (pWrapperTable->m_ToolpathLayerData_WriteLoop == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Texture2D_SetFilter = (PLib3MFTexture2D_SetFilterPtr) GetProcAddress(hLibrary, "lib3mf_texture2d_setfilter"); + pWrapperTable->m_ToolpathLayerData_WritePolyline = (PLib3MFToolpathLayerData_WritePolylinePtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_writepolyline"); #else // _WIN32 - pWrapperTable->m_Texture2D_SetFilter = (PLib3MFTexture2D_SetFilterPtr) dlsym(hLibrary, "lib3mf_texture2d_setfilter"); + pWrapperTable->m_ToolpathLayerData_WritePolyline = (PLib3MFToolpathLayerData_WritePolylinePtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_writepolyline"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Texture2D_SetFilter == NULL) + if (pWrapperTable->m_ToolpathLayerData_WritePolyline == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetObjectResource = (PLib3MFBuildItem_GetObjectResourcePtr) GetProcAddress(hLibrary, "lib3mf_builditem_getobjectresource"); + pWrapperTable->m_ToolpathLayerData_AddCustomData = (PLib3MFToolpathLayerData_AddCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_addcustomdata"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetObjectResource = (PLib3MFBuildItem_GetObjectResourcePtr) dlsym(hLibrary, "lib3mf_builditem_getobjectresource"); + pWrapperTable->m_ToolpathLayerData_AddCustomData = (PLib3MFToolpathLayerData_AddCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_addcustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetObjectResource == NULL) + if (pWrapperTable->m_ToolpathLayerData_AddCustomData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetUUID = (PLib3MFBuildItem_GetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getuuid"); + pWrapperTable->m_ToolpathLayerData_Finish = (PLib3MFToolpathLayerData_FinishPtr) GetProcAddress(hLibrary, "lib3mf_toolpathlayerdata_finish"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetUUID = (PLib3MFBuildItem_GetUUIDPtr) dlsym(hLibrary, "lib3mf_builditem_getuuid"); + pWrapperTable->m_ToolpathLayerData_Finish = (PLib3MFToolpathLayerData_FinishPtr) dlsym(hLibrary, "lib3mf_toolpathlayerdata_finish"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetUUID == NULL) + if (pWrapperTable->m_ToolpathLayerData_Finish == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_SetUUID = (PLib3MFBuildItem_SetUUIDPtr) GetProcAddress(hLibrary, "lib3mf_builditem_setuuid"); + pWrapperTable->m_Toolpath_GetUnits = (PLib3MFToolpath_GetUnitsPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getunits"); #else // _WIN32 - pWrapperTable->m_BuildItem_SetUUID = (PLib3MFBuildItem_SetUUIDPtr) dlsym(hLibrary, "lib3mf_builditem_setuuid"); + pWrapperTable->m_Toolpath_GetUnits = (PLib3MFToolpath_GetUnitsPtr) dlsym(hLibrary, "lib3mf_toolpath_getunits"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_SetUUID == NULL) + if (pWrapperTable->m_Toolpath_GetUnits == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetObjectResourceID = (PLib3MFBuildItem_GetObjectResourceIDPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getobjectresourceid"); + pWrapperTable->m_Toolpath_GetLayerCount = (PLib3MFToolpath_GetLayerCountPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getlayercount"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetObjectResourceID = (PLib3MFBuildItem_GetObjectResourceIDPtr) dlsym(hLibrary, "lib3mf_builditem_getobjectresourceid"); + pWrapperTable->m_Toolpath_GetLayerCount = (PLib3MFToolpath_GetLayerCountPtr) dlsym(hLibrary, "lib3mf_toolpath_getlayercount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetObjectResourceID == NULL) + if (pWrapperTable->m_Toolpath_GetLayerCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_HasObjectTransform = (PLib3MFBuildItem_HasObjectTransformPtr) GetProcAddress(hLibrary, "lib3mf_builditem_hasobjecttransform"); + pWrapperTable->m_Toolpath_GetProfileCount = (PLib3MFToolpath_GetProfileCountPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getprofilecount"); #else // _WIN32 - pWrapperTable->m_BuildItem_HasObjectTransform = (PLib3MFBuildItem_HasObjectTransformPtr) dlsym(hLibrary, "lib3mf_builditem_hasobjecttransform"); + pWrapperTable->m_Toolpath_GetProfileCount = (PLib3MFToolpath_GetProfileCountPtr) dlsym(hLibrary, "lib3mf_toolpath_getprofilecount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_HasObjectTransform == NULL) + if (pWrapperTable->m_Toolpath_GetProfileCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetObjectTransform = (PLib3MFBuildItem_GetObjectTransformPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getobjecttransform"); + pWrapperTable->m_Toolpath_AddLayer = (PLib3MFToolpath_AddLayerPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_addlayer"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetObjectTransform = (PLib3MFBuildItem_GetObjectTransformPtr) dlsym(hLibrary, "lib3mf_builditem_getobjecttransform"); + pWrapperTable->m_Toolpath_AddLayer = (PLib3MFToolpath_AddLayerPtr) dlsym(hLibrary, "lib3mf_toolpath_addlayer"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetObjectTransform == NULL) + if (pWrapperTable->m_Toolpath_AddLayer == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_SetObjectTransform = (PLib3MFBuildItem_SetObjectTransformPtr) GetProcAddress(hLibrary, "lib3mf_builditem_setobjecttransform"); + pWrapperTable->m_Toolpath_GetLayerAttachment = (PLib3MFToolpath_GetLayerAttachmentPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getlayerattachment"); #else // _WIN32 - pWrapperTable->m_BuildItem_SetObjectTransform = (PLib3MFBuildItem_SetObjectTransformPtr) dlsym(hLibrary, "lib3mf_builditem_setobjecttransform"); + pWrapperTable->m_Toolpath_GetLayerAttachment = (PLib3MFToolpath_GetLayerAttachmentPtr) dlsym(hLibrary, "lib3mf_toolpath_getlayerattachment"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_SetObjectTransform == NULL) + if (pWrapperTable->m_Toolpath_GetLayerAttachment == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetPartNumber = (PLib3MFBuildItem_GetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getpartnumber"); + pWrapperTable->m_Toolpath_ReadLayerData = (PLib3MFToolpath_ReadLayerDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_readlayerdata"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetPartNumber = (PLib3MFBuildItem_GetPartNumberPtr) dlsym(hLibrary, "lib3mf_builditem_getpartnumber"); + pWrapperTable->m_Toolpath_ReadLayerData = (PLib3MFToolpath_ReadLayerDataPtr) dlsym(hLibrary, "lib3mf_toolpath_readlayerdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetPartNumber == NULL) + if (pWrapperTable->m_Toolpath_ReadLayerData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_SetPartNumber = (PLib3MFBuildItem_SetPartNumberPtr) GetProcAddress(hLibrary, "lib3mf_builditem_setpartnumber"); + pWrapperTable->m_Toolpath_GetLayerPath = (PLib3MFToolpath_GetLayerPathPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getlayerpath"); #else // _WIN32 - pWrapperTable->m_BuildItem_SetPartNumber = (PLib3MFBuildItem_SetPartNumberPtr) dlsym(hLibrary, "lib3mf_builditem_setpartnumber"); + pWrapperTable->m_Toolpath_GetLayerPath = (PLib3MFToolpath_GetLayerPathPtr) dlsym(hLibrary, "lib3mf_toolpath_getlayerpath"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_SetPartNumber == NULL) + if (pWrapperTable->m_Toolpath_GetLayerPath == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetMetaDataGroup = (PLib3MFBuildItem_GetMetaDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getmetadatagroup"); + pWrapperTable->m_Toolpath_GetLayerZMax = (PLib3MFToolpath_GetLayerZMaxPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getlayerzmax"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetMetaDataGroup = (PLib3MFBuildItem_GetMetaDataGroupPtr) dlsym(hLibrary, "lib3mf_builditem_getmetadatagroup"); + pWrapperTable->m_Toolpath_GetLayerZMax = (PLib3MFToolpath_GetLayerZMaxPtr) dlsym(hLibrary, "lib3mf_toolpath_getlayerzmax"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetMetaDataGroup == NULL) + if (pWrapperTable->m_Toolpath_GetLayerZMax == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItem_GetOutbox = (PLib3MFBuildItem_GetOutboxPtr) GetProcAddress(hLibrary, "lib3mf_builditem_getoutbox"); + pWrapperTable->m_Toolpath_GetLayerZ = (PLib3MFToolpath_GetLayerZPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getlayerz"); #else // _WIN32 - pWrapperTable->m_BuildItem_GetOutbox = (PLib3MFBuildItem_GetOutboxPtr) dlsym(hLibrary, "lib3mf_builditem_getoutbox"); + pWrapperTable->m_Toolpath_GetLayerZ = (PLib3MFToolpath_GetLayerZPtr) dlsym(hLibrary, "lib3mf_toolpath_getlayerz"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItem_GetOutbox == NULL) + if (pWrapperTable->m_Toolpath_GetLayerZ == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItemIterator_MoveNext = (PLib3MFBuildItemIterator_MoveNextPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_movenext"); + pWrapperTable->m_Toolpath_AddProfile = (PLib3MFToolpath_AddProfilePtr) GetProcAddress(hLibrary, "lib3mf_toolpath_addprofile"); #else // _WIN32 - pWrapperTable->m_BuildItemIterator_MoveNext = (PLib3MFBuildItemIterator_MoveNextPtr) dlsym(hLibrary, "lib3mf_builditemiterator_movenext"); + pWrapperTable->m_Toolpath_AddProfile = (PLib3MFToolpath_AddProfilePtr) dlsym(hLibrary, "lib3mf_toolpath_addprofile"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItemIterator_MoveNext == NULL) + if (pWrapperTable->m_Toolpath_AddProfile == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItemIterator_MovePrevious = (PLib3MFBuildItemIterator_MovePreviousPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_moveprevious"); + pWrapperTable->m_Toolpath_GetProfile = (PLib3MFToolpath_GetProfilePtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getprofile"); #else // _WIN32 - pWrapperTable->m_BuildItemIterator_MovePrevious = (PLib3MFBuildItemIterator_MovePreviousPtr) dlsym(hLibrary, "lib3mf_builditemiterator_moveprevious"); + pWrapperTable->m_Toolpath_GetProfile = (PLib3MFToolpath_GetProfilePtr) dlsym(hLibrary, "lib3mf_toolpath_getprofile"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItemIterator_MovePrevious == NULL) + if (pWrapperTable->m_Toolpath_GetProfile == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItemIterator_GetCurrent = (PLib3MFBuildItemIterator_GetCurrentPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_getcurrent"); + pWrapperTable->m_Toolpath_GetProfileUUID = (PLib3MFToolpath_GetProfileUUIDPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getprofileuuid"); #else // _WIN32 - pWrapperTable->m_BuildItemIterator_GetCurrent = (PLib3MFBuildItemIterator_GetCurrentPtr) dlsym(hLibrary, "lib3mf_builditemiterator_getcurrent"); + pWrapperTable->m_Toolpath_GetProfileUUID = (PLib3MFToolpath_GetProfileUUIDPtr) dlsym(hLibrary, "lib3mf_toolpath_getprofileuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItemIterator_GetCurrent == NULL) + if (pWrapperTable->m_Toolpath_GetProfileUUID == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItemIterator_Clone = (PLib3MFBuildItemIterator_ClonePtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_clone"); + pWrapperTable->m_Toolpath_GetCustomDataCount = (PLib3MFToolpath_GetCustomDataCountPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getcustomdatacount"); #else // _WIN32 - pWrapperTable->m_BuildItemIterator_Clone = (PLib3MFBuildItemIterator_ClonePtr) dlsym(hLibrary, "lib3mf_builditemiterator_clone"); + pWrapperTable->m_Toolpath_GetCustomDataCount = (PLib3MFToolpath_GetCustomDataCountPtr) dlsym(hLibrary, "lib3mf_toolpath_getcustomdatacount"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItemIterator_Clone == NULL) + if (pWrapperTable->m_Toolpath_GetCustomDataCount == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_BuildItemIterator_Count = (PLib3MFBuildItemIterator_CountPtr) GetProcAddress(hLibrary, "lib3mf_builditemiterator_count"); + pWrapperTable->m_Toolpath_GetCustomData = (PLib3MFToolpath_GetCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getcustomdata"); #else // _WIN32 - pWrapperTable->m_BuildItemIterator_Count = (PLib3MFBuildItemIterator_CountPtr) dlsym(hLibrary, "lib3mf_builditemiterator_count"); + pWrapperTable->m_Toolpath_GetCustomData = (PLib3MFToolpath_GetCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpath_getcustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_BuildItemIterator_Count == NULL) + if (pWrapperTable->m_Toolpath_GetCustomData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_SetVertices = (PLib3MFSlice_SetVerticesPtr) GetProcAddress(hLibrary, "lib3mf_slice_setvertices"); + pWrapperTable->m_Toolpath_GetCustomDataName = (PLib3MFToolpath_GetCustomDataNamePtr) GetProcAddress(hLibrary, "lib3mf_toolpath_getcustomdataname"); #else // _WIN32 - pWrapperTable->m_Slice_SetVertices = (PLib3MFSlice_SetVerticesPtr) dlsym(hLibrary, "lib3mf_slice_setvertices"); + pWrapperTable->m_Toolpath_GetCustomDataName = (PLib3MFToolpath_GetCustomDataNamePtr) dlsym(hLibrary, "lib3mf_toolpath_getcustomdataname"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_SetVertices == NULL) + if (pWrapperTable->m_Toolpath_GetCustomDataName == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_GetVertices = (PLib3MFSlice_GetVerticesPtr) GetProcAddress(hLibrary, "lib3mf_slice_getvertices"); + pWrapperTable->m_Toolpath_HasUniqueCustomData = (PLib3MFToolpath_HasUniqueCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_hasuniquecustomdata"); #else // _WIN32 - pWrapperTable->m_Slice_GetVertices = (PLib3MFSlice_GetVerticesPtr) dlsym(hLibrary, "lib3mf_slice_getvertices"); + pWrapperTable->m_Toolpath_HasUniqueCustomData = (PLib3MFToolpath_HasUniqueCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpath_hasuniquecustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_GetVertices == NULL) + if (pWrapperTable->m_Toolpath_HasUniqueCustomData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_GetVertexCount = (PLib3MFSlice_GetVertexCountPtr) GetProcAddress(hLibrary, "lib3mf_slice_getvertexcount"); + pWrapperTable->m_Toolpath_FindUniqueCustomData = (PLib3MFToolpath_FindUniqueCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_finduniquecustomdata"); #else // _WIN32 - pWrapperTable->m_Slice_GetVertexCount = (PLib3MFSlice_GetVertexCountPtr) dlsym(hLibrary, "lib3mf_slice_getvertexcount"); + pWrapperTable->m_Toolpath_FindUniqueCustomData = (PLib3MFToolpath_FindUniqueCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpath_finduniquecustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_GetVertexCount == NULL) + if (pWrapperTable->m_Toolpath_FindUniqueCustomData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_AddPolygon = (PLib3MFSlice_AddPolygonPtr) GetProcAddress(hLibrary, "lib3mf_slice_addpolygon"); + pWrapperTable->m_Toolpath_AddCustomData = (PLib3MFToolpath_AddCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_addcustomdata"); #else // _WIN32 - pWrapperTable->m_Slice_AddPolygon = (PLib3MFSlice_AddPolygonPtr) dlsym(hLibrary, "lib3mf_slice_addpolygon"); + pWrapperTable->m_Toolpath_AddCustomData = (PLib3MFToolpath_AddCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpath_addcustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_AddPolygon == NULL) + if (pWrapperTable->m_Toolpath_AddCustomData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_GetPolygonCount = (PLib3MFSlice_GetPolygonCountPtr) GetProcAddress(hLibrary, "lib3mf_slice_getpolygoncount"); + pWrapperTable->m_Toolpath_ClearCustomData = (PLib3MFToolpath_ClearCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_clearcustomdata"); #else // _WIN32 - pWrapperTable->m_Slice_GetPolygonCount = (PLib3MFSlice_GetPolygonCountPtr) dlsym(hLibrary, "lib3mf_slice_getpolygoncount"); + pWrapperTable->m_Toolpath_ClearCustomData = (PLib3MFToolpath_ClearCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpath_clearcustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_GetPolygonCount == NULL) + if (pWrapperTable->m_Toolpath_ClearCustomData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_SetPolygonIndices = (PLib3MFSlice_SetPolygonIndicesPtr) GetProcAddress(hLibrary, "lib3mf_slice_setpolygonindices"); + pWrapperTable->m_Toolpath_DeleteCustomData = (PLib3MFToolpath_DeleteCustomDataPtr) GetProcAddress(hLibrary, "lib3mf_toolpath_deletecustomdata"); #else // _WIN32 - pWrapperTable->m_Slice_SetPolygonIndices = (PLib3MFSlice_SetPolygonIndicesPtr) dlsym(hLibrary, "lib3mf_slice_setpolygonindices"); + pWrapperTable->m_Toolpath_DeleteCustomData = (PLib3MFToolpath_DeleteCustomDataPtr) dlsym(hLibrary, "lib3mf_toolpath_deletecustomdata"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_SetPolygonIndices == NULL) + if (pWrapperTable->m_Toolpath_DeleteCustomData == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_GetPolygonIndices = (PLib3MFSlice_GetPolygonIndicesPtr) GetProcAddress(hLibrary, "lib3mf_slice_getpolygonindices"); + pWrapperTable->m_Toolpath_RegisterCustomIntegerAttribute = (PLib3MFToolpath_RegisterCustomIntegerAttributePtr) GetProcAddress(hLibrary, "lib3mf_toolpath_registercustomintegerattribute"); #else // _WIN32 - pWrapperTable->m_Slice_GetPolygonIndices = (PLib3MFSlice_GetPolygonIndicesPtr) dlsym(hLibrary, "lib3mf_slice_getpolygonindices"); + pWrapperTable->m_Toolpath_RegisterCustomIntegerAttribute = (PLib3MFToolpath_RegisterCustomIntegerAttributePtr) dlsym(hLibrary, "lib3mf_toolpath_registercustomintegerattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_GetPolygonIndices == NULL) + if (pWrapperTable->m_Toolpath_RegisterCustomIntegerAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_GetPolygonIndexCount = (PLib3MFSlice_GetPolygonIndexCountPtr) GetProcAddress(hLibrary, "lib3mf_slice_getpolygonindexcount"); + pWrapperTable->m_Toolpath_RegisterCustomDoubleAttribute = (PLib3MFToolpath_RegisterCustomDoubleAttributePtr) GetProcAddress(hLibrary, "lib3mf_toolpath_registercustomdoubleattribute"); #else // _WIN32 - pWrapperTable->m_Slice_GetPolygonIndexCount = (PLib3MFSlice_GetPolygonIndexCountPtr) dlsym(hLibrary, "lib3mf_slice_getpolygonindexcount"); + pWrapperTable->m_Toolpath_RegisterCustomDoubleAttribute = (PLib3MFToolpath_RegisterCustomDoubleAttributePtr) dlsym(hLibrary, "lib3mf_toolpath_registercustomdoubleattribute"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_GetPolygonIndexCount == NULL) + if (pWrapperTable->m_Toolpath_RegisterCustomDoubleAttribute == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_Slice_GetZTop = (PLib3MFSlice_GetZTopPtr) GetProcAddress(hLibrary, "lib3mf_slice_getztop"); + pWrapperTable->m_ToolpathIterator_GetCurrentToolpath = (PLib3MFToolpathIterator_GetCurrentToolpathPtr) GetProcAddress(hLibrary, "lib3mf_toolpathiterator_getcurrenttoolpath"); #else // _WIN32 - pWrapperTable->m_Slice_GetZTop = (PLib3MFSlice_GetZTopPtr) dlsym(hLibrary, "lib3mf_slice_getztop"); + pWrapperTable->m_ToolpathIterator_GetCurrentToolpath = (PLib3MFToolpathIterator_GetCurrentToolpathPtr) dlsym(hLibrary, "lib3mf_toolpathiterator_getcurrenttoolpath"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_Slice_GetZTop == NULL) + if (pWrapperTable->m_ToolpathIterator_GetCurrentToolpath == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 @@ -3278,6 +4593,15 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Model_GetMultiPropertyGroups == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Model_GetToolpaths = (PLib3MFModel_GetToolpathsPtr) GetProcAddress(hLibrary, "lib3mf_model_gettoolpaths"); + #else // _WIN32 + pWrapperTable->m_Model_GetToolpaths = (PLib3MFModel_GetToolpathsPtr) dlsym(hLibrary, "lib3mf_model_gettoolpaths"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_GetToolpaths == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Model_GetSliceStacks = (PLib3MFModel_GetSliceStacksPtr) GetProcAddress(hLibrary, "lib3mf_model_getslicestacks"); #else // _WIN32 @@ -3395,6 +4719,15 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Model_RemoveBuildItem == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Model_AddToolpath = (PLib3MFModel_AddToolpathPtr) GetProcAddress(hLibrary, "lib3mf_model_addtoolpath"); + #else // _WIN32 + pWrapperTable->m_Model_AddToolpath = (PLib3MFModel_AddToolpathPtr) dlsym(hLibrary, "lib3mf_model_addtoolpath"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_AddToolpath == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_Model_GetMetaDataGroup = (PLib3MFModel_GetMetaDataGroupPtr) GetProcAddress(hLibrary, "lib3mf_model_getmetadatagroup"); #else // _WIN32 @@ -3521,6 +4854,33 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable, if (pWrapperTable->m_Model_GetKeyStore == NULL) return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_Model_CreatePersistentSourceFromFile = (PLib3MFModel_CreatePersistentSourceFromFilePtr) GetProcAddress(hLibrary, "lib3mf_model_createpersistentsourcefromfile"); + #else // _WIN32 + pWrapperTable->m_Model_CreatePersistentSourceFromFile = (PLib3MFModel_CreatePersistentSourceFromFilePtr) dlsym(hLibrary, "lib3mf_model_createpersistentsourcefromfile"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_CreatePersistentSourceFromFile == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Model_CreatePersistentSourceFromBuffer = (PLib3MFModel_CreatePersistentSourceFromBufferPtr) GetProcAddress(hLibrary, "lib3mf_model_createpersistentsourcefrombuffer"); + #else // _WIN32 + pWrapperTable->m_Model_CreatePersistentSourceFromBuffer = (PLib3MFModel_CreatePersistentSourceFromBufferPtr) dlsym(hLibrary, "lib3mf_model_createpersistentsourcefrombuffer"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_CreatePersistentSourceFromBuffer == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_Model_CreatePersistentSourceFromCallback = (PLib3MFModel_CreatePersistentSourceFromCallbackPtr) GetProcAddress(hLibrary, "lib3mf_model_createpersistentsourcefromcallback"); + #else // _WIN32 + pWrapperTable->m_Model_CreatePersistentSourceFromCallback = (PLib3MFModel_CreatePersistentSourceFromCallbackPtr) dlsym(hLibrary, "lib3mf_model_createpersistentsourcefromcallback"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_Model_CreatePersistentSourceFromCallback == NULL) + return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_GetLibraryVersion = (PLib3MFGetLibraryVersionPtr) GetProcAddress(hLibrary, "lib3mf_getlibraryversion"); #else // _WIN32 diff --git a/Autogenerated/Bindings/NodeJS/lib3mf_dynamic.h b/Autogenerated/Bindings/NodeJS/lib3mf_dynamic.h index 044c754bb..6d35afa19 100644 --- a/Autogenerated/Bindings/NodeJS/lib3mf_dynamic.h +++ b/Autogenerated/Bindings/NodeJS/lib3mf_dynamic.h @@ -53,6 +53,78 @@ Interface version: 2.3.2 */ typedef Lib3MFResult (*PLib3MFBase_ClassTypeIdPtr) (Lib3MF_Base pBase, Lib3MF_uint64 * pClassTypeId); +/************************************************************************************************************************* + Class definition for BinaryStream +**************************************************************************************************************************/ + +/** +* Retrieves an binary streams package path for the binary data. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of binary streams package binary path., may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_GetBinaryPathPtr) (Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Retrieves an binary streams package path for the index data. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of binary streams package index path., may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_GetIndexPathPtr) (Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Retrieves an binary streams uuid. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of binary streams uuid, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_GetUUIDPtr) (Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); + +/** +* Sets the float compression mode to raw. All subsequent writes will adhere to this mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_DisableDiscretizedArrayCompressionPtr) (Lib3MF_BinaryStream pBinaryStream); + +/** +* Sets the compression mode to a quantized array. All subsequent writes will adhere to this mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] dUnits - Unit factor to use for quantization. +* @param[in] ePredictionType - Prediction type to use for arrays. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_EnableDiscretizedArrayCompressionPtr) (Lib3MF_BinaryStream pBinaryStream, Lib3MF_double dUnits, eLib3MFBinaryStreamPredictionType ePredictionType); + +/** +* Enables LZMA mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nLZMALevel - LZMA Level (0-9) +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_EnableLZMAPtr) (Lib3MF_BinaryStream pBinaryStream, Lib3MF_uint32 nLZMALevel); + +/** +* Disables LZMA mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBinaryStream_DisableLZMAPtr) (Lib3MF_BinaryStream pBinaryStream); + /************************************************************************************************************************* Class definition for Writer **************************************************************************************************************************/ @@ -186,10 +258,80 @@ typedef Lib3MFResult (*PLib3MFWriter_AddKeyWrappingCallbackPtr) (Lib3MF_Writer p */ typedef Lib3MFResult (*PLib3MFWriter_SetContentEncryptionCallbackPtr) (Lib3MF_Writer pWriter, Lib3MFContentEncryptionCallback pTheCallback, Lib3MF_pvoid pUserData); +/** +* Creates a binary stream object. Only applicable for 3MF Writers. +* +* @param[in] pWriter - Writer instance. +* @param[in] pIndexPath - Package path to write the index into +* @param[in] pBinaryPath - Package path to write raw binary data into +* @param[out] pBinaryStream - Returns a package path. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFWriter_CreateBinaryStreamPtr) (Lib3MF_Writer pWriter, const char * pIndexPath, const char * pBinaryPath, Lib3MF_BinaryStream * pBinaryStream); + +/** +* Sets a binary stream for an object. Currently supported objects are Meshes and Toolpath layers. +* +* @param[in] pWriter - Writer instance. +* @param[in] pInstance - Object instance to assign Binary stream to. +* @param[in] pBinaryStream - Binary stream object to use for this layer. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFWriter_AssignBinaryStreamPtr) (Lib3MF_Writer pWriter, Lib3MF_Base pInstance, Lib3MF_BinaryStream pBinaryStream); + +/** +* Registers a custom 3MF Namespace. Fails if Prefix is already registered. +* +* @param[in] pWriter - Writer instance. +* @param[in] pPrefix - Prefix to be used. MUST NOT be empty. MUST be alphanumeric, not starting with a number +* @param[in] pNameSpace - Namespace to be used. MUST NOT be empty. MUST be alphanumeric, not starting with a number +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFWriter_RegisterCustomNamespacePtr) (Lib3MF_Writer pWriter, const char * pPrefix, const char * pNameSpace); + +/************************************************************************************************************************* + Class definition for PersistentReaderSource +**************************************************************************************************************************/ + +/** +* Retrieves the type of source data. +* +* @param[in] pPersistentReaderSource - PersistentReaderSource instance. +* @param[out] pSourceType - Reader Source Type +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFPersistentReaderSource_GetSourceTypePtr) (Lib3MF_PersistentReaderSource pPersistentReaderSource, eLib3MFPersistentReaderSourceType * pSourceType); + +/** +* Invalidates the reader source. Every subsequent read on this data will fail. +* +* @param[in] pPersistentReaderSource - PersistentReaderSource instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFPersistentReaderSource_InvalidateSourceDataPtr) (Lib3MF_PersistentReaderSource pPersistentReaderSource); + +/** +* Checks if the source data is valid. Any read on an invalid source object will fail. +* +* @param[in] pPersistentReaderSource - PersistentReaderSource instance. +* @param[out] pDataIsValid - The source data is valid. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFPersistentReaderSource_SourceDataIsValidPtr) (Lib3MF_PersistentReaderSource pPersistentReaderSource, bool * pDataIsValid); + /************************************************************************************************************************* Class definition for Reader **************************************************************************************************************************/ +/** +* Reads a model from a persistent source object. The object will be referenced until the Model is destroyed or cleared. +* +* @param[in] pReader - Reader instance. +* @param[in] pSource - Source object to read from +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFReader_ReadFromPersistentSourcePtr) (Lib3MF_Reader pReader, Lib3MF_PersistentReaderSource pSource); + /** * Reads a model from a file. The file type is specified by the Model Reader class * @@ -433,1987 +575,3252 @@ typedef Lib3MFResult (*PLib3MFResourceIterator_ClonePtr) (Lib3MF_ResourceIterato typedef Lib3MFResult (*PLib3MFResourceIterator_CountPtr) (Lib3MF_ResourceIterator pResourceIterator, Lib3MF_uint64 * pCount); /************************************************************************************************************************* - Class definition for SliceStackIterator + Class definition for CustomXMLAttribute **************************************************************************************************************************/ /** -* Returns the SliceStack the iterator points at. +* Retrieves name of the attribute. * -* @param[in] pSliceStackIterator - SliceStackIterator instance. -* @param[out] pResource - returns the SliceStack instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the attribute., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSliceStackIterator_GetCurrentSliceStackPtr) (Lib3MF_SliceStackIterator pSliceStackIterator, Lib3MF_SliceStack * pResource); - -/************************************************************************************************************************* - Class definition for ObjectIterator -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_GetNamePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Returns the Object the iterator points at. +* Retrieves value of the attribute as string. * -* @param[in] pObjectIterator - ObjectIterator instance. -* @param[out] pResource - returns the Object instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of returns the value of the attribute., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObjectIterator_GetCurrentObjectPtr) (Lib3MF_ObjectIterator pObjectIterator, Lib3MF_Object * pResource); - -/************************************************************************************************************************* - Class definition for MeshObjectIterator -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_GetValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* Returns the MeshObject the iterator points at. +* Checks if the value is a valid integer in the given range. * -* @param[in] pMeshObjectIterator - MeshObjectIterator instance. -* @param[out] pResource - returns the MeshObject instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nMinValue - Minimum allowed value +* @param[in] nMaxValue - Maximum allowed value +* @param[out] pIsValid - returns if the value is a valid integer. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) (Lib3MF_MeshObjectIterator pMeshObjectIterator, Lib3MF_MeshObject * pResource); - -/************************************************************************************************************************* - Class definition for ComponentsObjectIterator -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_IsValidIntegerPtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nMinValue, Lib3MF_int64 nMaxValue, bool * pIsValid); /** -* Returns the ComponentsObject the iterator points at. +* Returns the value as integer. Fails if the value is not a valid integer in the given range. * -* @param[in] pComponentsObjectIterator - ComponentsObjectIterator instance. -* @param[out] pResource - returns the ComponentsObject instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nMinValue - Minimum allowed value +* @param[in] nMaxValue - Maximum allowed value +* @param[out] pValue - returns the value. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) (Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource); - -/************************************************************************************************************************* - Class definition for Texture2DIterator -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_GetIntegerValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nMinValue, Lib3MF_int64 nMaxValue, Lib3MF_int64 * pValue); /** -* Returns the Texture2D the iterator points at. +* Checks if the value is a valid double in the given range. * -* @param[in] pTexture2DIterator - Texture2DIterator instance. -* @param[out] pResource - returns the Texture2D instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dMinValue - Minimum allowed value +* @param[in] dMaxValue - Maximum allowed value +* @param[out] pIsValid - returns if the value is a valid double. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) (Lib3MF_Texture2DIterator pTexture2DIterator, Lib3MF_Texture2D * pResource); +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_IsValidDoublePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, bool * pIsValid); -/************************************************************************************************************************* - Class definition for BaseMaterialGroupIterator -**************************************************************************************************************************/ +/** +* Returns the value as double. Fails if the value is not a valid double in the given range. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dMinValue - Minimum allowed value +* @param[in] dMaxValue - Maximum allowed value +* @param[out] pValue - returns the value . +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_GetDoubleValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, Lib3MF_double * pValue); /** -* Returns the MaterialGroup the iterator points at. +* Checks if the value is a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. * -* @param[in] pBaseMaterialGroupIterator - BaseMaterialGroupIterator instance. -* @param[out] pResource - returns the BaseMaterialGroup instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[out] pIsValid - returns if the value is a valid bool. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr) (Lib3MF_BaseMaterialGroupIterator pBaseMaterialGroupIterator, Lib3MF_BaseMaterialGroup * pResource); +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_IsValidBoolPtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, bool * pIsValid); -/************************************************************************************************************************* - Class definition for ColorGroupIterator -**************************************************************************************************************************/ +/** +* Returns the value as bool. Fails if the value is not a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dMinValue - Minimum allowed value +* @param[in] dMaxValue - Maximum allowed value +* @param[out] pValue - returns the value . +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_GetBoolValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, bool * pValue); /** -* Returns the ColorGroup the iterator points at. +* Sets the value of the attribute as string. * -* @param[in] pColorGroupIterator - ColorGroupIterator instance. -* @param[out] pResource - returns the ColorGroup instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] pValue - new value of the attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroupIterator_GetCurrentColorGroupPtr) (Lib3MF_ColorGroupIterator pColorGroupIterator, Lib3MF_ColorGroup * pResource); +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_SetValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const char * pValue); -/************************************************************************************************************************* - Class definition for Texture2DGroupIterator -**************************************************************************************************************************/ +/** +* Sets the value of the attribute as integer. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nValue - new value of the attribute. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_SetIntegerValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nValue); /** -* Returns the Texture2DGroup the iterator points at. +* Sets the value of the attribute as double. * -* @param[in] pTexture2DGroupIterator - Texture2DGroupIterator instance. -* @param[out] pResource - returns the Texture2DGroup instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dValue - new value of the attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupPtr) (Lib3MF_Texture2DGroupIterator pTexture2DGroupIterator, Lib3MF_Texture2DGroup * pResource); +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_SetDoubleValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dValue); -/************************************************************************************************************************* - Class definition for CompositeMaterialsIterator -**************************************************************************************************************************/ +/** +* Sets the value of the attribute as bool. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] bValue - new value of the attribute. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_SetBoolValuePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute, bool bValue); /** -* Returns the CompositeMaterials the iterator points at. +* Removes the attribute from its parent node. All subsequent calls to the class will fail. * -* @param[in] pCompositeMaterialsIterator - CompositeMaterialsIterator instance. -* @param[out] pResource - returns the CompositeMaterials instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsPtr) (Lib3MF_CompositeMaterialsIterator pCompositeMaterialsIterator, Lib3MF_CompositeMaterials * pResource); +typedef Lib3MFResult (*PLib3MFCustomXMLAttribute_RemovePtr) (Lib3MF_CustomXMLAttribute pCustomXMLAttribute); /************************************************************************************************************************* - Class definition for MultiPropertyGroupIterator + Class definition for CustomXMLNode **************************************************************************************************************************/ /** -* Returns the MultiPropertyGroup the iterator points at. +* Retrieves name of the node. * -* @param[in] pMultiPropertyGroupIterator - MultiPropertyGroupIterator instance. -* @param[out] pResource - returns the MultiPropertyGroup instance. +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the node., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupPtr) (Lib3MF_MultiPropertyGroupIterator pMultiPropertyGroupIterator, Lib3MF_MultiPropertyGroup * pResource); - -/************************************************************************************************************************* - Class definition for MetaData -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLNode_GetNamePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* returns the namespace URL of the metadata +* Retrieves namespace of the node. * -* @param[in] pMetaData - MetaData instance. +* @param[in] pCustomXMLNode - CustomXMLNode instance. * @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) * @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameSpaceBuffer - buffer of the namespace URL of the metadata, may be NULL +* @param[out] pNameSpaceBuffer - buffer of returns the namespace of the node., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_GetNameSpacePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_GetNameSpacePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* sets a new namespace URL of the metadata +* Returns number of attributes. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pNameSpace - the new namespace URL of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[out] pCount - returns the number of attributes. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_SetNameSpacePtr) (Lib3MF_MetaData pMetaData, const char * pNameSpace); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_GetAttributeCountPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 * pCount); /** -* returns the name of a metadata +* Returns attribute instance. Fails if Index is out of range. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of the name of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] nIndex - Index of the attribute to return (0-based). +* @param[out] pAttributeInstance - XML Document attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_GetNamePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_GetAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 nIndex, Lib3MF_CustomXMLAttribute * pAttributeInstance); /** -* sets a new name of a metadata +* Returns if attribute of a specific name exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pName - the new name of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[out] pAttributeExists - Returns if the attribute exists. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_SetNamePtr) (Lib3MF_MetaData pMetaData, const char * pName); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_HasAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pAttributeExists); /** -* returns the (namespace+name) of a metadata +* Returns attribute instance of a specific name. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nKeyBufferSize - size of the buffer (including trailing 0) -* @param[out] pKeyNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pKeyBuffer - buffer of the key (namespace+name) of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] bMustExist - If true, the call fails if attribute does not exist. If falls, the call will return null if the attribute does not exist. +* @param[out] pAttributeInstance - XML Document attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_GetKeyPtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nKeyBufferSize, Lib3MF_uint32* pKeyNeededChars, char * pKeyBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_FindAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bMustExist, Lib3MF_CustomXMLAttribute * pAttributeInstance); /** -* returns, whether a metadata must be preserved +* Removes the attribute with a specific name. Does nothing if attribute does not exist. * -* @param[in] pMetaData - MetaData instance. -* @param[out] pMustPreserve - returns, whether a metadata must be preserved +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[out] pAttributeRemoved - Returns true if an attribute was removed. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_GetMustPreservePtr) (Lib3MF_MetaData pMetaData, bool * pMustPreserve); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_RemoveAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pAttributeRemoved); /** -* sets whether a metadata must be preserved +* Removes the attribute with a specific index. Fails if index is invalid * -* @param[in] pMetaData - MetaData instance. -* @param[in] bMustPreserve - a new value whether a metadata must be preserved +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] nIndex - Index of the attribute to remove (0-based). +* @param[out] pAttributeRemoved - Returns true if an attribute was removed. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_SetMustPreservePtr) (Lib3MF_MetaData pMetaData, bool bMustPreserve); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_RemoveAttributeByIndexPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 nIndex, bool * pAttributeRemoved); /** -* returns the type of a metadata +* Adds an attribute with a specific name and string value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nTypeBufferSize - size of the buffer (including trailing 0) -* @param[out] pTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pTypeBuffer - buffer of the type of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] pValue - Value of the attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_GetTypePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nTypeBufferSize, Lib3MF_uint32* pTypeNeededChars, char * pTypeBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_AddAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, const char * pValue); /** -* sets a new type of a metadata. This must be a simple XML type +* Adds an attribute with a specific name and integer value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pType - a new type of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] nValue - Value of the attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_SetTypePtr) (Lib3MF_MetaData pMetaData, const char * pType); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_AddIntegerAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_int64 nValue); /** -* returns the value of the metadata +* Adds an attribute with a specific name and double value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nValueBufferSize - size of the buffer (including trailing 0) -* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pValueBuffer - buffer of the value of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] dValue - Value of the attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_GetValuePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_AddDoubleAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_double dValue); /** -* sets a new value of the metadata +* Adds an attribute with a specific name and bool value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pValue - a new value of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] bValue - Value of the attribute. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaData_SetValuePtr) (Lib3MF_MetaData pMetaData, const char * pValue); - -/************************************************************************************************************************* - Class definition for MetaDataGroup -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLNode_AddBoolAttributePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bValue); /** -* returns the number of metadata in this metadatagroup +* Returns all the child nodes of the XML Node. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[out] pCount - returns the number metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[out] pChildNodes - returns the list of child nodes. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaDataGroup_GetMetaDataCountPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_GetChildrenPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_CustomXMLNodes * pChildNodes); /** -* returns a metadata value within this metadatagroup +* Returns how many children of the XML Node have a specific name. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] nIndex - Index of the Metadata. -* @param[out] pMetaData - an instance of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the node. +* @param[out] pCount - returns the number children with the specified name. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaDataGroup_GetMetaDataPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex, Lib3MF_MetaData * pMetaData); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_CountChildrenByNamePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_uint64 * pCount); /** -* returns a metadata value within this metadatagroup +* Returns all the child nodes of the XML Node with a specific name. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] pNameSpace - the namespace of the metadata -* @param[in] pName - the name of the Metadata -* @param[out] pMetaData - an instance of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildNodes - returns the list of child nodes. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaDataGroup_GetMetaDataByKeyPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, Lib3MF_MetaData * pMetaData); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_GetChildrenByNamePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_CustomXMLNodes * pChildNodes); /** -* removes metadata by index from the model. +* Returns if a child with a specific name exist. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] nIndex - Index of the metadata to remove +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildExists - returns if a child with a specific name exists. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaDataGroup_RemoveMetaDataByIndexPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_HasChildPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pChildExists); /** -* removes metadata from the model. +* Returns if a child with a specific name exist once and only once. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] pTheMetaData - The metadata to remove +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildExists - returns if a child with a specific name exists once and only once. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaDataGroup_RemoveMetaDataPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_MetaData pTheMetaData); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_HasUniqueChildPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pChildExists); /** -* adds a new metadata to this metadatagroup +* Returns child with a specific name. Throws an error if name does not exist once and only once. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] pNameSpace - the namespace of the metadata -* @param[in] pName - the name of the metadata -* @param[in] pValue - the value of the metadata -* @param[in] pType - the type of the metadata -* @param[in] bMustPreserve - shuold the metadata be preserved -* @param[out] pMetaData - a new instance of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[in] bMustExist - If true, the call fails if child does not exist. If falls, the call will return null if the child does not exist. +* @param[out] pChildInstance - returns child instance or null. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMetaDataGroup_AddMetaDataPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, const char * pValue, const char * pType, bool bMustPreserve, Lib3MF_MetaData * pMetaData); - -/************************************************************************************************************************* - Class definition for Object -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFCustomXMLNode_FindChildPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bMustExist, Lib3MF_CustomXMLNode * pChildInstance); /** -* Retrieves an object's type +* Adds a new child with a specific name. * -* @param[in] pObject - Object instance. -* @param[out] pObjectType - returns object type enum. +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildInstance - returns child instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetTypePtr) (Lib3MF_Object pObject, eLib3MFObjectType * pObjectType); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_AddChildPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_CustomXMLNode * pChildInstance); /** -* Sets an object's type +* Removes a specific child. All subsequent calls to the child will fail after the call. * -* @param[in] pObject - Object instance. -* @param[in] eObjectType - object type enum. +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pChildInstance - child instance to remove. Fails if given instance is not a child of the node. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_SetTypePtr) (Lib3MF_Object pObject, eLib3MFObjectType eObjectType); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_RemoveChildPtr) (Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_CustomXMLNode pChildInstance); /** -* Retrieves an object's name +* Removes all children with a specific name. Does nothing if no child with the name exists. All subsequent calls to the deleted children will fail after the call. * -* @param[in] pObject - Object instance. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of returns object name., may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the children. +* @param[out] pNumberOfDeletedChildren - Returns how many children have been deleted. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetNamePtr) (Lib3MF_Object pObject, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_RemoveChildrenWithNamePtr) (Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_uint64 * pNumberOfDeletedChildren); /** -* Sets an object's name string +* Removes the node from its parent. The root node of the document can not be removed. Any subsequent call to the node fails after this. * -* @param[in] pObject - Object instance. -* @param[in] pName - new object name. +* @param[in] pCustomXMLNode - CustomXMLNode instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_SetNamePtr) (Lib3MF_Object pObject, const char * pName); +typedef Lib3MFResult (*PLib3MFCustomXMLNode_RemovePtr) (Lib3MF_CustomXMLNode pCustomXMLNode); + +/************************************************************************************************************************* + Class definition for CustomXMLNodes +**************************************************************************************************************************/ /** -* Retrieves an object's part number +* Returns number of nodes. * -* @param[in] pObject - Object instance. -* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) -* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPartNumberBuffer - buffer of returns object part number., may be NULL +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[out] pCount - returns the number of nodes in the list. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetPartNumberPtr) (Lib3MF_Object pObject, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_GetNodeCountPtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, Lib3MF_uint64 * pCount); /** -* Sets an objects partnumber string +* Returns node instance. Fails if Index is out of range. * -* @param[in] pObject - Object instance. -* @param[in] pPartNumber - new object part number. +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] nIndex - Index of the node to return (0-based). +* @param[out] pNodeInstance - XML Node node. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_SetPartNumberPtr) (Lib3MF_Object pObject, const char * pPartNumber); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_GetNodePtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, Lib3MF_uint64 nIndex, Lib3MF_CustomXMLNode * pNodeInstance); /** -* Retrieves, if an object is a mesh object +* Returns how many nodes of the XML Node have a specific name. * -* @param[in] pObject - Object instance. -* @param[out] pIsMeshObject - returns, whether the object is a mesh object +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pCount - returns the number of nodes with the specified name. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_IsMeshObjectPtr) (Lib3MF_Object pObject, bool * pIsMeshObject); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_CountNodesByNamePtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, Lib3MF_uint64 * pCount); /** -* Retrieves, if an object is a components object +* Returns all the nodes nodes of the XML Node with a specific name. * -* @param[in] pObject - Object instance. -* @param[out] pIsComponentsObject - returns, whether the object is a components object +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pNodes - returns the list of node nodes. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_IsComponentsObjectPtr) (Lib3MF_Object pObject, bool * pIsComponentsObject); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_GetNodesByNamePtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, Lib3MF_CustomXMLNodes * pNodes); /** -* Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. +* Returns if a node with a specific name exist. * -* @param[in] pObject - Object instance. -* @param[out] pIsValid - returns whether the object is a valid object description +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pNodeExists - returns if a node with a specific name exists. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_IsValidPtr) (Lib3MF_Object pObject, bool * pIsValid); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_HasNodePtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool * pNodeExists); /** -* Use an existing attachment as thumbnail for this object +* Returns if a node with a specific name exist once and only once. * -* @param[in] pObject - Object instance. -* @param[in] pAttachment - Instance of a new or the existing thumbnailattachment object. +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pNodeExists - returns if a node with a specific name exists once and only once. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_SetAttachmentAsThumbnailPtr) (Lib3MF_Object pObject, Lib3MF_Attachment pAttachment); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_HasUniqueNodePtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool * pNodeExists); /** -* Get the attachment containing the object thumbnail. +* Returns node with a specific name. Throws an error if name does not exist once and only once. * -* @param[in] pObject - Object instance. -* @param[out] pAttachment - Instance of the thumbnailattachment object or NULL. +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[in] bMustExist - If true, the call fails if node does not exist. If falls, the call will return null if the node does not exist. +* @param[out] pNodeInstance - returns node instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetThumbnailAttachmentPtr) (Lib3MF_Object pObject, Lib3MF_Attachment * pAttachment); +typedef Lib3MFResult (*PLib3MFCustomXMLNodes_FindNodePtr) (Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool bMustExist, Lib3MF_CustomXMLNode * pNodeInstance); + +/************************************************************************************************************************* + Class definition for CustomDOMTree +**************************************************************************************************************************/ /** -* Clears the attachment. The attachment instance is not removed from the package. +* Returns the namespace identifier for the DOM Tree. * -* @param[in] pObject - Object instance. +* @param[in] pCustomDOMTree - CustomDOMTree instance. +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of returns the namespace of the DOM Tree., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_ClearThumbnailAttachmentPtr) (Lib3MF_Object pObject); +typedef Lib3MFResult (*PLib3MFCustomDOMTree_GetNameSpacePtr) (Lib3MF_CustomDOMTree pCustomDOMTree, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* Returns the outbox of a build item +* Returns root node of the tree. * -* @param[in] pObject - Object instance. -* @param[out] pOutbox - Outbox of this build item +* @param[in] pCustomDOMTree - CustomDOMTree instance. +* @param[out] pRootNode - Root node of the document. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetOutboxPtr) (Lib3MF_Object pObject, sLib3MFBox * pOutbox); +typedef Lib3MFResult (*PLib3MFCustomDOMTree_GetRootNodePtr) (Lib3MF_CustomDOMTree pCustomDOMTree, Lib3MF_CustomXMLNode * pRootNode); /** -* Retrieves an object's uuid string (see production extension specification) +* Saves the XML tree into a string. * -* @param[in] pObject - Object instance. -* @param[out] pHasUUID - flag whether the build item has a UUID -* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pUUIDBuffer - buffer of returns object uuid., may be NULL +* @param[in] pCustomDOMTree - CustomDOMTree instance. +* @param[in] nXMLStringBufferSize - size of the buffer (including trailing 0) +* @param[out] pXMLStringNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pXMLStringBuffer - buffer of String with the XML Content., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetUUIDPtr) (Lib3MF_Object pObject, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); +typedef Lib3MFResult (*PLib3MFCustomDOMTree_SaveToStringPtr) (Lib3MF_CustomDOMTree pCustomDOMTree, const Lib3MF_uint32 nXMLStringBufferSize, Lib3MF_uint32* pXMLStringNeededChars, char * pXMLStringBuffer); + +/************************************************************************************************************************* + Class definition for SliceStackIterator +**************************************************************************************************************************/ /** -* Sets a build object's uuid string (see production extension specification) +* Returns the SliceStack the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] pUUID - new object uuid string. +* @param[in] pSliceStackIterator - SliceStackIterator instance. +* @param[out] pResource - returns the SliceStack instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_SetUUIDPtr) (Lib3MF_Object pObject, const char * pUUID); +typedef Lib3MFResult (*PLib3MFSliceStackIterator_GetCurrentSliceStackPtr) (Lib3MF_SliceStackIterator pSliceStackIterator, Lib3MF_SliceStack * pResource); + +/************************************************************************************************************************* + Class definition for ObjectIterator +**************************************************************************************************************************/ /** -* Returns the metadatagroup of this object +* Returns the Object the iterator points at. * -* @param[in] pObject - Object instance. -* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this object +* @param[in] pObjectIterator - ObjectIterator instance. +* @param[out] pResource - returns the Object instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetMetaDataGroupPtr) (Lib3MF_Object pObject, Lib3MF_MetaDataGroup * pMetaDataGroup); +typedef Lib3MFResult (*PLib3MFObjectIterator_GetCurrentObjectPtr) (Lib3MF_ObjectIterator pObjectIterator, Lib3MF_Object * pResource); + +/************************************************************************************************************************* + Class definition for MeshObjectIterator +**************************************************************************************************************************/ /** -* set the meshresolution of the mesh object +* Returns the MeshObject the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] eMeshResolution - meshresolution of this object +* @param[in] pMeshObjectIterator - MeshObjectIterator instance. +* @param[out] pResource - returns the MeshObject instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_SetSlicesMeshResolutionPtr) (Lib3MF_Object pObject, eLib3MFSlicesMeshResolution eMeshResolution); +typedef Lib3MFResult (*PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr) (Lib3MF_MeshObjectIterator pMeshObjectIterator, Lib3MF_MeshObject * pResource); + +/************************************************************************************************************************* + Class definition for ComponentsObjectIterator +**************************************************************************************************************************/ /** -* get the meshresolution of the mesh object +* Returns the ComponentsObject the iterator points at. * -* @param[in] pObject - Object instance. -* @param[out] pMeshResolution - meshresolution of this object +* @param[in] pComponentsObjectIterator - ComponentsObjectIterator instance. +* @param[out] pResource - returns the ComponentsObject instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetSlicesMeshResolutionPtr) (Lib3MF_Object pObject, eLib3MFSlicesMeshResolution * pMeshResolution); +typedef Lib3MFResult (*PLib3MFComponentsObjectIterator_GetCurrentComponentsObjectPtr) (Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource); + +/************************************************************************************************************************* + Class definition for Texture2DIterator +**************************************************************************************************************************/ /** -* returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack +* Returns the Texture2D the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] bRecursive - check also all referenced objects? -* @param[out] pHasSlices - does the object have a slice stack? +* @param[in] pTexture2DIterator - Texture2DIterator instance. +* @param[out] pResource - returns the Texture2D instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_HasSlicesPtr) (Lib3MF_Object pObject, bool bRecursive, bool * pHasSlices); +typedef Lib3MFResult (*PLib3MFTexture2DIterator_GetCurrentTexture2DPtr) (Lib3MF_Texture2DIterator pTexture2DIterator, Lib3MF_Texture2D * pResource); + +/************************************************************************************************************************* + Class definition for BaseMaterialGroupIterator +**************************************************************************************************************************/ /** -* unlinks the attached slicestack from this object. If no slice stack is attached, do noting. +* Returns the MaterialGroup the iterator points at. * -* @param[in] pObject - Object instance. +* @param[in] pBaseMaterialGroupIterator - BaseMaterialGroupIterator instance. +* @param[out] pResource - returns the BaseMaterialGroup instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_ClearSliceStackPtr) (Lib3MF_Object pObject); +typedef Lib3MFResult (*PLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupPtr) (Lib3MF_BaseMaterialGroupIterator pBaseMaterialGroupIterator, Lib3MF_BaseMaterialGroup * pResource); + +/************************************************************************************************************************* + Class definition for ColorGroupIterator +**************************************************************************************************************************/ /** -* get the Slicestack attached to the object +* Returns the ColorGroup the iterator points at. * -* @param[in] pObject - Object instance. -* @param[out] pSliceStackInstance - returns the slicestack instance +* @param[in] pColorGroupIterator - ColorGroupIterator instance. +* @param[out] pResource - returns the ColorGroup instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_GetSliceStackPtr) (Lib3MF_Object pObject, Lib3MF_SliceStack * pSliceStackInstance); +typedef Lib3MFResult (*PLib3MFColorGroupIterator_GetCurrentColorGroupPtr) (Lib3MF_ColorGroupIterator pColorGroupIterator, Lib3MF_ColorGroup * pResource); + +/************************************************************************************************************************* + Class definition for Texture2DGroupIterator +**************************************************************************************************************************/ /** -* assigns a slicestack to the object +* Returns the Texture2DGroup the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] pSliceStackInstance - the new slice stack of this Object +* @param[in] pTexture2DGroupIterator - Texture2DGroupIterator instance. +* @param[out] pResource - returns the Texture2DGroup instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFObject_AssignSliceStackPtr) (Lib3MF_Object pObject, Lib3MF_SliceStack pSliceStackInstance); +typedef Lib3MFResult (*PLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupPtr) (Lib3MF_Texture2DGroupIterator pTexture2DGroupIterator, Lib3MF_Texture2DGroup * pResource); /************************************************************************************************************************* - Class definition for MeshObject + Class definition for CompositeMaterialsIterator **************************************************************************************************************************/ /** -* Returns the vertex count of a mesh object. +* Returns the CompositeMaterials the iterator points at. * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pVertexCount - filled with the vertex count. +* @param[in] pCompositeMaterialsIterator - CompositeMaterialsIterator instance. +* @param[out] pResource - returns the CompositeMaterials instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetVertexCountPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); +typedef Lib3MFResult (*PLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsPtr) (Lib3MF_CompositeMaterialsIterator pCompositeMaterialsIterator, Lib3MF_CompositeMaterials * pResource); + +/************************************************************************************************************************* + Class definition for MultiPropertyGroupIterator +**************************************************************************************************************************/ /** -* Returns the triangle count of a mesh object. +* Returns the MultiPropertyGroup the iterator points at. * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pVertexCount - filled with the triangle count. +* @param[in] pMultiPropertyGroupIterator - MultiPropertyGroupIterator instance. +* @param[out] pResource - returns the MultiPropertyGroup instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetTriangleCountPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); +typedef Lib3MFResult (*PLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupPtr) (Lib3MF_MultiPropertyGroupIterator pMultiPropertyGroupIterator, Lib3MF_MultiPropertyGroup * pResource); + +/************************************************************************************************************************* + Class definition for MetaData +**************************************************************************************************************************/ /** -* Returns the vertex count of a mesh object. +* returns the namespace URL of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) -* @param[out] pCoordinates - filled with the vertex coordinates. +* @param[in] pMetaData - MetaData instance. +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of the namespace URL of the metadata, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetVertexPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFPosition * pCoordinates); +typedef Lib3MFResult (*PLib3MFMetaData_GetNameSpacePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* Sets the coordinates of a single vertex of a mesh object +* sets a new namespace URL of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) -* @param[in] pCoordinates - contains the vertex coordinates. +* @param[in] pMetaData - MetaData instance. +* @param[in] pNameSpace - the new namespace URL of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_SetVertexPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFPosition * pCoordinates); +typedef Lib3MFResult (*PLib3MFMetaData_SetNameSpacePtr) (Lib3MF_MetaData pMetaData, const char * pNameSpace); /** -* Adds a single vertex to a mesh object +* returns the name of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] pCoordinates - contains the vertex coordinates. -* @param[out] pNewIndex - Index of the new vertex +* @param[in] pMetaData - MetaData instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of the name of the metadata, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_AddVertexPtr) (Lib3MF_MeshObject pMeshObject, const sLib3MFPosition * pCoordinates, Lib3MF_uint32 * pNewIndex); +typedef Lib3MFResult (*PLib3MFMetaData_GetNamePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Obtains all vertex positions of a mesh object +* sets a new name of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pVerticesBuffer - Position buffer of contains the vertex coordinates. +* @param[in] pMetaData - MetaData instance. +* @param[in] pName - the new name of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetVerticesPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, sLib3MFPosition * pVerticesBuffer); +typedef Lib3MFResult (*PLib3MFMetaData_SetNamePtr) (Lib3MF_MetaData pMetaData, const char * pName); /** -* Returns indices of a single triangle of a mesh object. +* returns the (namespace+name) of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[out] pIndices - filled with the triangle indices. +* @param[in] pMetaData - MetaData instance. +* @param[in] nKeyBufferSize - size of the buffer (including trailing 0) +* @param[out] pKeyNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pKeyBuffer - buffer of the key (namespace+name) of the metadata, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetTrianglePtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFTriangle * pIndices); +typedef Lib3MFResult (*PLib3MFMetaData_GetKeyPtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nKeyBufferSize, Lib3MF_uint32* pKeyNeededChars, char * pKeyBuffer); /** -* Sets the indices of a single triangle of a mesh object. +* returns, whether a metadata must be preserved * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[in] pIndices - contains the triangle indices. +* @param[in] pMetaData - MetaData instance. +* @param[out] pMustPreserve - returns, whether a metadata must be preserved * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_SetTrianglePtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFTriangle * pIndices); +typedef Lib3MFResult (*PLib3MFMetaData_GetMustPreservePtr) (Lib3MF_MetaData pMetaData, bool * pMustPreserve); /** -* Adds a single triangle to a mesh object +* sets whether a metadata must be preserved * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] pIndices - contains the triangle indices. -* @param[out] pNewIndex - Index of the new triangle +* @param[in] pMetaData - MetaData instance. +* @param[in] bMustPreserve - a new value whether a metadata must be preserved * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_AddTrianglePtr) (Lib3MF_MeshObject pMeshObject, const sLib3MFTriangle * pIndices, Lib3MF_uint32 * pNewIndex); +typedef Lib3MFResult (*PLib3MFMetaData_SetMustPreservePtr) (Lib3MF_MetaData pMetaData, bool bMustPreserve); /** -* Get all triangles of a mesh object +* returns the type of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @param[in] pMetaData - MetaData instance. +* @param[in] nTypeBufferSize - size of the buffer (including trailing 0) +* @param[out] pTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pTypeBuffer - buffer of the type of the metadata, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetTriangleIndicesPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, sLib3MFTriangle * pIndicesBuffer); +typedef Lib3MFResult (*PLib3MFMetaData_GetTypePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nTypeBufferSize, Lib3MF_uint32* pTypeNeededChars, char * pTypeBuffer); /** -* Sets the property at the object-level of the mesh object. +* sets a new type of a metadata. This must be a simple XML type * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nUniqueResourceID - the object-level Property UniqueResourceID. -* @param[in] nPropertyID - the object-level PropertyID. +* @param[in] pMetaData - MetaData instance. +* @param[in] pType - a new type of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_SetObjectLevelPropertyPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nUniqueResourceID, Lib3MF_uint32 nPropertyID); +typedef Lib3MFResult (*PLib3MFMetaData_SetTypePtr) (Lib3MF_MetaData pMetaData, const char * pType); /** -* Gets the property at the object-level of the mesh object. +* returns the value of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pUniqueResourceID - the object-level Property UniqueResourceID. -* @param[out] pPropertyID - the object-level PropertyID. -* @param[out] pHasObjectLevelProperty - Has an object-level property been specified? +* @param[in] pMetaData - MetaData instance. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of the value of the metadata, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetObjectLevelPropertyPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pUniqueResourceID, Lib3MF_uint32 * pPropertyID, bool * pHasObjectLevelProperty); +typedef Lib3MFResult (*PLib3MFMetaData_GetValuePtr) (Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* Sets the properties of a single triangle of a mesh object. +* sets a new value of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[in] pProperties - contains the triangle properties. +* @param[in] pMetaData - MetaData instance. +* @param[in] pValue - a new value of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_SetTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFTriangleProperties * pProperties); +typedef Lib3MFResult (*PLib3MFMetaData_SetValuePtr) (Lib3MF_MetaData pMetaData, const char * pValue); -/** -* Gets the properties of a single triangle of a mesh object. -* -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[out] pProperty - returns the triangle properties. -* @return error code or 0 (success) -*/ -typedef Lib3MFResult (*PLib3MFMeshObject_GetTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFTriangleProperties * pProperty); +/************************************************************************************************************************* + Class definition for MetaDataGroup +**************************************************************************************************************************/ /** -* Sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. +* returns the number of metadata in this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer -* @param[in] pPropertiesArrayBuffer - TriangleProperties buffer of contains the triangle properties array. Must have trianglecount elements. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[out] pCount - returns the number metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_SetAllTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nPropertiesArrayBufferSize, const sLib3MFTriangleProperties * pPropertiesArrayBuffer); +typedef Lib3MFResult (*PLib3MFMetaDataGroup_GetMetaDataCountPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 * pCount); /** -* Gets the properties of all triangles of a mesh object. +* returns a metadata value within this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer -* @param[out] pPropertiesArrayNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertiesArrayBuffer - TriangleProperties buffer of returns the triangle properties array. Must have trianglecount elements. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] nIndex - Index of the Metadata. +* @param[out] pMetaData - an instance of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_GetAllTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nPropertiesArrayBufferSize, Lib3MF_uint64* pPropertiesArrayNeededCount, sLib3MFTriangleProperties * pPropertiesArrayBuffer); +typedef Lib3MFResult (*PLib3MFMetaDataGroup_GetMetaDataPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex, Lib3MF_MetaData * pMetaData); /** -* Clears all properties of this mesh object (triangle and object-level). +* returns a metadata value within this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] pNameSpace - the namespace of the metadata +* @param[in] pName - the name of the Metadata +* @param[out] pMetaData - an instance of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_ClearAllPropertiesPtr) (Lib3MF_MeshObject pMeshObject); +typedef Lib3MFResult (*PLib3MFMetaDataGroup_GetMetaDataByKeyPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, Lib3MF_MetaData * pMetaData); /** -* Set all triangles of a mesh object +* removes metadata by index from the model. * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[in] pVerticesBuffer - Position buffer of contains the positions. -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[in] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] nIndex - Index of the metadata to remove * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_SetGeometryPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nVerticesBufferSize, const sLib3MFPosition * pVerticesBuffer, Lib3MF_uint64 nIndicesBufferSize, const sLib3MFTriangle * pIndicesBuffer); +typedef Lib3MFResult (*PLib3MFMetaDataGroup_RemoveMetaDataByIndexPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex); /** -* Retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. +* removes metadata from the model. * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pIsManifoldAndOriented - returns, if the object is oriented and manifold. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] pTheMetaData - The metadata to remove * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_IsManifoldAndOrientedPtr) (Lib3MF_MeshObject pMeshObject, bool * pIsManifoldAndOriented); +typedef Lib3MFResult (*PLib3MFMetaDataGroup_RemoveMetaDataPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_MetaData pTheMetaData); /** -* Retrieves the BeamLattice within this MeshObject. +* adds a new metadata to this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pTheBeamLattice - the BeamLattice within this MeshObject +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] pNameSpace - the namespace of the metadata +* @param[in] pName - the name of the metadata +* @param[in] pValue - the value of the metadata +* @param[in] pType - the type of the metadata +* @param[in] bMustPreserve - shuold the metadata be preserved +* @param[out] pMetaData - a new instance of the metadata * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMeshObject_BeamLatticePtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_BeamLattice * pTheBeamLattice); +typedef Lib3MFResult (*PLib3MFMetaDataGroup_AddMetaDataPtr) (Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, const char * pValue, const char * pType, bool bMustPreserve, Lib3MF_MetaData * pMetaData); /************************************************************************************************************************* - Class definition for BeamLattice + Class definition for Object **************************************************************************************************************************/ /** -* Returns the minimal length of beams for the beamlattice. +* Retrieves an object's type * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pMinLength - minimal length of beams for the beamlattice +* @param[in] pObject - Object instance. +* @param[out] pObjectType - returns object type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetMinLengthPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_double * pMinLength); +typedef Lib3MFResult (*PLib3MFObject_GetTypePtr) (Lib3MF_Object pObject, eLib3MFObjectType * pObjectType); /** -* Sets the minimal length of beams for the beamlattice. +* Sets an object's type * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] dMinLength - minimal length of beams for the beamlattice +* @param[in] pObject - Object instance. +* @param[in] eObjectType - object type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetMinLengthPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_double dMinLength); +typedef Lib3MFResult (*PLib3MFObject_SetTypePtr) (Lib3MF_Object pObject, eLib3MFObjectType eObjectType); /** -* Returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* Retrieves an object's name * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pClipMode - contains the clip mode of this mesh -* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object or an undefined value if pClipMode is MODELBEAMLATTICECLIPMODE_NONE +* @param[in] pObject - Object instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns object name., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetClippingPtr) (Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode * pClipMode, Lib3MF_uint32 * pUniqueResourceID); +typedef Lib3MFResult (*PLib3MFObject_GetNamePtr) (Lib3MF_Object pObject, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* Sets an object's name string * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] eClipMode - contains the clip mode of this mesh -* @param[in] nUniqueResourceID - the UniqueResourceID of the clipping mesh-object. This mesh-object has to be defined before setting the Clipping. +* @param[in] pObject - Object instance. +* @param[in] pName - new object name. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetClippingPtr) (Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode eClipMode, Lib3MF_uint32 nUniqueResourceID); +typedef Lib3MFResult (*PLib3MFObject_SetNamePtr) (Lib3MF_Object pObject, const char * pName); /** -* Returns the representation-mesh for the beamlattice of this mesh. +* Retrieves an object's part number * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pHasRepresentation - flag whether the beamlattice has a representation mesh. -* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object. +* @param[in] pObject - Object instance. +* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartNumberBuffer - buffer of returns object part number., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetRepresentationPtr) (Lib3MF_BeamLattice pBeamLattice, bool * pHasRepresentation, Lib3MF_uint32 * pUniqueResourceID); +typedef Lib3MFResult (*PLib3MFObject_GetPartNumberPtr) (Lib3MF_Object pObject, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); /** -* Sets the representation-mesh for the beamlattice of this mesh. +* Sets an objects partnumber string * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nUniqueResourceID - the UniqueResourceID of the representation mesh-object. This mesh-object has to be defined before setting the representation. +* @param[in] pObject - Object instance. +* @param[in] pPartNumber - new object part number. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetRepresentationPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nUniqueResourceID); +typedef Lib3MFResult (*PLib3MFObject_SetPartNumberPtr) (Lib3MF_Object pObject, const char * pPartNumber); /** -* Returns the ball mode and the default ball radius for the beamlattice of this mesh. +* Retrieves, if an object is a mesh object * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pBallMode - contains the ball mode of this mesh -* @param[out] pBallRadius - default ball radius of balls for the beamlattice +* @param[in] pObject - Object instance. +* @param[out] pIsMeshObject - returns, whether the object is a mesh object * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallOptionsPtr) (Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode * pBallMode, Lib3MF_double * pBallRadius); +typedef Lib3MFResult (*PLib3MFObject_IsMeshObjectPtr) (Lib3MF_Object pObject, bool * pIsMeshObject); /** -* Sets the ball mode and thedefault ball radius for the beamlattice. +* Retrieves, if an object is a components object * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] eBallMode - contains the ball mode of this mesh -* @param[in] dBallRadius - default ball radius of balls for the beamlattice +* @param[in] pObject - Object instance. +* @param[out] pIsComponentsObject - returns, whether the object is a components object * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetBallOptionsPtr) (Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode eBallMode, Lib3MF_double dBallRadius); +typedef Lib3MFResult (*PLib3MFObject_IsComponentsObjectPtr) (Lib3MF_Object pObject, bool * pIsComponentsObject); /** -* Returns the beam count of a mesh object. +* Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pCount - filled with the beam count. +* @param[in] pObject - Object instance. +* @param[out] pIsValid - returns whether the object is a valid object description * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamCountPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFObject_IsValidPtr) (Lib3MF_Object pObject, bool * pIsValid); /** -* Returns indices, radii and capmodes of a single beam of a mesh object. +* Use an existing attachment as thumbnail for this object * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the beam (0 to beamcount - 1). -* @param[out] pBeamInfo - filled with the beam indices, radii and capmodes. +* @param[in] pObject - Object instance. +* @param[in] pAttachment - Instance of a new or the existing thumbnailattachment object. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBeam * pBeamInfo); +typedef Lib3MFResult (*PLib3MFObject_SetAttachmentAsThumbnailPtr) (Lib3MF_Object pObject, Lib3MF_Attachment pAttachment); /** -* Adds a single beam to a mesh object. +* Get the attachment containing the object thumbnail. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] pBeamInfo - contains the node indices, radii and capmodes. -* @param[out] pIndex - filled with the new Index of the beam. +* @param[in] pObject - Object instance. +* @param[out] pAttachment - Instance of the thumbnailattachment object or NULL. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_AddBeamPtr) (Lib3MF_BeamLattice pBeamLattice, const sLib3MFBeam * pBeamInfo, Lib3MF_uint32 * pIndex); +typedef Lib3MFResult (*PLib3MFObject_GetThumbnailAttachmentPtr) (Lib3MF_Object pObject, Lib3MF_Attachment * pAttachment); /** -* Sets the indices, radii and capmodes of a single beam of a mesh object. +* Clears the attachment. The attachment instance is not removed from the package. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the beam (0 to beamcount - 1). -* @param[in] pBeamInfo - filled with the beam indices, radii and capmodes. +* @param[in] pObject - Object instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetBeamPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBeam * pBeamInfo); +typedef Lib3MFResult (*PLib3MFObject_ClearThumbnailAttachmentPtr) (Lib3MF_Object pObject); /** -* Sets all beam indices, radii and capmodes of a mesh object. +* Returns the outbox of a build item * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBeamInfoBufferSize - Number of elements in buffer -* @param[in] pBeamInfoBuffer - Beam buffer of contains information of a number of beams +* @param[in] pObject - Object instance. +* @param[out] pOutbox - Outbox of this build item * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetBeamsPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBeamInfoBufferSize, const sLib3MFBeam * pBeamInfoBuffer); +typedef Lib3MFResult (*PLib3MFObject_GetOutboxPtr) (Lib3MF_Object pObject, sLib3MFBox * pOutbox); + +/** +* Retrieves an object's uuid string (see production extension specification) +* +* @param[in] pObject - Object instance. +* @param[out] pHasUUID - flag whether the build item has a UUID +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of returns object uuid., may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_GetUUIDPtr) (Lib3MF_Object pObject, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); + +/** +* Sets a build object's uuid string (see production extension specification) +* +* @param[in] pObject - Object instance. +* @param[in] pUUID - new object uuid string. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_SetUUIDPtr) (Lib3MF_Object pObject, const char * pUUID); + +/** +* Returns the metadatagroup of this object +* +* @param[in] pObject - Object instance. +* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_GetMetaDataGroupPtr) (Lib3MF_Object pObject, Lib3MF_MetaDataGroup * pMetaDataGroup); + +/** +* set the meshresolution of the mesh object +* +* @param[in] pObject - Object instance. +* @param[in] eMeshResolution - meshresolution of this object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_SetSlicesMeshResolutionPtr) (Lib3MF_Object pObject, eLib3MFSlicesMeshResolution eMeshResolution); + +/** +* get the meshresolution of the mesh object +* +* @param[in] pObject - Object instance. +* @param[out] pMeshResolution - meshresolution of this object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_GetSlicesMeshResolutionPtr) (Lib3MF_Object pObject, eLib3MFSlicesMeshResolution * pMeshResolution); + +/** +* returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack +* +* @param[in] pObject - Object instance. +* @param[in] bRecursive - check also all referenced objects? +* @param[out] pHasSlices - does the object have a slice stack? +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_HasSlicesPtr) (Lib3MF_Object pObject, bool bRecursive, bool * pHasSlices); + +/** +* unlinks the attached slicestack from this object. If no slice stack is attached, do noting. +* +* @param[in] pObject - Object instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_ClearSliceStackPtr) (Lib3MF_Object pObject); + +/** +* get the Slicestack attached to the object +* +* @param[in] pObject - Object instance. +* @param[out] pSliceStackInstance - returns the slicestack instance +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_GetSliceStackPtr) (Lib3MF_Object pObject, Lib3MF_SliceStack * pSliceStackInstance); + +/** +* assigns a slicestack to the object +* +* @param[in] pObject - Object instance. +* @param[in] pSliceStackInstance - the new slice stack of this Object +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFObject_AssignSliceStackPtr) (Lib3MF_Object pObject, Lib3MF_SliceStack pSliceStackInstance); + +/************************************************************************************************************************* + Class definition for MeshObject +**************************************************************************************************************************/ + +/** +* Returns the vertex count of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pVertexCount - filled with the vertex count. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetVertexCountPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); + +/** +* Returns the triangle count of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pVertexCount - filled with the triangle count. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetTriangleCountPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); + +/** +* Returns the vertex count of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) +* @param[out] pCoordinates - filled with the vertex coordinates. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetVertexPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFPosition * pCoordinates); + +/** +* Sets the coordinates of a single vertex of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) +* @param[in] pCoordinates - contains the vertex coordinates. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_SetVertexPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFPosition * pCoordinates); + +/** +* Adds a single vertex to a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] pCoordinates - contains the vertex coordinates. +* @param[out] pNewIndex - Index of the new vertex +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_AddVertexPtr) (Lib3MF_MeshObject pMeshObject, const sLib3MFPosition * pCoordinates, Lib3MF_uint32 * pNewIndex); + +/** +* Obtains all vertex positions of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pVerticesBuffer - Position buffer of contains the vertex coordinates. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetVerticesPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, sLib3MFPosition * pVerticesBuffer); + +/** +* Returns indices of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[out] pIndices - filled with the triangle indices. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetTrianglePtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFTriangle * pIndices); + +/** +* Sets the indices of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[in] pIndices - contains the triangle indices. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_SetTrianglePtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFTriangle * pIndices); + +/** +* Adds a single triangle to a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] pIndices - contains the triangle indices. +* @param[out] pNewIndex - Index of the new triangle +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_AddTrianglePtr) (Lib3MF_MeshObject pMeshObject, const sLib3MFTriangle * pIndices, Lib3MF_uint32 * pNewIndex); + +/** +* Get all triangles of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetTriangleIndicesPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, sLib3MFTriangle * pIndicesBuffer); + +/** +* Sets the property at the object-level of the mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nUniqueResourceID - the object-level Property UniqueResourceID. +* @param[in] nPropertyID - the object-level PropertyID. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_SetObjectLevelPropertyPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nUniqueResourceID, Lib3MF_uint32 nPropertyID); + +/** +* Gets the property at the object-level of the mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pUniqueResourceID - the object-level Property UniqueResourceID. +* @param[out] pPropertyID - the object-level PropertyID. +* @param[out] pHasObjectLevelProperty - Has an object-level property been specified? +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetObjectLevelPropertyPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pUniqueResourceID, Lib3MF_uint32 * pPropertyID, bool * pHasObjectLevelProperty); + +/** +* Sets the properties of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[in] pProperties - contains the triangle properties. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_SetTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFTriangleProperties * pProperties); + +/** +* Gets the properties of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[out] pProperty - returns the triangle properties. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFTriangleProperties * pProperty); + +/** +* Sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer +* @param[in] pPropertiesArrayBuffer - TriangleProperties buffer of contains the triangle properties array. Must have trianglecount elements. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_SetAllTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nPropertiesArrayBufferSize, const sLib3MFTriangleProperties * pPropertiesArrayBuffer); + +/** +* Gets the properties of all triangles of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer +* @param[out] pPropertiesArrayNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertiesArrayBuffer - TriangleProperties buffer of returns the triangle properties array. Must have trianglecount elements. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_GetAllTrianglePropertiesPtr) (Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nPropertiesArrayBufferSize, Lib3MF_uint64* pPropertiesArrayNeededCount, sLib3MFTriangleProperties * pPropertiesArrayBuffer); + +/** +* Clears all properties of this mesh object (triangle and object-level). +* +* @param[in] pMeshObject - MeshObject instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_ClearAllPropertiesPtr) (Lib3MF_MeshObject pMeshObject); + +/** +* Set all triangles of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[in] pVerticesBuffer - Position buffer of contains the positions. +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[in] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_SetGeometryPtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nVerticesBufferSize, const sLib3MFPosition * pVerticesBuffer, Lib3MF_uint64 nIndicesBufferSize, const sLib3MFTriangle * pIndicesBuffer); + +/** +* Retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pIsManifoldAndOriented - returns, if the object is oriented and manifold. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_IsManifoldAndOrientedPtr) (Lib3MF_MeshObject pMeshObject, bool * pIsManifoldAndOriented); + +/** +* Retrieves the BeamLattice within this MeshObject. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pTheBeamLattice - the BeamLattice within this MeshObject +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMeshObject_BeamLatticePtr) (Lib3MF_MeshObject pMeshObject, Lib3MF_BeamLattice * pTheBeamLattice); + +/************************************************************************************************************************* + Class definition for BeamLattice +**************************************************************************************************************************/ + +/** +* Returns the minimal length of beams for the beamlattice. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pMinLength - minimal length of beams for the beamlattice +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetMinLengthPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_double * pMinLength); + +/** +* Sets the minimal length of beams for the beamlattice. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] dMinLength - minimal length of beams for the beamlattice +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetMinLengthPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_double dMinLength); + +/** +* Returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pClipMode - contains the clip mode of this mesh +* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object or an undefined value if pClipMode is MODELBEAMLATTICECLIPMODE_NONE +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetClippingPtr) (Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode * pClipMode, Lib3MF_uint32 * pUniqueResourceID); + +/** +* Sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] eClipMode - contains the clip mode of this mesh +* @param[in] nUniqueResourceID - the UniqueResourceID of the clipping mesh-object. This mesh-object has to be defined before setting the Clipping. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetClippingPtr) (Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode eClipMode, Lib3MF_uint32 nUniqueResourceID); + +/** +* Returns the representation-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pHasRepresentation - flag whether the beamlattice has a representation mesh. +* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetRepresentationPtr) (Lib3MF_BeamLattice pBeamLattice, bool * pHasRepresentation, Lib3MF_uint32 * pUniqueResourceID); + +/** +* Sets the representation-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nUniqueResourceID - the UniqueResourceID of the representation mesh-object. This mesh-object has to be defined before setting the representation. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetRepresentationPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nUniqueResourceID); + +/** +* Returns the ball mode and the default ball radius for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pBallMode - contains the ball mode of this mesh +* @param[out] pBallRadius - default ball radius of balls for the beamlattice +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallOptionsPtr) (Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode * pBallMode, Lib3MF_double * pBallRadius); + +/** +* Sets the ball mode and thedefault ball radius for the beamlattice. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] eBallMode - contains the ball mode of this mesh +* @param[in] dBallRadius - default ball radius of balls for the beamlattice +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetBallOptionsPtr) (Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode eBallMode, Lib3MF_double dBallRadius); + +/** +* Returns the beam count of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pCount - filled with the beam count. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamCountPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); + +/** +* Returns indices, radii and capmodes of a single beam of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the beam (0 to beamcount - 1). +* @param[out] pBeamInfo - filled with the beam indices, radii and capmodes. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBeam * pBeamInfo); + +/** +* Adds a single beam to a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] pBeamInfo - contains the node indices, radii and capmodes. +* @param[out] pIndex - filled with the new Index of the beam. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_AddBeamPtr) (Lib3MF_BeamLattice pBeamLattice, const sLib3MFBeam * pBeamInfo, Lib3MF_uint32 * pIndex); + +/** +* Sets the indices, radii and capmodes of a single beam of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the beam (0 to beamcount - 1). +* @param[in] pBeamInfo - filled with the beam indices, radii and capmodes. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetBeamPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBeam * pBeamInfo); + +/** +* Sets all beam indices, radii and capmodes of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBeamInfoBufferSize - Number of elements in buffer +* @param[in] pBeamInfoBuffer - Beam buffer of contains information of a number of beams +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetBeamsPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBeamInfoBufferSize, const sLib3MFBeam * pBeamInfoBuffer); + +/** +* obtains all beam indices, radii and capmodes of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBeamInfoBufferSize - Number of elements in buffer +* @param[out] pBeamInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBeamInfoBuffer - Beam buffer of contains information of all beams +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamsPtr) (Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBeamInfoBufferSize, Lib3MF_uint64* pBeamInfoNeededCount, sLib3MFBeam * pBeamInfoBuffer); + +/** +* Returns the ball count of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pCount - filled with the ball count. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallCountPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); + +/** +* Returns index and radius of a single ball of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the ball (0 to ballcount - 1). +* @param[out] pBallInfo - filled with the ball node index and radius. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBall * pBallInfo); + +/** +* Adds a single ball to a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] pBallInfo - contains the node index and radius. +* @param[out] pIndex - filled with the new Index of the ball. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_AddBallPtr) (Lib3MF_BeamLattice pBeamLattice, const sLib3MFBall * pBallInfo, Lib3MF_uint32 * pIndex); + +/** +* Sets the index and radius of a single ball of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the ball (0 to ballcount - 1). +* @param[in] pBallInfo - filled with the ball node index and radius. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetBallPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBall * pBallInfo); + +/** +* Sets all ball indices and radii of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBallInfoBufferSize - Number of elements in buffer +* @param[in] pBallInfoBuffer - Ball buffer of contains information of a number of balls +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_SetBallsPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBallInfoBufferSize, const sLib3MFBall * pBallInfoBuffer); + +/** +* obtains all ball indices and radii of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBallInfoBufferSize - Number of elements in buffer +* @param[out] pBallInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBallInfoBuffer - Ball buffer of contains information of all balls +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallsPtr) (Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBallInfoBufferSize, Lib3MF_uint64* pBallInfoNeededCount, sLib3MFBall * pBallInfoBuffer); + +/** +* Returns the number of beamsets of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pCount - filled with the beamset count. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamSetCountPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); + +/** +* Adds an empty beamset to a mesh object +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pBeamSet - the new beamset +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_AddBeamSetPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_BeamSet * pBeamSet); + +/** +* Returns a beamset of a mesh object +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - index of the requested beamset (0 ... beamsetcount-1). +* @param[out] pBeamSet - the requested beamset +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamSetPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF_BeamSet * pBeamSet); + +/************************************************************************************************************************* + Class definition for Component +**************************************************************************************************************************/ + +/** +* Returns the Resource Instance of the component. +* +* @param[in] pComponent - Component instance. +* @param[out] pObjectResource - filled with the Resource Instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_GetObjectResourcePtr) (Lib3MF_Component pComponent, Lib3MF_Object * pObjectResource); + +/** +* Returns the UniqueResourceID of the component. +* +* @param[in] pComponent - Component instance. +* @param[out] pUniqueResourceID - returns the UniqueResourceID. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_GetObjectResourceIDPtr) (Lib3MF_Component pComponent, Lib3MF_uint32 * pUniqueResourceID); + +/** +* returns, whether a component has a UUID and, if true, the component's UUID +* +* @param[in] pComponent - Component instance. +* @param[out] pHasUUID - flag whether the component has a UUID +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_GetUUIDPtr) (Lib3MF_Component pComponent, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); + +/** +* sets the component's UUID +* +* @param[in] pComponent - Component instance. +* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_SetUUIDPtr) (Lib3MF_Component pComponent, const char * pUUID); + +/** +* Returns, if the component has a different transformation than the identity matrix +* +* @param[in] pComponent - Component instance. +* @param[out] pHasTransform - if true is returned, the transformation is not equal than the identity +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_HasTransformPtr) (Lib3MF_Component pComponent, bool * pHasTransform); + +/** +* Returns the transformation matrix of the component. +* +* @param[in] pComponent - Component instance. +* @param[out] pTransform - filled with the component transformation matrix +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_GetTransformPtr) (Lib3MF_Component pComponent, sLib3MFTransform * pTransform); + +/** +* Sets the transformation matrix of the component. +* +* @param[in] pComponent - Component instance. +* @param[in] pTransform - new transformation matrix +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponent_SetTransformPtr) (Lib3MF_Component pComponent, const sLib3MFTransform * pTransform); + +/************************************************************************************************************************* + Class definition for ComponentsObject +**************************************************************************************************************************/ + +/** +* Adds a new component to a components object. +* +* @param[in] pComponentsObject - ComponentsObject instance. +* @param[in] pObjectResource - object to add as component. Must not lead to circular references! +* @param[in] pTransform - optional transform matrix for the component. +* @param[out] pComponentInstance - new component instance +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponentsObject_AddComponentPtr) (Lib3MF_ComponentsObject pComponentsObject, Lib3MF_Object pObjectResource, const sLib3MFTransform * pTransform, Lib3MF_Component * pComponentInstance); + +/** +* Retrieves a component from a component object. +* +* @param[in] pComponentsObject - ComponentsObject instance. +* @param[in] nIndex - index of the component to retrieve (0 to componentcount - 1) +* @param[out] pComponentInstance - component instance +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponentsObject_GetComponentPtr) (Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 nIndex, Lib3MF_Component * pComponentInstance); + +/** +* Retrieves a component count of a component object. +* +* @param[in] pComponentsObject - ComponentsObject instance. +* @param[out] pCount - returns the component count +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFComponentsObject_GetComponentCountPtr) (Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 * pCount); + +/************************************************************************************************************************* + Class definition for BeamSet +**************************************************************************************************************************/ + +/** +* Sets a beamset's name string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] pName - new name of the beamset. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_SetNamePtr) (Lib3MF_BeamSet pBeamSet, const char * pName); + +/** +* Retrieves a beamset's name string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the beamset., may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_GetNamePtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); + +/** +* Sets a beamset's identifier string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] pIdentifier - new name of the beamset. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_SetIdentifierPtr) (Lib3MF_BeamSet pBeamSet, const char * pIdentifier); + +/** +* Retrieves a beamset's identifier string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nIdentifierBufferSize - size of the buffer (including trailing 0) +* @param[out] pIdentifierNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pIdentifierBuffer - buffer of returns the identifier of the beamset., may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_GetIdentifierPtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer); + +/** +* Retrieves the reference count of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[out] pCount - returns the reference count +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_GetReferenceCountPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); + +/** +* Sets the references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nReferencesBufferSize - Number of elements in buffer +* @param[in] pReferencesBuffer - uint32 buffer of the new indices of all beams in this beamset +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_SetReferencesPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nReferencesBufferSize, const Lib3MF_uint32 * pReferencesBuffer); + +/** +* Retrieves the references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nReferencesBufferSize - Number of elements in buffer +* @param[out] pReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pReferencesBuffer - uint32 buffer of retrieves the indices of all beams in this beamset +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_GetReferencesPtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nReferencesBufferSize, Lib3MF_uint64* pReferencesNeededCount, Lib3MF_uint32 * pReferencesBuffer); + +/** +* Retrieves the ball reference count of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[out] pCount - returns the ball reference count +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_GetBallReferenceCountPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); + +/** +* Sets the ball references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nBallReferencesBufferSize - Number of elements in buffer +* @param[in] pBallReferencesBuffer - uint32 buffer of the new indices of all balls in this beamset +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_SetBallReferencesPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nBallReferencesBufferSize, const Lib3MF_uint32 * pBallReferencesBuffer); + +/** +* Retrieves the ball references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nBallReferencesBufferSize - Number of elements in buffer +* @param[out] pBallReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBallReferencesBuffer - uint32 buffer of retrieves the indices of all balls in this beamset +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBeamSet_GetBallReferencesPtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nBallReferencesBufferSize, Lib3MF_uint64* pBallReferencesNeededCount, Lib3MF_uint32 * pBallReferencesBuffer); + +/************************************************************************************************************************* + Class definition for BaseMaterialGroup +**************************************************************************************************************************/ + +/** +* Retrieves the count of base materials in the material group. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[out] pCount - returns the count of base materials. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetCountPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all materials in this group +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the material in the material group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetAllPropertyIDsPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Adds a new material to the material group +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] pName - new name of the base material. +* @param[in] pDisplayColor - Display color of the material +* @param[out] pPropertyID - returns new PropertyID of the new material in the material group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_AddMaterialPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const char * pName, const sLib3MFColor * pDisplayColor, Lib3MF_uint32 * pPropertyID); + +/** +* Removes a material from the material group. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_RemoveMaterialPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID); + +/** +* Returns the base material's name +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the base material., may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetNamePtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); + +/** +* Sets a base material's name +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] pName - new name of the base material. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_SetNamePtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const char * pName); + +/** +* Sets a base material's display color. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] pTheColor - The base material's display color +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_SetDisplayColorPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor); + +/** +* Returns a base material's display color. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[out] pTheColor - The base material's display color +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetDisplayColorPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor); + +/************************************************************************************************************************* + Class definition for ColorGroup +**************************************************************************************************************************/ + +/** +* Retrieves the count of base materials in this Color Group. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[out] pCount - returns the count of colors within this color group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFColorGroup_GetCountPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all colors within this group +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the color in the color group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFColorGroup_GetAllPropertyIDsPtr) (Lib3MF_ColorGroup pColorGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Adds a new value. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] pTheColor - The new color +* @param[out] pPropertyID - PropertyID of the new color within this color group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFColorGroup_AddColorPtr) (Lib3MF_ColorGroup pColorGroup, const sLib3MFColor * pTheColor, Lib3MF_uint32 * pPropertyID); + +/** +* Removes a color from the color group. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyID - PropertyID of the color to be removed from the color group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFColorGroup_RemoveColorPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID); + +/** +* Sets a color value. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyID - PropertyID of a color within this color group. +* @param[in] pTheColor - The color +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFColorGroup_SetColorPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor); + +/** +* Sets a color value. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyID - PropertyID of a color within this color group. +* @param[out] pTheColor - The color +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFColorGroup_GetColorPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor); + +/************************************************************************************************************************* + Class definition for Texture2DGroup +**************************************************************************************************************************/ + +/** +* Retrieves the count of tex2coords in the Texture2DGroup. +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[out] pCount - returns the count of tex2coords. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetCountPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all tex2coords in this Texture2DGroup +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the tex2coords in the Texture2DGroup. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetAllPropertyIDsPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Adds a new tex2coord to the Texture2DGroup +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. +* @param[out] pPropertyID - returns new PropertyID of the new tex2coord in the Texture2DGroup. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFTexture2DGroup_AddTex2CoordPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, const sLib3MFTex2Coord * pUVCoordinate, Lib3MF_uint32 * pPropertyID); + +/** +* Obtains a tex2coord to the Texture2DGroup +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] nPropertyID - the PropertyID of the tex2coord in the Texture2DGroup. +* @param[out] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetTex2CoordPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID, sLib3MFTex2Coord * pUVCoordinate); + +/** +* Removes a tex2coords from the Texture2DGroup. +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] nPropertyID - PropertyID of the tex2coords in the Texture2DGroup. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFTexture2DGroup_RemoveTex2CoordPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID); + +/** +* Obtains the texture2D instance of this group. +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[out] pTexture2DInstance - the texture2D instance of this group. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetTexture2DPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_Texture2D * pTexture2DInstance); + +/************************************************************************************************************************* + Class definition for CompositeMaterials +**************************************************************************************************************************/ + +/** +* Retrieves the count of Composite-s in the CompositeMaterials. +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[out] pCount - returns the count of Composite-s +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetCountPtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the Composite-Mixing Values in the CompositeMaterials. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetAllPropertyIDsPtr) (Lib3MF_CompositeMaterials pCompositeMaterials, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Obtains the BaseMaterialGroup instance of this CompositeMaterials. +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[out] pBaseMaterialGroupInstance - returns the BaseMaterialGroup instance of this CompositeMaterials +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetBaseMaterialGroupPtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance); + +/** +* Adds a new Composite-Mixing Values to the CompositeMaterials. +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nCompositeBufferSize - Number of elements in buffer +* @param[in] pCompositeBuffer - CompositeConstituent buffer of The Composite Constituents to be added as composite +* @param[out] pPropertyID - returns new PropertyID of the new Composite in the CompositeMaterials. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFCompositeMaterials_AddCompositePtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint64 nCompositeBufferSize, const sLib3MFCompositeConstituent * pCompositeBuffer, Lib3MF_uint32 * pPropertyID); /** -* obtains all beam indices, radii and capmodes of a mesh object. +* Removes a Composite-Maxing Ratio from the CompositeMaterials. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBeamInfoBufferSize - Number of elements in buffer -* @param[out] pBeamInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBeamInfoBuffer - Beam buffer of contains information of all beams +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nPropertyID - PropertyID of the Composite-Mixing Values in the CompositeMaterials to be removed. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamsPtr) (Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBeamInfoBufferSize, Lib3MF_uint64* pBeamInfoNeededCount, sLib3MFBeam * pBeamInfoBuffer); +typedef Lib3MFResult (*PLib3MFCompositeMaterials_RemoveCompositePtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID); /** -* Returns the ball count of a mesh object. +* Obtains a Composite-Maxing Ratio of this CompositeMaterials. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pCount - filled with the ball count. +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nPropertyID - the PropertyID of the Composite-Maxing Ratio in the CompositeMaterials. +* @param[in] nCompositeBufferSize - Number of elements in buffer +* @param[out] pCompositeNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pCompositeBuffer - CompositeConstituent buffer of The Composite-Mixing Values with the given PropertyID * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallCountPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetCompositePtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nCompositeBufferSize, Lib3MF_uint64* pCompositeNeededCount, sLib3MFCompositeConstituent * pCompositeBuffer); + +/************************************************************************************************************************* + Class definition for MultiPropertyGroup +**************************************************************************************************************************/ /** -* Returns index and radius of a single ball of a mesh object. +* Retrieves the count of MultiProperty-s in the MultiPropertyGroup. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the ball (0 to ballcount - 1). -* @param[out] pBallInfo - filled with the ball node index and radius. +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[out] pCount - returns the count of MultiProperty-s * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBall * pBallInfo); +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetCountPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); /** -* Adds a single ball to a mesh object. +* returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] pBallInfo - contains the node index and radius. -* @param[out] pIndex - filled with the new Index of the ball. +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the MultiProperty-s in the MultiPropertyGroup. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_AddBallPtr) (Lib3MF_BeamLattice pBeamLattice, const sLib3MFBall * pBallInfo, Lib3MF_uint32 * pIndex); +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetAllPropertyIDsPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); /** -* Sets the index and radius of a single ball of a mesh object. +* Adds a new MultiProperty to the MultiPropertyGroup. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the ball (0 to ballcount - 1). -* @param[in] pBallInfo - filled with the ball node index and radius. +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[in] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the new MultiProperty. +* @param[out] pPropertyID - returns the PropertyID of the new MultiProperty in the MultiPropertyGroup. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetBallPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBall * pBallInfo); +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_AddMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer, Lib3MF_uint32 * pPropertyID); /** -* Sets all ball indices and radii of a mesh object. +* Sets the PropertyIDs of a MultiProperty. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBallInfoBufferSize - Number of elements in buffer -* @param[in] pBallInfoBuffer - Ball buffer of contains information of a number of balls +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyID - the PropertyID of the MultiProperty to be changed. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[in] pPropertyIDsBuffer - uint32 buffer of The new PropertyIDs of the MultiProperty * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_SetBallsPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBallInfoBufferSize, const sLib3MFBall * pBallInfoBuffer); +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_SetMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer); /** -* obtains all ball indices and radii of a mesh object. +* Obtains the PropertyIDs of a MultiProperty. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBallInfoBufferSize - Number of elements in buffer -* @param[out] pBallInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBallInfoBuffer - Ball buffer of contains information of all balls +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyID - the PropertyID of the MultiProperty to be queried. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the MultiProperty +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Removes a MultiProperty from this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyID - the PropertyID of the MultiProperty to be removed. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_RemoveMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID); + +/** +* Retrieves the number of layers of this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[out] pCount - returns the number of layers +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetLayerCountPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); + +/** +* Adds a MultiPropertyLayer to this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] pTheLayer - The MultiPropertyLayer to add to this MultiPropertyGroup +* @param[out] pLayerIndex - returns the index of this MultiPropertyLayer +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_AddLayerPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const sLib3MFMultiPropertyLayer * pTheLayer, Lib3MF_uint32 * pLayerIndex); + +/** +* Obtains a MultiPropertyLayer of this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nLayerIndex - The Index of the MultiPropertyLayer queried +* @param[out] pTheLayer - The MultiPropertyLayer with index LayerIndex within MultiPropertyGroup +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetLayerPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex, sLib3MFMultiPropertyLayer * pTheLayer); + +/** +* Removes a MultiPropertyLayer from this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nLayerIndex - The Index of the MultiPropertyLayer to be removed +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_RemoveLayerPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex); + +/************************************************************************************************************************* + Class definition for Attachment +**************************************************************************************************************************/ + +/** +* Retrieves an attachment's package path. This function will be removed in a later release. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of returns the attachment's package path string, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_GetPathPtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Sets an attachment's package path. This function will be removed in a later release. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pPath - new path of the attachment. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_SetPathPtr) (Lib3MF_Attachment pAttachment, const char * pPath); + +/** +* Returns the PackagePart that is this attachment. +* +* @param[in] pAttachment - Attachment instance. +* @param[out] pPackagePart - The PackagePart of this attachment. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_PackagePartPtr) (Lib3MF_Attachment pAttachment, Lib3MF_PackagePart * pPackagePart); + +/** +* Retrieves an attachment's relationship type +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of returns the attachment's package relationship type string, may be NULL +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_GetRelationShipTypePtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Sets an attachment's relationship type. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pPath - new relationship type string. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_SetRelationShipTypePtr) (Lib3MF_Attachment pAttachment, const char * pPath); + +/** +* Writes out the attachment as file. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pFileName - file to write into. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_WriteToFilePtr) (Lib3MF_Attachment pAttachment, const char * pFileName); + +/** +* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pFileName - file to read from. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_ReadFromFilePtr) (Lib3MF_Attachment pAttachment, const char * pFileName); + +/** +* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pTheReadCallback - Callback to call for reading a data chunk +* @param[in] nStreamSize - number of bytes the callback returns +* @param[in] pTheSeekCallback - Callback to call for seeking in the stream. +* @param[in] pUserData - Userdata that is passed to the callback function +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_ReadFromCallbackPtr) (Lib3MF_Attachment pAttachment, Lib3MFReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MFSeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData); + +/** +* Retrieves the size of the attachment stream +* +* @param[in] pAttachment - Attachment instance. +* @param[out] pStreamSize - the stream size +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_GetStreamSizePtr) (Lib3MF_Attachment pAttachment, Lib3MF_uint64 * pStreamSize); + +/** +* Writes out the attachment into a buffer +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nBufferBufferSize - Number of elements in buffer +* @param[out] pBufferNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBufferBuffer - uint8 buffer of Buffer to write into +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_WriteToBufferPtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer); + +/** +* Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nBufferBufferSize - Number of elements in buffer +* @param[in] pBufferBuffer - uint8 buffer of Buffer to read from +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFAttachment_ReadFromBufferPtr) (Lib3MF_Attachment pAttachment, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer); + +/************************************************************************************************************************* + Class definition for Texture2D +**************************************************************************************************************************/ + +/** +* Retrieves the attachment located at the path of the texture. +* +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pAttachment - attachment that holds the texture's image information. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBallsPtr) (Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBallInfoBufferSize, Lib3MF_uint64* pBallInfoNeededCount, sLib3MFBall * pBallInfoBuffer); +typedef Lib3MFResult (*PLib3MFTexture2D_GetAttachmentPtr) (Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment * pAttachment); /** -* Returns the number of beamsets of a mesh object. +* Sets the texture's package path to the path of the attachment. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pCount - filled with the beamset count. +* @param[in] pTexture2D - Texture2D instance. +* @param[in] pAttachment - attachment that holds the texture's image information. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamSetCountPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFTexture2D_SetAttachmentPtr) (Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment pAttachment); /** -* Adds an empty beamset to a mesh object +* Retrieves a texture's content type. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pBeamSet - the new beamset +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pContentType - returns content type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_AddBeamSetPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_BeamSet * pBeamSet); +typedef Lib3MFResult (*PLib3MFTexture2D_GetContentTypePtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureType * pContentType); /** -* Returns a beamset of a mesh object +* Retrieves a texture's content type. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - index of the requested beamset (0 ... beamsetcount-1). -* @param[out] pBeamSet - the requested beamset +* @param[in] pTexture2D - Texture2D instance. +* @param[in] eContentType - new Content Type * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamLattice_GetBeamSetPtr) (Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF_BeamSet * pBeamSet); - -/************************************************************************************************************************* - Class definition for Component -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFTexture2D_SetContentTypePtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureType eContentType); /** -* Returns the Resource Instance of the component. +* Retrieves a texture's tilestyle type. * -* @param[in] pComponent - Component instance. -* @param[out] pObjectResource - filled with the Resource Instance. +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pTileStyleU - returns tilestyle type enum. +* @param[out] pTileStyleV - returns tilestyle type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_GetObjectResourcePtr) (Lib3MF_Component pComponent, Lib3MF_Object * pObjectResource); +typedef Lib3MFResult (*PLib3MFTexture2D_GetTileStyleUVPtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle * pTileStyleU, eLib3MFTextureTileStyle * pTileStyleV); /** -* Returns the UniqueResourceID of the component. +* Sets a texture's tilestyle type. * -* @param[in] pComponent - Component instance. -* @param[out] pUniqueResourceID - returns the UniqueResourceID. +* @param[in] pTexture2D - Texture2D instance. +* @param[in] eTileStyleU - new tilestyle type enum. +* @param[in] eTileStyleV - new tilestyle type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_GetObjectResourceIDPtr) (Lib3MF_Component pComponent, Lib3MF_uint32 * pUniqueResourceID); +typedef Lib3MFResult (*PLib3MFTexture2D_SetTileStyleUVPtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle eTileStyleU, eLib3MFTextureTileStyle eTileStyleV); /** -* returns, whether a component has a UUID and, if true, the component's UUID +* Retrieves a texture's filter type. * -* @param[in] pComponent - Component instance. -* @param[out] pHasUUID - flag whether the component has a UUID -* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pFilter - returns filter type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_GetUUIDPtr) (Lib3MF_Component pComponent, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); +typedef Lib3MFResult (*PLib3MFTexture2D_GetFilterPtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter * pFilter); /** -* sets the component's UUID +* Sets a texture's filter type. * -* @param[in] pComponent - Component instance. -* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' +* @param[in] pTexture2D - Texture2D instance. +* @param[in] eFilter - sets new filter type enum. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_SetUUIDPtr) (Lib3MF_Component pComponent, const char * pUUID); +typedef Lib3MFResult (*PLib3MFTexture2D_SetFilterPtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter eFilter); + +/************************************************************************************************************************* + Class definition for BuildItem +**************************************************************************************************************************/ /** -* Returns, if the component has a different transformation than the identity matrix +* Retrieves the object resource associated to a build item * -* @param[in] pComponent - Component instance. -* @param[out] pHasTransform - if true is returned, the transformation is not equal than the identity +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pObjectResource - returns the associated resource instance * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_HasTransformPtr) (Lib3MF_Component pComponent, bool * pHasTransform); +typedef Lib3MFResult (*PLib3MFBuildItem_GetObjectResourcePtr) (Lib3MF_BuildItem pBuildItem, Lib3MF_Object * pObjectResource); /** -* Returns the transformation matrix of the component. +* returns, whether a build item has a UUID and, if true, the build item's UUID * -* @param[in] pComponent - Component instance. -* @param[out] pTransform - filled with the component transformation matrix +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pHasUUID - flag whether the build item has a UUID +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_GetTransformPtr) (Lib3MF_Component pComponent, sLib3MFTransform * pTransform); +typedef Lib3MFResult (*PLib3MFBuildItem_GetUUIDPtr) (Lib3MF_BuildItem pBuildItem, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* Sets the transformation matrix of the component. +* sets the build item's UUID * -* @param[in] pComponent - Component instance. -* @param[in] pTransform - new transformation matrix +* @param[in] pBuildItem - BuildItem instance. +* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponent_SetTransformPtr) (Lib3MF_Component pComponent, const sLib3MFTransform * pTransform); - -/************************************************************************************************************************* - Class definition for ComponentsObject -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFBuildItem_SetUUIDPtr) (Lib3MF_BuildItem pBuildItem, const char * pUUID); /** -* Adds a new component to a components object. +* Retrieves the object UniqueResourceID associated to a build item * -* @param[in] pComponentsObject - ComponentsObject instance. -* @param[in] pObjectResource - object to add as component. Must not lead to circular references! -* @param[in] pTransform - optional transform matrix for the component. -* @param[out] pComponentInstance - new component instance +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pUniqueResourceID - returns the UniqueResourceID of the object * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponentsObject_AddComponentPtr) (Lib3MF_ComponentsObject pComponentsObject, Lib3MF_Object pObjectResource, const sLib3MFTransform * pTransform, Lib3MF_Component * pComponentInstance); +typedef Lib3MFResult (*PLib3MFBuildItem_GetObjectResourceIDPtr) (Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pUniqueResourceID); /** -* Retrieves a component from a component object. +* Checks, if a build item has a non-identity transformation matrix * -* @param[in] pComponentsObject - ComponentsObject instance. -* @param[in] nIndex - index of the component to retrieve (0 to componentcount - 1) -* @param[out] pComponentInstance - component instance +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pHasTransform - returns true, if the transformation matrix is not the identity * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponentsObject_GetComponentPtr) (Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 nIndex, Lib3MF_Component * pComponentInstance); +typedef Lib3MFResult (*PLib3MFBuildItem_HasObjectTransformPtr) (Lib3MF_BuildItem pBuildItem, bool * pHasTransform); /** -* Retrieves a component count of a component object. +* Retrieves a build item's transformation matrix. * -* @param[in] pComponentsObject - ComponentsObject instance. -* @param[out] pCount - returns the component count +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pTransform - returns the transformation matrix * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFComponentsObject_GetComponentCountPtr) (Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 * pCount); - -/************************************************************************************************************************* - Class definition for BeamSet -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFBuildItem_GetObjectTransformPtr) (Lib3MF_BuildItem pBuildItem, sLib3MFTransform * pTransform); /** -* Sets a beamset's name string +* Sets a build item's transformation matrix. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] pName - new name of the beamset. +* @param[in] pBuildItem - BuildItem instance. +* @param[in] pTransform - new transformation matrix * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_SetNamePtr) (Lib3MF_BeamSet pBeamSet, const char * pName); +typedef Lib3MFResult (*PLib3MFBuildItem_SetObjectTransformPtr) (Lib3MF_BuildItem pBuildItem, const sLib3MFTransform * pTransform); /** -* Retrieves a beamset's name string +* Retrieves a build item's part number string * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of returns the name of the beamset., may be NULL +* @param[in] pBuildItem - BuildItem instance. +* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartNumberBuffer - buffer of Returns a build item's part number string, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_GetNamePtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +typedef Lib3MFResult (*PLib3MFBuildItem_GetPartNumberPtr) (Lib3MF_BuildItem pBuildItem, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); /** -* Sets a beamset's identifier string +* Sets a build item's part number string * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] pIdentifier - new name of the beamset. +* @param[in] pBuildItem - BuildItem instance. +* @param[in] pSetPartnumber - new part number string for referencing parts from the outside world * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_SetIdentifierPtr) (Lib3MF_BeamSet pBeamSet, const char * pIdentifier); +typedef Lib3MFResult (*PLib3MFBuildItem_SetPartNumberPtr) (Lib3MF_BuildItem pBuildItem, const char * pSetPartnumber); /** -* Retrieves a beamset's identifier string +* Returns the metadatagroup of this build item * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nIdentifierBufferSize - size of the buffer (including trailing 0) -* @param[out] pIdentifierNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pIdentifierBuffer - buffer of returns the identifier of the beamset., may be NULL +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this build item * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_GetIdentifierPtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer); +typedef Lib3MFResult (*PLib3MFBuildItem_GetMetaDataGroupPtr) (Lib3MF_BuildItem pBuildItem, Lib3MF_MetaDataGroup * pMetaDataGroup); /** -* Retrieves the reference count of a beamset +* Returns the outbox of a build item * -* @param[in] pBeamSet - BeamSet instance. -* @param[out] pCount - returns the reference count +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pOutbox - Outbox of this build item * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_GetReferenceCountPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFBuildItem_GetOutboxPtr) (Lib3MF_BuildItem pBuildItem, sLib3MFBox * pOutbox); + +/************************************************************************************************************************* + Class definition for BuildItemIterator +**************************************************************************************************************************/ /** -* Sets the references of a beamset +* Iterates to the next build item in the list. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nReferencesBufferSize - Number of elements in buffer -* @param[in] pReferencesBuffer - uint32 buffer of the new indices of all beams in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pHasNext - Iterates to the next build item in the list. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_SetReferencesPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nReferencesBufferSize, const Lib3MF_uint32 * pReferencesBuffer); +typedef Lib3MFResult (*PLib3MFBuildItemIterator_MoveNextPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasNext); /** -* Retrieves the references of a beamset +* Iterates to the previous build item in the list. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nReferencesBufferSize - Number of elements in buffer -* @param[out] pReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pReferencesBuffer - uint32 buffer of retrieves the indices of all beams in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pHasPrevious - Iterates to the previous build item in the list. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_GetReferencesPtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nReferencesBufferSize, Lib3MF_uint64* pReferencesNeededCount, Lib3MF_uint32 * pReferencesBuffer); +typedef Lib3MFResult (*PLib3MFBuildItemIterator_MovePreviousPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasPrevious); /** -* Retrieves the ball reference count of a beamset +* Returns the build item the iterator points at. * -* @param[in] pBeamSet - BeamSet instance. -* @param[out] pCount - returns the ball reference count +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pBuildItem - returns the build item instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_GetBallReferenceCountPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFBuildItemIterator_GetCurrentPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItem * pBuildItem); /** -* Sets the ball references of a beamset +* Creates a new build item iterator with the same build item list. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nBallReferencesBufferSize - Number of elements in buffer -* @param[in] pBallReferencesBuffer - uint32 buffer of the new indices of all balls in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pOutBuildItemIterator - returns the cloned Iterator instance * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_SetBallReferencesPtr) (Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nBallReferencesBufferSize, const Lib3MF_uint32 * pBallReferencesBuffer); +typedef Lib3MFResult (*PLib3MFBuildItemIterator_ClonePtr) (Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItemIterator * pOutBuildItemIterator); /** -* Retrieves the ball references of a beamset +* Returns the number of build items the iterator captures. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nBallReferencesBufferSize - Number of elements in buffer -* @param[out] pBallReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBallReferencesBuffer - uint32 buffer of retrieves the indices of all balls in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pCount - returns the number of build items the iterator captures. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBeamSet_GetBallReferencesPtr) (Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nBallReferencesBufferSize, Lib3MF_uint64* pBallReferencesNeededCount, Lib3MF_uint32 * pBallReferencesBuffer); +typedef Lib3MFResult (*PLib3MFBuildItemIterator_CountPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_uint64 * pCount); /************************************************************************************************************************* - Class definition for BaseMaterialGroup + Class definition for Slice **************************************************************************************************************************/ /** -* Retrieves the count of base materials in the material group. +* Set all vertices of a slice. All polygons will be cleared. * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[out] pCount - returns the count of base materials. +* @param[in] pSlice - Slice instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[in] pVerticesBuffer - Position2D buffer of contains the positions. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetCountPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFSlice_SetVerticesPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nVerticesBufferSize, const sLib3MFPosition2D * pVerticesBuffer); /** -* returns all the PropertyIDs of all materials in this group +* Get all vertices of a slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the material in the material group. +* @param[in] pSlice - Slice instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pVerticesBuffer - Position2D buffer of contains the positions. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFSlice_GetVerticesPtr) (Lib3MF_Slice pSlice, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, sLib3MFPosition2D * pVerticesBuffer); + +/** +* Get the number of vertices in a slice +* +* @param[in] pSlice - Slice instance. +* @param[out] pCount - the number of vertices in the slice * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetAllPropertyIDsPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFSlice_GetVertexCountPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); /** -* Adds a new material to the material group +* Add a new polygon to this slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] pName - new name of the base material. -* @param[in] pDisplayColor - Display color of the material -* @param[out] pPropertyID - returns new PropertyID of the new material in the material group. +* @param[in] pSlice - Slice instance. +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the new polygon +* @param[out] pIndex - the index of the new polygon * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_AddMaterialPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const char * pName, const sLib3MFColor * pDisplayColor, Lib3MF_uint32 * pPropertyID); +typedef Lib3MFResult (*PLib3MFSlice_AddPolygonPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer, Lib3MF_uint64 * pIndex); /** -* Removes a material from the material group. +* Get the number of polygons in the slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] pSlice - Slice instance. +* @param[out] pCount - the number of polygons in the slice * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_RemoveMaterialPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID); +typedef Lib3MFResult (*PLib3MFSlice_GetPolygonCountPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); /** -* Returns the base material's name +* Set all indices of a polygon * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of returns the name of the base material., may be NULL +* @param[in] pSlice - Slice instance. +* @param[in] nIndex - the index of the polygon to manipulate +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the index-th polygon * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetNamePtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +typedef Lib3MFResult (*PLib3MFSlice_SetPolygonIndicesPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer); /** -* Sets a base material's name +* Get all vertices of a slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[in] pName - new name of the base material. +* @param[in] pSlice - Slice instance. +* @param[in] nIndex - the index of the polygon to manipulate +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pIndicesBuffer - uint32 buffer of the indices of the index-th polygon * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_SetNamePtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const char * pName); +typedef Lib3MFResult (*PLib3MFSlice_GetPolygonIndicesPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF_uint32 * pIndicesBuffer); /** -* Sets a base material's display color. +* Get the number of vertices in a slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[in] pTheColor - The base material's display color +* @param[in] pSlice - Slice instance. +* @param[in] nIndex - the index of the polygon to manipulate +* @param[out] pCount - the number of indices of the index-th polygon * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_SetDisplayColorPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor); +typedef Lib3MFResult (*PLib3MFSlice_GetPolygonIndexCountPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 * pCount); /** -* Returns a base material's display color. +* Get the upper Z-Coordinate of this slice. * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[out] pTheColor - The base material's display color +* @param[in] pSlice - Slice instance. +* @param[out] pZTop - the upper Z-Coordinate of this slice * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBaseMaterialGroup_GetDisplayColorPtr) (Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor); +typedef Lib3MFResult (*PLib3MFSlice_GetZTopPtr) (Lib3MF_Slice pSlice, Lib3MF_double * pZTop); /************************************************************************************************************************* - Class definition for ColorGroup + Class definition for ToolpathProfile **************************************************************************************************************************/ /** -* Retrieves the count of base materials in this Color Group. +* Retrieves the profile's uuid * -* @param[in] pColorGroup - ColorGroup instance. -* @param[out] pCount - returns the count of colors within this color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroup_GetCountPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetUUIDPtr) (Lib3MF_ToolpathProfile pToolpathProfile, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* returns all the PropertyIDs of all colors within this group +* Retrieves the profile's name * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the color in the color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of Returns the name., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroup_GetAllPropertyIDsPtr) (Lib3MF_ColorGroup pColorGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetNamePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Adds a new value. +* Returns the number of parameters. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] pTheColor - The new color -* @param[out] pPropertyID - PropertyID of the new color within this color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[out] pCount - Returns the number of parameters. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroup_AddColorPtr) (Lib3MF_ColorGroup pColorGroup, const sLib3MFColor * pTheColor, Lib3MF_uint32 * pPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterCountPtr) (Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 * pCount); /** -* Removes a color from the color group. +* Returns the Name of a parameter. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyID - PropertyID of the color to be removed from the color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nIndex - Index of Parameter (0-based). Call will fail if an invalid index is given. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of Returns the name of the parameter., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroup_RemoveColorPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterNamePtr) (Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Sets a color value. +* Returns the NameSpace of a parameter. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyID - PropertyID of a color within this color group. -* @param[in] pTheColor - The color +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nIndex - Index of Parameter (0-based). Call will fail if an invalid index is given. +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of Returns the namespace of the parameter., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroup_SetColorPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterNameSpacePtr) (Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* Sets a color value. +* Checks if a parameter value exists. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyID - PropertyID of a color within this color group. -* @param[out] pTheColor - The color +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValueExists - Returns if a value exists. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFColorGroup_GetColorPtr) (Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor); - -/************************************************************************************************************************* - Class definition for Texture2DGroup -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpathProfile_HasParameterValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool * pValueExists); /** -* Retrieves the count of tex2coords in the Texture2DGroup. +* Retrieves a profile's parameter value. Fails if value does not exist. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[out] pCount - returns the count of tex2coords. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of Returns the value of the field., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetCountPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* returns all the PropertyIDs of all tex2coords in this Texture2DGroup +* Retrieves a profile's parameter value * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the tex2coords in the Texture2DGroup. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] pDefaultValue - Default value if value does not exist. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of Returns the value of the field., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetAllPropertyIDsPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterValueDefPtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const char * pDefaultValue, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* Adds a new tex2coord to the Texture2DGroup +* Retrieves a profile's parameter value as double. Fails if value does not exist or is not a double value. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. -* @param[out] pPropertyID - returns new PropertyID of the new tex2coord in the Texture2DGroup. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroup_AddTex2CoordPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, const sLib3MFTex2Coord * pUVCoordinate, Lib3MF_uint32 * pPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterDoubleValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double * pValue); /** -* Obtains a tex2coord to the Texture2DGroup +* Retrieves a profile's parameter value as double. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] nPropertyID - the PropertyID of the tex2coord in the Texture2DGroup. -* @param[out] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] dDefaultValue - Default value if value does not exist or is not a double value. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetTex2CoordPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID, sLib3MFTex2Coord * pUVCoordinate); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterDoubleValueDefPtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double dDefaultValue, Lib3MF_double * pValue); /** -* Removes a tex2coords from the Texture2DGroup. +* Retrieves a profile's parameter value as integer. Fails if value does not exist or is not a integer value. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] nPropertyID - PropertyID of the tex2coords in the Texture2DGroup. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroup_RemoveTex2CoordPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterIntegerValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 * pValue); /** -* Obtains the texture2D instance of this group. +* Retrieves a profile's parameter value as integer. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[out] pTexture2DInstance - the texture2D instance of this group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] nDefaultValue - Default value if value does not exist or is not a integer value. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2DGroup_GetTexture2DPtr) (Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_Texture2D * pTexture2DInstance); - -/************************************************************************************************************************* - Class definition for CompositeMaterials -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterIntegerValueDefPtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 nDefaultValue, Lib3MF_int64 * pValue); /** -* Retrieves the count of Composite-s in the CompositeMaterials. +* Retrieves a profile's parameter value as boolean. Fails if value does not exist or is not a boolean value. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[out] pCount - returns the count of Composite-s +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetCountPtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterBoolValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool * pValue); /** -* returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials +* Retrieves a profile's parameter value as boolean. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the Composite-Mixing Values in the CompositeMaterials. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] bDefaultValue - Default value if value does not exist or is not a boolean value. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetAllPropertyIDsPtr) (Lib3MF_CompositeMaterials pCompositeMaterials, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFToolpathProfile_GetParameterBoolValueDefPtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool bDefaultValue, bool * pValue); /** -* Obtains the BaseMaterialGroup instance of this CompositeMaterials. +* Sets the profile's name * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[out] pBaseMaterialGroupInstance - returns the BaseMaterialGroup instance of this CompositeMaterials +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pName - Returns the name. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetBaseMaterialGroupPtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance); +typedef Lib3MFResult (*PLib3MFToolpathProfile_SetNamePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pName); /** -* Adds a new Composite-Mixing Values to the CompositeMaterials. +* Sets a profile's parameter value. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nCompositeBufferSize - Number of elements in buffer -* @param[in] pCompositeBuffer - CompositeConstituent buffer of The Composite Constituents to be added as composite -* @param[out] pPropertyID - returns new PropertyID of the new Composite in the CompositeMaterials. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] pValue - String value of the parameter. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterials_AddCompositePtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint64 nCompositeBufferSize, const sLib3MFCompositeConstituent * pCompositeBuffer, Lib3MF_uint32 * pPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathProfile_SetParameterValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const char * pValue); /** -* Removes a Composite-Maxing Ratio from the CompositeMaterials. +* Sets a profile's parameter value as double. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nPropertyID - PropertyID of the Composite-Mixing Values in the CompositeMaterials to be removed. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] dValue - Double value of the parameter. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterials_RemoveCompositePtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathProfile_SetParameterDoubleValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double dValue); /** -* Obtains a Composite-Maxing Ratio of this CompositeMaterials. +* Sets a profile's parameter value as integer. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nPropertyID - the PropertyID of the Composite-Maxing Ratio in the CompositeMaterials. -* @param[in] nCompositeBufferSize - Number of elements in buffer -* @param[out] pCompositeNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pCompositeBuffer - CompositeConstituent buffer of The Composite-Mixing Values with the given PropertyID +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] nValue - Integer value of the parameter. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFCompositeMaterials_GetCompositePtr) (Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nCompositeBufferSize, Lib3MF_uint64* pCompositeNeededCount, sLib3MFCompositeConstituent * pCompositeBuffer); - -/************************************************************************************************************************* - Class definition for MultiPropertyGroup -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpathProfile_SetParameterIntegerValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 nValue); /** -* Retrieves the count of MultiProperty-s in the MultiPropertyGroup. +* Sets a profile's parameter value as boolean. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[out] pCount - returns the count of MultiProperty-s +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] bValue - Boolean value of the parameter. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetCountPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFToolpathProfile_SetParameterBoolValuePtr) (Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool bValue); + +/************************************************************************************************************************* + Class definition for ToolpathLayerReader +**************************************************************************************************************************/ /** -* returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup +* Retrieves the layerdata's uuid * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the MultiProperty-s in the MultiPropertyGroup. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetAllPropertyIDsPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetLayerDataUUIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* Adds a new MultiProperty to the MultiPropertyGroup. +* Retrieves the count of segments. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[in] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the new MultiProperty. -* @param[out] pPropertyID - returns the PropertyID of the new MultiProperty in the MultiPropertyGroup. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[out] pCount - Count * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_AddMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer, Lib3MF_uint32 * pPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentCountPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 * pCount); /** -* Sets the PropertyIDs of a MultiProperty. +* Retrieves the segment type information . * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyID - the PropertyID of the MultiProperty to be changed. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[in] pPropertyIDsBuffer - uint32 buffer of The new PropertyIDs of the MultiProperty +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pType - Segment Type +* @param[out] pPointCount - Point count of segment. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_SetMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentInfoPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, eLib3MFToolpathSegmentType * pType, Lib3MF_uint32 * pPointCount); /** -* Obtains the PropertyIDs of a MultiProperty. +* Retrieves the assigned segment profile. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyID - the PropertyID of the MultiProperty to be queried. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the MultiProperty +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pProfile - Segment Profile * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentProfilePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_ToolpathProfile * pProfile); /** -* Removes a MultiProperty from this MultiPropertyGroup. +* Retrieves the assigned segment profile uuid. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyID - the PropertyID of the MultiProperty to be removed. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[in] nProfileUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pProfileUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pProfileUUIDBuffer - buffer of Segment Profile UUID, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_RemoveMultiPropertyPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentProfileUUIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nProfileUUIDBufferSize, Lib3MF_uint32* pProfileUUIDNeededChars, char * pProfileUUIDBuffer); /** -* Retrieves the number of layers of this MultiPropertyGroup. +* Retrieves the assigned segment profile. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[out] pCount - returns the number of layers +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pBuildItem - Segment Build Item * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetLayerCountPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentPartPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_BuildItem * pBuildItem); /** -* Adds a MultiPropertyLayer to this MultiPropertyGroup. +* Retrieves the assigned segment part uuid. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] pTheLayer - The MultiPropertyLayer to add to this MultiPropertyGroup -* @param[out] pLayerIndex - returns the index of this MultiPropertyLayer +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[in] nPartUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartUUIDBuffer - buffer of Segment Part UUID, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_AddLayerPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const sLib3MFMultiPropertyLayer * pTheLayer, Lib3MF_uint32 * pLayerIndex); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentPartUUIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nPartUUIDBufferSize, Lib3MF_uint32* pPartUUIDNeededChars, char * pPartUUIDBuffer); /** -* Obtains a MultiPropertyLayer of this MultiPropertyGroup. +* Retrieves the assigned segment part id. ATTENTION: This ID is only unique within the layer and there is no guarantee to be globally unique or consistent across layers. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nLayerIndex - The Index of the MultiPropertyLayer queried -* @param[out] pTheLayer - The MultiPropertyLayer with index LayerIndex within MultiPropertyGroup +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pLocalPartID - Local Segment Part ID * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_GetLayerPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex, sLib3MFMultiPropertyLayer * pTheLayer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentLocalPartIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 * pLocalPartID); /** -* Removes a MultiPropertyLayer from this MultiPropertyGroup. +* Retrieves the global part UUID by the local part ID. Fails if part ID does not exist in this layer. ATTENTION: This ID is only unique within the layer and there is no guarantee to be globally unique or consistent across layers. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nLayerIndex - The Index of the MultiPropertyLayer to be removed +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nLocalPartID - Local Segment Part ID +* @param[in] nPartUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartUUIDBuffer - buffer of Segment Part UUID, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFMultiPropertyGroup_RemoveLayerPtr) (Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex); - -/************************************************************************************************************************* - Class definition for Attachment -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nLocalPartID, const Lib3MF_uint32 nPartUUIDBufferSize, Lib3MF_uint32* pPartUUIDNeededChars, char * pPartUUIDBuffer); /** -* Retrieves an attachment's package path. This function will be removed in a later release. +* Retrieves the assigned segment point list. For type hatch, the points are taken pairwise. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nPathBufferSize - size of the buffer (including trailing 0) -* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPathBuffer - buffer of returns the attachment's package path string, may be NULL +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[out] pPointDataNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPointDataBuffer - Position2D buffer of The point data array * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_GetPathPtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentPointDataPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint64 nPointDataBufferSize, Lib3MF_uint64* pPointDataNeededCount, sLib3MFPosition2D * pPointDataBuffer); /** -* Sets an attachment's package path. This function will be removed in a later release. +* Retrieves a segment attribute Information by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pPath - new path of the attachment. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pID - Attribute ID. +* @param[out] pAttributeType - Attribute Type. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_SetPathPtr) (Lib3MF_Attachment pAttachment, const char * pPath); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_FindAttributeInfoByNamePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, Lib3MF_uint32 * pID, eLib3MFToolpathAttributeType * pAttributeType); /** -* Returns the PackagePart that is this attachment. +* Retrieves a segment attribute ID by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[out] pPackagePart - The PackagePart of this attachment. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pID - Attribute ID. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_PackagePartPtr) (Lib3MF_Attachment pAttachment, Lib3MF_PackagePart * pPackagePart); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_FindAttributeIDByNamePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, Lib3MF_uint32 * pID); /** -* Retrieves an attachment's relationship type +* Retrieves a segment attribute Type by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nPathBufferSize - size of the buffer (including trailing 0) -* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPathBuffer - buffer of returns the attachment's package relationship type string, may be NULL +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pAttributeType - Attribute Type. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_GetRelationShipTypePtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_FindAttributeValueByNamePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, eLib3MFToolpathAttributeType * pAttributeType); /** -* Sets an attachment's relationship type. +* Retrieves a segment Uint32 attribute by Attribute ID. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pPath - new relationship type string. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] nID - Attribute ID. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_SetRelationShipTypePtr) (Lib3MF_Attachment pAttachment, const char * pPath); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 nID, Lib3MF_int64 * pValue); /** -* Writes out the attachment as file. +* Retrieves a segment integer attribute by Attribute Name. Will fail if Attribute does not exist or is of different type. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pFileName - file to write into. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_WriteToFilePtr) (Lib3MF_Attachment pAttachment, const char * pFileName); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByNamePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const char * pNameSpace, const char * pAttributeName, Lib3MF_int64 * pValue); /** -* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Retrieves a segment Double attribute by Attribute ID. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pFileName - file to read from. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] nID - Attribute ID. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_ReadFromFilePtr) (Lib3MF_Attachment pAttachment, const char * pFileName); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByIDPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 nID, Lib3MF_double * pValue); /** -* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Retrieves a segment Double attribute by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pTheReadCallback - Callback to call for reading a data chunk -* @param[in] nStreamSize - number of bytes the callback returns -* @param[in] pTheSeekCallback - Callback to call for seeking in the stream. -* @param[in] pUserData - Userdata that is passed to the callback function +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_ReadFromCallbackPtr) (Lib3MF_Attachment pAttachment, Lib3MFReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MFSeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByNamePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const char * pNameSpace, const char * pAttributeName, Lib3MF_double * pValue); /** -* Retrieves the size of the attachment stream +* Retrieves the count of custom data elements. * -* @param[in] pAttachment - Attachment instance. -* @param[out] pStreamSize - the stream size +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[out] pCount - Count * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_GetStreamSizePtr) (Lib3MF_Attachment pAttachment, Lib3MF_uint64 * pStreamSize); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetCustomDataCountPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 * pCount); /** -* Writes out the attachment into a buffer +* Retrieves the custom data. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nBufferBufferSize - Number of elements in buffer -* @param[out] pBufferNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBufferBuffer - uint8 buffer of Buffer to write into +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_WriteToBufferPtr) (Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetCustomDataPtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_CustomDOMTree * pData); /** -* Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). +* Retrieves the node name of the custom data. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nBufferBufferSize - Number of elements in buffer -* @param[in] pBufferBuffer - uint8 buffer of Buffer to read from +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of Namespace of the custom data tree., may be NULL +* @param[in] nDataNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pDataNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pDataNameBuffer - buffer of Root name of the data tree., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFAttachment_ReadFromBufferPtr) (Lib3MF_Attachment pAttachment, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerReader_GetCustomDataNamePtr) (Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer, const Lib3MF_uint32 nDataNameBufferSize, Lib3MF_uint32* pDataNameNeededChars, char * pDataNameBuffer); /************************************************************************************************************************* - Class definition for Texture2D + Class definition for ToolpathLayerData **************************************************************************************************************************/ /** -* Retrieves the attachment located at the path of the texture. +* Retrieves the layerdata's uuid * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pAttachment - attachment that holds the texture's image information. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_GetAttachmentPtr) (Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment * pAttachment); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_GetLayerDataUUIDPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* Sets the texture's package path to the path of the attachment. +* Registers a toolpath profile * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] pAttachment - attachment that holds the texture's image information. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pProfile - The toolpath profile to register. +* @param[out] pProfileID - returns the local profile ID for the layer. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_SetAttachmentPtr) (Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment pAttachment); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_RegisterProfilePtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_ToolpathProfile pProfile, Lib3MF_uint32 * pProfileID); /** -* Retrieves a texture's content type. +* Registers a Model Build Item * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pContentType - returns content type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pBuildItem - The model build item to use. +* @param[out] pPartID - returns the local part ID for the layer. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_GetContentTypePtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureType * pContentType); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_RegisterBuildItemPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pPartID); /** -* Retrieves a texture's content type. +* Sets Segment Attribute for all following segments that are added. Overrides previously set attribute. * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] eContentType - new Content Type +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pNameSpace - The namespace of the attribute to register. +* @param[in] pAttributeName - The name of the attribute to register. +* @param[in] pValue - The value of the attribute to register. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_SetContentTypePtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureType eContentType); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_SetSegmentAttributePtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pAttributeName, const char * pValue); /** -* Retrieves a texture's tilestyle type. +* Clears current segment attributes. * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pTileStyleU - returns tilestyle type enum. -* @param[out] pTileStyleV - returns tilestyle type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_GetTileStyleUVPtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle * pTileStyleU, eLib3MFTextureTileStyle * pTileStyleV); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_ClearSegmentAttributesPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData); /** -* Sets a texture's tilestyle type. +* writes hatch data to the layer. * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] eTileStyleU - new tilestyle type enum. -* @param[in] eTileStyleV - new tilestyle type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nProfileID - The toolpath profile to use +* @param[in] nPartID - The toolpath part to use +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[in] pPointDataBuffer - Position2D buffer of The point data * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_SetTileStyleUVPtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle eTileStyleU, eLib3MFTextureTileStyle eTileStyleV); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_WriteHatchDataPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const sLib3MFPosition2D * pPointDataBuffer); /** -* Retrieves a texture's filter type. +* writes loop data to the layer. * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pFilter - returns filter type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nProfileID - The toolpath profile to use +* @param[in] nPartID - The toolpath part to use +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[in] pPointDataBuffer - Position2D buffer of The point data * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_GetFilterPtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter * pFilter); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_WriteLoopPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const sLib3MFPosition2D * pPointDataBuffer); /** -* Sets a texture's filter type. +* writes polyline data to the layer. * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] eFilter - sets new filter type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nProfileID - The toolpath profile to use +* @param[in] nPartID - The toolpath part to use +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[in] pPointDataBuffer - Position2D buffer of The point data * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFTexture2D_SetFilterPtr) (Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter eFilter); - -/************************************************************************************************************************* - Class definition for BuildItem -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpathLayerData_WritePolylinePtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const sLib3MFPosition2D * pPointDataBuffer); /** -* Retrieves the object resource associated to a build item +* Adds a custom data DOM tree to the layer. Layer MUST not be finished when changing the DOM tree. * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pObjectResource - returns the associated resource instance +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pDataName - Root name of the data tree. MUST not be empty. MUST be a valid XML name string. +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetObjectResourcePtr) (Lib3MF_BuildItem pBuildItem, Lib3MF_Object * pObjectResource); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_AddCustomDataPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData); /** -* returns, whether a build item has a UUID and, if true, the build item's UUID +* finishes all writing of the layer and compresses toolpath data. * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pHasUUID - flag whether the build item has a UUID -* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL +* @param[in] pToolpathLayerData - ToolpathLayerData instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetUUIDPtr) (Lib3MF_BuildItem pBuildItem, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); +typedef Lib3MFResult (*PLib3MFToolpathLayerData_FinishPtr) (Lib3MF_ToolpathLayerData pToolpathLayerData); + +/************************************************************************************************************************* + Class definition for Toolpath +**************************************************************************************************************************/ /** -* sets the build item's UUID +* Retrieves the unit factor * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' +* @param[in] pToolpath - Toolpath instance. +* @param[out] pUnits - Returns the unit factor. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_SetUUIDPtr) (Lib3MF_BuildItem pBuildItem, const char * pUUID); +typedef Lib3MFResult (*PLib3MFToolpath_GetUnitsPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_double * pUnits); /** -* Retrieves the object UniqueResourceID associated to a build item +* Retrieves the count of layers * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pUniqueResourceID - returns the UniqueResourceID of the object +* @param[in] pToolpath - Toolpath instance. +* @param[out] pCount - Returns the layer count * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetObjectResourceIDPtr) (Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pUniqueResourceID); +typedef Lib3MFResult (*PLib3MFToolpath_GetLayerCountPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount); /** -* Checks, if a build item has a non-identity transformation matrix +* Retrieves the count of profiles * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pHasTransform - returns true, if the transformation matrix is not the identity +* @param[in] pToolpath - Toolpath instance. +* @param[out] pCount - Returns the profile count * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_HasObjectTransformPtr) (Lib3MF_BuildItem pBuildItem, bool * pHasTransform); +typedef Lib3MFResult (*PLib3MFToolpath_GetProfileCountPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount); /** -* Retrieves a build item's transformation matrix. +* Adds a new toolpath layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pTransform - returns the transformation matrix +* @param[in] pToolpath - Toolpath instance. +* @param[in] nZMax - ZMax value +* @param[in] pPath - Package Path +* @param[in] pModelWriter - The model writer that writes out the 3MF. +* @param[out] pLayerData - Returns the layerdata object to write the layer content into. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetObjectTransformPtr) (Lib3MF_BuildItem pBuildItem, sLib3MFTransform * pTransform); +typedef Lib3MFResult (*PLib3MFToolpath_AddLayerPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nZMax, const char * pPath, Lib3MF_Writer pModelWriter, Lib3MF_ToolpathLayerData * pLayerData); /** -* Sets a build item's transformation matrix. +* Retrieves the Attachment of a layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] pTransform - new transformation matrix +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[out] pAttachment - Attachment * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_SetObjectTransformPtr) (Lib3MF_BuildItem pBuildItem, const sLib3MFTransform * pTransform); +typedef Lib3MFResult (*PLib3MFToolpath_GetLayerAttachmentPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_Attachment * pAttachment); /** -* Retrieves a build item's part number string +* Reads the toolpath of a layer. * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) -* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPartNumberBuffer - buffer of Returns a build item's part number string, may be NULL +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[out] pToolpathReader - Toolpath Reader Instance * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetPartNumberPtr) (Lib3MF_BuildItem pBuildItem, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); +typedef Lib3MFResult (*PLib3MFToolpath_ReadLayerDataPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_ToolpathLayerReader * pToolpathReader); /** -* Sets a build item's part number string +* Retrieves the Path of a layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] pSetPartnumber - new part number string for referencing parts from the outside world +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of Package Path, may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_SetPartNumberPtr) (Lib3MF_BuildItem pBuildItem, const char * pSetPartnumber); +typedef Lib3MFResult (*PLib3MFToolpath_GetLayerPathPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); /** -* Returns the metadatagroup of this build item +* Retrieves the ZMax of a layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this build item +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[out] pZMax - ZMax value * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetMetaDataGroupPtr) (Lib3MF_BuildItem pBuildItem, Lib3MF_MetaDataGroup * pMetaDataGroup); +typedef Lib3MFResult (*PLib3MFToolpath_GetLayerZMaxPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_uint32 * pZMax); /** -* Returns the outbox of a build item +* Return the z value of a layer in units. * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pOutbox - Outbox of this build item +* @param[in] pToolpath - Toolpath instance. +* @param[in] nLayerIndex - Layer Index. +* @param[out] pZValue - Z Value in Units. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItem_GetOutboxPtr) (Lib3MF_BuildItem pBuildItem, sLib3MFBox * pOutbox); - -/************************************************************************************************************************* - Class definition for BuildItemIterator -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpath_GetLayerZPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nLayerIndex, Lib3MF_uint32 * pZValue); /** -* Iterates to the next build item in the list. +* Adds a new profile to the toolpath. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pHasNext - Iterates to the next build item in the list. +* @param[in] pToolpath - Toolpath instance. +* @param[in] pName - the name. +* @param[out] pProfile - Returns the profile. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItemIterator_MoveNextPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasNext); +typedef Lib3MFResult (*PLib3MFToolpath_AddProfilePtr) (Lib3MF_Toolpath pToolpath, const char * pName, Lib3MF_ToolpathProfile * pProfile); /** -* Iterates to the previous build item in the list. +* Returns a profile of the toolpath. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pHasPrevious - Iterates to the previous build item in the list. +* @param[in] pToolpath - Toolpath instance. +* @param[in] nProfileIndex - Layer Index. +* @param[out] pProfile - Returns the profile. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItemIterator_MovePreviousPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasPrevious); +typedef Lib3MFResult (*PLib3MFToolpath_GetProfilePtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nProfileIndex, Lib3MF_ToolpathProfile * pProfile); /** -* Returns the build item the iterator points at. +* Returns a profile of the toolpath by UUID. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pBuildItem - returns the build item instance. +* @param[in] pToolpath - Toolpath instance. +* @param[in] pProfileUUID - UUID string. +* @param[out] pProfile - Returns the profile. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItemIterator_GetCurrentPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItem * pBuildItem); +typedef Lib3MFResult (*PLib3MFToolpath_GetProfileUUIDPtr) (Lib3MF_Toolpath pToolpath, const char * pProfileUUID, Lib3MF_ToolpathProfile * pProfile); /** -* Creates a new build item iterator with the same build item list. +* Retrieves the count of custom data elements. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pOutBuildItemIterator - returns the cloned Iterator instance +* @param[in] pToolpath - Toolpath instance. +* @param[out] pCount - Count * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItemIterator_ClonePtr) (Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItemIterator * pOutBuildItemIterator); +typedef Lib3MFResult (*PLib3MFToolpath_GetCustomDataCountPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount); /** -* Returns the number of build items the iterator captures. +* Retrieves the custom data. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pCount - returns the number of build items the iterator captures. +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFBuildItemIterator_CountPtr) (Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_uint64 * pCount); - -/************************************************************************************************************************* - Class definition for Slice -**************************************************************************************************************************/ +typedef Lib3MFResult (*PLib3MFToolpath_GetCustomDataPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_CustomDOMTree * pData); /** -* Set all vertices of a slice. All polygons will be cleared. +* Retrieves the node name of the custom data. * -* @param[in] pSlice - Slice instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[in] pVerticesBuffer - Position2D buffer of contains the positions. +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of Namespace of the custom data tree., may be NULL +* @param[in] nDataNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pDataNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pDataNameBuffer - buffer of Root name of the data tree., may be NULL * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_SetVerticesPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nVerticesBufferSize, const sLib3MFPosition2D * pVerticesBuffer); +typedef Lib3MFResult (*PLib3MFToolpath_GetCustomDataNamePtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer, const Lib3MF_uint32 nDataNameBufferSize, Lib3MF_uint32* pDataNameNeededChars, char * pDataNameBuffer); /** -* Get all vertices of a slice +* Retrieves if custom data with a specific namespace and name combination exists. * -* @param[in] pSlice - Slice instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pVerticesBuffer - Position2D buffer of contains the positions. +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. +* @param[in] pDataName - Root name of the data tree. +* @param[out] pCustomDataExists - Returns true if DOM Tree Exists. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_GetVerticesPtr) (Lib3MF_Slice pSlice, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, sLib3MFPosition2D * pVerticesBuffer); +typedef Lib3MFResult (*PLib3MFToolpath_HasUniqueCustomDataPtr) (Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, bool * pCustomDataExists); /** -* Get the number of vertices in a slice +* Retrieves the custom data with a specific namespace and name combination. Fails if combination is not unique. * -* @param[in] pSlice - Slice instance. -* @param[out] pCount - the number of vertices in the slice +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. +* @param[in] pDataName - Root name of the data tree. +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_GetVertexCountPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); +typedef Lib3MFResult (*PLib3MFToolpath_FindUniqueCustomDataPtr) (Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData); /** -* Add a new polygon to this slice +* Adds a custom data DOM tree to the toolpath. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the new polygon -* @param[out] pIndex - the index of the new polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pDataName - Root name of the data tree. MUST not be empty. MUST be a valid XML name string. +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_AddPolygonPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer, Lib3MF_uint64 * pIndex); +typedef Lib3MFResult (*PLib3MFToolpath_AddCustomDataPtr) (Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData); /** -* Get the number of polygons in the slice +* Deletes all custom data. * -* @param[in] pSlice - Slice instance. -* @param[out] pCount - the number of polygons in the slice +* @param[in] pToolpath - Toolpath instance. +* @param[out] pNumberOfDeletedItems - Returns number of deleted items. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_GetPolygonCountPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); +typedef Lib3MFResult (*PLib3MFToolpath_ClearCustomDataPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pNumberOfDeletedItems); /** -* Set all indices of a polygon +* Deletes a custom data instance from the list. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndex - the index of the polygon to manipulate -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the index-th polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pData - DOM Tree of the data. +* @param[out] pSuccess - Returns if deletion was successful. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_SetPolygonIndicesPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer); +typedef Lib3MFResult (*PLib3MFToolpath_DeleteCustomDataPtr) (Lib3MF_Toolpath pToolpath, Lib3MF_CustomDOMTree pData, bool * pSuccess); /** -* Get all vertices of a slice +* Registers an Integer Attribute that each segment holds. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndex - the index of the polygon to manipulate -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pIndicesBuffer - uint32 buffer of the indices of the index-th polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pAttributeName - Attribute name. MUST not be empty. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_GetPolygonIndicesPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF_uint32 * pIndicesBuffer); +typedef Lib3MFResult (*PLib3MFToolpath_RegisterCustomIntegerAttributePtr) (Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pAttributeName); /** -* Get the number of vertices in a slice +* Registers a Double Attribute that each segment holds. Registering only applies to reader or writer objects created after the call. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndex - the index of the polygon to manipulate -* @param[out] pCount - the number of indices of the index-th polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pAttributeName - Attribute name. MUST not be empty. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_GetPolygonIndexCountPtr) (Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 * pCount); +typedef Lib3MFResult (*PLib3MFToolpath_RegisterCustomDoubleAttributePtr) (Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pAttributeName); + +/************************************************************************************************************************* + Class definition for ToolpathIterator +**************************************************************************************************************************/ /** -* Get the upper Z-Coordinate of this slice. +* Returns the Toolpath the iterator points at. * -* @param[in] pSlice - Slice instance. -* @param[out] pZTop - the upper Z-Coordinate of this slice +* @param[in] pToolpathIterator - ToolpathIterator instance. +* @param[out] pResource - returns the Toolpath instance. * @return error code or 0 (success) */ -typedef Lib3MFResult (*PLib3MFSlice_GetZTopPtr) (Lib3MF_Slice pSlice, Lib3MF_double * pZTop); +typedef Lib3MFResult (*PLib3MFToolpathIterator_GetCurrentToolpathPtr) (Lib3MF_ToolpathIterator pToolpathIterator, Lib3MF_Toolpath * pResource); /************************************************************************************************************************* Class definition for SliceStack @@ -3261,6 +4668,15 @@ typedef Lib3MFResult (*PLib3MFModel_GetCompositeMaterialsPtr) (Lib3MF_Model pMod */ typedef Lib3MFResult (*PLib3MFModel_GetMultiPropertyGroupsPtr) (Lib3MF_Model pModel, Lib3MF_MultiPropertyGroupIterator * pResourceIterator); +/** +* creates a Toolpath instance with all toolpath resources. +* +* @param[in] pModel - Model instance. +* @param[out] pResourceIterator - returns the iterator instance. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_GetToolpathsPtr) (Lib3MF_Model pModel, Lib3MF_ToolpathIterator * pResourceIterator); + /** * creates a resource iterator instance with all slice stack resources. * @@ -3384,6 +4800,16 @@ typedef Lib3MFResult (*PLib3MFModel_AddBuildItemPtr) (Lib3MF_Model pModel, Lib3M */ typedef Lib3MFResult (*PLib3MFModel_RemoveBuildItemPtr) (Lib3MF_Model pModel, Lib3MF_BuildItem pBuildItemInstance); +/** +* adds an empty Toolpath resource to the model. +* +* @param[in] pModel - Model instance. +* @param[in] dUnitFactor - The toolpath instance of the created Toolpath. +* @param[out] pToolpathInstance - The toolpath instance of the created Toolpath. +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_AddToolpathPtr) (Lib3MF_Model pModel, Lib3MF_double dUnitFactor, Lib3MF_Toolpath * pToolpathInstance); + /** * Returns the metadata of the model as MetaDataGroup * @@ -3515,6 +4941,40 @@ typedef Lib3MFResult (*PLib3MFModel_SetRandomNumberCallbackPtr) (Lib3MF_Model pM */ typedef Lib3MFResult (*PLib3MFModel_GetKeyStorePtr) (Lib3MF_Model pModel, Lib3MF_KeyStore * pKeyStore); +/** +* Creates an OPC Reader Source from a file. +* +* @param[in] pModel - Model instance. +* @param[in] pFilename - Filename to read from +* @param[out] pInstance - The instance of the created reader source +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_CreatePersistentSourceFromFilePtr) (Lib3MF_Model pModel, const char * pFilename, Lib3MF_PersistentReaderSource * pInstance); + +/** +* Creates an OPC Reader Source from a memory buffer. The memory buffer MUST exist as long as the Source object exists. +* +* @param[in] pModel - Model instance. +* @param[in] nBufferBufferSize - Number of elements in buffer +* @param[in] pBufferBuffer - uint8 buffer of Buffer to read from +* @param[out] pInstance - The instance of the created reader source +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_CreatePersistentSourceFromBufferPtr) (Lib3MF_Model pModel, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer, Lib3MF_PersistentReaderSource * pInstance); + +/** +* Creates an OPC Reader Source from a data provided by a callback function. The callbacks MUST exist as long as the source object exists. +* +* @param[in] pModel - Model instance. +* @param[in] pTheReadCallback - Callback to call for reading a data chunk +* @param[in] nStreamSize - number of bytes the callback returns +* @param[in] pTheSeekCallback - Callback to call for seeking in the stream. +* @param[in] pUserData - Userdata that is passed to the callback function +* @param[out] pInstance - The instance of the created reader source +* @return error code or 0 (success) +*/ +typedef Lib3MFResult (*PLib3MFModel_CreatePersistentSourceFromCallbackPtr) (Lib3MF_Model pModel, Lib3MFReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MFSeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData, Lib3MF_PersistentReaderSource * pInstance); + /************************************************************************************************************************* Global functions **************************************************************************************************************************/ @@ -3720,6 +5180,13 @@ typedef Lib3MFResult (*PLib3MFGetTranslationTransformPtr) (Lib3MF_single fVector typedef struct { void * m_LibraryHandle; PLib3MFBase_ClassTypeIdPtr m_Base_ClassTypeId; + PLib3MFBinaryStream_GetBinaryPathPtr m_BinaryStream_GetBinaryPath; + PLib3MFBinaryStream_GetIndexPathPtr m_BinaryStream_GetIndexPath; + PLib3MFBinaryStream_GetUUIDPtr m_BinaryStream_GetUUID; + PLib3MFBinaryStream_DisableDiscretizedArrayCompressionPtr m_BinaryStream_DisableDiscretizedArrayCompression; + PLib3MFBinaryStream_EnableDiscretizedArrayCompressionPtr m_BinaryStream_EnableDiscretizedArrayCompression; + PLib3MFBinaryStream_EnableLZMAPtr m_BinaryStream_EnableLZMA; + PLib3MFBinaryStream_DisableLZMAPtr m_BinaryStream_DisableLZMA; PLib3MFWriter_WriteToFilePtr m_Writer_WriteToFile; PLib3MFWriter_GetStreamSizePtr m_Writer_GetStreamSize; PLib3MFWriter_WriteToBufferPtr m_Writer_WriteToBuffer; @@ -3733,6 +5200,13 @@ typedef struct { PLib3MFWriter_GetWarningCountPtr m_Writer_GetWarningCount; PLib3MFWriter_AddKeyWrappingCallbackPtr m_Writer_AddKeyWrappingCallback; PLib3MFWriter_SetContentEncryptionCallbackPtr m_Writer_SetContentEncryptionCallback; + PLib3MFWriter_CreateBinaryStreamPtr m_Writer_CreateBinaryStream; + PLib3MFWriter_AssignBinaryStreamPtr m_Writer_AssignBinaryStream; + PLib3MFWriter_RegisterCustomNamespacePtr m_Writer_RegisterCustomNamespace; + PLib3MFPersistentReaderSource_GetSourceTypePtr m_PersistentReaderSource_GetSourceType; + PLib3MFPersistentReaderSource_InvalidateSourceDataPtr m_PersistentReaderSource_InvalidateSourceData; + PLib3MFPersistentReaderSource_SourceDataIsValidPtr m_PersistentReaderSource_SourceDataIsValid; + PLib3MFReader_ReadFromPersistentSourcePtr m_Reader_ReadFromPersistentSource; PLib3MFReader_ReadFromFilePtr m_Reader_ReadFromFile; PLib3MFReader_ReadFromBufferPtr m_Reader_ReadFromBuffer; PLib3MFReader_ReadFromCallbackPtr m_Reader_ReadFromCallback; @@ -3757,6 +5231,51 @@ typedef struct { PLib3MFResourceIterator_GetCurrentPtr m_ResourceIterator_GetCurrent; PLib3MFResourceIterator_ClonePtr m_ResourceIterator_Clone; PLib3MFResourceIterator_CountPtr m_ResourceIterator_Count; + PLib3MFCustomXMLAttribute_GetNamePtr m_CustomXMLAttribute_GetName; + PLib3MFCustomXMLAttribute_GetValuePtr m_CustomXMLAttribute_GetValue; + PLib3MFCustomXMLAttribute_IsValidIntegerPtr m_CustomXMLAttribute_IsValidInteger; + PLib3MFCustomXMLAttribute_GetIntegerValuePtr m_CustomXMLAttribute_GetIntegerValue; + PLib3MFCustomXMLAttribute_IsValidDoublePtr m_CustomXMLAttribute_IsValidDouble; + PLib3MFCustomXMLAttribute_GetDoubleValuePtr m_CustomXMLAttribute_GetDoubleValue; + PLib3MFCustomXMLAttribute_IsValidBoolPtr m_CustomXMLAttribute_IsValidBool; + PLib3MFCustomXMLAttribute_GetBoolValuePtr m_CustomXMLAttribute_GetBoolValue; + PLib3MFCustomXMLAttribute_SetValuePtr m_CustomXMLAttribute_SetValue; + PLib3MFCustomXMLAttribute_SetIntegerValuePtr m_CustomXMLAttribute_SetIntegerValue; + PLib3MFCustomXMLAttribute_SetDoubleValuePtr m_CustomXMLAttribute_SetDoubleValue; + PLib3MFCustomXMLAttribute_SetBoolValuePtr m_CustomXMLAttribute_SetBoolValue; + PLib3MFCustomXMLAttribute_RemovePtr m_CustomXMLAttribute_Remove; + PLib3MFCustomXMLNode_GetNamePtr m_CustomXMLNode_GetName; + PLib3MFCustomXMLNode_GetNameSpacePtr m_CustomXMLNode_GetNameSpace; + PLib3MFCustomXMLNode_GetAttributeCountPtr m_CustomXMLNode_GetAttributeCount; + PLib3MFCustomXMLNode_GetAttributePtr m_CustomXMLNode_GetAttribute; + PLib3MFCustomXMLNode_HasAttributePtr m_CustomXMLNode_HasAttribute; + PLib3MFCustomXMLNode_FindAttributePtr m_CustomXMLNode_FindAttribute; + PLib3MFCustomXMLNode_RemoveAttributePtr m_CustomXMLNode_RemoveAttribute; + PLib3MFCustomXMLNode_RemoveAttributeByIndexPtr m_CustomXMLNode_RemoveAttributeByIndex; + PLib3MFCustomXMLNode_AddAttributePtr m_CustomXMLNode_AddAttribute; + PLib3MFCustomXMLNode_AddIntegerAttributePtr m_CustomXMLNode_AddIntegerAttribute; + PLib3MFCustomXMLNode_AddDoubleAttributePtr m_CustomXMLNode_AddDoubleAttribute; + PLib3MFCustomXMLNode_AddBoolAttributePtr m_CustomXMLNode_AddBoolAttribute; + PLib3MFCustomXMLNode_GetChildrenPtr m_CustomXMLNode_GetChildren; + PLib3MFCustomXMLNode_CountChildrenByNamePtr m_CustomXMLNode_CountChildrenByName; + PLib3MFCustomXMLNode_GetChildrenByNamePtr m_CustomXMLNode_GetChildrenByName; + PLib3MFCustomXMLNode_HasChildPtr m_CustomXMLNode_HasChild; + PLib3MFCustomXMLNode_HasUniqueChildPtr m_CustomXMLNode_HasUniqueChild; + PLib3MFCustomXMLNode_FindChildPtr m_CustomXMLNode_FindChild; + PLib3MFCustomXMLNode_AddChildPtr m_CustomXMLNode_AddChild; + PLib3MFCustomXMLNode_RemoveChildPtr m_CustomXMLNode_RemoveChild; + PLib3MFCustomXMLNode_RemoveChildrenWithNamePtr m_CustomXMLNode_RemoveChildrenWithName; + PLib3MFCustomXMLNode_RemovePtr m_CustomXMLNode_Remove; + PLib3MFCustomXMLNodes_GetNodeCountPtr m_CustomXMLNodes_GetNodeCount; + PLib3MFCustomXMLNodes_GetNodePtr m_CustomXMLNodes_GetNode; + PLib3MFCustomXMLNodes_CountNodesByNamePtr m_CustomXMLNodes_CountNodesByName; + PLib3MFCustomXMLNodes_GetNodesByNamePtr m_CustomXMLNodes_GetNodesByName; + PLib3MFCustomXMLNodes_HasNodePtr m_CustomXMLNodes_HasNode; + PLib3MFCustomXMLNodes_HasUniqueNodePtr m_CustomXMLNodes_HasUniqueNode; + PLib3MFCustomXMLNodes_FindNodePtr m_CustomXMLNodes_FindNode; + PLib3MFCustomDOMTree_GetNameSpacePtr m_CustomDOMTree_GetNameSpace; + PLib3MFCustomDOMTree_GetRootNodePtr m_CustomDOMTree_GetRootNode; + PLib3MFCustomDOMTree_SaveToStringPtr m_CustomDOMTree_SaveToString; PLib3MFSliceStackIterator_GetCurrentSliceStackPtr m_SliceStackIterator_GetCurrentSliceStack; PLib3MFObjectIterator_GetCurrentObjectPtr m_ObjectIterator_GetCurrentObject; PLib3MFMeshObjectIterator_GetCurrentMeshObjectPtr m_MeshObjectIterator_GetCurrentMeshObject; @@ -3949,6 +5468,78 @@ typedef struct { PLib3MFSlice_GetPolygonIndicesPtr m_Slice_GetPolygonIndices; PLib3MFSlice_GetPolygonIndexCountPtr m_Slice_GetPolygonIndexCount; PLib3MFSlice_GetZTopPtr m_Slice_GetZTop; + PLib3MFToolpathProfile_GetUUIDPtr m_ToolpathProfile_GetUUID; + PLib3MFToolpathProfile_GetNamePtr m_ToolpathProfile_GetName; + PLib3MFToolpathProfile_GetParameterCountPtr m_ToolpathProfile_GetParameterCount; + PLib3MFToolpathProfile_GetParameterNamePtr m_ToolpathProfile_GetParameterName; + PLib3MFToolpathProfile_GetParameterNameSpacePtr m_ToolpathProfile_GetParameterNameSpace; + PLib3MFToolpathProfile_HasParameterValuePtr m_ToolpathProfile_HasParameterValue; + PLib3MFToolpathProfile_GetParameterValuePtr m_ToolpathProfile_GetParameterValue; + PLib3MFToolpathProfile_GetParameterValueDefPtr m_ToolpathProfile_GetParameterValueDef; + PLib3MFToolpathProfile_GetParameterDoubleValuePtr m_ToolpathProfile_GetParameterDoubleValue; + PLib3MFToolpathProfile_GetParameterDoubleValueDefPtr m_ToolpathProfile_GetParameterDoubleValueDef; + PLib3MFToolpathProfile_GetParameterIntegerValuePtr m_ToolpathProfile_GetParameterIntegerValue; + PLib3MFToolpathProfile_GetParameterIntegerValueDefPtr m_ToolpathProfile_GetParameterIntegerValueDef; + PLib3MFToolpathProfile_GetParameterBoolValuePtr m_ToolpathProfile_GetParameterBoolValue; + PLib3MFToolpathProfile_GetParameterBoolValueDefPtr m_ToolpathProfile_GetParameterBoolValueDef; + PLib3MFToolpathProfile_SetNamePtr m_ToolpathProfile_SetName; + PLib3MFToolpathProfile_SetParameterValuePtr m_ToolpathProfile_SetParameterValue; + PLib3MFToolpathProfile_SetParameterDoubleValuePtr m_ToolpathProfile_SetParameterDoubleValue; + PLib3MFToolpathProfile_SetParameterIntegerValuePtr m_ToolpathProfile_SetParameterIntegerValue; + PLib3MFToolpathProfile_SetParameterBoolValuePtr m_ToolpathProfile_SetParameterBoolValue; + PLib3MFToolpathLayerReader_GetLayerDataUUIDPtr m_ToolpathLayerReader_GetLayerDataUUID; + PLib3MFToolpathLayerReader_GetSegmentCountPtr m_ToolpathLayerReader_GetSegmentCount; + PLib3MFToolpathLayerReader_GetSegmentInfoPtr m_ToolpathLayerReader_GetSegmentInfo; + PLib3MFToolpathLayerReader_GetSegmentProfilePtr m_ToolpathLayerReader_GetSegmentProfile; + PLib3MFToolpathLayerReader_GetSegmentProfileUUIDPtr m_ToolpathLayerReader_GetSegmentProfileUUID; + PLib3MFToolpathLayerReader_GetSegmentPartPtr m_ToolpathLayerReader_GetSegmentPart; + PLib3MFToolpathLayerReader_GetSegmentPartUUIDPtr m_ToolpathLayerReader_GetSegmentPartUUID; + PLib3MFToolpathLayerReader_GetSegmentLocalPartIDPtr m_ToolpathLayerReader_GetSegmentLocalPartID; + PLib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDPtr m_ToolpathLayerReader_GetPartUUIDByLocalPartID; + PLib3MFToolpathLayerReader_GetSegmentPointDataPtr m_ToolpathLayerReader_GetSegmentPointData; + PLib3MFToolpathLayerReader_FindAttributeInfoByNamePtr m_ToolpathLayerReader_FindAttributeInfoByName; + PLib3MFToolpathLayerReader_FindAttributeIDByNamePtr m_ToolpathLayerReader_FindAttributeIDByName; + PLib3MFToolpathLayerReader_FindAttributeValueByNamePtr m_ToolpathLayerReader_FindAttributeValueByName; + PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByIDPtr m_ToolpathLayerReader_GetSegmentIntegerAttributeByID; + PLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByNamePtr m_ToolpathLayerReader_GetSegmentIntegerAttributeByName; + PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByIDPtr m_ToolpathLayerReader_GetSegmentDoubleAttributeByID; + PLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByNamePtr m_ToolpathLayerReader_GetSegmentDoubleAttributeByName; + PLib3MFToolpathLayerReader_GetCustomDataCountPtr m_ToolpathLayerReader_GetCustomDataCount; + PLib3MFToolpathLayerReader_GetCustomDataPtr m_ToolpathLayerReader_GetCustomData; + PLib3MFToolpathLayerReader_GetCustomDataNamePtr m_ToolpathLayerReader_GetCustomDataName; + PLib3MFToolpathLayerData_GetLayerDataUUIDPtr m_ToolpathLayerData_GetLayerDataUUID; + PLib3MFToolpathLayerData_RegisterProfilePtr m_ToolpathLayerData_RegisterProfile; + PLib3MFToolpathLayerData_RegisterBuildItemPtr m_ToolpathLayerData_RegisterBuildItem; + PLib3MFToolpathLayerData_SetSegmentAttributePtr m_ToolpathLayerData_SetSegmentAttribute; + PLib3MFToolpathLayerData_ClearSegmentAttributesPtr m_ToolpathLayerData_ClearSegmentAttributes; + PLib3MFToolpathLayerData_WriteHatchDataPtr m_ToolpathLayerData_WriteHatchData; + PLib3MFToolpathLayerData_WriteLoopPtr m_ToolpathLayerData_WriteLoop; + PLib3MFToolpathLayerData_WritePolylinePtr m_ToolpathLayerData_WritePolyline; + PLib3MFToolpathLayerData_AddCustomDataPtr m_ToolpathLayerData_AddCustomData; + PLib3MFToolpathLayerData_FinishPtr m_ToolpathLayerData_Finish; + PLib3MFToolpath_GetUnitsPtr m_Toolpath_GetUnits; + PLib3MFToolpath_GetLayerCountPtr m_Toolpath_GetLayerCount; + PLib3MFToolpath_GetProfileCountPtr m_Toolpath_GetProfileCount; + PLib3MFToolpath_AddLayerPtr m_Toolpath_AddLayer; + PLib3MFToolpath_GetLayerAttachmentPtr m_Toolpath_GetLayerAttachment; + PLib3MFToolpath_ReadLayerDataPtr m_Toolpath_ReadLayerData; + PLib3MFToolpath_GetLayerPathPtr m_Toolpath_GetLayerPath; + PLib3MFToolpath_GetLayerZMaxPtr m_Toolpath_GetLayerZMax; + PLib3MFToolpath_GetLayerZPtr m_Toolpath_GetLayerZ; + PLib3MFToolpath_AddProfilePtr m_Toolpath_AddProfile; + PLib3MFToolpath_GetProfilePtr m_Toolpath_GetProfile; + PLib3MFToolpath_GetProfileUUIDPtr m_Toolpath_GetProfileUUID; + PLib3MFToolpath_GetCustomDataCountPtr m_Toolpath_GetCustomDataCount; + PLib3MFToolpath_GetCustomDataPtr m_Toolpath_GetCustomData; + PLib3MFToolpath_GetCustomDataNamePtr m_Toolpath_GetCustomDataName; + PLib3MFToolpath_HasUniqueCustomDataPtr m_Toolpath_HasUniqueCustomData; + PLib3MFToolpath_FindUniqueCustomDataPtr m_Toolpath_FindUniqueCustomData; + PLib3MFToolpath_AddCustomDataPtr m_Toolpath_AddCustomData; + PLib3MFToolpath_ClearCustomDataPtr m_Toolpath_ClearCustomData; + PLib3MFToolpath_DeleteCustomDataPtr m_Toolpath_DeleteCustomData; + PLib3MFToolpath_RegisterCustomIntegerAttributePtr m_Toolpath_RegisterCustomIntegerAttribute; + PLib3MFToolpath_RegisterCustomDoubleAttributePtr m_Toolpath_RegisterCustomDoubleAttribute; + PLib3MFToolpathIterator_GetCurrentToolpathPtr m_ToolpathIterator_GetCurrentToolpath; PLib3MFSliceStack_GetBottomZPtr m_SliceStack_GetBottomZ; PLib3MFSliceStack_GetSliceCountPtr m_SliceStack_GetSliceCount; PLib3MFSliceStack_GetSlicePtr m_SliceStack_GetSlice; @@ -4032,6 +5623,7 @@ typedef struct { PLib3MFModel_GetTexture2DGroupsPtr m_Model_GetTexture2DGroups; PLib3MFModel_GetCompositeMaterialsPtr m_Model_GetCompositeMaterials; PLib3MFModel_GetMultiPropertyGroupsPtr m_Model_GetMultiPropertyGroups; + PLib3MFModel_GetToolpathsPtr m_Model_GetToolpaths; PLib3MFModel_GetSliceStacksPtr m_Model_GetSliceStacks; PLib3MFModel_MergeToModelPtr m_Model_MergeToModel; PLib3MFModel_AddMeshObjectPtr m_Model_AddMeshObject; @@ -4045,6 +5637,7 @@ typedef struct { PLib3MFModel_AddMultiPropertyGroupPtr m_Model_AddMultiPropertyGroup; PLib3MFModel_AddBuildItemPtr m_Model_AddBuildItem; PLib3MFModel_RemoveBuildItemPtr m_Model_RemoveBuildItem; + PLib3MFModel_AddToolpathPtr m_Model_AddToolpath; PLib3MFModel_GetMetaDataGroupPtr m_Model_GetMetaDataGroup; PLib3MFModel_AddAttachmentPtr m_Model_AddAttachment; PLib3MFModel_RemoveAttachmentPtr m_Model_RemoveAttachment; @@ -4059,6 +5652,9 @@ typedef struct { PLib3MFModel_RemoveCustomContentTypePtr m_Model_RemoveCustomContentType; PLib3MFModel_SetRandomNumberCallbackPtr m_Model_SetRandomNumberCallback; PLib3MFModel_GetKeyStorePtr m_Model_GetKeyStore; + PLib3MFModel_CreatePersistentSourceFromFilePtr m_Model_CreatePersistentSourceFromFile; + PLib3MFModel_CreatePersistentSourceFromBufferPtr m_Model_CreatePersistentSourceFromBuffer; + PLib3MFModel_CreatePersistentSourceFromCallbackPtr m_Model_CreatePersistentSourceFromCallback; PLib3MFGetLibraryVersionPtr m_GetLibraryVersion; PLib3MFGetPrereleaseInformationPtr m_GetPrereleaseInformation; PLib3MFGetBuildInformationPtr m_GetBuildInformation; diff --git a/Autogenerated/Bindings/NodeJS/lib3mf_nodeaddon.cc b/Autogenerated/Bindings/NodeJS/lib3mf_nodeaddon.cc index 96e56c3d9..101109dba 100644 --- a/Autogenerated/Bindings/NodeJS/lib3mf_nodeaddon.cc +++ b/Autogenerated/Bindings/NodeJS/lib3mf_nodeaddon.cc @@ -49,11 +49,17 @@ void LoadLib3MF(const FunctionCallbackInfo& args) void InitAll(v8::Local exports, v8::Local module) { CLib3MFBase::Init(); + CLib3MFBinaryStream::Init(); CLib3MFWriter::Init(); + CLib3MFPersistentReaderSource::Init(); CLib3MFReader::Init(); CLib3MFPackagePart::Init(); CLib3MFResource::Init(); CLib3MFResourceIterator::Init(); + CLib3MFCustomXMLAttribute::Init(); + CLib3MFCustomXMLNode::Init(); + CLib3MFCustomXMLNodes::Init(); + CLib3MFCustomDOMTree::Init(); CLib3MFSliceStackIterator::Init(); CLib3MFObjectIterator::Init(); CLib3MFMeshObjectIterator::Init(); @@ -82,6 +88,11 @@ void InitAll(v8::Local exports, v8::Local module) CLib3MFBuildItem::Init(); CLib3MFBuildItemIterator::Init(); CLib3MFSlice::Init(); + CLib3MFToolpathProfile::Init(); + CLib3MFToolpathLayerReader::Init(); + CLib3MFToolpathLayerData::Init(); + CLib3MFToolpath::Init(); + CLib3MFToolpathIterator::Init(); CLib3MFSliceStack::Init(); CLib3MFConsumer::Init(); CLib3MFAccessRight::Init(); diff --git a/Autogenerated/Bindings/NodeJS/lib3mf_nodewrapper.cc b/Autogenerated/Bindings/NodeJS/lib3mf_nodewrapper.cc index 36b978e15..0abf40cdc 100644 --- a/Autogenerated/Bindings/NodeJS/lib3mf_nodewrapper.cc +++ b/Autogenerated/Bindings/NodeJS/lib3mf_nodewrapper.cc @@ -42,11 +42,17 @@ using namespace v8; Persistent CLib3MFWrapper::constructor; Persistent CLib3MFBase::constructor; +Persistent CLib3MFBinaryStream::constructor; Persistent CLib3MFWriter::constructor; +Persistent CLib3MFPersistentReaderSource::constructor; Persistent CLib3MFReader::constructor; Persistent CLib3MFPackagePart::constructor; Persistent CLib3MFResource::constructor; Persistent CLib3MFResourceIterator::constructor; +Persistent CLib3MFCustomXMLAttribute::constructor; +Persistent CLib3MFCustomXMLNode::constructor; +Persistent CLib3MFCustomXMLNodes::constructor; +Persistent CLib3MFCustomDOMTree::constructor; Persistent CLib3MFSliceStackIterator::constructor; Persistent CLib3MFObjectIterator::constructor; Persistent CLib3MFMeshObjectIterator::constructor; @@ -75,6 +81,11 @@ Persistent CLib3MFTexture2D::constructor; Persistent CLib3MFBuildItem::constructor; Persistent CLib3MFBuildItemIterator::constructor; Persistent CLib3MFSlice::constructor; +Persistent CLib3MFToolpathProfile::constructor; +Persistent CLib3MFToolpathLayerReader::constructor; +Persistent CLib3MFToolpathLayerData::constructor; +Persistent CLib3MFToolpath::constructor; +Persistent CLib3MFToolpathIterator::constructor; Persistent CLib3MFSliceStack::constructor; Persistent CLib3MFConsumer::constructor; Persistent CLib3MFAccessRight::constructor; @@ -1226,6 +1237,241 @@ void CLib3MFBase::ClassTypeId(const FunctionCallbackInfo& args) } } +/************************************************************************************************************************* + Class CLib3MFBinaryStream Implementation +**************************************************************************************************************************/ + +CLib3MFBinaryStream::CLib3MFBinaryStream() + : CLib3MFBaseClass() +{ +} + +CLib3MFBinaryStream::~CLib3MFBinaryStream() +{ +} + +void CLib3MFBinaryStream::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFBinaryStream")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBinaryPath", GetBinaryPath); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetIndexPath", GetIndexPath); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetUUID", GetUUID); + NODE_SET_PROTOTYPE_METHOD(tpl, "DisableDiscretizedArrayCompression", DisableDiscretizedArrayCompression); + NODE_SET_PROTOTYPE_METHOD(tpl, "EnableDiscretizedArrayCompression", EnableDiscretizedArrayCompression); + NODE_SET_PROTOTYPE_METHOD(tpl, "EnableLZMA", EnableLZMA); + NODE_SET_PROTOTYPE_METHOD(tpl, "DisableLZMA", DisableLZMA); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFBinaryStream::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFBinaryStream * binarystreamInstance = new CLib3MFBinaryStream(); + binarystreamInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFBinaryStream: Invalid call to Constructor"); + } +} + +Local CLib3MFBinaryStream::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFBinaryStream::GetBinaryPath(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + unsigned int bytesNeededPath = 0; + unsigned int bytesWrittenPath = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBinaryPath."); + if (wrapperTable->m_BinaryStream_GetBinaryPath == nullptr) + throw std::runtime_error("Could not call Lib3MF method BinaryStream::GetBinaryPath."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult initErrorCode = wrapperTable->m_BinaryStream_GetBinaryPath(instanceHandle, 0, &bytesNeededPath, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferPath; + bufferPath.resize(bytesNeededPath); + Lib3MFResult errorCode = wrapperTable->m_BinaryStream_GetBinaryPath(instanceHandle, bytesNeededPath, &bytesWrittenPath, &bufferPath[0]); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferPath[0])); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFBinaryStream::GetIndexPath(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + unsigned int bytesNeededPath = 0; + unsigned int bytesWrittenPath = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetIndexPath."); + if (wrapperTable->m_BinaryStream_GetIndexPath == nullptr) + throw std::runtime_error("Could not call Lib3MF method BinaryStream::GetIndexPath."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult initErrorCode = wrapperTable->m_BinaryStream_GetIndexPath(instanceHandle, 0, &bytesNeededPath, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferPath; + bufferPath.resize(bytesNeededPath); + Lib3MFResult errorCode = wrapperTable->m_BinaryStream_GetIndexPath(instanceHandle, bytesNeededPath, &bytesWrittenPath, &bufferPath[0]); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferPath[0])); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFBinaryStream::GetUUID(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + unsigned int bytesNeededUUID = 0; + unsigned int bytesWrittenUUID = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetUUID."); + if (wrapperTable->m_BinaryStream_GetUUID == nullptr) + throw std::runtime_error("Could not call Lib3MF method BinaryStream::GetUUID."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult initErrorCode = wrapperTable->m_BinaryStream_GetUUID(instanceHandle, 0, &bytesNeededUUID, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferUUID; + bufferUUID.resize(bytesNeededUUID); + Lib3MFResult errorCode = wrapperTable->m_BinaryStream_GetUUID(instanceHandle, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0]); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferUUID[0])); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFBinaryStream::DisableDiscretizedArrayCompression(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method DisableDiscretizedArrayCompression."); + if (wrapperTable->m_BinaryStream_DisableDiscretizedArrayCompression == nullptr) + throw std::runtime_error("Could not call Lib3MF method BinaryStream::DisableDiscretizedArrayCompression."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BinaryStream_DisableDiscretizedArrayCompression(instanceHandle); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFBinaryStream::EnableDiscretizedArrayCompression(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsNumber()) { + throw std::runtime_error("Expected double parameter 0 (Units)"); + } + if (!args[1]->IsUint32()) { + throw std::runtime_error("Expected enum parameter 1 (PredictionType)"); + } + double dUnits = (double) args[0]->NumberValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int ePredictionType = (unsigned int) args[1]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method EnableDiscretizedArrayCompression."); + if (wrapperTable->m_BinaryStream_EnableDiscretizedArrayCompression == nullptr) + throw std::runtime_error("Could not call Lib3MF method BinaryStream::EnableDiscretizedArrayCompression."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BinaryStream_EnableDiscretizedArrayCompression(instanceHandle, dUnits, (eLib3MFBinaryStreamPredictionType) ePredictionType); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFBinaryStream::EnableLZMA(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (LZMALevel)"); + } + unsigned int nLZMALevel = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method EnableLZMA."); + if (wrapperTable->m_BinaryStream_EnableLZMA == nullptr) + throw std::runtime_error("Could not call Lib3MF method BinaryStream::EnableLZMA."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BinaryStream_EnableLZMA(instanceHandle, nLZMALevel); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFBinaryStream::DisableLZMA(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method DisableLZMA."); + if (wrapperTable->m_BinaryStream_DisableLZMA == nullptr) + throw std::runtime_error("Could not call Lib3MF method BinaryStream::DisableLZMA."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BinaryStream_DisableLZMA(instanceHandle); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + /************************************************************************************************************************* Class CLib3MFWriter Implementation **************************************************************************************************************************/ @@ -1262,6 +1508,9 @@ void CLib3MFWriter::Init() NODE_SET_PROTOTYPE_METHOD(tpl, "GetWarningCount", GetWarningCount); NODE_SET_PROTOTYPE_METHOD(tpl, "AddKeyWrappingCallback", AddKeyWrappingCallback); NODE_SET_PROTOTYPE_METHOD(tpl, "SetContentEncryptionCallback", SetContentEncryptionCallback); + NODE_SET_PROTOTYPE_METHOD(tpl, "CreateBinaryStream", CreateBinaryStream); + NODE_SET_PROTOTYPE_METHOD(tpl, "AssignBinaryStream", AssignBinaryStream); + NODE_SET_PROTOTYPE_METHOD(tpl, "RegisterCustomNamespace", RegisterCustomNamespace); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } @@ -1619,92 +1868,33 @@ void CLib3MFWriter::SetContentEncryptionCallback(const FunctionCallbackInfo tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFReader")); - tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); - - // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "ReadFromFile", ReadFromFile); - NODE_SET_PROTOTYPE_METHOD(tpl, "ReadFromBuffer", ReadFromBuffer); - NODE_SET_PROTOTYPE_METHOD(tpl, "ReadFromCallback", ReadFromCallback); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetProgressCallback", SetProgressCallback); - NODE_SET_PROTOTYPE_METHOD(tpl, "AddRelationToRead", AddRelationToRead); - NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveRelationToRead", RemoveRelationToRead); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetStrictModeActive", SetStrictModeActive); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetStrictModeActive", GetStrictModeActive); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetWarning", GetWarning); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetWarningCount", GetWarningCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "AddKeyWrappingCallback", AddKeyWrappingCallback); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetContentEncryptionCallback", SetContentEncryptionCallback); - constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); - -} - -void CLib3MFReader::New(const FunctionCallbackInfo& args) -{ - Isolate* isolate = args.GetIsolate(); - HandleScope scope(isolate); - - if (args.IsConstructCall()) { - CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFReader * readerInstance = new CLib3MFReader(); - readerInstance->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - RaiseError(isolate, "Lib3MFReader: Invalid call to Constructor"); - } -} - -Local CLib3MFReader::NewInstance(Local pParent, Lib3MFHandle pHandle) -{ - Isolate* isolate = Isolate::GetCurrent(); - HandleScope scope(isolate); - Local cons = Local::New(isolate, constructor); - Local instance; - if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { - instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); - instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); - } - return instance; -} - -void CLib3MFReader::ReadFromFile(const FunctionCallbackInfo& args) +void CLib3MFWriter::CreateBinaryStream(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { if (!args[0]->IsString()) { - throw std::runtime_error("Expected string parameter 0 (Filename)"); + throw std::runtime_error("Expected string parameter 0 (IndexPath)"); } - v8::String::Utf8Value sutf8Filename(isolate, args[0]); - std::string sFilename = *sutf8Filename; + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (BinaryPath)"); + } + v8::String::Utf8Value sutf8IndexPath(isolate, args[0]); + std::string sIndexPath = *sutf8IndexPath; + v8::String::Utf8Value sutf8BinaryPath(isolate, args[1]); + std::string sBinaryPath = *sutf8BinaryPath; + Lib3MFHandle hReturnBinaryStream = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method ReadFromFile."); - if (wrapperTable->m_Reader_ReadFromFile == nullptr) - throw std::runtime_error("Could not call Lib3MF method Reader::ReadFromFile."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method CreateBinaryStream."); + if (wrapperTable->m_Writer_CreateBinaryStream == nullptr) + throw std::runtime_error("Could not call Lib3MF method Writer::CreateBinaryStream."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Reader_ReadFromFile(instanceHandle, sFilename.c_str()); + Lib3MFResult errorCode = wrapperTable->m_Writer_CreateBinaryStream(instanceHandle, sIndexPath.c_str(), sBinaryPath.c_str(), &hReturnBinaryStream); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjBinaryStream = CLib3MFBinaryStream::NewInstance(args.Holder(), hReturnBinaryStream); + args.GetReturnValue().Set(instanceObjBinaryStream); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -1712,13 +1902,322 @@ void CLib3MFReader::ReadFromFile(const FunctionCallbackInfo& args) } -void CLib3MFReader::ReadFromBuffer(const FunctionCallbackInfo& args) +void CLib3MFWriter::AssignBinaryStream(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected class parameter 0 (Instance)"); + } + if (!args[1]->IsObject()) { + throw std::runtime_error("Expected class parameter 1 (BinaryStream)"); + } + Local objInstance = args[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); + CLib3MFBase * instanceInstance = ObjectWrap::Unwrap(objInstance); + if (instanceInstance == nullptr) + throw std::runtime_error("Invalid Object parameter 0 (Instance)"); + Lib3MFHandle hInstance = instanceInstance->getHandle( objInstance ); + Local objBinaryStream = args[1]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); + CLib3MFBinaryStream * instanceBinaryStream = ObjectWrap::Unwrap(objBinaryStream); + if (instanceBinaryStream == nullptr) + throw std::runtime_error("Invalid Object parameter 1 (BinaryStream)"); + Lib3MFHandle hBinaryStream = instanceBinaryStream->getHandle( objBinaryStream ); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method AssignBinaryStream."); + if (wrapperTable->m_Writer_AssignBinaryStream == nullptr) + throw std::runtime_error("Could not call Lib3MF method Writer::AssignBinaryStream."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Writer_AssignBinaryStream(instanceHandle, hInstance, hBinaryStream); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFWriter::RegisterCustomNamespace(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Prefix)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (NameSpace)"); + } + v8::String::Utf8Value sutf8Prefix(isolate, args[0]); + std::string sPrefix = *sutf8Prefix; + v8::String::Utf8Value sutf8NameSpace(isolate, args[1]); + std::string sNameSpace = *sutf8NameSpace; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method RegisterCustomNamespace."); + if (wrapperTable->m_Writer_RegisterCustomNamespace == nullptr) + throw std::runtime_error("Could not call Lib3MF method Writer::RegisterCustomNamespace."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Writer_RegisterCustomNamespace(instanceHandle, sPrefix.c_str(), sNameSpace.c_str()); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + +/************************************************************************************************************************* + Class CLib3MFPersistentReaderSource Implementation +**************************************************************************************************************************/ + +CLib3MFPersistentReaderSource::CLib3MFPersistentReaderSource() + : CLib3MFBaseClass() +{ +} + +CLib3MFPersistentReaderSource::~CLib3MFPersistentReaderSource() +{ +} + +void CLib3MFPersistentReaderSource::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFPersistentReaderSource")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetSourceType", GetSourceType); + NODE_SET_PROTOTYPE_METHOD(tpl, "InvalidateSourceData", InvalidateSourceData); + NODE_SET_PROTOTYPE_METHOD(tpl, "SourceDataIsValid", SourceDataIsValid); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFPersistentReaderSource::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFPersistentReaderSource * persistentreadersourceInstance = new CLib3MFPersistentReaderSource(); + persistentreadersourceInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFPersistentReaderSource: Invalid call to Constructor"); + } +} + +Local CLib3MFPersistentReaderSource::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFPersistentReaderSource::GetSourceType(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + eLib3MFPersistentReaderSourceType eReturnSourceType; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetSourceType."); + if (wrapperTable->m_PersistentReaderSource_GetSourceType == nullptr) + throw std::runtime_error("Could not call Lib3MF method PersistentReaderSource::GetSourceType."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_PersistentReaderSource_GetSourceType(instanceHandle, &eReturnSourceType); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::New(isolate, (int)eReturnSourceType)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFPersistentReaderSource::InvalidateSourceData(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method InvalidateSourceData."); + if (wrapperTable->m_PersistentReaderSource_InvalidateSourceData == nullptr) + throw std::runtime_error("Could not call Lib3MF method PersistentReaderSource::InvalidateSourceData."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_PersistentReaderSource_InvalidateSourceData(instanceHandle); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFPersistentReaderSource::SourceDataIsValid(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + bool bReturnDataIsValid = false; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SourceDataIsValid."); + if (wrapperTable->m_PersistentReaderSource_SourceDataIsValid == nullptr) + throw std::runtime_error("Could not call Lib3MF method PersistentReaderSource::SourceDataIsValid."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_PersistentReaderSource_SourceDataIsValid(instanceHandle, &bReturnDataIsValid); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnDataIsValid)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + +/************************************************************************************************************************* + Class CLib3MFReader Implementation +**************************************************************************************************************************/ + +CLib3MFReader::CLib3MFReader() + : CLib3MFBaseClass() +{ +} + +CLib3MFReader::~CLib3MFReader() +{ +} + +void CLib3MFReader::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFReader")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "ReadFromPersistentSource", ReadFromPersistentSource); + NODE_SET_PROTOTYPE_METHOD(tpl, "ReadFromFile", ReadFromFile); + NODE_SET_PROTOTYPE_METHOD(tpl, "ReadFromBuffer", ReadFromBuffer); + NODE_SET_PROTOTYPE_METHOD(tpl, "ReadFromCallback", ReadFromCallback); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetProgressCallback", SetProgressCallback); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddRelationToRead", AddRelationToRead); + NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveRelationToRead", RemoveRelationToRead); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetStrictModeActive", SetStrictModeActive); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetStrictModeActive", GetStrictModeActive); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetWarning", GetWarning); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetWarningCount", GetWarningCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddKeyWrappingCallback", AddKeyWrappingCallback); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetContentEncryptionCallback", SetContentEncryptionCallback); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFReader::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFReader * readerInstance = new CLib3MFReader(); + readerInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFReader: Invalid call to Constructor"); + } +} + +Local CLib3MFReader::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFReader::ReadFromPersistentSource(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected class parameter 0 (Source)"); + } + Local objSource = args[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); + CLib3MFPersistentReaderSource * instanceSource = ObjectWrap::Unwrap(objSource); + if (instanceSource == nullptr) + throw std::runtime_error("Invalid Object parameter 0 (Source)"); + Lib3MFHandle hSource = instanceSource->getHandle( objSource ); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method ReadFromPersistentSource."); + if (wrapperTable->m_Reader_ReadFromPersistentSource == nullptr) + throw std::runtime_error("Could not call Lib3MF method Reader::ReadFromPersistentSource."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Reader_ReadFromPersistentSource(instanceHandle, hSource); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFReader::ReadFromFile(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Filename)"); + } + v8::String::Utf8Value sutf8Filename(isolate, args[0]); + std::string sFilename = *sutf8Filename; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method ReadFromFile."); + if (wrapperTable->m_Reader_ReadFromFile == nullptr) + throw std::runtime_error("Could not call Lib3MF method Reader::ReadFromFile."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Reader_ReadFromFile(instanceHandle, sFilename.c_str()); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFReader::ReadFromBuffer(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) throw std::runtime_error("Could not get wrapper table for Lib3MF method ReadFromBuffer."); if (wrapperTable->m_Reader_ReadFromBuffer == nullptr) throw std::runtime_error("Could not call Lib3MF method Reader::ReadFromBuffer."); @@ -2458,49 +2957,61 @@ void CLib3MFResourceIterator::Count(const FunctionCallbackInfo& args) } /************************************************************************************************************************* - Class CLib3MFSliceStackIterator Implementation + Class CLib3MFCustomXMLAttribute Implementation **************************************************************************************************************************/ -CLib3MFSliceStackIterator::CLib3MFSliceStackIterator() +CLib3MFCustomXMLAttribute::CLib3MFCustomXMLAttribute() : CLib3MFBaseClass() { } -CLib3MFSliceStackIterator::~CLib3MFSliceStackIterator() +CLib3MFCustomXMLAttribute::~CLib3MFCustomXMLAttribute() { } -void CLib3MFSliceStackIterator::Init() +void CLib3MFCustomXMLAttribute::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFSliceStackIterator")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFCustomXMLAttribute")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetCurrentSliceStack", GetCurrentSliceStack); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetName", GetName); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetValue", GetValue); + NODE_SET_PROTOTYPE_METHOD(tpl, "IsValidInteger", IsValidInteger); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetIntegerValue", GetIntegerValue); + NODE_SET_PROTOTYPE_METHOD(tpl, "IsValidDouble", IsValidDouble); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetDoubleValue", GetDoubleValue); + NODE_SET_PROTOTYPE_METHOD(tpl, "IsValidBool", IsValidBool); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBoolValue", GetBoolValue); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetValue", SetValue); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetIntegerValue", SetIntegerValue); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetDoubleValue", SetDoubleValue); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetBoolValue", SetBoolValue); + NODE_SET_PROTOTYPE_METHOD(tpl, "Remove", Remove); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFSliceStackIterator::New(const FunctionCallbackInfo& args) +void CLib3MFCustomXMLAttribute::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFSliceStackIterator * slicestackiteratorInstance = new CLib3MFSliceStackIterator(); - slicestackiteratorInstance->Wrap(args.This()); + CLib3MFCustomXMLAttribute * customxmlattributeInstance = new CLib3MFCustomXMLAttribute(); + customxmlattributeInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFSliceStackIterator: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFCustomXMLAttribute: Invalid call to Constructor"); } } -Local CLib3MFSliceStackIterator::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFCustomXMLAttribute::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -2514,180 +3025,352 @@ Local CLib3MFSliceStackIterator::NewInstance(Local pParent, Lib3 } -void CLib3MFSliceStackIterator::GetCurrentSliceStack(const FunctionCallbackInfo& args) +void CLib3MFCustomXMLAttribute::GetName(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnResource = nullptr; + unsigned int bytesNeededName = 0; + unsigned int bytesWrittenName = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCurrentSliceStack."); - if (wrapperTable->m_SliceStackIterator_GetCurrentSliceStack == nullptr) - throw std::runtime_error("Could not call Lib3MF method SliceStackIterator::GetCurrentSliceStack."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetName."); + if (wrapperTable->m_CustomXMLAttribute_GetName == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLAttribute::GetName."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_SliceStackIterator_GetCurrentSliceStack(instanceHandle, &hReturnResource); + Lib3MFResult initErrorCode = wrapperTable->m_CustomXMLAttribute_GetName(instanceHandle, 0, &bytesNeededName, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferName; + bufferName.resize(bytesNeededName); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLAttribute_GetName(instanceHandle, bytesNeededName, &bytesWrittenName, &bufferName[0]); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjResource = CLib3MFSliceStack::NewInstance(args.Holder(), hReturnResource); - args.GetReturnValue().Set(instanceObjResource); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferName[0])); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } -/************************************************************************************************************************* - Class CLib3MFObjectIterator Implementation -**************************************************************************************************************************/ -CLib3MFObjectIterator::CLib3MFObjectIterator() - : CLib3MFBaseClass() +void CLib3MFCustomXMLAttribute::GetValue(const FunctionCallbackInfo& args) { -} + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + unsigned int bytesNeededValue = 0; + unsigned int bytesWrittenValue = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetValue."); + if (wrapperTable->m_CustomXMLAttribute_GetValue == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLAttribute::GetValue."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult initErrorCode = wrapperTable->m_CustomXMLAttribute_GetValue(instanceHandle, 0, &bytesNeededValue, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferValue; + bufferValue.resize(bytesNeededValue); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLAttribute_GetValue(instanceHandle, bytesNeededValue, &bytesWrittenValue, &bufferValue[0]); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferValue[0])); -CLib3MFObjectIterator::~CLib3MFObjectIterator() -{ + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } } -void CLib3MFObjectIterator::Init() -{ - Isolate* isolate = Isolate::GetCurrent(); - - // Prepare constructor template - Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFObjectIterator")); - tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); - // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetCurrentObject", GetCurrentObject); - constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); +void CLib3MFCustomXMLAttribute::IsValidInteger(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected int64 parameter 0 (MinValue)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected int64 parameter 1 (MaxValue)"); + } + v8::String::Utf8Value sutf8MinValue(isolate, args[0]); + std::string sMinValue = *sutf8MinValue; + int64_t nMinValue = stoll(sMinValue); + v8::String::Utf8Value sutf8MaxValue(isolate, args[1]); + std::string sMaxValue = *sutf8MaxValue; + int64_t nMaxValue = stoll(sMaxValue); + bool bReturnIsValid = false; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method IsValidInteger."); + if (wrapperTable->m_CustomXMLAttribute_IsValidInteger == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLAttribute::IsValidInteger."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLAttribute_IsValidInteger(instanceHandle, nMinValue, nMaxValue, &bReturnIsValid); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnIsValid)); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } } -void CLib3MFObjectIterator::New(const FunctionCallbackInfo& args) + +void CLib3MFCustomXMLAttribute::GetIntegerValue(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected int64 parameter 0 (MinValue)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected int64 parameter 1 (MaxValue)"); + } + v8::String::Utf8Value sutf8MinValue(isolate, args[0]); + std::string sMinValue = *sutf8MinValue; + int64_t nMinValue = stoll(sMinValue); + v8::String::Utf8Value sutf8MaxValue(isolate, args[1]); + std::string sMaxValue = *sutf8MaxValue; + int64_t nMaxValue = stoll(sMaxValue); + int64_t nReturnValue = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetIntegerValue."); + if (wrapperTable->m_CustomXMLAttribute_GetIntegerValue == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLAttribute::GetIntegerValue."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLAttribute_GetIntegerValue(instanceHandle, nMinValue, nMaxValue, &nReturnValue); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, std::to_string(nReturnValue).c_str() )); - if (args.IsConstructCall()) { - CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFObjectIterator * objectiteratorInstance = new CLib3MFObjectIterator(); - objectiteratorInstance->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - RaiseError(isolate, "Lib3MFObjectIterator: Invalid call to Constructor"); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } } -Local CLib3MFObjectIterator::NewInstance(Local pParent, Lib3MFHandle pHandle) + +void CLib3MFCustomXMLAttribute::IsValidDouble(const FunctionCallbackInfo& args) { - Isolate* isolate = Isolate::GetCurrent(); + Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); - Local cons = Local::New(isolate, constructor); - Local instance; - if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { - instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); - instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + try { + if (!args[0]->IsNumber()) { + throw std::runtime_error("Expected double parameter 0 (MinValue)"); + } + if (!args[1]->IsNumber()) { + throw std::runtime_error("Expected double parameter 1 (MaxValue)"); + } + double dMinValue = (double) args[0]->NumberValue(isolate->GetCurrentContext()).ToChecked(); + double dMaxValue = (double) args[1]->NumberValue(isolate->GetCurrentContext()).ToChecked(); + bool bReturnIsValid = false; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method IsValidDouble."); + if (wrapperTable->m_CustomXMLAttribute_IsValidDouble == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLAttribute::IsValidDouble."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLAttribute_IsValidDouble(instanceHandle, dMinValue, dMaxValue, &bReturnIsValid); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnIsValid)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } - return instance; } -void CLib3MFObjectIterator::GetCurrentObject(const FunctionCallbackInfo& args) +void CLib3MFCustomXMLAttribute::GetDoubleValue(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnResource = nullptr; + if (!args[0]->IsNumber()) { + throw std::runtime_error("Expected double parameter 0 (MinValue)"); + } + if (!args[1]->IsNumber()) { + throw std::runtime_error("Expected double parameter 1 (MaxValue)"); + } + double dMinValue = (double) args[0]->NumberValue(isolate->GetCurrentContext()).ToChecked(); + double dMaxValue = (double) args[1]->NumberValue(isolate->GetCurrentContext()).ToChecked(); + double dReturnValue = 0.0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCurrentObject."); - if (wrapperTable->m_ObjectIterator_GetCurrentObject == nullptr) - throw std::runtime_error("Could not call Lib3MF method ObjectIterator::GetCurrentObject."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetDoubleValue."); + if (wrapperTable->m_CustomXMLAttribute_GetDoubleValue == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLAttribute::GetDoubleValue."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ObjectIterator_GetCurrentObject(instanceHandle, &hReturnResource); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLAttribute_GetDoubleValue(instanceHandle, dMinValue, dMaxValue, &dReturnValue); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjResource = CLib3MFObject::NewInstance(args.Holder(), hReturnResource); - args.GetReturnValue().Set(instanceObjResource); + args.GetReturnValue().Set(Number::New(isolate, dReturnValue)); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } -/************************************************************************************************************************* - Class CLib3MFMeshObjectIterator Implementation -**************************************************************************************************************************/ -CLib3MFMeshObjectIterator::CLib3MFMeshObjectIterator() - : CLib3MFBaseClass() +void CLib3MFCustomXMLAttribute::IsValidBool(const FunctionCallbackInfo& args) { + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + bool bReturnIsValid = false; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method IsValidBool."); + if (wrapperTable->m_CustomXMLAttribute_IsValidBool == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLAttribute::IsValidBool."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLAttribute_IsValidBool(instanceHandle, &bReturnIsValid); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnIsValid)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } } -CLib3MFMeshObjectIterator::~CLib3MFMeshObjectIterator() + +void CLib3MFCustomXMLAttribute::GetBoolValue(const FunctionCallbackInfo& args) { + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsNumber()) { + throw std::runtime_error("Expected double parameter 0 (MinValue)"); + } + if (!args[1]->IsNumber()) { + throw std::runtime_error("Expected double parameter 1 (MaxValue)"); + } + double dMinValue = (double) args[0]->NumberValue(isolate->GetCurrentContext()).ToChecked(); + double dMaxValue = (double) args[1]->NumberValue(isolate->GetCurrentContext()).ToChecked(); + bool bReturnValue = false; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBoolValue."); + if (wrapperTable->m_CustomXMLAttribute_GetBoolValue == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLAttribute::GetBoolValue."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLAttribute_GetBoolValue(instanceHandle, dMinValue, dMaxValue, &bReturnValue); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnValue)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } } -void CLib3MFMeshObjectIterator::Init() + +void CLib3MFCustomXMLAttribute::SetValue(const FunctionCallbackInfo& args) { - Isolate* isolate = Isolate::GetCurrent(); + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Value)"); + } + v8::String::Utf8Value sutf8Value(isolate, args[0]); + std::string sValue = *sutf8Value; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetValue."); + if (wrapperTable->m_CustomXMLAttribute_SetValue == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLAttribute::SetValue."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLAttribute_SetValue(instanceHandle, sValue.c_str()); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); - // Prepare constructor template - Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFMeshObjectIterator")); - tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} - // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetCurrentMeshObject", GetCurrentMeshObject); - constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); +void CLib3MFCustomXMLAttribute::SetIntegerValue(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected int64 parameter 0 (Value)"); + } + v8::String::Utf8Value sutf8Value(isolate, args[0]); + std::string sValue = *sutf8Value; + int64_t nValue = stoll(sValue); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetIntegerValue."); + if (wrapperTable->m_CustomXMLAttribute_SetIntegerValue == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLAttribute::SetIntegerValue."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLAttribute_SetIntegerValue(instanceHandle, nValue); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } } -void CLib3MFMeshObjectIterator::New(const FunctionCallbackInfo& args) + +void CLib3MFCustomXMLAttribute::SetDoubleValue(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); + try { + if (!args[0]->IsNumber()) { + throw std::runtime_error("Expected double parameter 0 (Value)"); + } + double dValue = (double) args[0]->NumberValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetDoubleValue."); + if (wrapperTable->m_CustomXMLAttribute_SetDoubleValue == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLAttribute::SetDoubleValue."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLAttribute_SetDoubleValue(instanceHandle, dValue); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); - if (args.IsConstructCall()) { - CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFMeshObjectIterator * meshobjectiteratorInstance = new CLib3MFMeshObjectIterator(); - meshobjectiteratorInstance->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - RaiseError(isolate, "Lib3MFMeshObjectIterator: Invalid call to Constructor"); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } } -Local CLib3MFMeshObjectIterator::NewInstance(Local pParent, Lib3MFHandle pHandle) + +void CLib3MFCustomXMLAttribute::SetBoolValue(const FunctionCallbackInfo& args) { - Isolate* isolate = Isolate::GetCurrent(); + Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); - Local cons = Local::New(isolate, constructor); - Local instance; - if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { - instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); - instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + try { + if (!args[0]->IsBoolean()) { + throw std::runtime_error("Expected bool parameter 0 (Value)"); + } + bool bValue = args[0]->BooleanValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBoolValue."); + if (wrapperTable->m_CustomXMLAttribute_SetBoolValue == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLAttribute::SetBoolValue."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLAttribute_SetBoolValue(instanceHandle, bValue); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } - return instance; } -void CLib3MFMeshObjectIterator::GetCurrentMeshObject(const FunctionCallbackInfo& args) +void CLib3MFCustomXMLAttribute::Remove(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnResource = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCurrentMeshObject."); - if (wrapperTable->m_MeshObjectIterator_GetCurrentMeshObject == nullptr) - throw std::runtime_error("Could not call Lib3MF method MeshObjectIterator::GetCurrentMeshObject."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method Remove."); + if (wrapperTable->m_CustomXMLAttribute_Remove == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLAttribute::Remove."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MeshObjectIterator_GetCurrentMeshObject(instanceHandle, &hReturnResource); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLAttribute_Remove(instanceHandle); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjResource = CLib3MFMeshObject::NewInstance(args.Holder(), hReturnResource); - args.GetReturnValue().Set(instanceObjResource); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -2695,49 +3378,70 @@ void CLib3MFMeshObjectIterator::GetCurrentMeshObject(const FunctionCallbackInfo< } /************************************************************************************************************************* - Class CLib3MFComponentsObjectIterator Implementation + Class CLib3MFCustomXMLNode Implementation **************************************************************************************************************************/ -CLib3MFComponentsObjectIterator::CLib3MFComponentsObjectIterator() +CLib3MFCustomXMLNode::CLib3MFCustomXMLNode() : CLib3MFBaseClass() { } -CLib3MFComponentsObjectIterator::~CLib3MFComponentsObjectIterator() +CLib3MFCustomXMLNode::~CLib3MFCustomXMLNode() { } -void CLib3MFComponentsObjectIterator::Init() +void CLib3MFCustomXMLNode::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFComponentsObjectIterator")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFCustomXMLNode")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetCurrentComponentsObject", GetCurrentComponentsObject); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetName", GetName); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetNameSpace", GetNameSpace); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetAttributeCount", GetAttributeCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetAttribute", GetAttribute); + NODE_SET_PROTOTYPE_METHOD(tpl, "HasAttribute", HasAttribute); + NODE_SET_PROTOTYPE_METHOD(tpl, "FindAttribute", FindAttribute); + NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveAttribute", RemoveAttribute); + NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveAttributeByIndex", RemoveAttributeByIndex); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddAttribute", AddAttribute); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddIntegerAttribute", AddIntegerAttribute); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddDoubleAttribute", AddDoubleAttribute); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddBoolAttribute", AddBoolAttribute); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetChildren", GetChildren); + NODE_SET_PROTOTYPE_METHOD(tpl, "CountChildrenByName", CountChildrenByName); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetChildrenByName", GetChildrenByName); + NODE_SET_PROTOTYPE_METHOD(tpl, "HasChild", HasChild); + NODE_SET_PROTOTYPE_METHOD(tpl, "HasUniqueChild", HasUniqueChild); + NODE_SET_PROTOTYPE_METHOD(tpl, "FindChild", FindChild); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddChild", AddChild); + NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveChild", RemoveChild); + NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveChildrenWithName", RemoveChildrenWithName); + NODE_SET_PROTOTYPE_METHOD(tpl, "Remove", Remove); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFComponentsObjectIterator::New(const FunctionCallbackInfo& args) +void CLib3MFCustomXMLNode::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFComponentsObjectIterator * componentsobjectiteratorInstance = new CLib3MFComponentsObjectIterator(); - componentsobjectiteratorInstance->Wrap(args.This()); + CLib3MFCustomXMLNode * customxmlnodeInstance = new CLib3MFCustomXMLNode(); + customxmlnodeInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFComponentsObjectIterator: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFCustomXMLNode: Invalid call to Constructor"); } } -Local CLib3MFComponentsObjectIterator::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFCustomXMLNode::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -2751,259 +3455,2980 @@ Local CLib3MFComponentsObjectIterator::NewInstance(Local pParent } -void CLib3MFComponentsObjectIterator::GetCurrentComponentsObject(const FunctionCallbackInfo& args) +void CLib3MFCustomXMLNode::GetName(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnResource = nullptr; + unsigned int bytesNeededName = 0; + unsigned int bytesWrittenName = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCurrentComponentsObject."); - if (wrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComponentsObjectIterator::GetCurrentComponentsObject."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetName."); + if (wrapperTable->m_CustomXMLNode_GetName == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNode::GetName."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject(instanceHandle, &hReturnResource); + Lib3MFResult initErrorCode = wrapperTable->m_CustomXMLNode_GetName(instanceHandle, 0, &bytesNeededName, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferName; + bufferName.resize(bytesNeededName); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNode_GetName(instanceHandle, bytesNeededName, &bytesWrittenName, &bufferName[0]); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjResource = CLib3MFComponentsObject::NewInstance(args.Holder(), hReturnResource); - args.GetReturnValue().Set(instanceObjResource); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferName[0])); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } -/************************************************************************************************************************* - Class CLib3MFTexture2DIterator Implementation -**************************************************************************************************************************/ - -CLib3MFTexture2DIterator::CLib3MFTexture2DIterator() - : CLib3MFBaseClass() -{ -} - -CLib3MFTexture2DIterator::~CLib3MFTexture2DIterator() -{ -} - -void CLib3MFTexture2DIterator::Init() -{ - Isolate* isolate = Isolate::GetCurrent(); - - // Prepare constructor template - Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFTexture2DIterator")); - tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); - - // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetCurrentTexture2D", GetCurrentTexture2D); - constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); - -} -void CLib3MFTexture2DIterator::New(const FunctionCallbackInfo& args) +void CLib3MFCustomXMLNode::GetNameSpace(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); + try { + unsigned int bytesNeededNameSpace = 0; + unsigned int bytesWrittenNameSpace = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetNameSpace."); + if (wrapperTable->m_CustomXMLNode_GetNameSpace == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNode::GetNameSpace."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult initErrorCode = wrapperTable->m_CustomXMLNode_GetNameSpace(instanceHandle, 0, &bytesNeededNameSpace, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferNameSpace; + bufferNameSpace.resize(bytesNeededNameSpace); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNode_GetNameSpace(instanceHandle, bytesNeededNameSpace, &bytesWrittenNameSpace, &bufferNameSpace[0]); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferNameSpace[0])); - if (args.IsConstructCall()) { - CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFTexture2DIterator * texture2diteratorInstance = new CLib3MFTexture2DIterator(); - texture2diteratorInstance->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - RaiseError(isolate, "Lib3MFTexture2DIterator: Invalid call to Constructor"); - } -} - -Local CLib3MFTexture2DIterator::NewInstance(Local pParent, Lib3MFHandle pHandle) -{ - Isolate* isolate = Isolate::GetCurrent(); - HandleScope scope(isolate); - Local cons = Local::New(isolate, constructor); - Local instance; - if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { - instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); - instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } - return instance; } -void CLib3MFTexture2DIterator::GetCurrentTexture2D(const FunctionCallbackInfo& args) +void CLib3MFCustomXMLNode::GetAttributeCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnResource = nullptr; + uint64_t nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCurrentTexture2D."); - if (wrapperTable->m_Texture2DIterator_GetCurrentTexture2D == nullptr) - throw std::runtime_error("Could not call Lib3MF method Texture2DIterator::GetCurrentTexture2D."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetAttributeCount."); + if (wrapperTable->m_CustomXMLNode_GetAttributeCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNode::GetAttributeCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Texture2DIterator_GetCurrentTexture2D(instanceHandle, &hReturnResource); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNode_GetAttributeCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjResource = CLib3MFTexture2D::NewInstance(args.Holder(), hReturnResource); - args.GetReturnValue().Set(instanceObjResource); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, std::to_string(nReturnCount).c_str())); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } -/************************************************************************************************************************* - Class CLib3MFBaseMaterialGroupIterator Implementation -**************************************************************************************************************************/ - -CLib3MFBaseMaterialGroupIterator::CLib3MFBaseMaterialGroupIterator() - : CLib3MFBaseClass() -{ -} - -CLib3MFBaseMaterialGroupIterator::~CLib3MFBaseMaterialGroupIterator() -{ -} - -void CLib3MFBaseMaterialGroupIterator::Init() -{ - Isolate* isolate = Isolate::GetCurrent(); - - // Prepare constructor template - Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFBaseMaterialGroupIterator")); - tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); - - // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetCurrentBaseMaterialGroup", GetCurrentBaseMaterialGroup); - constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); - -} -void CLib3MFBaseMaterialGroupIterator::New(const FunctionCallbackInfo& args) +void CLib3MFCustomXMLNode::GetAttribute(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected uint64 parameter 0 (Index)"); + } + v8::String::Utf8Value sutf8Index(isolate, args[0]); + std::string sIndex = *sutf8Index; + uint64_t nIndex = stoull(sIndex); + Lib3MFHandle hReturnAttributeInstance = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetAttribute."); + if (wrapperTable->m_CustomXMLNode_GetAttribute == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNode::GetAttribute."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNode_GetAttribute(instanceHandle, nIndex, &hReturnAttributeInstance); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjAttributeInstance = CLib3MFCustomXMLAttribute::NewInstance(args.Holder(), hReturnAttributeInstance); + args.GetReturnValue().Set(instanceObjAttributeInstance); - if (args.IsConstructCall()) { - CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFBaseMaterialGroupIterator * basematerialgroupiteratorInstance = new CLib3MFBaseMaterialGroupIterator(); - basematerialgroupiteratorInstance->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - RaiseError(isolate, "Lib3MFBaseMaterialGroupIterator: Invalid call to Constructor"); - } -} - -Local CLib3MFBaseMaterialGroupIterator::NewInstance(Local pParent, Lib3MFHandle pHandle) -{ - Isolate* isolate = Isolate::GetCurrent(); - HandleScope scope(isolate); - Local cons = Local::New(isolate, constructor); - Local instance; - if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { - instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); - instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } - return instance; } -void CLib3MFBaseMaterialGroupIterator::GetCurrentBaseMaterialGroup(const FunctionCallbackInfo& args) +void CLib3MFCustomXMLNode::HasAttribute(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnResource = nullptr; + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; + bool bReturnAttributeExists = false; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCurrentBaseMaterialGroup."); - if (wrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup == nullptr) - throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroupIterator::GetCurrentBaseMaterialGroup."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method HasAttribute."); + if (wrapperTable->m_CustomXMLNode_HasAttribute == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNode::HasAttribute."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup(instanceHandle, &hReturnResource); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNode_HasAttribute(instanceHandle, sName.c_str(), &bReturnAttributeExists); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjResource = CLib3MFBaseMaterialGroup::NewInstance(args.Holder(), hReturnResource); - args.GetReturnValue().Set(instanceObjResource); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnAttributeExists)); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } -/************************************************************************************************************************* - Class CLib3MFColorGroupIterator Implementation -**************************************************************************************************************************/ - -CLib3MFColorGroupIterator::CLib3MFColorGroupIterator() - : CLib3MFBaseClass() -{ -} - -CLib3MFColorGroupIterator::~CLib3MFColorGroupIterator() -{ -} - -void CLib3MFColorGroupIterator::Init() -{ - Isolate* isolate = Isolate::GetCurrent(); - - // Prepare constructor template - Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFColorGroupIterator")); - tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); - - // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetCurrentColorGroup", GetCurrentColorGroup); - constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); - -} -void CLib3MFColorGroupIterator::New(const FunctionCallbackInfo& args) +void CLib3MFCustomXMLNode::FindAttribute(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); + } + if (!args[1]->IsBoolean()) { + throw std::runtime_error("Expected bool parameter 1 (MustExist)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; + bool bMustExist = args[1]->BooleanValue(isolate->GetCurrentContext()).ToChecked(); + Lib3MFHandle hReturnAttributeInstance = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method FindAttribute."); + if (wrapperTable->m_CustomXMLNode_FindAttribute == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNode::FindAttribute."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNode_FindAttribute(instanceHandle, sName.c_str(), bMustExist, &hReturnAttributeInstance); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjAttributeInstance = CLib3MFCustomXMLAttribute::NewInstance(args.Holder(), hReturnAttributeInstance); + args.GetReturnValue().Set(instanceObjAttributeInstance); - if (args.IsConstructCall()) { - CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFColorGroupIterator * colorgroupiteratorInstance = new CLib3MFColorGroupIterator(); - colorgroupiteratorInstance->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - RaiseError(isolate, "Lib3MFColorGroupIterator: Invalid call to Constructor"); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } } -Local CLib3MFColorGroupIterator::NewInstance(Local pParent, Lib3MFHandle pHandle) + +void CLib3MFCustomXMLNode::RemoveAttribute(const FunctionCallbackInfo& args) { - Isolate* isolate = Isolate::GetCurrent(); + Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); - Local cons = Local::New(isolate, constructor); - Local instance; - if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { - instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); - instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; + bool bReturnAttributeRemoved = false; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveAttribute."); + if (wrapperTable->m_CustomXMLNode_RemoveAttribute == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNode::RemoveAttribute."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNode_RemoveAttribute(instanceHandle, sName.c_str(), &bReturnAttributeRemoved); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnAttributeRemoved)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } - return instance; } -void CLib3MFColorGroupIterator::GetCurrentColorGroup(const FunctionCallbackInfo& args) +void CLib3MFCustomXMLNode::RemoveAttributeByIndex(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnResource = nullptr; + if (!args[0]->IsString()) { + throw std::runtime_error("Expected uint64 parameter 0 (Index)"); + } + v8::String::Utf8Value sutf8Index(isolate, args[0]); + std::string sIndex = *sutf8Index; + uint64_t nIndex = stoull(sIndex); + bool bReturnAttributeRemoved = false; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCurrentColorGroup."); - if (wrapperTable->m_ColorGroupIterator_GetCurrentColorGroup == nullptr) - throw std::runtime_error("Could not call Lib3MF method ColorGroupIterator::GetCurrentColorGroup."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveAttributeByIndex."); + if (wrapperTable->m_CustomXMLNode_RemoveAttributeByIndex == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNode::RemoveAttributeByIndex."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ColorGroupIterator_GetCurrentColorGroup(instanceHandle, &hReturnResource); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNode_RemoveAttributeByIndex(instanceHandle, nIndex, &bReturnAttributeRemoved); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnAttributeRemoved)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFCustomXMLNode::AddAttribute(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (Value)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; + v8::String::Utf8Value sutf8Value(isolate, args[1]); + std::string sValue = *sutf8Value; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddAttribute."); + if (wrapperTable->m_CustomXMLNode_AddAttribute == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNode::AddAttribute."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNode_AddAttribute(instanceHandle, sName.c_str(), sValue.c_str()); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFCustomXMLNode::AddIntegerAttribute(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected int64 parameter 1 (Value)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; + v8::String::Utf8Value sutf8Value(isolate, args[1]); + std::string sValue = *sutf8Value; + int64_t nValue = stoll(sValue); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddIntegerAttribute."); + if (wrapperTable->m_CustomXMLNode_AddIntegerAttribute == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNode::AddIntegerAttribute."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNode_AddIntegerAttribute(instanceHandle, sName.c_str(), nValue); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFCustomXMLNode::AddDoubleAttribute(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); + } + if (!args[1]->IsNumber()) { + throw std::runtime_error("Expected double parameter 1 (Value)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; + double dValue = (double) args[1]->NumberValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddDoubleAttribute."); + if (wrapperTable->m_CustomXMLNode_AddDoubleAttribute == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNode::AddDoubleAttribute."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNode_AddDoubleAttribute(instanceHandle, sName.c_str(), dValue); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFCustomXMLNode::AddBoolAttribute(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); + } + if (!args[1]->IsBoolean()) { + throw std::runtime_error("Expected bool parameter 1 (Value)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; + bool bValue = args[1]->BooleanValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddBoolAttribute."); + if (wrapperTable->m_CustomXMLNode_AddBoolAttribute == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNode::AddBoolAttribute."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNode_AddBoolAttribute(instanceHandle, sName.c_str(), bValue); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFCustomXMLNode::GetChildren(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnChildNodes = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetChildren."); + if (wrapperTable->m_CustomXMLNode_GetChildren == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNode::GetChildren."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNode_GetChildren(instanceHandle, &hReturnChildNodes); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjChildNodes = CLib3MFCustomXMLNodes::NewInstance(args.Holder(), hReturnChildNodes); + args.GetReturnValue().Set(instanceObjChildNodes); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFCustomXMLNode::CountChildrenByName(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; + uint64_t nReturnCount = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method CountChildrenByName."); + if (wrapperTable->m_CustomXMLNode_CountChildrenByName == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNode::CountChildrenByName."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNode_CountChildrenByName(instanceHandle, sName.c_str(), &nReturnCount); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, std::to_string(nReturnCount).c_str())); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFCustomXMLNode::GetChildrenByName(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; + Lib3MFHandle hReturnChildNodes = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetChildrenByName."); + if (wrapperTable->m_CustomXMLNode_GetChildrenByName == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNode::GetChildrenByName."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNode_GetChildrenByName(instanceHandle, sName.c_str(), &hReturnChildNodes); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjChildNodes = CLib3MFCustomXMLNodes::NewInstance(args.Holder(), hReturnChildNodes); + args.GetReturnValue().Set(instanceObjChildNodes); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFCustomXMLNode::HasChild(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; + bool bReturnChildExists = false; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method HasChild."); + if (wrapperTable->m_CustomXMLNode_HasChild == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNode::HasChild."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNode_HasChild(instanceHandle, sName.c_str(), &bReturnChildExists); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnChildExists)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFCustomXMLNode::HasUniqueChild(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; + bool bReturnChildExists = false; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method HasUniqueChild."); + if (wrapperTable->m_CustomXMLNode_HasUniqueChild == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNode::HasUniqueChild."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNode_HasUniqueChild(instanceHandle, sName.c_str(), &bReturnChildExists); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnChildExists)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFCustomXMLNode::FindChild(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); + } + if (!args[1]->IsBoolean()) { + throw std::runtime_error("Expected bool parameter 1 (MustExist)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; + bool bMustExist = args[1]->BooleanValue(isolate->GetCurrentContext()).ToChecked(); + Lib3MFHandle hReturnChildInstance = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method FindChild."); + if (wrapperTable->m_CustomXMLNode_FindChild == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNode::FindChild."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNode_FindChild(instanceHandle, sName.c_str(), bMustExist, &hReturnChildInstance); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjChildInstance = CLib3MFCustomXMLNode::NewInstance(args.Holder(), hReturnChildInstance); + args.GetReturnValue().Set(instanceObjChildInstance); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFCustomXMLNode::AddChild(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; + Lib3MFHandle hReturnChildInstance = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddChild."); + if (wrapperTable->m_CustomXMLNode_AddChild == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNode::AddChild."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNode_AddChild(instanceHandle, sName.c_str(), &hReturnChildInstance); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjChildInstance = CLib3MFCustomXMLNode::NewInstance(args.Holder(), hReturnChildInstance); + args.GetReturnValue().Set(instanceObjChildInstance); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFCustomXMLNode::RemoveChild(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected class parameter 0 (ChildInstance)"); + } + Local objChildInstance = args[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); + CLib3MFCustomXMLNode * instanceChildInstance = ObjectWrap::Unwrap(objChildInstance); + if (instanceChildInstance == nullptr) + throw std::runtime_error("Invalid Object parameter 0 (ChildInstance)"); + Lib3MFHandle hChildInstance = instanceChildInstance->getHandle( objChildInstance ); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveChild."); + if (wrapperTable->m_CustomXMLNode_RemoveChild == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNode::RemoveChild."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNode_RemoveChild(instanceHandle, hChildInstance); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFCustomXMLNode::RemoveChildrenWithName(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; + uint64_t nReturnNumberOfDeletedChildren = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveChildrenWithName."); + if (wrapperTable->m_CustomXMLNode_RemoveChildrenWithName == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNode::RemoveChildrenWithName."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNode_RemoveChildrenWithName(instanceHandle, sName.c_str(), &nReturnNumberOfDeletedChildren); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, std::to_string(nReturnNumberOfDeletedChildren).c_str())); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFCustomXMLNode::Remove(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method Remove."); + if (wrapperTable->m_CustomXMLNode_Remove == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNode::Remove."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNode_Remove(instanceHandle); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + +/************************************************************************************************************************* + Class CLib3MFCustomXMLNodes Implementation +**************************************************************************************************************************/ + +CLib3MFCustomXMLNodes::CLib3MFCustomXMLNodes() + : CLib3MFBaseClass() +{ +} + +CLib3MFCustomXMLNodes::~CLib3MFCustomXMLNodes() +{ +} + +void CLib3MFCustomXMLNodes::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFCustomXMLNodes")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetNodeCount", GetNodeCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetNode", GetNode); + NODE_SET_PROTOTYPE_METHOD(tpl, "CountNodesByName", CountNodesByName); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetNodesByName", GetNodesByName); + NODE_SET_PROTOTYPE_METHOD(tpl, "HasNode", HasNode); + NODE_SET_PROTOTYPE_METHOD(tpl, "HasUniqueNode", HasUniqueNode); + NODE_SET_PROTOTYPE_METHOD(tpl, "FindNode", FindNode); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFCustomXMLNodes::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFCustomXMLNodes * customxmlnodesInstance = new CLib3MFCustomXMLNodes(); + customxmlnodesInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFCustomXMLNodes: Invalid call to Constructor"); + } +} + +Local CLib3MFCustomXMLNodes::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFCustomXMLNodes::GetNodeCount(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + uint64_t nReturnCount = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetNodeCount."); + if (wrapperTable->m_CustomXMLNodes_GetNodeCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNodes::GetNodeCount."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNodes_GetNodeCount(instanceHandle, &nReturnCount); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, std::to_string(nReturnCount).c_str())); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFCustomXMLNodes::GetNode(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected uint64 parameter 0 (Index)"); + } + v8::String::Utf8Value sutf8Index(isolate, args[0]); + std::string sIndex = *sutf8Index; + uint64_t nIndex = stoull(sIndex); + Lib3MFHandle hReturnNodeInstance = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetNode."); + if (wrapperTable->m_CustomXMLNodes_GetNode == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNodes::GetNode."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNodes_GetNode(instanceHandle, nIndex, &hReturnNodeInstance); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjNodeInstance = CLib3MFCustomXMLNode::NewInstance(args.Holder(), hReturnNodeInstance); + args.GetReturnValue().Set(instanceObjNodeInstance); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFCustomXMLNodes::CountNodesByName(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; + uint64_t nReturnCount = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method CountNodesByName."); + if (wrapperTable->m_CustomXMLNodes_CountNodesByName == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNodes::CountNodesByName."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNodes_CountNodesByName(instanceHandle, sName.c_str(), &nReturnCount); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, std::to_string(nReturnCount).c_str())); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFCustomXMLNodes::GetNodesByName(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; + Lib3MFHandle hReturnNodes = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetNodesByName."); + if (wrapperTable->m_CustomXMLNodes_GetNodesByName == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNodes::GetNodesByName."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNodes_GetNodesByName(instanceHandle, sName.c_str(), &hReturnNodes); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjNodes = CLib3MFCustomXMLNodes::NewInstance(args.Holder(), hReturnNodes); + args.GetReturnValue().Set(instanceObjNodes); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFCustomXMLNodes::HasNode(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; + bool bReturnNodeExists = false; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method HasNode."); + if (wrapperTable->m_CustomXMLNodes_HasNode == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNodes::HasNode."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNodes_HasNode(instanceHandle, sName.c_str(), &bReturnNodeExists); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnNodeExists)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFCustomXMLNodes::HasUniqueNode(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; + bool bReturnNodeExists = false; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method HasUniqueNode."); + if (wrapperTable->m_CustomXMLNodes_HasUniqueNode == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNodes::HasUniqueNode."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNodes_HasUniqueNode(instanceHandle, sName.c_str(), &bReturnNodeExists); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnNodeExists)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFCustomXMLNodes::FindNode(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); + } + if (!args[1]->IsBoolean()) { + throw std::runtime_error("Expected bool parameter 1 (MustExist)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; + bool bMustExist = args[1]->BooleanValue(isolate->GetCurrentContext()).ToChecked(); + Lib3MFHandle hReturnNodeInstance = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method FindNode."); + if (wrapperTable->m_CustomXMLNodes_FindNode == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomXMLNodes::FindNode."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomXMLNodes_FindNode(instanceHandle, sName.c_str(), bMustExist, &hReturnNodeInstance); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjNodeInstance = CLib3MFCustomXMLNode::NewInstance(args.Holder(), hReturnNodeInstance); + args.GetReturnValue().Set(instanceObjNodeInstance); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + +/************************************************************************************************************************* + Class CLib3MFCustomDOMTree Implementation +**************************************************************************************************************************/ + +CLib3MFCustomDOMTree::CLib3MFCustomDOMTree() + : CLib3MFBaseClass() +{ +} + +CLib3MFCustomDOMTree::~CLib3MFCustomDOMTree() +{ +} + +void CLib3MFCustomDOMTree::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFCustomDOMTree")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetNameSpace", GetNameSpace); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetRootNode", GetRootNode); + NODE_SET_PROTOTYPE_METHOD(tpl, "SaveToString", SaveToString); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFCustomDOMTree::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFCustomDOMTree * customdomtreeInstance = new CLib3MFCustomDOMTree(); + customdomtreeInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFCustomDOMTree: Invalid call to Constructor"); + } +} + +Local CLib3MFCustomDOMTree::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFCustomDOMTree::GetNameSpace(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + unsigned int bytesNeededNameSpace = 0; + unsigned int bytesWrittenNameSpace = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetNameSpace."); + if (wrapperTable->m_CustomDOMTree_GetNameSpace == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomDOMTree::GetNameSpace."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult initErrorCode = wrapperTable->m_CustomDOMTree_GetNameSpace(instanceHandle, 0, &bytesNeededNameSpace, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferNameSpace; + bufferNameSpace.resize(bytesNeededNameSpace); + Lib3MFResult errorCode = wrapperTable->m_CustomDOMTree_GetNameSpace(instanceHandle, bytesNeededNameSpace, &bytesWrittenNameSpace, &bufferNameSpace[0]); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferNameSpace[0])); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFCustomDOMTree::GetRootNode(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnRootNode = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetRootNode."); + if (wrapperTable->m_CustomDOMTree_GetRootNode == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomDOMTree::GetRootNode."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CustomDOMTree_GetRootNode(instanceHandle, &hReturnRootNode); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjRootNode = CLib3MFCustomXMLNode::NewInstance(args.Holder(), hReturnRootNode); + args.GetReturnValue().Set(instanceObjRootNode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFCustomDOMTree::SaveToString(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + unsigned int bytesNeededXMLString = 0; + unsigned int bytesWrittenXMLString = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SaveToString."); + if (wrapperTable->m_CustomDOMTree_SaveToString == nullptr) + throw std::runtime_error("Could not call Lib3MF method CustomDOMTree::SaveToString."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult initErrorCode = wrapperTable->m_CustomDOMTree_SaveToString(instanceHandle, 0, &bytesNeededXMLString, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferXMLString; + bufferXMLString.resize(bytesNeededXMLString); + Lib3MFResult errorCode = wrapperTable->m_CustomDOMTree_SaveToString(instanceHandle, bytesNeededXMLString, &bytesWrittenXMLString, &bufferXMLString[0]); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferXMLString[0])); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + +/************************************************************************************************************************* + Class CLib3MFSliceStackIterator Implementation +**************************************************************************************************************************/ + +CLib3MFSliceStackIterator::CLib3MFSliceStackIterator() + : CLib3MFBaseClass() +{ +} + +CLib3MFSliceStackIterator::~CLib3MFSliceStackIterator() +{ +} + +void CLib3MFSliceStackIterator::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFSliceStackIterator")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCurrentSliceStack", GetCurrentSliceStack); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFSliceStackIterator::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFSliceStackIterator * slicestackiteratorInstance = new CLib3MFSliceStackIterator(); + slicestackiteratorInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFSliceStackIterator: Invalid call to Constructor"); + } +} + +Local CLib3MFSliceStackIterator::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFSliceStackIterator::GetCurrentSliceStack(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnResource = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCurrentSliceStack."); + if (wrapperTable->m_SliceStackIterator_GetCurrentSliceStack == nullptr) + throw std::runtime_error("Could not call Lib3MF method SliceStackIterator::GetCurrentSliceStack."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_SliceStackIterator_GetCurrentSliceStack(instanceHandle, &hReturnResource); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjResource = CLib3MFSliceStack::NewInstance(args.Holder(), hReturnResource); + args.GetReturnValue().Set(instanceObjResource); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + +/************************************************************************************************************************* + Class CLib3MFObjectIterator Implementation +**************************************************************************************************************************/ + +CLib3MFObjectIterator::CLib3MFObjectIterator() + : CLib3MFBaseClass() +{ +} + +CLib3MFObjectIterator::~CLib3MFObjectIterator() +{ +} + +void CLib3MFObjectIterator::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFObjectIterator")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCurrentObject", GetCurrentObject); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFObjectIterator::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFObjectIterator * objectiteratorInstance = new CLib3MFObjectIterator(); + objectiteratorInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFObjectIterator: Invalid call to Constructor"); + } +} + +Local CLib3MFObjectIterator::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFObjectIterator::GetCurrentObject(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnResource = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCurrentObject."); + if (wrapperTable->m_ObjectIterator_GetCurrentObject == nullptr) + throw std::runtime_error("Could not call Lib3MF method ObjectIterator::GetCurrentObject."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ObjectIterator_GetCurrentObject(instanceHandle, &hReturnResource); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjResource = CLib3MFObject::NewInstance(args.Holder(), hReturnResource); + args.GetReturnValue().Set(instanceObjResource); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + +/************************************************************************************************************************* + Class CLib3MFMeshObjectIterator Implementation +**************************************************************************************************************************/ + +CLib3MFMeshObjectIterator::CLib3MFMeshObjectIterator() + : CLib3MFBaseClass() +{ +} + +CLib3MFMeshObjectIterator::~CLib3MFMeshObjectIterator() +{ +} + +void CLib3MFMeshObjectIterator::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFMeshObjectIterator")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCurrentMeshObject", GetCurrentMeshObject); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFMeshObjectIterator::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFMeshObjectIterator * meshobjectiteratorInstance = new CLib3MFMeshObjectIterator(); + meshobjectiteratorInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFMeshObjectIterator: Invalid call to Constructor"); + } +} + +Local CLib3MFMeshObjectIterator::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFMeshObjectIterator::GetCurrentMeshObject(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnResource = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCurrentMeshObject."); + if (wrapperTable->m_MeshObjectIterator_GetCurrentMeshObject == nullptr) + throw std::runtime_error("Could not call Lib3MF method MeshObjectIterator::GetCurrentMeshObject."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MeshObjectIterator_GetCurrentMeshObject(instanceHandle, &hReturnResource); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjResource = CLib3MFMeshObject::NewInstance(args.Holder(), hReturnResource); + args.GetReturnValue().Set(instanceObjResource); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + +/************************************************************************************************************************* + Class CLib3MFComponentsObjectIterator Implementation +**************************************************************************************************************************/ + +CLib3MFComponentsObjectIterator::CLib3MFComponentsObjectIterator() + : CLib3MFBaseClass() +{ +} + +CLib3MFComponentsObjectIterator::~CLib3MFComponentsObjectIterator() +{ +} + +void CLib3MFComponentsObjectIterator::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFComponentsObjectIterator")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCurrentComponentsObject", GetCurrentComponentsObject); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFComponentsObjectIterator::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFComponentsObjectIterator * componentsobjectiteratorInstance = new CLib3MFComponentsObjectIterator(); + componentsobjectiteratorInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFComponentsObjectIterator: Invalid call to Constructor"); + } +} + +Local CLib3MFComponentsObjectIterator::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFComponentsObjectIterator::GetCurrentComponentsObject(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnResource = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCurrentComponentsObject."); + if (wrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComponentsObjectIterator::GetCurrentComponentsObject."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ComponentsObjectIterator_GetCurrentComponentsObject(instanceHandle, &hReturnResource); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjResource = CLib3MFComponentsObject::NewInstance(args.Holder(), hReturnResource); + args.GetReturnValue().Set(instanceObjResource); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + +/************************************************************************************************************************* + Class CLib3MFTexture2DIterator Implementation +**************************************************************************************************************************/ + +CLib3MFTexture2DIterator::CLib3MFTexture2DIterator() + : CLib3MFBaseClass() +{ +} + +CLib3MFTexture2DIterator::~CLib3MFTexture2DIterator() +{ +} + +void CLib3MFTexture2DIterator::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFTexture2DIterator")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCurrentTexture2D", GetCurrentTexture2D); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFTexture2DIterator::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFTexture2DIterator * texture2diteratorInstance = new CLib3MFTexture2DIterator(); + texture2diteratorInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFTexture2DIterator: Invalid call to Constructor"); + } +} + +Local CLib3MFTexture2DIterator::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFTexture2DIterator::GetCurrentTexture2D(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnResource = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCurrentTexture2D."); + if (wrapperTable->m_Texture2DIterator_GetCurrentTexture2D == nullptr) + throw std::runtime_error("Could not call Lib3MF method Texture2DIterator::GetCurrentTexture2D."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Texture2DIterator_GetCurrentTexture2D(instanceHandle, &hReturnResource); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjResource = CLib3MFTexture2D::NewInstance(args.Holder(), hReturnResource); + args.GetReturnValue().Set(instanceObjResource); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + +/************************************************************************************************************************* + Class CLib3MFBaseMaterialGroupIterator Implementation +**************************************************************************************************************************/ + +CLib3MFBaseMaterialGroupIterator::CLib3MFBaseMaterialGroupIterator() + : CLib3MFBaseClass() +{ +} + +CLib3MFBaseMaterialGroupIterator::~CLib3MFBaseMaterialGroupIterator() +{ +} + +void CLib3MFBaseMaterialGroupIterator::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFBaseMaterialGroupIterator")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCurrentBaseMaterialGroup", GetCurrentBaseMaterialGroup); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFBaseMaterialGroupIterator::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFBaseMaterialGroupIterator * basematerialgroupiteratorInstance = new CLib3MFBaseMaterialGroupIterator(); + basematerialgroupiteratorInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFBaseMaterialGroupIterator: Invalid call to Constructor"); + } +} + +Local CLib3MFBaseMaterialGroupIterator::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFBaseMaterialGroupIterator::GetCurrentBaseMaterialGroup(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnResource = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCurrentBaseMaterialGroup."); + if (wrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup == nullptr) + throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroupIterator::GetCurrentBaseMaterialGroup."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup(instanceHandle, &hReturnResource); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjResource = CLib3MFBaseMaterialGroup::NewInstance(args.Holder(), hReturnResource); + args.GetReturnValue().Set(instanceObjResource); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + +/************************************************************************************************************************* + Class CLib3MFColorGroupIterator Implementation +**************************************************************************************************************************/ + +CLib3MFColorGroupIterator::CLib3MFColorGroupIterator() + : CLib3MFBaseClass() +{ +} + +CLib3MFColorGroupIterator::~CLib3MFColorGroupIterator() +{ +} + +void CLib3MFColorGroupIterator::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFColorGroupIterator")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCurrentColorGroup", GetCurrentColorGroup); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFColorGroupIterator::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFColorGroupIterator * colorgroupiteratorInstance = new CLib3MFColorGroupIterator(); + colorgroupiteratorInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFColorGroupIterator: Invalid call to Constructor"); + } +} + +Local CLib3MFColorGroupIterator::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFColorGroupIterator::GetCurrentColorGroup(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnResource = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCurrentColorGroup."); + if (wrapperTable->m_ColorGroupIterator_GetCurrentColorGroup == nullptr) + throw std::runtime_error("Could not call Lib3MF method ColorGroupIterator::GetCurrentColorGroup."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ColorGroupIterator_GetCurrentColorGroup(instanceHandle, &hReturnResource); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjResource = CLib3MFColorGroup::NewInstance(args.Holder(), hReturnResource); + args.GetReturnValue().Set(instanceObjResource); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + +/************************************************************************************************************************* + Class CLib3MFTexture2DGroupIterator Implementation +**************************************************************************************************************************/ + +CLib3MFTexture2DGroupIterator::CLib3MFTexture2DGroupIterator() + : CLib3MFBaseClass() +{ +} + +CLib3MFTexture2DGroupIterator::~CLib3MFTexture2DGroupIterator() +{ +} + +void CLib3MFTexture2DGroupIterator::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFTexture2DGroupIterator")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCurrentTexture2DGroup", GetCurrentTexture2DGroup); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFTexture2DGroupIterator::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFTexture2DGroupIterator * texture2dgroupiteratorInstance = new CLib3MFTexture2DGroupIterator(); + texture2dgroupiteratorInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFTexture2DGroupIterator: Invalid call to Constructor"); + } +} + +Local CLib3MFTexture2DGroupIterator::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFTexture2DGroupIterator::GetCurrentTexture2DGroup(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnResource = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCurrentTexture2DGroup."); + if (wrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup == nullptr) + throw std::runtime_error("Could not call Lib3MF method Texture2DGroupIterator::GetCurrentTexture2DGroup."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup(instanceHandle, &hReturnResource); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjResource = CLib3MFTexture2DGroup::NewInstance(args.Holder(), hReturnResource); + args.GetReturnValue().Set(instanceObjResource); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + +/************************************************************************************************************************* + Class CLib3MFCompositeMaterialsIterator Implementation +**************************************************************************************************************************/ + +CLib3MFCompositeMaterialsIterator::CLib3MFCompositeMaterialsIterator() + : CLib3MFBaseClass() +{ +} + +CLib3MFCompositeMaterialsIterator::~CLib3MFCompositeMaterialsIterator() +{ +} + +void CLib3MFCompositeMaterialsIterator::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFCompositeMaterialsIterator")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCurrentCompositeMaterials", GetCurrentCompositeMaterials); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFCompositeMaterialsIterator::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFCompositeMaterialsIterator * compositematerialsiteratorInstance = new CLib3MFCompositeMaterialsIterator(); + compositematerialsiteratorInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFCompositeMaterialsIterator: Invalid call to Constructor"); + } +} + +Local CLib3MFCompositeMaterialsIterator::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFCompositeMaterialsIterator::GetCurrentCompositeMaterials(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnResource = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCurrentCompositeMaterials."); + if (wrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials == nullptr) + throw std::runtime_error("Could not call Lib3MF method CompositeMaterialsIterator::GetCurrentCompositeMaterials."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials(instanceHandle, &hReturnResource); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjResource = CLib3MFCompositeMaterials::NewInstance(args.Holder(), hReturnResource); + args.GetReturnValue().Set(instanceObjResource); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + +/************************************************************************************************************************* + Class CLib3MFMultiPropertyGroupIterator Implementation +**************************************************************************************************************************/ + +CLib3MFMultiPropertyGroupIterator::CLib3MFMultiPropertyGroupIterator() + : CLib3MFBaseClass() +{ +} + +CLib3MFMultiPropertyGroupIterator::~CLib3MFMultiPropertyGroupIterator() +{ +} + +void CLib3MFMultiPropertyGroupIterator::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFMultiPropertyGroupIterator")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCurrentMultiPropertyGroup", GetCurrentMultiPropertyGroup); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFMultiPropertyGroupIterator::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFMultiPropertyGroupIterator * multipropertygroupiteratorInstance = new CLib3MFMultiPropertyGroupIterator(); + multipropertygroupiteratorInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFMultiPropertyGroupIterator: Invalid call to Constructor"); + } +} + +Local CLib3MFMultiPropertyGroupIterator::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFMultiPropertyGroupIterator::GetCurrentMultiPropertyGroup(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnResource = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCurrentMultiPropertyGroup."); + if (wrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup == nullptr) + throw std::runtime_error("Could not call Lib3MF method MultiPropertyGroupIterator::GetCurrentMultiPropertyGroup."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup(instanceHandle, &hReturnResource); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjResource = CLib3MFMultiPropertyGroup::NewInstance(args.Holder(), hReturnResource); + args.GetReturnValue().Set(instanceObjResource); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + +/************************************************************************************************************************* + Class CLib3MFMetaData Implementation +**************************************************************************************************************************/ + +CLib3MFMetaData::CLib3MFMetaData() + : CLib3MFBaseClass() +{ +} + +CLib3MFMetaData::~CLib3MFMetaData() +{ +} + +void CLib3MFMetaData::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFMetaData")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetNameSpace", GetNameSpace); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetNameSpace", SetNameSpace); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetName", GetName); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetName", SetName); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetKey", GetKey); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetMustPreserve", GetMustPreserve); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetMustPreserve", SetMustPreserve); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetType", GetType); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetType", SetType); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetValue", GetValue); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetValue", SetValue); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFMetaData::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFMetaData * metadataInstance = new CLib3MFMetaData(); + metadataInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFMetaData: Invalid call to Constructor"); + } +} + +Local CLib3MFMetaData::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFMetaData::GetNameSpace(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + unsigned int bytesNeededNameSpace = 0; + unsigned int bytesWrittenNameSpace = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetNameSpace."); + if (wrapperTable->m_MetaData_GetNameSpace == nullptr) + throw std::runtime_error("Could not call Lib3MF method MetaData::GetNameSpace."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult initErrorCode = wrapperTable->m_MetaData_GetNameSpace(instanceHandle, 0, &bytesNeededNameSpace, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferNameSpace; + bufferNameSpace.resize(bytesNeededNameSpace); + Lib3MFResult errorCode = wrapperTable->m_MetaData_GetNameSpace(instanceHandle, bytesNeededNameSpace, &bytesWrittenNameSpace, &bufferNameSpace[0]); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferNameSpace[0])); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMetaData::SetNameSpace(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (NameSpace)"); + } + v8::String::Utf8Value sutf8NameSpace(isolate, args[0]); + std::string sNameSpace = *sutf8NameSpace; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetNameSpace."); + if (wrapperTable->m_MetaData_SetNameSpace == nullptr) + throw std::runtime_error("Could not call Lib3MF method MetaData::SetNameSpace."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MetaData_SetNameSpace(instanceHandle, sNameSpace.c_str()); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMetaData::GetName(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + unsigned int bytesNeededName = 0; + unsigned int bytesWrittenName = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetName."); + if (wrapperTable->m_MetaData_GetName == nullptr) + throw std::runtime_error("Could not call Lib3MF method MetaData::GetName."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult initErrorCode = wrapperTable->m_MetaData_GetName(instanceHandle, 0, &bytesNeededName, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferName; + bufferName.resize(bytesNeededName); + Lib3MFResult errorCode = wrapperTable->m_MetaData_GetName(instanceHandle, bytesNeededName, &bytesWrittenName, &bufferName[0]); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferName[0])); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMetaData::SetName(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetName."); + if (wrapperTable->m_MetaData_SetName == nullptr) + throw std::runtime_error("Could not call Lib3MF method MetaData::SetName."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MetaData_SetName(instanceHandle, sName.c_str()); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMetaData::GetKey(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + unsigned int bytesNeededKey = 0; + unsigned int bytesWrittenKey = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetKey."); + if (wrapperTable->m_MetaData_GetKey == nullptr) + throw std::runtime_error("Could not call Lib3MF method MetaData::GetKey."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult initErrorCode = wrapperTable->m_MetaData_GetKey(instanceHandle, 0, &bytesNeededKey, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferKey; + bufferKey.resize(bytesNeededKey); + Lib3MFResult errorCode = wrapperTable->m_MetaData_GetKey(instanceHandle, bytesNeededKey, &bytesWrittenKey, &bufferKey[0]); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferKey[0])); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMetaData::GetMustPreserve(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + bool bReturnMustPreserve = false; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMustPreserve."); + if (wrapperTable->m_MetaData_GetMustPreserve == nullptr) + throw std::runtime_error("Could not call Lib3MF method MetaData::GetMustPreserve."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MetaData_GetMustPreserve(instanceHandle, &bReturnMustPreserve); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnMustPreserve)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMetaData::SetMustPreserve(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsBoolean()) { + throw std::runtime_error("Expected bool parameter 0 (MustPreserve)"); + } + bool bMustPreserve = args[0]->BooleanValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetMustPreserve."); + if (wrapperTable->m_MetaData_SetMustPreserve == nullptr) + throw std::runtime_error("Could not call Lib3MF method MetaData::SetMustPreserve."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MetaData_SetMustPreserve(instanceHandle, bMustPreserve); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMetaData::GetType(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + unsigned int bytesNeededType = 0; + unsigned int bytesWrittenType = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetType."); + if (wrapperTable->m_MetaData_GetType == nullptr) + throw std::runtime_error("Could not call Lib3MF method MetaData::GetType."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult initErrorCode = wrapperTable->m_MetaData_GetType(instanceHandle, 0, &bytesNeededType, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferType; + bufferType.resize(bytesNeededType); + Lib3MFResult errorCode = wrapperTable->m_MetaData_GetType(instanceHandle, bytesNeededType, &bytesWrittenType, &bufferType[0]); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferType[0])); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMetaData::SetType(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Type)"); + } + v8::String::Utf8Value sutf8Type(isolate, args[0]); + std::string sType = *sutf8Type; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetType."); + if (wrapperTable->m_MetaData_SetType == nullptr) + throw std::runtime_error("Could not call Lib3MF method MetaData::SetType."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MetaData_SetType(instanceHandle, sType.c_str()); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMetaData::GetValue(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + unsigned int bytesNeededValue = 0; + unsigned int bytesWrittenValue = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetValue."); + if (wrapperTable->m_MetaData_GetValue == nullptr) + throw std::runtime_error("Could not call Lib3MF method MetaData::GetValue."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult initErrorCode = wrapperTable->m_MetaData_GetValue(instanceHandle, 0, &bytesNeededValue, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferValue; + bufferValue.resize(bytesNeededValue); + Lib3MFResult errorCode = wrapperTable->m_MetaData_GetValue(instanceHandle, bytesNeededValue, &bytesWrittenValue, &bufferValue[0]); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferValue[0])); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMetaData::SetValue(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Value)"); + } + v8::String::Utf8Value sutf8Value(isolate, args[0]); + std::string sValue = *sutf8Value; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetValue."); + if (wrapperTable->m_MetaData_SetValue == nullptr) + throw std::runtime_error("Could not call Lib3MF method MetaData::SetValue."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MetaData_SetValue(instanceHandle, sValue.c_str()); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + +/************************************************************************************************************************* + Class CLib3MFMetaDataGroup Implementation +**************************************************************************************************************************/ + +CLib3MFMetaDataGroup::CLib3MFMetaDataGroup() + : CLib3MFBaseClass() +{ +} + +CLib3MFMetaDataGroup::~CLib3MFMetaDataGroup() +{ +} + +void CLib3MFMetaDataGroup::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFMetaDataGroup")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetMetaDataCount", GetMetaDataCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetMetaData", GetMetaData); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetMetaDataByKey", GetMetaDataByKey); + NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveMetaDataByIndex", RemoveMetaDataByIndex); + NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveMetaData", RemoveMetaData); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddMetaData", AddMetaData); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFMetaDataGroup::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFMetaDataGroup * metadatagroupInstance = new CLib3MFMetaDataGroup(); + metadatagroupInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFMetaDataGroup: Invalid call to Constructor"); + } +} + +Local CLib3MFMetaDataGroup::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFMetaDataGroup::GetMetaDataCount(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + unsigned int nReturnCount = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMetaDataCount."); + if (wrapperTable->m_MetaDataGroup_GetMetaDataCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method MetaDataGroup::GetMetaDataCount."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MetaDataGroup_GetMetaDataCount(instanceHandle, &nReturnCount); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMetaDataGroup::GetMetaData(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + Lib3MFHandle hReturnMetaData = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMetaData."); + if (wrapperTable->m_MetaDataGroup_GetMetaData == nullptr) + throw std::runtime_error("Could not call Lib3MF method MetaDataGroup::GetMetaData."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MetaDataGroup_GetMetaData(instanceHandle, nIndex, &hReturnMetaData); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjMetaData = CLib3MFMetaData::NewInstance(args.Holder(), hReturnMetaData); + args.GetReturnValue().Set(instanceObjMetaData); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMetaDataGroup::GetMetaDataByKey(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (NameSpace)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (Name)"); + } + v8::String::Utf8Value sutf8NameSpace(isolate, args[0]); + std::string sNameSpace = *sutf8NameSpace; + v8::String::Utf8Value sutf8Name(isolate, args[1]); + std::string sName = *sutf8Name; + Lib3MFHandle hReturnMetaData = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMetaDataByKey."); + if (wrapperTable->m_MetaDataGroup_GetMetaDataByKey == nullptr) + throw std::runtime_error("Could not call Lib3MF method MetaDataGroup::GetMetaDataByKey."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MetaDataGroup_GetMetaDataByKey(instanceHandle, sNameSpace.c_str(), sName.c_str(), &hReturnMetaData); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjMetaData = CLib3MFMetaData::NewInstance(args.Holder(), hReturnMetaData); + args.GetReturnValue().Set(instanceObjMetaData); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMetaDataGroup::RemoveMetaDataByIndex(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveMetaDataByIndex."); + if (wrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex == nullptr) + throw std::runtime_error("Could not call Lib3MF method MetaDataGroup::RemoveMetaDataByIndex."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex(instanceHandle, nIndex); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMetaDataGroup::RemoveMetaData(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected class parameter 0 (TheMetaData)"); + } + Local objTheMetaData = args[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); + CLib3MFMetaData * instanceTheMetaData = ObjectWrap::Unwrap(objTheMetaData); + if (instanceTheMetaData == nullptr) + throw std::runtime_error("Invalid Object parameter 0 (TheMetaData)"); + Lib3MFHandle hTheMetaData = instanceTheMetaData->getHandle( objTheMetaData ); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveMetaData."); + if (wrapperTable->m_MetaDataGroup_RemoveMetaData == nullptr) + throw std::runtime_error("Could not call Lib3MF method MetaDataGroup::RemoveMetaData."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MetaDataGroup_RemoveMetaData(instanceHandle, hTheMetaData); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMetaDataGroup::AddMetaData(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (NameSpace)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (Name)"); + } + if (!args[2]->IsString()) { + throw std::runtime_error("Expected string parameter 2 (Value)"); + } + if (!args[3]->IsString()) { + throw std::runtime_error("Expected string parameter 3 (Type)"); + } + if (!args[4]->IsBoolean()) { + throw std::runtime_error("Expected bool parameter 4 (MustPreserve)"); + } + v8::String::Utf8Value sutf8NameSpace(isolate, args[0]); + std::string sNameSpace = *sutf8NameSpace; + v8::String::Utf8Value sutf8Name(isolate, args[1]); + std::string sName = *sutf8Name; + v8::String::Utf8Value sutf8Value(isolate, args[2]); + std::string sValue = *sutf8Value; + v8::String::Utf8Value sutf8Type(isolate, args[3]); + std::string sType = *sutf8Type; + bool bMustPreserve = args[4]->BooleanValue(isolate->GetCurrentContext()).ToChecked(); + Lib3MFHandle hReturnMetaData = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddMetaData."); + if (wrapperTable->m_MetaDataGroup_AddMetaData == nullptr) + throw std::runtime_error("Could not call Lib3MF method MetaDataGroup::AddMetaData."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MetaDataGroup_AddMetaData(instanceHandle, sNameSpace.c_str(), sName.c_str(), sValue.c_str(), sType.c_str(), bMustPreserve, &hReturnMetaData); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjMetaData = CLib3MFMetaData::NewInstance(args.Holder(), hReturnMetaData); + args.GetReturnValue().Set(instanceObjMetaData); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + +/************************************************************************************************************************* + Class CLib3MFObject Implementation +**************************************************************************************************************************/ + +CLib3MFObject::CLib3MFObject() + : CLib3MFBaseClass() +{ +} + +CLib3MFObject::~CLib3MFObject() +{ +} + +void CLib3MFObject::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFObject")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetType", GetType); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetType", SetType); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetName", GetName); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetName", SetName); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetPartNumber", GetPartNumber); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetPartNumber", SetPartNumber); + NODE_SET_PROTOTYPE_METHOD(tpl, "IsMeshObject", IsMeshObject); + NODE_SET_PROTOTYPE_METHOD(tpl, "IsComponentsObject", IsComponentsObject); + NODE_SET_PROTOTYPE_METHOD(tpl, "IsValid", IsValid); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetAttachmentAsThumbnail", SetAttachmentAsThumbnail); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetThumbnailAttachment", GetThumbnailAttachment); + NODE_SET_PROTOTYPE_METHOD(tpl, "ClearThumbnailAttachment", ClearThumbnailAttachment); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutbox", GetOutbox); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetUUID", GetUUID); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetUUID", SetUUID); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetMetaDataGroup", GetMetaDataGroup); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetSlicesMeshResolution", SetSlicesMeshResolution); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetSlicesMeshResolution", GetSlicesMeshResolution); + NODE_SET_PROTOTYPE_METHOD(tpl, "HasSlices", HasSlices); + NODE_SET_PROTOTYPE_METHOD(tpl, "ClearSliceStack", ClearSliceStack); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetSliceStack", GetSliceStack); + NODE_SET_PROTOTYPE_METHOD(tpl, "AssignSliceStack", AssignSliceStack); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFObject::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFObject * objectInstance = new CLib3MFObject(); + objectInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFObject: Invalid call to Constructor"); + } +} + +Local CLib3MFObject::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFObject::GetType(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + eLib3MFObjectType eReturnObjectType; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetType."); + if (wrapperTable->m_Object_GetType == nullptr) + throw std::runtime_error("Could not call Lib3MF method Object::GetType."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Object_GetType(instanceHandle, &eReturnObjectType); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::New(isolate, (int)eReturnObjectType)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFObject::SetType(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected enum parameter 0 (ObjectType)"); + } + unsigned int eObjectType = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetType."); + if (wrapperTable->m_Object_SetType == nullptr) + throw std::runtime_error("Could not call Lib3MF method Object::SetType."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Object_SetType(instanceHandle, (eLib3MFObjectType) eObjectType); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFObject::GetName(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + unsigned int bytesNeededName = 0; + unsigned int bytesWrittenName = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetName."); + if (wrapperTable->m_Object_GetName == nullptr) + throw std::runtime_error("Could not call Lib3MF method Object::GetName."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult initErrorCode = wrapperTable->m_Object_GetName(instanceHandle, 0, &bytesNeededName, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferName; + bufferName.resize(bytesNeededName); + Lib3MFResult errorCode = wrapperTable->m_Object_GetName(instanceHandle, bytesNeededName, &bytesWrittenName, &bufferName[0]); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferName[0])); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFObject::SetName(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetName."); + if (wrapperTable->m_Object_SetName == nullptr) + throw std::runtime_error("Could not call Lib3MF method Object::SetName."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Object_SetName(instanceHandle, sName.c_str()); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFObject::GetPartNumber(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + unsigned int bytesNeededPartNumber = 0; + unsigned int bytesWrittenPartNumber = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetPartNumber."); + if (wrapperTable->m_Object_GetPartNumber == nullptr) + throw std::runtime_error("Could not call Lib3MF method Object::GetPartNumber."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult initErrorCode = wrapperTable->m_Object_GetPartNumber(instanceHandle, 0, &bytesNeededPartNumber, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferPartNumber; + bufferPartNumber.resize(bytesNeededPartNumber); + Lib3MFResult errorCode = wrapperTable->m_Object_GetPartNumber(instanceHandle, bytesNeededPartNumber, &bytesWrittenPartNumber, &bufferPartNumber[0]); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferPartNumber[0])); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFObject::SetPartNumber(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (PartNumber)"); + } + v8::String::Utf8Value sutf8PartNumber(isolate, args[0]); + std::string sPartNumber = *sutf8PartNumber; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetPartNumber."); + if (wrapperTable->m_Object_SetPartNumber == nullptr) + throw std::runtime_error("Could not call Lib3MF method Object::SetPartNumber."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Object_SetPartNumber(instanceHandle, sPartNumber.c_str()); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFObject::IsMeshObject(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + bool bReturnIsMeshObject = false; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method IsMeshObject."); + if (wrapperTable->m_Object_IsMeshObject == nullptr) + throw std::runtime_error("Could not call Lib3MF method Object::IsMeshObject."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Object_IsMeshObject(instanceHandle, &bReturnIsMeshObject); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnIsMeshObject)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFObject::IsComponentsObject(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + bool bReturnIsComponentsObject = false; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method IsComponentsObject."); + if (wrapperTable->m_Object_IsComponentsObject == nullptr) + throw std::runtime_error("Could not call Lib3MF method Object::IsComponentsObject."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Object_IsComponentsObject(instanceHandle, &bReturnIsComponentsObject); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnIsComponentsObject)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFObject::IsValid(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + bool bReturnIsValid = false; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method IsValid."); + if (wrapperTable->m_Object_IsValid == nullptr) + throw std::runtime_error("Could not call Lib3MF method Object::IsValid."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Object_IsValid(instanceHandle, &bReturnIsValid); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnIsValid)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFObject::SetAttachmentAsThumbnail(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected class parameter 0 (Attachment)"); + } + Local objAttachment = args[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); + CLib3MFAttachment * instanceAttachment = ObjectWrap::Unwrap(objAttachment); + if (instanceAttachment == nullptr) + throw std::runtime_error("Invalid Object parameter 0 (Attachment)"); + Lib3MFHandle hAttachment = instanceAttachment->getHandle( objAttachment ); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetAttachmentAsThumbnail."); + if (wrapperTable->m_Object_SetAttachmentAsThumbnail == nullptr) + throw std::runtime_error("Could not call Lib3MF method Object::SetAttachmentAsThumbnail."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Object_SetAttachmentAsThumbnail(instanceHandle, hAttachment); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFObject::GetThumbnailAttachment(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnAttachment = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetThumbnailAttachment."); + if (wrapperTable->m_Object_GetThumbnailAttachment == nullptr) + throw std::runtime_error("Could not call Lib3MF method Object::GetThumbnailAttachment."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Object_GetThumbnailAttachment(instanceHandle, &hReturnAttachment); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjAttachment = CLib3MFAttachment::NewInstance(args.Holder(), hReturnAttachment); + args.GetReturnValue().Set(instanceObjAttachment); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFObject::ClearThumbnailAttachment(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method ClearThumbnailAttachment."); + if (wrapperTable->m_Object_ClearThumbnailAttachment == nullptr) + throw std::runtime_error("Could not call Lib3MF method Object::ClearThumbnailAttachment."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Object_ClearThumbnailAttachment(instanceHandle); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFObject::GetOutbox(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + sLib3MFBox sReturnOutbox; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutbox."); + if (wrapperTable->m_Object_GetOutbox == nullptr) + throw std::runtime_error("Could not call Lib3MF method Object::GetOutbox."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Object_GetOutbox(instanceHandle, &sReturnOutbox); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(convertLib3MFBoxToObject(isolate, sReturnOutbox)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFObject::GetUUID(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Local outObject = Object::New(isolate); + bool bReturnHasUUID = false; + unsigned int bytesNeededUUID = 0; + unsigned int bytesWrittenUUID = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetUUID."); + if (wrapperTable->m_Object_GetUUID == nullptr) + throw std::runtime_error("Could not call Lib3MF method Object::GetUUID."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult initErrorCode = wrapperTable->m_Object_GetUUID(instanceHandle, &bReturnHasUUID, 0, &bytesNeededUUID, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferUUID; + bufferUUID.resize(bytesNeededUUID); + Lib3MFResult errorCode = wrapperTable->m_Object_GetUUID(instanceHandle, &bReturnHasUUID, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0]); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "HasUUID"), Boolean::New(isolate, bReturnHasUUID)); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "UUID"), String::NewFromUtf8(isolate, &bufferUUID[0])); + args.GetReturnValue().Set(outObject); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFObject::SetUUID(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (UUID)"); + } + v8::String::Utf8Value sutf8UUID(isolate, args[0]); + std::string sUUID = *sutf8UUID; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetUUID."); + if (wrapperTable->m_Object_SetUUID == nullptr) + throw std::runtime_error("Could not call Lib3MF method Object::SetUUID."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Object_SetUUID(instanceHandle, sUUID.c_str()); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFObject::GetMetaDataGroup(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnMetaDataGroup = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMetaDataGroup."); + if (wrapperTable->m_Object_GetMetaDataGroup == nullptr) + throw std::runtime_error("Could not call Lib3MF method Object::GetMetaDataGroup."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Object_GetMetaDataGroup(instanceHandle, &hReturnMetaDataGroup); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjMetaDataGroup = CLib3MFMetaDataGroup::NewInstance(args.Holder(), hReturnMetaDataGroup); + args.GetReturnValue().Set(instanceObjMetaDataGroup); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFObject::SetSlicesMeshResolution(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected enum parameter 0 (MeshResolution)"); + } + unsigned int eMeshResolution = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetSlicesMeshResolution."); + if (wrapperTable->m_Object_SetSlicesMeshResolution == nullptr) + throw std::runtime_error("Could not call Lib3MF method Object::SetSlicesMeshResolution."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Object_SetSlicesMeshResolution(instanceHandle, (eLib3MFSlicesMeshResolution) eMeshResolution); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFObject::GetSlicesMeshResolution(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + eLib3MFSlicesMeshResolution eReturnMeshResolution; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetSlicesMeshResolution."); + if (wrapperTable->m_Object_GetSlicesMeshResolution == nullptr) + throw std::runtime_error("Could not call Lib3MF method Object::GetSlicesMeshResolution."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Object_GetSlicesMeshResolution(instanceHandle, &eReturnMeshResolution); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::New(isolate, (int)eReturnMeshResolution)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFObject::HasSlices(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsBoolean()) { + throw std::runtime_error("Expected bool parameter 0 (Recursive)"); + } + bool bRecursive = args[0]->BooleanValue(isolate->GetCurrentContext()).ToChecked(); + bool bReturnHasSlices = false; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method HasSlices."); + if (wrapperTable->m_Object_HasSlices == nullptr) + throw std::runtime_error("Could not call Lib3MF method Object::HasSlices."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Object_HasSlices(instanceHandle, bRecursive, &bReturnHasSlices); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnHasSlices)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFObject::ClearSliceStack(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method ClearSliceStack."); + if (wrapperTable->m_Object_ClearSliceStack == nullptr) + throw std::runtime_error("Could not call Lib3MF method Object::ClearSliceStack."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Object_ClearSliceStack(instanceHandle); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFObject::GetSliceStack(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnSliceStackInstance = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetSliceStack."); + if (wrapperTable->m_Object_GetSliceStack == nullptr) + throw std::runtime_error("Could not call Lib3MF method Object::GetSliceStack."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Object_GetSliceStack(instanceHandle, &hReturnSliceStackInstance); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjSliceStackInstance = CLib3MFSliceStack::NewInstance(args.Holder(), hReturnSliceStackInstance); + args.GetReturnValue().Set(instanceObjSliceStackInstance); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFObject::AssignSliceStack(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected class parameter 0 (SliceStackInstance)"); + } + Local objSliceStackInstance = args[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); + CLib3MFSliceStack * instanceSliceStackInstance = ObjectWrap::Unwrap(objSliceStackInstance); + if (instanceSliceStackInstance == nullptr) + throw std::runtime_error("Invalid Object parameter 0 (SliceStackInstance)"); + Lib3MFHandle hSliceStackInstance = instanceSliceStackInstance->getHandle( objSliceStackInstance ); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method AssignSliceStack."); + if (wrapperTable->m_Object_AssignSliceStack == nullptr) + throw std::runtime_error("Could not call Lib3MF method Object::AssignSliceStack."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Object_AssignSliceStack(instanceHandle, hSliceStackInstance); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjResource = CLib3MFColorGroup::NewInstance(args.Holder(), hReturnResource); - args.GetReturnValue().Set(instanceObjResource); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -3011,78 +6436,553 @@ void CLib3MFColorGroupIterator::GetCurrentColorGroup(const FunctionCallbackInfo< } /************************************************************************************************************************* - Class CLib3MFTexture2DGroupIterator Implementation + Class CLib3MFMeshObject Implementation **************************************************************************************************************************/ -CLib3MFTexture2DGroupIterator::CLib3MFTexture2DGroupIterator() - : CLib3MFBaseClass() +CLib3MFMeshObject::CLib3MFMeshObject() + : CLib3MFBaseClass() +{ +} + +CLib3MFMeshObject::~CLib3MFMeshObject() +{ +} + +void CLib3MFMeshObject::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFMeshObject")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetVertexCount", GetVertexCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetTriangleCount", GetTriangleCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetVertex", GetVertex); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetVertex", SetVertex); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddVertex", AddVertex); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetVertices", GetVertices); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetTriangle", GetTriangle); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetTriangle", SetTriangle); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddTriangle", AddTriangle); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetTriangleIndices", GetTriangleIndices); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetObjectLevelProperty", SetObjectLevelProperty); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetObjectLevelProperty", GetObjectLevelProperty); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetTriangleProperties", SetTriangleProperties); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetTriangleProperties", GetTriangleProperties); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetAllTriangleProperties", SetAllTriangleProperties); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetAllTriangleProperties", GetAllTriangleProperties); + NODE_SET_PROTOTYPE_METHOD(tpl, "ClearAllProperties", ClearAllProperties); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetGeometry", SetGeometry); + NODE_SET_PROTOTYPE_METHOD(tpl, "IsManifoldAndOriented", IsManifoldAndOriented); + NODE_SET_PROTOTYPE_METHOD(tpl, "BeamLattice", BeamLattice); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFMeshObject::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFMeshObject * meshobjectInstance = new CLib3MFMeshObject(); + meshobjectInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFMeshObject: Invalid call to Constructor"); + } +} + +Local CLib3MFMeshObject::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFMeshObject::GetVertexCount(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + unsigned int nReturnVertexCount = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetVertexCount."); + if (wrapperTable->m_MeshObject_GetVertexCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method MeshObject::GetVertexCount."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MeshObject_GetVertexCount(instanceHandle, &nReturnVertexCount); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnVertexCount)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMeshObject::GetTriangleCount(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + unsigned int nReturnVertexCount = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetTriangleCount."); + if (wrapperTable->m_MeshObject_GetTriangleCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method MeshObject::GetTriangleCount."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MeshObject_GetTriangleCount(instanceHandle, &nReturnVertexCount); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnVertexCount)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMeshObject::GetVertex(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFPosition sReturnCoordinates; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetVertex."); + if (wrapperTable->m_MeshObject_GetVertex == nullptr) + throw std::runtime_error("Could not call Lib3MF method MeshObject::GetVertex."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MeshObject_GetVertex(instanceHandle, nIndex, &sReturnCoordinates); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(convertLib3MFPositionToObject(isolate, sReturnCoordinates)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMeshObject::SetVertex(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + if (!args[1]->IsObject()) { + throw std::runtime_error("Expected struct parameter 1 (Coordinates)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFPosition sCoordinates = convertObjectToLib3MFPosition(isolate, args[1]); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetVertex."); + if (wrapperTable->m_MeshObject_SetVertex == nullptr) + throw std::runtime_error("Could not call Lib3MF method MeshObject::SetVertex."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MeshObject_SetVertex(instanceHandle, nIndex, &sCoordinates); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMeshObject::AddVertex(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected struct parameter 0 (Coordinates)"); + } + sLib3MFPosition sCoordinates = convertObjectToLib3MFPosition(isolate, args[0]); + unsigned int nReturnNewIndex = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddVertex."); + if (wrapperTable->m_MeshObject_AddVertex == nullptr) + throw std::runtime_error("Could not call Lib3MF method MeshObject::AddVertex."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MeshObject_AddVertex(instanceHandle, &sCoordinates, &nReturnNewIndex); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnNewIndex)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMeshObject::GetVertices(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetVertices."); + if (wrapperTable->m_MeshObject_GetVertices == nullptr) + throw std::runtime_error("Could not call Lib3MF method MeshObject::GetVertices."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MeshObject_GetVertices(instanceHandle, 0, nullptr, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMeshObject::GetTriangle(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFTriangle sReturnIndices; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetTriangle."); + if (wrapperTable->m_MeshObject_GetTriangle == nullptr) + throw std::runtime_error("Could not call Lib3MF method MeshObject::GetTriangle."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MeshObject_GetTriangle(instanceHandle, nIndex, &sReturnIndices); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(convertLib3MFTriangleToObject(isolate, sReturnIndices)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMeshObject::SetTriangle(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + if (!args[1]->IsObject()) { + throw std::runtime_error("Expected struct parameter 1 (Indices)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFTriangle sIndices = convertObjectToLib3MFTriangle(isolate, args[1]); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetTriangle."); + if (wrapperTable->m_MeshObject_SetTriangle == nullptr) + throw std::runtime_error("Could not call Lib3MF method MeshObject::SetTriangle."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MeshObject_SetTriangle(instanceHandle, nIndex, &sIndices); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMeshObject::AddTriangle(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected struct parameter 0 (Indices)"); + } + sLib3MFTriangle sIndices = convertObjectToLib3MFTriangle(isolate, args[0]); + unsigned int nReturnNewIndex = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddTriangle."); + if (wrapperTable->m_MeshObject_AddTriangle == nullptr) + throw std::runtime_error("Could not call Lib3MF method MeshObject::AddTriangle."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MeshObject_AddTriangle(instanceHandle, &sIndices, &nReturnNewIndex); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnNewIndex)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMeshObject::GetTriangleIndices(const FunctionCallbackInfo& args) { + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetTriangleIndices."); + if (wrapperTable->m_MeshObject_GetTriangleIndices == nullptr) + throw std::runtime_error("Could not call Lib3MF method MeshObject::GetTriangleIndices."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MeshObject_GetTriangleIndices(instanceHandle, 0, nullptr, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } } -CLib3MFTexture2DGroupIterator::~CLib3MFTexture2DGroupIterator() + +void CLib3MFMeshObject::SetObjectLevelProperty(const FunctionCallbackInfo& args) { + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (UniqueResourceID)"); + } + if (!args[1]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 1 (PropertyID)"); + } + unsigned int nUniqueResourceID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int nPropertyID = (unsigned int) args[1]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetObjectLevelProperty."); + if (wrapperTable->m_MeshObject_SetObjectLevelProperty == nullptr) + throw std::runtime_error("Could not call Lib3MF method MeshObject::SetObjectLevelProperty."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MeshObject_SetObjectLevelProperty(instanceHandle, nUniqueResourceID, nPropertyID); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } } -void CLib3MFTexture2DGroupIterator::Init() + +void CLib3MFMeshObject::GetObjectLevelProperty(const FunctionCallbackInfo& args) { - Isolate* isolate = Isolate::GetCurrent(); + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Local outObject = Object::New(isolate); + unsigned int nReturnUniqueResourceID = 0; + unsigned int nReturnPropertyID = 0; + bool bReturnHasObjectLevelProperty = false; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetObjectLevelProperty."); + if (wrapperTable->m_MeshObject_GetObjectLevelProperty == nullptr) + throw std::runtime_error("Could not call Lib3MF method MeshObject::GetObjectLevelProperty."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MeshObject_GetObjectLevelProperty(instanceHandle, &nReturnUniqueResourceID, &nReturnPropertyID, &bReturnHasObjectLevelProperty); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "UniqueResourceID"), Integer::NewFromUnsigned(isolate, nReturnUniqueResourceID)); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "PropertyID"), Integer::NewFromUnsigned(isolate, nReturnPropertyID)); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "HasObjectLevelProperty"), Boolean::New(isolate, bReturnHasObjectLevelProperty)); + args.GetReturnValue().Set(outObject); - // Prepare constructor template - Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFTexture2DGroupIterator")); - tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} - // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetCurrentTexture2DGroup", GetCurrentTexture2DGroup); - constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); +void CLib3MFMeshObject::SetTriangleProperties(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + if (!args[1]->IsObject()) { + throw std::runtime_error("Expected struct parameter 1 (Properties)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFTriangleProperties sProperties = convertObjectToLib3MFTriangleProperties(isolate, args[1]); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetTriangleProperties."); + if (wrapperTable->m_MeshObject_SetTriangleProperties == nullptr) + throw std::runtime_error("Could not call Lib3MF method MeshObject::SetTriangleProperties."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MeshObject_SetTriangleProperties(instanceHandle, nIndex, &sProperties); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } } -void CLib3MFTexture2DGroupIterator::New(const FunctionCallbackInfo& args) + +void CLib3MFMeshObject::GetTriangleProperties(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFTriangleProperties sReturnProperty; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetTriangleProperties."); + if (wrapperTable->m_MeshObject_GetTriangleProperties == nullptr) + throw std::runtime_error("Could not call Lib3MF method MeshObject::GetTriangleProperties."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MeshObject_GetTriangleProperties(instanceHandle, nIndex, &sReturnProperty); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(convertLib3MFTrianglePropertiesToObject(isolate, sReturnProperty)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMeshObject::SetAllTriangleProperties(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); + try { + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetAllTriangleProperties."); + if (wrapperTable->m_MeshObject_SetAllTriangleProperties == nullptr) + throw std::runtime_error("Could not call Lib3MF method MeshObject::SetAllTriangleProperties."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MeshObject_SetAllTriangleProperties(instanceHandle, 0, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); - if (args.IsConstructCall()) { - CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFTexture2DGroupIterator * texture2dgroupiteratorInstance = new CLib3MFTexture2DGroupIterator(); - texture2dgroupiteratorInstance->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - RaiseError(isolate, "Lib3MFTexture2DGroupIterator: Invalid call to Constructor"); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } } -Local CLib3MFTexture2DGroupIterator::NewInstance(Local pParent, Lib3MFHandle pHandle) + +void CLib3MFMeshObject::GetAllTriangleProperties(const FunctionCallbackInfo& args) { - Isolate* isolate = Isolate::GetCurrent(); + Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); - Local cons = Local::New(isolate, constructor); - Local instance; - if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { - instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); - instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + try { + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetAllTriangleProperties."); + if (wrapperTable->m_MeshObject_GetAllTriangleProperties == nullptr) + throw std::runtime_error("Could not call Lib3MF method MeshObject::GetAllTriangleProperties."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MeshObject_GetAllTriangleProperties(instanceHandle, 0, nullptr, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } - return instance; } -void CLib3MFTexture2DGroupIterator::GetCurrentTexture2DGroup(const FunctionCallbackInfo& args) +void CLib3MFMeshObject::ClearAllProperties(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnResource = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCurrentTexture2DGroup."); - if (wrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup == nullptr) - throw std::runtime_error("Could not call Lib3MF method Texture2DGroupIterator::GetCurrentTexture2DGroup."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method ClearAllProperties."); + if (wrapperTable->m_MeshObject_ClearAllProperties == nullptr) + throw std::runtime_error("Could not call Lib3MF method MeshObject::ClearAllProperties."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MeshObject_ClearAllProperties(instanceHandle); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMeshObject::SetGeometry(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetGeometry."); + if (wrapperTable->m_MeshObject_SetGeometry == nullptr) + throw std::runtime_error("Could not call Lib3MF method MeshObject::SetGeometry."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MeshObject_SetGeometry(instanceHandle, 0, nullptr, 0, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMeshObject::IsManifoldAndOriented(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + bool bReturnIsManifoldAndOriented = false; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method IsManifoldAndOriented."); + if (wrapperTable->m_MeshObject_IsManifoldAndOriented == nullptr) + throw std::runtime_error("Could not call Lib3MF method MeshObject::IsManifoldAndOriented."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_MeshObject_IsManifoldAndOriented(instanceHandle, &bReturnIsManifoldAndOriented); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnIsManifoldAndOriented)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFMeshObject::BeamLattice(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnTheBeamLattice = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method BeamLattice."); + if (wrapperTable->m_MeshObject_BeamLattice == nullptr) + throw std::runtime_error("Could not call Lib3MF method MeshObject::BeamLattice."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Texture2DGroupIterator_GetCurrentTexture2DGroup(instanceHandle, &hReturnResource); + Lib3MFResult errorCode = wrapperTable->m_MeshObject_BeamLattice(instanceHandle, &hReturnTheBeamLattice); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjResource = CLib3MFTexture2DGroup::NewInstance(args.Holder(), hReturnResource); - args.GetReturnValue().Set(instanceObjResource); + Local instanceObjTheBeamLattice = CLib3MFBeamLattice::NewInstance(args.Holder(), hReturnTheBeamLattice); + args.GetReturnValue().Set(instanceObjTheBeamLattice); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -3090,49 +6990,71 @@ void CLib3MFTexture2DGroupIterator::GetCurrentTexture2DGroup(const FunctionCallb } /************************************************************************************************************************* - Class CLib3MFCompositeMaterialsIterator Implementation + Class CLib3MFBeamLattice Implementation **************************************************************************************************************************/ -CLib3MFCompositeMaterialsIterator::CLib3MFCompositeMaterialsIterator() +CLib3MFBeamLattice::CLib3MFBeamLattice() : CLib3MFBaseClass() { } -CLib3MFCompositeMaterialsIterator::~CLib3MFCompositeMaterialsIterator() +CLib3MFBeamLattice::~CLib3MFBeamLattice() { } -void CLib3MFCompositeMaterialsIterator::Init() +void CLib3MFBeamLattice::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFCompositeMaterialsIterator")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFBeamLattice")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetCurrentCompositeMaterials", GetCurrentCompositeMaterials); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetMinLength", GetMinLength); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetMinLength", SetMinLength); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetClipping", GetClipping); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetClipping", SetClipping); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetRepresentation", GetRepresentation); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetRepresentation", SetRepresentation); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBallOptions", GetBallOptions); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetBallOptions", SetBallOptions); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBeamCount", GetBeamCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBeam", GetBeam); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddBeam", AddBeam); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetBeam", SetBeam); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetBeams", SetBeams); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBeams", GetBeams); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBallCount", GetBallCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBall", GetBall); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddBall", AddBall); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetBall", SetBall); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetBalls", SetBalls); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBalls", GetBalls); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBeamSetCount", GetBeamSetCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddBeamSet", AddBeamSet); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBeamSet", GetBeamSet); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFCompositeMaterialsIterator::New(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFCompositeMaterialsIterator * compositematerialsiteratorInstance = new CLib3MFCompositeMaterialsIterator(); - compositematerialsiteratorInstance->Wrap(args.This()); + CLib3MFBeamLattice * beamlatticeInstance = new CLib3MFBeamLattice(); + beamlatticeInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFCompositeMaterialsIterator: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFBeamLattice: Invalid call to Constructor"); } } -Local CLib3MFCompositeMaterialsIterator::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFBeamLattice::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -3146,194 +7068,325 @@ Local CLib3MFCompositeMaterialsIterator::NewInstance(Local pPare } -void CLib3MFCompositeMaterialsIterator::GetCurrentCompositeMaterials(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::GetMinLength(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnResource = nullptr; + double dReturnMinLength = 0.0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCurrentCompositeMaterials."); - if (wrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials == nullptr) - throw std::runtime_error("Could not call Lib3MF method CompositeMaterialsIterator::GetCurrentCompositeMaterials."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMinLength."); + if (wrapperTable->m_BeamLattice_GetMinLength == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetMinLength."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_CompositeMaterialsIterator_GetCurrentCompositeMaterials(instanceHandle, &hReturnResource); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetMinLength(instanceHandle, &dReturnMinLength); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjResource = CLib3MFCompositeMaterials::NewInstance(args.Holder(), hReturnResource); - args.GetReturnValue().Set(instanceObjResource); + args.GetReturnValue().Set(Number::New(isolate, dReturnMinLength)); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } -/************************************************************************************************************************* - Class CLib3MFMultiPropertyGroupIterator Implementation -**************************************************************************************************************************/ -CLib3MFMultiPropertyGroupIterator::CLib3MFMultiPropertyGroupIterator() - : CLib3MFBaseClass() +void CLib3MFBeamLattice::SetMinLength(const FunctionCallbackInfo& args) { + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsNumber()) { + throw std::runtime_error("Expected double parameter 0 (MinLength)"); + } + double dMinLength = (double) args[0]->NumberValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetMinLength."); + if (wrapperTable->m_BeamLattice_SetMinLength == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetMinLength."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetMinLength(instanceHandle, dMinLength); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } } -CLib3MFMultiPropertyGroupIterator::~CLib3MFMultiPropertyGroupIterator() + +void CLib3MFBeamLattice::GetClipping(const FunctionCallbackInfo& args) { + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Local outObject = Object::New(isolate); + eLib3MFBeamLatticeClipMode eReturnClipMode; + unsigned int nReturnUniqueResourceID = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetClipping."); + if (wrapperTable->m_BeamLattice_GetClipping == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetClipping."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetClipping(instanceHandle, &eReturnClipMode, &nReturnUniqueResourceID); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "ClipMode"), Integer::New(isolate, (int)eReturnClipMode)); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "UniqueResourceID"), Integer::NewFromUnsigned(isolate, nReturnUniqueResourceID)); + args.GetReturnValue().Set(outObject); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } } -void CLib3MFMultiPropertyGroupIterator::Init() + +void CLib3MFBeamLattice::SetClipping(const FunctionCallbackInfo& args) { - Isolate* isolate = Isolate::GetCurrent(); + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected enum parameter 0 (ClipMode)"); + } + if (!args[1]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 1 (UniqueResourceID)"); + } + unsigned int eClipMode = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int nUniqueResourceID = (unsigned int) args[1]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetClipping."); + if (wrapperTable->m_BeamLattice_SetClipping == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetClipping."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetClipping(instanceHandle, (eLib3MFBeamLatticeClipMode) eClipMode, nUniqueResourceID); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); - // Prepare constructor template - Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFMultiPropertyGroupIterator")); - tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} - // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetCurrentMultiPropertyGroup", GetCurrentMultiPropertyGroup); - constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); +void CLib3MFBeamLattice::GetRepresentation(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Local outObject = Object::New(isolate); + bool bReturnHasRepresentation = false; + unsigned int nReturnUniqueResourceID = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetRepresentation."); + if (wrapperTable->m_BeamLattice_GetRepresentation == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetRepresentation."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetRepresentation(instanceHandle, &bReturnHasRepresentation, &nReturnUniqueResourceID); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "HasRepresentation"), Boolean::New(isolate, bReturnHasRepresentation)); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "UniqueResourceID"), Integer::NewFromUnsigned(isolate, nReturnUniqueResourceID)); + args.GetReturnValue().Set(outObject); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } } -void CLib3MFMultiPropertyGroupIterator::New(const FunctionCallbackInfo& args) + +void CLib3MFBeamLattice::SetRepresentation(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (UniqueResourceID)"); + } + unsigned int nUniqueResourceID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetRepresentation."); + if (wrapperTable->m_BeamLattice_SetRepresentation == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetRepresentation."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetRepresentation(instanceHandle, nUniqueResourceID); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); - if (args.IsConstructCall()) { - CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFMultiPropertyGroupIterator * multipropertygroupiteratorInstance = new CLib3MFMultiPropertyGroupIterator(); - multipropertygroupiteratorInstance->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - RaiseError(isolate, "Lib3MFMultiPropertyGroupIterator: Invalid call to Constructor"); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } } -Local CLib3MFMultiPropertyGroupIterator::NewInstance(Local pParent, Lib3MFHandle pHandle) + +void CLib3MFBeamLattice::GetBallOptions(const FunctionCallbackInfo& args) { - Isolate* isolate = Isolate::GetCurrent(); + Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); - Local cons = Local::New(isolate, constructor); - Local instance; - if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { - instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); - instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + try { + Local outObject = Object::New(isolate); + eLib3MFBeamLatticeBallMode eReturnBallMode; + double dReturnBallRadius = 0.0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBallOptions."); + if (wrapperTable->m_BeamLattice_GetBallOptions == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBallOptions."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBallOptions(instanceHandle, &eReturnBallMode, &dReturnBallRadius); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "BallMode"), Integer::New(isolate, (int)eReturnBallMode)); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "BallRadius"), Number::New(isolate, dReturnBallRadius)); + args.GetReturnValue().Set(outObject); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFBeamLattice::SetBallOptions(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected enum parameter 0 (BallMode)"); + } + if (!args[1]->IsNumber()) { + throw std::runtime_error("Expected double parameter 1 (BallRadius)"); + } + unsigned int eBallMode = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + double dBallRadius = (double) args[1]->NumberValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBallOptions."); + if (wrapperTable->m_BeamLattice_SetBallOptions == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetBallOptions."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetBallOptions(instanceHandle, (eLib3MFBeamLatticeBallMode) eBallMode, dBallRadius); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } - return instance; } -void CLib3MFMultiPropertyGroupIterator::GetCurrentMultiPropertyGroup(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::GetBeamCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnResource = nullptr; + unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCurrentMultiPropertyGroup."); - if (wrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup == nullptr) - throw std::runtime_error("Could not call Lib3MF method MultiPropertyGroupIterator::GetCurrentMultiPropertyGroup."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBeamCount."); + if (wrapperTable->m_BeamLattice_GetBeamCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBeamCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup(instanceHandle, &hReturnResource); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBeamCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjResource = CLib3MFMultiPropertyGroup::NewInstance(args.Holder(), hReturnResource); - args.GetReturnValue().Set(instanceObjResource); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } -/************************************************************************************************************************* - Class CLib3MFMetaData Implementation -**************************************************************************************************************************/ -CLib3MFMetaData::CLib3MFMetaData() - : CLib3MFBaseClass() +void CLib3MFBeamLattice::GetBeam(const FunctionCallbackInfo& args) { -} + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFBeam sReturnBeamInfo; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBeam."); + if (wrapperTable->m_BeamLattice_GetBeam == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBeam."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBeam(instanceHandle, nIndex, &sReturnBeamInfo); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(convertLib3MFBeamToObject(isolate, sReturnBeamInfo)); -CLib3MFMetaData::~CLib3MFMetaData() -{ + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } } -void CLib3MFMetaData::Init() -{ - Isolate* isolate = Isolate::GetCurrent(); - - // Prepare constructor template - Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFMetaData")); - tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); - - // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetNameSpace", GetNameSpace); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetNameSpace", SetNameSpace); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetName", GetName); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetName", SetName); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetKey", GetKey); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetMustPreserve", GetMustPreserve); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetMustPreserve", SetMustPreserve); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetType", GetType); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetType", SetType); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetValue", GetValue); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetValue", SetValue); - constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); - -} -void CLib3MFMetaData::New(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::AddBeam(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); + try { + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected struct parameter 0 (BeamInfo)"); + } + sLib3MFBeam sBeamInfo = convertObjectToLib3MFBeam(isolate, args[0]); + unsigned int nReturnIndex = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddBeam."); + if (wrapperTable->m_BeamLattice_AddBeam == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::AddBeam."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_AddBeam(instanceHandle, &sBeamInfo, &nReturnIndex); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnIndex)); - if (args.IsConstructCall()) { - CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFMetaData * metadataInstance = new CLib3MFMetaData(); - metadataInstance->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - RaiseError(isolate, "Lib3MFMetaData: Invalid call to Constructor"); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } } -Local CLib3MFMetaData::NewInstance(Local pParent, Lib3MFHandle pHandle) + +void CLib3MFBeamLattice::SetBeam(const FunctionCallbackInfo& args) { - Isolate* isolate = Isolate::GetCurrent(); + Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); - Local cons = Local::New(isolate, constructor); - Local instance; - if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { - instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); - instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + if (!args[1]->IsObject()) { + throw std::runtime_error("Expected struct parameter 1 (BeamInfo)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFBeam sBeamInfo = convertObjectToLib3MFBeam(isolate, args[1]); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBeam."); + if (wrapperTable->m_BeamLattice_SetBeam == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetBeam."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetBeam(instanceHandle, nIndex, &sBeamInfo); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } - return instance; } -void CLib3MFMetaData::GetNameSpace(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::SetBeams(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int bytesNeededNameSpace = 0; - unsigned int bytesWrittenNameSpace = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetNameSpace."); - if (wrapperTable->m_MetaData_GetNameSpace == nullptr) - throw std::runtime_error("Could not call Lib3MF method MetaData::GetNameSpace."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBeams."); + if (wrapperTable->m_BeamLattice_SetBeams == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetBeams."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult initErrorCode = wrapperTable->m_MetaData_GetNameSpace(instanceHandle, 0, &bytesNeededNameSpace, nullptr); - CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); - std::vector bufferNameSpace; - bufferNameSpace.resize(bytesNeededNameSpace); - Lib3MFResult errorCode = wrapperTable->m_MetaData_GetNameSpace(instanceHandle, bytesNeededNameSpace, &bytesWrittenNameSpace, &bufferNameSpace[0]); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetBeams(instanceHandle, 0, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferNameSpace[0])); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -3341,23 +7394,18 @@ void CLib3MFMetaData::GetNameSpace(const FunctionCallbackInfo& args) } -void CLib3MFMetaData::SetNameSpace(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::GetBeams(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsString()) { - throw std::runtime_error("Expected string parameter 0 (NameSpace)"); - } - v8::String::Utf8Value sutf8NameSpace(isolate, args[0]); - std::string sNameSpace = *sutf8NameSpace; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetNameSpace."); - if (wrapperTable->m_MetaData_SetNameSpace == nullptr) - throw std::runtime_error("Could not call Lib3MF method MetaData::SetNameSpace."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBeams."); + if (wrapperTable->m_BeamLattice_GetBeams == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBeams."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MetaData_SetNameSpace(instanceHandle, sNameSpace.c_str()); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBeams(instanceHandle, 0, nullptr, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -3366,26 +7414,21 @@ void CLib3MFMetaData::SetNameSpace(const FunctionCallbackInfo& args) } -void CLib3MFMetaData::GetName(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::GetBallCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int bytesNeededName = 0; - unsigned int bytesWrittenName = 0; + unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetName."); - if (wrapperTable->m_MetaData_GetName == nullptr) - throw std::runtime_error("Could not call Lib3MF method MetaData::GetName."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBallCount."); + if (wrapperTable->m_BeamLattice_GetBallCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBallCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult initErrorCode = wrapperTable->m_MetaData_GetName(instanceHandle, 0, &bytesNeededName, nullptr); - CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); - std::vector bufferName; - bufferName.resize(bytesNeededName); - Lib3MFResult errorCode = wrapperTable->m_MetaData_GetName(instanceHandle, bytesNeededName, &bytesWrittenName, &bufferName[0]); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBallCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferName[0])); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -3393,24 +7436,25 @@ void CLib3MFMetaData::GetName(const FunctionCallbackInfo& args) } -void CLib3MFMetaData::SetName(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::GetBall(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsString()) { - throw std::runtime_error("Expected string parameter 0 (Name)"); + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); } - v8::String::Utf8Value sutf8Name(isolate, args[0]); - std::string sName = *sutf8Name; + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFBall sReturnBallInfo; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetName."); - if (wrapperTable->m_MetaData_SetName == nullptr) - throw std::runtime_error("Could not call Lib3MF method MetaData::SetName."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBall."); + if (wrapperTable->m_BeamLattice_GetBall == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBall."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MetaData_SetName(instanceHandle, sName.c_str()); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBall(instanceHandle, nIndex, &sReturnBallInfo); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(convertLib3MFBallToObject(isolate, sReturnBallInfo)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -3418,26 +7462,25 @@ void CLib3MFMetaData::SetName(const FunctionCallbackInfo& args) } -void CLib3MFMetaData::GetKey(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::AddBall(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int bytesNeededKey = 0; - unsigned int bytesWrittenKey = 0; + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected struct parameter 0 (BallInfo)"); + } + sLib3MFBall sBallInfo = convertObjectToLib3MFBall(isolate, args[0]); + unsigned int nReturnIndex = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetKey."); - if (wrapperTable->m_MetaData_GetKey == nullptr) - throw std::runtime_error("Could not call Lib3MF method MetaData::GetKey."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddBall."); + if (wrapperTable->m_BeamLattice_AddBall == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::AddBall."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult initErrorCode = wrapperTable->m_MetaData_GetKey(instanceHandle, 0, &bytesNeededKey, nullptr); - CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); - std::vector bufferKey; - bufferKey.resize(bytesNeededKey); - Lib3MFResult errorCode = wrapperTable->m_MetaData_GetKey(instanceHandle, bytesNeededKey, &bytesWrittenKey, &bufferKey[0]); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_AddBall(instanceHandle, &sBallInfo, &nReturnIndex); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferKey[0])); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnIndex)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -3445,21 +7488,27 @@ void CLib3MFMetaData::GetKey(const FunctionCallbackInfo& args) } -void CLib3MFMetaData::GetMustPreserve(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::SetBall(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - bool bReturnMustPreserve = false; + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + if (!args[1]->IsObject()) { + throw std::runtime_error("Expected struct parameter 1 (BallInfo)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFBall sBallInfo = convertObjectToLib3MFBall(isolate, args[1]); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMustPreserve."); - if (wrapperTable->m_MetaData_GetMustPreserve == nullptr) - throw std::runtime_error("Could not call Lib3MF method MetaData::GetMustPreserve."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBall."); + if (wrapperTable->m_BeamLattice_SetBall == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetBall."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MetaData_GetMustPreserve(instanceHandle, &bReturnMustPreserve); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetBall(instanceHandle, nIndex, &sBallInfo); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Boolean::New(isolate, bReturnMustPreserve)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -3467,22 +7516,18 @@ void CLib3MFMetaData::GetMustPreserve(const FunctionCallbackInfo& args) } -void CLib3MFMetaData::SetMustPreserve(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::SetBalls(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsBoolean()) { - throw std::runtime_error("Expected bool parameter 0 (MustPreserve)"); - } - bool bMustPreserve = args[0]->BooleanValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetMustPreserve."); - if (wrapperTable->m_MetaData_SetMustPreserve == nullptr) - throw std::runtime_error("Could not call Lib3MF method MetaData::SetMustPreserve."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBalls."); + if (wrapperTable->m_BeamLattice_SetBalls == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetBalls."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MetaData_SetMustPreserve(instanceHandle, bMustPreserve); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetBalls(instanceHandle, 0, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -3491,26 +7536,19 @@ void CLib3MFMetaData::SetMustPreserve(const FunctionCallbackInfo& args) } -void CLib3MFMetaData::GetType(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::GetBalls(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int bytesNeededType = 0; - unsigned int bytesWrittenType = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetType."); - if (wrapperTable->m_MetaData_GetType == nullptr) - throw std::runtime_error("Could not call Lib3MF method MetaData::GetType."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBalls."); + if (wrapperTable->m_BeamLattice_GetBalls == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBalls."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult initErrorCode = wrapperTable->m_MetaData_GetType(instanceHandle, 0, &bytesNeededType, nullptr); - CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); - std::vector bufferType; - bufferType.resize(bytesNeededType); - Lib3MFResult errorCode = wrapperTable->m_MetaData_GetType(instanceHandle, bytesNeededType, &bytesWrittenType, &bufferType[0]); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBalls(instanceHandle, 0, nullptr, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferType[0])); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -3518,24 +7556,21 @@ void CLib3MFMetaData::GetType(const FunctionCallbackInfo& args) } -void CLib3MFMetaData::SetType(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::GetBeamSetCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsString()) { - throw std::runtime_error("Expected string parameter 0 (Type)"); - } - v8::String::Utf8Value sutf8Type(isolate, args[0]); - std::string sType = *sutf8Type; + unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetType."); - if (wrapperTable->m_MetaData_SetType == nullptr) - throw std::runtime_error("Could not call Lib3MF method MetaData::SetType."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBeamSetCount."); + if (wrapperTable->m_BeamLattice_GetBeamSetCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBeamSetCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MetaData_SetType(instanceHandle, sType.c_str()); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBeamSetCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -3543,26 +7578,22 @@ void CLib3MFMetaData::SetType(const FunctionCallbackInfo& args) } -void CLib3MFMetaData::GetValue(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::AddBeamSet(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int bytesNeededValue = 0; - unsigned int bytesWrittenValue = 0; + Lib3MFHandle hReturnBeamSet = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetValue."); - if (wrapperTable->m_MetaData_GetValue == nullptr) - throw std::runtime_error("Could not call Lib3MF method MetaData::GetValue."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddBeamSet."); + if (wrapperTable->m_BeamLattice_AddBeamSet == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::AddBeamSet."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult initErrorCode = wrapperTable->m_MetaData_GetValue(instanceHandle, 0, &bytesNeededValue, nullptr); - CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); - std::vector bufferValue; - bufferValue.resize(bytesNeededValue); - Lib3MFResult errorCode = wrapperTable->m_MetaData_GetValue(instanceHandle, bytesNeededValue, &bytesWrittenValue, &bufferValue[0]); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_AddBeamSet(instanceHandle, &hReturnBeamSet); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferValue[0])); + Local instanceObjBeamSet = CLib3MFBeamSet::NewInstance(args.Holder(), hReturnBeamSet); + args.GetReturnValue().Set(instanceObjBeamSet); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -3570,24 +7601,26 @@ void CLib3MFMetaData::GetValue(const FunctionCallbackInfo& args) } -void CLib3MFMetaData::SetValue(const FunctionCallbackInfo& args) +void CLib3MFBeamLattice::GetBeamSet(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsString()) { - throw std::runtime_error("Expected string parameter 0 (Value)"); + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); } - v8::String::Utf8Value sutf8Value(isolate, args[0]); - std::string sValue = *sutf8Value; + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + Lib3MFHandle hReturnBeamSet = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetValue."); - if (wrapperTable->m_MetaData_SetValue == nullptr) - throw std::runtime_error("Could not call Lib3MF method MetaData::SetValue."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBeamSet."); + if (wrapperTable->m_BeamLattice_GetBeamSet == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBeamSet."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MetaData_SetValue(instanceHandle, sValue.c_str()); + Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBeamSet(instanceHandle, nIndex, &hReturnBeamSet); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjBeamSet = CLib3MFBeamSet::NewInstance(args.Holder(), hReturnBeamSet); + args.GetReturnValue().Set(instanceObjBeamSet); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -3595,54 +7628,55 @@ void CLib3MFMetaData::SetValue(const FunctionCallbackInfo& args) } /************************************************************************************************************************* - Class CLib3MFMetaDataGroup Implementation + Class CLib3MFComponent Implementation **************************************************************************************************************************/ -CLib3MFMetaDataGroup::CLib3MFMetaDataGroup() +CLib3MFComponent::CLib3MFComponent() : CLib3MFBaseClass() { } -CLib3MFMetaDataGroup::~CLib3MFMetaDataGroup() +CLib3MFComponent::~CLib3MFComponent() { } -void CLib3MFMetaDataGroup::Init() +void CLib3MFComponent::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFMetaDataGroup")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFComponent")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetMetaDataCount", GetMetaDataCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetMetaData", GetMetaData); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetMetaDataByKey", GetMetaDataByKey); - NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveMetaDataByIndex", RemoveMetaDataByIndex); - NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveMetaData", RemoveMetaData); - NODE_SET_PROTOTYPE_METHOD(tpl, "AddMetaData", AddMetaData); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetObjectResource", GetObjectResource); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetObjectResourceID", GetObjectResourceID); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetUUID", GetUUID); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetUUID", SetUUID); + NODE_SET_PROTOTYPE_METHOD(tpl, "HasTransform", HasTransform); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetTransform", GetTransform); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetTransform", SetTransform); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFMetaDataGroup::New(const FunctionCallbackInfo& args) +void CLib3MFComponent::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFMetaDataGroup * metadatagroupInstance = new CLib3MFMetaDataGroup(); - metadatagroupInstance->Wrap(args.This()); + CLib3MFComponent * componentInstance = new CLib3MFComponent(); + componentInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFMetaDataGroup: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFComponent: Invalid call to Constructor"); } } -Local CLib3MFMetaDataGroup::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFComponent::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -3656,21 +7690,22 @@ Local CLib3MFMetaDataGroup::NewInstance(Local pParent, Lib3MFHan } -void CLib3MFMetaDataGroup::GetMetaDataCount(const FunctionCallbackInfo& args) +void CLib3MFComponent::GetObjectResource(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int nReturnCount = 0; + Lib3MFHandle hReturnObjectResource = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMetaDataCount."); - if (wrapperTable->m_MetaDataGroup_GetMetaDataCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method MetaDataGroup::GetMetaDataCount."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetObjectResource."); + if (wrapperTable->m_Component_GetObjectResource == nullptr) + throw std::runtime_error("Could not call Lib3MF method Component::GetObjectResource."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MetaDataGroup_GetMetaDataCount(instanceHandle, &nReturnCount); + Lib3MFResult errorCode = wrapperTable->m_Component_GetObjectResource(instanceHandle, &hReturnObjectResource); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); + Local instanceObjObjectResource = CLib3MFObject::NewInstance(args.Holder(), hReturnObjectResource); + args.GetReturnValue().Set(instanceObjObjectResource); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -3678,26 +7713,21 @@ void CLib3MFMetaDataGroup::GetMetaDataCount(const FunctionCallbackInfo& a } -void CLib3MFMetaDataGroup::GetMetaData(const FunctionCallbackInfo& args) +void CLib3MFComponent::GetObjectResourceID(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (Index)"); - } - unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - Lib3MFHandle hReturnMetaData = nullptr; + unsigned int nReturnUniqueResourceID = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMetaData."); - if (wrapperTable->m_MetaDataGroup_GetMetaData == nullptr) - throw std::runtime_error("Could not call Lib3MF method MetaDataGroup::GetMetaData."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetObjectResourceID."); + if (wrapperTable->m_Component_GetObjectResourceID == nullptr) + throw std::runtime_error("Could not call Lib3MF method Component::GetObjectResourceID."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MetaDataGroup_GetMetaData(instanceHandle, nIndex, &hReturnMetaData); + Lib3MFResult errorCode = wrapperTable->m_Component_GetObjectResourceID(instanceHandle, &nReturnUniqueResourceID); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjMetaData = CLib3MFMetaData::NewInstance(args.Holder(), hReturnMetaData); - args.GetReturnValue().Set(instanceObjMetaData); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnUniqueResourceID)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -3705,32 +7735,55 @@ void CLib3MFMetaDataGroup::GetMetaData(const FunctionCallbackInfo& args) } -void CLib3MFMetaDataGroup::GetMetaDataByKey(const FunctionCallbackInfo& args) +void CLib3MFComponent::GetUUID(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Local outObject = Object::New(isolate); + bool bReturnHasUUID = false; + unsigned int bytesNeededUUID = 0; + unsigned int bytesWrittenUUID = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetUUID."); + if (wrapperTable->m_Component_GetUUID == nullptr) + throw std::runtime_error("Could not call Lib3MF method Component::GetUUID."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult initErrorCode = wrapperTable->m_Component_GetUUID(instanceHandle, &bReturnHasUUID, 0, &bytesNeededUUID, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferUUID; + bufferUUID.resize(bytesNeededUUID); + Lib3MFResult errorCode = wrapperTable->m_Component_GetUUID(instanceHandle, &bReturnHasUUID, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0]); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "HasUUID"), Boolean::New(isolate, bReturnHasUUID)); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "UUID"), String::NewFromUtf8(isolate, &bufferUUID[0])); + args.GetReturnValue().Set(outObject); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFComponent::SetUUID(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { if (!args[0]->IsString()) { - throw std::runtime_error("Expected string parameter 0 (NameSpace)"); - } - if (!args[1]->IsString()) { - throw std::runtime_error("Expected string parameter 1 (Name)"); + throw std::runtime_error("Expected string parameter 0 (UUID)"); } - v8::String::Utf8Value sutf8NameSpace(isolate, args[0]); - std::string sNameSpace = *sutf8NameSpace; - v8::String::Utf8Value sutf8Name(isolate, args[1]); - std::string sName = *sutf8Name; - Lib3MFHandle hReturnMetaData = nullptr; + v8::String::Utf8Value sutf8UUID(isolate, args[0]); + std::string sUUID = *sutf8UUID; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMetaDataByKey."); - if (wrapperTable->m_MetaDataGroup_GetMetaDataByKey == nullptr) - throw std::runtime_error("Could not call Lib3MF method MetaDataGroup::GetMetaDataByKey."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetUUID."); + if (wrapperTable->m_Component_SetUUID == nullptr) + throw std::runtime_error("Could not call Lib3MF method Component::SetUUID."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MetaDataGroup_GetMetaDataByKey(instanceHandle, sNameSpace.c_str(), sName.c_str(), &hReturnMetaData); + Lib3MFResult errorCode = wrapperTable->m_Component_SetUUID(instanceHandle, sUUID.c_str()); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjMetaData = CLib3MFMetaData::NewInstance(args.Holder(), hReturnMetaData); - args.GetReturnValue().Set(instanceObjMetaData); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -3738,23 +7791,21 @@ void CLib3MFMetaDataGroup::GetMetaDataByKey(const FunctionCallbackInfo& a } -void CLib3MFMetaDataGroup::RemoveMetaDataByIndex(const FunctionCallbackInfo& args) +void CLib3MFComponent::HasTransform(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (Index)"); - } - unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + bool bReturnHasTransform = false; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveMetaDataByIndex."); - if (wrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex == nullptr) - throw std::runtime_error("Could not call Lib3MF method MetaDataGroup::RemoveMetaDataByIndex."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method HasTransform."); + if (wrapperTable->m_Component_HasTransform == nullptr) + throw std::runtime_error("Could not call Lib3MF method Component::HasTransform."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MetaDataGroup_RemoveMetaDataByIndex(instanceHandle, nIndex); + Lib3MFResult errorCode = wrapperTable->m_Component_HasTransform(instanceHandle, &bReturnHasTransform); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnHasTransform)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -3762,27 +7813,21 @@ void CLib3MFMetaDataGroup::RemoveMetaDataByIndex(const FunctionCallbackInfo& args) +void CLib3MFComponent::GetTransform(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsObject()) { - throw std::runtime_error("Expected class parameter 0 (TheMetaData)"); - } - Local objTheMetaData = args[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); - CLib3MFMetaData * instanceTheMetaData = ObjectWrap::Unwrap(objTheMetaData); - if (instanceTheMetaData == nullptr) - throw std::runtime_error("Invalid Object parameter 0 (TheMetaData)"); - Lib3MFHandle hTheMetaData = instanceTheMetaData->getHandle( objTheMetaData ); + sLib3MFTransform sReturnTransform; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveMetaData."); - if (wrapperTable->m_MetaDataGroup_RemoveMetaData == nullptr) - throw std::runtime_error("Could not call Lib3MF method MetaDataGroup::RemoveMetaData."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetTransform."); + if (wrapperTable->m_Component_GetTransform == nullptr) + throw std::runtime_error("Could not call Lib3MF method Component::GetTransform."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MetaDataGroup_RemoveMetaData(instanceHandle, hTheMetaData); + Lib3MFResult errorCode = wrapperTable->m_Component_GetTransform(instanceHandle, &sReturnTransform); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(convertLib3MFTransformToObject(isolate, sReturnTransform)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -3790,46 +7835,23 @@ void CLib3MFMetaDataGroup::RemoveMetaData(const FunctionCallbackInfo& arg } -void CLib3MFMetaDataGroup::AddMetaData(const FunctionCallbackInfo& args) +void CLib3MFComponent::SetTransform(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsString()) { - throw std::runtime_error("Expected string parameter 0 (NameSpace)"); - } - if (!args[1]->IsString()) { - throw std::runtime_error("Expected string parameter 1 (Name)"); - } - if (!args[2]->IsString()) { - throw std::runtime_error("Expected string parameter 2 (Value)"); - } - if (!args[3]->IsString()) { - throw std::runtime_error("Expected string parameter 3 (Type)"); - } - if (!args[4]->IsBoolean()) { - throw std::runtime_error("Expected bool parameter 4 (MustPreserve)"); + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected struct parameter 0 (Transform)"); } - v8::String::Utf8Value sutf8NameSpace(isolate, args[0]); - std::string sNameSpace = *sutf8NameSpace; - v8::String::Utf8Value sutf8Name(isolate, args[1]); - std::string sName = *sutf8Name; - v8::String::Utf8Value sutf8Value(isolate, args[2]); - std::string sValue = *sutf8Value; - v8::String::Utf8Value sutf8Type(isolate, args[3]); - std::string sType = *sutf8Type; - bool bMustPreserve = args[4]->BooleanValue(isolate->GetCurrentContext()).ToChecked(); - Lib3MFHandle hReturnMetaData = nullptr; + sLib3MFTransform sTransform = convertObjectToLib3MFTransform(isolate, args[0]); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method AddMetaData."); - if (wrapperTable->m_MetaDataGroup_AddMetaData == nullptr) - throw std::runtime_error("Could not call Lib3MF method MetaDataGroup::AddMetaData."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetTransform."); + if (wrapperTable->m_Component_SetTransform == nullptr) + throw std::runtime_error("Could not call Lib3MF method Component::SetTransform."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MetaDataGroup_AddMetaData(instanceHandle, sNameSpace.c_str(), sName.c_str(), sValue.c_str(), sType.c_str(), bMustPreserve, &hReturnMetaData); + Lib3MFResult errorCode = wrapperTable->m_Component_SetTransform(instanceHandle, &sTransform); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjMetaData = CLib3MFMetaData::NewInstance(args.Holder(), hReturnMetaData); - args.GetReturnValue().Set(instanceObjMetaData); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -3837,70 +7859,51 @@ void CLib3MFMetaDataGroup::AddMetaData(const FunctionCallbackInfo& args) } /************************************************************************************************************************* - Class CLib3MFObject Implementation + Class CLib3MFComponentsObject Implementation **************************************************************************************************************************/ -CLib3MFObject::CLib3MFObject() +CLib3MFComponentsObject::CLib3MFComponentsObject() : CLib3MFBaseClass() { } -CLib3MFObject::~CLib3MFObject() +CLib3MFComponentsObject::~CLib3MFComponentsObject() { } -void CLib3MFObject::Init() +void CLib3MFComponentsObject::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFObject")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFComponentsObject")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetType", GetType); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetType", SetType); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetName", GetName); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetName", SetName); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetPartNumber", GetPartNumber); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetPartNumber", SetPartNumber); - NODE_SET_PROTOTYPE_METHOD(tpl, "IsMeshObject", IsMeshObject); - NODE_SET_PROTOTYPE_METHOD(tpl, "IsComponentsObject", IsComponentsObject); - NODE_SET_PROTOTYPE_METHOD(tpl, "IsValid", IsValid); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetAttachmentAsThumbnail", SetAttachmentAsThumbnail); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetThumbnailAttachment", GetThumbnailAttachment); - NODE_SET_PROTOTYPE_METHOD(tpl, "ClearThumbnailAttachment", ClearThumbnailAttachment); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutbox", GetOutbox); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetUUID", GetUUID); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetUUID", SetUUID); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetMetaDataGroup", GetMetaDataGroup); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetSlicesMeshResolution", SetSlicesMeshResolution); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetSlicesMeshResolution", GetSlicesMeshResolution); - NODE_SET_PROTOTYPE_METHOD(tpl, "HasSlices", HasSlices); - NODE_SET_PROTOTYPE_METHOD(tpl, "ClearSliceStack", ClearSliceStack); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetSliceStack", GetSliceStack); - NODE_SET_PROTOTYPE_METHOD(tpl, "AssignSliceStack", AssignSliceStack); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddComponent", AddComponent); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetComponent", GetComponent); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetComponentCount", GetComponentCount); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFObject::New(const FunctionCallbackInfo& args) +void CLib3MFComponentsObject::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFObject * objectInstance = new CLib3MFObject(); - objectInstance->Wrap(args.This()); + CLib3MFComponentsObject * componentsobjectInstance = new CLib3MFComponentsObject(); + componentsobjectInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFObject: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFComponentsObject: Invalid call to Constructor"); } } -Local CLib3MFObject::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFComponentsObject::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -3914,21 +7917,34 @@ Local CLib3MFObject::NewInstance(Local pParent, Lib3MFHandle pHa } -void CLib3MFObject::GetType(const FunctionCallbackInfo& args) +void CLib3MFComponentsObject::AddComponent(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - eLib3MFObjectType eReturnObjectType; + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected class parameter 0 (ObjectResource)"); + } + if (!args[1]->IsObject()) { + throw std::runtime_error("Expected struct parameter 1 (Transform)"); + } + Local objObjectResource = args[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); + CLib3MFObject * instanceObjectResource = ObjectWrap::Unwrap(objObjectResource); + if (instanceObjectResource == nullptr) + throw std::runtime_error("Invalid Object parameter 0 (ObjectResource)"); + Lib3MFHandle hObjectResource = instanceObjectResource->getHandle( objObjectResource ); + sLib3MFTransform sTransform = convertObjectToLib3MFTransform(isolate, args[1]); + Lib3MFHandle hReturnComponentInstance = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetType."); - if (wrapperTable->m_Object_GetType == nullptr) - throw std::runtime_error("Could not call Lib3MF method Object::GetType."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddComponent."); + if (wrapperTable->m_ComponentsObject_AddComponent == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComponentsObject::AddComponent."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Object_GetType(instanceHandle, &eReturnObjectType); + Lib3MFResult errorCode = wrapperTable->m_ComponentsObject_AddComponent(instanceHandle, hObjectResource, &sTransform, &hReturnComponentInstance); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::New(isolate, (int)eReturnObjectType)); + Local instanceObjComponentInstance = CLib3MFComponent::NewInstance(args.Holder(), hReturnComponentInstance); + args.GetReturnValue().Set(instanceObjComponentInstance); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -3936,23 +7952,26 @@ void CLib3MFObject::GetType(const FunctionCallbackInfo& args) } -void CLib3MFObject::SetType(const FunctionCallbackInfo& args) +void CLib3MFComponentsObject::GetComponent(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected enum parameter 0 (ObjectType)"); + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); } - unsigned int eObjectType = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + Lib3MFHandle hReturnComponentInstance = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetType."); - if (wrapperTable->m_Object_SetType == nullptr) - throw std::runtime_error("Could not call Lib3MF method Object::SetType."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetComponent."); + if (wrapperTable->m_ComponentsObject_GetComponent == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComponentsObject::GetComponent."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Object_SetType(instanceHandle, (eLib3MFObjectType) eObjectType); + Lib3MFResult errorCode = wrapperTable->m_ComponentsObject_GetComponent(instanceHandle, nIndex, &hReturnComponentInstance); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjComponentInstance = CLib3MFComponent::NewInstance(args.Holder(), hReturnComponentInstance); + args.GetReturnValue().Set(instanceObjComponentInstance); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -3960,34 +7979,94 @@ void CLib3MFObject::SetType(const FunctionCallbackInfo& args) } -void CLib3MFObject::GetName(const FunctionCallbackInfo& args) +void CLib3MFComponentsObject::GetComponentCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int bytesNeededName = 0; - unsigned int bytesWrittenName = 0; + unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetName."); - if (wrapperTable->m_Object_GetName == nullptr) - throw std::runtime_error("Could not call Lib3MF method Object::GetName."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetComponentCount."); + if (wrapperTable->m_ComponentsObject_GetComponentCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method ComponentsObject::GetComponentCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult initErrorCode = wrapperTable->m_Object_GetName(instanceHandle, 0, &bytesNeededName, nullptr); - CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); - std::vector bufferName; - bufferName.resize(bytesNeededName); - Lib3MFResult errorCode = wrapperTable->m_Object_GetName(instanceHandle, bytesNeededName, &bytesWrittenName, &bufferName[0]); + Lib3MFResult errorCode = wrapperTable->m_ComponentsObject_GetComponentCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferName[0])); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } +/************************************************************************************************************************* + Class CLib3MFBeamSet Implementation +**************************************************************************************************************************/ + +CLib3MFBeamSet::CLib3MFBeamSet() + : CLib3MFBaseClass() +{ +} -void CLib3MFObject::SetName(const FunctionCallbackInfo& args) +CLib3MFBeamSet::~CLib3MFBeamSet() +{ +} + +void CLib3MFBeamSet::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFBeamSet")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "SetName", SetName); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetName", GetName); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetIdentifier", SetIdentifier); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetIdentifier", GetIdentifier); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetReferenceCount", GetReferenceCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetReferences", SetReferences); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetReferences", GetReferences); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBallReferenceCount", GetBallReferenceCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetBallReferences", SetBallReferences); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBallReferences", GetBallReferences); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFBeamSet::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFBeamSet * beamsetInstance = new CLib3MFBeamSet(); + beamsetInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFBeamSet: Invalid call to Constructor"); + } +} + +Local CLib3MFBeamSet::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFBeamSet::SetName(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); @@ -4000,10 +8079,10 @@ void CLib3MFObject::SetName(const FunctionCallbackInfo& args) sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) throw std::runtime_error("Could not get wrapper table for Lib3MF method SetName."); - if (wrapperTable->m_Object_SetName == nullptr) - throw std::runtime_error("Could not call Lib3MF method Object::SetName."); + if (wrapperTable->m_BeamSet_SetName == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamSet::SetName."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Object_SetName(instanceHandle, sName.c_str()); + Lib3MFResult errorCode = wrapperTable->m_BeamSet_SetName(instanceHandle, sName.c_str()); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -4012,26 +8091,26 @@ void CLib3MFObject::SetName(const FunctionCallbackInfo& args) } -void CLib3MFObject::GetPartNumber(const FunctionCallbackInfo& args) +void CLib3MFBeamSet::GetName(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int bytesNeededPartNumber = 0; - unsigned int bytesWrittenPartNumber = 0; + unsigned int bytesNeededName = 0; + unsigned int bytesWrittenName = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetPartNumber."); - if (wrapperTable->m_Object_GetPartNumber == nullptr) - throw std::runtime_error("Could not call Lib3MF method Object::GetPartNumber."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetName."); + if (wrapperTable->m_BeamSet_GetName == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamSet::GetName."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult initErrorCode = wrapperTable->m_Object_GetPartNumber(instanceHandle, 0, &bytesNeededPartNumber, nullptr); + Lib3MFResult initErrorCode = wrapperTable->m_BeamSet_GetName(instanceHandle, 0, &bytesNeededName, nullptr); CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); - std::vector bufferPartNumber; - bufferPartNumber.resize(bytesNeededPartNumber); - Lib3MFResult errorCode = wrapperTable->m_Object_GetPartNumber(instanceHandle, bytesNeededPartNumber, &bytesWrittenPartNumber, &bufferPartNumber[0]); + std::vector bufferName; + bufferName.resize(bytesNeededName); + Lib3MFResult errorCode = wrapperTable->m_BeamSet_GetName(instanceHandle, bytesNeededName, &bytesWrittenName, &bufferName[0]); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferPartNumber[0])); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferName[0])); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -4039,23 +8118,23 @@ void CLib3MFObject::GetPartNumber(const FunctionCallbackInfo& args) } -void CLib3MFObject::SetPartNumber(const FunctionCallbackInfo& args) +void CLib3MFBeamSet::SetIdentifier(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { if (!args[0]->IsString()) { - throw std::runtime_error("Expected string parameter 0 (PartNumber)"); + throw std::runtime_error("Expected string parameter 0 (Identifier)"); } - v8::String::Utf8Value sutf8PartNumber(isolate, args[0]); - std::string sPartNumber = *sutf8PartNumber; + v8::String::Utf8Value sutf8Identifier(isolate, args[0]); + std::string sIdentifier = *sutf8Identifier; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetPartNumber."); - if (wrapperTable->m_Object_SetPartNumber == nullptr) - throw std::runtime_error("Could not call Lib3MF method Object::SetPartNumber."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetIdentifier."); + if (wrapperTable->m_BeamSet_SetIdentifier == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamSet::SetIdentifier."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Object_SetPartNumber(instanceHandle, sPartNumber.c_str()); + Lib3MFResult errorCode = wrapperTable->m_BeamSet_SetIdentifier(instanceHandle, sIdentifier.c_str()); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -4064,21 +8143,26 @@ void CLib3MFObject::SetPartNumber(const FunctionCallbackInfo& args) } -void CLib3MFObject::IsMeshObject(const FunctionCallbackInfo& args) +void CLib3MFBeamSet::GetIdentifier(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - bool bReturnIsMeshObject = false; + unsigned int bytesNeededIdentifier = 0; + unsigned int bytesWrittenIdentifier = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method IsMeshObject."); - if (wrapperTable->m_Object_IsMeshObject == nullptr) - throw std::runtime_error("Could not call Lib3MF method Object::IsMeshObject."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetIdentifier."); + if (wrapperTable->m_BeamSet_GetIdentifier == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamSet::GetIdentifier."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Object_IsMeshObject(instanceHandle, &bReturnIsMeshObject); + Lib3MFResult initErrorCode = wrapperTable->m_BeamSet_GetIdentifier(instanceHandle, 0, &bytesNeededIdentifier, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferIdentifier; + bufferIdentifier.resize(bytesNeededIdentifier); + Lib3MFResult errorCode = wrapperTable->m_BeamSet_GetIdentifier(instanceHandle, bytesNeededIdentifier, &bytesWrittenIdentifier, &bufferIdentifier[0]); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Boolean::New(isolate, bReturnIsMeshObject)); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferIdentifier[0])); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -4086,21 +8170,21 @@ void CLib3MFObject::IsMeshObject(const FunctionCallbackInfo& args) } -void CLib3MFObject::IsComponentsObject(const FunctionCallbackInfo& args) +void CLib3MFBeamSet::GetReferenceCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - bool bReturnIsComponentsObject = false; + unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method IsComponentsObject."); - if (wrapperTable->m_Object_IsComponentsObject == nullptr) - throw std::runtime_error("Could not call Lib3MF method Object::IsComponentsObject."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetReferenceCount."); + if (wrapperTable->m_BeamSet_GetReferenceCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamSet::GetReferenceCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Object_IsComponentsObject(instanceHandle, &bReturnIsComponentsObject); + Lib3MFResult errorCode = wrapperTable->m_BeamSet_GetReferenceCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Boolean::New(isolate, bReturnIsComponentsObject)); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -4108,21 +8192,19 @@ void CLib3MFObject::IsComponentsObject(const FunctionCallbackInfo& args) } -void CLib3MFObject::IsValid(const FunctionCallbackInfo& args) +void CLib3MFBeamSet::SetReferences(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - bool bReturnIsValid = false; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method IsValid."); - if (wrapperTable->m_Object_IsValid == nullptr) - throw std::runtime_error("Could not call Lib3MF method Object::IsValid."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetReferences."); + if (wrapperTable->m_BeamSet_SetReferences == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamSet::SetReferences."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Object_IsValid(instanceHandle, &bReturnIsValid); + Lib3MFResult errorCode = wrapperTable->m_BeamSet_SetReferences(instanceHandle, 0, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Boolean::New(isolate, bReturnIsValid)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -4130,26 +8212,18 @@ void CLib3MFObject::IsValid(const FunctionCallbackInfo& args) } -void CLib3MFObject::SetAttachmentAsThumbnail(const FunctionCallbackInfo& args) +void CLib3MFBeamSet::GetReferences(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsObject()) { - throw std::runtime_error("Expected class parameter 0 (Attachment)"); - } - Local objAttachment = args[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); - CLib3MFAttachment * instanceAttachment = ObjectWrap::Unwrap(objAttachment); - if (instanceAttachment == nullptr) - throw std::runtime_error("Invalid Object parameter 0 (Attachment)"); - Lib3MFHandle hAttachment = instanceAttachment->getHandle( objAttachment ); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetAttachmentAsThumbnail."); - if (wrapperTable->m_Object_SetAttachmentAsThumbnail == nullptr) - throw std::runtime_error("Could not call Lib3MF method Object::SetAttachmentAsThumbnail."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetReferences."); + if (wrapperTable->m_BeamSet_GetReferences == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamSet::GetReferences."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Object_SetAttachmentAsThumbnail(instanceHandle, hAttachment); + Lib3MFResult errorCode = wrapperTable->m_BeamSet_GetReferences(instanceHandle, 0, nullptr, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -4158,22 +8232,21 @@ void CLib3MFObject::SetAttachmentAsThumbnail(const FunctionCallbackInfo& } -void CLib3MFObject::GetThumbnailAttachment(const FunctionCallbackInfo& args) +void CLib3MFBeamSet::GetBallReferenceCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnAttachment = nullptr; + unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetThumbnailAttachment."); - if (wrapperTable->m_Object_GetThumbnailAttachment == nullptr) - throw std::runtime_error("Could not call Lib3MF method Object::GetThumbnailAttachment."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBallReferenceCount."); + if (wrapperTable->m_BeamSet_GetBallReferenceCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamSet::GetBallReferenceCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Object_GetThumbnailAttachment(instanceHandle, &hReturnAttachment); + Lib3MFResult errorCode = wrapperTable->m_BeamSet_GetBallReferenceCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjAttachment = CLib3MFAttachment::NewInstance(args.Holder(), hReturnAttachment); - args.GetReturnValue().Set(instanceObjAttachment); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -4181,18 +8254,18 @@ void CLib3MFObject::GetThumbnailAttachment(const FunctionCallbackInfo& ar } -void CLib3MFObject::ClearThumbnailAttachment(const FunctionCallbackInfo& args) +void CLib3MFBeamSet::SetBallReferences(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method ClearThumbnailAttachment."); - if (wrapperTable->m_Object_ClearThumbnailAttachment == nullptr) - throw std::runtime_error("Could not call Lib3MF method Object::ClearThumbnailAttachment."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBallReferences."); + if (wrapperTable->m_BeamSet_SetBallReferences == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamSet::SetBallReferences."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Object_ClearThumbnailAttachment(instanceHandle); + Lib3MFResult errorCode = wrapperTable->m_BeamSet_SetBallReferences(instanceHandle, 0, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -4201,77 +8274,104 @@ void CLib3MFObject::ClearThumbnailAttachment(const FunctionCallbackInfo& } -void CLib3MFObject::GetOutbox(const FunctionCallbackInfo& args) +void CLib3MFBeamSet::GetBallReferences(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - sLib3MFBox sReturnOutbox; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutbox."); - if (wrapperTable->m_Object_GetOutbox == nullptr) - throw std::runtime_error("Could not call Lib3MF method Object::GetOutbox."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBallReferences."); + if (wrapperTable->m_BeamSet_GetBallReferences == nullptr) + throw std::runtime_error("Could not call Lib3MF method BeamSet::GetBallReferences."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Object_GetOutbox(instanceHandle, &sReturnOutbox); + Lib3MFResult errorCode = wrapperTable->m_BeamSet_GetBallReferences(instanceHandle, 0, nullptr, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(convertLib3MFBoxToObject(isolate, sReturnOutbox)); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } +/************************************************************************************************************************* + Class CLib3MFBaseMaterialGroup Implementation +**************************************************************************************************************************/ -void CLib3MFObject::GetUUID(const FunctionCallbackInfo& args) +CLib3MFBaseMaterialGroup::CLib3MFBaseMaterialGroup() + : CLib3MFBaseClass() +{ +} + +CLib3MFBaseMaterialGroup::~CLib3MFBaseMaterialGroup() +{ +} + +void CLib3MFBaseMaterialGroup::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFBaseMaterialGroup")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCount", GetCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetAllPropertyIDs", GetAllPropertyIDs); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddMaterial", AddMaterial); + NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveMaterial", RemoveMaterial); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetName", GetName); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetName", SetName); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetDisplayColor", SetDisplayColor); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetDisplayColor", GetDisplayColor); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFBaseMaterialGroup::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); - try { - Local outObject = Object::New(isolate); - bool bReturnHasUUID = false; - unsigned int bytesNeededUUID = 0; - unsigned int bytesWrittenUUID = 0; - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetUUID."); - if (wrapperTable->m_Object_GetUUID == nullptr) - throw std::runtime_error("Could not call Lib3MF method Object::GetUUID."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult initErrorCode = wrapperTable->m_Object_GetUUID(instanceHandle, &bReturnHasUUID, 0, &bytesNeededUUID, nullptr); - CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); - std::vector bufferUUID; - bufferUUID.resize(bytesNeededUUID); - Lib3MFResult errorCode = wrapperTable->m_Object_GetUUID(instanceHandle, &bReturnHasUUID, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0]); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "HasUUID"), Boolean::New(isolate, bReturnHasUUID)); - outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "UUID"), String::NewFromUtf8(isolate, &bufferUUID[0])); - args.GetReturnValue().Set(outObject); - } catch (std::exception & E) { - RaiseError(isolate, E.what()); + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFBaseMaterialGroup * basematerialgroupInstance = new CLib3MFBaseMaterialGroup(); + basematerialgroupInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFBaseMaterialGroup: Invalid call to Constructor"); + } +} + +Local CLib3MFBaseMaterialGroup::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); } + return instance; } -void CLib3MFObject::SetUUID(const FunctionCallbackInfo& args) +void CLib3MFBaseMaterialGroup::GetCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsString()) { - throw std::runtime_error("Expected string parameter 0 (UUID)"); - } - v8::String::Utf8Value sutf8UUID(isolate, args[0]); - std::string sUUID = *sutf8UUID; + unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetUUID."); - if (wrapperTable->m_Object_SetUUID == nullptr) - throw std::runtime_error("Could not call Lib3MF method Object::SetUUID."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCount."); + if (wrapperTable->m_BaseMaterialGroup_GetCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::GetCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Object_SetUUID(instanceHandle, sUUID.c_str()); + Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_GetCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -4279,22 +8379,19 @@ void CLib3MFObject::SetUUID(const FunctionCallbackInfo& args) } -void CLib3MFObject::GetMetaDataGroup(const FunctionCallbackInfo& args) +void CLib3MFBaseMaterialGroup::GetAllPropertyIDs(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnMetaDataGroup = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMetaDataGroup."); - if (wrapperTable->m_Object_GetMetaDataGroup == nullptr) - throw std::runtime_error("Could not call Lib3MF method Object::GetMetaDataGroup."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetAllPropertyIDs."); + if (wrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs == nullptr) + throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::GetAllPropertyIDs."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Object_GetMetaDataGroup(instanceHandle, &hReturnMetaDataGroup); + Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs(instanceHandle, 0, nullptr, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjMetaDataGroup = CLib3MFMetaDataGroup::NewInstance(args.Holder(), hReturnMetaDataGroup); - args.GetReturnValue().Set(instanceObjMetaDataGroup); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -4302,23 +8399,30 @@ void CLib3MFObject::GetMetaDataGroup(const FunctionCallbackInfo& args) } -void CLib3MFObject::SetSlicesMeshResolution(const FunctionCallbackInfo& args) +void CLib3MFBaseMaterialGroup::AddMaterial(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected enum parameter 0 (MeshResolution)"); + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); } - unsigned int eMeshResolution = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + if (!args[1]->IsObject()) { + throw std::runtime_error("Expected struct parameter 1 (DisplayColor)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; + sLib3MFColor sDisplayColor = convertObjectToLib3MFColor(isolate, args[1]); + unsigned int nReturnPropertyID = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetSlicesMeshResolution."); - if (wrapperTable->m_Object_SetSlicesMeshResolution == nullptr) - throw std::runtime_error("Could not call Lib3MF method Object::SetSlicesMeshResolution."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddMaterial."); + if (wrapperTable->m_BaseMaterialGroup_AddMaterial == nullptr) + throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::AddMaterial."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Object_SetSlicesMeshResolution(instanceHandle, (eLib3MFSlicesMeshResolution) eMeshResolution); + Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_AddMaterial(instanceHandle, sName.c_str(), &sDisplayColor, &nReturnPropertyID); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnPropertyID)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -4326,21 +8430,23 @@ void CLib3MFObject::SetSlicesMeshResolution(const FunctionCallbackInfo& a } -void CLib3MFObject::GetSlicesMeshResolution(const FunctionCallbackInfo& args) +void CLib3MFBaseMaterialGroup::RemoveMaterial(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - eLib3MFSlicesMeshResolution eReturnMeshResolution; + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); + } + unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetSlicesMeshResolution."); - if (wrapperTable->m_Object_GetSlicesMeshResolution == nullptr) - throw std::runtime_error("Could not call Lib3MF method Object::GetSlicesMeshResolution."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveMaterial."); + if (wrapperTable->m_BaseMaterialGroup_RemoveMaterial == nullptr) + throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::RemoveMaterial."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Object_GetSlicesMeshResolution(instanceHandle, &eReturnMeshResolution); + Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_RemoveMaterial(instanceHandle, nPropertyID); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::New(isolate, (int)eReturnMeshResolution)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -4348,25 +8454,30 @@ void CLib3MFObject::GetSlicesMeshResolution(const FunctionCallbackInfo& a } -void CLib3MFObject::HasSlices(const FunctionCallbackInfo& args) +void CLib3MFBaseMaterialGroup::GetName(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsBoolean()) { - throw std::runtime_error("Expected bool parameter 0 (Recursive)"); + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); } - bool bRecursive = args[0]->BooleanValue(isolate->GetCurrentContext()).ToChecked(); - bool bReturnHasSlices = false; + unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int bytesNeededName = 0; + unsigned int bytesWrittenName = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method HasSlices."); - if (wrapperTable->m_Object_HasSlices == nullptr) - throw std::runtime_error("Could not call Lib3MF method Object::HasSlices."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetName."); + if (wrapperTable->m_BaseMaterialGroup_GetName == nullptr) + throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::GetName."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Object_HasSlices(instanceHandle, bRecursive, &bReturnHasSlices); + Lib3MFResult initErrorCode = wrapperTable->m_BaseMaterialGroup_GetName(instanceHandle, nPropertyID, 0, &bytesNeededName, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferName; + bufferName.resize(bytesNeededName); + Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_GetName(instanceHandle, nPropertyID, bytesNeededName, &bytesWrittenName, &bufferName[0]); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Boolean::New(isolate, bReturnHasSlices)); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferName[0])); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -4374,18 +8485,27 @@ void CLib3MFObject::HasSlices(const FunctionCallbackInfo& args) } -void CLib3MFObject::ClearSliceStack(const FunctionCallbackInfo& args) +void CLib3MFBaseMaterialGroup::SetName(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (Name)"); + } + unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + v8::String::Utf8Value sutf8Name(isolate, args[1]); + std::string sName = *sutf8Name; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method ClearSliceStack."); - if (wrapperTable->m_Object_ClearSliceStack == nullptr) - throw std::runtime_error("Could not call Lib3MF method Object::ClearSliceStack."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetName."); + if (wrapperTable->m_BaseMaterialGroup_SetName == nullptr) + throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::SetName."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Object_ClearSliceStack(instanceHandle); + Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_SetName(instanceHandle, nPropertyID, sName.c_str()); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -4394,22 +8514,27 @@ void CLib3MFObject::ClearSliceStack(const FunctionCallbackInfo& args) } -void CLib3MFObject::GetSliceStack(const FunctionCallbackInfo& args) +void CLib3MFBaseMaterialGroup::SetDisplayColor(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnSliceStackInstance = nullptr; + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); + } + if (!args[1]->IsObject()) { + throw std::runtime_error("Expected struct parameter 1 (TheColor)"); + } + unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFColor sTheColor = convertObjectToLib3MFColor(isolate, args[1]); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetSliceStack."); - if (wrapperTable->m_Object_GetSliceStack == nullptr) - throw std::runtime_error("Could not call Lib3MF method Object::GetSliceStack."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetDisplayColor."); + if (wrapperTable->m_BaseMaterialGroup_SetDisplayColor == nullptr) + throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::SetDisplayColor."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Object_GetSliceStack(instanceHandle, &hReturnSliceStackInstance); + Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_SetDisplayColor(instanceHandle, nPropertyID, &sTheColor); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjSliceStackInstance = CLib3MFSliceStack::NewInstance(args.Holder(), hReturnSliceStackInstance); - args.GetReturnValue().Set(instanceObjSliceStackInstance); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -4417,27 +8542,25 @@ void CLib3MFObject::GetSliceStack(const FunctionCallbackInfo& args) } -void CLib3MFObject::AssignSliceStack(const FunctionCallbackInfo& args) +void CLib3MFBaseMaterialGroup::GetDisplayColor(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsObject()) { - throw std::runtime_error("Expected class parameter 0 (SliceStackInstance)"); + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); } - Local objSliceStackInstance = args[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); - CLib3MFSliceStack * instanceSliceStackInstance = ObjectWrap::Unwrap(objSliceStackInstance); - if (instanceSliceStackInstance == nullptr) - throw std::runtime_error("Invalid Object parameter 0 (SliceStackInstance)"); - Lib3MFHandle hSliceStackInstance = instanceSliceStackInstance->getHandle( objSliceStackInstance ); + unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFColor sReturnTheColor; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method AssignSliceStack."); - if (wrapperTable->m_Object_AssignSliceStack == nullptr) - throw std::runtime_error("Could not call Lib3MF method Object::AssignSliceStack."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetDisplayColor."); + if (wrapperTable->m_BaseMaterialGroup_GetDisplayColor == nullptr) + throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::GetDisplayColor."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Object_AssignSliceStack(instanceHandle, hSliceStackInstance); + Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_GetDisplayColor(instanceHandle, nPropertyID, &sReturnTheColor); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(convertLib3MFColorToObject(isolate, sReturnTheColor)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -4445,68 +8568,54 @@ void CLib3MFObject::AssignSliceStack(const FunctionCallbackInfo& args) } /************************************************************************************************************************* - Class CLib3MFMeshObject Implementation + Class CLib3MFColorGroup Implementation **************************************************************************************************************************/ -CLib3MFMeshObject::CLib3MFMeshObject() +CLib3MFColorGroup::CLib3MFColorGroup() : CLib3MFBaseClass() { } -CLib3MFMeshObject::~CLib3MFMeshObject() +CLib3MFColorGroup::~CLib3MFColorGroup() { } -void CLib3MFMeshObject::Init() +void CLib3MFColorGroup::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFMeshObject")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFColorGroup")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetVertexCount", GetVertexCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetTriangleCount", GetTriangleCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetVertex", GetVertex); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetVertex", SetVertex); - NODE_SET_PROTOTYPE_METHOD(tpl, "AddVertex", AddVertex); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetVertices", GetVertices); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetTriangle", GetTriangle); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetTriangle", SetTriangle); - NODE_SET_PROTOTYPE_METHOD(tpl, "AddTriangle", AddTriangle); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetTriangleIndices", GetTriangleIndices); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetObjectLevelProperty", SetObjectLevelProperty); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetObjectLevelProperty", GetObjectLevelProperty); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetTriangleProperties", SetTriangleProperties); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetTriangleProperties", GetTriangleProperties); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetAllTriangleProperties", SetAllTriangleProperties); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetAllTriangleProperties", GetAllTriangleProperties); - NODE_SET_PROTOTYPE_METHOD(tpl, "ClearAllProperties", ClearAllProperties); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetGeometry", SetGeometry); - NODE_SET_PROTOTYPE_METHOD(tpl, "IsManifoldAndOriented", IsManifoldAndOriented); - NODE_SET_PROTOTYPE_METHOD(tpl, "BeamLattice", BeamLattice); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCount", GetCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetAllPropertyIDs", GetAllPropertyIDs); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddColor", AddColor); + NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveColor", RemoveColor); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetColor", SetColor); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetColor", GetColor); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFMeshObject::New(const FunctionCallbackInfo& args) +void CLib3MFColorGroup::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFMeshObject * meshobjectInstance = new CLib3MFMeshObject(); - meshobjectInstance->Wrap(args.This()); + CLib3MFColorGroup * colorgroupInstance = new CLib3MFColorGroup(); + colorgroupInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFMeshObject: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFColorGroup: Invalid call to Constructor"); } } -Local CLib3MFMeshObject::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFColorGroup::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -4520,21 +8629,21 @@ Local CLib3MFMeshObject::NewInstance(Local pParent, Lib3MFHandle } -void CLib3MFMeshObject::GetVertexCount(const FunctionCallbackInfo& args) +void CLib3MFColorGroup::GetCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int nReturnVertexCount = 0; + unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetVertexCount."); - if (wrapperTable->m_MeshObject_GetVertexCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method MeshObject::GetVertexCount."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCount."); + if (wrapperTable->m_ColorGroup_GetCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method ColorGroup::GetCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MeshObject_GetVertexCount(instanceHandle, &nReturnVertexCount); + Lib3MFResult errorCode = wrapperTable->m_ColorGroup_GetCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnVertexCount)); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -4542,21 +8651,19 @@ void CLib3MFMeshObject::GetVertexCount(const FunctionCallbackInfo& args) } -void CLib3MFMeshObject::GetTriangleCount(const FunctionCallbackInfo& args) +void CLib3MFColorGroup::GetAllPropertyIDs(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int nReturnVertexCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetTriangleCount."); - if (wrapperTable->m_MeshObject_GetTriangleCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method MeshObject::GetTriangleCount."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetAllPropertyIDs."); + if (wrapperTable->m_ColorGroup_GetAllPropertyIDs == nullptr) + throw std::runtime_error("Could not call Lib3MF method ColorGroup::GetAllPropertyIDs."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MeshObject_GetTriangleCount(instanceHandle, &nReturnVertexCount); + Lib3MFResult errorCode = wrapperTable->m_ColorGroup_GetAllPropertyIDs(instanceHandle, 0, nullptr, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnVertexCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -4564,25 +8671,25 @@ void CLib3MFMeshObject::GetTriangleCount(const FunctionCallbackInfo& args } -void CLib3MFMeshObject::GetVertex(const FunctionCallbackInfo& args) +void CLib3MFColorGroup::AddColor(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected struct parameter 0 (TheColor)"); } - unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - sLib3MFPosition sReturnCoordinates; + sLib3MFColor sTheColor = convertObjectToLib3MFColor(isolate, args[0]); + unsigned int nReturnPropertyID = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetVertex."); - if (wrapperTable->m_MeshObject_GetVertex == nullptr) - throw std::runtime_error("Could not call Lib3MF method MeshObject::GetVertex."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddColor."); + if (wrapperTable->m_ColorGroup_AddColor == nullptr) + throw std::runtime_error("Could not call Lib3MF method ColorGroup::AddColor."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MeshObject_GetVertex(instanceHandle, nIndex, &sReturnCoordinates); + Lib3MFResult errorCode = wrapperTable->m_ColorGroup_AddColor(instanceHandle, &sTheColor, &nReturnPropertyID); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(convertLib3MFPositionToObject(isolate, sReturnCoordinates)); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnPropertyID)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -4590,26 +8697,22 @@ void CLib3MFMeshObject::GetVertex(const FunctionCallbackInfo& args) } -void CLib3MFMeshObject::SetVertex(const FunctionCallbackInfo& args) +void CLib3MFColorGroup::RemoveColor(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (Index)"); - } - if (!args[1]->IsObject()) { - throw std::runtime_error("Expected struct parameter 1 (Coordinates)"); + throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); } - unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - sLib3MFPosition sCoordinates = convertObjectToLib3MFPosition(isolate, args[1]); + unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetVertex."); - if (wrapperTable->m_MeshObject_SetVertex == nullptr) - throw std::runtime_error("Could not call Lib3MF method MeshObject::SetVertex."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveColor."); + if (wrapperTable->m_ColorGroup_RemoveColor == nullptr) + throw std::runtime_error("Could not call Lib3MF method ColorGroup::RemoveColor."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MeshObject_SetVertex(instanceHandle, nIndex, &sCoordinates); + Lib3MFResult errorCode = wrapperTable->m_ColorGroup_RemoveColor(instanceHandle, nPropertyID); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -4618,25 +8721,27 @@ void CLib3MFMeshObject::SetVertex(const FunctionCallbackInfo& args) } -void CLib3MFMeshObject::AddVertex(const FunctionCallbackInfo& args) +void CLib3MFColorGroup::SetColor(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsObject()) { - throw std::runtime_error("Expected struct parameter 0 (Coordinates)"); + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); } - sLib3MFPosition sCoordinates = convertObjectToLib3MFPosition(isolate, args[0]); - unsigned int nReturnNewIndex = 0; + if (!args[1]->IsObject()) { + throw std::runtime_error("Expected struct parameter 1 (TheColor)"); + } + unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFColor sTheColor = convertObjectToLib3MFColor(isolate, args[1]); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method AddVertex."); - if (wrapperTable->m_MeshObject_AddVertex == nullptr) - throw std::runtime_error("Could not call Lib3MF method MeshObject::AddVertex."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetColor."); + if (wrapperTable->m_ColorGroup_SetColor == nullptr) + throw std::runtime_error("Could not call Lib3MF method ColorGroup::SetColor."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MeshObject_AddVertex(instanceHandle, &sCoordinates, &nReturnNewIndex); + Lib3MFResult errorCode = wrapperTable->m_ColorGroup_SetColor(instanceHandle, nPropertyID, &sTheColor); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnNewIndex)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -4644,45 +8749,108 @@ void CLib3MFMeshObject::AddVertex(const FunctionCallbackInfo& args) } -void CLib3MFMeshObject::GetVertices(const FunctionCallbackInfo& args) +void CLib3MFColorGroup::GetColor(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); + } + unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFColor sReturnTheColor; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetVertices."); - if (wrapperTable->m_MeshObject_GetVertices == nullptr) - throw std::runtime_error("Could not call Lib3MF method MeshObject::GetVertices."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetColor."); + if (wrapperTable->m_ColorGroup_GetColor == nullptr) + throw std::runtime_error("Could not call Lib3MF method ColorGroup::GetColor."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MeshObject_GetVertices(instanceHandle, 0, nullptr, nullptr); + Lib3MFResult errorCode = wrapperTable->m_ColorGroup_GetColor(instanceHandle, nPropertyID, &sReturnTheColor); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(convertLib3MFColorToObject(isolate, sReturnTheColor)); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } +/************************************************************************************************************************* + Class CLib3MFTexture2DGroup Implementation +**************************************************************************************************************************/ + +CLib3MFTexture2DGroup::CLib3MFTexture2DGroup() + : CLib3MFBaseClass() +{ +} + +CLib3MFTexture2DGroup::~CLib3MFTexture2DGroup() +{ +} + +void CLib3MFTexture2DGroup::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFTexture2DGroup")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCount", GetCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetAllPropertyIDs", GetAllPropertyIDs); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddTex2Coord", AddTex2Coord); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetTex2Coord", GetTex2Coord); + NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveTex2Coord", RemoveTex2Coord); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetTexture2D", GetTexture2D); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFTexture2DGroup::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFTexture2DGroup * texture2dgroupInstance = new CLib3MFTexture2DGroup(); + texture2dgroupInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFTexture2DGroup: Invalid call to Constructor"); + } +} + +Local CLib3MFTexture2DGroup::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + -void CLib3MFMeshObject::GetTriangle(const FunctionCallbackInfo& args) +void CLib3MFTexture2DGroup::GetCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (Index)"); - } - unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - sLib3MFTriangle sReturnIndices; + unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetTriangle."); - if (wrapperTable->m_MeshObject_GetTriangle == nullptr) - throw std::runtime_error("Could not call Lib3MF method MeshObject::GetTriangle."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCount."); + if (wrapperTable->m_Texture2DGroup_GetCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method Texture2DGroup::GetCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MeshObject_GetTriangle(instanceHandle, nIndex, &sReturnIndices); + Lib3MFResult errorCode = wrapperTable->m_Texture2DGroup_GetCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(convertLib3MFTriangleToObject(isolate, sReturnIndices)); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -4690,26 +8858,18 @@ void CLib3MFMeshObject::GetTriangle(const FunctionCallbackInfo& args) } -void CLib3MFMeshObject::SetTriangle(const FunctionCallbackInfo& args) +void CLib3MFTexture2DGroup::GetAllPropertyIDs(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (Index)"); - } - if (!args[1]->IsObject()) { - throw std::runtime_error("Expected struct parameter 1 (Indices)"); - } - unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - sLib3MFTriangle sIndices = convertObjectToLib3MFTriangle(isolate, args[1]); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetTriangle."); - if (wrapperTable->m_MeshObject_SetTriangle == nullptr) - throw std::runtime_error("Could not call Lib3MF method MeshObject::SetTriangle."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetAllPropertyIDs."); + if (wrapperTable->m_Texture2DGroup_GetAllPropertyIDs == nullptr) + throw std::runtime_error("Could not call Lib3MF method Texture2DGroup::GetAllPropertyIDs."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MeshObject_SetTriangle(instanceHandle, nIndex, &sIndices); + Lib3MFResult errorCode = wrapperTable->m_Texture2DGroup_GetAllPropertyIDs(instanceHandle, 0, nullptr, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -4718,25 +8878,25 @@ void CLib3MFMeshObject::SetTriangle(const FunctionCallbackInfo& args) } -void CLib3MFMeshObject::AddTriangle(const FunctionCallbackInfo& args) +void CLib3MFTexture2DGroup::AddTex2Coord(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { if (!args[0]->IsObject()) { - throw std::runtime_error("Expected struct parameter 0 (Indices)"); + throw std::runtime_error("Expected struct parameter 0 (UVCoordinate)"); } - sLib3MFTriangle sIndices = convertObjectToLib3MFTriangle(isolate, args[0]); - unsigned int nReturnNewIndex = 0; + sLib3MFTex2Coord sUVCoordinate = convertObjectToLib3MFTex2Coord(isolate, args[0]); + unsigned int nReturnPropertyID = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method AddTriangle."); - if (wrapperTable->m_MeshObject_AddTriangle == nullptr) - throw std::runtime_error("Could not call Lib3MF method MeshObject::AddTriangle."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddTex2Coord."); + if (wrapperTable->m_Texture2DGroup_AddTex2Coord == nullptr) + throw std::runtime_error("Could not call Lib3MF method Texture2DGroup::AddTex2Coord."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MeshObject_AddTriangle(instanceHandle, &sIndices, &nReturnNewIndex); + Lib3MFResult errorCode = wrapperTable->m_Texture2DGroup_AddTex2Coord(instanceHandle, &sUVCoordinate, &nReturnPropertyID); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnNewIndex)); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnPropertyID)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -4744,19 +8904,25 @@ void CLib3MFMeshObject::AddTriangle(const FunctionCallbackInfo& args) } -void CLib3MFMeshObject::GetTriangleIndices(const FunctionCallbackInfo& args) +void CLib3MFTexture2DGroup::GetTex2Coord(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); + } + unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFTex2Coord sReturnUVCoordinate; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetTriangleIndices."); - if (wrapperTable->m_MeshObject_GetTriangleIndices == nullptr) - throw std::runtime_error("Could not call Lib3MF method MeshObject::GetTriangleIndices."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetTex2Coord."); + if (wrapperTable->m_Texture2DGroup_GetTex2Coord == nullptr) + throw std::runtime_error("Could not call Lib3MF method Texture2DGroup::GetTex2Coord."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MeshObject_GetTriangleIndices(instanceHandle, 0, nullptr, nullptr); + Lib3MFResult errorCode = wrapperTable->m_Texture2DGroup_GetTex2Coord(instanceHandle, nPropertyID, &sReturnUVCoordinate); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(convertLib3MFTex2CoordToObject(isolate, sReturnUVCoordinate)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -4764,26 +8930,22 @@ void CLib3MFMeshObject::GetTriangleIndices(const FunctionCallbackInfo& ar } -void CLib3MFMeshObject::SetObjectLevelProperty(const FunctionCallbackInfo& args) +void CLib3MFTexture2DGroup::RemoveTex2Coord(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (UniqueResourceID)"); - } - if (!args[1]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 1 (PropertyID)"); + throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); } - unsigned int nUniqueResourceID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - unsigned int nPropertyID = (unsigned int) args[1]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetObjectLevelProperty."); - if (wrapperTable->m_MeshObject_SetObjectLevelProperty == nullptr) - throw std::runtime_error("Could not call Lib3MF method MeshObject::SetObjectLevelProperty."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveTex2Coord."); + if (wrapperTable->m_Texture2DGroup_RemoveTex2Coord == nullptr) + throw std::runtime_error("Could not call Lib3MF method Texture2DGroup::RemoveTex2Coord."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MeshObject_SetObjectLevelProperty(instanceHandle, nUniqueResourceID, nPropertyID); + Lib3MFResult errorCode = wrapperTable->m_Texture2DGroup_RemoveTex2Coord(instanceHandle, nPropertyID); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -4792,101 +8954,105 @@ void CLib3MFMeshObject::SetObjectLevelProperty(const FunctionCallbackInfo } -void CLib3MFMeshObject::GetObjectLevelProperty(const FunctionCallbackInfo& args) +void CLib3MFTexture2DGroup::GetTexture2D(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Local outObject = Object::New(isolate); - unsigned int nReturnUniqueResourceID = 0; - unsigned int nReturnPropertyID = 0; - bool bReturnHasObjectLevelProperty = false; + Lib3MFHandle hReturnTexture2DInstance = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetObjectLevelProperty."); - if (wrapperTable->m_MeshObject_GetObjectLevelProperty == nullptr) - throw std::runtime_error("Could not call Lib3MF method MeshObject::GetObjectLevelProperty."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetTexture2D."); + if (wrapperTable->m_Texture2DGroup_GetTexture2D == nullptr) + throw std::runtime_error("Could not call Lib3MF method Texture2DGroup::GetTexture2D."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MeshObject_GetObjectLevelProperty(instanceHandle, &nReturnUniqueResourceID, &nReturnPropertyID, &bReturnHasObjectLevelProperty); + Lib3MFResult errorCode = wrapperTable->m_Texture2DGroup_GetTexture2D(instanceHandle, &hReturnTexture2DInstance); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "UniqueResourceID"), Integer::NewFromUnsigned(isolate, nReturnUniqueResourceID)); - outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "PropertyID"), Integer::NewFromUnsigned(isolate, nReturnPropertyID)); - outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "HasObjectLevelProperty"), Boolean::New(isolate, bReturnHasObjectLevelProperty)); - args.GetReturnValue().Set(outObject); + Local instanceObjTexture2DInstance = CLib3MFTexture2D::NewInstance(args.Holder(), hReturnTexture2DInstance); + args.GetReturnValue().Set(instanceObjTexture2DInstance); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } +/************************************************************************************************************************* + Class CLib3MFCompositeMaterials Implementation +**************************************************************************************************************************/ -void CLib3MFMeshObject::SetTriangleProperties(const FunctionCallbackInfo& args) +CLib3MFCompositeMaterials::CLib3MFCompositeMaterials() + : CLib3MFBaseClass() { - Isolate* isolate = args.GetIsolate(); - HandleScope scope(isolate); - try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (Index)"); - } - if (!args[1]->IsObject()) { - throw std::runtime_error("Expected struct parameter 1 (Properties)"); - } - unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - sLib3MFTriangleProperties sProperties = convertObjectToLib3MFTriangleProperties(isolate, args[1]); - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetTriangleProperties."); - if (wrapperTable->m_MeshObject_SetTriangleProperties == nullptr) - throw std::runtime_error("Could not call Lib3MF method MeshObject::SetTriangleProperties."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MeshObject_SetTriangleProperties(instanceHandle, nIndex, &sProperties); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); +} - } catch (std::exception & E) { - RaiseError(isolate, E.what()); - } +CLib3MFCompositeMaterials::~CLib3MFCompositeMaterials() +{ } +void CLib3MFCompositeMaterials::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); -void CLib3MFMeshObject::GetTriangleProperties(const FunctionCallbackInfo& args) + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFCompositeMaterials")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCount", GetCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetAllPropertyIDs", GetAllPropertyIDs); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetBaseMaterialGroup", GetBaseMaterialGroup); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddComposite", AddComposite); + NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveComposite", RemoveComposite); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetComposite", GetComposite); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFCompositeMaterials::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); - try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (Index)"); - } - unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - sLib3MFTriangleProperties sReturnProperty; - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetTriangleProperties."); - if (wrapperTable->m_MeshObject_GetTriangleProperties == nullptr) - throw std::runtime_error("Could not call Lib3MF method MeshObject::GetTriangleProperties."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MeshObject_GetTriangleProperties(instanceHandle, nIndex, &sReturnProperty); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(convertLib3MFTrianglePropertiesToObject(isolate, sReturnProperty)); - } catch (std::exception & E) { - RaiseError(isolate, E.what()); + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFCompositeMaterials * compositematerialsInstance = new CLib3MFCompositeMaterials(); + compositematerialsInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFCompositeMaterials: Invalid call to Constructor"); + } +} + +Local CLib3MFCompositeMaterials::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); } + return instance; } -void CLib3MFMeshObject::SetAllTriangleProperties(const FunctionCallbackInfo& args) +void CLib3MFCompositeMaterials::GetCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetAllTriangleProperties."); - if (wrapperTable->m_MeshObject_SetAllTriangleProperties == nullptr) - throw std::runtime_error("Could not call Lib3MF method MeshObject::SetAllTriangleProperties."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCount."); + if (wrapperTable->m_CompositeMaterials_GetCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method CompositeMaterials::GetCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MeshObject_SetAllTriangleProperties(instanceHandle, 0, nullptr); + Lib3MFResult errorCode = wrapperTable->m_CompositeMaterials_GetCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -4894,18 +9060,18 @@ void CLib3MFMeshObject::SetAllTriangleProperties(const FunctionCallbackInfo& args) +void CLib3MFCompositeMaterials::GetAllPropertyIDs(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetAllTriangleProperties."); - if (wrapperTable->m_MeshObject_GetAllTriangleProperties == nullptr) - throw std::runtime_error("Could not call Lib3MF method MeshObject::GetAllTriangleProperties."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetAllPropertyIDs."); + if (wrapperTable->m_CompositeMaterials_GetAllPropertyIDs == nullptr) + throw std::runtime_error("Could not call Lib3MF method CompositeMaterials::GetAllPropertyIDs."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MeshObject_GetAllTriangleProperties(instanceHandle, 0, nullptr, nullptr); + Lib3MFResult errorCode = wrapperTable->m_CompositeMaterials_GetAllPropertyIDs(instanceHandle, 0, nullptr, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -4914,19 +9080,22 @@ void CLib3MFMeshObject::GetAllTriangleProperties(const FunctionCallbackInfo& args) +void CLib3MFCompositeMaterials::GetBaseMaterialGroup(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + Lib3MFHandle hReturnBaseMaterialGroupInstance = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method ClearAllProperties."); - if (wrapperTable->m_MeshObject_ClearAllProperties == nullptr) - throw std::runtime_error("Could not call Lib3MF method MeshObject::ClearAllProperties."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBaseMaterialGroup."); + if (wrapperTable->m_CompositeMaterials_GetBaseMaterialGroup == nullptr) + throw std::runtime_error("Could not call Lib3MF method CompositeMaterials::GetBaseMaterialGroup."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MeshObject_ClearAllProperties(instanceHandle); + Lib3MFResult errorCode = wrapperTable->m_CompositeMaterials_GetBaseMaterialGroup(instanceHandle, &hReturnBaseMaterialGroupInstance); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjBaseMaterialGroupInstance = CLib3MFBaseMaterialGroup::NewInstance(args.Holder(), hReturnBaseMaterialGroupInstance); + args.GetReturnValue().Set(instanceObjBaseMaterialGroupInstance); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -4934,19 +9103,21 @@ void CLib3MFMeshObject::ClearAllProperties(const FunctionCallbackInfo& ar } -void CLib3MFMeshObject::SetGeometry(const FunctionCallbackInfo& args) +void CLib3MFCompositeMaterials::AddComposite(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + unsigned int nReturnPropertyID = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetGeometry."); - if (wrapperTable->m_MeshObject_SetGeometry == nullptr) - throw std::runtime_error("Could not call Lib3MF method MeshObject::SetGeometry."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddComposite."); + if (wrapperTable->m_CompositeMaterials_AddComposite == nullptr) + throw std::runtime_error("Could not call Lib3MF method CompositeMaterials::AddComposite."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MeshObject_SetGeometry(instanceHandle, 0, nullptr, 0, nullptr); + Lib3MFResult errorCode = wrapperTable->m_CompositeMaterials_AddComposite(instanceHandle, 0, nullptr, &nReturnPropertyID); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnPropertyID)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -4954,21 +9125,23 @@ void CLib3MFMeshObject::SetGeometry(const FunctionCallbackInfo& args) } -void CLib3MFMeshObject::IsManifoldAndOriented(const FunctionCallbackInfo& args) +void CLib3MFCompositeMaterials::RemoveComposite(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - bool bReturnIsManifoldAndOriented = false; + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); + } + unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method IsManifoldAndOriented."); - if (wrapperTable->m_MeshObject_IsManifoldAndOriented == nullptr) - throw std::runtime_error("Could not call Lib3MF method MeshObject::IsManifoldAndOriented."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveComposite."); + if (wrapperTable->m_CompositeMaterials_RemoveComposite == nullptr) + throw std::runtime_error("Could not call Lib3MF method CompositeMaterials::RemoveComposite."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MeshObject_IsManifoldAndOriented(instanceHandle, &bReturnIsManifoldAndOriented); + Lib3MFResult errorCode = wrapperTable->m_CompositeMaterials_RemoveComposite(instanceHandle, nPropertyID); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Boolean::New(isolate, bReturnIsManifoldAndOriented)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -4976,22 +9149,23 @@ void CLib3MFMeshObject::IsManifoldAndOriented(const FunctionCallbackInfo& } -void CLib3MFMeshObject::BeamLattice(const FunctionCallbackInfo& args) +void CLib3MFCompositeMaterials::GetComposite(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnTheBeamLattice = nullptr; + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); + } + unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method BeamLattice."); - if (wrapperTable->m_MeshObject_BeamLattice == nullptr) - throw std::runtime_error("Could not call Lib3MF method MeshObject::BeamLattice."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetComposite."); + if (wrapperTable->m_CompositeMaterials_GetComposite == nullptr) + throw std::runtime_error("Could not call Lib3MF method CompositeMaterials::GetComposite."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MeshObject_BeamLattice(instanceHandle, &hReturnTheBeamLattice); + Lib3MFResult errorCode = wrapperTable->m_CompositeMaterials_GetComposite(instanceHandle, nPropertyID, 0, nullptr, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjTheBeamLattice = CLib3MFBeamLattice::NewInstance(args.Holder(), hReturnTheBeamLattice); - args.GetReturnValue().Set(instanceObjTheBeamLattice); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -4999,71 +9173,58 @@ void CLib3MFMeshObject::BeamLattice(const FunctionCallbackInfo& args) } /************************************************************************************************************************* - Class CLib3MFBeamLattice Implementation + Class CLib3MFMultiPropertyGroup Implementation **************************************************************************************************************************/ -CLib3MFBeamLattice::CLib3MFBeamLattice() +CLib3MFMultiPropertyGroup::CLib3MFMultiPropertyGroup() : CLib3MFBaseClass() { } -CLib3MFBeamLattice::~CLib3MFBeamLattice() +CLib3MFMultiPropertyGroup::~CLib3MFMultiPropertyGroup() { } -void CLib3MFBeamLattice::Init() +void CLib3MFMultiPropertyGroup::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFBeamLattice")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFMultiPropertyGroup")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetMinLength", GetMinLength); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetMinLength", SetMinLength); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetClipping", GetClipping); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetClipping", SetClipping); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetRepresentation", GetRepresentation); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetRepresentation", SetRepresentation); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetBallOptions", GetBallOptions); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetBallOptions", SetBallOptions); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetBeamCount", GetBeamCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetBeam", GetBeam); - NODE_SET_PROTOTYPE_METHOD(tpl, "AddBeam", AddBeam); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetBeam", SetBeam); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetBeams", SetBeams); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetBeams", GetBeams); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetBallCount", GetBallCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetBall", GetBall); - NODE_SET_PROTOTYPE_METHOD(tpl, "AddBall", AddBall); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetBall", SetBall); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetBalls", SetBalls); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetBalls", GetBalls); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetBeamSetCount", GetBeamSetCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "AddBeamSet", AddBeamSet); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetBeamSet", GetBeamSet); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCount", GetCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetAllPropertyIDs", GetAllPropertyIDs); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddMultiProperty", AddMultiProperty); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetMultiProperty", SetMultiProperty); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetMultiProperty", GetMultiProperty); + NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveMultiProperty", RemoveMultiProperty); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetLayerCount", GetLayerCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddLayer", AddLayer); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetLayer", GetLayer); + NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveLayer", RemoveLayer); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFBeamLattice::New(const FunctionCallbackInfo& args) +void CLib3MFMultiPropertyGroup::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFBeamLattice * beamlatticeInstance = new CLib3MFBeamLattice(); - beamlatticeInstance->Wrap(args.This()); + CLib3MFMultiPropertyGroup * multipropertygroupInstance = new CLib3MFMultiPropertyGroup(); + multipropertygroupInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFBeamLattice: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFMultiPropertyGroup: Invalid call to Constructor"); } } -Local CLib3MFBeamLattice::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFMultiPropertyGroup::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -5077,21 +9238,21 @@ Local CLib3MFBeamLattice::NewInstance(Local pParent, Lib3MFHandl } -void CLib3MFBeamLattice::GetMinLength(const FunctionCallbackInfo& args) +void CLib3MFMultiPropertyGroup::GetCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - double dReturnMinLength = 0.0; + unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMinLength."); - if (wrapperTable->m_BeamLattice_GetMinLength == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetMinLength."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCount."); + if (wrapperTable->m_MultiPropertyGroup_GetCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method MultiPropertyGroup::GetCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetMinLength(instanceHandle, &dReturnMinLength); + Lib3MFResult errorCode = wrapperTable->m_MultiPropertyGroup_GetCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Number::New(isolate, dReturnMinLength)); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -5099,22 +9260,18 @@ void CLib3MFBeamLattice::GetMinLength(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::SetMinLength(const FunctionCallbackInfo& args) +void CLib3MFMultiPropertyGroup::GetAllPropertyIDs(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsNumber()) { - throw std::runtime_error("Expected double parameter 0 (MinLength)"); - } - double dMinLength = (double) args[0]->NumberValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetMinLength."); - if (wrapperTable->m_BeamLattice_SetMinLength == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetMinLength."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetAllPropertyIDs."); + if (wrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs == nullptr) + throw std::runtime_error("Could not call Lib3MF method MultiPropertyGroup::GetAllPropertyIDs."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetMinLength(instanceHandle, dMinLength); + Lib3MFResult errorCode = wrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs(instanceHandle, 0, nullptr, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -5123,25 +9280,21 @@ void CLib3MFBeamLattice::SetMinLength(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::GetClipping(const FunctionCallbackInfo& args) +void CLib3MFMultiPropertyGroup::AddMultiProperty(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Local outObject = Object::New(isolate); - eLib3MFBeamLatticeClipMode eReturnClipMode; - unsigned int nReturnUniqueResourceID = 0; + unsigned int nReturnPropertyID = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetClipping."); - if (wrapperTable->m_BeamLattice_GetClipping == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetClipping."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddMultiProperty."); + if (wrapperTable->m_MultiPropertyGroup_AddMultiProperty == nullptr) + throw std::runtime_error("Could not call Lib3MF method MultiPropertyGroup::AddMultiProperty."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetClipping(instanceHandle, &eReturnClipMode, &nReturnUniqueResourceID); + Lib3MFResult errorCode = wrapperTable->m_MultiPropertyGroup_AddMultiProperty(instanceHandle, 0, nullptr, &nReturnPropertyID); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "ClipMode"), Integer::New(isolate, (int)eReturnClipMode)); - outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "UniqueResourceID"), Integer::NewFromUnsigned(isolate, nReturnUniqueResourceID)); - args.GetReturnValue().Set(outObject); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnPropertyID)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -5149,26 +9302,22 @@ void CLib3MFBeamLattice::GetClipping(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::SetClipping(const FunctionCallbackInfo& args) +void CLib3MFMultiPropertyGroup::SetMultiProperty(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected enum parameter 0 (ClipMode)"); - } - if (!args[1]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 1 (UniqueResourceID)"); + throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); } - unsigned int eClipMode = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - unsigned int nUniqueResourceID = (unsigned int) args[1]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetClipping."); - if (wrapperTable->m_BeamLattice_SetClipping == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetClipping."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetMultiProperty."); + if (wrapperTable->m_MultiPropertyGroup_SetMultiProperty == nullptr) + throw std::runtime_error("Could not call Lib3MF method MultiPropertyGroup::SetMultiProperty."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetClipping(instanceHandle, (eLib3MFBeamLatticeClipMode) eClipMode, nUniqueResourceID); + Lib3MFResult errorCode = wrapperTable->m_MultiPropertyGroup_SetMultiProperty(instanceHandle, nPropertyID, 0, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -5177,25 +9326,23 @@ void CLib3MFBeamLattice::SetClipping(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::GetRepresentation(const FunctionCallbackInfo& args) +void CLib3MFMultiPropertyGroup::GetMultiProperty(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Local outObject = Object::New(isolate); - bool bReturnHasRepresentation = false; - unsigned int nReturnUniqueResourceID = 0; + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); + } + unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetRepresentation."); - if (wrapperTable->m_BeamLattice_GetRepresentation == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetRepresentation."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMultiProperty."); + if (wrapperTable->m_MultiPropertyGroup_GetMultiProperty == nullptr) + throw std::runtime_error("Could not call Lib3MF method MultiPropertyGroup::GetMultiProperty."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetRepresentation(instanceHandle, &bReturnHasRepresentation, &nReturnUniqueResourceID); + Lib3MFResult errorCode = wrapperTable->m_MultiPropertyGroup_GetMultiProperty(instanceHandle, nPropertyID, 0, nullptr, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "HasRepresentation"), Boolean::New(isolate, bReturnHasRepresentation)); - outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "UniqueResourceID"), Integer::NewFromUnsigned(isolate, nReturnUniqueResourceID)); - args.GetReturnValue().Set(outObject); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -5203,22 +9350,22 @@ void CLib3MFBeamLattice::GetRepresentation(const FunctionCallbackInfo& ar } -void CLib3MFBeamLattice::SetRepresentation(const FunctionCallbackInfo& args) +void CLib3MFMultiPropertyGroup::RemoveMultiProperty(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (UniqueResourceID)"); + throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); } - unsigned int nUniqueResourceID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetRepresentation."); - if (wrapperTable->m_BeamLattice_SetRepresentation == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetRepresentation."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveMultiProperty."); + if (wrapperTable->m_MultiPropertyGroup_RemoveMultiProperty == nullptr) + throw std::runtime_error("Could not call Lib3MF method MultiPropertyGroup::RemoveMultiProperty."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetRepresentation(instanceHandle, nUniqueResourceID); + Lib3MFResult errorCode = wrapperTable->m_MultiPropertyGroup_RemoveMultiProperty(instanceHandle, nPropertyID); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -5227,25 +9374,21 @@ void CLib3MFBeamLattice::SetRepresentation(const FunctionCallbackInfo& ar } -void CLib3MFBeamLattice::GetBallOptions(const FunctionCallbackInfo& args) +void CLib3MFMultiPropertyGroup::GetLayerCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Local outObject = Object::New(isolate); - eLib3MFBeamLatticeBallMode eReturnBallMode; - double dReturnBallRadius = 0.0; + unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBallOptions."); - if (wrapperTable->m_BeamLattice_GetBallOptions == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBallOptions."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetLayerCount."); + if (wrapperTable->m_MultiPropertyGroup_GetLayerCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method MultiPropertyGroup::GetLayerCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBallOptions(instanceHandle, &eReturnBallMode, &dReturnBallRadius); + Lib3MFResult errorCode = wrapperTable->m_MultiPropertyGroup_GetLayerCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "BallMode"), Integer::New(isolate, (int)eReturnBallMode)); - outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "BallRadius"), Number::New(isolate, dReturnBallRadius)); - args.GetReturnValue().Set(outObject); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -5253,49 +9396,25 @@ void CLib3MFBeamLattice::GetBallOptions(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::SetBallOptions(const FunctionCallbackInfo& args) +void CLib3MFMultiPropertyGroup::AddLayer(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected enum parameter 0 (BallMode)"); - } - if (!args[1]->IsNumber()) { - throw std::runtime_error("Expected double parameter 1 (BallRadius)"); + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected struct parameter 0 (TheLayer)"); } - unsigned int eBallMode = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - double dBallRadius = (double) args[1]->NumberValue(isolate->GetCurrentContext()).ToChecked(); - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBallOptions."); - if (wrapperTable->m_BeamLattice_SetBallOptions == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetBallOptions."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetBallOptions(instanceHandle, (eLib3MFBeamLatticeBallMode) eBallMode, dBallRadius); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - - } catch (std::exception & E) { - RaiseError(isolate, E.what()); - } -} - - -void CLib3MFBeamLattice::GetBeamCount(const FunctionCallbackInfo& args) -{ - Isolate* isolate = args.GetIsolate(); - HandleScope scope(isolate); - try { - unsigned int nReturnCount = 0; + sLib3MFMultiPropertyLayer sTheLayer = convertObjectToLib3MFMultiPropertyLayer(isolate, args[0]); + unsigned int nReturnLayerIndex = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBeamCount."); - if (wrapperTable->m_BeamLattice_GetBeamCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBeamCount."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddLayer."); + if (wrapperTable->m_MultiPropertyGroup_AddLayer == nullptr) + throw std::runtime_error("Could not call Lib3MF method MultiPropertyGroup::AddLayer."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBeamCount(instanceHandle, &nReturnCount); + Lib3MFResult errorCode = wrapperTable->m_MultiPropertyGroup_AddLayer(instanceHandle, &sTheLayer, &nReturnLayerIndex); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnLayerIndex)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -5303,25 +9422,25 @@ void CLib3MFBeamLattice::GetBeamCount(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::GetBeam(const FunctionCallbackInfo& args) +void CLib3MFMultiPropertyGroup::GetLayer(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + throw std::runtime_error("Expected uint32 parameter 0 (LayerIndex)"); } - unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - sLib3MFBeam sReturnBeamInfo; + unsigned int nLayerIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + sLib3MFMultiPropertyLayer sReturnTheLayer; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBeam."); - if (wrapperTable->m_BeamLattice_GetBeam == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBeam."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetLayer."); + if (wrapperTable->m_MultiPropertyGroup_GetLayer == nullptr) + throw std::runtime_error("Could not call Lib3MF method MultiPropertyGroup::GetLayer."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBeam(instanceHandle, nIndex, &sReturnBeamInfo); + Lib3MFResult errorCode = wrapperTable->m_MultiPropertyGroup_GetLayer(instanceHandle, nLayerIndex, &sReturnTheLayer); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(convertLib3MFBeamToObject(isolate, sReturnBeamInfo)); + args.GetReturnValue().Set(convertLib3MFMultiPropertyLayerToObject(isolate, sReturnTheLayer)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -5329,73 +9448,116 @@ void CLib3MFBeamLattice::GetBeam(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::AddBeam(const FunctionCallbackInfo& args) +void CLib3MFMultiPropertyGroup::RemoveLayer(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsObject()) { - throw std::runtime_error("Expected struct parameter 0 (BeamInfo)"); + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (LayerIndex)"); } - sLib3MFBeam sBeamInfo = convertObjectToLib3MFBeam(isolate, args[0]); - unsigned int nReturnIndex = 0; + unsigned int nLayerIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method AddBeam."); - if (wrapperTable->m_BeamLattice_AddBeam == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::AddBeam."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveLayer."); + if (wrapperTable->m_MultiPropertyGroup_RemoveLayer == nullptr) + throw std::runtime_error("Could not call Lib3MF method MultiPropertyGroup::RemoveLayer."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_AddBeam(instanceHandle, &sBeamInfo, &nReturnIndex); + Lib3MFResult errorCode = wrapperTable->m_MultiPropertyGroup_RemoveLayer(instanceHandle, nLayerIndex); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnIndex)); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } +/************************************************************************************************************************* + Class CLib3MFAttachment Implementation +**************************************************************************************************************************/ -void CLib3MFBeamLattice::SetBeam(const FunctionCallbackInfo& args) +CLib3MFAttachment::CLib3MFAttachment() + : CLib3MFBaseClass() +{ +} + +CLib3MFAttachment::~CLib3MFAttachment() +{ +} + +void CLib3MFAttachment::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFAttachment")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetPath", GetPath); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetPath", SetPath); + NODE_SET_PROTOTYPE_METHOD(tpl, "PackagePart", PackagePart); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetRelationShipType", GetRelationShipType); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetRelationShipType", SetRelationShipType); + NODE_SET_PROTOTYPE_METHOD(tpl, "WriteToFile", WriteToFile); + NODE_SET_PROTOTYPE_METHOD(tpl, "ReadFromFile", ReadFromFile); + NODE_SET_PROTOTYPE_METHOD(tpl, "ReadFromCallback", ReadFromCallback); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetStreamSize", GetStreamSize); + NODE_SET_PROTOTYPE_METHOD(tpl, "WriteToBuffer", WriteToBuffer); + NODE_SET_PROTOTYPE_METHOD(tpl, "ReadFromBuffer", ReadFromBuffer); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFAttachment::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); - try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (Index)"); - } - if (!args[1]->IsObject()) { - throw std::runtime_error("Expected struct parameter 1 (BeamInfo)"); - } - unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - sLib3MFBeam sBeamInfo = convertObjectToLib3MFBeam(isolate, args[1]); - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBeam."); - if (wrapperTable->m_BeamLattice_SetBeam == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetBeam."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetBeam(instanceHandle, nIndex, &sBeamInfo); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - } catch (std::exception & E) { - RaiseError(isolate, E.what()); + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFAttachment * attachmentInstance = new CLib3MFAttachment(); + attachmentInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFAttachment: Invalid call to Constructor"); + } +} + +Local CLib3MFAttachment::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); } + return instance; } -void CLib3MFBeamLattice::SetBeams(const FunctionCallbackInfo& args) +void CLib3MFAttachment::GetPath(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + unsigned int bytesNeededPath = 0; + unsigned int bytesWrittenPath = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBeams."); - if (wrapperTable->m_BeamLattice_SetBeams == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetBeams."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetPath."); + if (wrapperTable->m_Attachment_GetPath == nullptr) + throw std::runtime_error("Could not call Lib3MF method Attachment::GetPath."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetBeams(instanceHandle, 0, nullptr); + Lib3MFResult initErrorCode = wrapperTable->m_Attachment_GetPath(instanceHandle, 0, &bytesNeededPath, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferPath; + bufferPath.resize(bytesNeededPath); + Lib3MFResult errorCode = wrapperTable->m_Attachment_GetPath(instanceHandle, bytesNeededPath, &bytesWrittenPath, &bufferPath[0]); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferPath[0])); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -5403,18 +9565,23 @@ void CLib3MFBeamLattice::SetBeams(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::GetBeams(const FunctionCallbackInfo& args) +void CLib3MFAttachment::SetPath(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Path)"); + } + v8::String::Utf8Value sutf8Path(isolate, args[0]); + std::string sPath = *sutf8Path; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBeams."); - if (wrapperTable->m_BeamLattice_GetBeams == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBeams."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetPath."); + if (wrapperTable->m_Attachment_SetPath == nullptr) + throw std::runtime_error("Could not call Lib3MF method Attachment::SetPath."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBeams(instanceHandle, 0, nullptr, nullptr); + Lib3MFResult errorCode = wrapperTable->m_Attachment_SetPath(instanceHandle, sPath.c_str()); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -5423,21 +9590,22 @@ void CLib3MFBeamLattice::GetBeams(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::GetBallCount(const FunctionCallbackInfo& args) +void CLib3MFAttachment::PackagePart(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int nReturnCount = 0; + Lib3MFHandle hReturnPackagePart = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBallCount."); - if (wrapperTable->m_BeamLattice_GetBallCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBallCount."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method PackagePart."); + if (wrapperTable->m_Attachment_PackagePart == nullptr) + throw std::runtime_error("Could not call Lib3MF method Attachment::PackagePart."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBallCount(instanceHandle, &nReturnCount); + Lib3MFResult errorCode = wrapperTable->m_Attachment_PackagePart(instanceHandle, &hReturnPackagePart); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); + Local instanceObjPackagePart = CLib3MFPackagePart::NewInstance(args.Holder(), hReturnPackagePart); + args.GetReturnValue().Set(instanceObjPackagePart); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -5445,25 +9613,26 @@ void CLib3MFBeamLattice::GetBallCount(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::GetBall(const FunctionCallbackInfo& args) +void CLib3MFAttachment::GetRelationShipType(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (Index)"); - } - unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - sLib3MFBall sReturnBallInfo; + unsigned int bytesNeededPath = 0; + unsigned int bytesWrittenPath = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBall."); - if (wrapperTable->m_BeamLattice_GetBall == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBall."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetRelationShipType."); + if (wrapperTable->m_Attachment_GetRelationShipType == nullptr) + throw std::runtime_error("Could not call Lib3MF method Attachment::GetRelationShipType."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBall(instanceHandle, nIndex, &sReturnBallInfo); + Lib3MFResult initErrorCode = wrapperTable->m_Attachment_GetRelationShipType(instanceHandle, 0, &bytesNeededPath, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferPath; + bufferPath.resize(bytesNeededPath); + Lib3MFResult errorCode = wrapperTable->m_Attachment_GetRelationShipType(instanceHandle, bytesNeededPath, &bytesWrittenPath, &bufferPath[0]); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(convertLib3MFBallToObject(isolate, sReturnBallInfo)); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferPath[0])); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -5471,25 +9640,24 @@ void CLib3MFBeamLattice::GetBall(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::AddBall(const FunctionCallbackInfo& args) +void CLib3MFAttachment::SetRelationShipType(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsObject()) { - throw std::runtime_error("Expected struct parameter 0 (BallInfo)"); + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Path)"); } - sLib3MFBall sBallInfo = convertObjectToLib3MFBall(isolate, args[0]); - unsigned int nReturnIndex = 0; + v8::String::Utf8Value sutf8Path(isolate, args[0]); + std::string sPath = *sutf8Path; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method AddBall."); - if (wrapperTable->m_BeamLattice_AddBall == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::AddBall."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetRelationShipType."); + if (wrapperTable->m_Attachment_SetRelationShipType == nullptr) + throw std::runtime_error("Could not call Lib3MF method Attachment::SetRelationShipType."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_AddBall(instanceHandle, &sBallInfo, &nReturnIndex); + Lib3MFResult errorCode = wrapperTable->m_Attachment_SetRelationShipType(instanceHandle, sPath.c_str()); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnIndex)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -5497,26 +9665,23 @@ void CLib3MFBeamLattice::AddBall(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::SetBall(const FunctionCallbackInfo& args) +void CLib3MFAttachment::WriteToFile(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (Index)"); - } - if (!args[1]->IsObject()) { - throw std::runtime_error("Expected struct parameter 1 (BallInfo)"); + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (FileName)"); } - unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - sLib3MFBall sBallInfo = convertObjectToLib3MFBall(isolate, args[1]); + v8::String::Utf8Value sutf8FileName(isolate, args[0]); + std::string sFileName = *sutf8FileName; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBall."); - if (wrapperTable->m_BeamLattice_SetBall == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetBall."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method WriteToFile."); + if (wrapperTable->m_Attachment_WriteToFile == nullptr) + throw std::runtime_error("Could not call Lib3MF method Attachment::WriteToFile."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetBall(instanceHandle, nIndex, &sBallInfo); + Lib3MFResult errorCode = wrapperTable->m_Attachment_WriteToFile(instanceHandle, sFileName.c_str()); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -5525,18 +9690,23 @@ void CLib3MFBeamLattice::SetBall(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::SetBalls(const FunctionCallbackInfo& args) +void CLib3MFAttachment::ReadFromFile(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (FileName)"); + } + v8::String::Utf8Value sutf8FileName(isolate, args[0]); + std::string sFileName = *sutf8FileName; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBalls."); - if (wrapperTable->m_BeamLattice_SetBalls == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::SetBalls."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method ReadFromFile."); + if (wrapperTable->m_Attachment_ReadFromFile == nullptr) + throw std::runtime_error("Could not call Lib3MF method Attachment::ReadFromFile."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_SetBalls(instanceHandle, 0, nullptr); + Lib3MFResult errorCode = wrapperTable->m_Attachment_ReadFromFile(instanceHandle, sFileName.c_str()); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -5545,18 +9715,30 @@ void CLib3MFBeamLattice::SetBalls(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::GetBalls(const FunctionCallbackInfo& args) +void CLib3MFAttachment::ReadFromCallback(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + if (!args[1]->IsString()) { + throw std::runtime_error("Expected uint64 parameter 1 (StreamSize)"); + } + if (!args[3]->IsString()) { + throw std::runtime_error("Expected pointer parameter 3 (UserData)"); + } + v8::String::Utf8Value sutf8StreamSize(isolate, args[1]); + std::string sStreamSize = *sutf8StreamSize; + uint64_t nStreamSize = stoull(sStreamSize); + v8::String::Utf8Value sutf8UserData(isolate, args[3]); + std::string sUserData = *sutf8UserData; + uint64_t nUserData = stoull(sUserData); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBalls."); - if (wrapperTable->m_BeamLattice_GetBalls == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBalls."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method ReadFromCallback."); + if (wrapperTable->m_Attachment_ReadFromCallback == nullptr) + throw std::runtime_error("Could not call Lib3MF method Attachment::ReadFromCallback."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBalls(instanceHandle, 0, nullptr, nullptr); + Lib3MFResult errorCode = wrapperTable->m_Attachment_ReadFromCallback(instanceHandle, nullptr, nStreamSize, nullptr, (void*) nUserData); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -5565,21 +9747,21 @@ void CLib3MFBeamLattice::GetBalls(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::GetBeamSetCount(const FunctionCallbackInfo& args) +void CLib3MFAttachment::GetStreamSize(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int nReturnCount = 0; + uint64_t nReturnStreamSize = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBeamSetCount."); - if (wrapperTable->m_BeamLattice_GetBeamSetCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBeamSetCount."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetStreamSize."); + if (wrapperTable->m_Attachment_GetStreamSize == nullptr) + throw std::runtime_error("Could not call Lib3MF method Attachment::GetStreamSize."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBeamSetCount(instanceHandle, &nReturnCount); + Lib3MFResult errorCode = wrapperTable->m_Attachment_GetStreamSize(instanceHandle, &nReturnStreamSize); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, std::to_string(nReturnStreamSize).c_str())); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -5587,22 +9769,19 @@ void CLib3MFBeamLattice::GetBeamSetCount(const FunctionCallbackInfo& args } -void CLib3MFBeamLattice::AddBeamSet(const FunctionCallbackInfo& args) +void CLib3MFAttachment::WriteToBuffer(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnBeamSet = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method AddBeamSet."); - if (wrapperTable->m_BeamLattice_AddBeamSet == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::AddBeamSet."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method WriteToBuffer."); + if (wrapperTable->m_Attachment_WriteToBuffer == nullptr) + throw std::runtime_error("Could not call Lib3MF method Attachment::WriteToBuffer."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_AddBeamSet(instanceHandle, &hReturnBeamSet); + Lib3MFResult errorCode = wrapperTable->m_Attachment_WriteToBuffer(instanceHandle, 0, nullptr, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjBeamSet = CLib3MFBeamSet::NewInstance(args.Holder(), hReturnBeamSet); - args.GetReturnValue().Set(instanceObjBeamSet); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -5610,26 +9789,19 @@ void CLib3MFBeamLattice::AddBeamSet(const FunctionCallbackInfo& args) } -void CLib3MFBeamLattice::GetBeamSet(const FunctionCallbackInfo& args) +void CLib3MFAttachment::ReadFromBuffer(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (Index)"); - } - unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - Lib3MFHandle hReturnBeamSet = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBeamSet."); - if (wrapperTable->m_BeamLattice_GetBeamSet == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamLattice::GetBeamSet."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method ReadFromBuffer."); + if (wrapperTable->m_Attachment_ReadFromBuffer == nullptr) + throw std::runtime_error("Could not call Lib3MF method Attachment::ReadFromBuffer."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamLattice_GetBeamSet(instanceHandle, nIndex, &hReturnBeamSet); + Lib3MFResult errorCode = wrapperTable->m_Attachment_ReadFromBuffer(instanceHandle, 0, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjBeamSet = CLib3MFBeamSet::NewInstance(args.Holder(), hReturnBeamSet); - args.GetReturnValue().Set(instanceObjBeamSet); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -5637,55 +9809,56 @@ void CLib3MFBeamLattice::GetBeamSet(const FunctionCallbackInfo& args) } /************************************************************************************************************************* - Class CLib3MFComponent Implementation + Class CLib3MFTexture2D Implementation **************************************************************************************************************************/ -CLib3MFComponent::CLib3MFComponent() +CLib3MFTexture2D::CLib3MFTexture2D() : CLib3MFBaseClass() { } -CLib3MFComponent::~CLib3MFComponent() +CLib3MFTexture2D::~CLib3MFTexture2D() { } -void CLib3MFComponent::Init() +void CLib3MFTexture2D::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFComponent")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFTexture2D")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetObjectResource", GetObjectResource); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetObjectResourceID", GetObjectResourceID); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetUUID", GetUUID); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetUUID", SetUUID); - NODE_SET_PROTOTYPE_METHOD(tpl, "HasTransform", HasTransform); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetTransform", GetTransform); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetTransform", SetTransform); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetAttachment", GetAttachment); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetAttachment", SetAttachment); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetContentType", GetContentType); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetContentType", SetContentType); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetTileStyleUV", GetTileStyleUV); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetTileStyleUV", SetTileStyleUV); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetFilter", GetFilter); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetFilter", SetFilter); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFComponent::New(const FunctionCallbackInfo& args) +void CLib3MFTexture2D::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFComponent * componentInstance = new CLib3MFComponent(); - componentInstance->Wrap(args.This()); + CLib3MFTexture2D * texture2dInstance = new CLib3MFTexture2D(); + texture2dInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFComponent: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFTexture2D: Invalid call to Constructor"); } } -Local CLib3MFComponent::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFTexture2D::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -5699,75 +9872,22 @@ Local CLib3MFComponent::NewInstance(Local pParent, Lib3MFHandle } -void CLib3MFComponent::GetObjectResource(const FunctionCallbackInfo& args) -{ - Isolate* isolate = args.GetIsolate(); - HandleScope scope(isolate); - try { - Lib3MFHandle hReturnObjectResource = nullptr; - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetObjectResource."); - if (wrapperTable->m_Component_GetObjectResource == nullptr) - throw std::runtime_error("Could not call Lib3MF method Component::GetObjectResource."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Component_GetObjectResource(instanceHandle, &hReturnObjectResource); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjObjectResource = CLib3MFObject::NewInstance(args.Holder(), hReturnObjectResource); - args.GetReturnValue().Set(instanceObjObjectResource); - - } catch (std::exception & E) { - RaiseError(isolate, E.what()); - } -} - - -void CLib3MFComponent::GetObjectResourceID(const FunctionCallbackInfo& args) -{ - Isolate* isolate = args.GetIsolate(); - HandleScope scope(isolate); - try { - unsigned int nReturnUniqueResourceID = 0; - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetObjectResourceID."); - if (wrapperTable->m_Component_GetObjectResourceID == nullptr) - throw std::runtime_error("Could not call Lib3MF method Component::GetObjectResourceID."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Component_GetObjectResourceID(instanceHandle, &nReturnUniqueResourceID); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnUniqueResourceID)); - - } catch (std::exception & E) { - RaiseError(isolate, E.what()); - } -} - - -void CLib3MFComponent::GetUUID(const FunctionCallbackInfo& args) +void CLib3MFTexture2D::GetAttachment(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Local outObject = Object::New(isolate); - bool bReturnHasUUID = false; - unsigned int bytesNeededUUID = 0; - unsigned int bytesWrittenUUID = 0; + Lib3MFHandle hReturnAttachment = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetUUID."); - if (wrapperTable->m_Component_GetUUID == nullptr) - throw std::runtime_error("Could not call Lib3MF method Component::GetUUID."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetAttachment."); + if (wrapperTable->m_Texture2D_GetAttachment == nullptr) + throw std::runtime_error("Could not call Lib3MF method Texture2D::GetAttachment."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult initErrorCode = wrapperTable->m_Component_GetUUID(instanceHandle, &bReturnHasUUID, 0, &bytesNeededUUID, nullptr); - CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); - std::vector bufferUUID; - bufferUUID.resize(bytesNeededUUID); - Lib3MFResult errorCode = wrapperTable->m_Component_GetUUID(instanceHandle, &bReturnHasUUID, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0]); + Lib3MFResult errorCode = wrapperTable->m_Texture2D_GetAttachment(instanceHandle, &hReturnAttachment); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "HasUUID"), Boolean::New(isolate, bReturnHasUUID)); - outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "UUID"), String::NewFromUtf8(isolate, &bufferUUID[0])); - args.GetReturnValue().Set(outObject); + Local instanceObjAttachment = CLib3MFAttachment::NewInstance(args.Holder(), hReturnAttachment); + args.GetReturnValue().Set(instanceObjAttachment); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -5775,23 +9895,26 @@ void CLib3MFComponent::GetUUID(const FunctionCallbackInfo& args) } -void CLib3MFComponent::SetUUID(const FunctionCallbackInfo& args) +void CLib3MFTexture2D::SetAttachment(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsString()) { - throw std::runtime_error("Expected string parameter 0 (UUID)"); + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected class parameter 0 (Attachment)"); } - v8::String::Utf8Value sutf8UUID(isolate, args[0]); - std::string sUUID = *sutf8UUID; + Local objAttachment = args[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); + CLib3MFAttachment * instanceAttachment = ObjectWrap::Unwrap(objAttachment); + if (instanceAttachment == nullptr) + throw std::runtime_error("Invalid Object parameter 0 (Attachment)"); + Lib3MFHandle hAttachment = instanceAttachment->getHandle( objAttachment ); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetUUID."); - if (wrapperTable->m_Component_SetUUID == nullptr) - throw std::runtime_error("Could not call Lib3MF method Component::SetUUID."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetAttachment."); + if (wrapperTable->m_Texture2D_SetAttachment == nullptr) + throw std::runtime_error("Could not call Lib3MF method Texture2D::SetAttachment."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Component_SetUUID(instanceHandle, sUUID.c_str()); + Lib3MFResult errorCode = wrapperTable->m_Texture2D_SetAttachment(instanceHandle, hAttachment); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -5800,21 +9923,21 @@ void CLib3MFComponent::SetUUID(const FunctionCallbackInfo& args) } -void CLib3MFComponent::HasTransform(const FunctionCallbackInfo& args) +void CLib3MFTexture2D::GetContentType(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - bool bReturnHasTransform = false; + eLib3MFTextureType eReturnContentType; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method HasTransform."); - if (wrapperTable->m_Component_HasTransform == nullptr) - throw std::runtime_error("Could not call Lib3MF method Component::HasTransform."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetContentType."); + if (wrapperTable->m_Texture2D_GetContentType == nullptr) + throw std::runtime_error("Could not call Lib3MF method Texture2D::GetContentType."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Component_HasTransform(instanceHandle, &bReturnHasTransform); + Lib3MFResult errorCode = wrapperTable->m_Texture2D_GetContentType(instanceHandle, &eReturnContentType); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Boolean::New(isolate, bReturnHasTransform)); + args.GetReturnValue().Set(Integer::New(isolate, (int)eReturnContentType)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -5822,21 +9945,23 @@ void CLib3MFComponent::HasTransform(const FunctionCallbackInfo& args) } -void CLib3MFComponent::GetTransform(const FunctionCallbackInfo& args) +void CLib3MFTexture2D::SetContentType(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - sLib3MFTransform sReturnTransform; + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected enum parameter 0 (ContentType)"); + } + unsigned int eContentType = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetTransform."); - if (wrapperTable->m_Component_GetTransform == nullptr) - throw std::runtime_error("Could not call Lib3MF method Component::GetTransform."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetContentType."); + if (wrapperTable->m_Texture2D_SetContentType == nullptr) + throw std::runtime_error("Could not call Lib3MF method Texture2D::SetContentType."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Component_GetTransform(instanceHandle, &sReturnTransform); + Lib3MFResult errorCode = wrapperTable->m_Texture2D_SetContentType(instanceHandle, (eLib3MFTextureType) eContentType); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(convertLib3MFTransformToObject(isolate, sReturnTransform)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -5844,116 +9969,53 @@ void CLib3MFComponent::GetTransform(const FunctionCallbackInfo& args) } -void CLib3MFComponent::SetTransform(const FunctionCallbackInfo& args) +void CLib3MFTexture2D::GetTileStyleUV(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsObject()) { - throw std::runtime_error("Expected struct parameter 0 (Transform)"); - } - sLib3MFTransform sTransform = convertObjectToLib3MFTransform(isolate, args[0]); + Local outObject = Object::New(isolate); + eLib3MFTextureTileStyle eReturnTileStyleU; + eLib3MFTextureTileStyle eReturnTileStyleV; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetTransform."); - if (wrapperTable->m_Component_SetTransform == nullptr) - throw std::runtime_error("Could not call Lib3MF method Component::SetTransform."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetTileStyleUV."); + if (wrapperTable->m_Texture2D_GetTileStyleUV == nullptr) + throw std::runtime_error("Could not call Lib3MF method Texture2D::GetTileStyleUV."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Component_SetTransform(instanceHandle, &sTransform); + Lib3MFResult errorCode = wrapperTable->m_Texture2D_GetTileStyleUV(instanceHandle, &eReturnTileStyleU, &eReturnTileStyleV); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "TileStyleU"), Integer::New(isolate, (int)eReturnTileStyleU)); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "TileStyleV"), Integer::New(isolate, (int)eReturnTileStyleV)); + args.GetReturnValue().Set(outObject); - } catch (std::exception & E) { - RaiseError(isolate, E.what()); - } -} - -/************************************************************************************************************************* - Class CLib3MFComponentsObject Implementation -**************************************************************************************************************************/ - -CLib3MFComponentsObject::CLib3MFComponentsObject() - : CLib3MFBaseClass() -{ -} - -CLib3MFComponentsObject::~CLib3MFComponentsObject() -{ -} - -void CLib3MFComponentsObject::Init() -{ - Isolate* isolate = Isolate::GetCurrent(); - - // Prepare constructor template - Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFComponentsObject")); - tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); - - // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "AddComponent", AddComponent); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetComponent", GetComponent); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetComponentCount", GetComponentCount); - constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); - -} - -void CLib3MFComponentsObject::New(const FunctionCallbackInfo& args) -{ - Isolate* isolate = args.GetIsolate(); - HandleScope scope(isolate); - - if (args.IsConstructCall()) { - CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFComponentsObject * componentsobjectInstance = new CLib3MFComponentsObject(); - componentsobjectInstance->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - RaiseError(isolate, "Lib3MFComponentsObject: Invalid call to Constructor"); - } -} - -Local CLib3MFComponentsObject::NewInstance(Local pParent, Lib3MFHandle pHandle) -{ - Isolate* isolate = Isolate::GetCurrent(); - HandleScope scope(isolate); - Local cons = Local::New(isolate, constructor); - Local instance; - if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { - instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); - instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } - return instance; } -void CLib3MFComponentsObject::AddComponent(const FunctionCallbackInfo& args) +void CLib3MFTexture2D::SetTileStyleUV(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsObject()) { - throw std::runtime_error("Expected class parameter 0 (ObjectResource)"); + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected enum parameter 0 (TileStyleU)"); } - if (!args[1]->IsObject()) { - throw std::runtime_error("Expected struct parameter 1 (Transform)"); + if (!args[1]->IsUint32()) { + throw std::runtime_error("Expected enum parameter 1 (TileStyleV)"); } - Local objObjectResource = args[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); - CLib3MFObject * instanceObjectResource = ObjectWrap::Unwrap(objObjectResource); - if (instanceObjectResource == nullptr) - throw std::runtime_error("Invalid Object parameter 0 (ObjectResource)"); - Lib3MFHandle hObjectResource = instanceObjectResource->getHandle( objObjectResource ); - sLib3MFTransform sTransform = convertObjectToLib3MFTransform(isolate, args[1]); - Lib3MFHandle hReturnComponentInstance = nullptr; + unsigned int eTileStyleU = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int eTileStyleV = (unsigned int) args[1]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method AddComponent."); - if (wrapperTable->m_ComponentsObject_AddComponent == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComponentsObject::AddComponent."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetTileStyleUV."); + if (wrapperTable->m_Texture2D_SetTileStyleUV == nullptr) + throw std::runtime_error("Could not call Lib3MF method Texture2D::SetTileStyleUV."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComponentsObject_AddComponent(instanceHandle, hObjectResource, &sTransform, &hReturnComponentInstance); + Lib3MFResult errorCode = wrapperTable->m_Texture2D_SetTileStyleUV(instanceHandle, (eLib3MFTextureTileStyle) eTileStyleU, (eLib3MFTextureTileStyle) eTileStyleV); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjComponentInstance = CLib3MFComponent::NewInstance(args.Holder(), hReturnComponentInstance); - args.GetReturnValue().Set(instanceObjComponentInstance); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -5961,26 +10023,21 @@ void CLib3MFComponentsObject::AddComponent(const FunctionCallbackInfo& ar } -void CLib3MFComponentsObject::GetComponent(const FunctionCallbackInfo& args) +void CLib3MFTexture2D::GetFilter(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (Index)"); - } - unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - Lib3MFHandle hReturnComponentInstance = nullptr; + eLib3MFTextureFilter eReturnFilter; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetComponent."); - if (wrapperTable->m_ComponentsObject_GetComponent == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComponentsObject::GetComponent."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetFilter."); + if (wrapperTable->m_Texture2D_GetFilter == nullptr) + throw std::runtime_error("Could not call Lib3MF method Texture2D::GetFilter."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComponentsObject_GetComponent(instanceHandle, nIndex, &hReturnComponentInstance); + Lib3MFResult errorCode = wrapperTable->m_Texture2D_GetFilter(instanceHandle, &eReturnFilter); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjComponentInstance = CLib3MFComponent::NewInstance(args.Holder(), hReturnComponentInstance); - args.GetReturnValue().Set(instanceObjComponentInstance); + args.GetReturnValue().Set(Integer::New(isolate, (int)eReturnFilter)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -5988,21 +10045,23 @@ void CLib3MFComponentsObject::GetComponent(const FunctionCallbackInfo& ar } -void CLib3MFComponentsObject::GetComponentCount(const FunctionCallbackInfo& args) +void CLib3MFTexture2D::SetFilter(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int nReturnCount = 0; + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected enum parameter 0 (Filter)"); + } + unsigned int eFilter = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetComponentCount."); - if (wrapperTable->m_ComponentsObject_GetComponentCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method ComponentsObject::GetComponentCount."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetFilter."); + if (wrapperTable->m_Texture2D_SetFilter == nullptr) + throw std::runtime_error("Could not call Lib3MF method Texture2D::SetFilter."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ComponentsObject_GetComponentCount(instanceHandle, &nReturnCount); + Lib3MFResult errorCode = wrapperTable->m_Texture2D_SetFilter(instanceHandle, (eLib3MFTextureFilter) eFilter); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6010,58 +10069,59 @@ void CLib3MFComponentsObject::GetComponentCount(const FunctionCallbackInfo tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFBeamSet")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFBuildItem")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "SetName", SetName); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetName", GetName); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetIdentifier", SetIdentifier); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetIdentifier", GetIdentifier); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetReferenceCount", GetReferenceCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetReferences", SetReferences); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetReferences", GetReferences); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetBallReferenceCount", GetBallReferenceCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetBallReferences", SetBallReferences); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetBallReferences", GetBallReferences); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetObjectResource", GetObjectResource); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetUUID", GetUUID); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetUUID", SetUUID); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetObjectResourceID", GetObjectResourceID); + NODE_SET_PROTOTYPE_METHOD(tpl, "HasObjectTransform", HasObjectTransform); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetObjectTransform", GetObjectTransform); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetObjectTransform", SetObjectTransform); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetPartNumber", GetPartNumber); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetPartNumber", SetPartNumber); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetMetaDataGroup", GetMetaDataGroup); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutbox", GetOutbox); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFBeamSet::New(const FunctionCallbackInfo& args) +void CLib3MFBuildItem::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFBeamSet * beamsetInstance = new CLib3MFBeamSet(); - beamsetInstance->Wrap(args.This()); + CLib3MFBuildItem * builditemInstance = new CLib3MFBuildItem(); + builditemInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFBeamSet: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFBuildItem: Invalid call to Constructor"); } } -Local CLib3MFBeamSet::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFBuildItem::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -6075,24 +10135,22 @@ Local CLib3MFBeamSet::NewInstance(Local pParent, Lib3MFHandle pH } -void CLib3MFBeamSet::SetName(const FunctionCallbackInfo& args) +void CLib3MFBuildItem::GetObjectResource(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsString()) { - throw std::runtime_error("Expected string parameter 0 (Name)"); - } - v8::String::Utf8Value sutf8Name(isolate, args[0]); - std::string sName = *sutf8Name; + Lib3MFHandle hReturnObjectResource = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetName."); - if (wrapperTable->m_BeamSet_SetName == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamSet::SetName."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetObjectResource."); + if (wrapperTable->m_BuildItem_GetObjectResource == nullptr) + throw std::runtime_error("Could not call Lib3MF method BuildItem::GetObjectResource."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamSet_SetName(instanceHandle, sName.c_str()); + Lib3MFResult errorCode = wrapperTable->m_BuildItem_GetObjectResource(instanceHandle, &hReturnObjectResource); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjObjectResource = CLib3MFObject::NewInstance(args.Holder(), hReturnObjectResource); + args.GetReturnValue().Set(instanceObjObjectResource); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6100,26 +10158,30 @@ void CLib3MFBeamSet::SetName(const FunctionCallbackInfo& args) } -void CLib3MFBeamSet::GetName(const FunctionCallbackInfo& args) +void CLib3MFBuildItem::GetUUID(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int bytesNeededName = 0; - unsigned int bytesWrittenName = 0; + Local outObject = Object::New(isolate); + bool bReturnHasUUID = false; + unsigned int bytesNeededUUID = 0; + unsigned int bytesWrittenUUID = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetName."); - if (wrapperTable->m_BeamSet_GetName == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamSet::GetName."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetUUID."); + if (wrapperTable->m_BuildItem_GetUUID == nullptr) + throw std::runtime_error("Could not call Lib3MF method BuildItem::GetUUID."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult initErrorCode = wrapperTable->m_BeamSet_GetName(instanceHandle, 0, &bytesNeededName, nullptr); + Lib3MFResult initErrorCode = wrapperTable->m_BuildItem_GetUUID(instanceHandle, &bReturnHasUUID, 0, &bytesNeededUUID, nullptr); CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); - std::vector bufferName; - bufferName.resize(bytesNeededName); - Lib3MFResult errorCode = wrapperTable->m_BeamSet_GetName(instanceHandle, bytesNeededName, &bytesWrittenName, &bufferName[0]); + std::vector bufferUUID; + bufferUUID.resize(bytesNeededUUID); + Lib3MFResult errorCode = wrapperTable->m_BuildItem_GetUUID(instanceHandle, &bReturnHasUUID, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0]); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferName[0])); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "HasUUID"), Boolean::New(isolate, bReturnHasUUID)); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "UUID"), String::NewFromUtf8(isolate, &bufferUUID[0])); + args.GetReturnValue().Set(outObject); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6127,23 +10189,23 @@ void CLib3MFBeamSet::GetName(const FunctionCallbackInfo& args) } -void CLib3MFBeamSet::SetIdentifier(const FunctionCallbackInfo& args) +void CLib3MFBuildItem::SetUUID(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { if (!args[0]->IsString()) { - throw std::runtime_error("Expected string parameter 0 (Identifier)"); + throw std::runtime_error("Expected string parameter 0 (UUID)"); } - v8::String::Utf8Value sutf8Identifier(isolate, args[0]); - std::string sIdentifier = *sutf8Identifier; + v8::String::Utf8Value sutf8UUID(isolate, args[0]); + std::string sUUID = *sutf8UUID; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetIdentifier."); - if (wrapperTable->m_BeamSet_SetIdentifier == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamSet::SetIdentifier."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetUUID."); + if (wrapperTable->m_BuildItem_SetUUID == nullptr) + throw std::runtime_error("Could not call Lib3MF method BuildItem::SetUUID."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamSet_SetIdentifier(instanceHandle, sIdentifier.c_str()); + Lib3MFResult errorCode = wrapperTable->m_BuildItem_SetUUID(instanceHandle, sUUID.c_str()); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -6152,26 +10214,21 @@ void CLib3MFBeamSet::SetIdentifier(const FunctionCallbackInfo& args) } -void CLib3MFBeamSet::GetIdentifier(const FunctionCallbackInfo& args) +void CLib3MFBuildItem::GetObjectResourceID(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int bytesNeededIdentifier = 0; - unsigned int bytesWrittenIdentifier = 0; + unsigned int nReturnUniqueResourceID = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetIdentifier."); - if (wrapperTable->m_BeamSet_GetIdentifier == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamSet::GetIdentifier."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetObjectResourceID."); + if (wrapperTable->m_BuildItem_GetObjectResourceID == nullptr) + throw std::runtime_error("Could not call Lib3MF method BuildItem::GetObjectResourceID."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult initErrorCode = wrapperTable->m_BeamSet_GetIdentifier(instanceHandle, 0, &bytesNeededIdentifier, nullptr); - CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); - std::vector bufferIdentifier; - bufferIdentifier.resize(bytesNeededIdentifier); - Lib3MFResult errorCode = wrapperTable->m_BeamSet_GetIdentifier(instanceHandle, bytesNeededIdentifier, &bytesWrittenIdentifier, &bufferIdentifier[0]); + Lib3MFResult errorCode = wrapperTable->m_BuildItem_GetObjectResourceID(instanceHandle, &nReturnUniqueResourceID); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferIdentifier[0])); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnUniqueResourceID)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6179,21 +10236,21 @@ void CLib3MFBeamSet::GetIdentifier(const FunctionCallbackInfo& args) } -void CLib3MFBeamSet::GetReferenceCount(const FunctionCallbackInfo& args) +void CLib3MFBuildItem::HasObjectTransform(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int nReturnCount = 0; + bool bReturnHasTransform = false; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetReferenceCount."); - if (wrapperTable->m_BeamSet_GetReferenceCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamSet::GetReferenceCount."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method HasObjectTransform."); + if (wrapperTable->m_BuildItem_HasObjectTransform == nullptr) + throw std::runtime_error("Could not call Lib3MF method BuildItem::HasObjectTransform."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamSet_GetReferenceCount(instanceHandle, &nReturnCount); + Lib3MFResult errorCode = wrapperTable->m_BuildItem_HasObjectTransform(instanceHandle, &bReturnHasTransform); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnHasTransform)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6201,18 +10258,44 @@ void CLib3MFBeamSet::GetReferenceCount(const FunctionCallbackInfo& args) } -void CLib3MFBeamSet::SetReferences(const FunctionCallbackInfo& args) +void CLib3MFBuildItem::GetObjectTransform(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + sLib3MFTransform sReturnTransform; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetReferences."); - if (wrapperTable->m_BeamSet_SetReferences == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamSet::SetReferences."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetObjectTransform."); + if (wrapperTable->m_BuildItem_GetObjectTransform == nullptr) + throw std::runtime_error("Could not call Lib3MF method BuildItem::GetObjectTransform."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamSet_SetReferences(instanceHandle, 0, nullptr); + Lib3MFResult errorCode = wrapperTable->m_BuildItem_GetObjectTransform(instanceHandle, &sReturnTransform); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(convertLib3MFTransformToObject(isolate, sReturnTransform)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFBuildItem::SetObjectTransform(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected struct parameter 0 (Transform)"); + } + sLib3MFTransform sTransform = convertObjectToLib3MFTransform(isolate, args[0]); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetObjectTransform."); + if (wrapperTable->m_BuildItem_SetObjectTransform == nullptr) + throw std::runtime_error("Could not call Lib3MF method BuildItem::SetObjectTransform."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_BuildItem_SetObjectTransform(instanceHandle, &sTransform); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -6221,19 +10304,26 @@ void CLib3MFBeamSet::SetReferences(const FunctionCallbackInfo& args) } -void CLib3MFBeamSet::GetReferences(const FunctionCallbackInfo& args) +void CLib3MFBuildItem::GetPartNumber(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + unsigned int bytesNeededPartNumber = 0; + unsigned int bytesWrittenPartNumber = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetReferences."); - if (wrapperTable->m_BeamSet_GetReferences == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamSet::GetReferences."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetPartNumber."); + if (wrapperTable->m_BuildItem_GetPartNumber == nullptr) + throw std::runtime_error("Could not call Lib3MF method BuildItem::GetPartNumber."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamSet_GetReferences(instanceHandle, 0, nullptr, nullptr); + Lib3MFResult initErrorCode = wrapperTable->m_BuildItem_GetPartNumber(instanceHandle, 0, &bytesNeededPartNumber, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferPartNumber; + bufferPartNumber.resize(bytesNeededPartNumber); + Lib3MFResult errorCode = wrapperTable->m_BuildItem_GetPartNumber(instanceHandle, bytesNeededPartNumber, &bytesWrittenPartNumber, &bufferPartNumber[0]); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferPartNumber[0])); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6241,21 +10331,24 @@ void CLib3MFBeamSet::GetReferences(const FunctionCallbackInfo& args) } -void CLib3MFBeamSet::GetBallReferenceCount(const FunctionCallbackInfo& args) +void CLib3MFBuildItem::SetPartNumber(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int nReturnCount = 0; + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (SetPartnumber)"); + } + v8::String::Utf8Value sutf8SetPartnumber(isolate, args[0]); + std::string sSetPartnumber = *sutf8SetPartnumber; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBallReferenceCount."); - if (wrapperTable->m_BeamSet_GetBallReferenceCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamSet::GetBallReferenceCount."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetPartNumber."); + if (wrapperTable->m_BuildItem_SetPartNumber == nullptr) + throw std::runtime_error("Could not call Lib3MF method BuildItem::SetPartNumber."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamSet_GetBallReferenceCount(instanceHandle, &nReturnCount); + Lib3MFResult errorCode = wrapperTable->m_BuildItem_SetPartNumber(instanceHandle, sSetPartnumber.c_str()); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6263,19 +10356,22 @@ void CLib3MFBeamSet::GetBallReferenceCount(const FunctionCallbackInfo& ar } -void CLib3MFBeamSet::SetBallReferences(const FunctionCallbackInfo& args) +void CLib3MFBuildItem::GetMetaDataGroup(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + Lib3MFHandle hReturnMetaDataGroup = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetBallReferences."); - if (wrapperTable->m_BeamSet_SetBallReferences == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamSet::SetBallReferences."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMetaDataGroup."); + if (wrapperTable->m_BuildItem_GetMetaDataGroup == nullptr) + throw std::runtime_error("Could not call Lib3MF method BuildItem::GetMetaDataGroup."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamSet_SetBallReferences(instanceHandle, 0, nullptr); + Lib3MFResult errorCode = wrapperTable->m_BuildItem_GetMetaDataGroup(instanceHandle, &hReturnMetaDataGroup); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjMetaDataGroup = CLib3MFMetaDataGroup::NewInstance(args.Holder(), hReturnMetaDataGroup); + args.GetReturnValue().Set(instanceObjMetaDataGroup); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6283,19 +10379,21 @@ void CLib3MFBeamSet::SetBallReferences(const FunctionCallbackInfo& args) } -void CLib3MFBeamSet::GetBallReferences(const FunctionCallbackInfo& args) +void CLib3MFBuildItem::GetOutbox(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + sLib3MFBox sReturnOutbox; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBallReferences."); - if (wrapperTable->m_BeamSet_GetBallReferences == nullptr) - throw std::runtime_error("Could not call Lib3MF method BeamSet::GetBallReferences."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutbox."); + if (wrapperTable->m_BuildItem_GetOutbox == nullptr) + throw std::runtime_error("Could not call Lib3MF method BuildItem::GetOutbox."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BeamSet_GetBallReferences(instanceHandle, 0, nullptr, nullptr); + Lib3MFResult errorCode = wrapperTable->m_BuildItem_GetOutbox(instanceHandle, &sReturnOutbox); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(convertLib3MFBoxToObject(isolate, sReturnOutbox)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6303,56 +10401,53 @@ void CLib3MFBeamSet::GetBallReferences(const FunctionCallbackInfo& args) } /************************************************************************************************************************* - Class CLib3MFBaseMaterialGroup Implementation + Class CLib3MFBuildItemIterator Implementation **************************************************************************************************************************/ -CLib3MFBaseMaterialGroup::CLib3MFBaseMaterialGroup() +CLib3MFBuildItemIterator::CLib3MFBuildItemIterator() : CLib3MFBaseClass() { } -CLib3MFBaseMaterialGroup::~CLib3MFBaseMaterialGroup() +CLib3MFBuildItemIterator::~CLib3MFBuildItemIterator() { } -void CLib3MFBaseMaterialGroup::Init() +void CLib3MFBuildItemIterator::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFBaseMaterialGroup")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFBuildItemIterator")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetCount", GetCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetAllPropertyIDs", GetAllPropertyIDs); - NODE_SET_PROTOTYPE_METHOD(tpl, "AddMaterial", AddMaterial); - NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveMaterial", RemoveMaterial); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetName", GetName); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetName", SetName); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetDisplayColor", SetDisplayColor); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetDisplayColor", GetDisplayColor); + NODE_SET_PROTOTYPE_METHOD(tpl, "MoveNext", MoveNext); + NODE_SET_PROTOTYPE_METHOD(tpl, "MovePrevious", MovePrevious); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCurrent", GetCurrent); + NODE_SET_PROTOTYPE_METHOD(tpl, "Clone", Clone); + NODE_SET_PROTOTYPE_METHOD(tpl, "Count", Count); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFBaseMaterialGroup::New(const FunctionCallbackInfo& args) +void CLib3MFBuildItemIterator::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFBaseMaterialGroup * basematerialgroupInstance = new CLib3MFBaseMaterialGroup(); - basematerialgroupInstance->Wrap(args.This()); + CLib3MFBuildItemIterator * builditemiteratorInstance = new CLib3MFBuildItemIterator(); + builditemiteratorInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFBaseMaterialGroup: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFBuildItemIterator: Invalid call to Constructor"); } } -Local CLib3MFBaseMaterialGroup::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFBuildItemIterator::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -6366,96 +10461,21 @@ Local CLib3MFBaseMaterialGroup::NewInstance(Local pParent, Lib3M } -void CLib3MFBaseMaterialGroup::GetCount(const FunctionCallbackInfo& args) -{ - Isolate* isolate = args.GetIsolate(); - HandleScope scope(isolate); - try { - unsigned int nReturnCount = 0; - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCount."); - if (wrapperTable->m_BaseMaterialGroup_GetCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::GetCount."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_GetCount(instanceHandle, &nReturnCount); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); - - } catch (std::exception & E) { - RaiseError(isolate, E.what()); - } -} - - -void CLib3MFBaseMaterialGroup::GetAllPropertyIDs(const FunctionCallbackInfo& args) -{ - Isolate* isolate = args.GetIsolate(); - HandleScope scope(isolate); - try { - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetAllPropertyIDs."); - if (wrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs == nullptr) - throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::GetAllPropertyIDs."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_GetAllPropertyIDs(instanceHandle, 0, nullptr, nullptr); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - - } catch (std::exception & E) { - RaiseError(isolate, E.what()); - } -} - - -void CLib3MFBaseMaterialGroup::AddMaterial(const FunctionCallbackInfo& args) -{ - Isolate* isolate = args.GetIsolate(); - HandleScope scope(isolate); - try { - if (!args[0]->IsString()) { - throw std::runtime_error("Expected string parameter 0 (Name)"); - } - if (!args[1]->IsObject()) { - throw std::runtime_error("Expected struct parameter 1 (DisplayColor)"); - } - v8::String::Utf8Value sutf8Name(isolate, args[0]); - std::string sName = *sutf8Name; - sLib3MFColor sDisplayColor = convertObjectToLib3MFColor(isolate, args[1]); - unsigned int nReturnPropertyID = 0; - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method AddMaterial."); - if (wrapperTable->m_BaseMaterialGroup_AddMaterial == nullptr) - throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::AddMaterial."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_AddMaterial(instanceHandle, sName.c_str(), &sDisplayColor, &nReturnPropertyID); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnPropertyID)); - - } catch (std::exception & E) { - RaiseError(isolate, E.what()); - } -} - - -void CLib3MFBaseMaterialGroup::RemoveMaterial(const FunctionCallbackInfo& args) +void CLib3MFBuildItemIterator::MoveNext(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); - } - unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + bool bReturnHasNext = false; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveMaterial."); - if (wrapperTable->m_BaseMaterialGroup_RemoveMaterial == nullptr) - throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::RemoveMaterial."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method MoveNext."); + if (wrapperTable->m_BuildItemIterator_MoveNext == nullptr) + throw std::runtime_error("Could not call Lib3MF method BuildItemIterator::MoveNext."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_RemoveMaterial(instanceHandle, nPropertyID); + Lib3MFResult errorCode = wrapperTable->m_BuildItemIterator_MoveNext(instanceHandle, &bReturnHasNext); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnHasNext)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6463,30 +10483,21 @@ void CLib3MFBaseMaterialGroup::RemoveMaterial(const FunctionCallbackInfo& } -void CLib3MFBaseMaterialGroup::GetName(const FunctionCallbackInfo& args) +void CLib3MFBuildItemIterator::MovePrevious(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); - } - unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - unsigned int bytesNeededName = 0; - unsigned int bytesWrittenName = 0; + bool bReturnHasPrevious = false; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetName."); - if (wrapperTable->m_BaseMaterialGroup_GetName == nullptr) - throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::GetName."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method MovePrevious."); + if (wrapperTable->m_BuildItemIterator_MovePrevious == nullptr) + throw std::runtime_error("Could not call Lib3MF method BuildItemIterator::MovePrevious."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult initErrorCode = wrapperTable->m_BaseMaterialGroup_GetName(instanceHandle, nPropertyID, 0, &bytesNeededName, nullptr); - CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); - std::vector bufferName; - bufferName.resize(bytesNeededName); - Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_GetName(instanceHandle, nPropertyID, bytesNeededName, &bytesWrittenName, &bufferName[0]); + Lib3MFResult errorCode = wrapperTable->m_BuildItemIterator_MovePrevious(instanceHandle, &bReturnHasPrevious); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferName[0])); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnHasPrevious)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6494,28 +10505,22 @@ void CLib3MFBaseMaterialGroup::GetName(const FunctionCallbackInfo& args) } -void CLib3MFBaseMaterialGroup::SetName(const FunctionCallbackInfo& args) +void CLib3MFBuildItemIterator::GetCurrent(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); - } - if (!args[1]->IsString()) { - throw std::runtime_error("Expected string parameter 1 (Name)"); - } - unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - v8::String::Utf8Value sutf8Name(isolate, args[1]); - std::string sName = *sutf8Name; + Lib3MFHandle hReturnBuildItem = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetName."); - if (wrapperTable->m_BaseMaterialGroup_SetName == nullptr) - throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::SetName."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCurrent."); + if (wrapperTable->m_BuildItemIterator_GetCurrent == nullptr) + throw std::runtime_error("Could not call Lib3MF method BuildItemIterator::GetCurrent."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_SetName(instanceHandle, nPropertyID, sName.c_str()); + Lib3MFResult errorCode = wrapperTable->m_BuildItemIterator_GetCurrent(instanceHandle, &hReturnBuildItem); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjBuildItem = CLib3MFBuildItem::NewInstance(args.Holder(), hReturnBuildItem); + args.GetReturnValue().Set(instanceObjBuildItem); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6523,27 +10528,22 @@ void CLib3MFBaseMaterialGroup::SetName(const FunctionCallbackInfo& args) } -void CLib3MFBaseMaterialGroup::SetDisplayColor(const FunctionCallbackInfo& args) +void CLib3MFBuildItemIterator::Clone(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); - } - if (!args[1]->IsObject()) { - throw std::runtime_error("Expected struct parameter 1 (TheColor)"); - } - unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - sLib3MFColor sTheColor = convertObjectToLib3MFColor(isolate, args[1]); + Lib3MFHandle hReturnOutBuildItemIterator = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetDisplayColor."); - if (wrapperTable->m_BaseMaterialGroup_SetDisplayColor == nullptr) - throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::SetDisplayColor."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method Clone."); + if (wrapperTable->m_BuildItemIterator_Clone == nullptr) + throw std::runtime_error("Could not call Lib3MF method BuildItemIterator::Clone."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_SetDisplayColor(instanceHandle, nPropertyID, &sTheColor); + Lib3MFResult errorCode = wrapperTable->m_BuildItemIterator_Clone(instanceHandle, &hReturnOutBuildItemIterator); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjOutBuildItemIterator = CLib3MFBuildItemIterator::NewInstance(args.Holder(), hReturnOutBuildItemIterator); + args.GetReturnValue().Set(instanceObjOutBuildItemIterator); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6551,25 +10551,21 @@ void CLib3MFBaseMaterialGroup::SetDisplayColor(const FunctionCallbackInfo } -void CLib3MFBaseMaterialGroup::GetDisplayColor(const FunctionCallbackInfo& args) +void CLib3MFBuildItemIterator::Count(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); - } - unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - sLib3MFColor sReturnTheColor; + uint64_t nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetDisplayColor."); - if (wrapperTable->m_BaseMaterialGroup_GetDisplayColor == nullptr) - throw std::runtime_error("Could not call Lib3MF method BaseMaterialGroup::GetDisplayColor."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method Count."); + if (wrapperTable->m_BuildItemIterator_Count == nullptr) + throw std::runtime_error("Could not call Lib3MF method BuildItemIterator::Count."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BaseMaterialGroup_GetDisplayColor(instanceHandle, nPropertyID, &sReturnTheColor); + Lib3MFResult errorCode = wrapperTable->m_BuildItemIterator_Count(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(convertLib3MFColorToObject(isolate, sReturnTheColor)); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, std::to_string(nReturnCount).c_str())); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6577,54 +10573,57 @@ void CLib3MFBaseMaterialGroup::GetDisplayColor(const FunctionCallbackInfo } /************************************************************************************************************************* - Class CLib3MFColorGroup Implementation + Class CLib3MFSlice Implementation **************************************************************************************************************************/ -CLib3MFColorGroup::CLib3MFColorGroup() +CLib3MFSlice::CLib3MFSlice() : CLib3MFBaseClass() { } -CLib3MFColorGroup::~CLib3MFColorGroup() +CLib3MFSlice::~CLib3MFSlice() { } -void CLib3MFColorGroup::Init() +void CLib3MFSlice::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFColorGroup")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFSlice")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetCount", GetCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetAllPropertyIDs", GetAllPropertyIDs); - NODE_SET_PROTOTYPE_METHOD(tpl, "AddColor", AddColor); - NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveColor", RemoveColor); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetColor", SetColor); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetColor", GetColor); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetVertices", SetVertices); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetVertices", GetVertices); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetVertexCount", GetVertexCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddPolygon", AddPolygon); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetPolygonCount", GetPolygonCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetPolygonIndices", SetPolygonIndices); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetPolygonIndices", GetPolygonIndices); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetPolygonIndexCount", GetPolygonIndexCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetZTop", GetZTop); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFColorGroup::New(const FunctionCallbackInfo& args) +void CLib3MFSlice::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFColorGroup * colorgroupInstance = new CLib3MFColorGroup(); - colorgroupInstance->Wrap(args.This()); + CLib3MFSlice * sliceInstance = new CLib3MFSlice(); + sliceInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFColorGroup: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFSlice: Invalid call to Constructor"); } } -Local CLib3MFColorGroup::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFSlice::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -6638,21 +10637,19 @@ Local CLib3MFColorGroup::NewInstance(Local pParent, Lib3MFHandle } -void CLib3MFColorGroup::GetCount(const FunctionCallbackInfo& args) +void CLib3MFSlice::SetVertices(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCount."); - if (wrapperTable->m_ColorGroup_GetCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method ColorGroup::GetCount."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetVertices."); + if (wrapperTable->m_Slice_SetVertices == nullptr) + throw std::runtime_error("Could not call Lib3MF method Slice::SetVertices."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ColorGroup_GetCount(instanceHandle, &nReturnCount); + Lib3MFResult errorCode = wrapperTable->m_Slice_SetVertices(instanceHandle, 0, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6660,18 +10657,18 @@ void CLib3MFColorGroup::GetCount(const FunctionCallbackInfo& args) } -void CLib3MFColorGroup::GetAllPropertyIDs(const FunctionCallbackInfo& args) +void CLib3MFSlice::GetVertices(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetAllPropertyIDs."); - if (wrapperTable->m_ColorGroup_GetAllPropertyIDs == nullptr) - throw std::runtime_error("Could not call Lib3MF method ColorGroup::GetAllPropertyIDs."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetVertices."); + if (wrapperTable->m_Slice_GetVertices == nullptr) + throw std::runtime_error("Could not call Lib3MF method Slice::GetVertices."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ColorGroup_GetAllPropertyIDs(instanceHandle, 0, nullptr, nullptr); + Lib3MFResult errorCode = wrapperTable->m_Slice_GetVertices(instanceHandle, 0, nullptr, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -6680,25 +10677,21 @@ void CLib3MFColorGroup::GetAllPropertyIDs(const FunctionCallbackInfo& arg } -void CLib3MFColorGroup::AddColor(const FunctionCallbackInfo& args) +void CLib3MFSlice::GetVertexCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsObject()) { - throw std::runtime_error("Expected struct parameter 0 (TheColor)"); - } - sLib3MFColor sTheColor = convertObjectToLib3MFColor(isolate, args[0]); - unsigned int nReturnPropertyID = 0; + uint64_t nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method AddColor."); - if (wrapperTable->m_ColorGroup_AddColor == nullptr) - throw std::runtime_error("Could not call Lib3MF method ColorGroup::AddColor."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetVertexCount."); + if (wrapperTable->m_Slice_GetVertexCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method Slice::GetVertexCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ColorGroup_AddColor(instanceHandle, &sTheColor, &nReturnPropertyID); + Lib3MFResult errorCode = wrapperTable->m_Slice_GetVertexCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnPropertyID)); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, std::to_string(nReturnCount).c_str())); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6706,23 +10699,21 @@ void CLib3MFColorGroup::AddColor(const FunctionCallbackInfo& args) } -void CLib3MFColorGroup::RemoveColor(const FunctionCallbackInfo& args) +void CLib3MFSlice::AddPolygon(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); - } - unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + uint64_t nReturnIndex = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveColor."); - if (wrapperTable->m_ColorGroup_RemoveColor == nullptr) - throw std::runtime_error("Could not call Lib3MF method ColorGroup::RemoveColor."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddPolygon."); + if (wrapperTable->m_Slice_AddPolygon == nullptr) + throw std::runtime_error("Could not call Lib3MF method Slice::AddPolygon."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ColorGroup_RemoveColor(instanceHandle, nPropertyID); + Lib3MFResult errorCode = wrapperTable->m_Slice_AddPolygon(instanceHandle, 0, nullptr, &nReturnIndex); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, std::to_string(nReturnIndex).c_str())); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6730,26 +10721,72 @@ void CLib3MFColorGroup::RemoveColor(const FunctionCallbackInfo& args) } -void CLib3MFColorGroup::SetColor(const FunctionCallbackInfo& args) +void CLib3MFSlice::GetPolygonCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); + uint64_t nReturnCount = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetPolygonCount."); + if (wrapperTable->m_Slice_GetPolygonCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method Slice::GetPolygonCount."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Slice_GetPolygonCount(instanceHandle, &nReturnCount); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, std::to_string(nReturnCount).c_str())); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFSlice::SetPolygonIndices(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected uint64 parameter 0 (Index)"); } - if (!args[1]->IsObject()) { - throw std::runtime_error("Expected struct parameter 1 (TheColor)"); + v8::String::Utf8Value sutf8Index(isolate, args[0]); + std::string sIndex = *sutf8Index; + uint64_t nIndex = stoull(sIndex); + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetPolygonIndices."); + if (wrapperTable->m_Slice_SetPolygonIndices == nullptr) + throw std::runtime_error("Could not call Lib3MF method Slice::SetPolygonIndices."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Slice_SetPolygonIndices(instanceHandle, nIndex, 0, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFSlice::GetPolygonIndices(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected uint64 parameter 0 (Index)"); } - unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - sLib3MFColor sTheColor = convertObjectToLib3MFColor(isolate, args[1]); + v8::String::Utf8Value sutf8Index(isolate, args[0]); + std::string sIndex = *sutf8Index; + uint64_t nIndex = stoull(sIndex); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetColor."); - if (wrapperTable->m_ColorGroup_SetColor == nullptr) - throw std::runtime_error("Could not call Lib3MF method ColorGroup::SetColor."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetPolygonIndices."); + if (wrapperTable->m_Slice_GetPolygonIndices == nullptr) + throw std::runtime_error("Could not call Lib3MF method Slice::GetPolygonIndices."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ColorGroup_SetColor(instanceHandle, nPropertyID, &sTheColor); + Lib3MFResult errorCode = wrapperTable->m_Slice_GetPolygonIndices(instanceHandle, nIndex, 0, nullptr, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -6758,25 +10795,49 @@ void CLib3MFColorGroup::SetColor(const FunctionCallbackInfo& args) } -void CLib3MFColorGroup::GetColor(const FunctionCallbackInfo& args) +void CLib3MFSlice::GetPolygonIndexCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); + if (!args[0]->IsString()) { + throw std::runtime_error("Expected uint64 parameter 0 (Index)"); } - unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - sLib3MFColor sReturnTheColor; + v8::String::Utf8Value sutf8Index(isolate, args[0]); + std::string sIndex = *sutf8Index; + uint64_t nIndex = stoull(sIndex); + uint64_t nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetColor."); - if (wrapperTable->m_ColorGroup_GetColor == nullptr) - throw std::runtime_error("Could not call Lib3MF method ColorGroup::GetColor."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetPolygonIndexCount."); + if (wrapperTable->m_Slice_GetPolygonIndexCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method Slice::GetPolygonIndexCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_ColorGroup_GetColor(instanceHandle, nPropertyID, &sReturnTheColor); + Lib3MFResult errorCode = wrapperTable->m_Slice_GetPolygonIndexCount(instanceHandle, nIndex, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(convertLib3MFColorToObject(isolate, sReturnTheColor)); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, std::to_string(nReturnCount).c_str())); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFSlice::GetZTop(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + double dReturnZTop = 0.0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetZTop."); + if (wrapperTable->m_Slice_GetZTop == nullptr) + throw std::runtime_error("Could not call Lib3MF method Slice::GetZTop."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Slice_GetZTop(instanceHandle, &dReturnZTop); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Number::New(isolate, dReturnZTop)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6784,68 +10845,135 @@ void CLib3MFColorGroup::GetColor(const FunctionCallbackInfo& args) } /************************************************************************************************************************* - Class CLib3MFTexture2DGroup Implementation + Class CLib3MFToolpathProfile Implementation **************************************************************************************************************************/ -CLib3MFTexture2DGroup::CLib3MFTexture2DGroup() +CLib3MFToolpathProfile::CLib3MFToolpathProfile() : CLib3MFBaseClass() { } -CLib3MFTexture2DGroup::~CLib3MFTexture2DGroup() +CLib3MFToolpathProfile::~CLib3MFToolpathProfile() { } -void CLib3MFTexture2DGroup::Init() +void CLib3MFToolpathProfile::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFTexture2DGroup")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFToolpathProfile")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetCount", GetCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetAllPropertyIDs", GetAllPropertyIDs); - NODE_SET_PROTOTYPE_METHOD(tpl, "AddTex2Coord", AddTex2Coord); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetTex2Coord", GetTex2Coord); - NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveTex2Coord", RemoveTex2Coord); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetTexture2D", GetTexture2D); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetUUID", GetUUID); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetName", GetName); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetParameterCount", GetParameterCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetParameterName", GetParameterName); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetParameterNameSpace", GetParameterNameSpace); + NODE_SET_PROTOTYPE_METHOD(tpl, "HasParameterValue", HasParameterValue); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetParameterValue", GetParameterValue); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetParameterValueDef", GetParameterValueDef); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetParameterDoubleValue", GetParameterDoubleValue); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetParameterDoubleValueDef", GetParameterDoubleValueDef); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetParameterIntegerValue", GetParameterIntegerValue); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetParameterIntegerValueDef", GetParameterIntegerValueDef); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetParameterBoolValue", GetParameterBoolValue); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetParameterBoolValueDef", GetParameterBoolValueDef); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetName", SetName); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetParameterValue", SetParameterValue); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetParameterDoubleValue", SetParameterDoubleValue); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetParameterIntegerValue", SetParameterIntegerValue); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetParameterBoolValue", SetParameterBoolValue); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFTexture2DGroup::New(const FunctionCallbackInfo& args) +void CLib3MFToolpathProfile::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFTexture2DGroup * texture2dgroupInstance = new CLib3MFTexture2DGroup(); - texture2dgroupInstance->Wrap(args.This()); + CLib3MFToolpathProfile * toolpathprofileInstance = new CLib3MFToolpathProfile(); + toolpathprofileInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFTexture2DGroup: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFToolpathProfile: Invalid call to Constructor"); + } +} + +Local CLib3MFToolpathProfile::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFToolpathProfile::GetUUID(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + unsigned int bytesNeededUUID = 0; + unsigned int bytesWrittenUUID = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetUUID."); + if (wrapperTable->m_ToolpathProfile_GetUUID == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathProfile::GetUUID."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult initErrorCode = wrapperTable->m_ToolpathProfile_GetUUID(instanceHandle, 0, &bytesNeededUUID, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferUUID; + bufferUUID.resize(bytesNeededUUID); + Lib3MFResult errorCode = wrapperTable->m_ToolpathProfile_GetUUID(instanceHandle, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0]); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferUUID[0])); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } } -Local CLib3MFTexture2DGroup::NewInstance(Local pParent, Lib3MFHandle pHandle) + +void CLib3MFToolpathProfile::GetName(const FunctionCallbackInfo& args) { - Isolate* isolate = Isolate::GetCurrent(); + Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); - Local cons = Local::New(isolate, constructor); - Local instance; - if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { - instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); - instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + try { + unsigned int bytesNeededName = 0; + unsigned int bytesWrittenName = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetName."); + if (wrapperTable->m_ToolpathProfile_GetName == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathProfile::GetName."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult initErrorCode = wrapperTable->m_ToolpathProfile_GetName(instanceHandle, 0, &bytesNeededName, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferName; + bufferName.resize(bytesNeededName); + Lib3MFResult errorCode = wrapperTable->m_ToolpathProfile_GetName(instanceHandle, bytesNeededName, &bytesWrittenName, &bufferName[0]); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferName[0])); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } - return instance; } -void CLib3MFTexture2DGroup::GetCount(const FunctionCallbackInfo& args) +void CLib3MFToolpathProfile::GetParameterCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); @@ -6853,11 +10981,11 @@ void CLib3MFTexture2DGroup::GetCount(const FunctionCallbackInfo& args) unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCount."); - if (wrapperTable->m_Texture2DGroup_GetCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method Texture2DGroup::GetCount."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetParameterCount."); + if (wrapperTable->m_ToolpathProfile_GetParameterCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathProfile::GetParameterCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Texture2DGroup_GetCount(instanceHandle, &nReturnCount); + Lib3MFResult errorCode = wrapperTable->m_ToolpathProfile_GetParameterCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); @@ -6867,19 +10995,30 @@ void CLib3MFTexture2DGroup::GetCount(const FunctionCallbackInfo& args) } -void CLib3MFTexture2DGroup::GetAllPropertyIDs(const FunctionCallbackInfo& args) +void CLib3MFToolpathProfile::GetParameterName(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int bytesNeededName = 0; + unsigned int bytesWrittenName = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetAllPropertyIDs."); - if (wrapperTable->m_Texture2DGroup_GetAllPropertyIDs == nullptr) - throw std::runtime_error("Could not call Lib3MF method Texture2DGroup::GetAllPropertyIDs."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetParameterName."); + if (wrapperTable->m_ToolpathProfile_GetParameterName == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathProfile::GetParameterName."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Texture2DGroup_GetAllPropertyIDs(instanceHandle, 0, nullptr, nullptr); + Lib3MFResult initErrorCode = wrapperTable->m_ToolpathProfile_GetParameterName(instanceHandle, nIndex, 0, &bytesNeededName, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferName; + bufferName.resize(bytesNeededName); + Lib3MFResult errorCode = wrapperTable->m_ToolpathProfile_GetParameterName(instanceHandle, nIndex, bytesNeededName, &bytesWrittenName, &bufferName[0]); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferName[0])); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6887,25 +11026,30 @@ void CLib3MFTexture2DGroup::GetAllPropertyIDs(const FunctionCallbackInfo& } -void CLib3MFTexture2DGroup::AddTex2Coord(const FunctionCallbackInfo& args) +void CLib3MFToolpathProfile::GetParameterNameSpace(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsObject()) { - throw std::runtime_error("Expected struct parameter 0 (UVCoordinate)"); + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); } - sLib3MFTex2Coord sUVCoordinate = convertObjectToLib3MFTex2Coord(isolate, args[0]); - unsigned int nReturnPropertyID = 0; + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int bytesNeededNameSpace = 0; + unsigned int bytesWrittenNameSpace = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method AddTex2Coord."); - if (wrapperTable->m_Texture2DGroup_AddTex2Coord == nullptr) - throw std::runtime_error("Could not call Lib3MF method Texture2DGroup::AddTex2Coord."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetParameterNameSpace."); + if (wrapperTable->m_ToolpathProfile_GetParameterNameSpace == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathProfile::GetParameterNameSpace."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Texture2DGroup_AddTex2Coord(instanceHandle, &sUVCoordinate, &nReturnPropertyID); + Lib3MFResult initErrorCode = wrapperTable->m_ToolpathProfile_GetParameterNameSpace(instanceHandle, nIndex, 0, &bytesNeededNameSpace, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferNameSpace; + bufferNameSpace.resize(bytesNeededNameSpace); + Lib3MFResult errorCode = wrapperTable->m_ToolpathProfile_GetParameterNameSpace(instanceHandle, nIndex, bytesNeededNameSpace, &bytesWrittenNameSpace, &bufferNameSpace[0]); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnPropertyID)); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferNameSpace[0])); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6913,25 +11057,31 @@ void CLib3MFTexture2DGroup::AddTex2Coord(const FunctionCallbackInfo& args } -void CLib3MFTexture2DGroup::GetTex2Coord(const FunctionCallbackInfo& args) +void CLib3MFToolpathProfile::HasParameterValue(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (NameSpaceName)"); } - unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - sLib3MFTex2Coord sReturnUVCoordinate; + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (ValueName)"); + } + v8::String::Utf8Value sutf8NameSpaceName(isolate, args[0]); + std::string sNameSpaceName = *sutf8NameSpaceName; + v8::String::Utf8Value sutf8ValueName(isolate, args[1]); + std::string sValueName = *sutf8ValueName; + bool bReturnValueExists = false; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetTex2Coord."); - if (wrapperTable->m_Texture2DGroup_GetTex2Coord == nullptr) - throw std::runtime_error("Could not call Lib3MF method Texture2DGroup::GetTex2Coord."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method HasParameterValue."); + if (wrapperTable->m_ToolpathProfile_HasParameterValue == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathProfile::HasParameterValue."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Texture2DGroup_GetTex2Coord(instanceHandle, nPropertyID, &sReturnUVCoordinate); + Lib3MFResult errorCode = wrapperTable->m_ToolpathProfile_HasParameterValue(instanceHandle, sNameSpaceName.c_str(), sValueName.c_str(), &bReturnValueExists); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(convertLib3MFTex2CoordToObject(isolate, sReturnUVCoordinate)); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnValueExists)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6939,23 +11089,36 @@ void CLib3MFTexture2DGroup::GetTex2Coord(const FunctionCallbackInfo& args } -void CLib3MFTexture2DGroup::RemoveTex2Coord(const FunctionCallbackInfo& args) +void CLib3MFToolpathProfile::GetParameterValue(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (NameSpaceName)"); } - unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (ValueName)"); + } + v8::String::Utf8Value sutf8NameSpaceName(isolate, args[0]); + std::string sNameSpaceName = *sutf8NameSpaceName; + v8::String::Utf8Value sutf8ValueName(isolate, args[1]); + std::string sValueName = *sutf8ValueName; + unsigned int bytesNeededValue = 0; + unsigned int bytesWrittenValue = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveTex2Coord."); - if (wrapperTable->m_Texture2DGroup_RemoveTex2Coord == nullptr) - throw std::runtime_error("Could not call Lib3MF method Texture2DGroup::RemoveTex2Coord."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetParameterValue."); + if (wrapperTable->m_ToolpathProfile_GetParameterValue == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathProfile::GetParameterValue."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Texture2DGroup_RemoveTex2Coord(instanceHandle, nPropertyID); + Lib3MFResult initErrorCode = wrapperTable->m_ToolpathProfile_GetParameterValue(instanceHandle, sNameSpaceName.c_str(), sValueName.c_str(), 0, &bytesNeededValue, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferValue; + bufferValue.resize(bytesNeededValue); + Lib3MFResult errorCode = wrapperTable->m_ToolpathProfile_GetParameterValue(instanceHandle, sNameSpaceName.c_str(), sValueName.c_str(), bytesNeededValue, &bytesWrittenValue, &bufferValue[0]); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferValue[0])); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -6963,105 +11126,247 @@ void CLib3MFTexture2DGroup::RemoveTex2Coord(const FunctionCallbackInfo& a } -void CLib3MFTexture2DGroup::GetTexture2D(const FunctionCallbackInfo& args) +void CLib3MFToolpathProfile::GetParameterValueDef(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnTexture2DInstance = nullptr; + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (NameSpaceName)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (ValueName)"); + } + if (!args[2]->IsString()) { + throw std::runtime_error("Expected string parameter 2 (DefaultValue)"); + } + v8::String::Utf8Value sutf8NameSpaceName(isolate, args[0]); + std::string sNameSpaceName = *sutf8NameSpaceName; + v8::String::Utf8Value sutf8ValueName(isolate, args[1]); + std::string sValueName = *sutf8ValueName; + v8::String::Utf8Value sutf8DefaultValue(isolate, args[2]); + std::string sDefaultValue = *sutf8DefaultValue; + unsigned int bytesNeededValue = 0; + unsigned int bytesWrittenValue = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetTexture2D."); - if (wrapperTable->m_Texture2DGroup_GetTexture2D == nullptr) - throw std::runtime_error("Could not call Lib3MF method Texture2DGroup::GetTexture2D."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetParameterValueDef."); + if (wrapperTable->m_ToolpathProfile_GetParameterValueDef == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathProfile::GetParameterValueDef."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Texture2DGroup_GetTexture2D(instanceHandle, &hReturnTexture2DInstance); + Lib3MFResult initErrorCode = wrapperTable->m_ToolpathProfile_GetParameterValueDef(instanceHandle, sNameSpaceName.c_str(), sValueName.c_str(), sDefaultValue.c_str(), 0, &bytesNeededValue, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferValue; + bufferValue.resize(bytesNeededValue); + Lib3MFResult errorCode = wrapperTable->m_ToolpathProfile_GetParameterValueDef(instanceHandle, sNameSpaceName.c_str(), sValueName.c_str(), sDefaultValue.c_str(), bytesNeededValue, &bytesWrittenValue, &bufferValue[0]); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjTexture2DInstance = CLib3MFTexture2D::NewInstance(args.Holder(), hReturnTexture2DInstance); - args.GetReturnValue().Set(instanceObjTexture2DInstance); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferValue[0])); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } -/************************************************************************************************************************* - Class CLib3MFCompositeMaterials Implementation -**************************************************************************************************************************/ -CLib3MFCompositeMaterials::CLib3MFCompositeMaterials() - : CLib3MFBaseClass() +void CLib3MFToolpathProfile::GetParameterDoubleValue(const FunctionCallbackInfo& args) { -} + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (NameSpaceName)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (ValueName)"); + } + v8::String::Utf8Value sutf8NameSpaceName(isolate, args[0]); + std::string sNameSpaceName = *sutf8NameSpaceName; + v8::String::Utf8Value sutf8ValueName(isolate, args[1]); + std::string sValueName = *sutf8ValueName; + double dReturnValue = 0.0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetParameterDoubleValue."); + if (wrapperTable->m_ToolpathProfile_GetParameterDoubleValue == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathProfile::GetParameterDoubleValue."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ToolpathProfile_GetParameterDoubleValue(instanceHandle, sNameSpaceName.c_str(), sValueName.c_str(), &dReturnValue); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Number::New(isolate, dReturnValue)); -CLib3MFCompositeMaterials::~CLib3MFCompositeMaterials() -{ + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } } -void CLib3MFCompositeMaterials::Init() + +void CLib3MFToolpathProfile::GetParameterDoubleValueDef(const FunctionCallbackInfo& args) { - Isolate* isolate = Isolate::GetCurrent(); + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (NameSpaceName)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (ValueName)"); + } + if (!args[2]->IsNumber()) { + throw std::runtime_error("Expected double parameter 2 (DefaultValue)"); + } + v8::String::Utf8Value sutf8NameSpaceName(isolate, args[0]); + std::string sNameSpaceName = *sutf8NameSpaceName; + v8::String::Utf8Value sutf8ValueName(isolate, args[1]); + std::string sValueName = *sutf8ValueName; + double dDefaultValue = (double) args[2]->NumberValue(isolate->GetCurrentContext()).ToChecked(); + double dReturnValue = 0.0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetParameterDoubleValueDef."); + if (wrapperTable->m_ToolpathProfile_GetParameterDoubleValueDef == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathProfile::GetParameterDoubleValueDef."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ToolpathProfile_GetParameterDoubleValueDef(instanceHandle, sNameSpaceName.c_str(), sValueName.c_str(), dDefaultValue, &dReturnValue); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Number::New(isolate, dReturnValue)); - // Prepare constructor template - Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFCompositeMaterials")); - tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} - // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetCount", GetCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetAllPropertyIDs", GetAllPropertyIDs); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetBaseMaterialGroup", GetBaseMaterialGroup); - NODE_SET_PROTOTYPE_METHOD(tpl, "AddComposite", AddComposite); - NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveComposite", RemoveComposite); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetComposite", GetComposite); - constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); +void CLib3MFToolpathProfile::GetParameterIntegerValue(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (NameSpaceName)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (ValueName)"); + } + v8::String::Utf8Value sutf8NameSpaceName(isolate, args[0]); + std::string sNameSpaceName = *sutf8NameSpaceName; + v8::String::Utf8Value sutf8ValueName(isolate, args[1]); + std::string sValueName = *sutf8ValueName; + int64_t nReturnValue = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetParameterIntegerValue."); + if (wrapperTable->m_ToolpathProfile_GetParameterIntegerValue == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathProfile::GetParameterIntegerValue."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ToolpathProfile_GetParameterIntegerValue(instanceHandle, sNameSpaceName.c_str(), sValueName.c_str(), &nReturnValue); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, std::to_string(nReturnValue).c_str() )); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } } -void CLib3MFCompositeMaterials::New(const FunctionCallbackInfo& args) + +void CLib3MFToolpathProfile::GetParameterIntegerValueDef(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (NameSpaceName)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (ValueName)"); + } + if (!args[2]->IsString()) { + throw std::runtime_error("Expected int64 parameter 2 (DefaultValue)"); + } + v8::String::Utf8Value sutf8NameSpaceName(isolate, args[0]); + std::string sNameSpaceName = *sutf8NameSpaceName; + v8::String::Utf8Value sutf8ValueName(isolate, args[1]); + std::string sValueName = *sutf8ValueName; + v8::String::Utf8Value sutf8DefaultValue(isolate, args[2]); + std::string sDefaultValue = *sutf8DefaultValue; + int64_t nDefaultValue = stoll(sDefaultValue); + int64_t nReturnValue = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetParameterIntegerValueDef."); + if (wrapperTable->m_ToolpathProfile_GetParameterIntegerValueDef == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathProfile::GetParameterIntegerValueDef."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ToolpathProfile_GetParameterIntegerValueDef(instanceHandle, sNameSpaceName.c_str(), sValueName.c_str(), nDefaultValue, &nReturnValue); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, std::to_string(nReturnValue).c_str() )); - if (args.IsConstructCall()) { - CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFCompositeMaterials * compositematerialsInstance = new CLib3MFCompositeMaterials(); - compositematerialsInstance->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - RaiseError(isolate, "Lib3MFCompositeMaterials: Invalid call to Constructor"); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } } -Local CLib3MFCompositeMaterials::NewInstance(Local pParent, Lib3MFHandle pHandle) + +void CLib3MFToolpathProfile::GetParameterBoolValue(const FunctionCallbackInfo& args) { - Isolate* isolate = Isolate::GetCurrent(); + Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); - Local cons = Local::New(isolate, constructor); - Local instance; - if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { - instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); - instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (NameSpaceName)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (ValueName)"); + } + v8::String::Utf8Value sutf8NameSpaceName(isolate, args[0]); + std::string sNameSpaceName = *sutf8NameSpaceName; + v8::String::Utf8Value sutf8ValueName(isolate, args[1]); + std::string sValueName = *sutf8ValueName; + bool bReturnValue = false; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetParameterBoolValue."); + if (wrapperTable->m_ToolpathProfile_GetParameterBoolValue == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathProfile::GetParameterBoolValue."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ToolpathProfile_GetParameterBoolValue(instanceHandle, sNameSpaceName.c_str(), sValueName.c_str(), &bReturnValue); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnValue)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } - return instance; } -void CLib3MFCompositeMaterials::GetCount(const FunctionCallbackInfo& args) +void CLib3MFToolpathProfile::GetParameterBoolValueDef(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int nReturnCount = 0; + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (NameSpaceName)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (ValueName)"); + } + if (!args[2]->IsBoolean()) { + throw std::runtime_error("Expected bool parameter 2 (DefaultValue)"); + } + v8::String::Utf8Value sutf8NameSpaceName(isolate, args[0]); + std::string sNameSpaceName = *sutf8NameSpaceName; + v8::String::Utf8Value sutf8ValueName(isolate, args[1]); + std::string sValueName = *sutf8ValueName; + bool bDefaultValue = args[2]->BooleanValue(isolate->GetCurrentContext()).ToChecked(); + bool bReturnValue = false; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCount."); - if (wrapperTable->m_CompositeMaterials_GetCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method CompositeMaterials::GetCount."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetParameterBoolValueDef."); + if (wrapperTable->m_ToolpathProfile_GetParameterBoolValueDef == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathProfile::GetParameterBoolValueDef."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_CompositeMaterials_GetCount(instanceHandle, &nReturnCount); + Lib3MFResult errorCode = wrapperTable->m_ToolpathProfile_GetParameterBoolValueDef(instanceHandle, sNameSpaceName.c_str(), sValueName.c_str(), bDefaultValue, &bReturnValue); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnValue)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7069,18 +11374,23 @@ void CLib3MFCompositeMaterials::GetCount(const FunctionCallbackInfo& args } -void CLib3MFCompositeMaterials::GetAllPropertyIDs(const FunctionCallbackInfo& args) +void CLib3MFToolpathProfile::SetName(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetAllPropertyIDs."); - if (wrapperTable->m_CompositeMaterials_GetAllPropertyIDs == nullptr) - throw std::runtime_error("Could not call Lib3MF method CompositeMaterials::GetAllPropertyIDs."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetName."); + if (wrapperTable->m_ToolpathProfile_SetName == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathProfile::SetName."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_CompositeMaterials_GetAllPropertyIDs(instanceHandle, 0, nullptr, nullptr); + Lib3MFResult errorCode = wrapperTable->m_ToolpathProfile_SetName(instanceHandle, sName.c_str()); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -7089,22 +11399,34 @@ void CLib3MFCompositeMaterials::GetAllPropertyIDs(const FunctionCallbackInfo& args) +void CLib3MFToolpathProfile::SetParameterValue(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnBaseMaterialGroupInstance = nullptr; + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (NameSpaceName)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (ValueName)"); + } + if (!args[2]->IsString()) { + throw std::runtime_error("Expected string parameter 2 (Value)"); + } + v8::String::Utf8Value sutf8NameSpaceName(isolate, args[0]); + std::string sNameSpaceName = *sutf8NameSpaceName; + v8::String::Utf8Value sutf8ValueName(isolate, args[1]); + std::string sValueName = *sutf8ValueName; + v8::String::Utf8Value sutf8Value(isolate, args[2]); + std::string sValue = *sutf8Value; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetBaseMaterialGroup."); - if (wrapperTable->m_CompositeMaterials_GetBaseMaterialGroup == nullptr) - throw std::runtime_error("Could not call Lib3MF method CompositeMaterials::GetBaseMaterialGroup."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetParameterValue."); + if (wrapperTable->m_ToolpathProfile_SetParameterValue == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathProfile::SetParameterValue."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_CompositeMaterials_GetBaseMaterialGroup(instanceHandle, &hReturnBaseMaterialGroupInstance); + Lib3MFResult errorCode = wrapperTable->m_ToolpathProfile_SetParameterValue(instanceHandle, sNameSpaceName.c_str(), sValueName.c_str(), sValue.c_str()); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjBaseMaterialGroupInstance = CLib3MFBaseMaterialGroup::NewInstance(args.Holder(), hReturnBaseMaterialGroupInstance); - args.GetReturnValue().Set(instanceObjBaseMaterialGroupInstance); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7112,21 +11434,33 @@ void CLib3MFCompositeMaterials::GetBaseMaterialGroup(const FunctionCallbackInfo< } -void CLib3MFCompositeMaterials::AddComposite(const FunctionCallbackInfo& args) +void CLib3MFToolpathProfile::SetParameterDoubleValue(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int nReturnPropertyID = 0; + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (NameSpaceName)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (ValueName)"); + } + if (!args[2]->IsNumber()) { + throw std::runtime_error("Expected double parameter 2 (Value)"); + } + v8::String::Utf8Value sutf8NameSpaceName(isolate, args[0]); + std::string sNameSpaceName = *sutf8NameSpaceName; + v8::String::Utf8Value sutf8ValueName(isolate, args[1]); + std::string sValueName = *sutf8ValueName; + double dValue = (double) args[2]->NumberValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method AddComposite."); - if (wrapperTable->m_CompositeMaterials_AddComposite == nullptr) - throw std::runtime_error("Could not call Lib3MF method CompositeMaterials::AddComposite."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetParameterDoubleValue."); + if (wrapperTable->m_ToolpathProfile_SetParameterDoubleValue == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathProfile::SetParameterDoubleValue."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_CompositeMaterials_AddComposite(instanceHandle, 0, nullptr, &nReturnPropertyID); + Lib3MFResult errorCode = wrapperTable->m_ToolpathProfile_SetParameterDoubleValue(instanceHandle, sNameSpaceName.c_str(), sValueName.c_str(), dValue); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnPropertyID)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7134,22 +11468,34 @@ void CLib3MFCompositeMaterials::AddComposite(const FunctionCallbackInfo& } -void CLib3MFCompositeMaterials::RemoveComposite(const FunctionCallbackInfo& args) +void CLib3MFToolpathProfile::SetParameterIntegerValue(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (NameSpaceName)"); } - unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (ValueName)"); + } + if (!args[2]->IsString()) { + throw std::runtime_error("Expected int64 parameter 2 (Value)"); + } + v8::String::Utf8Value sutf8NameSpaceName(isolate, args[0]); + std::string sNameSpaceName = *sutf8NameSpaceName; + v8::String::Utf8Value sutf8ValueName(isolate, args[1]); + std::string sValueName = *sutf8ValueName; + v8::String::Utf8Value sutf8Value(isolate, args[2]); + std::string sValue = *sutf8Value; + int64_t nValue = stoll(sValue); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveComposite."); - if (wrapperTable->m_CompositeMaterials_RemoveComposite == nullptr) - throw std::runtime_error("Could not call Lib3MF method CompositeMaterials::RemoveComposite."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetParameterIntegerValue."); + if (wrapperTable->m_ToolpathProfile_SetParameterIntegerValue == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathProfile::SetParameterIntegerValue."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_CompositeMaterials_RemoveComposite(instanceHandle, nPropertyID); + Lib3MFResult errorCode = wrapperTable->m_ToolpathProfile_SetParameterIntegerValue(instanceHandle, sNameSpaceName.c_str(), sValueName.c_str(), nValue); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -7158,22 +11504,32 @@ void CLib3MFCompositeMaterials::RemoveComposite(const FunctionCallbackInfo& args) +void CLib3MFToolpathProfile::SetParameterBoolValue(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (NameSpaceName)"); } - unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (ValueName)"); + } + if (!args[2]->IsBoolean()) { + throw std::runtime_error("Expected bool parameter 2 (Value)"); + } + v8::String::Utf8Value sutf8NameSpaceName(isolate, args[0]); + std::string sNameSpaceName = *sutf8NameSpaceName; + v8::String::Utf8Value sutf8ValueName(isolate, args[1]); + std::string sValueName = *sutf8ValueName; + bool bValue = args[2]->BooleanValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetComposite."); - if (wrapperTable->m_CompositeMaterials_GetComposite == nullptr) - throw std::runtime_error("Could not call Lib3MF method CompositeMaterials::GetComposite."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetParameterBoolValue."); + if (wrapperTable->m_ToolpathProfile_SetParameterBoolValue == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathProfile::SetParameterBoolValue."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_CompositeMaterials_GetComposite(instanceHandle, nPropertyID, 0, nullptr, nullptr); + Lib3MFResult errorCode = wrapperTable->m_ToolpathProfile_SetParameterBoolValue(instanceHandle, sNameSpaceName.c_str(), sValueName.c_str(), bValue); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -7182,58 +11538,68 @@ void CLib3MFCompositeMaterials::GetComposite(const FunctionCallbackInfo& } /************************************************************************************************************************* - Class CLib3MFMultiPropertyGroup Implementation + Class CLib3MFToolpathLayerReader Implementation **************************************************************************************************************************/ -CLib3MFMultiPropertyGroup::CLib3MFMultiPropertyGroup() +CLib3MFToolpathLayerReader::CLib3MFToolpathLayerReader() : CLib3MFBaseClass() { } -CLib3MFMultiPropertyGroup::~CLib3MFMultiPropertyGroup() +CLib3MFToolpathLayerReader::~CLib3MFToolpathLayerReader() { } -void CLib3MFMultiPropertyGroup::Init() +void CLib3MFToolpathLayerReader::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFMultiPropertyGroup")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFToolpathLayerReader")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetCount", GetCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetAllPropertyIDs", GetAllPropertyIDs); - NODE_SET_PROTOTYPE_METHOD(tpl, "AddMultiProperty", AddMultiProperty); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetMultiProperty", SetMultiProperty); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetMultiProperty", GetMultiProperty); - NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveMultiProperty", RemoveMultiProperty); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetLayerCount", GetLayerCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "AddLayer", AddLayer); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetLayer", GetLayer); - NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveLayer", RemoveLayer); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetLayerDataUUID", GetLayerDataUUID); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetSegmentCount", GetSegmentCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetSegmentInfo", GetSegmentInfo); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetSegmentProfile", GetSegmentProfile); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetSegmentProfileUUID", GetSegmentProfileUUID); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetSegmentPart", GetSegmentPart); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetSegmentPartUUID", GetSegmentPartUUID); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetSegmentLocalPartID", GetSegmentLocalPartID); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetPartUUIDByLocalPartID", GetPartUUIDByLocalPartID); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetSegmentPointData", GetSegmentPointData); + NODE_SET_PROTOTYPE_METHOD(tpl, "FindAttributeInfoByName", FindAttributeInfoByName); + NODE_SET_PROTOTYPE_METHOD(tpl, "FindAttributeIDByName", FindAttributeIDByName); + NODE_SET_PROTOTYPE_METHOD(tpl, "FindAttributeValueByName", FindAttributeValueByName); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetSegmentIntegerAttributeByID", GetSegmentIntegerAttributeByID); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetSegmentIntegerAttributeByName", GetSegmentIntegerAttributeByName); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetSegmentDoubleAttributeByID", GetSegmentDoubleAttributeByID); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetSegmentDoubleAttributeByName", GetSegmentDoubleAttributeByName); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCustomDataCount", GetCustomDataCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCustomData", GetCustomData); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCustomDataName", GetCustomDataName); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFMultiPropertyGroup::New(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerReader::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFMultiPropertyGroup * multipropertygroupInstance = new CLib3MFMultiPropertyGroup(); - multipropertygroupInstance->Wrap(args.This()); + CLib3MFToolpathLayerReader * toolpathlayerreaderInstance = new CLib3MFToolpathLayerReader(); + toolpathlayerreaderInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFMultiPropertyGroup: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFToolpathLayerReader: Invalid call to Constructor"); } } -Local CLib3MFMultiPropertyGroup::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFToolpathLayerReader::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -7247,41 +11613,26 @@ Local CLib3MFMultiPropertyGroup::NewInstance(Local pParent, Lib3 } -void CLib3MFMultiPropertyGroup::GetCount(const FunctionCallbackInfo& args) -{ - Isolate* isolate = args.GetIsolate(); - HandleScope scope(isolate); - try { - unsigned int nReturnCount = 0; - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCount."); - if (wrapperTable->m_MultiPropertyGroup_GetCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method MultiPropertyGroup::GetCount."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MultiPropertyGroup_GetCount(instanceHandle, &nReturnCount); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); - - } catch (std::exception & E) { - RaiseError(isolate, E.what()); - } -} - - -void CLib3MFMultiPropertyGroup::GetAllPropertyIDs(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerReader::GetLayerDataUUID(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + unsigned int bytesNeededUUID = 0; + unsigned int bytesWrittenUUID = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetAllPropertyIDs."); - if (wrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs == nullptr) - throw std::runtime_error("Could not call Lib3MF method MultiPropertyGroup::GetAllPropertyIDs."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetLayerDataUUID."); + if (wrapperTable->m_ToolpathLayerReader_GetLayerDataUUID == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerReader::GetLayerDataUUID."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MultiPropertyGroup_GetAllPropertyIDs(instanceHandle, 0, nullptr, nullptr); + Lib3MFResult initErrorCode = wrapperTable->m_ToolpathLayerReader_GetLayerDataUUID(instanceHandle, 0, &bytesNeededUUID, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferUUID; + bufferUUID.resize(bytesNeededUUID); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerReader_GetLayerDataUUID(instanceHandle, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0]); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferUUID[0])); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7289,21 +11640,21 @@ void CLib3MFMultiPropertyGroup::GetAllPropertyIDs(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerReader::GetSegmentCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int nReturnPropertyID = 0; + unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method AddMultiProperty."); - if (wrapperTable->m_MultiPropertyGroup_AddMultiProperty == nullptr) - throw std::runtime_error("Could not call Lib3MF method MultiPropertyGroup::AddMultiProperty."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetSegmentCount."); + if (wrapperTable->m_ToolpathLayerReader_GetSegmentCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerReader::GetSegmentCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MultiPropertyGroup_AddMultiProperty(instanceHandle, 0, nullptr, &nReturnPropertyID); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerReader_GetSegmentCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnPropertyID)); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7311,23 +11662,29 @@ void CLib3MFMultiPropertyGroup::AddMultiProperty(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerReader::GetSegmentInfo(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); } - unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + Local outObject = Object::New(isolate); + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + eLib3MFToolpathSegmentType eReturnType; + unsigned int nReturnPointCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetMultiProperty."); - if (wrapperTable->m_MultiPropertyGroup_SetMultiProperty == nullptr) - throw std::runtime_error("Could not call Lib3MF method MultiPropertyGroup::SetMultiProperty."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetSegmentInfo."); + if (wrapperTable->m_ToolpathLayerReader_GetSegmentInfo == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerReader::GetSegmentInfo."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MultiPropertyGroup_SetMultiProperty(instanceHandle, nPropertyID, 0, nullptr); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerReader_GetSegmentInfo(instanceHandle, nIndex, &eReturnType, &nReturnPointCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "Type"), Integer::New(isolate, (int)eReturnType)); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "PointCount"), Integer::NewFromUnsigned(isolate, nReturnPointCount)); + args.GetReturnValue().Set(outObject); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7335,23 +11692,26 @@ void CLib3MFMultiPropertyGroup::SetMultiProperty(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerReader::GetSegmentProfile(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); } - unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + Lib3MFHandle hReturnProfile = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMultiProperty."); - if (wrapperTable->m_MultiPropertyGroup_GetMultiProperty == nullptr) - throw std::runtime_error("Could not call Lib3MF method MultiPropertyGroup::GetMultiProperty."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetSegmentProfile."); + if (wrapperTable->m_ToolpathLayerReader_GetSegmentProfile == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerReader::GetSegmentProfile."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MultiPropertyGroup_GetMultiProperty(instanceHandle, nPropertyID, 0, nullptr, nullptr); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerReader_GetSegmentProfile(instanceHandle, nIndex, &hReturnProfile); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjProfile = CLib3MFToolpathProfile::NewInstance(args.Holder(), hReturnProfile); + args.GetReturnValue().Set(instanceObjProfile); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7359,71 +11719,30 @@ void CLib3MFMultiPropertyGroup::GetMultiProperty(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerReader::GetSegmentProfileUUID(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (PropertyID)"); - } - unsigned int nPropertyID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveMultiProperty."); - if (wrapperTable->m_MultiPropertyGroup_RemoveMultiProperty == nullptr) - throw std::runtime_error("Could not call Lib3MF method MultiPropertyGroup::RemoveMultiProperty."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MultiPropertyGroup_RemoveMultiProperty(instanceHandle, nPropertyID); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - - } catch (std::exception & E) { - RaiseError(isolate, E.what()); - } -} - - -void CLib3MFMultiPropertyGroup::GetLayerCount(const FunctionCallbackInfo& args) -{ - Isolate* isolate = args.GetIsolate(); - HandleScope scope(isolate); - try { - unsigned int nReturnCount = 0; - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetLayerCount."); - if (wrapperTable->m_MultiPropertyGroup_GetLayerCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method MultiPropertyGroup::GetLayerCount."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MultiPropertyGroup_GetLayerCount(instanceHandle, &nReturnCount); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); - - } catch (std::exception & E) { - RaiseError(isolate, E.what()); - } -} - - -void CLib3MFMultiPropertyGroup::AddLayer(const FunctionCallbackInfo& args) -{ - Isolate* isolate = args.GetIsolate(); - HandleScope scope(isolate); - try { - if (!args[0]->IsObject()) { - throw std::runtime_error("Expected struct parameter 0 (TheLayer)"); + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); } - sLib3MFMultiPropertyLayer sTheLayer = convertObjectToLib3MFMultiPropertyLayer(isolate, args[0]); - unsigned int nReturnLayerIndex = 0; + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int bytesNeededProfileUUID = 0; + unsigned int bytesWrittenProfileUUID = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method AddLayer."); - if (wrapperTable->m_MultiPropertyGroup_AddLayer == nullptr) - throw std::runtime_error("Could not call Lib3MF method MultiPropertyGroup::AddLayer."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetSegmentProfileUUID."); + if (wrapperTable->m_ToolpathLayerReader_GetSegmentProfileUUID == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerReader::GetSegmentProfileUUID."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MultiPropertyGroup_AddLayer(instanceHandle, &sTheLayer, &nReturnLayerIndex); + Lib3MFResult initErrorCode = wrapperTable->m_ToolpathLayerReader_GetSegmentProfileUUID(instanceHandle, nIndex, 0, &bytesNeededProfileUUID, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferProfileUUID; + bufferProfileUUID.resize(bytesNeededProfileUUID); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerReader_GetSegmentProfileUUID(instanceHandle, nIndex, bytesNeededProfileUUID, &bytesWrittenProfileUUID, &bufferProfileUUID[0]); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnLayerIndex)); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferProfileUUID[0])); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7431,25 +11750,26 @@ void CLib3MFMultiPropertyGroup::AddLayer(const FunctionCallbackInfo& args } -void CLib3MFMultiPropertyGroup::GetLayer(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerReader::GetSegmentPart(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (LayerIndex)"); + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); } - unsigned int nLayerIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - sLib3MFMultiPropertyLayer sReturnTheLayer; + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + Lib3MFHandle hReturnBuildItem = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetLayer."); - if (wrapperTable->m_MultiPropertyGroup_GetLayer == nullptr) - throw std::runtime_error("Could not call Lib3MF method MultiPropertyGroup::GetLayer."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetSegmentPart."); + if (wrapperTable->m_ToolpathLayerReader_GetSegmentPart == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerReader::GetSegmentPart."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MultiPropertyGroup_GetLayer(instanceHandle, nLayerIndex, &sReturnTheLayer); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerReader_GetSegmentPart(instanceHandle, nIndex, &hReturnBuildItem); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(convertLib3MFMultiPropertyLayerToObject(isolate, sReturnTheLayer)); + Local instanceObjBuildItem = CLib3MFBuildItem::NewInstance(args.Holder(), hReturnBuildItem); + args.GetReturnValue().Set(instanceObjBuildItem); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7457,116 +11777,111 @@ void CLib3MFMultiPropertyGroup::GetLayer(const FunctionCallbackInfo& args } -void CLib3MFMultiPropertyGroup::RemoveLayer(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerReader::GetSegmentPartUUID(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected uint32 parameter 0 (LayerIndex)"); + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); } - unsigned int nLayerIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int bytesNeededPartUUID = 0; + unsigned int bytesWrittenPartUUID = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method RemoveLayer."); - if (wrapperTable->m_MultiPropertyGroup_RemoveLayer == nullptr) - throw std::runtime_error("Could not call Lib3MF method MultiPropertyGroup::RemoveLayer."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetSegmentPartUUID."); + if (wrapperTable->m_ToolpathLayerReader_GetSegmentPartUUID == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerReader::GetSegmentPartUUID."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_MultiPropertyGroup_RemoveLayer(instanceHandle, nLayerIndex); + Lib3MFResult initErrorCode = wrapperTable->m_ToolpathLayerReader_GetSegmentPartUUID(instanceHandle, nIndex, 0, &bytesNeededPartUUID, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferPartUUID; + bufferPartUUID.resize(bytesNeededPartUUID); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerReader_GetSegmentPartUUID(instanceHandle, nIndex, bytesNeededPartUUID, &bytesWrittenPartUUID, &bufferPartUUID[0]); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferPartUUID[0])); } catch (std::exception & E) { - RaiseError(isolate, E.what()); - } -} - -/************************************************************************************************************************* - Class CLib3MFAttachment Implementation -**************************************************************************************************************************/ - -CLib3MFAttachment::CLib3MFAttachment() - : CLib3MFBaseClass() -{ -} - -CLib3MFAttachment::~CLib3MFAttachment() -{ -} - -void CLib3MFAttachment::Init() -{ - Isolate* isolate = Isolate::GetCurrent(); - - // Prepare constructor template - Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFAttachment")); - tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); - - // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetPath", GetPath); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetPath", SetPath); - NODE_SET_PROTOTYPE_METHOD(tpl, "PackagePart", PackagePart); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetRelationShipType", GetRelationShipType); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetRelationShipType", SetRelationShipType); - NODE_SET_PROTOTYPE_METHOD(tpl, "WriteToFile", WriteToFile); - NODE_SET_PROTOTYPE_METHOD(tpl, "ReadFromFile", ReadFromFile); - NODE_SET_PROTOTYPE_METHOD(tpl, "ReadFromCallback", ReadFromCallback); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetStreamSize", GetStreamSize); - NODE_SET_PROTOTYPE_METHOD(tpl, "WriteToBuffer", WriteToBuffer); - NODE_SET_PROTOTYPE_METHOD(tpl, "ReadFromBuffer", ReadFromBuffer); - constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); - + RaiseError(isolate, E.what()); + } } -void CLib3MFAttachment::New(const FunctionCallbackInfo& args) + +void CLib3MFToolpathLayerReader::GetSegmentLocalPartID(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int nReturnLocalPartID = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetSegmentLocalPartID."); + if (wrapperTable->m_ToolpathLayerReader_GetSegmentLocalPartID == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerReader::GetSegmentLocalPartID."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerReader_GetSegmentLocalPartID(instanceHandle, nIndex, &nReturnLocalPartID); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnLocalPartID)); - if (args.IsConstructCall()) { - CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFAttachment * attachmentInstance = new CLib3MFAttachment(); - attachmentInstance->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - RaiseError(isolate, "Lib3MFAttachment: Invalid call to Constructor"); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } } -Local CLib3MFAttachment::NewInstance(Local pParent, Lib3MFHandle pHandle) + +void CLib3MFToolpathLayerReader::GetPartUUIDByLocalPartID(const FunctionCallbackInfo& args) { - Isolate* isolate = Isolate::GetCurrent(); + Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); - Local cons = Local::New(isolate, constructor); - Local instance; - if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { - instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); - instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (LocalPartID)"); + } + unsigned int nLocalPartID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int bytesNeededPartUUID = 0; + unsigned int bytesWrittenPartUUID = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetPartUUIDByLocalPartID."); + if (wrapperTable->m_ToolpathLayerReader_GetPartUUIDByLocalPartID == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerReader::GetPartUUIDByLocalPartID."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult initErrorCode = wrapperTable->m_ToolpathLayerReader_GetPartUUIDByLocalPartID(instanceHandle, nLocalPartID, 0, &bytesNeededPartUUID, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferPartUUID; + bufferPartUUID.resize(bytesNeededPartUUID); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerReader_GetPartUUIDByLocalPartID(instanceHandle, nLocalPartID, bytesNeededPartUUID, &bytesWrittenPartUUID, &bufferPartUUID[0]); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferPartUUID[0])); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } - return instance; } -void CLib3MFAttachment::GetPath(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerReader::GetSegmentPointData(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int bytesNeededPath = 0; - unsigned int bytesWrittenPath = 0; + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetPath."); - if (wrapperTable->m_Attachment_GetPath == nullptr) - throw std::runtime_error("Could not call Lib3MF method Attachment::GetPath."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetSegmentPointData."); + if (wrapperTable->m_ToolpathLayerReader_GetSegmentPointData == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerReader::GetSegmentPointData."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult initErrorCode = wrapperTable->m_Attachment_GetPath(instanceHandle, 0, &bytesNeededPath, nullptr); - CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); - std::vector bufferPath; - bufferPath.resize(bytesNeededPath); - Lib3MFResult errorCode = wrapperTable->m_Attachment_GetPath(instanceHandle, bytesNeededPath, &bytesWrittenPath, &bufferPath[0]); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerReader_GetSegmentPointData(instanceHandle, nIndex, 0, nullptr, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferPath[0])); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7574,24 +11889,35 @@ void CLib3MFAttachment::GetPath(const FunctionCallbackInfo& args) } -void CLib3MFAttachment::SetPath(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerReader::FindAttributeInfoByName(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { if (!args[0]->IsString()) { - throw std::runtime_error("Expected string parameter 0 (Path)"); + throw std::runtime_error("Expected string parameter 0 (NameSpace)"); } - v8::String::Utf8Value sutf8Path(isolate, args[0]); - std::string sPath = *sutf8Path; + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (AttributeName)"); + } + Local outObject = Object::New(isolate); + v8::String::Utf8Value sutf8NameSpace(isolate, args[0]); + std::string sNameSpace = *sutf8NameSpace; + v8::String::Utf8Value sutf8AttributeName(isolate, args[1]); + std::string sAttributeName = *sutf8AttributeName; + unsigned int nReturnID = 0; + eLib3MFToolpathAttributeType eReturnAttributeType; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetPath."); - if (wrapperTable->m_Attachment_SetPath == nullptr) - throw std::runtime_error("Could not call Lib3MF method Attachment::SetPath."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method FindAttributeInfoByName."); + if (wrapperTable->m_ToolpathLayerReader_FindAttributeInfoByName == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerReader::FindAttributeInfoByName."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Attachment_SetPath(instanceHandle, sPath.c_str()); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerReader_FindAttributeInfoByName(instanceHandle, sNameSpace.c_str(), sAttributeName.c_str(), &nReturnID, &eReturnAttributeType); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "ID"), Integer::NewFromUnsigned(isolate, nReturnID)); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "AttributeType"), Integer::New(isolate, (int)eReturnAttributeType)); + args.GetReturnValue().Set(outObject); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7599,22 +11925,31 @@ void CLib3MFAttachment::SetPath(const FunctionCallbackInfo& args) } -void CLib3MFAttachment::PackagePart(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerReader::FindAttributeIDByName(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnPackagePart = nullptr; + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (NameSpace)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (AttributeName)"); + } + v8::String::Utf8Value sutf8NameSpace(isolate, args[0]); + std::string sNameSpace = *sutf8NameSpace; + v8::String::Utf8Value sutf8AttributeName(isolate, args[1]); + std::string sAttributeName = *sutf8AttributeName; + unsigned int nReturnID = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method PackagePart."); - if (wrapperTable->m_Attachment_PackagePart == nullptr) - throw std::runtime_error("Could not call Lib3MF method Attachment::PackagePart."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method FindAttributeIDByName."); + if (wrapperTable->m_ToolpathLayerReader_FindAttributeIDByName == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerReader::FindAttributeIDByName."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Attachment_PackagePart(instanceHandle, &hReturnPackagePart); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerReader_FindAttributeIDByName(instanceHandle, sNameSpace.c_str(), sAttributeName.c_str(), &nReturnID); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjPackagePart = CLib3MFPackagePart::NewInstance(args.Holder(), hReturnPackagePart); - args.GetReturnValue().Set(instanceObjPackagePart); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnID)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7622,26 +11957,31 @@ void CLib3MFAttachment::PackagePart(const FunctionCallbackInfo& args) } -void CLib3MFAttachment::GetRelationShipType(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerReader::FindAttributeValueByName(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int bytesNeededPath = 0; - unsigned int bytesWrittenPath = 0; + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (NameSpace)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (AttributeName)"); + } + v8::String::Utf8Value sutf8NameSpace(isolate, args[0]); + std::string sNameSpace = *sutf8NameSpace; + v8::String::Utf8Value sutf8AttributeName(isolate, args[1]); + std::string sAttributeName = *sutf8AttributeName; + eLib3MFToolpathAttributeType eReturnAttributeType; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetRelationShipType."); - if (wrapperTable->m_Attachment_GetRelationShipType == nullptr) - throw std::runtime_error("Could not call Lib3MF method Attachment::GetRelationShipType."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method FindAttributeValueByName."); + if (wrapperTable->m_ToolpathLayerReader_FindAttributeValueByName == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerReader::FindAttributeValueByName."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult initErrorCode = wrapperTable->m_Attachment_GetRelationShipType(instanceHandle, 0, &bytesNeededPath, nullptr); - CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); - std::vector bufferPath; - bufferPath.resize(bytesNeededPath); - Lib3MFResult errorCode = wrapperTable->m_Attachment_GetRelationShipType(instanceHandle, bytesNeededPath, &bytesWrittenPath, &bufferPath[0]); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerReader_FindAttributeValueByName(instanceHandle, sNameSpace.c_str(), sAttributeName.c_str(), &eReturnAttributeType); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferPath[0])); + args.GetReturnValue().Set(Integer::New(isolate, (int)eReturnAttributeType)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7649,24 +11989,29 @@ void CLib3MFAttachment::GetRelationShipType(const FunctionCallbackInfo& a } -void CLib3MFAttachment::SetRelationShipType(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerReader::GetSegmentIntegerAttributeByID(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsString()) { - throw std::runtime_error("Expected string parameter 0 (Path)"); + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); } - v8::String::Utf8Value sutf8Path(isolate, args[0]); - std::string sPath = *sutf8Path; + if (!args[1]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 1 (ID)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int nID = (unsigned int) args[1]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + int64_t nReturnValue = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetRelationShipType."); - if (wrapperTable->m_Attachment_SetRelationShipType == nullptr) - throw std::runtime_error("Could not call Lib3MF method Attachment::SetRelationShipType."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetSegmentIntegerAttributeByID."); + if (wrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByID == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerReader::GetSegmentIntegerAttributeByID."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Attachment_SetRelationShipType(instanceHandle, sPath.c_str()); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByID(instanceHandle, nIndex, nID, &nReturnValue); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, std::to_string(nReturnValue).c_str() )); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7674,24 +12019,35 @@ void CLib3MFAttachment::SetRelationShipType(const FunctionCallbackInfo& a } -void CLib3MFAttachment::WriteToFile(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerReader::GetSegmentIntegerAttributeByName(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsString()) { - throw std::runtime_error("Expected string parameter 0 (FileName)"); + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); } - v8::String::Utf8Value sutf8FileName(isolate, args[0]); - std::string sFileName = *sutf8FileName; + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (NameSpace)"); + } + if (!args[2]->IsString()) { + throw std::runtime_error("Expected string parameter 2 (AttributeName)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + v8::String::Utf8Value sutf8NameSpace(isolate, args[1]); + std::string sNameSpace = *sutf8NameSpace; + v8::String::Utf8Value sutf8AttributeName(isolate, args[2]); + std::string sAttributeName = *sutf8AttributeName; + int64_t nReturnValue = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method WriteToFile."); - if (wrapperTable->m_Attachment_WriteToFile == nullptr) - throw std::runtime_error("Could not call Lib3MF method Attachment::WriteToFile."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetSegmentIntegerAttributeByName."); + if (wrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByName == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerReader::GetSegmentIntegerAttributeByName."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Attachment_WriteToFile(instanceHandle, sFileName.c_str()); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerReader_GetSegmentIntegerAttributeByName(instanceHandle, nIndex, sNameSpace.c_str(), sAttributeName.c_str(), &nReturnValue); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, std::to_string(nReturnValue).c_str() )); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7699,24 +12055,29 @@ void CLib3MFAttachment::WriteToFile(const FunctionCallbackInfo& args) } -void CLib3MFAttachment::ReadFromFile(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerReader::GetSegmentDoubleAttributeByID(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsString()) { - throw std::runtime_error("Expected string parameter 0 (FileName)"); + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); } - v8::String::Utf8Value sutf8FileName(isolate, args[0]); - std::string sFileName = *sutf8FileName; + if (!args[1]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 1 (ID)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int nID = (unsigned int) args[1]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + double dReturnValue = 0.0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method ReadFromFile."); - if (wrapperTable->m_Attachment_ReadFromFile == nullptr) - throw std::runtime_error("Could not call Lib3MF method Attachment::ReadFromFile."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetSegmentDoubleAttributeByID."); + if (wrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByID == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerReader::GetSegmentDoubleAttributeByID."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Attachment_ReadFromFile(instanceHandle, sFileName.c_str()); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByID(instanceHandle, nIndex, nID, &dReturnValue); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Number::New(isolate, dReturnValue)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7724,31 +12085,35 @@ void CLib3MFAttachment::ReadFromFile(const FunctionCallbackInfo& args) } -void CLib3MFAttachment::ReadFromCallback(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerReader::GetSegmentDoubleAttributeByName(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } if (!args[1]->IsString()) { - throw std::runtime_error("Expected uint64 parameter 1 (StreamSize)"); + throw std::runtime_error("Expected string parameter 1 (NameSpace)"); } - if (!args[3]->IsString()) { - throw std::runtime_error("Expected pointer parameter 3 (UserData)"); + if (!args[2]->IsString()) { + throw std::runtime_error("Expected string parameter 2 (AttributeName)"); } - v8::String::Utf8Value sutf8StreamSize(isolate, args[1]); - std::string sStreamSize = *sutf8StreamSize; - uint64_t nStreamSize = stoull(sStreamSize); - v8::String::Utf8Value sutf8UserData(isolate, args[3]); - std::string sUserData = *sutf8UserData; - uint64_t nUserData = stoull(sUserData); + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + v8::String::Utf8Value sutf8NameSpace(isolate, args[1]); + std::string sNameSpace = *sutf8NameSpace; + v8::String::Utf8Value sutf8AttributeName(isolate, args[2]); + std::string sAttributeName = *sutf8AttributeName; + double dReturnValue = 0.0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method ReadFromCallback."); - if (wrapperTable->m_Attachment_ReadFromCallback == nullptr) - throw std::runtime_error("Could not call Lib3MF method Attachment::ReadFromCallback."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetSegmentDoubleAttributeByName."); + if (wrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByName == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerReader::GetSegmentDoubleAttributeByName."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Attachment_ReadFromCallback(instanceHandle, nullptr, nStreamSize, nullptr, (void*) nUserData); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerReader_GetSegmentDoubleAttributeByName(instanceHandle, nIndex, sNameSpace.c_str(), sAttributeName.c_str(), &dReturnValue); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Number::New(isolate, dReturnValue)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7756,21 +12121,21 @@ void CLib3MFAttachment::ReadFromCallback(const FunctionCallbackInfo& args } -void CLib3MFAttachment::GetStreamSize(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerReader::GetCustomDataCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - uint64_t nReturnStreamSize = 0; + unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetStreamSize."); - if (wrapperTable->m_Attachment_GetStreamSize == nullptr) - throw std::runtime_error("Could not call Lib3MF method Attachment::GetStreamSize."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCustomDataCount."); + if (wrapperTable->m_ToolpathLayerReader_GetCustomDataCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerReader::GetCustomDataCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Attachment_GetStreamSize(instanceHandle, &nReturnStreamSize); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerReader_GetCustomDataCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, std::to_string(nReturnStreamSize).c_str())); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7778,19 +12143,26 @@ void CLib3MFAttachment::GetStreamSize(const FunctionCallbackInfo& args) } -void CLib3MFAttachment::WriteToBuffer(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerReader::GetCustomData(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + Lib3MFHandle hReturnData = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method WriteToBuffer."); - if (wrapperTable->m_Attachment_WriteToBuffer == nullptr) - throw std::runtime_error("Could not call Lib3MF method Attachment::WriteToBuffer."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCustomData."); + if (wrapperTable->m_ToolpathLayerReader_GetCustomData == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerReader::GetCustomData."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Attachment_WriteToBuffer(instanceHandle, 0, nullptr, nullptr); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerReader_GetCustomData(instanceHandle, nIndex, &hReturnData); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjData = CLib3MFCustomDOMTree::NewInstance(args.Holder(), hReturnData); + args.GetReturnValue().Set(instanceObjData); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7798,19 +12170,37 @@ void CLib3MFAttachment::WriteToBuffer(const FunctionCallbackInfo& args) } -void CLib3MFAttachment::ReadFromBuffer(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerReader::GetCustomDataName(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + Local outObject = Object::New(isolate); + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int bytesNeededNameSpace = 0; + unsigned int bytesWrittenNameSpace = 0; + unsigned int bytesNeededDataName = 0; + unsigned int bytesWrittenDataName = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method ReadFromBuffer."); - if (wrapperTable->m_Attachment_ReadFromBuffer == nullptr) - throw std::runtime_error("Could not call Lib3MF method Attachment::ReadFromBuffer."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCustomDataName."); + if (wrapperTable->m_ToolpathLayerReader_GetCustomDataName == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerReader::GetCustomDataName."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Attachment_ReadFromBuffer(instanceHandle, 0, nullptr); + Lib3MFResult initErrorCode = wrapperTable->m_ToolpathLayerReader_GetCustomDataName(instanceHandle, nIndex, 0, &bytesNeededNameSpace, nullptr, 0, &bytesNeededDataName, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferNameSpace; + bufferNameSpace.resize(bytesNeededNameSpace); + std::vector bufferDataName; + bufferDataName.resize(bytesNeededDataName); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerReader_GetCustomDataName(instanceHandle, nIndex, bytesNeededNameSpace, &bytesWrittenNameSpace, &bufferNameSpace[0], bytesNeededDataName, &bytesWrittenDataName, &bufferDataName[0]); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "NameSpace"), String::NewFromUtf8(isolate, &bufferNameSpace[0])); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "DataName"), String::NewFromUtf8(isolate, &bufferDataName[0])); + args.GetReturnValue().Set(outObject); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7818,85 +12208,151 @@ void CLib3MFAttachment::ReadFromBuffer(const FunctionCallbackInfo& args) } /************************************************************************************************************************* - Class CLib3MFTexture2D Implementation + Class CLib3MFToolpathLayerData Implementation **************************************************************************************************************************/ -CLib3MFTexture2D::CLib3MFTexture2D() +CLib3MFToolpathLayerData::CLib3MFToolpathLayerData() : CLib3MFBaseClass() { } -CLib3MFTexture2D::~CLib3MFTexture2D() +CLib3MFToolpathLayerData::~CLib3MFToolpathLayerData() { } -void CLib3MFTexture2D::Init() +void CLib3MFToolpathLayerData::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFTexture2D")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFToolpathLayerData")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetAttachment", GetAttachment); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetAttachment", SetAttachment); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetContentType", GetContentType); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetContentType", SetContentType); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetTileStyleUV", GetTileStyleUV); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetTileStyleUV", SetTileStyleUV); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetFilter", GetFilter); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetFilter", SetFilter); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetLayerDataUUID", GetLayerDataUUID); + NODE_SET_PROTOTYPE_METHOD(tpl, "RegisterProfile", RegisterProfile); + NODE_SET_PROTOTYPE_METHOD(tpl, "RegisterBuildItem", RegisterBuildItem); + NODE_SET_PROTOTYPE_METHOD(tpl, "SetSegmentAttribute", SetSegmentAttribute); + NODE_SET_PROTOTYPE_METHOD(tpl, "ClearSegmentAttributes", ClearSegmentAttributes); + NODE_SET_PROTOTYPE_METHOD(tpl, "WriteHatchData", WriteHatchData); + NODE_SET_PROTOTYPE_METHOD(tpl, "WriteLoop", WriteLoop); + NODE_SET_PROTOTYPE_METHOD(tpl, "WritePolyline", WritePolyline); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddCustomData", AddCustomData); + NODE_SET_PROTOTYPE_METHOD(tpl, "Finish", Finish); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFTexture2D::New(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerData::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFTexture2D * texture2dInstance = new CLib3MFTexture2D(); - texture2dInstance->Wrap(args.This()); + CLib3MFToolpathLayerData * toolpathlayerdataInstance = new CLib3MFToolpathLayerData(); + toolpathlayerdataInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFTexture2D: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFToolpathLayerData: Invalid call to Constructor"); + } +} + +Local CLib3MFToolpathLayerData::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFToolpathLayerData::GetLayerDataUUID(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + unsigned int bytesNeededUUID = 0; + unsigned int bytesWrittenUUID = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetLayerDataUUID."); + if (wrapperTable->m_ToolpathLayerData_GetLayerDataUUID == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerData::GetLayerDataUUID."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult initErrorCode = wrapperTable->m_ToolpathLayerData_GetLayerDataUUID(instanceHandle, 0, &bytesNeededUUID, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferUUID; + bufferUUID.resize(bytesNeededUUID); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerData_GetLayerDataUUID(instanceHandle, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0]); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferUUID[0])); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } } -Local CLib3MFTexture2D::NewInstance(Local pParent, Lib3MFHandle pHandle) + +void CLib3MFToolpathLayerData::RegisterProfile(const FunctionCallbackInfo& args) { - Isolate* isolate = Isolate::GetCurrent(); + Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); - Local cons = Local::New(isolate, constructor); - Local instance; - if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { - instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); - instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + try { + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected class parameter 0 (Profile)"); + } + Local objProfile = args[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); + CLib3MFToolpathProfile * instanceProfile = ObjectWrap::Unwrap(objProfile); + if (instanceProfile == nullptr) + throw std::runtime_error("Invalid Object parameter 0 (Profile)"); + Lib3MFHandle hProfile = instanceProfile->getHandle( objProfile ); + unsigned int nReturnProfileID = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method RegisterProfile."); + if (wrapperTable->m_ToolpathLayerData_RegisterProfile == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerData::RegisterProfile."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerData_RegisterProfile(instanceHandle, hProfile, &nReturnProfileID); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnProfileID)); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } - return instance; } -void CLib3MFTexture2D::GetAttachment(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerData::RegisterBuildItem(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnAttachment = nullptr; + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected class parameter 0 (BuildItem)"); + } + Local objBuildItem = args[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); + CLib3MFBuildItem * instanceBuildItem = ObjectWrap::Unwrap(objBuildItem); + if (instanceBuildItem == nullptr) + throw std::runtime_error("Invalid Object parameter 0 (BuildItem)"); + Lib3MFHandle hBuildItem = instanceBuildItem->getHandle( objBuildItem ); + unsigned int nReturnPartID = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetAttachment."); - if (wrapperTable->m_Texture2D_GetAttachment == nullptr) - throw std::runtime_error("Could not call Lib3MF method Texture2D::GetAttachment."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method RegisterBuildItem."); + if (wrapperTable->m_ToolpathLayerData_RegisterBuildItem == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerData::RegisterBuildItem."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Texture2D_GetAttachment(instanceHandle, &hReturnAttachment); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerData_RegisterBuildItem(instanceHandle, hBuildItem, &nReturnPartID); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjAttachment = CLib3MFAttachment::NewInstance(args.Holder(), hReturnAttachment); - args.GetReturnValue().Set(instanceObjAttachment); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnPartID)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7904,26 +12360,33 @@ void CLib3MFTexture2D::GetAttachment(const FunctionCallbackInfo& args) } -void CLib3MFTexture2D::SetAttachment(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerData::SetSegmentAttribute(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsObject()) { - throw std::runtime_error("Expected class parameter 0 (Attachment)"); + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (NameSpace)"); } - Local objAttachment = args[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); - CLib3MFAttachment * instanceAttachment = ObjectWrap::Unwrap(objAttachment); - if (instanceAttachment == nullptr) - throw std::runtime_error("Invalid Object parameter 0 (Attachment)"); - Lib3MFHandle hAttachment = instanceAttachment->getHandle( objAttachment ); + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (AttributeName)"); + } + if (!args[2]->IsString()) { + throw std::runtime_error("Expected string parameter 2 (Value)"); + } + v8::String::Utf8Value sutf8NameSpace(isolate, args[0]); + std::string sNameSpace = *sutf8NameSpace; + v8::String::Utf8Value sutf8AttributeName(isolate, args[1]); + std::string sAttributeName = *sutf8AttributeName; + v8::String::Utf8Value sutf8Value(isolate, args[2]); + std::string sValue = *sutf8Value; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetAttachment."); - if (wrapperTable->m_Texture2D_SetAttachment == nullptr) - throw std::runtime_error("Could not call Lib3MF method Texture2D::SetAttachment."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method SetSegmentAttribute."); + if (wrapperTable->m_ToolpathLayerData_SetSegmentAttribute == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerData::SetSegmentAttribute."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Texture2D_SetAttachment(instanceHandle, hAttachment); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerData_SetSegmentAttribute(instanceHandle, sNameSpace.c_str(), sAttributeName.c_str(), sValue.c_str()); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -7932,21 +12395,19 @@ void CLib3MFTexture2D::SetAttachment(const FunctionCallbackInfo& args) } -void CLib3MFTexture2D::GetContentType(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerData::ClearSegmentAttributes(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - eLib3MFTextureType eReturnContentType; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetContentType."); - if (wrapperTable->m_Texture2D_GetContentType == nullptr) - throw std::runtime_error("Could not call Lib3MF method Texture2D::GetContentType."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method ClearSegmentAttributes."); + if (wrapperTable->m_ToolpathLayerData_ClearSegmentAttributes == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerData::ClearSegmentAttributes."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Texture2D_GetContentType(instanceHandle, &eReturnContentType); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerData_ClearSegmentAttributes(instanceHandle); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::New(isolate, (int)eReturnContentType)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -7954,22 +12415,26 @@ void CLib3MFTexture2D::GetContentType(const FunctionCallbackInfo& args) } -void CLib3MFTexture2D::SetContentType(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerData::WriteHatchData(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected enum parameter 0 (ContentType)"); + throw std::runtime_error("Expected uint32 parameter 0 (ProfileID)"); } - unsigned int eContentType = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + if (!args[1]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 1 (PartID)"); + } + unsigned int nProfileID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int nPartID = (unsigned int) args[1]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetContentType."); - if (wrapperTable->m_Texture2D_SetContentType == nullptr) - throw std::runtime_error("Could not call Lib3MF method Texture2D::SetContentType."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method WriteHatchData."); + if (wrapperTable->m_ToolpathLayerData_WriteHatchData == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerData::WriteHatchData."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Texture2D_SetContentType(instanceHandle, (eLib3MFTextureType) eContentType); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerData_WriteHatchData(instanceHandle, nProfileID, nPartID, 0, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -7978,25 +12443,27 @@ void CLib3MFTexture2D::SetContentType(const FunctionCallbackInfo& args) } -void CLib3MFTexture2D::GetTileStyleUV(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerData::WriteLoop(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Local outObject = Object::New(isolate); - eLib3MFTextureTileStyle eReturnTileStyleU; - eLib3MFTextureTileStyle eReturnTileStyleV; + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (ProfileID)"); + } + if (!args[1]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 1 (PartID)"); + } + unsigned int nProfileID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int nPartID = (unsigned int) args[1]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetTileStyleUV."); - if (wrapperTable->m_Texture2D_GetTileStyleUV == nullptr) - throw std::runtime_error("Could not call Lib3MF method Texture2D::GetTileStyleUV."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method WriteLoop."); + if (wrapperTable->m_ToolpathLayerData_WriteLoop == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerData::WriteLoop."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Texture2D_GetTileStyleUV(instanceHandle, &eReturnTileStyleU, &eReturnTileStyleV); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerData_WriteLoop(instanceHandle, nProfileID, nPartID, 0, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "TileStyleU"), Integer::New(isolate, (int)eReturnTileStyleU)); - outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "TileStyleV"), Integer::New(isolate, (int)eReturnTileStyleV)); - args.GetReturnValue().Set(outObject); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8004,26 +12471,26 @@ void CLib3MFTexture2D::GetTileStyleUV(const FunctionCallbackInfo& args) } -void CLib3MFTexture2D::SetTileStyleUV(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerData::WritePolyline(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected enum parameter 0 (TileStyleU)"); + throw std::runtime_error("Expected uint32 parameter 0 (ProfileID)"); } if (!args[1]->IsUint32()) { - throw std::runtime_error("Expected enum parameter 1 (TileStyleV)"); + throw std::runtime_error("Expected uint32 parameter 1 (PartID)"); } - unsigned int eTileStyleU = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); - unsigned int eTileStyleV = (unsigned int) args[1]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int nProfileID = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int nPartID = (unsigned int) args[1]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetTileStyleUV."); - if (wrapperTable->m_Texture2D_SetTileStyleUV == nullptr) - throw std::runtime_error("Could not call Lib3MF method Texture2D::SetTileStyleUV."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method WritePolyline."); + if (wrapperTable->m_ToolpathLayerData_WritePolyline == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerData::WritePolyline."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Texture2D_SetTileStyleUV(instanceHandle, (eLib3MFTextureTileStyle) eTileStyleU, (eLib3MFTextureTileStyle) eTileStyleV); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerData_WritePolyline(instanceHandle, nProfileID, nPartID, 0, nullptr); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -8032,21 +12499,32 @@ void CLib3MFTexture2D::SetTileStyleUV(const FunctionCallbackInfo& args) } -void CLib3MFTexture2D::GetFilter(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerData::AddCustomData(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - eLib3MFTextureFilter eReturnFilter; + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (NameSpace)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (DataName)"); + } + v8::String::Utf8Value sutf8NameSpace(isolate, args[0]); + std::string sNameSpace = *sutf8NameSpace; + v8::String::Utf8Value sutf8DataName(isolate, args[1]); + std::string sDataName = *sutf8DataName; + Lib3MFHandle hReturnData = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetFilter."); - if (wrapperTable->m_Texture2D_GetFilter == nullptr) - throw std::runtime_error("Could not call Lib3MF method Texture2D::GetFilter."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddCustomData."); + if (wrapperTable->m_ToolpathLayerData_AddCustomData == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerData::AddCustomData."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Texture2D_GetFilter(instanceHandle, &eReturnFilter); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerData_AddCustomData(instanceHandle, sNameSpace.c_str(), sDataName.c_str(), &hReturnData); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::New(isolate, (int)eReturnFilter)); + Local instanceObjData = CLib3MFCustomDOMTree::NewInstance(args.Holder(), hReturnData); + args.GetReturnValue().Set(instanceObjData); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8054,22 +12532,18 @@ void CLib3MFTexture2D::GetFilter(const FunctionCallbackInfo& args) } -void CLib3MFTexture2D::SetFilter(const FunctionCallbackInfo& args) +void CLib3MFToolpathLayerData::Finish(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsUint32()) { - throw std::runtime_error("Expected enum parameter 0 (Filter)"); - } - unsigned int eFilter = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetFilter."); - if (wrapperTable->m_Texture2D_SetFilter == nullptr) - throw std::runtime_error("Could not call Lib3MF method Texture2D::SetFilter."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method Finish."); + if (wrapperTable->m_ToolpathLayerData_Finish == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathLayerData::Finish."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Texture2D_SetFilter(instanceHandle, (eLib3MFTextureFilter) eFilter); + Lib3MFResult errorCode = wrapperTable->m_ToolpathLayerData_Finish(instanceHandle); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -8078,59 +12552,70 @@ void CLib3MFTexture2D::SetFilter(const FunctionCallbackInfo& args) } /************************************************************************************************************************* - Class CLib3MFBuildItem Implementation + Class CLib3MFToolpath Implementation **************************************************************************************************************************/ -CLib3MFBuildItem::CLib3MFBuildItem() +CLib3MFToolpath::CLib3MFToolpath() : CLib3MFBaseClass() { } -CLib3MFBuildItem::~CLib3MFBuildItem() +CLib3MFToolpath::~CLib3MFToolpath() { } -void CLib3MFBuildItem::Init() +void CLib3MFToolpath::Init() { Isolate* isolate = Isolate::GetCurrent(); // Prepare constructor template Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFBuildItem")); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFToolpath")); tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "GetObjectResource", GetObjectResource); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetUUID", GetUUID); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetUUID", SetUUID); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetObjectResourceID", GetObjectResourceID); - NODE_SET_PROTOTYPE_METHOD(tpl, "HasObjectTransform", HasObjectTransform); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetObjectTransform", GetObjectTransform); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetObjectTransform", SetObjectTransform); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetPartNumber", GetPartNumber); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetPartNumber", SetPartNumber); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetMetaDataGroup", GetMetaDataGroup); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetOutbox", GetOutbox); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetUnits", GetUnits); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetLayerCount", GetLayerCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetProfileCount", GetProfileCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddLayer", AddLayer); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetLayerAttachment", GetLayerAttachment); + NODE_SET_PROTOTYPE_METHOD(tpl, "ReadLayerData", ReadLayerData); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetLayerPath", GetLayerPath); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetLayerZMax", GetLayerZMax); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetLayerZ", GetLayerZ); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddProfile", AddProfile); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetProfile", GetProfile); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetProfileUUID", GetProfileUUID); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCustomDataCount", GetCustomDataCount); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCustomData", GetCustomData); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCustomDataName", GetCustomDataName); + NODE_SET_PROTOTYPE_METHOD(tpl, "HasUniqueCustomData", HasUniqueCustomData); + NODE_SET_PROTOTYPE_METHOD(tpl, "FindUniqueCustomData", FindUniqueCustomData); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddCustomData", AddCustomData); + NODE_SET_PROTOTYPE_METHOD(tpl, "ClearCustomData", ClearCustomData); + NODE_SET_PROTOTYPE_METHOD(tpl, "DeleteCustomData", DeleteCustomData); + NODE_SET_PROTOTYPE_METHOD(tpl, "RegisterCustomIntegerAttribute", RegisterCustomIntegerAttribute); + NODE_SET_PROTOTYPE_METHOD(tpl, "RegisterCustomDoubleAttribute", RegisterCustomDoubleAttribute); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } -void CLib3MFBuildItem::New(const FunctionCallbackInfo& args) +void CLib3MFToolpath::New(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); if (args.IsConstructCall()) { CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFBuildItem * builditemInstance = new CLib3MFBuildItem(); - builditemInstance->Wrap(args.This()); + CLib3MFToolpath * toolpathInstance = new CLib3MFToolpath(); + toolpathInstance->Wrap(args.This()); args.GetReturnValue().Set(args.This()); } else { - RaiseError(isolate, "Lib3MFBuildItem: Invalid call to Constructor"); + RaiseError(isolate, "Lib3MFToolpath: Invalid call to Constructor"); } } -Local CLib3MFBuildItem::NewInstance(Local pParent, Lib3MFHandle pHandle) +Local CLib3MFToolpath::NewInstance(Local pParent, Lib3MFHandle pHandle) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); @@ -8144,122 +12629,21 @@ Local CLib3MFBuildItem::NewInstance(Local pParent, Lib3MFHandle } -void CLib3MFBuildItem::GetObjectResource(const FunctionCallbackInfo& args) -{ - Isolate* isolate = args.GetIsolate(); - HandleScope scope(isolate); - try { - Lib3MFHandle hReturnObjectResource = nullptr; - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetObjectResource."); - if (wrapperTable->m_BuildItem_GetObjectResource == nullptr) - throw std::runtime_error("Could not call Lib3MF method BuildItem::GetObjectResource."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BuildItem_GetObjectResource(instanceHandle, &hReturnObjectResource); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjObjectResource = CLib3MFObject::NewInstance(args.Holder(), hReturnObjectResource); - args.GetReturnValue().Set(instanceObjObjectResource); - - } catch (std::exception & E) { - RaiseError(isolate, E.what()); - } -} - - -void CLib3MFBuildItem::GetUUID(const FunctionCallbackInfo& args) -{ - Isolate* isolate = args.GetIsolate(); - HandleScope scope(isolate); - try { - Local outObject = Object::New(isolate); - bool bReturnHasUUID = false; - unsigned int bytesNeededUUID = 0; - unsigned int bytesWrittenUUID = 0; - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetUUID."); - if (wrapperTable->m_BuildItem_GetUUID == nullptr) - throw std::runtime_error("Could not call Lib3MF method BuildItem::GetUUID."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult initErrorCode = wrapperTable->m_BuildItem_GetUUID(instanceHandle, &bReturnHasUUID, 0, &bytesNeededUUID, nullptr); - CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); - std::vector bufferUUID; - bufferUUID.resize(bytesNeededUUID); - Lib3MFResult errorCode = wrapperTable->m_BuildItem_GetUUID(instanceHandle, &bReturnHasUUID, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0]); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "HasUUID"), Boolean::New(isolate, bReturnHasUUID)); - outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "UUID"), String::NewFromUtf8(isolate, &bufferUUID[0])); - args.GetReturnValue().Set(outObject); - - } catch (std::exception & E) { - RaiseError(isolate, E.what()); - } -} - - -void CLib3MFBuildItem::SetUUID(const FunctionCallbackInfo& args) -{ - Isolate* isolate = args.GetIsolate(); - HandleScope scope(isolate); - try { - if (!args[0]->IsString()) { - throw std::runtime_error("Expected string parameter 0 (UUID)"); - } - v8::String::Utf8Value sutf8UUID(isolate, args[0]); - std::string sUUID = *sutf8UUID; - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetUUID."); - if (wrapperTable->m_BuildItem_SetUUID == nullptr) - throw std::runtime_error("Could not call Lib3MF method BuildItem::SetUUID."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BuildItem_SetUUID(instanceHandle, sUUID.c_str()); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - - } catch (std::exception & E) { - RaiseError(isolate, E.what()); - } -} - - -void CLib3MFBuildItem::GetObjectResourceID(const FunctionCallbackInfo& args) -{ - Isolate* isolate = args.GetIsolate(); - HandleScope scope(isolate); - try { - unsigned int nReturnUniqueResourceID = 0; - sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); - if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetObjectResourceID."); - if (wrapperTable->m_BuildItem_GetObjectResourceID == nullptr) - throw std::runtime_error("Could not call Lib3MF method BuildItem::GetObjectResourceID."); - Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BuildItem_GetObjectResourceID(instanceHandle, &nReturnUniqueResourceID); - CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnUniqueResourceID)); - - } catch (std::exception & E) { - RaiseError(isolate, E.what()); - } -} - - -void CLib3MFBuildItem::HasObjectTransform(const FunctionCallbackInfo& args) +void CLib3MFToolpath::GetUnits(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - bool bReturnHasTransform = false; + double dReturnUnits = 0.0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method HasObjectTransform."); - if (wrapperTable->m_BuildItem_HasObjectTransform == nullptr) - throw std::runtime_error("Could not call Lib3MF method BuildItem::HasObjectTransform."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetUnits."); + if (wrapperTable->m_Toolpath_GetUnits == nullptr) + throw std::runtime_error("Could not call Lib3MF method Toolpath::GetUnits."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BuildItem_HasObjectTransform(instanceHandle, &bReturnHasTransform); + Lib3MFResult errorCode = wrapperTable->m_Toolpath_GetUnits(instanceHandle, &dReturnUnits); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Boolean::New(isolate, bReturnHasTransform)); + args.GetReturnValue().Set(Number::New(isolate, dReturnUnits)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8267,21 +12651,21 @@ void CLib3MFBuildItem::HasObjectTransform(const FunctionCallbackInfo& arg } -void CLib3MFBuildItem::GetObjectTransform(const FunctionCallbackInfo& args) +void CLib3MFToolpath::GetLayerCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - sLib3MFTransform sReturnTransform; + unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetObjectTransform."); - if (wrapperTable->m_BuildItem_GetObjectTransform == nullptr) - throw std::runtime_error("Could not call Lib3MF method BuildItem::GetObjectTransform."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetLayerCount."); + if (wrapperTable->m_Toolpath_GetLayerCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method Toolpath::GetLayerCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BuildItem_GetObjectTransform(instanceHandle, &sReturnTransform); + Lib3MFResult errorCode = wrapperTable->m_Toolpath_GetLayerCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(convertLib3MFTransformToObject(isolate, sReturnTransform)); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8289,23 +12673,21 @@ void CLib3MFBuildItem::GetObjectTransform(const FunctionCallbackInfo& arg } -void CLib3MFBuildItem::SetObjectTransform(const FunctionCallbackInfo& args) +void CLib3MFToolpath::GetProfileCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsObject()) { - throw std::runtime_error("Expected struct parameter 0 (Transform)"); - } - sLib3MFTransform sTransform = convertObjectToLib3MFTransform(isolate, args[0]); + unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetObjectTransform."); - if (wrapperTable->m_BuildItem_SetObjectTransform == nullptr) - throw std::runtime_error("Could not call Lib3MF method BuildItem::SetObjectTransform."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetProfileCount."); + if (wrapperTable->m_Toolpath_GetProfileCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method Toolpath::GetProfileCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BuildItem_SetObjectTransform(instanceHandle, &sTransform); + Lib3MFResult errorCode = wrapperTable->m_Toolpath_GetProfileCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8313,26 +12695,39 @@ void CLib3MFBuildItem::SetObjectTransform(const FunctionCallbackInfo& arg } -void CLib3MFBuildItem::GetPartNumber(const FunctionCallbackInfo& args) +void CLib3MFToolpath::AddLayer(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - unsigned int bytesNeededPartNumber = 0; - unsigned int bytesWrittenPartNumber = 0; + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (ZMax)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (Path)"); + } + if (!args[2]->IsObject()) { + throw std::runtime_error("Expected class parameter 2 (ModelWriter)"); + } + unsigned int nZMax = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + v8::String::Utf8Value sutf8Path(isolate, args[1]); + std::string sPath = *sutf8Path; + Local objModelWriter = args[2]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); + CLib3MFWriter * instanceModelWriter = ObjectWrap::Unwrap(objModelWriter); + if (instanceModelWriter == nullptr) + throw std::runtime_error("Invalid Object parameter 2 (ModelWriter)"); + Lib3MFHandle hModelWriter = instanceModelWriter->getHandle( objModelWriter ); + Lib3MFHandle hReturnLayerData = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetPartNumber."); - if (wrapperTable->m_BuildItem_GetPartNumber == nullptr) - throw std::runtime_error("Could not call Lib3MF method BuildItem::GetPartNumber."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddLayer."); + if (wrapperTable->m_Toolpath_AddLayer == nullptr) + throw std::runtime_error("Could not call Lib3MF method Toolpath::AddLayer."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult initErrorCode = wrapperTable->m_BuildItem_GetPartNumber(instanceHandle, 0, &bytesNeededPartNumber, nullptr); - CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); - std::vector bufferPartNumber; - bufferPartNumber.resize(bytesNeededPartNumber); - Lib3MFResult errorCode = wrapperTable->m_BuildItem_GetPartNumber(instanceHandle, bytesNeededPartNumber, &bytesWrittenPartNumber, &bufferPartNumber[0]); + Lib3MFResult errorCode = wrapperTable->m_Toolpath_AddLayer(instanceHandle, nZMax, sPath.c_str(), hModelWriter, &hReturnLayerData); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferPartNumber[0])); + Local instanceObjLayerData = CLib3MFToolpathLayerData::NewInstance(args.Holder(), hReturnLayerData); + args.GetReturnValue().Set(instanceObjLayerData); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8340,24 +12735,26 @@ void CLib3MFBuildItem::GetPartNumber(const FunctionCallbackInfo& args) } -void CLib3MFBuildItem::SetPartNumber(const FunctionCallbackInfo& args) +void CLib3MFToolpath::GetLayerAttachment(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsString()) { - throw std::runtime_error("Expected string parameter 0 (SetPartnumber)"); + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); } - v8::String::Utf8Value sutf8SetPartnumber(isolate, args[0]); - std::string sSetPartnumber = *sutf8SetPartnumber; + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + Lib3MFHandle hReturnAttachment = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetPartNumber."); - if (wrapperTable->m_BuildItem_SetPartNumber == nullptr) - throw std::runtime_error("Could not call Lib3MF method BuildItem::SetPartNumber."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetLayerAttachment."); + if (wrapperTable->m_Toolpath_GetLayerAttachment == nullptr) + throw std::runtime_error("Could not call Lib3MF method Toolpath::GetLayerAttachment."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BuildItem_SetPartNumber(instanceHandle, sSetPartnumber.c_str()); + Lib3MFResult errorCode = wrapperTable->m_Toolpath_GetLayerAttachment(instanceHandle, nIndex, &hReturnAttachment); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjAttachment = CLib3MFAttachment::NewInstance(args.Holder(), hReturnAttachment); + args.GetReturnValue().Set(instanceObjAttachment); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8365,22 +12762,26 @@ void CLib3MFBuildItem::SetPartNumber(const FunctionCallbackInfo& args) } -void CLib3MFBuildItem::GetMetaDataGroup(const FunctionCallbackInfo& args) +void CLib3MFToolpath::ReadLayerData(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnMetaDataGroup = nullptr; + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + Lib3MFHandle hReturnToolpathReader = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetMetaDataGroup."); - if (wrapperTable->m_BuildItem_GetMetaDataGroup == nullptr) - throw std::runtime_error("Could not call Lib3MF method BuildItem::GetMetaDataGroup."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method ReadLayerData."); + if (wrapperTable->m_Toolpath_ReadLayerData == nullptr) + throw std::runtime_error("Could not call Lib3MF method Toolpath::ReadLayerData."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BuildItem_GetMetaDataGroup(instanceHandle, &hReturnMetaDataGroup); + Lib3MFResult errorCode = wrapperTable->m_Toolpath_ReadLayerData(instanceHandle, nIndex, &hReturnToolpathReader); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjMetaDataGroup = CLib3MFMetaDataGroup::NewInstance(args.Holder(), hReturnMetaDataGroup); - args.GetReturnValue().Set(instanceObjMetaDataGroup); + Local instanceObjToolpathReader = CLib3MFToolpathLayerReader::NewInstance(args.Holder(), hReturnToolpathReader); + args.GetReturnValue().Set(instanceObjToolpathReader); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8388,103 +12789,82 @@ void CLib3MFBuildItem::GetMetaDataGroup(const FunctionCallbackInfo& args) } -void CLib3MFBuildItem::GetOutbox(const FunctionCallbackInfo& args) +void CLib3MFToolpath::GetLayerPath(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - sLib3MFBox sReturnOutbox; + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int bytesNeededPath = 0; + unsigned int bytesWrittenPath = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetOutbox."); - if (wrapperTable->m_BuildItem_GetOutbox == nullptr) - throw std::runtime_error("Could not call Lib3MF method BuildItem::GetOutbox."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetLayerPath."); + if (wrapperTable->m_Toolpath_GetLayerPath == nullptr) + throw std::runtime_error("Could not call Lib3MF method Toolpath::GetLayerPath."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BuildItem_GetOutbox(instanceHandle, &sReturnOutbox); + Lib3MFResult initErrorCode = wrapperTable->m_Toolpath_GetLayerPath(instanceHandle, nIndex, 0, &bytesNeededPath, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferPath; + bufferPath.resize(bytesNeededPath); + Lib3MFResult errorCode = wrapperTable->m_Toolpath_GetLayerPath(instanceHandle, nIndex, bytesNeededPath, &bytesWrittenPath, &bufferPath[0]); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(convertLib3MFBoxToObject(isolate, sReturnOutbox)); + args.GetReturnValue().Set(String::NewFromUtf8(isolate, &bufferPath[0])); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } -/************************************************************************************************************************* - Class CLib3MFBuildItemIterator Implementation -**************************************************************************************************************************/ - -CLib3MFBuildItemIterator::CLib3MFBuildItemIterator() - : CLib3MFBaseClass() -{ -} - -CLib3MFBuildItemIterator::~CLib3MFBuildItemIterator() -{ -} - -void CLib3MFBuildItemIterator::Init() -{ - Isolate* isolate = Isolate::GetCurrent(); - - // Prepare constructor template - Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFBuildItemIterator")); - tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); - - // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "MoveNext", MoveNext); - NODE_SET_PROTOTYPE_METHOD(tpl, "MovePrevious", MovePrevious); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetCurrent", GetCurrent); - NODE_SET_PROTOTYPE_METHOD(tpl, "Clone", Clone); - NODE_SET_PROTOTYPE_METHOD(tpl, "Count", Count); - constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); - -} -void CLib3MFBuildItemIterator::New(const FunctionCallbackInfo& args) +void CLib3MFToolpath::GetLayerZMax(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int nReturnZMax = 0; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetLayerZMax."); + if (wrapperTable->m_Toolpath_GetLayerZMax == nullptr) + throw std::runtime_error("Could not call Lib3MF method Toolpath::GetLayerZMax."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Toolpath_GetLayerZMax(instanceHandle, nIndex, &nReturnZMax); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnZMax)); - if (args.IsConstructCall()) { - CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFBuildItemIterator * builditemiteratorInstance = new CLib3MFBuildItemIterator(); - builditemiteratorInstance->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - RaiseError(isolate, "Lib3MFBuildItemIterator: Invalid call to Constructor"); - } -} - -Local CLib3MFBuildItemIterator::NewInstance(Local pParent, Lib3MFHandle pHandle) -{ - Isolate* isolate = Isolate::GetCurrent(); - HandleScope scope(isolate); - Local cons = Local::New(isolate, constructor); - Local instance; - if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { - instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); - instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } - return instance; } -void CLib3MFBuildItemIterator::MoveNext(const FunctionCallbackInfo& args) +void CLib3MFToolpath::GetLayerZ(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - bool bReturnHasNext = false; + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (LayerIndex)"); + } + unsigned int nLayerIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int nReturnZValue = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method MoveNext."); - if (wrapperTable->m_BuildItemIterator_MoveNext == nullptr) - throw std::runtime_error("Could not call Lib3MF method BuildItemIterator::MoveNext."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetLayerZ."); + if (wrapperTable->m_Toolpath_GetLayerZ == nullptr) + throw std::runtime_error("Could not call Lib3MF method Toolpath::GetLayerZ."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BuildItemIterator_MoveNext(instanceHandle, &bReturnHasNext); + Lib3MFResult errorCode = wrapperTable->m_Toolpath_GetLayerZ(instanceHandle, nLayerIndex, &nReturnZValue); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Boolean::New(isolate, bReturnHasNext)); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnZValue)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8492,21 +12872,27 @@ void CLib3MFBuildItemIterator::MoveNext(const FunctionCallbackInfo& args) } -void CLib3MFBuildItemIterator::MovePrevious(const FunctionCallbackInfo& args) +void CLib3MFToolpath::AddProfile(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - bool bReturnHasPrevious = false; + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Name)"); + } + v8::String::Utf8Value sutf8Name(isolate, args[0]); + std::string sName = *sutf8Name; + Lib3MFHandle hReturnProfile = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method MovePrevious."); - if (wrapperTable->m_BuildItemIterator_MovePrevious == nullptr) - throw std::runtime_error("Could not call Lib3MF method BuildItemIterator::MovePrevious."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddProfile."); + if (wrapperTable->m_Toolpath_AddProfile == nullptr) + throw std::runtime_error("Could not call Lib3MF method Toolpath::AddProfile."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BuildItemIterator_MovePrevious(instanceHandle, &bReturnHasPrevious); + Lib3MFResult errorCode = wrapperTable->m_Toolpath_AddProfile(instanceHandle, sName.c_str(), &hReturnProfile); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Boolean::New(isolate, bReturnHasPrevious)); + Local instanceObjProfile = CLib3MFToolpathProfile::NewInstance(args.Holder(), hReturnProfile); + args.GetReturnValue().Set(instanceObjProfile); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8514,22 +12900,26 @@ void CLib3MFBuildItemIterator::MovePrevious(const FunctionCallbackInfo& a } -void CLib3MFBuildItemIterator::GetCurrent(const FunctionCallbackInfo& args) +void CLib3MFToolpath::GetProfile(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnBuildItem = nullptr; + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (ProfileIndex)"); + } + unsigned int nProfileIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + Lib3MFHandle hReturnProfile = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCurrent."); - if (wrapperTable->m_BuildItemIterator_GetCurrent == nullptr) - throw std::runtime_error("Could not call Lib3MF method BuildItemIterator::GetCurrent."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetProfile."); + if (wrapperTable->m_Toolpath_GetProfile == nullptr) + throw std::runtime_error("Could not call Lib3MF method Toolpath::GetProfile."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BuildItemIterator_GetCurrent(instanceHandle, &hReturnBuildItem); + Lib3MFResult errorCode = wrapperTable->m_Toolpath_GetProfile(instanceHandle, nProfileIndex, &hReturnProfile); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjBuildItem = CLib3MFBuildItem::NewInstance(args.Holder(), hReturnBuildItem); - args.GetReturnValue().Set(instanceObjBuildItem); + Local instanceObjProfile = CLib3MFToolpathProfile::NewInstance(args.Holder(), hReturnProfile); + args.GetReturnValue().Set(instanceObjProfile); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8537,22 +12927,27 @@ void CLib3MFBuildItemIterator::GetCurrent(const FunctionCallbackInfo& arg } -void CLib3MFBuildItemIterator::Clone(const FunctionCallbackInfo& args) +void CLib3MFToolpath::GetProfileUUID(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - Lib3MFHandle hReturnOutBuildItemIterator = nullptr; + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (ProfileUUID)"); + } + v8::String::Utf8Value sutf8ProfileUUID(isolate, args[0]); + std::string sProfileUUID = *sutf8ProfileUUID; + Lib3MFHandle hReturnProfile = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method Clone."); - if (wrapperTable->m_BuildItemIterator_Clone == nullptr) - throw std::runtime_error("Could not call Lib3MF method BuildItemIterator::Clone."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetProfileUUID."); + if (wrapperTable->m_Toolpath_GetProfileUUID == nullptr) + throw std::runtime_error("Could not call Lib3MF method Toolpath::GetProfileUUID."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BuildItemIterator_Clone(instanceHandle, &hReturnOutBuildItemIterator); + Lib3MFResult errorCode = wrapperTable->m_Toolpath_GetProfileUUID(instanceHandle, sProfileUUID.c_str(), &hReturnProfile); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - Local instanceObjOutBuildItemIterator = CLib3MFBuildItemIterator::NewInstance(args.Holder(), hReturnOutBuildItemIterator); - args.GetReturnValue().Set(instanceObjOutBuildItemIterator); + Local instanceObjProfile = CLib3MFToolpathProfile::NewInstance(args.Holder(), hReturnProfile); + args.GetReturnValue().Set(instanceObjProfile); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8560,105 +12955,86 @@ void CLib3MFBuildItemIterator::Clone(const FunctionCallbackInfo& args) } -void CLib3MFBuildItemIterator::Count(const FunctionCallbackInfo& args) +void CLib3MFToolpath::GetCustomDataCount(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - uint64_t nReturnCount = 0; + unsigned int nReturnCount = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method Count."); - if (wrapperTable->m_BuildItemIterator_Count == nullptr) - throw std::runtime_error("Could not call Lib3MF method BuildItemIterator::Count."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCustomDataCount."); + if (wrapperTable->m_Toolpath_GetCustomDataCount == nullptr) + throw std::runtime_error("Could not call Lib3MF method Toolpath::GetCustomDataCount."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_BuildItemIterator_Count(instanceHandle, &nReturnCount); + Lib3MFResult errorCode = wrapperTable->m_Toolpath_GetCustomDataCount(instanceHandle, &nReturnCount); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, std::to_string(nReturnCount).c_str())); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnCount)); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } -/************************************************************************************************************************* - Class CLib3MFSlice Implementation -**************************************************************************************************************************/ - -CLib3MFSlice::CLib3MFSlice() - : CLib3MFBaseClass() -{ -} - -CLib3MFSlice::~CLib3MFSlice() -{ -} - -void CLib3MFSlice::Init() -{ - Isolate* isolate = Isolate::GetCurrent(); - - // Prepare constructor template - Local tpl = FunctionTemplate::New(isolate, New); - tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFSlice")); - tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); - - // Prototype - NODE_SET_PROTOTYPE_METHOD(tpl, "SetVertices", SetVertices); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetVertices", GetVertices); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetVertexCount", GetVertexCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "AddPolygon", AddPolygon); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetPolygonCount", GetPolygonCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "SetPolygonIndices", SetPolygonIndices); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetPolygonIndices", GetPolygonIndices); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetPolygonIndexCount", GetPolygonIndexCount); - NODE_SET_PROTOTYPE_METHOD(tpl, "GetZTop", GetZTop); - constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); - -} -void CLib3MFSlice::New(const FunctionCallbackInfo& args) +void CLib3MFToolpath::GetCustomData(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); + try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + Lib3MFHandle hReturnData = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCustomData."); + if (wrapperTable->m_Toolpath_GetCustomData == nullptr) + throw std::runtime_error("Could not call Lib3MF method Toolpath::GetCustomData."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Toolpath_GetCustomData(instanceHandle, nIndex, &hReturnData); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjData = CLib3MFCustomDOMTree::NewInstance(args.Holder(), hReturnData); + args.GetReturnValue().Set(instanceObjData); - if (args.IsConstructCall()) { - CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); - CLib3MFSlice * sliceInstance = new CLib3MFSlice(); - sliceInstance->Wrap(args.This()); - args.GetReturnValue().Set(args.This()); - } else { - RaiseError(isolate, "Lib3MFSlice: Invalid call to Constructor"); - } -} - -Local CLib3MFSlice::NewInstance(Local pParent, Lib3MFHandle pHandle) -{ - Isolate* isolate = Isolate::GetCurrent(); - HandleScope scope(isolate); - Local cons = Local::New(isolate, constructor); - Local instance; - if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { - instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); - instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } catch (std::exception & E) { + RaiseError(isolate, E.what()); } - return instance; } -void CLib3MFSlice::SetVertices(const FunctionCallbackInfo& args) +void CLib3MFToolpath::GetCustomDataName(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + if (!args[0]->IsUint32()) { + throw std::runtime_error("Expected uint32 parameter 0 (Index)"); + } + Local outObject = Object::New(isolate); + unsigned int nIndex = (unsigned int) args[0]->IntegerValue(isolate->GetCurrentContext()).ToChecked(); + unsigned int bytesNeededNameSpace = 0; + unsigned int bytesWrittenNameSpace = 0; + unsigned int bytesNeededDataName = 0; + unsigned int bytesWrittenDataName = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetVertices."); - if (wrapperTable->m_Slice_SetVertices == nullptr) - throw std::runtime_error("Could not call Lib3MF method Slice::SetVertices."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCustomDataName."); + if (wrapperTable->m_Toolpath_GetCustomDataName == nullptr) + throw std::runtime_error("Could not call Lib3MF method Toolpath::GetCustomDataName."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Slice_SetVertices(instanceHandle, 0, nullptr); + Lib3MFResult initErrorCode = wrapperTable->m_Toolpath_GetCustomDataName(instanceHandle, nIndex, 0, &bytesNeededNameSpace, nullptr, 0, &bytesNeededDataName, nullptr); + CheckError(isolate, wrapperTable, instanceHandle, initErrorCode); + std::vector bufferNameSpace; + bufferNameSpace.resize(bytesNeededNameSpace); + std::vector bufferDataName; + bufferDataName.resize(bytesNeededDataName); + Lib3MFResult errorCode = wrapperTable->m_Toolpath_GetCustomDataName(instanceHandle, nIndex, bytesNeededNameSpace, &bytesWrittenNameSpace, &bufferNameSpace[0], bytesNeededDataName, &bytesWrittenDataName, &bufferDataName[0]); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "NameSpace"), String::NewFromUtf8(isolate, &bufferNameSpace[0])); + outObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "DataName"), String::NewFromUtf8(isolate, &bufferDataName[0])); + args.GetReturnValue().Set(outObject); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8666,19 +13042,31 @@ void CLib3MFSlice::SetVertices(const FunctionCallbackInfo& args) } -void CLib3MFSlice::GetVertices(const FunctionCallbackInfo& args) +void CLib3MFToolpath::HasUniqueCustomData(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (NameSpace)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (DataName)"); + } + v8::String::Utf8Value sutf8NameSpace(isolate, args[0]); + std::string sNameSpace = *sutf8NameSpace; + v8::String::Utf8Value sutf8DataName(isolate, args[1]); + std::string sDataName = *sutf8DataName; + bool bReturnCustomDataExists = false; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetVertices."); - if (wrapperTable->m_Slice_GetVertices == nullptr) - throw std::runtime_error("Could not call Lib3MF method Slice::GetVertices."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method HasUniqueCustomData."); + if (wrapperTable->m_Toolpath_HasUniqueCustomData == nullptr) + throw std::runtime_error("Could not call Lib3MF method Toolpath::HasUniqueCustomData."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Slice_GetVertices(instanceHandle, 0, nullptr, nullptr); + Lib3MFResult errorCode = wrapperTable->m_Toolpath_HasUniqueCustomData(instanceHandle, sNameSpace.c_str(), sDataName.c_str(), &bReturnCustomDataExists); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnCustomDataExists)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8686,21 +13074,32 @@ void CLib3MFSlice::GetVertices(const FunctionCallbackInfo& args) } -void CLib3MFSlice::GetVertexCount(const FunctionCallbackInfo& args) +void CLib3MFToolpath::FindUniqueCustomData(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - uint64_t nReturnCount = 0; + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (NameSpace)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (DataName)"); + } + v8::String::Utf8Value sutf8NameSpace(isolate, args[0]); + std::string sNameSpace = *sutf8NameSpace; + v8::String::Utf8Value sutf8DataName(isolate, args[1]); + std::string sDataName = *sutf8DataName; + Lib3MFHandle hReturnData = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetVertexCount."); - if (wrapperTable->m_Slice_GetVertexCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method Slice::GetVertexCount."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method FindUniqueCustomData."); + if (wrapperTable->m_Toolpath_FindUniqueCustomData == nullptr) + throw std::runtime_error("Could not call Lib3MF method Toolpath::FindUniqueCustomData."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Slice_GetVertexCount(instanceHandle, &nReturnCount); + Lib3MFResult errorCode = wrapperTable->m_Toolpath_FindUniqueCustomData(instanceHandle, sNameSpace.c_str(), sDataName.c_str(), &hReturnData); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, std::to_string(nReturnCount).c_str())); + Local instanceObjData = CLib3MFCustomDOMTree::NewInstance(args.Holder(), hReturnData); + args.GetReturnValue().Set(instanceObjData); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8708,21 +13107,32 @@ void CLib3MFSlice::GetVertexCount(const FunctionCallbackInfo& args) } -void CLib3MFSlice::AddPolygon(const FunctionCallbackInfo& args) +void CLib3MFToolpath::AddCustomData(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - uint64_t nReturnIndex = 0; + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (NameSpace)"); + } + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (DataName)"); + } + v8::String::Utf8Value sutf8NameSpace(isolate, args[0]); + std::string sNameSpace = *sutf8NameSpace; + v8::String::Utf8Value sutf8DataName(isolate, args[1]); + std::string sDataName = *sutf8DataName; + Lib3MFHandle hReturnData = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method AddPolygon."); - if (wrapperTable->m_Slice_AddPolygon == nullptr) - throw std::runtime_error("Could not call Lib3MF method Slice::AddPolygon."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddCustomData."); + if (wrapperTable->m_Toolpath_AddCustomData == nullptr) + throw std::runtime_error("Could not call Lib3MF method Toolpath::AddCustomData."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Slice_AddPolygon(instanceHandle, 0, nullptr, &nReturnIndex); + Lib3MFResult errorCode = wrapperTable->m_Toolpath_AddCustomData(instanceHandle, sNameSpace.c_str(), sDataName.c_str(), &hReturnData); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, std::to_string(nReturnIndex).c_str())); + Local instanceObjData = CLib3MFCustomDOMTree::NewInstance(args.Holder(), hReturnData); + args.GetReturnValue().Set(instanceObjData); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8730,21 +13140,21 @@ void CLib3MFSlice::AddPolygon(const FunctionCallbackInfo& args) } -void CLib3MFSlice::GetPolygonCount(const FunctionCallbackInfo& args) +void CLib3MFToolpath::ClearCustomData(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - uint64_t nReturnCount = 0; + unsigned int nReturnNumberOfDeletedItems = 0; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetPolygonCount."); - if (wrapperTable->m_Slice_GetPolygonCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method Slice::GetPolygonCount."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method ClearCustomData."); + if (wrapperTable->m_Toolpath_ClearCustomData == nullptr) + throw std::runtime_error("Could not call Lib3MF method Toolpath::ClearCustomData."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Slice_GetPolygonCount(instanceHandle, &nReturnCount); + Lib3MFResult errorCode = wrapperTable->m_Toolpath_ClearCustomData(instanceHandle, &nReturnNumberOfDeletedItems); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, std::to_string(nReturnCount).c_str())); + args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, nReturnNumberOfDeletedItems)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8752,25 +13162,29 @@ void CLib3MFSlice::GetPolygonCount(const FunctionCallbackInfo& args) } -void CLib3MFSlice::SetPolygonIndices(const FunctionCallbackInfo& args) +void CLib3MFToolpath::DeleteCustomData(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - if (!args[0]->IsString()) { - throw std::runtime_error("Expected uint64 parameter 0 (Index)"); + if (!args[0]->IsObject()) { + throw std::runtime_error("Expected class parameter 0 (Data)"); } - v8::String::Utf8Value sutf8Index(isolate, args[0]); - std::string sIndex = *sutf8Index; - uint64_t nIndex = stoull(sIndex); + Local objData = args[0]->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); + CLib3MFCustomDOMTree * instanceData = ObjectWrap::Unwrap(objData); + if (instanceData == nullptr) + throw std::runtime_error("Invalid Object parameter 0 (Data)"); + Lib3MFHandle hData = instanceData->getHandle( objData ); + bool bReturnSuccess = false; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method SetPolygonIndices."); - if (wrapperTable->m_Slice_SetPolygonIndices == nullptr) - throw std::runtime_error("Could not call Lib3MF method Slice::SetPolygonIndices."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method DeleteCustomData."); + if (wrapperTable->m_Toolpath_DeleteCustomData == nullptr) + throw std::runtime_error("Could not call Lib3MF method Toolpath::DeleteCustomData."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Slice_SetPolygonIndices(instanceHandle, nIndex, 0, nullptr); + Lib3MFResult errorCode = wrapperTable->m_Toolpath_DeleteCustomData(instanceHandle, hData, &bReturnSuccess); CheckError(isolate, wrapperTable, instanceHandle, errorCode); + args.GetReturnValue().Set(Boolean::New(isolate, bReturnSuccess)); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -8778,24 +13192,28 @@ void CLib3MFSlice::SetPolygonIndices(const FunctionCallbackInfo& args) } -void CLib3MFSlice::GetPolygonIndices(const FunctionCallbackInfo& args) +void CLib3MFToolpath::RegisterCustomIntegerAttribute(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { if (!args[0]->IsString()) { - throw std::runtime_error("Expected uint64 parameter 0 (Index)"); + throw std::runtime_error("Expected string parameter 0 (NameSpace)"); } - v8::String::Utf8Value sutf8Index(isolate, args[0]); - std::string sIndex = *sutf8Index; - uint64_t nIndex = stoull(sIndex); + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (AttributeName)"); + } + v8::String::Utf8Value sutf8NameSpace(isolate, args[0]); + std::string sNameSpace = *sutf8NameSpace; + v8::String::Utf8Value sutf8AttributeName(isolate, args[1]); + std::string sAttributeName = *sutf8AttributeName; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetPolygonIndices."); - if (wrapperTable->m_Slice_GetPolygonIndices == nullptr) - throw std::runtime_error("Could not call Lib3MF method Slice::GetPolygonIndices."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method RegisterCustomIntegerAttribute."); + if (wrapperTable->m_Toolpath_RegisterCustomIntegerAttribute == nullptr) + throw std::runtime_error("Could not call Lib3MF method Toolpath::RegisterCustomIntegerAttribute."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Slice_GetPolygonIndices(instanceHandle, nIndex, 0, nullptr, nullptr); + Lib3MFResult errorCode = wrapperTable->m_Toolpath_RegisterCustomIntegerAttribute(instanceHandle, sNameSpace.c_str(), sAttributeName.c_str()); CheckError(isolate, wrapperTable, instanceHandle, errorCode); } catch (std::exception & E) { @@ -8804,49 +13222,108 @@ void CLib3MFSlice::GetPolygonIndices(const FunctionCallbackInfo& args) } -void CLib3MFSlice::GetPolygonIndexCount(const FunctionCallbackInfo& args) +void CLib3MFToolpath::RegisterCustomDoubleAttribute(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { if (!args[0]->IsString()) { - throw std::runtime_error("Expected uint64 parameter 0 (Index)"); + throw std::runtime_error("Expected string parameter 0 (NameSpace)"); } - v8::String::Utf8Value sutf8Index(isolate, args[0]); - std::string sIndex = *sutf8Index; - uint64_t nIndex = stoull(sIndex); - uint64_t nReturnCount = 0; + if (!args[1]->IsString()) { + throw std::runtime_error("Expected string parameter 1 (AttributeName)"); + } + v8::String::Utf8Value sutf8NameSpace(isolate, args[0]); + std::string sNameSpace = *sutf8NameSpace; + v8::String::Utf8Value sutf8AttributeName(isolate, args[1]); + std::string sAttributeName = *sutf8AttributeName; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetPolygonIndexCount."); - if (wrapperTable->m_Slice_GetPolygonIndexCount == nullptr) - throw std::runtime_error("Could not call Lib3MF method Slice::GetPolygonIndexCount."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method RegisterCustomDoubleAttribute."); + if (wrapperTable->m_Toolpath_RegisterCustomDoubleAttribute == nullptr) + throw std::runtime_error("Could not call Lib3MF method Toolpath::RegisterCustomDoubleAttribute."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Slice_GetPolygonIndexCount(instanceHandle, nIndex, &nReturnCount); + Lib3MFResult errorCode = wrapperTable->m_Toolpath_RegisterCustomDoubleAttribute(instanceHandle, sNameSpace.c_str(), sAttributeName.c_str()); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(String::NewFromUtf8(isolate, std::to_string(nReturnCount).c_str())); } catch (std::exception & E) { RaiseError(isolate, E.what()); } } +/************************************************************************************************************************* + Class CLib3MFToolpathIterator Implementation +**************************************************************************************************************************/ -void CLib3MFSlice::GetZTop(const FunctionCallbackInfo& args) +CLib3MFToolpathIterator::CLib3MFToolpathIterator() + : CLib3MFBaseClass() +{ +} + +CLib3MFToolpathIterator::~CLib3MFToolpathIterator() +{ +} + +void CLib3MFToolpathIterator::Init() +{ + Isolate* isolate = Isolate::GetCurrent(); + + // Prepare constructor template + Local tpl = FunctionTemplate::New(isolate, New); + tpl->SetClassName(String::NewFromUtf8(isolate, "Lib3MFToolpathIterator")); + tpl->InstanceTemplate()->SetInternalFieldCount(NODEWRAPPER_FIELDCOUNT); + + // Prototype + NODE_SET_PROTOTYPE_METHOD(tpl, "GetCurrentToolpath", GetCurrentToolpath); + constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); + +} + +void CLib3MFToolpathIterator::New(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + + if (args.IsConstructCall()) { + CLib3MFBaseClass * holderObj = ObjectWrap::Unwrap(args.Holder()); + CLib3MFToolpathIterator * toolpathiteratorInstance = new CLib3MFToolpathIterator(); + toolpathiteratorInstance->Wrap(args.This()); + args.GetReturnValue().Set(args.This()); + } else { + RaiseError(isolate, "Lib3MFToolpathIterator: Invalid call to Constructor"); + } +} + +Local CLib3MFToolpathIterator::NewInstance(Local pParent, Lib3MFHandle pHandle) +{ + Isolate* isolate = Isolate::GetCurrent(); + HandleScope scope(isolate); + Local cons = Local::New(isolate, constructor); + Local instance; + if (cons->NewInstance(isolate->GetCurrentContext()).ToLocal(&instance)) { + instance->SetInternalField(NODEWRAPPER_TABLEINDEX, External::New(isolate, CLib3MFBaseClass::getDynamicWrapperTable(pParent))); + instance->SetInternalField(NODEWRAPPER_HANDLEINDEX, External::New(isolate, pHandle)); + } + return instance; +} + + +void CLib3MFToolpathIterator::GetCurrentToolpath(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); HandleScope scope(isolate); try { - double dReturnZTop = 0.0; + Lib3MFHandle hReturnResource = nullptr; sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); if (wrapperTable == nullptr) - throw std::runtime_error("Could not get wrapper table for Lib3MF method GetZTop."); - if (wrapperTable->m_Slice_GetZTop == nullptr) - throw std::runtime_error("Could not call Lib3MF method Slice::GetZTop."); + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetCurrentToolpath."); + if (wrapperTable->m_ToolpathIterator_GetCurrentToolpath == nullptr) + throw std::runtime_error("Could not call Lib3MF method ToolpathIterator::GetCurrentToolpath."); Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); - Lib3MFResult errorCode = wrapperTable->m_Slice_GetZTop(instanceHandle, &dReturnZTop); + Lib3MFResult errorCode = wrapperTable->m_ToolpathIterator_GetCurrentToolpath(instanceHandle, &hReturnResource); CheckError(isolate, wrapperTable, instanceHandle, errorCode); - args.GetReturnValue().Set(Number::New(isolate, dReturnZTop)); + Local instanceObjResource = CLib3MFToolpath::NewInstance(args.Holder(), hReturnResource); + args.GetReturnValue().Set(instanceObjResource); } catch (std::exception & E) { RaiseError(isolate, E.what()); @@ -10643,6 +15120,7 @@ void CLib3MFModel::Init() NODE_SET_PROTOTYPE_METHOD(tpl, "GetTexture2DGroups", GetTexture2DGroups); NODE_SET_PROTOTYPE_METHOD(tpl, "GetCompositeMaterials", GetCompositeMaterials); NODE_SET_PROTOTYPE_METHOD(tpl, "GetMultiPropertyGroups", GetMultiPropertyGroups); + NODE_SET_PROTOTYPE_METHOD(tpl, "GetToolpaths", GetToolpaths); NODE_SET_PROTOTYPE_METHOD(tpl, "GetSliceStacks", GetSliceStacks); NODE_SET_PROTOTYPE_METHOD(tpl, "MergeToModel", MergeToModel); NODE_SET_PROTOTYPE_METHOD(tpl, "AddMeshObject", AddMeshObject); @@ -10656,6 +15134,7 @@ void CLib3MFModel::Init() NODE_SET_PROTOTYPE_METHOD(tpl, "AddMultiPropertyGroup", AddMultiPropertyGroup); NODE_SET_PROTOTYPE_METHOD(tpl, "AddBuildItem", AddBuildItem); NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveBuildItem", RemoveBuildItem); + NODE_SET_PROTOTYPE_METHOD(tpl, "AddToolpath", AddToolpath); NODE_SET_PROTOTYPE_METHOD(tpl, "GetMetaDataGroup", GetMetaDataGroup); NODE_SET_PROTOTYPE_METHOD(tpl, "AddAttachment", AddAttachment); NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveAttachment", RemoveAttachment); @@ -10670,6 +15149,9 @@ void CLib3MFModel::Init() NODE_SET_PROTOTYPE_METHOD(tpl, "RemoveCustomContentType", RemoveCustomContentType); NODE_SET_PROTOTYPE_METHOD(tpl, "SetRandomNumberCallback", SetRandomNumberCallback); NODE_SET_PROTOTYPE_METHOD(tpl, "GetKeyStore", GetKeyStore); + NODE_SET_PROTOTYPE_METHOD(tpl, "CreatePersistentSourceFromFile", CreatePersistentSourceFromFile); + NODE_SET_PROTOTYPE_METHOD(tpl, "CreatePersistentSourceFromBuffer", CreatePersistentSourceFromBuffer); + NODE_SET_PROTOTYPE_METHOD(tpl, "CreatePersistentSourceFromCallback", CreatePersistentSourceFromCallback); constructor.Reset(isolate, tpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked()); } @@ -11535,6 +16017,29 @@ void CLib3MFModel::GetMultiPropertyGroups(const FunctionCallbackInfo& arg } +void CLib3MFModel::GetToolpaths(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnResourceIterator = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method GetToolpaths."); + if (wrapperTable->m_Model_GetToolpaths == nullptr) + throw std::runtime_error("Could not call Lib3MF method Model::GetToolpaths."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Model_GetToolpaths(instanceHandle, &hReturnResourceIterator); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjResourceIterator = CLib3MFToolpathIterator::NewInstance(args.Holder(), hReturnResourceIterator); + args.GetReturnValue().Set(instanceObjResourceIterator); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + void CLib3MFModel::GetSliceStacks(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); @@ -11879,6 +16384,33 @@ void CLib3MFModel::RemoveBuildItem(const FunctionCallbackInfo& args) } +void CLib3MFModel::AddToolpath(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsNumber()) { + throw std::runtime_error("Expected double parameter 0 (UnitFactor)"); + } + double dUnitFactor = (double) args[0]->NumberValue(isolate->GetCurrentContext()).ToChecked(); + Lib3MFHandle hReturnToolpathInstance = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method AddToolpath."); + if (wrapperTable->m_Model_AddToolpath == nullptr) + throw std::runtime_error("Could not call Lib3MF method Model::AddToolpath."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Model_AddToolpath(instanceHandle, dUnitFactor, &hReturnToolpathInstance); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjToolpathInstance = CLib3MFToolpath::NewInstance(args.Holder(), hReturnToolpathInstance); + args.GetReturnValue().Set(instanceObjToolpathInstance); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + void CLib3MFModel::GetMetaDataGroup(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); @@ -12231,6 +16763,92 @@ void CLib3MFModel::GetKeyStore(const FunctionCallbackInfo& args) } } + +void CLib3MFModel::CreatePersistentSourceFromFile(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[0]->IsString()) { + throw std::runtime_error("Expected string parameter 0 (Filename)"); + } + v8::String::Utf8Value sutf8Filename(isolate, args[0]); + std::string sFilename = *sutf8Filename; + Lib3MFHandle hReturnInstance = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method CreatePersistentSourceFromFile."); + if (wrapperTable->m_Model_CreatePersistentSourceFromFile == nullptr) + throw std::runtime_error("Could not call Lib3MF method Model::CreatePersistentSourceFromFile."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Model_CreatePersistentSourceFromFile(instanceHandle, sFilename.c_str(), &hReturnInstance); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjInstance = CLib3MFPersistentReaderSource::NewInstance(args.Holder(), hReturnInstance); + args.GetReturnValue().Set(instanceObjInstance); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFModel::CreatePersistentSourceFromBuffer(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + Lib3MFHandle hReturnInstance = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method CreatePersistentSourceFromBuffer."); + if (wrapperTable->m_Model_CreatePersistentSourceFromBuffer == nullptr) + throw std::runtime_error("Could not call Lib3MF method Model::CreatePersistentSourceFromBuffer."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Model_CreatePersistentSourceFromBuffer(instanceHandle, 0, nullptr, &hReturnInstance); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjInstance = CLib3MFPersistentReaderSource::NewInstance(args.Holder(), hReturnInstance); + args.GetReturnValue().Set(instanceObjInstance); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + + +void CLib3MFModel::CreatePersistentSourceFromCallback(const FunctionCallbackInfo& args) +{ + Isolate* isolate = args.GetIsolate(); + HandleScope scope(isolate); + try { + if (!args[1]->IsString()) { + throw std::runtime_error("Expected uint64 parameter 1 (StreamSize)"); + } + if (!args[3]->IsString()) { + throw std::runtime_error("Expected pointer parameter 3 (UserData)"); + } + v8::String::Utf8Value sutf8StreamSize(isolate, args[1]); + std::string sStreamSize = *sutf8StreamSize; + uint64_t nStreamSize = stoull(sStreamSize); + v8::String::Utf8Value sutf8UserData(isolate, args[3]); + std::string sUserData = *sutf8UserData; + uint64_t nUserData = stoull(sUserData); + Lib3MFHandle hReturnInstance = nullptr; + sLib3MFDynamicWrapperTable * wrapperTable = CLib3MFBaseClass::getDynamicWrapperTable(args.Holder()); + if (wrapperTable == nullptr) + throw std::runtime_error("Could not get wrapper table for Lib3MF method CreatePersistentSourceFromCallback."); + if (wrapperTable->m_Model_CreatePersistentSourceFromCallback == nullptr) + throw std::runtime_error("Could not call Lib3MF method Model::CreatePersistentSourceFromCallback."); + Lib3MFHandle instanceHandle = CLib3MFBaseClass::getHandle(args.Holder()); + Lib3MFResult errorCode = wrapperTable->m_Model_CreatePersistentSourceFromCallback(instanceHandle, nullptr, nStreamSize, nullptr, (void*) nUserData, &hReturnInstance); + CheckError(isolate, wrapperTable, instanceHandle, errorCode); + Local instanceObjInstance = CLib3MFPersistentReaderSource::NewInstance(args.Holder(), hReturnInstance); + args.GetReturnValue().Set(instanceObjInstance); + + } catch (std::exception & E) { + RaiseError(isolate, E.what()); + } +} + /************************************************************************************************************************* Class CLib3MFWrapper Implementation **************************************************************************************************************************/ @@ -12310,6 +16928,10 @@ void CLib3MFWrapper::New(const FunctionCallbackInfo& args) newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "ePropertyType_Multi"), Integer::New(isolate, 5)); newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eSlicesMeshResolution_Fullres"), Integer::New(isolate, 0)); newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eSlicesMeshResolution_Lowres"), Integer::New(isolate, 1)); + newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "ePersistentReaderSourceType_Unknown"), Integer::New(isolate, 0)); + newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "ePersistentReaderSourceType_FileOnDisk"), Integer::New(isolate, 1)); + newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "ePersistentReaderSourceType_MemoryBuffer"), Integer::New(isolate, 2)); + newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "ePersistentReaderSourceType_Callback"), Integer::New(isolate, 3)); newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eModelUnit_MicroMeter"), Integer::New(isolate, 0)); newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eModelUnit_MilliMeter"), Integer::New(isolate, 1)); newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eModelUnit_CentiMeter"), Integer::New(isolate, 2)); @@ -12339,6 +16961,8 @@ void CLib3MFWrapper::New(const FunctionCallbackInfo& args) newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eBeamLatticeBallMode_None"), Integer::New(isolate, 0)); newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eBeamLatticeBallMode_Mixed"), Integer::New(isolate, 1)); newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eBeamLatticeBallMode_All"), Integer::New(isolate, 2)); + newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eBinaryStreamPredictionType_NoPrediction"), Integer::New(isolate, 0)); + newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eBinaryStreamPredictionType_DeltaPrediction"), Integer::New(isolate, 1)); newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eProgressIdentifier_QUERYCANCELED"), Integer::New(isolate, 0)); newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eProgressIdentifier_DONE"), Integer::New(isolate, 1)); newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eProgressIdentifier_CLEANUP"), Integer::New(isolate, 2)); @@ -12366,6 +16990,13 @@ void CLib3MFWrapper::New(const FunctionCallbackInfo& args) newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eBlendMethod_NoBlendMethod"), Integer::New(isolate, 0)); newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eBlendMethod_Mix"), Integer::New(isolate, 1)); newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eBlendMethod_Multiply"), Integer::New(isolate, 2)); + newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eToolpathSegmentType_Unknown"), Integer::New(isolate, 0)); + newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eToolpathSegmentType_Hatch"), Integer::New(isolate, 1)); + newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eToolpathSegmentType_Loop"), Integer::New(isolate, 2)); + newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eToolpathSegmentType_Polyline"), Integer::New(isolate, 3)); + newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eToolpathAttributeType_Unknown"), Integer::New(isolate, 0)); + newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eToolpathAttributeType_Integer"), Integer::New(isolate, 1)); + newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eToolpathAttributeType_Double"), Integer::New(isolate, 2)); newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eEncryptionAlgorithm_AES256_GCM"), Integer::New(isolate, 1)); newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eWrappingAlgorithm_RSA_OAEP"), Integer::New(isolate, 0)); newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eMgfAlgorithm_MGF1_SHA1"), Integer::New(isolate, 160)); diff --git a/Autogenerated/Bindings/NodeJS/lib3mf_nodewrapper.h b/Autogenerated/Bindings/NodeJS/lib3mf_nodewrapper.h index 49ce0ade5..1dcd17db4 100644 --- a/Autogenerated/Bindings/NodeJS/lib3mf_nodewrapper.h +++ b/Autogenerated/Bindings/NodeJS/lib3mf_nodewrapper.h @@ -87,6 +87,30 @@ class CLib3MFBase : public CLib3MFBaseClass { }; +/************************************************************************************************************************* + Class CLib3MFBinaryStream +**************************************************************************************************************************/ +class CLib3MFBinaryStream : public CLib3MFBaseClass { +private: + static void New(const v8::FunctionCallbackInfo& args); + static v8::Persistent constructor; + static void GetBinaryPath(const v8::FunctionCallbackInfo& args); + static void GetIndexPath(const v8::FunctionCallbackInfo& args); + static void GetUUID(const v8::FunctionCallbackInfo& args); + static void DisableDiscretizedArrayCompression(const v8::FunctionCallbackInfo& args); + static void EnableDiscretizedArrayCompression(const v8::FunctionCallbackInfo& args); + static void EnableLZMA(const v8::FunctionCallbackInfo& args); + static void DisableLZMA(const v8::FunctionCallbackInfo& args); + +public: + CLib3MFBinaryStream(); + ~CLib3MFBinaryStream(); + + static void Init(); + static v8::Local NewInstance(v8::Local, Lib3MFHandle pHandle); + +}; + /************************************************************************************************************************* Class CLib3MFWriter **************************************************************************************************************************/ @@ -107,6 +131,9 @@ class CLib3MFWriter : public CLib3MFBaseClass { static void GetWarningCount(const v8::FunctionCallbackInfo& args); static void AddKeyWrappingCallback(const v8::FunctionCallbackInfo& args); static void SetContentEncryptionCallback(const v8::FunctionCallbackInfo& args); + static void CreateBinaryStream(const v8::FunctionCallbackInfo& args); + static void AssignBinaryStream(const v8::FunctionCallbackInfo& args); + static void RegisterCustomNamespace(const v8::FunctionCallbackInfo& args); public: CLib3MFWriter(); @@ -117,6 +144,26 @@ class CLib3MFWriter : public CLib3MFBaseClass { }; +/************************************************************************************************************************* + Class CLib3MFPersistentReaderSource +**************************************************************************************************************************/ +class CLib3MFPersistentReaderSource : public CLib3MFBaseClass { +private: + static void New(const v8::FunctionCallbackInfo& args); + static v8::Persistent constructor; + static void GetSourceType(const v8::FunctionCallbackInfo& args); + static void InvalidateSourceData(const v8::FunctionCallbackInfo& args); + static void SourceDataIsValid(const v8::FunctionCallbackInfo& args); + +public: + CLib3MFPersistentReaderSource(); + ~CLib3MFPersistentReaderSource(); + + static void Init(); + static v8::Local NewInstance(v8::Local, Lib3MFHandle pHandle); + +}; + /************************************************************************************************************************* Class CLib3MFReader **************************************************************************************************************************/ @@ -124,6 +171,7 @@ class CLib3MFReader : public CLib3MFBaseClass { private: static void New(const v8::FunctionCallbackInfo& args); static v8::Persistent constructor; + static void ReadFromPersistentSource(const v8::FunctionCallbackInfo& args); static void ReadFromFile(const v8::FunctionCallbackInfo& args); static void ReadFromBuffer(const v8::FunctionCallbackInfo& args); static void ReadFromCallback(const v8::FunctionCallbackInfo& args); @@ -209,6 +257,119 @@ class CLib3MFResourceIterator : public CLib3MFBaseClass { }; +/************************************************************************************************************************* + Class CLib3MFCustomXMLAttribute +**************************************************************************************************************************/ +class CLib3MFCustomXMLAttribute : public CLib3MFBaseClass { +private: + static void New(const v8::FunctionCallbackInfo& args); + static v8::Persistent constructor; + static void GetName(const v8::FunctionCallbackInfo& args); + static void GetValue(const v8::FunctionCallbackInfo& args); + static void IsValidInteger(const v8::FunctionCallbackInfo& args); + static void GetIntegerValue(const v8::FunctionCallbackInfo& args); + static void IsValidDouble(const v8::FunctionCallbackInfo& args); + static void GetDoubleValue(const v8::FunctionCallbackInfo& args); + static void IsValidBool(const v8::FunctionCallbackInfo& args); + static void GetBoolValue(const v8::FunctionCallbackInfo& args); + static void SetValue(const v8::FunctionCallbackInfo& args); + static void SetIntegerValue(const v8::FunctionCallbackInfo& args); + static void SetDoubleValue(const v8::FunctionCallbackInfo& args); + static void SetBoolValue(const v8::FunctionCallbackInfo& args); + static void Remove(const v8::FunctionCallbackInfo& args); + +public: + CLib3MFCustomXMLAttribute(); + ~CLib3MFCustomXMLAttribute(); + + static void Init(); + static v8::Local NewInstance(v8::Local, Lib3MFHandle pHandle); + +}; + +/************************************************************************************************************************* + Class CLib3MFCustomXMLNode +**************************************************************************************************************************/ +class CLib3MFCustomXMLNode : public CLib3MFBaseClass { +private: + static void New(const v8::FunctionCallbackInfo& args); + static v8::Persistent constructor; + static void GetName(const v8::FunctionCallbackInfo& args); + static void GetNameSpace(const v8::FunctionCallbackInfo& args); + static void GetAttributeCount(const v8::FunctionCallbackInfo& args); + static void GetAttribute(const v8::FunctionCallbackInfo& args); + static void HasAttribute(const v8::FunctionCallbackInfo& args); + static void FindAttribute(const v8::FunctionCallbackInfo& args); + static void RemoveAttribute(const v8::FunctionCallbackInfo& args); + static void RemoveAttributeByIndex(const v8::FunctionCallbackInfo& args); + static void AddAttribute(const v8::FunctionCallbackInfo& args); + static void AddIntegerAttribute(const v8::FunctionCallbackInfo& args); + static void AddDoubleAttribute(const v8::FunctionCallbackInfo& args); + static void AddBoolAttribute(const v8::FunctionCallbackInfo& args); + static void GetChildren(const v8::FunctionCallbackInfo& args); + static void CountChildrenByName(const v8::FunctionCallbackInfo& args); + static void GetChildrenByName(const v8::FunctionCallbackInfo& args); + static void HasChild(const v8::FunctionCallbackInfo& args); + static void HasUniqueChild(const v8::FunctionCallbackInfo& args); + static void FindChild(const v8::FunctionCallbackInfo& args); + static void AddChild(const v8::FunctionCallbackInfo& args); + static void RemoveChild(const v8::FunctionCallbackInfo& args); + static void RemoveChildrenWithName(const v8::FunctionCallbackInfo& args); + static void Remove(const v8::FunctionCallbackInfo& args); + +public: + CLib3MFCustomXMLNode(); + ~CLib3MFCustomXMLNode(); + + static void Init(); + static v8::Local NewInstance(v8::Local, Lib3MFHandle pHandle); + +}; + +/************************************************************************************************************************* + Class CLib3MFCustomXMLNodes +**************************************************************************************************************************/ +class CLib3MFCustomXMLNodes : public CLib3MFBaseClass { +private: + static void New(const v8::FunctionCallbackInfo& args); + static v8::Persistent constructor; + static void GetNodeCount(const v8::FunctionCallbackInfo& args); + static void GetNode(const v8::FunctionCallbackInfo& args); + static void CountNodesByName(const v8::FunctionCallbackInfo& args); + static void GetNodesByName(const v8::FunctionCallbackInfo& args); + static void HasNode(const v8::FunctionCallbackInfo& args); + static void HasUniqueNode(const v8::FunctionCallbackInfo& args); + static void FindNode(const v8::FunctionCallbackInfo& args); + +public: + CLib3MFCustomXMLNodes(); + ~CLib3MFCustomXMLNodes(); + + static void Init(); + static v8::Local NewInstance(v8::Local, Lib3MFHandle pHandle); + +}; + +/************************************************************************************************************************* + Class CLib3MFCustomDOMTree +**************************************************************************************************************************/ +class CLib3MFCustomDOMTree : public CLib3MFBaseClass { +private: + static void New(const v8::FunctionCallbackInfo& args); + static v8::Persistent constructor; + static void GetNameSpace(const v8::FunctionCallbackInfo& args); + static void GetRootNode(const v8::FunctionCallbackInfo& args); + static void SaveToString(const v8::FunctionCallbackInfo& args); + +public: + CLib3MFCustomDOMTree(); + ~CLib3MFCustomDOMTree(); + + static void Init(); + static v8::Local NewInstance(v8::Local, Lib3MFHandle pHandle); + +}; + /************************************************************************************************************************* Class CLib3MFSliceStackIterator **************************************************************************************************************************/ @@ -877,6 +1038,163 @@ class CLib3MFSlice : public CLib3MFBaseClass { }; +/************************************************************************************************************************* + Class CLib3MFToolpathProfile +**************************************************************************************************************************/ +class CLib3MFToolpathProfile : public CLib3MFBaseClass { +private: + static void New(const v8::FunctionCallbackInfo& args); + static v8::Persistent constructor; + static void GetUUID(const v8::FunctionCallbackInfo& args); + static void GetName(const v8::FunctionCallbackInfo& args); + static void GetParameterCount(const v8::FunctionCallbackInfo& args); + static void GetParameterName(const v8::FunctionCallbackInfo& args); + static void GetParameterNameSpace(const v8::FunctionCallbackInfo& args); + static void HasParameterValue(const v8::FunctionCallbackInfo& args); + static void GetParameterValue(const v8::FunctionCallbackInfo& args); + static void GetParameterValueDef(const v8::FunctionCallbackInfo& args); + static void GetParameterDoubleValue(const v8::FunctionCallbackInfo& args); + static void GetParameterDoubleValueDef(const v8::FunctionCallbackInfo& args); + static void GetParameterIntegerValue(const v8::FunctionCallbackInfo& args); + static void GetParameterIntegerValueDef(const v8::FunctionCallbackInfo& args); + static void GetParameterBoolValue(const v8::FunctionCallbackInfo& args); + static void GetParameterBoolValueDef(const v8::FunctionCallbackInfo& args); + static void SetName(const v8::FunctionCallbackInfo& args); + static void SetParameterValue(const v8::FunctionCallbackInfo& args); + static void SetParameterDoubleValue(const v8::FunctionCallbackInfo& args); + static void SetParameterIntegerValue(const v8::FunctionCallbackInfo& args); + static void SetParameterBoolValue(const v8::FunctionCallbackInfo& args); + +public: + CLib3MFToolpathProfile(); + ~CLib3MFToolpathProfile(); + + static void Init(); + static v8::Local NewInstance(v8::Local, Lib3MFHandle pHandle); + +}; + +/************************************************************************************************************************* + Class CLib3MFToolpathLayerReader +**************************************************************************************************************************/ +class CLib3MFToolpathLayerReader : public CLib3MFBaseClass { +private: + static void New(const v8::FunctionCallbackInfo& args); + static v8::Persistent constructor; + static void GetLayerDataUUID(const v8::FunctionCallbackInfo& args); + static void GetSegmentCount(const v8::FunctionCallbackInfo& args); + static void GetSegmentInfo(const v8::FunctionCallbackInfo& args); + static void GetSegmentProfile(const v8::FunctionCallbackInfo& args); + static void GetSegmentProfileUUID(const v8::FunctionCallbackInfo& args); + static void GetSegmentPart(const v8::FunctionCallbackInfo& args); + static void GetSegmentPartUUID(const v8::FunctionCallbackInfo& args); + static void GetSegmentLocalPartID(const v8::FunctionCallbackInfo& args); + static void GetPartUUIDByLocalPartID(const v8::FunctionCallbackInfo& args); + static void GetSegmentPointData(const v8::FunctionCallbackInfo& args); + static void FindAttributeInfoByName(const v8::FunctionCallbackInfo& args); + static void FindAttributeIDByName(const v8::FunctionCallbackInfo& args); + static void FindAttributeValueByName(const v8::FunctionCallbackInfo& args); + static void GetSegmentIntegerAttributeByID(const v8::FunctionCallbackInfo& args); + static void GetSegmentIntegerAttributeByName(const v8::FunctionCallbackInfo& args); + static void GetSegmentDoubleAttributeByID(const v8::FunctionCallbackInfo& args); + static void GetSegmentDoubleAttributeByName(const v8::FunctionCallbackInfo& args); + static void GetCustomDataCount(const v8::FunctionCallbackInfo& args); + static void GetCustomData(const v8::FunctionCallbackInfo& args); + static void GetCustomDataName(const v8::FunctionCallbackInfo& args); + +public: + CLib3MFToolpathLayerReader(); + ~CLib3MFToolpathLayerReader(); + + static void Init(); + static v8::Local NewInstance(v8::Local, Lib3MFHandle pHandle); + +}; + +/************************************************************************************************************************* + Class CLib3MFToolpathLayerData +**************************************************************************************************************************/ +class CLib3MFToolpathLayerData : public CLib3MFBaseClass { +private: + static void New(const v8::FunctionCallbackInfo& args); + static v8::Persistent constructor; + static void GetLayerDataUUID(const v8::FunctionCallbackInfo& args); + static void RegisterProfile(const v8::FunctionCallbackInfo& args); + static void RegisterBuildItem(const v8::FunctionCallbackInfo& args); + static void SetSegmentAttribute(const v8::FunctionCallbackInfo& args); + static void ClearSegmentAttributes(const v8::FunctionCallbackInfo& args); + static void WriteHatchData(const v8::FunctionCallbackInfo& args); + static void WriteLoop(const v8::FunctionCallbackInfo& args); + static void WritePolyline(const v8::FunctionCallbackInfo& args); + static void AddCustomData(const v8::FunctionCallbackInfo& args); + static void Finish(const v8::FunctionCallbackInfo& args); + +public: + CLib3MFToolpathLayerData(); + ~CLib3MFToolpathLayerData(); + + static void Init(); + static v8::Local NewInstance(v8::Local, Lib3MFHandle pHandle); + +}; + +/************************************************************************************************************************* + Class CLib3MFToolpath +**************************************************************************************************************************/ +class CLib3MFToolpath : public CLib3MFBaseClass { +private: + static void New(const v8::FunctionCallbackInfo& args); + static v8::Persistent constructor; + static void GetUnits(const v8::FunctionCallbackInfo& args); + static void GetLayerCount(const v8::FunctionCallbackInfo& args); + static void GetProfileCount(const v8::FunctionCallbackInfo& args); + static void AddLayer(const v8::FunctionCallbackInfo& args); + static void GetLayerAttachment(const v8::FunctionCallbackInfo& args); + static void ReadLayerData(const v8::FunctionCallbackInfo& args); + static void GetLayerPath(const v8::FunctionCallbackInfo& args); + static void GetLayerZMax(const v8::FunctionCallbackInfo& args); + static void GetLayerZ(const v8::FunctionCallbackInfo& args); + static void AddProfile(const v8::FunctionCallbackInfo& args); + static void GetProfile(const v8::FunctionCallbackInfo& args); + static void GetProfileUUID(const v8::FunctionCallbackInfo& args); + static void GetCustomDataCount(const v8::FunctionCallbackInfo& args); + static void GetCustomData(const v8::FunctionCallbackInfo& args); + static void GetCustomDataName(const v8::FunctionCallbackInfo& args); + static void HasUniqueCustomData(const v8::FunctionCallbackInfo& args); + static void FindUniqueCustomData(const v8::FunctionCallbackInfo& args); + static void AddCustomData(const v8::FunctionCallbackInfo& args); + static void ClearCustomData(const v8::FunctionCallbackInfo& args); + static void DeleteCustomData(const v8::FunctionCallbackInfo& args); + static void RegisterCustomIntegerAttribute(const v8::FunctionCallbackInfo& args); + static void RegisterCustomDoubleAttribute(const v8::FunctionCallbackInfo& args); + +public: + CLib3MFToolpath(); + ~CLib3MFToolpath(); + + static void Init(); + static v8::Local NewInstance(v8::Local, Lib3MFHandle pHandle); + +}; + +/************************************************************************************************************************* + Class CLib3MFToolpathIterator +**************************************************************************************************************************/ +class CLib3MFToolpathIterator : public CLib3MFBaseClass { +private: + static void New(const v8::FunctionCallbackInfo& args); + static v8::Persistent constructor; + static void GetCurrentToolpath(const v8::FunctionCallbackInfo& args); + +public: + CLib3MFToolpathIterator(); + ~CLib3MFToolpathIterator(); + + static void Init(); + static v8::Local NewInstance(v8::Local, Lib3MFHandle pHandle); + +}; + /************************************************************************************************************************* Class CLib3MFSliceStack **************************************************************************************************************************/ @@ -1086,6 +1404,7 @@ class CLib3MFModel : public CLib3MFBaseClass { static void GetTexture2DGroups(const v8::FunctionCallbackInfo& args); static void GetCompositeMaterials(const v8::FunctionCallbackInfo& args); static void GetMultiPropertyGroups(const v8::FunctionCallbackInfo& args); + static void GetToolpaths(const v8::FunctionCallbackInfo& args); static void GetSliceStacks(const v8::FunctionCallbackInfo& args); static void MergeToModel(const v8::FunctionCallbackInfo& args); static void AddMeshObject(const v8::FunctionCallbackInfo& args); @@ -1099,6 +1418,7 @@ class CLib3MFModel : public CLib3MFBaseClass { static void AddMultiPropertyGroup(const v8::FunctionCallbackInfo& args); static void AddBuildItem(const v8::FunctionCallbackInfo& args); static void RemoveBuildItem(const v8::FunctionCallbackInfo& args); + static void AddToolpath(const v8::FunctionCallbackInfo& args); static void GetMetaDataGroup(const v8::FunctionCallbackInfo& args); static void AddAttachment(const v8::FunctionCallbackInfo& args); static void RemoveAttachment(const v8::FunctionCallbackInfo& args); @@ -1113,6 +1433,9 @@ class CLib3MFModel : public CLib3MFBaseClass { static void RemoveCustomContentType(const v8::FunctionCallbackInfo& args); static void SetRandomNumberCallback(const v8::FunctionCallbackInfo& args); static void GetKeyStore(const v8::FunctionCallbackInfo& args); + static void CreatePersistentSourceFromFile(const v8::FunctionCallbackInfo& args); + static void CreatePersistentSourceFromBuffer(const v8::FunctionCallbackInfo& args); + static void CreatePersistentSourceFromCallback(const v8::FunctionCallbackInfo& args); public: CLib3MFModel(); diff --git a/Autogenerated/Bindings/NodeJS/lib3mf_types.h b/Autogenerated/Bindings/NodeJS/lib3mf_types.h index 6f2dcf6a4..ed4941824 100644 --- a/Autogenerated/Bindings/NodeJS/lib3mf_types.h +++ b/Autogenerated/Bindings/NodeJS/lib3mf_types.h @@ -130,13 +130,27 @@ typedef void * Lib3MF_pvoid; #define LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER 140 /** A progress identifier is unknown */ #define LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT 141 /** An element buffer exceeds its spec limit */ #define LIB3MF_ERROR_INVALIDRESOURCE 142 /** A resource is invalid */ +#define LIB3MF_ERROR_INVALIDNODEINDEX 143 /** Invalid node index */ +#define LIB3MF_ERROR_INVALIDATTRIBUTEINDEX 144 /** Invalid attribute index */ +#define LIB3MF_ERROR_DUPLICATECUSTOMDATA 145 /** Duplicate custom data */ +#define LIB3MF_ERROR_CUSTOMDATANOTFOUND 146 /** Custom data not found */ #define LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE 2000 /** This object type is not valid for beamlattices */ #define LIB3MF_ERROR_INVALIDKEYSTORE 3000 /** The keystore object is invalid */ #define LIB3MF_ERROR_INVALIDKEYSTORECONSUMER 3001 /** The consumer keystore object is invalid */ #define LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND 3002 /** A consumer has not been found */ #define LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND 3003 /** A resource data has not been found */ #define LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED 3004 /** A Key or Conentent encryption callback has not been registered */ -#define LIB3MF_ERROR_INVALIDKEYSIZE 3005 /** The key siue is invalid */ +#define LIB3MF_ERROR_INVALIDKEYSIZE 3005 /** The key size is invalid */ +#define LIB3MF_ERROR_TOOLPATH_NOTWRITINGHEADER 4000 /** Not in toolpath header writing mode */ +#define LIB3MF_ERROR_TOOLPATH_NOTWRITINGDATA 4001 /** Not in toolpath data writing mode */ +#define LIB3MF_ERROR_TOOLPATH_DATAHASBEENWRITTEN 4002 /** Toolpath has already been written out */ +#define LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT 4003 /** Toolpath has an invalid number of points */ +#define LIB3MF_ERROR_TOOLPATH_ATTRIBUTEALREADYDEFINED 4004 /** Toolpath attribute already defined */ +#define LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE 4005 /** Toolpath attribute is of invalid type */ +#define LIB3MF_ERROR_EMPTYNAMESPACEPREFIX 4006 /** Empty namespace prefix. */ +#define LIB3MF_ERROR_EMPTYNAMESPACE 4007 /** Empty namespace. */ +#define LIB3MF_ERROR_INVALIDNAMESPACEPREFIX 4008 /** Invalid namespace prefix. */ +#define LIB3MF_ERROR_WRITERDOESNOTSUPPORTNAMESPACES 4009 /** Writer does not support namespaces. */ /************************************************************************************************************************* Error strings for Lib3MF @@ -181,13 +195,27 @@ inline const char * LIB3MF_GETERRORSTRING (Lib3MFResult nErrorCode) { case LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER: return "A progress identifier is unknown"; case LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT: return "An element buffer exceeds its spec limit"; case LIB3MF_ERROR_INVALIDRESOURCE: return "A resource is invalid"; + case LIB3MF_ERROR_INVALIDNODEINDEX: return "Invalid node index"; + case LIB3MF_ERROR_INVALIDATTRIBUTEINDEX: return "Invalid attribute index"; + case LIB3MF_ERROR_DUPLICATECUSTOMDATA: return "Duplicate custom data"; + case LIB3MF_ERROR_CUSTOMDATANOTFOUND: return "Custom data not found"; case LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE: return "This object type is not valid for beamlattices"; case LIB3MF_ERROR_INVALIDKEYSTORE: return "The keystore object is invalid"; case LIB3MF_ERROR_INVALIDKEYSTORECONSUMER: return "The consumer keystore object is invalid"; case LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND: return "A consumer has not been found"; case LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND: return "A resource data has not been found"; case LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED: return "A Key or Conentent encryption callback has not been registered"; - case LIB3MF_ERROR_INVALIDKEYSIZE: return "The key siue is invalid"; + case LIB3MF_ERROR_INVALIDKEYSIZE: return "The key size is invalid"; + case LIB3MF_ERROR_TOOLPATH_NOTWRITINGHEADER: return "Not in toolpath header writing mode"; + case LIB3MF_ERROR_TOOLPATH_NOTWRITINGDATA: return "Not in toolpath data writing mode"; + case LIB3MF_ERROR_TOOLPATH_DATAHASBEENWRITTEN: return "Toolpath has already been written out"; + case LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT: return "Toolpath has an invalid number of points"; + case LIB3MF_ERROR_TOOLPATH_ATTRIBUTEALREADYDEFINED: return "Toolpath attribute already defined"; + case LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE: return "Toolpath attribute is of invalid type"; + case LIB3MF_ERROR_EMPTYNAMESPACEPREFIX: return "Empty namespace prefix."; + case LIB3MF_ERROR_EMPTYNAMESPACE: return "Empty namespace."; + case LIB3MF_ERROR_INVALIDNAMESPACEPREFIX: return "Invalid namespace prefix."; + case LIB3MF_ERROR_WRITERDOESNOTSUPPORTNAMESPACES: return "Writer does not support namespaces."; default: return "unknown error"; } } @@ -197,11 +225,17 @@ inline const char * LIB3MF_GETERRORSTRING (Lib3MFResult nErrorCode) { **************************************************************************************************************************/ typedef Lib3MFHandle Lib3MF_Base; +typedef Lib3MFHandle Lib3MF_BinaryStream; typedef Lib3MFHandle Lib3MF_Writer; +typedef Lib3MFHandle Lib3MF_PersistentReaderSource; typedef Lib3MFHandle Lib3MF_Reader; typedef Lib3MFHandle Lib3MF_PackagePart; typedef Lib3MFHandle Lib3MF_Resource; typedef Lib3MFHandle Lib3MF_ResourceIterator; +typedef Lib3MFHandle Lib3MF_CustomXMLAttribute; +typedef Lib3MFHandle Lib3MF_CustomXMLNode; +typedef Lib3MFHandle Lib3MF_CustomXMLNodes; +typedef Lib3MFHandle Lib3MF_CustomDOMTree; typedef Lib3MFHandle Lib3MF_SliceStackIterator; typedef Lib3MFHandle Lib3MF_ObjectIterator; typedef Lib3MFHandle Lib3MF_MeshObjectIterator; @@ -230,6 +264,11 @@ typedef Lib3MFHandle Lib3MF_Texture2D; typedef Lib3MFHandle Lib3MF_BuildItem; typedef Lib3MFHandle Lib3MF_BuildItemIterator; typedef Lib3MFHandle Lib3MF_Slice; +typedef Lib3MFHandle Lib3MF_ToolpathProfile; +typedef Lib3MFHandle Lib3MF_ToolpathLayerReader; +typedef Lib3MFHandle Lib3MF_ToolpathLayerData; +typedef Lib3MFHandle Lib3MF_Toolpath; +typedef Lib3MFHandle Lib3MF_ToolpathIterator; typedef Lib3MFHandle Lib3MF_SliceStack; typedef Lib3MFHandle Lib3MF_Consumer; typedef Lib3MFHandle Lib3MF_AccessRight; @@ -257,6 +296,13 @@ typedef enum eLib3MFSlicesMeshResolution { eSlicesMeshResolutionLowres = 1 } eLib3MFSlicesMeshResolution; +typedef enum eLib3MFPersistentReaderSourceType { + ePersistentReaderSourceTypeUnknown = 0, + ePersistentReaderSourceTypeFileOnDisk = 1, + ePersistentReaderSourceTypeMemoryBuffer = 2, + ePersistentReaderSourceTypeCallback = 3 +} eLib3MFPersistentReaderSourceType; + typedef enum eLib3MFModelUnit { eModelUnitMicroMeter = 0, eModelUnitMilliMeter = 1, @@ -310,6 +356,11 @@ typedef enum eLib3MFBeamLatticeBallMode { eBeamLatticeBallModeAll = 2 } eLib3MFBeamLatticeBallMode; +typedef enum eLib3MFBinaryStreamPredictionType { + eBinaryStreamPredictionTypeNoPrediction = 0, + eBinaryStreamPredictionTypeDeltaPrediction = 1 +} eLib3MFBinaryStreamPredictionType; + typedef enum eLib3MFProgressIdentifier { eProgressIdentifierQUERYCANCELED = 0, eProgressIdentifierDONE = 1, @@ -343,6 +394,19 @@ typedef enum eLib3MFBlendMethod { eBlendMethodMultiply = 2 } eLib3MFBlendMethod; +typedef enum eLib3MFToolpathSegmentType { + eToolpathSegmentTypeUnknown = 0, + eToolpathSegmentTypeHatch = 1, + eToolpathSegmentTypeLoop = 2, + eToolpathSegmentTypePolyline = 3 +} eLib3MFToolpathSegmentType; + +typedef enum eLib3MFToolpathAttributeType { + eToolpathAttributeTypeUnknown = 0, + eToolpathAttributeTypeInteger = 1, + eToolpathAttributeTypeDouble = 2 +} eLib3MFToolpathAttributeType; + typedef enum eLib3MFEncryptionAlgorithm { eEncryptionAlgorithmAES256_GCM = 1 /** http://www.w3.org/2009/xmlenc11#aes256-gcm */ } eLib3MFEncryptionAlgorithm; @@ -383,6 +447,11 @@ typedef union { int m_code; } structEnumLib3MFSlicesMeshResolution; +typedef union { + eLib3MFPersistentReaderSourceType m_enum; + int m_code; +} structEnumLib3MFPersistentReaderSourceType; + typedef union { eLib3MFModelUnit m_enum; int m_code; @@ -423,6 +492,11 @@ typedef union { int m_code; } structEnumLib3MFBeamLatticeBallMode; +typedef union { + eLib3MFBinaryStreamPredictionType m_enum; + int m_code; +} structEnumLib3MFBinaryStreamPredictionType; + typedef union { eLib3MFProgressIdentifier m_enum; int m_code; @@ -433,6 +507,16 @@ typedef union { int m_code; } structEnumLib3MFBlendMethod; +typedef union { + eLib3MFToolpathSegmentType m_enum; + int m_code; +} structEnumLib3MFToolpathSegmentType; + +typedef union { + eLib3MFToolpathAttributeType m_enum; + int m_code; +} structEnumLib3MFToolpathAttributeType; + typedef union { eLib3MFEncryptionAlgorithm m_enum; int m_code; diff --git a/Autogenerated/Bindings/Pascal/Unit_Lib3MF.pas b/Autogenerated/Bindings/Pascal/Unit_Lib3MF.pas index 8271fb01c..077d4a0e7 100644 --- a/Autogenerated/Bindings/Pascal/Unit_Lib3MF.pas +++ b/Autogenerated/Bindings/Pascal/Unit_Lib3MF.pas @@ -113,6 +113,10 @@ interface LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER = 140; LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT = 141; LIB3MF_ERROR_INVALIDRESOURCE = 142; + LIB3MF_ERROR_INVALIDNODEINDEX = 143; + LIB3MF_ERROR_INVALIDATTRIBUTEINDEX = 144; + LIB3MF_ERROR_DUPLICATECUSTOMDATA = 145; + LIB3MF_ERROR_CUSTOMDATANOTFOUND = 146; LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE = 2000; LIB3MF_ERROR_INVALIDKEYSTORE = 3000; LIB3MF_ERROR_INVALIDKEYSTORECONSUMER = 3001; @@ -120,6 +124,16 @@ interface LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND = 3003; LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED = 3004; LIB3MF_ERROR_INVALIDKEYSIZE = 3005; + LIB3MF_ERROR_TOOLPATH_NOTWRITINGHEADER = 4000; + LIB3MF_ERROR_TOOLPATH_NOTWRITINGDATA = 4001; + LIB3MF_ERROR_TOOLPATH_DATAHASBEENWRITTEN = 4002; + LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT = 4003; + LIB3MF_ERROR_TOOLPATH_ATTRIBUTEALREADYDEFINED = 4004; + LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE = 4005; + LIB3MF_ERROR_EMPTYNAMESPACEPREFIX = 4006; + LIB3MF_ERROR_EMPTYNAMESPACE = 4007; + LIB3MF_ERROR_INVALIDNAMESPACEPREFIX = 4008; + LIB3MF_ERROR_WRITERDOESNOTSUPPORTNAMESPACES = 4009; (************************************************************************************************************************* Declaration of enums @@ -141,6 +155,13 @@ interface eSlicesMeshResolutionLowres ); + TLib3MFPersistentReaderSourceType = ( + ePersistentReaderSourceTypeUnknown, + ePersistentReaderSourceTypeFileOnDisk, + ePersistentReaderSourceTypeMemoryBuffer, + ePersistentReaderSourceTypeCallback + ); + TLib3MFModelUnit = ( eModelUnitMicroMeter, eModelUnitMilliMeter, @@ -194,6 +215,11 @@ interface eBeamLatticeBallModeAll ); + TLib3MFBinaryStreamPredictionType = ( + eBinaryStreamPredictionTypeNoPrediction, + eBinaryStreamPredictionTypeDeltaPrediction + ); + TLib3MFProgressIdentifier = ( eProgressIdentifierQUERYCANCELED, eProgressIdentifierDONE, @@ -227,6 +253,19 @@ interface eBlendMethodMultiply ); + TLib3MFToolpathSegmentType = ( + eToolpathSegmentTypeUnknown, + eToolpathSegmentTypeHatch, + eToolpathSegmentTypeLoop, + eToolpathSegmentTypePolyline + ); + + TLib3MFToolpathAttributeType = ( + eToolpathAttributeTypeUnknown, + eToolpathAttributeTypeInteger, + eToolpathAttributeTypeDouble + ); + TLib3MFEncryptionAlgorithm = ( eEncryptionAlgorithmAES256_GCM ); @@ -369,11 +408,17 @@ interface type TLib3MFWrapper = class; TLib3MFBase = class; + TLib3MFBinaryStream = class; TLib3MFWriter = class; + TLib3MFPersistentReaderSource = class; TLib3MFReader = class; TLib3MFPackagePart = class; TLib3MFResource = class; TLib3MFResourceIterator = class; + TLib3MFCustomXMLAttribute = class; + TLib3MFCustomXMLNode = class; + TLib3MFCustomXMLNodes = class; + TLib3MFCustomDOMTree = class; TLib3MFSliceStackIterator = class; TLib3MFObjectIterator = class; TLib3MFMeshObjectIterator = class; @@ -402,6 +447,11 @@ TLib3MFTexture2D = class; TLib3MFBuildItem = class; TLib3MFBuildItemIterator = class; TLib3MFSlice = class; + TLib3MFToolpathProfile = class; + TLib3MFToolpathLayerReader = class; + TLib3MFToolpathLayerData = class; + TLib3MFToolpath = class; + TLib3MFToolpathIterator = class; TLib3MFSliceStack = class; TLib3MFConsumer = class; TLib3MFAccessRight = class; @@ -426,6 +476,79 @@ TLib3MFModel = class; TLib3MFBase_ClassTypeIdFunc = function(pBase: TLib3MFHandle; out pClassTypeId: QWord): TLib3MFResult; cdecl; +(************************************************************************************************************************* + Function type definitions for BinaryStream +**************************************************************************************************************************) + + (** + * Retrieves an binary streams package path for the binary data. + * + * @param[in] pBinaryStream - BinaryStream instance. + * @param[in] nPathBufferSize - size of the buffer (including trailing 0) + * @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pPathBuffer - buffer of binary streams package binary path., may be NULL + * @return error code or 0 (success) + *) + TLib3MFBinaryStream_GetBinaryPathFunc = function(pBinaryStream: TLib3MFHandle; const nPathBufferSize: Cardinal; out pPathNeededChars: Cardinal; pPathBuffer: PAnsiChar): TLib3MFResult; cdecl; + + (** + * Retrieves an binary streams package path for the index data. + * + * @param[in] pBinaryStream - BinaryStream instance. + * @param[in] nPathBufferSize - size of the buffer (including trailing 0) + * @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pPathBuffer - buffer of binary streams package index path., may be NULL + * @return error code or 0 (success) + *) + TLib3MFBinaryStream_GetIndexPathFunc = function(pBinaryStream: TLib3MFHandle; const nPathBufferSize: Cardinal; out pPathNeededChars: Cardinal; pPathBuffer: PAnsiChar): TLib3MFResult; cdecl; + + (** + * Retrieves an binary streams uuid. + * + * @param[in] pBinaryStream - BinaryStream instance. + * @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) + * @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pUUIDBuffer - buffer of binary streams uuid, may be NULL + * @return error code or 0 (success) + *) + TLib3MFBinaryStream_GetUUIDFunc = function(pBinaryStream: TLib3MFHandle; const nUUIDBufferSize: Cardinal; out pUUIDNeededChars: Cardinal; pUUIDBuffer: PAnsiChar): TLib3MFResult; cdecl; + + (** + * Sets the float compression mode to raw. All subsequent writes will adhere to this mode. + * + * @param[in] pBinaryStream - BinaryStream instance. + * @return error code or 0 (success) + *) + TLib3MFBinaryStream_DisableDiscretizedArrayCompressionFunc = function(pBinaryStream: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Sets the compression mode to a quantized array. All subsequent writes will adhere to this mode. + * + * @param[in] pBinaryStream - BinaryStream instance. + * @param[in] dUnits - Unit factor to use for quantization. + * @param[in] ePredictionType - Prediction type to use for arrays. + * @return error code or 0 (success) + *) + TLib3MFBinaryStream_EnableDiscretizedArrayCompressionFunc = function(pBinaryStream: TLib3MFHandle; const dUnits: Double; const ePredictionType: Integer): TLib3MFResult; cdecl; + + (** + * Enables LZMA mode. + * + * @param[in] pBinaryStream - BinaryStream instance. + * @param[in] nLZMALevel - LZMA Level (0-9) + * @return error code or 0 (success) + *) + TLib3MFBinaryStream_EnableLZMAFunc = function(pBinaryStream: TLib3MFHandle; const nLZMALevel: Cardinal): TLib3MFResult; cdecl; + + (** + * Disables LZMA mode. + * + * @param[in] pBinaryStream - BinaryStream instance. + * @return error code or 0 (success) + *) + TLib3MFBinaryStream_DisableLZMAFunc = function(pBinaryStream: TLib3MFHandle): TLib3MFResult; cdecl; + + (************************************************************************************************************************* Function type definitions for Writer **************************************************************************************************************************) @@ -559,11 +682,82 @@ TLib3MFModel = class; *) TLib3MFWriter_SetContentEncryptionCallbackFunc = function(pWriter: TLib3MFHandle; const pTheCallback: PLib3MF_ContentEncryptionCallback; const pUserData: Pointer): TLib3MFResult; cdecl; + (** + * Creates a binary stream object. Only applicable for 3MF Writers. + * + * @param[in] pWriter - Writer instance. + * @param[in] pIndexPath - Package path to write the index into + * @param[in] pBinaryPath - Package path to write raw binary data into + * @param[out] pBinaryStream - Returns a package path. + * @return error code or 0 (success) + *) + TLib3MFWriter_CreateBinaryStreamFunc = function(pWriter: TLib3MFHandle; const pIndexPath: PAnsiChar; const pBinaryPath: PAnsiChar; out pBinaryStream: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Sets a binary stream for an object. Currently supported objects are Meshes and Toolpath layers. + * + * @param[in] pWriter - Writer instance. + * @param[in] pInstance - Object instance to assign Binary stream to. + * @param[in] pBinaryStream - Binary stream object to use for this layer. + * @return error code or 0 (success) + *) + TLib3MFWriter_AssignBinaryStreamFunc = function(pWriter: TLib3MFHandle; const pInstance: TLib3MFHandle; const pBinaryStream: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Registers a custom 3MF Namespace. Fails if Prefix is already registered. + * + * @param[in] pWriter - Writer instance. + * @param[in] pPrefix - Prefix to be used. MUST NOT be empty. MUST be alphanumeric, not starting with a number + * @param[in] pNameSpace - Namespace to be used. MUST NOT be empty. MUST be alphanumeric, not starting with a number + * @return error code or 0 (success) + *) + TLib3MFWriter_RegisterCustomNamespaceFunc = function(pWriter: TLib3MFHandle; const pPrefix: PAnsiChar; const pNameSpace: PAnsiChar): TLib3MFResult; cdecl; + + +(************************************************************************************************************************* + Function type definitions for PersistentReaderSource +**************************************************************************************************************************) + + (** + * Retrieves the type of source data. + * + * @param[in] pPersistentReaderSource - PersistentReaderSource instance. + * @param[out] pSourceType - Reader Source Type + * @return error code or 0 (success) + *) + TLib3MFPersistentReaderSource_GetSourceTypeFunc = function(pPersistentReaderSource: TLib3MFHandle; out pSourceType: Integer): TLib3MFResult; cdecl; + + (** + * Invalidates the reader source. Every subsequent read on this data will fail. + * + * @param[in] pPersistentReaderSource - PersistentReaderSource instance. + * @return error code or 0 (success) + *) + TLib3MFPersistentReaderSource_InvalidateSourceDataFunc = function(pPersistentReaderSource: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Checks if the source data is valid. Any read on an invalid source object will fail. + * + * @param[in] pPersistentReaderSource - PersistentReaderSource instance. + * @param[out] pDataIsValid - The source data is valid. + * @return error code or 0 (success) + *) + TLib3MFPersistentReaderSource_SourceDataIsValidFunc = function(pPersistentReaderSource: TLib3MFHandle; out pDataIsValid: Byte): TLib3MFResult; cdecl; + (************************************************************************************************************************* Function type definitions for Reader **************************************************************************************************************************) + (** + * Reads a model from a persistent source object. The object will be referenced until the Model is destroyed or cleared. + * + * @param[in] pReader - Reader instance. + * @param[in] pSource - Source object to read from + * @return error code or 0 (success) + *) + TLib3MFReader_ReadFromPersistentSourceFunc = function(pReader: TLib3MFHandle; const pSource: TLib3MFHandle): TLib3MFResult; cdecl; + (** * Reads a model from a file. The file type is specified by the Model Reader class * @@ -811,3604 +1005,5056 @@ TLib3MFModel = class; (************************************************************************************************************************* - Function type definitions for SliceStackIterator + Function type definitions for CustomXMLAttribute **************************************************************************************************************************) (** - * Returns the SliceStack the iterator points at. + * Retrieves name of the attribute. * - * @param[in] pSliceStackIterator - SliceStackIterator instance. - * @param[out] pResource - returns the SliceStack instance. + * @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. + * @param[in] nNameBufferSize - size of the buffer (including trailing 0) + * @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pNameBuffer - buffer of returns the name of the attribute., may be NULL * @return error code or 0 (success) *) - TLib3MFSliceStackIterator_GetCurrentSliceStackFunc = function(pSliceStackIterator: TLib3MFHandle; out pResource: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFCustomXMLAttribute_GetNameFunc = function(pCustomXMLAttribute: TLib3MFHandle; const nNameBufferSize: Cardinal; out pNameNeededChars: Cardinal; pNameBuffer: PAnsiChar): TLib3MFResult; cdecl; - -(************************************************************************************************************************* - Function type definitions for ObjectIterator -**************************************************************************************************************************) - (** - * Returns the Object the iterator points at. + * Retrieves value of the attribute as string. * - * @param[in] pObjectIterator - ObjectIterator instance. - * @param[out] pResource - returns the Object instance. + * @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. + * @param[in] nValueBufferSize - size of the buffer (including trailing 0) + * @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pValueBuffer - buffer of returns the value of the attribute., may be NULL * @return error code or 0 (success) *) - TLib3MFObjectIterator_GetCurrentObjectFunc = function(pObjectIterator: TLib3MFHandle; out pResource: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFCustomXMLAttribute_GetValueFunc = function(pCustomXMLAttribute: TLib3MFHandle; const nValueBufferSize: Cardinal; out pValueNeededChars: Cardinal; pValueBuffer: PAnsiChar): TLib3MFResult; cdecl; - -(************************************************************************************************************************* - Function type definitions for MeshObjectIterator -**************************************************************************************************************************) - (** - * Returns the MeshObject the iterator points at. + * Checks if the value is a valid integer in the given range. * - * @param[in] pMeshObjectIterator - MeshObjectIterator instance. - * @param[out] pResource - returns the MeshObject instance. + * @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. + * @param[in] nMinValue - Minimum allowed value + * @param[in] nMaxValue - Maximum allowed value + * @param[out] pIsValid - returns if the value is a valid integer. * @return error code or 0 (success) *) - TLib3MFMeshObjectIterator_GetCurrentMeshObjectFunc = function(pMeshObjectIterator: TLib3MFHandle; out pResource: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFCustomXMLAttribute_IsValidIntegerFunc = function(pCustomXMLAttribute: TLib3MFHandle; const nMinValue: Int64; const nMaxValue: Int64; out pIsValid: Byte): TLib3MFResult; cdecl; - -(************************************************************************************************************************* - Function type definitions for ComponentsObjectIterator -**************************************************************************************************************************) - (** - * Returns the ComponentsObject the iterator points at. + * Returns the value as integer. Fails if the value is not a valid integer in the given range. * - * @param[in] pComponentsObjectIterator - ComponentsObjectIterator instance. - * @param[out] pResource - returns the ComponentsObject instance. + * @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. + * @param[in] nMinValue - Minimum allowed value + * @param[in] nMaxValue - Maximum allowed value + * @param[out] pValue - returns the value. * @return error code or 0 (success) *) - TLib3MFComponentsObjectIterator_GetCurrentComponentsObjectFunc = function(pComponentsObjectIterator: TLib3MFHandle; out pResource: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFCustomXMLAttribute_GetIntegerValueFunc = function(pCustomXMLAttribute: TLib3MFHandle; const nMinValue: Int64; const nMaxValue: Int64; out pValue: Int64): TLib3MFResult; cdecl; - -(************************************************************************************************************************* - Function type definitions for Texture2DIterator -**************************************************************************************************************************) - (** - * Returns the Texture2D the iterator points at. + * Checks if the value is a valid double in the given range. * - * @param[in] pTexture2DIterator - Texture2DIterator instance. - * @param[out] pResource - returns the Texture2D instance. + * @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. + * @param[in] dMinValue - Minimum allowed value + * @param[in] dMaxValue - Maximum allowed value + * @param[out] pIsValid - returns if the value is a valid double. * @return error code or 0 (success) *) - TLib3MFTexture2DIterator_GetCurrentTexture2DFunc = function(pTexture2DIterator: TLib3MFHandle; out pResource: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFCustomXMLAttribute_IsValidDoubleFunc = function(pCustomXMLAttribute: TLib3MFHandle; const dMinValue: Double; const dMaxValue: Double; out pIsValid: Byte): TLib3MFResult; cdecl; - -(************************************************************************************************************************* - Function type definitions for BaseMaterialGroupIterator -**************************************************************************************************************************) - (** - * Returns the MaterialGroup the iterator points at. + * Returns the value as double. Fails if the value is not a valid double in the given range. * - * @param[in] pBaseMaterialGroupIterator - BaseMaterialGroupIterator instance. - * @param[out] pResource - returns the BaseMaterialGroup instance. + * @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. + * @param[in] dMinValue - Minimum allowed value + * @param[in] dMaxValue - Maximum allowed value + * @param[out] pValue - returns the value . * @return error code or 0 (success) *) - TLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupFunc = function(pBaseMaterialGroupIterator: TLib3MFHandle; out pResource: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFCustomXMLAttribute_GetDoubleValueFunc = function(pCustomXMLAttribute: TLib3MFHandle; const dMinValue: Double; const dMaxValue: Double; out pValue: Double): TLib3MFResult; cdecl; - -(************************************************************************************************************************* - Function type definitions for ColorGroupIterator -**************************************************************************************************************************) - (** - * Returns the ColorGroup the iterator points at. + * Checks if the value is a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. * - * @param[in] pColorGroupIterator - ColorGroupIterator instance. - * @param[out] pResource - returns the ColorGroup instance. + * @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. + * @param[out] pIsValid - returns if the value is a valid bool. * @return error code or 0 (success) *) - TLib3MFColorGroupIterator_GetCurrentColorGroupFunc = function(pColorGroupIterator: TLib3MFHandle; out pResource: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFCustomXMLAttribute_IsValidBoolFunc = function(pCustomXMLAttribute: TLib3MFHandle; out pIsValid: Byte): TLib3MFResult; cdecl; - -(************************************************************************************************************************* - Function type definitions for Texture2DGroupIterator -**************************************************************************************************************************) - (** - * Returns the Texture2DGroup the iterator points at. + * Returns the value as bool. Fails if the value is not a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. * - * @param[in] pTexture2DGroupIterator - Texture2DGroupIterator instance. - * @param[out] pResource - returns the Texture2DGroup instance. + * @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. + * @param[in] dMinValue - Minimum allowed value + * @param[in] dMaxValue - Maximum allowed value + * @param[out] pValue - returns the value . * @return error code or 0 (success) *) - TLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupFunc = function(pTexture2DGroupIterator: TLib3MFHandle; out pResource: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFCustomXMLAttribute_GetBoolValueFunc = function(pCustomXMLAttribute: TLib3MFHandle; const dMinValue: Double; const dMaxValue: Double; out pValue: Byte): TLib3MFResult; cdecl; - -(************************************************************************************************************************* - Function type definitions for CompositeMaterialsIterator -**************************************************************************************************************************) - (** - * Returns the CompositeMaterials the iterator points at. + * Sets the value of the attribute as string. * - * @param[in] pCompositeMaterialsIterator - CompositeMaterialsIterator instance. - * @param[out] pResource - returns the CompositeMaterials instance. + * @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. + * @param[in] pValue - new value of the attribute. * @return error code or 0 (success) *) - TLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsFunc = function(pCompositeMaterialsIterator: TLib3MFHandle; out pResource: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFCustomXMLAttribute_SetValueFunc = function(pCustomXMLAttribute: TLib3MFHandle; const pValue: PAnsiChar): TLib3MFResult; cdecl; - -(************************************************************************************************************************* - Function type definitions for MultiPropertyGroupIterator -**************************************************************************************************************************) - (** - * Returns the MultiPropertyGroup the iterator points at. + * Sets the value of the attribute as integer. * - * @param[in] pMultiPropertyGroupIterator - MultiPropertyGroupIterator instance. - * @param[out] pResource - returns the MultiPropertyGroup instance. + * @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. + * @param[in] nValue - new value of the attribute. * @return error code or 0 (success) *) - TLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupFunc = function(pMultiPropertyGroupIterator: TLib3MFHandle; out pResource: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFCustomXMLAttribute_SetIntegerValueFunc = function(pCustomXMLAttribute: TLib3MFHandle; const nValue: Int64): TLib3MFResult; cdecl; - -(************************************************************************************************************************* - Function type definitions for MetaData -**************************************************************************************************************************) - (** - * returns the namespace URL of the metadata + * Sets the value of the attribute as double. * - * @param[in] pMetaData - MetaData instance. - * @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) - * @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pNameSpaceBuffer - buffer of the namespace URL of the metadata, may be NULL + * @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. + * @param[in] dValue - new value of the attribute. * @return error code or 0 (success) *) - TLib3MFMetaData_GetNameSpaceFunc = function(pMetaData: TLib3MFHandle; const nNameSpaceBufferSize: Cardinal; out pNameSpaceNeededChars: Cardinal; pNameSpaceBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFCustomXMLAttribute_SetDoubleValueFunc = function(pCustomXMLAttribute: TLib3MFHandle; const dValue: Double): TLib3MFResult; cdecl; (** - * sets a new namespace URL of the metadata + * Sets the value of the attribute as bool. * - * @param[in] pMetaData - MetaData instance. - * @param[in] pNameSpace - the new namespace URL of the metadata + * @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. + * @param[in] bValue - new value of the attribute. * @return error code or 0 (success) *) - TLib3MFMetaData_SetNameSpaceFunc = function(pMetaData: TLib3MFHandle; const pNameSpace: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFCustomXMLAttribute_SetBoolValueFunc = function(pCustomXMLAttribute: TLib3MFHandle; const bValue: Byte): TLib3MFResult; cdecl; (** - * returns the name of a metadata + * Removes the attribute from its parent node. All subsequent calls to the class will fail. * - * @param[in] pMetaData - MetaData instance. + * @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. + * @return error code or 0 (success) + *) + TLib3MFCustomXMLAttribute_RemoveFunc = function(pCustomXMLAttribute: TLib3MFHandle): TLib3MFResult; cdecl; + + +(************************************************************************************************************************* + Function type definitions for CustomXMLNode +**************************************************************************************************************************) + + (** + * Retrieves name of the node. + * + * @param[in] pCustomXMLNode - CustomXMLNode instance. * @param[in] nNameBufferSize - size of the buffer (including trailing 0) * @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pNameBuffer - buffer of the name of the metadata, may be NULL + * @param[out] pNameBuffer - buffer of returns the name of the node., may be NULL * @return error code or 0 (success) *) - TLib3MFMetaData_GetNameFunc = function(pMetaData: TLib3MFHandle; const nNameBufferSize: Cardinal; out pNameNeededChars: Cardinal; pNameBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFCustomXMLNode_GetNameFunc = function(pCustomXMLNode: TLib3MFHandle; const nNameBufferSize: Cardinal; out pNameNeededChars: Cardinal; pNameBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * sets a new name of a metadata + * Retrieves namespace of the node. * - * @param[in] pMetaData - MetaData instance. - * @param[in] pName - the new name of the metadata + * @param[in] pCustomXMLNode - CustomXMLNode instance. + * @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) + * @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pNameSpaceBuffer - buffer of returns the namespace of the node., may be NULL * @return error code or 0 (success) *) - TLib3MFMetaData_SetNameFunc = function(pMetaData: TLib3MFHandle; const pName: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFCustomXMLNode_GetNameSpaceFunc = function(pCustomXMLNode: TLib3MFHandle; const nNameSpaceBufferSize: Cardinal; out pNameSpaceNeededChars: Cardinal; pNameSpaceBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * returns the (namespace+name) of a metadata + * Returns number of attributes. * - * @param[in] pMetaData - MetaData instance. - * @param[in] nKeyBufferSize - size of the buffer (including trailing 0) - * @param[out] pKeyNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pKeyBuffer - buffer of the key (namespace+name) of the metadata, may be NULL + * @param[in] pCustomXMLNode - CustomXMLNode instance. + * @param[out] pCount - returns the number of attributes. * @return error code or 0 (success) *) - TLib3MFMetaData_GetKeyFunc = function(pMetaData: TLib3MFHandle; const nKeyBufferSize: Cardinal; out pKeyNeededChars: Cardinal; pKeyBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFCustomXMLNode_GetAttributeCountFunc = function(pCustomXMLNode: TLib3MFHandle; out pCount: QWord): TLib3MFResult; cdecl; (** - * returns, whether a metadata must be preserved + * Returns attribute instance. Fails if Index is out of range. * - * @param[in] pMetaData - MetaData instance. - * @param[out] pMustPreserve - returns, whether a metadata must be preserved + * @param[in] pCustomXMLNode - CustomXMLNode instance. + * @param[in] nIndex - Index of the attribute to return (0-based). + * @param[out] pAttributeInstance - XML Document attribute. * @return error code or 0 (success) *) - TLib3MFMetaData_GetMustPreserveFunc = function(pMetaData: TLib3MFHandle; out pMustPreserve: Byte): TLib3MFResult; cdecl; + TLib3MFCustomXMLNode_GetAttributeFunc = function(pCustomXMLNode: TLib3MFHandle; const nIndex: QWord; out pAttributeInstance: TLib3MFHandle): TLib3MFResult; cdecl; (** - * sets whether a metadata must be preserved + * Returns if attribute of a specific name exists. * - * @param[in] pMetaData - MetaData instance. - * @param[in] bMustPreserve - a new value whether a metadata must be preserved + * @param[in] pCustomXMLNode - CustomXMLNode instance. + * @param[in] pName - Name of the attribute. + * @param[out] pAttributeExists - Returns if the attribute exists. * @return error code or 0 (success) *) - TLib3MFMetaData_SetMustPreserveFunc = function(pMetaData: TLib3MFHandle; const bMustPreserve: Byte): TLib3MFResult; cdecl; + TLib3MFCustomXMLNode_HasAttributeFunc = function(pCustomXMLNode: TLib3MFHandle; const pName: PAnsiChar; out pAttributeExists: Byte): TLib3MFResult; cdecl; (** - * returns the type of a metadata + * Returns attribute instance of a specific name. * - * @param[in] pMetaData - MetaData instance. - * @param[in] nTypeBufferSize - size of the buffer (including trailing 0) - * @param[out] pTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pTypeBuffer - buffer of the type of the metadata, may be NULL + * @param[in] pCustomXMLNode - CustomXMLNode instance. + * @param[in] pName - Name of the attribute. + * @param[in] bMustExist - If true, the call fails if attribute does not exist. If falls, the call will return null if the attribute does not exist. + * @param[out] pAttributeInstance - XML Document attribute. * @return error code or 0 (success) *) - TLib3MFMetaData_GetTypeFunc = function(pMetaData: TLib3MFHandle; const nTypeBufferSize: Cardinal; out pTypeNeededChars: Cardinal; pTypeBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFCustomXMLNode_FindAttributeFunc = function(pCustomXMLNode: TLib3MFHandle; const pName: PAnsiChar; const bMustExist: Byte; out pAttributeInstance: TLib3MFHandle): TLib3MFResult; cdecl; (** - * sets a new type of a metadata. This must be a simple XML type + * Removes the attribute with a specific name. Does nothing if attribute does not exist. * - * @param[in] pMetaData - MetaData instance. - * @param[in] pType - a new type of the metadata + * @param[in] pCustomXMLNode - CustomXMLNode instance. + * @param[in] pName - Name of the attribute. + * @param[out] pAttributeRemoved - Returns true if an attribute was removed. * @return error code or 0 (success) *) - TLib3MFMetaData_SetTypeFunc = function(pMetaData: TLib3MFHandle; const pType: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFCustomXMLNode_RemoveAttributeFunc = function(pCustomXMLNode: TLib3MFHandle; const pName: PAnsiChar; out pAttributeRemoved: Byte): TLib3MFResult; cdecl; (** - * returns the value of the metadata + * Removes the attribute with a specific index. Fails if index is invalid * - * @param[in] pMetaData - MetaData instance. - * @param[in] nValueBufferSize - size of the buffer (including trailing 0) - * @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pValueBuffer - buffer of the value of the metadata, may be NULL + * @param[in] pCustomXMLNode - CustomXMLNode instance. + * @param[in] nIndex - Index of the attribute to remove (0-based). + * @param[out] pAttributeRemoved - Returns true if an attribute was removed. * @return error code or 0 (success) *) - TLib3MFMetaData_GetValueFunc = function(pMetaData: TLib3MFHandle; const nValueBufferSize: Cardinal; out pValueNeededChars: Cardinal; pValueBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFCustomXMLNode_RemoveAttributeByIndexFunc = function(pCustomXMLNode: TLib3MFHandle; const nIndex: QWord; out pAttributeRemoved: Byte): TLib3MFResult; cdecl; (** - * sets a new value of the metadata + * Adds an attribute with a specific name and string value. Fails if attribute already exists. * - * @param[in] pMetaData - MetaData instance. - * @param[in] pValue - a new value of the metadata + * @param[in] pCustomXMLNode - CustomXMLNode instance. + * @param[in] pName - Name of the attribute. + * @param[in] pValue - Value of the attribute. * @return error code or 0 (success) *) - TLib3MFMetaData_SetValueFunc = function(pMetaData: TLib3MFHandle; const pValue: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFCustomXMLNode_AddAttributeFunc = function(pCustomXMLNode: TLib3MFHandle; const pName: PAnsiChar; const pValue: PAnsiChar): TLib3MFResult; cdecl; - -(************************************************************************************************************************* - Function type definitions for MetaDataGroup -**************************************************************************************************************************) - (** - * returns the number of metadata in this metadatagroup + * Adds an attribute with a specific name and integer value. Fails if attribute already exists. * - * @param[in] pMetaDataGroup - MetaDataGroup instance. - * @param[out] pCount - returns the number metadata + * @param[in] pCustomXMLNode - CustomXMLNode instance. + * @param[in] pName - Name of the attribute. + * @param[in] nValue - Value of the attribute. * @return error code or 0 (success) *) - TLib3MFMetaDataGroup_GetMetaDataCountFunc = function(pMetaDataGroup: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; + TLib3MFCustomXMLNode_AddIntegerAttributeFunc = function(pCustomXMLNode: TLib3MFHandle; const pName: PAnsiChar; const nValue: Int64): TLib3MFResult; cdecl; (** - * returns a metadata value within this metadatagroup + * Adds an attribute with a specific name and double value. Fails if attribute already exists. * - * @param[in] pMetaDataGroup - MetaDataGroup instance. - * @param[in] nIndex - Index of the Metadata. - * @param[out] pMetaData - an instance of the metadata + * @param[in] pCustomXMLNode - CustomXMLNode instance. + * @param[in] pName - Name of the attribute. + * @param[in] dValue - Value of the attribute. * @return error code or 0 (success) *) - TLib3MFMetaDataGroup_GetMetaDataFunc = function(pMetaDataGroup: TLib3MFHandle; const nIndex: Cardinal; out pMetaData: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFCustomXMLNode_AddDoubleAttributeFunc = function(pCustomXMLNode: TLib3MFHandle; const pName: PAnsiChar; const dValue: Double): TLib3MFResult; cdecl; (** - * returns a metadata value within this metadatagroup + * Adds an attribute with a specific name and bool value. Fails if attribute already exists. * - * @param[in] pMetaDataGroup - MetaDataGroup instance. - * @param[in] pNameSpace - the namespace of the metadata - * @param[in] pName - the name of the Metadata - * @param[out] pMetaData - an instance of the metadata + * @param[in] pCustomXMLNode - CustomXMLNode instance. + * @param[in] pName - Name of the attribute. + * @param[in] bValue - Value of the attribute. * @return error code or 0 (success) *) - TLib3MFMetaDataGroup_GetMetaDataByKeyFunc = function(pMetaDataGroup: TLib3MFHandle; const pNameSpace: PAnsiChar; const pName: PAnsiChar; out pMetaData: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFCustomXMLNode_AddBoolAttributeFunc = function(pCustomXMLNode: TLib3MFHandle; const pName: PAnsiChar; const bValue: Byte): TLib3MFResult; cdecl; (** - * removes metadata by index from the model. + * Returns all the child nodes of the XML Node. * - * @param[in] pMetaDataGroup - MetaDataGroup instance. - * @param[in] nIndex - Index of the metadata to remove + * @param[in] pCustomXMLNode - CustomXMLNode instance. + * @param[out] pChildNodes - returns the list of child nodes. * @return error code or 0 (success) *) - TLib3MFMetaDataGroup_RemoveMetaDataByIndexFunc = function(pMetaDataGroup: TLib3MFHandle; const nIndex: Cardinal): TLib3MFResult; cdecl; + TLib3MFCustomXMLNode_GetChildrenFunc = function(pCustomXMLNode: TLib3MFHandle; out pChildNodes: TLib3MFHandle): TLib3MFResult; cdecl; (** - * removes metadata from the model. + * Returns how many children of the XML Node have a specific name. * - * @param[in] pMetaDataGroup - MetaDataGroup instance. - * @param[in] pTheMetaData - The metadata to remove + * @param[in] pCustomXMLNode - CustomXMLNode instance. + * @param[in] pName - Name of the node. + * @param[out] pCount - returns the number children with the specified name. * @return error code or 0 (success) *) - TLib3MFMetaDataGroup_RemoveMetaDataFunc = function(pMetaDataGroup: TLib3MFHandle; const pTheMetaData: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFCustomXMLNode_CountChildrenByNameFunc = function(pCustomXMLNode: TLib3MFHandle; const pName: PAnsiChar; out pCount: QWord): TLib3MFResult; cdecl; (** - * adds a new metadata to this metadatagroup + * Returns all the child nodes of the XML Node with a specific name. * - * @param[in] pMetaDataGroup - MetaDataGroup instance. - * @param[in] pNameSpace - the namespace of the metadata - * @param[in] pName - the name of the metadata - * @param[in] pValue - the value of the metadata - * @param[in] pType - the type of the metadata - * @param[in] bMustPreserve - shuold the metadata be preserved - * @param[out] pMetaData - a new instance of the metadata + * @param[in] pCustomXMLNode - CustomXMLNode instance. + * @param[in] pName - Name of the child. + * @param[out] pChildNodes - returns the list of child nodes. * @return error code or 0 (success) *) - TLib3MFMetaDataGroup_AddMetaDataFunc = function(pMetaDataGroup: TLib3MFHandle; const pNameSpace: PAnsiChar; const pName: PAnsiChar; const pValue: PAnsiChar; const pType: PAnsiChar; const bMustPreserve: Byte; out pMetaData: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFCustomXMLNode_GetChildrenByNameFunc = function(pCustomXMLNode: TLib3MFHandle; const pName: PAnsiChar; out pChildNodes: TLib3MFHandle): TLib3MFResult; cdecl; - -(************************************************************************************************************************* - Function type definitions for Object -**************************************************************************************************************************) - (** - * Retrieves an object's type + * Returns if a child with a specific name exist. * - * @param[in] pObject - Object instance. - * @param[out] pObjectType - returns object type enum. + * @param[in] pCustomXMLNode - CustomXMLNode instance. + * @param[in] pName - Name of the child. + * @param[out] pChildExists - returns if a child with a specific name exists. * @return error code or 0 (success) *) - TLib3MFObject_GetTypeFunc = function(pObject: TLib3MFHandle; out pObjectType: Integer): TLib3MFResult; cdecl; + TLib3MFCustomXMLNode_HasChildFunc = function(pCustomXMLNode: TLib3MFHandle; const pName: PAnsiChar; out pChildExists: Byte): TLib3MFResult; cdecl; (** - * Sets an object's type + * Returns if a child with a specific name exist once and only once. * - * @param[in] pObject - Object instance. - * @param[in] eObjectType - object type enum. + * @param[in] pCustomXMLNode - CustomXMLNode instance. + * @param[in] pName - Name of the child. + * @param[out] pChildExists - returns if a child with a specific name exists once and only once. * @return error code or 0 (success) *) - TLib3MFObject_SetTypeFunc = function(pObject: TLib3MFHandle; const eObjectType: Integer): TLib3MFResult; cdecl; + TLib3MFCustomXMLNode_HasUniqueChildFunc = function(pCustomXMLNode: TLib3MFHandle; const pName: PAnsiChar; out pChildExists: Byte): TLib3MFResult; cdecl; (** - * Retrieves an object's name + * Returns child with a specific name. Throws an error if name does not exist once and only once. * - * @param[in] pObject - Object instance. - * @param[in] nNameBufferSize - size of the buffer (including trailing 0) - * @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pNameBuffer - buffer of returns object name., may be NULL + * @param[in] pCustomXMLNode - CustomXMLNode instance. + * @param[in] pName - Name of the child. + * @param[in] bMustExist - If true, the call fails if child does not exist. If falls, the call will return null if the child does not exist. + * @param[out] pChildInstance - returns child instance or null. * @return error code or 0 (success) *) - TLib3MFObject_GetNameFunc = function(pObject: TLib3MFHandle; const nNameBufferSize: Cardinal; out pNameNeededChars: Cardinal; pNameBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFCustomXMLNode_FindChildFunc = function(pCustomXMLNode: TLib3MFHandle; const pName: PAnsiChar; const bMustExist: Byte; out pChildInstance: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Sets an object's name string + * Adds a new child with a specific name. * - * @param[in] pObject - Object instance. - * @param[in] pName - new object name. + * @param[in] pCustomXMLNode - CustomXMLNode instance. + * @param[in] pName - Name of the child. + * @param[out] pChildInstance - returns child instance. * @return error code or 0 (success) *) - TLib3MFObject_SetNameFunc = function(pObject: TLib3MFHandle; const pName: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFCustomXMLNode_AddChildFunc = function(pCustomXMLNode: TLib3MFHandle; const pName: PAnsiChar; out pChildInstance: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Retrieves an object's part number + * Removes a specific child. All subsequent calls to the child will fail after the call. * - * @param[in] pObject - Object instance. - * @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) - * @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pPartNumberBuffer - buffer of returns object part number., may be NULL + * @param[in] pCustomXMLNode - CustomXMLNode instance. + * @param[in] pChildInstance - child instance to remove. Fails if given instance is not a child of the node. * @return error code or 0 (success) *) - TLib3MFObject_GetPartNumberFunc = function(pObject: TLib3MFHandle; const nPartNumberBufferSize: Cardinal; out pPartNumberNeededChars: Cardinal; pPartNumberBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFCustomXMLNode_RemoveChildFunc = function(pCustomXMLNode: TLib3MFHandle; const pChildInstance: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Sets an objects partnumber string + * Removes all children with a specific name. Does nothing if no child with the name exists. All subsequent calls to the deleted children will fail after the call. * - * @param[in] pObject - Object instance. - * @param[in] pPartNumber - new object part number. + * @param[in] pCustomXMLNode - CustomXMLNode instance. + * @param[in] pName - Name of the children. + * @param[out] pNumberOfDeletedChildren - Returns how many children have been deleted. * @return error code or 0 (success) *) - TLib3MFObject_SetPartNumberFunc = function(pObject: TLib3MFHandle; const pPartNumber: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFCustomXMLNode_RemoveChildrenWithNameFunc = function(pCustomXMLNode: TLib3MFHandle; const pName: PAnsiChar; out pNumberOfDeletedChildren: QWord): TLib3MFResult; cdecl; (** - * Retrieves, if an object is a mesh object + * Removes the node from its parent. The root node of the document can not be removed. Any subsequent call to the node fails after this. * - * @param[in] pObject - Object instance. - * @param[out] pIsMeshObject - returns, whether the object is a mesh object + * @param[in] pCustomXMLNode - CustomXMLNode instance. * @return error code or 0 (success) *) - TLib3MFObject_IsMeshObjectFunc = function(pObject: TLib3MFHandle; out pIsMeshObject: Byte): TLib3MFResult; cdecl; + TLib3MFCustomXMLNode_RemoveFunc = function(pCustomXMLNode: TLib3MFHandle): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Function type definitions for CustomXMLNodes +**************************************************************************************************************************) + (** - * Retrieves, if an object is a components object + * Returns number of nodes. * - * @param[in] pObject - Object instance. - * @param[out] pIsComponentsObject - returns, whether the object is a components object + * @param[in] pCustomXMLNodes - CustomXMLNodes instance. + * @param[out] pCount - returns the number of nodes in the list. * @return error code or 0 (success) *) - TLib3MFObject_IsComponentsObjectFunc = function(pObject: TLib3MFHandle; out pIsComponentsObject: Byte): TLib3MFResult; cdecl; + TLib3MFCustomXMLNodes_GetNodeCountFunc = function(pCustomXMLNodes: TLib3MFHandle; out pCount: QWord): TLib3MFResult; cdecl; (** - * Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. + * Returns node instance. Fails if Index is out of range. * - * @param[in] pObject - Object instance. - * @param[out] pIsValid - returns whether the object is a valid object description + * @param[in] pCustomXMLNodes - CustomXMLNodes instance. + * @param[in] nIndex - Index of the node to return (0-based). + * @param[out] pNodeInstance - XML Node node. * @return error code or 0 (success) *) - TLib3MFObject_IsValidFunc = function(pObject: TLib3MFHandle; out pIsValid: Byte): TLib3MFResult; cdecl; + TLib3MFCustomXMLNodes_GetNodeFunc = function(pCustomXMLNodes: TLib3MFHandle; const nIndex: QWord; out pNodeInstance: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Use an existing attachment as thumbnail for this object + * Returns how many nodes of the XML Node have a specific name. * - * @param[in] pObject - Object instance. - * @param[in] pAttachment - Instance of a new or the existing thumbnailattachment object. + * @param[in] pCustomXMLNodes - CustomXMLNodes instance. + * @param[in] pName - Name of the node. + * @param[out] pCount - returns the number of nodes with the specified name. * @return error code or 0 (success) *) - TLib3MFObject_SetAttachmentAsThumbnailFunc = function(pObject: TLib3MFHandle; const pAttachment: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFCustomXMLNodes_CountNodesByNameFunc = function(pCustomXMLNodes: TLib3MFHandle; const pName: PAnsiChar; out pCount: QWord): TLib3MFResult; cdecl; (** - * Get the attachment containing the object thumbnail. + * Returns all the nodes nodes of the XML Node with a specific name. * - * @param[in] pObject - Object instance. - * @param[out] pAttachment - Instance of the thumbnailattachment object or NULL. + * @param[in] pCustomXMLNodes - CustomXMLNodes instance. + * @param[in] pName - Name of the node. + * @param[out] pNodes - returns the list of node nodes. * @return error code or 0 (success) *) - TLib3MFObject_GetThumbnailAttachmentFunc = function(pObject: TLib3MFHandle; out pAttachment: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFCustomXMLNodes_GetNodesByNameFunc = function(pCustomXMLNodes: TLib3MFHandle; const pName: PAnsiChar; out pNodes: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Clears the attachment. The attachment instance is not removed from the package. + * Returns if a node with a specific name exist. * - * @param[in] pObject - Object instance. + * @param[in] pCustomXMLNodes - CustomXMLNodes instance. + * @param[in] pName - Name of the node. + * @param[out] pNodeExists - returns if a node with a specific name exists. * @return error code or 0 (success) *) - TLib3MFObject_ClearThumbnailAttachmentFunc = function(pObject: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFCustomXMLNodes_HasNodeFunc = function(pCustomXMLNodes: TLib3MFHandle; const pName: PAnsiChar; out pNodeExists: Byte): TLib3MFResult; cdecl; (** - * Returns the outbox of a build item + * Returns if a node with a specific name exist once and only once. * - * @param[in] pObject - Object instance. - * @param[out] pOutbox - Outbox of this build item + * @param[in] pCustomXMLNodes - CustomXMLNodes instance. + * @param[in] pName - Name of the node. + * @param[out] pNodeExists - returns if a node with a specific name exists once and only once. * @return error code or 0 (success) *) - TLib3MFObject_GetOutboxFunc = function(pObject: TLib3MFHandle; pOutbox: PLib3MFBox): TLib3MFResult; cdecl; + TLib3MFCustomXMLNodes_HasUniqueNodeFunc = function(pCustomXMLNodes: TLib3MFHandle; const pName: PAnsiChar; out pNodeExists: Byte): TLib3MFResult; cdecl; (** - * Retrieves an object's uuid string (see production extension specification) + * Returns node with a specific name. Throws an error if name does not exist once and only once. * - * @param[in] pObject - Object instance. - * @param[out] pHasUUID - flag whether the build item has a UUID - * @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) - * @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pUUIDBuffer - buffer of returns object uuid., may be NULL + * @param[in] pCustomXMLNodes - CustomXMLNodes instance. + * @param[in] pName - Name of the node. + * @param[in] bMustExist - If true, the call fails if node does not exist. If falls, the call will return null if the node does not exist. + * @param[out] pNodeInstance - returns node instance. * @return error code or 0 (success) *) - TLib3MFObject_GetUUIDFunc = function(pObject: TLib3MFHandle; out pHasUUID: Byte; const nUUIDBufferSize: Cardinal; out pUUIDNeededChars: Cardinal; pUUIDBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFCustomXMLNodes_FindNodeFunc = function(pCustomXMLNodes: TLib3MFHandle; const pName: PAnsiChar; const bMustExist: Byte; out pNodeInstance: TLib3MFHandle): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Function type definitions for CustomDOMTree +**************************************************************************************************************************) + (** - * Sets a build object's uuid string (see production extension specification) + * Returns the namespace identifier for the DOM Tree. * - * @param[in] pObject - Object instance. - * @param[in] pUUID - new object uuid string. + * @param[in] pCustomDOMTree - CustomDOMTree instance. + * @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) + * @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pNameSpaceBuffer - buffer of returns the namespace of the DOM Tree., may be NULL * @return error code or 0 (success) *) - TLib3MFObject_SetUUIDFunc = function(pObject: TLib3MFHandle; const pUUID: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFCustomDOMTree_GetNameSpaceFunc = function(pCustomDOMTree: TLib3MFHandle; const nNameSpaceBufferSize: Cardinal; out pNameSpaceNeededChars: Cardinal; pNameSpaceBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * Returns the metadatagroup of this object + * Returns root node of the tree. * - * @param[in] pObject - Object instance. - * @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this object + * @param[in] pCustomDOMTree - CustomDOMTree instance. + * @param[out] pRootNode - Root node of the document. * @return error code or 0 (success) *) - TLib3MFObject_GetMetaDataGroupFunc = function(pObject: TLib3MFHandle; out pMetaDataGroup: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFCustomDOMTree_GetRootNodeFunc = function(pCustomDOMTree: TLib3MFHandle; out pRootNode: TLib3MFHandle): TLib3MFResult; cdecl; (** - * set the meshresolution of the mesh object + * Saves the XML tree into a string. * - * @param[in] pObject - Object instance. - * @param[in] eMeshResolution - meshresolution of this object + * @param[in] pCustomDOMTree - CustomDOMTree instance. + * @param[in] nXMLStringBufferSize - size of the buffer (including trailing 0) + * @param[out] pXMLStringNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pXMLStringBuffer - buffer of String with the XML Content., may be NULL * @return error code or 0 (success) *) - TLib3MFObject_SetSlicesMeshResolutionFunc = function(pObject: TLib3MFHandle; const eMeshResolution: Integer): TLib3MFResult; cdecl; + TLib3MFCustomDOMTree_SaveToStringFunc = function(pCustomDOMTree: TLib3MFHandle; const nXMLStringBufferSize: Cardinal; out pXMLStringNeededChars: Cardinal; pXMLStringBuffer: PAnsiChar): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Function type definitions for SliceStackIterator +**************************************************************************************************************************) + (** - * get the meshresolution of the mesh object + * Returns the SliceStack the iterator points at. * - * @param[in] pObject - Object instance. - * @param[out] pMeshResolution - meshresolution of this object + * @param[in] pSliceStackIterator - SliceStackIterator instance. + * @param[out] pResource - returns the SliceStack instance. * @return error code or 0 (success) *) - TLib3MFObject_GetSlicesMeshResolutionFunc = function(pObject: TLib3MFHandle; out pMeshResolution: Integer): TLib3MFResult; cdecl; + TLib3MFSliceStackIterator_GetCurrentSliceStackFunc = function(pSliceStackIterator: TLib3MFHandle; out pResource: TLib3MFHandle): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Function type definitions for ObjectIterator +**************************************************************************************************************************) + (** - * returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack + * Returns the Object the iterator points at. * - * @param[in] pObject - Object instance. - * @param[in] bRecursive - check also all referenced objects? - * @param[out] pHasSlices - does the object have a slice stack? + * @param[in] pObjectIterator - ObjectIterator instance. + * @param[out] pResource - returns the Object instance. * @return error code or 0 (success) *) - TLib3MFObject_HasSlicesFunc = function(pObject: TLib3MFHandle; const bRecursive: Byte; out pHasSlices: Byte): TLib3MFResult; cdecl; + TLib3MFObjectIterator_GetCurrentObjectFunc = function(pObjectIterator: TLib3MFHandle; out pResource: TLib3MFHandle): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Function type definitions for MeshObjectIterator +**************************************************************************************************************************) + (** - * unlinks the attached slicestack from this object. If no slice stack is attached, do noting. + * Returns the MeshObject the iterator points at. * - * @param[in] pObject - Object instance. + * @param[in] pMeshObjectIterator - MeshObjectIterator instance. + * @param[out] pResource - returns the MeshObject instance. * @return error code or 0 (success) *) - TLib3MFObject_ClearSliceStackFunc = function(pObject: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFMeshObjectIterator_GetCurrentMeshObjectFunc = function(pMeshObjectIterator: TLib3MFHandle; out pResource: TLib3MFHandle): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Function type definitions for ComponentsObjectIterator +**************************************************************************************************************************) + (** - * get the Slicestack attached to the object + * Returns the ComponentsObject the iterator points at. * - * @param[in] pObject - Object instance. - * @param[out] pSliceStackInstance - returns the slicestack instance + * @param[in] pComponentsObjectIterator - ComponentsObjectIterator instance. + * @param[out] pResource - returns the ComponentsObject instance. * @return error code or 0 (success) *) - TLib3MFObject_GetSliceStackFunc = function(pObject: TLib3MFHandle; out pSliceStackInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFComponentsObjectIterator_GetCurrentComponentsObjectFunc = function(pComponentsObjectIterator: TLib3MFHandle; out pResource: TLib3MFHandle): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Function type definitions for Texture2DIterator +**************************************************************************************************************************) + (** - * assigns a slicestack to the object + * Returns the Texture2D the iterator points at. * - * @param[in] pObject - Object instance. - * @param[in] pSliceStackInstance - the new slice stack of this Object + * @param[in] pTexture2DIterator - Texture2DIterator instance. + * @param[out] pResource - returns the Texture2D instance. * @return error code or 0 (success) *) - TLib3MFObject_AssignSliceStackFunc = function(pObject: TLib3MFHandle; const pSliceStackInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFTexture2DIterator_GetCurrentTexture2DFunc = function(pTexture2DIterator: TLib3MFHandle; out pResource: TLib3MFHandle): TLib3MFResult; cdecl; (************************************************************************************************************************* - Function type definitions for MeshObject + Function type definitions for BaseMaterialGroupIterator **************************************************************************************************************************) (** - * Returns the vertex count of a mesh object. + * Returns the MaterialGroup the iterator points at. * - * @param[in] pMeshObject - MeshObject instance. - * @param[out] pVertexCount - filled with the vertex count. + * @param[in] pBaseMaterialGroupIterator - BaseMaterialGroupIterator instance. + * @param[out] pResource - returns the BaseMaterialGroup instance. * @return error code or 0 (success) *) - TLib3MFMeshObject_GetVertexCountFunc = function(pMeshObject: TLib3MFHandle; out pVertexCount: Cardinal): TLib3MFResult; cdecl; + TLib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupFunc = function(pBaseMaterialGroupIterator: TLib3MFHandle; out pResource: TLib3MFHandle): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Function type definitions for ColorGroupIterator +**************************************************************************************************************************) + (** - * Returns the triangle count of a mesh object. + * Returns the ColorGroup the iterator points at. * - * @param[in] pMeshObject - MeshObject instance. - * @param[out] pVertexCount - filled with the triangle count. + * @param[in] pColorGroupIterator - ColorGroupIterator instance. + * @param[out] pResource - returns the ColorGroup instance. * @return error code or 0 (success) *) - TLib3MFMeshObject_GetTriangleCountFunc = function(pMeshObject: TLib3MFHandle; out pVertexCount: Cardinal): TLib3MFResult; cdecl; + TLib3MFColorGroupIterator_GetCurrentColorGroupFunc = function(pColorGroupIterator: TLib3MFHandle; out pResource: TLib3MFHandle): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Function type definitions for Texture2DGroupIterator +**************************************************************************************************************************) + (** - * Returns the vertex count of a mesh object. + * Returns the Texture2DGroup the iterator points at. * - * @param[in] pMeshObject - MeshObject instance. - * @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) - * @param[out] pCoordinates - filled with the vertex coordinates. + * @param[in] pTexture2DGroupIterator - Texture2DGroupIterator instance. + * @param[out] pResource - returns the Texture2DGroup instance. * @return error code or 0 (success) *) - TLib3MFMeshObject_GetVertexFunc = function(pMeshObject: TLib3MFHandle; const nIndex: Cardinal; pCoordinates: PLib3MFPosition): TLib3MFResult; cdecl; + TLib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupFunc = function(pTexture2DGroupIterator: TLib3MFHandle; out pResource: TLib3MFHandle): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Function type definitions for CompositeMaterialsIterator +**************************************************************************************************************************) + (** - * Sets the coordinates of a single vertex of a mesh object + * Returns the CompositeMaterials the iterator points at. * - * @param[in] pMeshObject - MeshObject instance. - * @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) - * @param[in] pCoordinates - contains the vertex coordinates. + * @param[in] pCompositeMaterialsIterator - CompositeMaterialsIterator instance. + * @param[out] pResource - returns the CompositeMaterials instance. * @return error code or 0 (success) *) - TLib3MFMeshObject_SetVertexFunc = function(pMeshObject: TLib3MFHandle; const nIndex: Cardinal; const pCoordinates: PLib3MFPosition): TLib3MFResult; cdecl; + TLib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsFunc = function(pCompositeMaterialsIterator: TLib3MFHandle; out pResource: TLib3MFHandle): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Function type definitions for MultiPropertyGroupIterator +**************************************************************************************************************************) + (** - * Adds a single vertex to a mesh object + * Returns the MultiPropertyGroup the iterator points at. * - * @param[in] pMeshObject - MeshObject instance. - * @param[in] pCoordinates - contains the vertex coordinates. - * @param[out] pNewIndex - Index of the new vertex + * @param[in] pMultiPropertyGroupIterator - MultiPropertyGroupIterator instance. + * @param[out] pResource - returns the MultiPropertyGroup instance. * @return error code or 0 (success) *) - TLib3MFMeshObject_AddVertexFunc = function(pMeshObject: TLib3MFHandle; const pCoordinates: PLib3MFPosition; out pNewIndex: Cardinal): TLib3MFResult; cdecl; + TLib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupFunc = function(pMultiPropertyGroupIterator: TLib3MFHandle; out pResource: TLib3MFHandle): TLib3MFResult; cdecl; - (** - * Obtains all vertex positions of a mesh object + +(************************************************************************************************************************* + Function type definitions for MetaData +**************************************************************************************************************************) + + (** + * returns the namespace URL of the metadata * - * @param[in] pMeshObject - MeshObject instance. - * @param[in] nVerticesCount - Number of elements in buffer - * @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. - * @param[out] pVerticesBuffer - Position buffer of contains the vertex coordinates. + * @param[in] pMetaData - MetaData instance. + * @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) + * @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pNameSpaceBuffer - buffer of the namespace URL of the metadata, may be NULL * @return error code or 0 (success) *) - TLib3MFMeshObject_GetVerticesFunc = function(pMeshObject: TLib3MFHandle; const nVerticesCount: QWord; out pVerticesNeededCount: QWord; pVerticesBuffer: PLib3MFPosition): TLib3MFResult; cdecl; + TLib3MFMetaData_GetNameSpaceFunc = function(pMetaData: TLib3MFHandle; const nNameSpaceBufferSize: Cardinal; out pNameSpaceNeededChars: Cardinal; pNameSpaceBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * Returns indices of a single triangle of a mesh object. + * sets a new namespace URL of the metadata * - * @param[in] pMeshObject - MeshObject instance. - * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) - * @param[out] pIndices - filled with the triangle indices. + * @param[in] pMetaData - MetaData instance. + * @param[in] pNameSpace - the new namespace URL of the metadata * @return error code or 0 (success) *) - TLib3MFMeshObject_GetTriangleFunc = function(pMeshObject: TLib3MFHandle; const nIndex: Cardinal; pIndices: PLib3MFTriangle): TLib3MFResult; cdecl; + TLib3MFMetaData_SetNameSpaceFunc = function(pMetaData: TLib3MFHandle; const pNameSpace: PAnsiChar): TLib3MFResult; cdecl; (** - * Sets the indices of a single triangle of a mesh object. + * returns the name of a metadata * - * @param[in] pMeshObject - MeshObject instance. - * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) - * @param[in] pIndices - contains the triangle indices. + * @param[in] pMetaData - MetaData instance. + * @param[in] nNameBufferSize - size of the buffer (including trailing 0) + * @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pNameBuffer - buffer of the name of the metadata, may be NULL * @return error code or 0 (success) *) - TLib3MFMeshObject_SetTriangleFunc = function(pMeshObject: TLib3MFHandle; const nIndex: Cardinal; const pIndices: PLib3MFTriangle): TLib3MFResult; cdecl; + TLib3MFMetaData_GetNameFunc = function(pMetaData: TLib3MFHandle; const nNameBufferSize: Cardinal; out pNameNeededChars: Cardinal; pNameBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * Adds a single triangle to a mesh object + * sets a new name of a metadata * - * @param[in] pMeshObject - MeshObject instance. - * @param[in] pIndices - contains the triangle indices. - * @param[out] pNewIndex - Index of the new triangle + * @param[in] pMetaData - MetaData instance. + * @param[in] pName - the new name of the metadata * @return error code or 0 (success) *) - TLib3MFMeshObject_AddTriangleFunc = function(pMeshObject: TLib3MFHandle; const pIndices: PLib3MFTriangle; out pNewIndex: Cardinal): TLib3MFResult; cdecl; + TLib3MFMetaData_SetNameFunc = function(pMetaData: TLib3MFHandle; const pName: PAnsiChar): TLib3MFResult; cdecl; (** - * Get all triangles of a mesh object + * returns the (namespace+name) of a metadata * - * @param[in] pMeshObject - MeshObject instance. - * @param[in] nIndicesCount - Number of elements in buffer - * @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. - * @param[out] pIndicesBuffer - Triangle buffer of contains the triangle indices. + * @param[in] pMetaData - MetaData instance. + * @param[in] nKeyBufferSize - size of the buffer (including trailing 0) + * @param[out] pKeyNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pKeyBuffer - buffer of the key (namespace+name) of the metadata, may be NULL * @return error code or 0 (success) *) - TLib3MFMeshObject_GetTriangleIndicesFunc = function(pMeshObject: TLib3MFHandle; const nIndicesCount: QWord; out pIndicesNeededCount: QWord; pIndicesBuffer: PLib3MFTriangle): TLib3MFResult; cdecl; + TLib3MFMetaData_GetKeyFunc = function(pMetaData: TLib3MFHandle; const nKeyBufferSize: Cardinal; out pKeyNeededChars: Cardinal; pKeyBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * Sets the property at the object-level of the mesh object. + * returns, whether a metadata must be preserved * - * @param[in] pMeshObject - MeshObject instance. - * @param[in] nUniqueResourceID - the object-level Property UniqueResourceID. - * @param[in] nPropertyID - the object-level PropertyID. + * @param[in] pMetaData - MetaData instance. + * @param[out] pMustPreserve - returns, whether a metadata must be preserved * @return error code or 0 (success) *) - TLib3MFMeshObject_SetObjectLevelPropertyFunc = function(pMeshObject: TLib3MFHandle; const nUniqueResourceID: Cardinal; const nPropertyID: Cardinal): TLib3MFResult; cdecl; + TLib3MFMetaData_GetMustPreserveFunc = function(pMetaData: TLib3MFHandle; out pMustPreserve: Byte): TLib3MFResult; cdecl; (** - * Gets the property at the object-level of the mesh object. + * sets whether a metadata must be preserved * - * @param[in] pMeshObject - MeshObject instance. - * @param[out] pUniqueResourceID - the object-level Property UniqueResourceID. - * @param[out] pPropertyID - the object-level PropertyID. - * @param[out] pHasObjectLevelProperty - Has an object-level property been specified? + * @param[in] pMetaData - MetaData instance. + * @param[in] bMustPreserve - a new value whether a metadata must be preserved * @return error code or 0 (success) *) - TLib3MFMeshObject_GetObjectLevelPropertyFunc = function(pMeshObject: TLib3MFHandle; out pUniqueResourceID: Cardinal; out pPropertyID: Cardinal; out pHasObjectLevelProperty: Byte): TLib3MFResult; cdecl; + TLib3MFMetaData_SetMustPreserveFunc = function(pMetaData: TLib3MFHandle; const bMustPreserve: Byte): TLib3MFResult; cdecl; (** - * Sets the properties of a single triangle of a mesh object. + * returns the type of a metadata * - * @param[in] pMeshObject - MeshObject instance. - * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) - * @param[in] pProperties - contains the triangle properties. + * @param[in] pMetaData - MetaData instance. + * @param[in] nTypeBufferSize - size of the buffer (including trailing 0) + * @param[out] pTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pTypeBuffer - buffer of the type of the metadata, may be NULL * @return error code or 0 (success) *) - TLib3MFMeshObject_SetTrianglePropertiesFunc = function(pMeshObject: TLib3MFHandle; const nIndex: Cardinal; const pProperties: PLib3MFTriangleProperties): TLib3MFResult; cdecl; + TLib3MFMetaData_GetTypeFunc = function(pMetaData: TLib3MFHandle; const nTypeBufferSize: Cardinal; out pTypeNeededChars: Cardinal; pTypeBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * Gets the properties of a single triangle of a mesh object. + * sets a new type of a metadata. This must be a simple XML type * - * @param[in] pMeshObject - MeshObject instance. - * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) - * @param[out] pProperty - returns the triangle properties. + * @param[in] pMetaData - MetaData instance. + * @param[in] pType - a new type of the metadata * @return error code or 0 (success) *) - TLib3MFMeshObject_GetTrianglePropertiesFunc = function(pMeshObject: TLib3MFHandle; const nIndex: Cardinal; pProperty: PLib3MFTriangleProperties): TLib3MFResult; cdecl; + TLib3MFMetaData_SetTypeFunc = function(pMetaData: TLib3MFHandle; const pType: PAnsiChar): TLib3MFResult; cdecl; (** - * Sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. + * returns the value of the metadata * - * @param[in] pMeshObject - MeshObject instance. - * @param[in] nPropertiesArrayCount - Number of elements in buffer - * @param[in] pPropertiesArrayBuffer - TriangleProperties buffer of contains the triangle properties array. Must have trianglecount elements. + * @param[in] pMetaData - MetaData instance. + * @param[in] nValueBufferSize - size of the buffer (including trailing 0) + * @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pValueBuffer - buffer of the value of the metadata, may be NULL * @return error code or 0 (success) *) - TLib3MFMeshObject_SetAllTrianglePropertiesFunc = function(pMeshObject: TLib3MFHandle; const nPropertiesArrayCount: QWord; const pPropertiesArrayBuffer: PLib3MFTriangleProperties): TLib3MFResult; cdecl; + TLib3MFMetaData_GetValueFunc = function(pMetaData: TLib3MFHandle; const nValueBufferSize: Cardinal; out pValueNeededChars: Cardinal; pValueBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * Gets the properties of all triangles of a mesh object. + * sets a new value of the metadata * - * @param[in] pMeshObject - MeshObject instance. - * @param[in] nPropertiesArrayCount - Number of elements in buffer - * @param[out] pPropertiesArrayNeededCount - will be filled with the count of the written elements, or needed buffer size. - * @param[out] pPropertiesArrayBuffer - TriangleProperties buffer of returns the triangle properties array. Must have trianglecount elements. + * @param[in] pMetaData - MetaData instance. + * @param[in] pValue - a new value of the metadata * @return error code or 0 (success) *) - TLib3MFMeshObject_GetAllTrianglePropertiesFunc = function(pMeshObject: TLib3MFHandle; const nPropertiesArrayCount: QWord; out pPropertiesArrayNeededCount: QWord; pPropertiesArrayBuffer: PLib3MFTriangleProperties): TLib3MFResult; cdecl; + TLib3MFMetaData_SetValueFunc = function(pMetaData: TLib3MFHandle; const pValue: PAnsiChar): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Function type definitions for MetaDataGroup +**************************************************************************************************************************) + (** - * Clears all properties of this mesh object (triangle and object-level). + * returns the number of metadata in this metadatagroup * - * @param[in] pMeshObject - MeshObject instance. + * @param[in] pMetaDataGroup - MetaDataGroup instance. + * @param[out] pCount - returns the number metadata * @return error code or 0 (success) *) - TLib3MFMeshObject_ClearAllPropertiesFunc = function(pMeshObject: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFMetaDataGroup_GetMetaDataCountFunc = function(pMetaDataGroup: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; (** - * Set all triangles of a mesh object + * returns a metadata value within this metadatagroup * - * @param[in] pMeshObject - MeshObject instance. - * @param[in] nVerticesCount - Number of elements in buffer - * @param[in] pVerticesBuffer - Position buffer of contains the positions. - * @param[in] nIndicesCount - Number of elements in buffer - * @param[in] pIndicesBuffer - Triangle buffer of contains the triangle indices. + * @param[in] pMetaDataGroup - MetaDataGroup instance. + * @param[in] nIndex - Index of the Metadata. + * @param[out] pMetaData - an instance of the metadata * @return error code or 0 (success) *) - TLib3MFMeshObject_SetGeometryFunc = function(pMeshObject: TLib3MFHandle; const nVerticesCount: QWord; const pVerticesBuffer: PLib3MFPosition; const nIndicesCount: QWord; const pIndicesBuffer: PLib3MFTriangle): TLib3MFResult; cdecl; + TLib3MFMetaDataGroup_GetMetaDataFunc = function(pMetaDataGroup: TLib3MFHandle; const nIndex: Cardinal; out pMetaData: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. + * returns a metadata value within this metadatagroup * - * @param[in] pMeshObject - MeshObject instance. - * @param[out] pIsManifoldAndOriented - returns, if the object is oriented and manifold. + * @param[in] pMetaDataGroup - MetaDataGroup instance. + * @param[in] pNameSpace - the namespace of the metadata + * @param[in] pName - the name of the Metadata + * @param[out] pMetaData - an instance of the metadata * @return error code or 0 (success) *) - TLib3MFMeshObject_IsManifoldAndOrientedFunc = function(pMeshObject: TLib3MFHandle; out pIsManifoldAndOriented: Byte): TLib3MFResult; cdecl; + TLib3MFMetaDataGroup_GetMetaDataByKeyFunc = function(pMetaDataGroup: TLib3MFHandle; const pNameSpace: PAnsiChar; const pName: PAnsiChar; out pMetaData: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Retrieves the BeamLattice within this MeshObject. + * removes metadata by index from the model. * - * @param[in] pMeshObject - MeshObject instance. - * @param[out] pTheBeamLattice - the BeamLattice within this MeshObject + * @param[in] pMetaDataGroup - MetaDataGroup instance. + * @param[in] nIndex - Index of the metadata to remove * @return error code or 0 (success) *) - TLib3MFMeshObject_BeamLatticeFunc = function(pMeshObject: TLib3MFHandle; out pTheBeamLattice: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFMetaDataGroup_RemoveMetaDataByIndexFunc = function(pMetaDataGroup: TLib3MFHandle; const nIndex: Cardinal): TLib3MFResult; cdecl; - -(************************************************************************************************************************* - Function type definitions for BeamLattice -**************************************************************************************************************************) - (** - * Returns the minimal length of beams for the beamlattice. + * removes metadata from the model. * - * @param[in] pBeamLattice - BeamLattice instance. - * @param[out] pMinLength - minimal length of beams for the beamlattice + * @param[in] pMetaDataGroup - MetaDataGroup instance. + * @param[in] pTheMetaData - The metadata to remove * @return error code or 0 (success) *) - TLib3MFBeamLattice_GetMinLengthFunc = function(pBeamLattice: TLib3MFHandle; out pMinLength: Double): TLib3MFResult; cdecl; + TLib3MFMetaDataGroup_RemoveMetaDataFunc = function(pMetaDataGroup: TLib3MFHandle; const pTheMetaData: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Sets the minimal length of beams for the beamlattice. + * adds a new metadata to this metadatagroup * - * @param[in] pBeamLattice - BeamLattice instance. - * @param[in] dMinLength - minimal length of beams for the beamlattice + * @param[in] pMetaDataGroup - MetaDataGroup instance. + * @param[in] pNameSpace - the namespace of the metadata + * @param[in] pName - the name of the metadata + * @param[in] pValue - the value of the metadata + * @param[in] pType - the type of the metadata + * @param[in] bMustPreserve - shuold the metadata be preserved + * @param[out] pMetaData - a new instance of the metadata * @return error code or 0 (success) *) - TLib3MFBeamLattice_SetMinLengthFunc = function(pBeamLattice: TLib3MFHandle; const dMinLength: Double): TLib3MFResult; cdecl; + TLib3MFMetaDataGroup_AddMetaDataFunc = function(pMetaDataGroup: TLib3MFHandle; const pNameSpace: PAnsiChar; const pName: PAnsiChar; const pValue: PAnsiChar; const pType: PAnsiChar; const bMustPreserve: Byte; out pMetaData: TLib3MFHandle): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Function type definitions for Object +**************************************************************************************************************************) + (** - * Returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. + * Retrieves an object's type * - * @param[in] pBeamLattice - BeamLattice instance. - * @param[out] pClipMode - contains the clip mode of this mesh - * @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object or an undefined value if pClipMode is MODELBEAMLATTICECLIPMODE_NONE + * @param[in] pObject - Object instance. + * @param[out] pObjectType - returns object type enum. * @return error code or 0 (success) *) - TLib3MFBeamLattice_GetClippingFunc = function(pBeamLattice: TLib3MFHandle; out pClipMode: Integer; out pUniqueResourceID: Cardinal): TLib3MFResult; cdecl; + TLib3MFObject_GetTypeFunc = function(pObject: TLib3MFHandle; out pObjectType: Integer): TLib3MFResult; cdecl; (** - * Sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. + * Sets an object's type * - * @param[in] pBeamLattice - BeamLattice instance. - * @param[in] eClipMode - contains the clip mode of this mesh - * @param[in] nUniqueResourceID - the UniqueResourceID of the clipping mesh-object. This mesh-object has to be defined before setting the Clipping. + * @param[in] pObject - Object instance. + * @param[in] eObjectType - object type enum. * @return error code or 0 (success) *) - TLib3MFBeamLattice_SetClippingFunc = function(pBeamLattice: TLib3MFHandle; const eClipMode: Integer; const nUniqueResourceID: Cardinal): TLib3MFResult; cdecl; + TLib3MFObject_SetTypeFunc = function(pObject: TLib3MFHandle; const eObjectType: Integer): TLib3MFResult; cdecl; (** - * Returns the representation-mesh for the beamlattice of this mesh. + * Retrieves an object's name * - * @param[in] pBeamLattice - BeamLattice instance. - * @param[out] pHasRepresentation - flag whether the beamlattice has a representation mesh. - * @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object. + * @param[in] pObject - Object instance. + * @param[in] nNameBufferSize - size of the buffer (including trailing 0) + * @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pNameBuffer - buffer of returns object name., may be NULL * @return error code or 0 (success) *) - TLib3MFBeamLattice_GetRepresentationFunc = function(pBeamLattice: TLib3MFHandle; out pHasRepresentation: Byte; out pUniqueResourceID: Cardinal): TLib3MFResult; cdecl; + TLib3MFObject_GetNameFunc = function(pObject: TLib3MFHandle; const nNameBufferSize: Cardinal; out pNameNeededChars: Cardinal; pNameBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * Sets the representation-mesh for the beamlattice of this mesh. + * Sets an object's name string * - * @param[in] pBeamLattice - BeamLattice instance. - * @param[in] nUniqueResourceID - the UniqueResourceID of the representation mesh-object. This mesh-object has to be defined before setting the representation. + * @param[in] pObject - Object instance. + * @param[in] pName - new object name. * @return error code or 0 (success) *) - TLib3MFBeamLattice_SetRepresentationFunc = function(pBeamLattice: TLib3MFHandle; const nUniqueResourceID: Cardinal): TLib3MFResult; cdecl; + TLib3MFObject_SetNameFunc = function(pObject: TLib3MFHandle; const pName: PAnsiChar): TLib3MFResult; cdecl; (** - * Returns the ball mode and the default ball radius for the beamlattice of this mesh. + * Retrieves an object's part number * - * @param[in] pBeamLattice - BeamLattice instance. - * @param[out] pBallMode - contains the ball mode of this mesh - * @param[out] pBallRadius - default ball radius of balls for the beamlattice + * @param[in] pObject - Object instance. + * @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) + * @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pPartNumberBuffer - buffer of returns object part number., may be NULL * @return error code or 0 (success) *) - TLib3MFBeamLattice_GetBallOptionsFunc = function(pBeamLattice: TLib3MFHandle; out pBallMode: Integer; out pBallRadius: Double): TLib3MFResult; cdecl; + TLib3MFObject_GetPartNumberFunc = function(pObject: TLib3MFHandle; const nPartNumberBufferSize: Cardinal; out pPartNumberNeededChars: Cardinal; pPartNumberBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * Sets the ball mode and thedefault ball radius for the beamlattice. + * Sets an objects partnumber string * - * @param[in] pBeamLattice - BeamLattice instance. - * @param[in] eBallMode - contains the ball mode of this mesh - * @param[in] dBallRadius - default ball radius of balls for the beamlattice + * @param[in] pObject - Object instance. + * @param[in] pPartNumber - new object part number. * @return error code or 0 (success) *) - TLib3MFBeamLattice_SetBallOptionsFunc = function(pBeamLattice: TLib3MFHandle; const eBallMode: Integer; const dBallRadius: Double): TLib3MFResult; cdecl; + TLib3MFObject_SetPartNumberFunc = function(pObject: TLib3MFHandle; const pPartNumber: PAnsiChar): TLib3MFResult; cdecl; (** - * Returns the beam count of a mesh object. + * Retrieves, if an object is a mesh object * - * @param[in] pBeamLattice - BeamLattice instance. - * @param[out] pCount - filled with the beam count. + * @param[in] pObject - Object instance. + * @param[out] pIsMeshObject - returns, whether the object is a mesh object * @return error code or 0 (success) *) - TLib3MFBeamLattice_GetBeamCountFunc = function(pBeamLattice: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; + TLib3MFObject_IsMeshObjectFunc = function(pObject: TLib3MFHandle; out pIsMeshObject: Byte): TLib3MFResult; cdecl; (** - * Returns indices, radii and capmodes of a single beam of a mesh object. + * Retrieves, if an object is a components object * - * @param[in] pBeamLattice - BeamLattice instance. - * @param[in] nIndex - Index of the beam (0 to beamcount - 1). - * @param[out] pBeamInfo - filled with the beam indices, radii and capmodes. + * @param[in] pObject - Object instance. + * @param[out] pIsComponentsObject - returns, whether the object is a components object * @return error code or 0 (success) *) - TLib3MFBeamLattice_GetBeamFunc = function(pBeamLattice: TLib3MFHandle; const nIndex: Cardinal; pBeamInfo: PLib3MFBeam): TLib3MFResult; cdecl; + TLib3MFObject_IsComponentsObjectFunc = function(pObject: TLib3MFHandle; out pIsComponentsObject: Byte): TLib3MFResult; cdecl; (** - * Adds a single beam to a mesh object. + * Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. * - * @param[in] pBeamLattice - BeamLattice instance. - * @param[in] pBeamInfo - contains the node indices, radii and capmodes. - * @param[out] pIndex - filled with the new Index of the beam. + * @param[in] pObject - Object instance. + * @param[out] pIsValid - returns whether the object is a valid object description * @return error code or 0 (success) *) - TLib3MFBeamLattice_AddBeamFunc = function(pBeamLattice: TLib3MFHandle; const pBeamInfo: PLib3MFBeam; out pIndex: Cardinal): TLib3MFResult; cdecl; + TLib3MFObject_IsValidFunc = function(pObject: TLib3MFHandle; out pIsValid: Byte): TLib3MFResult; cdecl; (** - * Sets the indices, radii and capmodes of a single beam of a mesh object. + * Use an existing attachment as thumbnail for this object * - * @param[in] pBeamLattice - BeamLattice instance. - * @param[in] nIndex - Index of the beam (0 to beamcount - 1). - * @param[in] pBeamInfo - filled with the beam indices, radii and capmodes. + * @param[in] pObject - Object instance. + * @param[in] pAttachment - Instance of a new or the existing thumbnailattachment object. * @return error code or 0 (success) *) - TLib3MFBeamLattice_SetBeamFunc = function(pBeamLattice: TLib3MFHandle; const nIndex: Cardinal; const pBeamInfo: PLib3MFBeam): TLib3MFResult; cdecl; + TLib3MFObject_SetAttachmentAsThumbnailFunc = function(pObject: TLib3MFHandle; const pAttachment: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Sets all beam indices, radii and capmodes of a mesh object. + * Get the attachment containing the object thumbnail. * - * @param[in] pBeamLattice - BeamLattice instance. - * @param[in] nBeamInfoCount - Number of elements in buffer - * @param[in] pBeamInfoBuffer - Beam buffer of contains information of a number of beams + * @param[in] pObject - Object instance. + * @param[out] pAttachment - Instance of the thumbnailattachment object or NULL. * @return error code or 0 (success) *) - TLib3MFBeamLattice_SetBeamsFunc = function(pBeamLattice: TLib3MFHandle; const nBeamInfoCount: QWord; const pBeamInfoBuffer: PLib3MFBeam): TLib3MFResult; cdecl; + TLib3MFObject_GetThumbnailAttachmentFunc = function(pObject: TLib3MFHandle; out pAttachment: TLib3MFHandle): TLib3MFResult; cdecl; (** - * obtains all beam indices, radii and capmodes of a mesh object. + * Clears the attachment. The attachment instance is not removed from the package. * - * @param[in] pBeamLattice - BeamLattice instance. - * @param[in] nBeamInfoCount - Number of elements in buffer - * @param[out] pBeamInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. - * @param[out] pBeamInfoBuffer - Beam buffer of contains information of all beams + * @param[in] pObject - Object instance. * @return error code or 0 (success) *) - TLib3MFBeamLattice_GetBeamsFunc = function(pBeamLattice: TLib3MFHandle; const nBeamInfoCount: QWord; out pBeamInfoNeededCount: QWord; pBeamInfoBuffer: PLib3MFBeam): TLib3MFResult; cdecl; + TLib3MFObject_ClearThumbnailAttachmentFunc = function(pObject: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Returns the ball count of a mesh object. + * Returns the outbox of a build item * - * @param[in] pBeamLattice - BeamLattice instance. - * @param[out] pCount - filled with the ball count. + * @param[in] pObject - Object instance. + * @param[out] pOutbox - Outbox of this build item * @return error code or 0 (success) *) - TLib3MFBeamLattice_GetBallCountFunc = function(pBeamLattice: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; + TLib3MFObject_GetOutboxFunc = function(pObject: TLib3MFHandle; pOutbox: PLib3MFBox): TLib3MFResult; cdecl; (** - * Returns index and radius of a single ball of a mesh object. + * Retrieves an object's uuid string (see production extension specification) * - * @param[in] pBeamLattice - BeamLattice instance. - * @param[in] nIndex - Index of the ball (0 to ballcount - 1). - * @param[out] pBallInfo - filled with the ball node index and radius. + * @param[in] pObject - Object instance. + * @param[out] pHasUUID - flag whether the build item has a UUID + * @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) + * @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pUUIDBuffer - buffer of returns object uuid., may be NULL * @return error code or 0 (success) *) - TLib3MFBeamLattice_GetBallFunc = function(pBeamLattice: TLib3MFHandle; const nIndex: Cardinal; pBallInfo: PLib3MFBall): TLib3MFResult; cdecl; + TLib3MFObject_GetUUIDFunc = function(pObject: TLib3MFHandle; out pHasUUID: Byte; const nUUIDBufferSize: Cardinal; out pUUIDNeededChars: Cardinal; pUUIDBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * Adds a single ball to a mesh object. + * Sets a build object's uuid string (see production extension specification) * - * @param[in] pBeamLattice - BeamLattice instance. - * @param[in] pBallInfo - contains the node index and radius. - * @param[out] pIndex - filled with the new Index of the ball. + * @param[in] pObject - Object instance. + * @param[in] pUUID - new object uuid string. * @return error code or 0 (success) *) - TLib3MFBeamLattice_AddBallFunc = function(pBeamLattice: TLib3MFHandle; const pBallInfo: PLib3MFBall; out pIndex: Cardinal): TLib3MFResult; cdecl; + TLib3MFObject_SetUUIDFunc = function(pObject: TLib3MFHandle; const pUUID: PAnsiChar): TLib3MFResult; cdecl; (** - * Sets the index and radius of a single ball of a mesh object. + * Returns the metadatagroup of this object * - * @param[in] pBeamLattice - BeamLattice instance. - * @param[in] nIndex - Index of the ball (0 to ballcount - 1). - * @param[in] pBallInfo - filled with the ball node index and radius. + * @param[in] pObject - Object instance. + * @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this object * @return error code or 0 (success) *) - TLib3MFBeamLattice_SetBallFunc = function(pBeamLattice: TLib3MFHandle; const nIndex: Cardinal; const pBallInfo: PLib3MFBall): TLib3MFResult; cdecl; + TLib3MFObject_GetMetaDataGroupFunc = function(pObject: TLib3MFHandle; out pMetaDataGroup: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Sets all ball indices and radii of a mesh object. + * set the meshresolution of the mesh object * - * @param[in] pBeamLattice - BeamLattice instance. - * @param[in] nBallInfoCount - Number of elements in buffer - * @param[in] pBallInfoBuffer - Ball buffer of contains information of a number of balls + * @param[in] pObject - Object instance. + * @param[in] eMeshResolution - meshresolution of this object * @return error code or 0 (success) *) - TLib3MFBeamLattice_SetBallsFunc = function(pBeamLattice: TLib3MFHandle; const nBallInfoCount: QWord; const pBallInfoBuffer: PLib3MFBall): TLib3MFResult; cdecl; + TLib3MFObject_SetSlicesMeshResolutionFunc = function(pObject: TLib3MFHandle; const eMeshResolution: Integer): TLib3MFResult; cdecl; (** - * obtains all ball indices and radii of a mesh object. + * get the meshresolution of the mesh object * - * @param[in] pBeamLattice - BeamLattice instance. - * @param[in] nBallInfoCount - Number of elements in buffer - * @param[out] pBallInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. - * @param[out] pBallInfoBuffer - Ball buffer of contains information of all balls + * @param[in] pObject - Object instance. + * @param[out] pMeshResolution - meshresolution of this object * @return error code or 0 (success) *) - TLib3MFBeamLattice_GetBallsFunc = function(pBeamLattice: TLib3MFHandle; const nBallInfoCount: QWord; out pBallInfoNeededCount: QWord; pBallInfoBuffer: PLib3MFBall): TLib3MFResult; cdecl; + TLib3MFObject_GetSlicesMeshResolutionFunc = function(pObject: TLib3MFHandle; out pMeshResolution: Integer): TLib3MFResult; cdecl; (** - * Returns the number of beamsets of a mesh object. + * returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack * - * @param[in] pBeamLattice - BeamLattice instance. - * @param[out] pCount - filled with the beamset count. + * @param[in] pObject - Object instance. + * @param[in] bRecursive - check also all referenced objects? + * @param[out] pHasSlices - does the object have a slice stack? * @return error code or 0 (success) *) - TLib3MFBeamLattice_GetBeamSetCountFunc = function(pBeamLattice: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; + TLib3MFObject_HasSlicesFunc = function(pObject: TLib3MFHandle; const bRecursive: Byte; out pHasSlices: Byte): TLib3MFResult; cdecl; (** - * Adds an empty beamset to a mesh object + * unlinks the attached slicestack from this object. If no slice stack is attached, do noting. * - * @param[in] pBeamLattice - BeamLattice instance. - * @param[out] pBeamSet - the new beamset + * @param[in] pObject - Object instance. * @return error code or 0 (success) *) - TLib3MFBeamLattice_AddBeamSetFunc = function(pBeamLattice: TLib3MFHandle; out pBeamSet: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFObject_ClearSliceStackFunc = function(pObject: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Returns a beamset of a mesh object + * get the Slicestack attached to the object * - * @param[in] pBeamLattice - BeamLattice instance. - * @param[in] nIndex - index of the requested beamset (0 ... beamsetcount-1). - * @param[out] pBeamSet - the requested beamset + * @param[in] pObject - Object instance. + * @param[out] pSliceStackInstance - returns the slicestack instance * @return error code or 0 (success) *) - TLib3MFBeamLattice_GetBeamSetFunc = function(pBeamLattice: TLib3MFHandle; const nIndex: Cardinal; out pBeamSet: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFObject_GetSliceStackFunc = function(pObject: TLib3MFHandle; out pSliceStackInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * assigns a slicestack to the object + * + * @param[in] pObject - Object instance. + * @param[in] pSliceStackInstance - the new slice stack of this Object + * @return error code or 0 (success) + *) + TLib3MFObject_AssignSliceStackFunc = function(pObject: TLib3MFHandle; const pSliceStackInstance: TLib3MFHandle): TLib3MFResult; cdecl; (************************************************************************************************************************* - Function type definitions for Component + Function type definitions for MeshObject **************************************************************************************************************************) (** - * Returns the Resource Instance of the component. + * Returns the vertex count of a mesh object. * - * @param[in] pComponent - Component instance. - * @param[out] pObjectResource - filled with the Resource Instance. + * @param[in] pMeshObject - MeshObject instance. + * @param[out] pVertexCount - filled with the vertex count. * @return error code or 0 (success) *) - TLib3MFComponent_GetObjectResourceFunc = function(pComponent: TLib3MFHandle; out pObjectResource: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFMeshObject_GetVertexCountFunc = function(pMeshObject: TLib3MFHandle; out pVertexCount: Cardinal): TLib3MFResult; cdecl; (** - * Returns the UniqueResourceID of the component. + * Returns the triangle count of a mesh object. * - * @param[in] pComponent - Component instance. - * @param[out] pUniqueResourceID - returns the UniqueResourceID. + * @param[in] pMeshObject - MeshObject instance. + * @param[out] pVertexCount - filled with the triangle count. * @return error code or 0 (success) *) - TLib3MFComponent_GetObjectResourceIDFunc = function(pComponent: TLib3MFHandle; out pUniqueResourceID: Cardinal): TLib3MFResult; cdecl; + TLib3MFMeshObject_GetTriangleCountFunc = function(pMeshObject: TLib3MFHandle; out pVertexCount: Cardinal): TLib3MFResult; cdecl; (** - * returns, whether a component has a UUID and, if true, the component's UUID + * Returns the vertex count of a mesh object. * - * @param[in] pComponent - Component instance. - * @param[out] pHasUUID - flag whether the component has a UUID - * @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) - * @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL + * @param[in] pMeshObject - MeshObject instance. + * @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) + * @param[out] pCoordinates - filled with the vertex coordinates. * @return error code or 0 (success) *) - TLib3MFComponent_GetUUIDFunc = function(pComponent: TLib3MFHandle; out pHasUUID: Byte; const nUUIDBufferSize: Cardinal; out pUUIDNeededChars: Cardinal; pUUIDBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFMeshObject_GetVertexFunc = function(pMeshObject: TLib3MFHandle; const nIndex: Cardinal; pCoordinates: PLib3MFPosition): TLib3MFResult; cdecl; (** - * sets the component's UUID + * Sets the coordinates of a single vertex of a mesh object * - * @param[in] pComponent - Component instance. - * @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + * @param[in] pMeshObject - MeshObject instance. + * @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) + * @param[in] pCoordinates - contains the vertex coordinates. * @return error code or 0 (success) *) - TLib3MFComponent_SetUUIDFunc = function(pComponent: TLib3MFHandle; const pUUID: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFMeshObject_SetVertexFunc = function(pMeshObject: TLib3MFHandle; const nIndex: Cardinal; const pCoordinates: PLib3MFPosition): TLib3MFResult; cdecl; (** - * Returns, if the component has a different transformation than the identity matrix + * Adds a single vertex to a mesh object * - * @param[in] pComponent - Component instance. - * @param[out] pHasTransform - if true is returned, the transformation is not equal than the identity + * @param[in] pMeshObject - MeshObject instance. + * @param[in] pCoordinates - contains the vertex coordinates. + * @param[out] pNewIndex - Index of the new vertex * @return error code or 0 (success) *) - TLib3MFComponent_HasTransformFunc = function(pComponent: TLib3MFHandle; out pHasTransform: Byte): TLib3MFResult; cdecl; + TLib3MFMeshObject_AddVertexFunc = function(pMeshObject: TLib3MFHandle; const pCoordinates: PLib3MFPosition; out pNewIndex: Cardinal): TLib3MFResult; cdecl; (** - * Returns the transformation matrix of the component. + * Obtains all vertex positions of a mesh object * - * @param[in] pComponent - Component instance. - * @param[out] pTransform - filled with the component transformation matrix + * @param[in] pMeshObject - MeshObject instance. + * @param[in] nVerticesCount - Number of elements in buffer + * @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. + * @param[out] pVerticesBuffer - Position buffer of contains the vertex coordinates. * @return error code or 0 (success) *) - TLib3MFComponent_GetTransformFunc = function(pComponent: TLib3MFHandle; pTransform: PLib3MFTransform): TLib3MFResult; cdecl; + TLib3MFMeshObject_GetVerticesFunc = function(pMeshObject: TLib3MFHandle; const nVerticesCount: QWord; out pVerticesNeededCount: QWord; pVerticesBuffer: PLib3MFPosition): TLib3MFResult; cdecl; (** - * Sets the transformation matrix of the component. + * Returns indices of a single triangle of a mesh object. * - * @param[in] pComponent - Component instance. - * @param[in] pTransform - new transformation matrix + * @param[in] pMeshObject - MeshObject instance. + * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) + * @param[out] pIndices - filled with the triangle indices. * @return error code or 0 (success) *) - TLib3MFComponent_SetTransformFunc = function(pComponent: TLib3MFHandle; const pTransform: PLib3MFTransform): TLib3MFResult; cdecl; + TLib3MFMeshObject_GetTriangleFunc = function(pMeshObject: TLib3MFHandle; const nIndex: Cardinal; pIndices: PLib3MFTriangle): TLib3MFResult; cdecl; - -(************************************************************************************************************************* - Function type definitions for ComponentsObject -**************************************************************************************************************************) - (** - * Adds a new component to a components object. + * Sets the indices of a single triangle of a mesh object. * - * @param[in] pComponentsObject - ComponentsObject instance. - * @param[in] pObjectResource - object to add as component. Must not lead to circular references! - * @param[in] pTransform - optional transform matrix for the component. - * @param[out] pComponentInstance - new component instance + * @param[in] pMeshObject - MeshObject instance. + * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) + * @param[in] pIndices - contains the triangle indices. * @return error code or 0 (success) *) - TLib3MFComponentsObject_AddComponentFunc = function(pComponentsObject: TLib3MFHandle; const pObjectResource: TLib3MFHandle; const pTransform: PLib3MFTransform; out pComponentInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFMeshObject_SetTriangleFunc = function(pMeshObject: TLib3MFHandle; const nIndex: Cardinal; const pIndices: PLib3MFTriangle): TLib3MFResult; cdecl; (** - * Retrieves a component from a component object. + * Adds a single triangle to a mesh object * - * @param[in] pComponentsObject - ComponentsObject instance. - * @param[in] nIndex - index of the component to retrieve (0 to componentcount - 1) - * @param[out] pComponentInstance - component instance + * @param[in] pMeshObject - MeshObject instance. + * @param[in] pIndices - contains the triangle indices. + * @param[out] pNewIndex - Index of the new triangle * @return error code or 0 (success) *) - TLib3MFComponentsObject_GetComponentFunc = function(pComponentsObject: TLib3MFHandle; const nIndex: Cardinal; out pComponentInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFMeshObject_AddTriangleFunc = function(pMeshObject: TLib3MFHandle; const pIndices: PLib3MFTriangle; out pNewIndex: Cardinal): TLib3MFResult; cdecl; (** - * Retrieves a component count of a component object. + * Get all triangles of a mesh object * - * @param[in] pComponentsObject - ComponentsObject instance. - * @param[out] pCount - returns the component count + * @param[in] pMeshObject - MeshObject instance. + * @param[in] nIndicesCount - Number of elements in buffer + * @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. + * @param[out] pIndicesBuffer - Triangle buffer of contains the triangle indices. * @return error code or 0 (success) *) - TLib3MFComponentsObject_GetComponentCountFunc = function(pComponentsObject: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; + TLib3MFMeshObject_GetTriangleIndicesFunc = function(pMeshObject: TLib3MFHandle; const nIndicesCount: QWord; out pIndicesNeededCount: QWord; pIndicesBuffer: PLib3MFTriangle): TLib3MFResult; cdecl; - -(************************************************************************************************************************* - Function type definitions for BeamSet -**************************************************************************************************************************) - (** - * Sets a beamset's name string + * Sets the property at the object-level of the mesh object. * - * @param[in] pBeamSet - BeamSet instance. - * @param[in] pName - new name of the beamset. + * @param[in] pMeshObject - MeshObject instance. + * @param[in] nUniqueResourceID - the object-level Property UniqueResourceID. + * @param[in] nPropertyID - the object-level PropertyID. * @return error code or 0 (success) *) - TLib3MFBeamSet_SetNameFunc = function(pBeamSet: TLib3MFHandle; const pName: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFMeshObject_SetObjectLevelPropertyFunc = function(pMeshObject: TLib3MFHandle; const nUniqueResourceID: Cardinal; const nPropertyID: Cardinal): TLib3MFResult; cdecl; (** - * Retrieves a beamset's name string + * Gets the property at the object-level of the mesh object. * - * @param[in] pBeamSet - BeamSet instance. - * @param[in] nNameBufferSize - size of the buffer (including trailing 0) - * @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pNameBuffer - buffer of returns the name of the beamset., may be NULL + * @param[in] pMeshObject - MeshObject instance. + * @param[out] pUniqueResourceID - the object-level Property UniqueResourceID. + * @param[out] pPropertyID - the object-level PropertyID. + * @param[out] pHasObjectLevelProperty - Has an object-level property been specified? * @return error code or 0 (success) *) - TLib3MFBeamSet_GetNameFunc = function(pBeamSet: TLib3MFHandle; const nNameBufferSize: Cardinal; out pNameNeededChars: Cardinal; pNameBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFMeshObject_GetObjectLevelPropertyFunc = function(pMeshObject: TLib3MFHandle; out pUniqueResourceID: Cardinal; out pPropertyID: Cardinal; out pHasObjectLevelProperty: Byte): TLib3MFResult; cdecl; (** - * Sets a beamset's identifier string + * Sets the properties of a single triangle of a mesh object. * - * @param[in] pBeamSet - BeamSet instance. - * @param[in] pIdentifier - new name of the beamset. + * @param[in] pMeshObject - MeshObject instance. + * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) + * @param[in] pProperties - contains the triangle properties. * @return error code or 0 (success) *) - TLib3MFBeamSet_SetIdentifierFunc = function(pBeamSet: TLib3MFHandle; const pIdentifier: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFMeshObject_SetTrianglePropertiesFunc = function(pMeshObject: TLib3MFHandle; const nIndex: Cardinal; const pProperties: PLib3MFTriangleProperties): TLib3MFResult; cdecl; (** - * Retrieves a beamset's identifier string + * Gets the properties of a single triangle of a mesh object. * - * @param[in] pBeamSet - BeamSet instance. - * @param[in] nIdentifierBufferSize - size of the buffer (including trailing 0) - * @param[out] pIdentifierNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pIdentifierBuffer - buffer of returns the identifier of the beamset., may be NULL + * @param[in] pMeshObject - MeshObject instance. + * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) + * @param[out] pProperty - returns the triangle properties. * @return error code or 0 (success) *) - TLib3MFBeamSet_GetIdentifierFunc = function(pBeamSet: TLib3MFHandle; const nIdentifierBufferSize: Cardinal; out pIdentifierNeededChars: Cardinal; pIdentifierBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFMeshObject_GetTrianglePropertiesFunc = function(pMeshObject: TLib3MFHandle; const nIndex: Cardinal; pProperty: PLib3MFTriangleProperties): TLib3MFResult; cdecl; (** - * Retrieves the reference count of a beamset + * Sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. * - * @param[in] pBeamSet - BeamSet instance. - * @param[out] pCount - returns the reference count + * @param[in] pMeshObject - MeshObject instance. + * @param[in] nPropertiesArrayCount - Number of elements in buffer + * @param[in] pPropertiesArrayBuffer - TriangleProperties buffer of contains the triangle properties array. Must have trianglecount elements. * @return error code or 0 (success) *) - TLib3MFBeamSet_GetReferenceCountFunc = function(pBeamSet: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; + TLib3MFMeshObject_SetAllTrianglePropertiesFunc = function(pMeshObject: TLib3MFHandle; const nPropertiesArrayCount: QWord; const pPropertiesArrayBuffer: PLib3MFTriangleProperties): TLib3MFResult; cdecl; (** - * Sets the references of a beamset + * Gets the properties of all triangles of a mesh object. * - * @param[in] pBeamSet - BeamSet instance. - * @param[in] nReferencesCount - Number of elements in buffer - * @param[in] pReferencesBuffer - uint32 buffer of the new indices of all beams in this beamset + * @param[in] pMeshObject - MeshObject instance. + * @param[in] nPropertiesArrayCount - Number of elements in buffer + * @param[out] pPropertiesArrayNeededCount - will be filled with the count of the written elements, or needed buffer size. + * @param[out] pPropertiesArrayBuffer - TriangleProperties buffer of returns the triangle properties array. Must have trianglecount elements. * @return error code or 0 (success) *) - TLib3MFBeamSet_SetReferencesFunc = function(pBeamSet: TLib3MFHandle; const nReferencesCount: QWord; const pReferencesBuffer: PCardinal): TLib3MFResult; cdecl; + TLib3MFMeshObject_GetAllTrianglePropertiesFunc = function(pMeshObject: TLib3MFHandle; const nPropertiesArrayCount: QWord; out pPropertiesArrayNeededCount: QWord; pPropertiesArrayBuffer: PLib3MFTriangleProperties): TLib3MFResult; cdecl; (** - * Retrieves the references of a beamset + * Clears all properties of this mesh object (triangle and object-level). * - * @param[in] pBeamSet - BeamSet instance. - * @param[in] nReferencesCount - Number of elements in buffer - * @param[out] pReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. - * @param[out] pReferencesBuffer - uint32 buffer of retrieves the indices of all beams in this beamset + * @param[in] pMeshObject - MeshObject instance. * @return error code or 0 (success) *) - TLib3MFBeamSet_GetReferencesFunc = function(pBeamSet: TLib3MFHandle; const nReferencesCount: QWord; out pReferencesNeededCount: QWord; pReferencesBuffer: PCardinal): TLib3MFResult; cdecl; + TLib3MFMeshObject_ClearAllPropertiesFunc = function(pMeshObject: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Retrieves the ball reference count of a beamset + * Set all triangles of a mesh object * - * @param[in] pBeamSet - BeamSet instance. - * @param[out] pCount - returns the ball reference count + * @param[in] pMeshObject - MeshObject instance. + * @param[in] nVerticesCount - Number of elements in buffer + * @param[in] pVerticesBuffer - Position buffer of contains the positions. + * @param[in] nIndicesCount - Number of elements in buffer + * @param[in] pIndicesBuffer - Triangle buffer of contains the triangle indices. * @return error code or 0 (success) *) - TLib3MFBeamSet_GetBallReferenceCountFunc = function(pBeamSet: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; + TLib3MFMeshObject_SetGeometryFunc = function(pMeshObject: TLib3MFHandle; const nVerticesCount: QWord; const pVerticesBuffer: PLib3MFPosition; const nIndicesCount: QWord; const pIndicesBuffer: PLib3MFTriangle): TLib3MFResult; cdecl; (** - * Sets the ball references of a beamset + * Retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. * - * @param[in] pBeamSet - BeamSet instance. - * @param[in] nBallReferencesCount - Number of elements in buffer - * @param[in] pBallReferencesBuffer - uint32 buffer of the new indices of all balls in this beamset + * @param[in] pMeshObject - MeshObject instance. + * @param[out] pIsManifoldAndOriented - returns, if the object is oriented and manifold. * @return error code or 0 (success) *) - TLib3MFBeamSet_SetBallReferencesFunc = function(pBeamSet: TLib3MFHandle; const nBallReferencesCount: QWord; const pBallReferencesBuffer: PCardinal): TLib3MFResult; cdecl; + TLib3MFMeshObject_IsManifoldAndOrientedFunc = function(pMeshObject: TLib3MFHandle; out pIsManifoldAndOriented: Byte): TLib3MFResult; cdecl; (** - * Retrieves the ball references of a beamset + * Retrieves the BeamLattice within this MeshObject. * - * @param[in] pBeamSet - BeamSet instance. - * @param[in] nBallReferencesCount - Number of elements in buffer - * @param[out] pBallReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. - * @param[out] pBallReferencesBuffer - uint32 buffer of retrieves the indices of all balls in this beamset + * @param[in] pMeshObject - MeshObject instance. + * @param[out] pTheBeamLattice - the BeamLattice within this MeshObject * @return error code or 0 (success) *) - TLib3MFBeamSet_GetBallReferencesFunc = function(pBeamSet: TLib3MFHandle; const nBallReferencesCount: QWord; out pBallReferencesNeededCount: QWord; pBallReferencesBuffer: PCardinal): TLib3MFResult; cdecl; + TLib3MFMeshObject_BeamLatticeFunc = function(pMeshObject: TLib3MFHandle; out pTheBeamLattice: TLib3MFHandle): TLib3MFResult; cdecl; (************************************************************************************************************************* - Function type definitions for BaseMaterialGroup + Function type definitions for BeamLattice **************************************************************************************************************************) (** - * Retrieves the count of base materials in the material group. + * Returns the minimal length of beams for the beamlattice. * - * @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. - * @param[out] pCount - returns the count of base materials. + * @param[in] pBeamLattice - BeamLattice instance. + * @param[out] pMinLength - minimal length of beams for the beamlattice * @return error code or 0 (success) *) - TLib3MFBaseMaterialGroup_GetCountFunc = function(pBaseMaterialGroup: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; + TLib3MFBeamLattice_GetMinLengthFunc = function(pBeamLattice: TLib3MFHandle; out pMinLength: Double): TLib3MFResult; cdecl; (** - * returns all the PropertyIDs of all materials in this group + * Sets the minimal length of beams for the beamlattice. * - * @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. - * @param[in] nPropertyIDsCount - Number of elements in buffer - * @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. - * @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the material in the material group. + * @param[in] pBeamLattice - BeamLattice instance. + * @param[in] dMinLength - minimal length of beams for the beamlattice * @return error code or 0 (success) *) - TLib3MFBaseMaterialGroup_GetAllPropertyIDsFunc = function(pBaseMaterialGroup: TLib3MFHandle; const nPropertyIDsCount: QWord; out pPropertyIDsNeededCount: QWord; pPropertyIDsBuffer: PCardinal): TLib3MFResult; cdecl; + TLib3MFBeamLattice_SetMinLengthFunc = function(pBeamLattice: TLib3MFHandle; const dMinLength: Double): TLib3MFResult; cdecl; (** - * Adds a new material to the material group + * Returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. * - * @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. - * @param[in] pName - new name of the base material. - * @param[in] pDisplayColor - Display color of the material - * @param[out] pPropertyID - returns new PropertyID of the new material in the material group. + * @param[in] pBeamLattice - BeamLattice instance. + * @param[out] pClipMode - contains the clip mode of this mesh + * @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object or an undefined value if pClipMode is MODELBEAMLATTICECLIPMODE_NONE * @return error code or 0 (success) *) - TLib3MFBaseMaterialGroup_AddMaterialFunc = function(pBaseMaterialGroup: TLib3MFHandle; const pName: PAnsiChar; const pDisplayColor: PLib3MFColor; out pPropertyID: Cardinal): TLib3MFResult; cdecl; + TLib3MFBeamLattice_GetClippingFunc = function(pBeamLattice: TLib3MFHandle; out pClipMode: Integer; out pUniqueResourceID: Cardinal): TLib3MFResult; cdecl; (** - * Removes a material from the material group. + * Sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. * - * @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. - * @param[in] nPropertyID - PropertyID of the material in the material group. + * @param[in] pBeamLattice - BeamLattice instance. + * @param[in] eClipMode - contains the clip mode of this mesh + * @param[in] nUniqueResourceID - the UniqueResourceID of the clipping mesh-object. This mesh-object has to be defined before setting the Clipping. * @return error code or 0 (success) *) - TLib3MFBaseMaterialGroup_RemoveMaterialFunc = function(pBaseMaterialGroup: TLib3MFHandle; const nPropertyID: Cardinal): TLib3MFResult; cdecl; + TLib3MFBeamLattice_SetClippingFunc = function(pBeamLattice: TLib3MFHandle; const eClipMode: Integer; const nUniqueResourceID: Cardinal): TLib3MFResult; cdecl; (** - * Returns the base material's name + * Returns the representation-mesh for the beamlattice of this mesh. * - * @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. - * @param[in] nPropertyID - PropertyID of the material in the material group. - * @param[in] nNameBufferSize - size of the buffer (including trailing 0) - * @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pNameBuffer - buffer of returns the name of the base material., may be NULL + * @param[in] pBeamLattice - BeamLattice instance. + * @param[out] pHasRepresentation - flag whether the beamlattice has a representation mesh. + * @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object. * @return error code or 0 (success) *) - TLib3MFBaseMaterialGroup_GetNameFunc = function(pBaseMaterialGroup: TLib3MFHandle; const nPropertyID: Cardinal; const nNameBufferSize: Cardinal; out pNameNeededChars: Cardinal; pNameBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFBeamLattice_GetRepresentationFunc = function(pBeamLattice: TLib3MFHandle; out pHasRepresentation: Byte; out pUniqueResourceID: Cardinal): TLib3MFResult; cdecl; (** - * Sets a base material's name + * Sets the representation-mesh for the beamlattice of this mesh. * - * @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. - * @param[in] nPropertyID - PropertyID of the material in the material group. - * @param[in] pName - new name of the base material. + * @param[in] pBeamLattice - BeamLattice instance. + * @param[in] nUniqueResourceID - the UniqueResourceID of the representation mesh-object. This mesh-object has to be defined before setting the representation. * @return error code or 0 (success) *) - TLib3MFBaseMaterialGroup_SetNameFunc = function(pBaseMaterialGroup: TLib3MFHandle; const nPropertyID: Cardinal; const pName: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFBeamLattice_SetRepresentationFunc = function(pBeamLattice: TLib3MFHandle; const nUniqueResourceID: Cardinal): TLib3MFResult; cdecl; (** - * Sets a base material's display color. + * Returns the ball mode and the default ball radius for the beamlattice of this mesh. * - * @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. - * @param[in] nPropertyID - PropertyID of the material in the material group. - * @param[in] pTheColor - The base material's display color + * @param[in] pBeamLattice - BeamLattice instance. + * @param[out] pBallMode - contains the ball mode of this mesh + * @param[out] pBallRadius - default ball radius of balls for the beamlattice * @return error code or 0 (success) *) - TLib3MFBaseMaterialGroup_SetDisplayColorFunc = function(pBaseMaterialGroup: TLib3MFHandle; const nPropertyID: Cardinal; const pTheColor: PLib3MFColor): TLib3MFResult; cdecl; + TLib3MFBeamLattice_GetBallOptionsFunc = function(pBeamLattice: TLib3MFHandle; out pBallMode: Integer; out pBallRadius: Double): TLib3MFResult; cdecl; (** - * Returns a base material's display color. + * Sets the ball mode and thedefault ball radius for the beamlattice. * - * @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. - * @param[in] nPropertyID - PropertyID of the material in the material group. - * @param[out] pTheColor - The base material's display color + * @param[in] pBeamLattice - BeamLattice instance. + * @param[in] eBallMode - contains the ball mode of this mesh + * @param[in] dBallRadius - default ball radius of balls for the beamlattice * @return error code or 0 (success) *) - TLib3MFBaseMaterialGroup_GetDisplayColorFunc = function(pBaseMaterialGroup: TLib3MFHandle; const nPropertyID: Cardinal; pTheColor: PLib3MFColor): TLib3MFResult; cdecl; + TLib3MFBeamLattice_SetBallOptionsFunc = function(pBeamLattice: TLib3MFHandle; const eBallMode: Integer; const dBallRadius: Double): TLib3MFResult; cdecl; - -(************************************************************************************************************************* - Function type definitions for ColorGroup -**************************************************************************************************************************) - (** - * Retrieves the count of base materials in this Color Group. + * Returns the beam count of a mesh object. * - * @param[in] pColorGroup - ColorGroup instance. - * @param[out] pCount - returns the count of colors within this color group. + * @param[in] pBeamLattice - BeamLattice instance. + * @param[out] pCount - filled with the beam count. * @return error code or 0 (success) *) - TLib3MFColorGroup_GetCountFunc = function(pColorGroup: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; + TLib3MFBeamLattice_GetBeamCountFunc = function(pBeamLattice: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; (** - * returns all the PropertyIDs of all colors within this group + * Returns indices, radii and capmodes of a single beam of a mesh object. * - * @param[in] pColorGroup - ColorGroup instance. - * @param[in] nPropertyIDsCount - Number of elements in buffer - * @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. - * @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the color in the color group. + * @param[in] pBeamLattice - BeamLattice instance. + * @param[in] nIndex - Index of the beam (0 to beamcount - 1). + * @param[out] pBeamInfo - filled with the beam indices, radii and capmodes. * @return error code or 0 (success) *) - TLib3MFColorGroup_GetAllPropertyIDsFunc = function(pColorGroup: TLib3MFHandle; const nPropertyIDsCount: QWord; out pPropertyIDsNeededCount: QWord; pPropertyIDsBuffer: PCardinal): TLib3MFResult; cdecl; + TLib3MFBeamLattice_GetBeamFunc = function(pBeamLattice: TLib3MFHandle; const nIndex: Cardinal; pBeamInfo: PLib3MFBeam): TLib3MFResult; cdecl; (** - * Adds a new value. + * Adds a single beam to a mesh object. * - * @param[in] pColorGroup - ColorGroup instance. - * @param[in] pTheColor - The new color - * @param[out] pPropertyID - PropertyID of the new color within this color group. + * @param[in] pBeamLattice - BeamLattice instance. + * @param[in] pBeamInfo - contains the node indices, radii and capmodes. + * @param[out] pIndex - filled with the new Index of the beam. * @return error code or 0 (success) *) - TLib3MFColorGroup_AddColorFunc = function(pColorGroup: TLib3MFHandle; const pTheColor: PLib3MFColor; out pPropertyID: Cardinal): TLib3MFResult; cdecl; + TLib3MFBeamLattice_AddBeamFunc = function(pBeamLattice: TLib3MFHandle; const pBeamInfo: PLib3MFBeam; out pIndex: Cardinal): TLib3MFResult; cdecl; (** - * Removes a color from the color group. + * Sets the indices, radii and capmodes of a single beam of a mesh object. * - * @param[in] pColorGroup - ColorGroup instance. - * @param[in] nPropertyID - PropertyID of the color to be removed from the color group. + * @param[in] pBeamLattice - BeamLattice instance. + * @param[in] nIndex - Index of the beam (0 to beamcount - 1). + * @param[in] pBeamInfo - filled with the beam indices, radii and capmodes. * @return error code or 0 (success) *) - TLib3MFColorGroup_RemoveColorFunc = function(pColorGroup: TLib3MFHandle; const nPropertyID: Cardinal): TLib3MFResult; cdecl; + TLib3MFBeamLattice_SetBeamFunc = function(pBeamLattice: TLib3MFHandle; const nIndex: Cardinal; const pBeamInfo: PLib3MFBeam): TLib3MFResult; cdecl; (** - * Sets a color value. + * Sets all beam indices, radii and capmodes of a mesh object. * - * @param[in] pColorGroup - ColorGroup instance. - * @param[in] nPropertyID - PropertyID of a color within this color group. - * @param[in] pTheColor - The color + * @param[in] pBeamLattice - BeamLattice instance. + * @param[in] nBeamInfoCount - Number of elements in buffer + * @param[in] pBeamInfoBuffer - Beam buffer of contains information of a number of beams * @return error code or 0 (success) *) - TLib3MFColorGroup_SetColorFunc = function(pColorGroup: TLib3MFHandle; const nPropertyID: Cardinal; const pTheColor: PLib3MFColor): TLib3MFResult; cdecl; + TLib3MFBeamLattice_SetBeamsFunc = function(pBeamLattice: TLib3MFHandle; const nBeamInfoCount: QWord; const pBeamInfoBuffer: PLib3MFBeam): TLib3MFResult; cdecl; (** - * Sets a color value. + * obtains all beam indices, radii and capmodes of a mesh object. * - * @param[in] pColorGroup - ColorGroup instance. - * @param[in] nPropertyID - PropertyID of a color within this color group. - * @param[out] pTheColor - The color + * @param[in] pBeamLattice - BeamLattice instance. + * @param[in] nBeamInfoCount - Number of elements in buffer + * @param[out] pBeamInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. + * @param[out] pBeamInfoBuffer - Beam buffer of contains information of all beams * @return error code or 0 (success) *) - TLib3MFColorGroup_GetColorFunc = function(pColorGroup: TLib3MFHandle; const nPropertyID: Cardinal; pTheColor: PLib3MFColor): TLib3MFResult; cdecl; + TLib3MFBeamLattice_GetBeamsFunc = function(pBeamLattice: TLib3MFHandle; const nBeamInfoCount: QWord; out pBeamInfoNeededCount: QWord; pBeamInfoBuffer: PLib3MFBeam): TLib3MFResult; cdecl; - -(************************************************************************************************************************* - Function type definitions for Texture2DGroup -**************************************************************************************************************************) - (** - * Retrieves the count of tex2coords in the Texture2DGroup. + * Returns the ball count of a mesh object. * - * @param[in] pTexture2DGroup - Texture2DGroup instance. - * @param[out] pCount - returns the count of tex2coords. + * @param[in] pBeamLattice - BeamLattice instance. + * @param[out] pCount - filled with the ball count. * @return error code or 0 (success) *) - TLib3MFTexture2DGroup_GetCountFunc = function(pTexture2DGroup: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; + TLib3MFBeamLattice_GetBallCountFunc = function(pBeamLattice: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; (** - * returns all the PropertyIDs of all tex2coords in this Texture2DGroup + * Returns index and radius of a single ball of a mesh object. * - * @param[in] pTexture2DGroup - Texture2DGroup instance. - * @param[in] nPropertyIDsCount - Number of elements in buffer - * @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. - * @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the tex2coords in the Texture2DGroup. + * @param[in] pBeamLattice - BeamLattice instance. + * @param[in] nIndex - Index of the ball (0 to ballcount - 1). + * @param[out] pBallInfo - filled with the ball node index and radius. * @return error code or 0 (success) *) - TLib3MFTexture2DGroup_GetAllPropertyIDsFunc = function(pTexture2DGroup: TLib3MFHandle; const nPropertyIDsCount: QWord; out pPropertyIDsNeededCount: QWord; pPropertyIDsBuffer: PCardinal): TLib3MFResult; cdecl; - - (** - * Adds a new tex2coord to the Texture2DGroup - * - * @param[in] pTexture2DGroup - Texture2DGroup instance. - * @param[in] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. - * @param[out] pPropertyID - returns new PropertyID of the new tex2coord in the Texture2DGroup. - * @return error code or 0 (success) - *) - TLib3MFTexture2DGroup_AddTex2CoordFunc = function(pTexture2DGroup: TLib3MFHandle; const pUVCoordinate: PLib3MFTex2Coord; out pPropertyID: Cardinal): TLib3MFResult; cdecl; - - (** - * Obtains a tex2coord to the Texture2DGroup - * - * @param[in] pTexture2DGroup - Texture2DGroup instance. - * @param[in] nPropertyID - the PropertyID of the tex2coord in the Texture2DGroup. - * @param[out] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. - * @return error code or 0 (success) - *) - TLib3MFTexture2DGroup_GetTex2CoordFunc = function(pTexture2DGroup: TLib3MFHandle; const nPropertyID: Cardinal; pUVCoordinate: PLib3MFTex2Coord): TLib3MFResult; cdecl; - - (** - * Removes a tex2coords from the Texture2DGroup. - * - * @param[in] pTexture2DGroup - Texture2DGroup instance. - * @param[in] nPropertyID - PropertyID of the tex2coords in the Texture2DGroup. - * @return error code or 0 (success) - *) - TLib3MFTexture2DGroup_RemoveTex2CoordFunc = function(pTexture2DGroup: TLib3MFHandle; const nPropertyID: Cardinal): TLib3MFResult; cdecl; + TLib3MFBeamLattice_GetBallFunc = function(pBeamLattice: TLib3MFHandle; const nIndex: Cardinal; pBallInfo: PLib3MFBall): TLib3MFResult; cdecl; (** - * Obtains the texture2D instance of this group. + * Adds a single ball to a mesh object. * - * @param[in] pTexture2DGroup - Texture2DGroup instance. - * @param[out] pTexture2DInstance - the texture2D instance of this group. + * @param[in] pBeamLattice - BeamLattice instance. + * @param[in] pBallInfo - contains the node index and radius. + * @param[out] pIndex - filled with the new Index of the ball. * @return error code or 0 (success) *) - TLib3MFTexture2DGroup_GetTexture2DFunc = function(pTexture2DGroup: TLib3MFHandle; out pTexture2DInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFBeamLattice_AddBallFunc = function(pBeamLattice: TLib3MFHandle; const pBallInfo: PLib3MFBall; out pIndex: Cardinal): TLib3MFResult; cdecl; - -(************************************************************************************************************************* - Function type definitions for CompositeMaterials -**************************************************************************************************************************) - (** - * Retrieves the count of Composite-s in the CompositeMaterials. + * Sets the index and radius of a single ball of a mesh object. * - * @param[in] pCompositeMaterials - CompositeMaterials instance. - * @param[out] pCount - returns the count of Composite-s + * @param[in] pBeamLattice - BeamLattice instance. + * @param[in] nIndex - Index of the ball (0 to ballcount - 1). + * @param[in] pBallInfo - filled with the ball node index and radius. * @return error code or 0 (success) *) - TLib3MFCompositeMaterials_GetCountFunc = function(pCompositeMaterials: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; + TLib3MFBeamLattice_SetBallFunc = function(pBeamLattice: TLib3MFHandle; const nIndex: Cardinal; const pBallInfo: PLib3MFBall): TLib3MFResult; cdecl; (** - * returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials + * Sets all ball indices and radii of a mesh object. * - * @param[in] pCompositeMaterials - CompositeMaterials instance. - * @param[in] nPropertyIDsCount - Number of elements in buffer - * @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. - * @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the Composite-Mixing Values in the CompositeMaterials. + * @param[in] pBeamLattice - BeamLattice instance. + * @param[in] nBallInfoCount - Number of elements in buffer + * @param[in] pBallInfoBuffer - Ball buffer of contains information of a number of balls * @return error code or 0 (success) *) - TLib3MFCompositeMaterials_GetAllPropertyIDsFunc = function(pCompositeMaterials: TLib3MFHandle; const nPropertyIDsCount: QWord; out pPropertyIDsNeededCount: QWord; pPropertyIDsBuffer: PCardinal): TLib3MFResult; cdecl; + TLib3MFBeamLattice_SetBallsFunc = function(pBeamLattice: TLib3MFHandle; const nBallInfoCount: QWord; const pBallInfoBuffer: PLib3MFBall): TLib3MFResult; cdecl; (** - * Obtains the BaseMaterialGroup instance of this CompositeMaterials. + * obtains all ball indices and radii of a mesh object. * - * @param[in] pCompositeMaterials - CompositeMaterials instance. - * @param[out] pBaseMaterialGroupInstance - returns the BaseMaterialGroup instance of this CompositeMaterials + * @param[in] pBeamLattice - BeamLattice instance. + * @param[in] nBallInfoCount - Number of elements in buffer + * @param[out] pBallInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. + * @param[out] pBallInfoBuffer - Ball buffer of contains information of all balls * @return error code or 0 (success) *) - TLib3MFCompositeMaterials_GetBaseMaterialGroupFunc = function(pCompositeMaterials: TLib3MFHandle; out pBaseMaterialGroupInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFBeamLattice_GetBallsFunc = function(pBeamLattice: TLib3MFHandle; const nBallInfoCount: QWord; out pBallInfoNeededCount: QWord; pBallInfoBuffer: PLib3MFBall): TLib3MFResult; cdecl; (** - * Adds a new Composite-Mixing Values to the CompositeMaterials. + * Returns the number of beamsets of a mesh object. * - * @param[in] pCompositeMaterials - CompositeMaterials instance. - * @param[in] nCompositeCount - Number of elements in buffer - * @param[in] pCompositeBuffer - CompositeConstituent buffer of The Composite Constituents to be added as composite - * @param[out] pPropertyID - returns new PropertyID of the new Composite in the CompositeMaterials. + * @param[in] pBeamLattice - BeamLattice instance. + * @param[out] pCount - filled with the beamset count. * @return error code or 0 (success) *) - TLib3MFCompositeMaterials_AddCompositeFunc = function(pCompositeMaterials: TLib3MFHandle; const nCompositeCount: QWord; const pCompositeBuffer: PLib3MFCompositeConstituent; out pPropertyID: Cardinal): TLib3MFResult; cdecl; + TLib3MFBeamLattice_GetBeamSetCountFunc = function(pBeamLattice: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; (** - * Removes a Composite-Maxing Ratio from the CompositeMaterials. + * Adds an empty beamset to a mesh object * - * @param[in] pCompositeMaterials - CompositeMaterials instance. - * @param[in] nPropertyID - PropertyID of the Composite-Mixing Values in the CompositeMaterials to be removed. + * @param[in] pBeamLattice - BeamLattice instance. + * @param[out] pBeamSet - the new beamset * @return error code or 0 (success) *) - TLib3MFCompositeMaterials_RemoveCompositeFunc = function(pCompositeMaterials: TLib3MFHandle; const nPropertyID: Cardinal): TLib3MFResult; cdecl; + TLib3MFBeamLattice_AddBeamSetFunc = function(pBeamLattice: TLib3MFHandle; out pBeamSet: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Obtains a Composite-Maxing Ratio of this CompositeMaterials. + * Returns a beamset of a mesh object * - * @param[in] pCompositeMaterials - CompositeMaterials instance. - * @param[in] nPropertyID - the PropertyID of the Composite-Maxing Ratio in the CompositeMaterials. - * @param[in] nCompositeCount - Number of elements in buffer - * @param[out] pCompositeNeededCount - will be filled with the count of the written elements, or needed buffer size. - * @param[out] pCompositeBuffer - CompositeConstituent buffer of The Composite-Mixing Values with the given PropertyID + * @param[in] pBeamLattice - BeamLattice instance. + * @param[in] nIndex - index of the requested beamset (0 ... beamsetcount-1). + * @param[out] pBeamSet - the requested beamset * @return error code or 0 (success) *) - TLib3MFCompositeMaterials_GetCompositeFunc = function(pCompositeMaterials: TLib3MFHandle; const nPropertyID: Cardinal; const nCompositeCount: QWord; out pCompositeNeededCount: QWord; pCompositeBuffer: PLib3MFCompositeConstituent): TLib3MFResult; cdecl; + TLib3MFBeamLattice_GetBeamSetFunc = function(pBeamLattice: TLib3MFHandle; const nIndex: Cardinal; out pBeamSet: TLib3MFHandle): TLib3MFResult; cdecl; (************************************************************************************************************************* - Function type definitions for MultiPropertyGroup + Function type definitions for Component **************************************************************************************************************************) (** - * Retrieves the count of MultiProperty-s in the MultiPropertyGroup. + * Returns the Resource Instance of the component. * - * @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. - * @param[out] pCount - returns the count of MultiProperty-s + * @param[in] pComponent - Component instance. + * @param[out] pObjectResource - filled with the Resource Instance. * @return error code or 0 (success) *) - TLib3MFMultiPropertyGroup_GetCountFunc = function(pMultiPropertyGroup: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; + TLib3MFComponent_GetObjectResourceFunc = function(pComponent: TLib3MFHandle; out pObjectResource: TLib3MFHandle): TLib3MFResult; cdecl; (** - * returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup + * Returns the UniqueResourceID of the component. * - * @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. - * @param[in] nPropertyIDsCount - Number of elements in buffer - * @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. - * @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the MultiProperty-s in the MultiPropertyGroup. + * @param[in] pComponent - Component instance. + * @param[out] pUniqueResourceID - returns the UniqueResourceID. * @return error code or 0 (success) *) - TLib3MFMultiPropertyGroup_GetAllPropertyIDsFunc = function(pMultiPropertyGroup: TLib3MFHandle; const nPropertyIDsCount: QWord; out pPropertyIDsNeededCount: QWord; pPropertyIDsBuffer: PCardinal): TLib3MFResult; cdecl; + TLib3MFComponent_GetObjectResourceIDFunc = function(pComponent: TLib3MFHandle; out pUniqueResourceID: Cardinal): TLib3MFResult; cdecl; (** - * Adds a new MultiProperty to the MultiPropertyGroup. + * returns, whether a component has a UUID and, if true, the component's UUID * - * @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. - * @param[in] nPropertyIDsCount - Number of elements in buffer - * @param[in] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the new MultiProperty. - * @param[out] pPropertyID - returns the PropertyID of the new MultiProperty in the MultiPropertyGroup. + * @param[in] pComponent - Component instance. + * @param[out] pHasUUID - flag whether the component has a UUID + * @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) + * @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL * @return error code or 0 (success) *) - TLib3MFMultiPropertyGroup_AddMultiPropertyFunc = function(pMultiPropertyGroup: TLib3MFHandle; const nPropertyIDsCount: QWord; const pPropertyIDsBuffer: PCardinal; out pPropertyID: Cardinal): TLib3MFResult; cdecl; + TLib3MFComponent_GetUUIDFunc = function(pComponent: TLib3MFHandle; out pHasUUID: Byte; const nUUIDBufferSize: Cardinal; out pUUIDNeededChars: Cardinal; pUUIDBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * Sets the PropertyIDs of a MultiProperty. + * sets the component's UUID * - * @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. - * @param[in] nPropertyID - the PropertyID of the MultiProperty to be changed. - * @param[in] nPropertyIDsCount - Number of elements in buffer - * @param[in] pPropertyIDsBuffer - uint32 buffer of The new PropertyIDs of the MultiProperty + * @param[in] pComponent - Component instance. + * @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' * @return error code or 0 (success) *) - TLib3MFMultiPropertyGroup_SetMultiPropertyFunc = function(pMultiPropertyGroup: TLib3MFHandle; const nPropertyID: Cardinal; const nPropertyIDsCount: QWord; const pPropertyIDsBuffer: PCardinal): TLib3MFResult; cdecl; + TLib3MFComponent_SetUUIDFunc = function(pComponent: TLib3MFHandle; const pUUID: PAnsiChar): TLib3MFResult; cdecl; (** - * Obtains the PropertyIDs of a MultiProperty. + * Returns, if the component has a different transformation than the identity matrix * - * @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. - * @param[in] nPropertyID - the PropertyID of the MultiProperty to be queried. - * @param[in] nPropertyIDsCount - Number of elements in buffer - * @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. - * @param[out] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the MultiProperty + * @param[in] pComponent - Component instance. + * @param[out] pHasTransform - if true is returned, the transformation is not equal than the identity * @return error code or 0 (success) *) - TLib3MFMultiPropertyGroup_GetMultiPropertyFunc = function(pMultiPropertyGroup: TLib3MFHandle; const nPropertyID: Cardinal; const nPropertyIDsCount: QWord; out pPropertyIDsNeededCount: QWord; pPropertyIDsBuffer: PCardinal): TLib3MFResult; cdecl; + TLib3MFComponent_HasTransformFunc = function(pComponent: TLib3MFHandle; out pHasTransform: Byte): TLib3MFResult; cdecl; (** - * Removes a MultiProperty from this MultiPropertyGroup. + * Returns the transformation matrix of the component. * - * @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. - * @param[in] nPropertyID - the PropertyID of the MultiProperty to be removed. + * @param[in] pComponent - Component instance. + * @param[out] pTransform - filled with the component transformation matrix * @return error code or 0 (success) *) - TLib3MFMultiPropertyGroup_RemoveMultiPropertyFunc = function(pMultiPropertyGroup: TLib3MFHandle; const nPropertyID: Cardinal): TLib3MFResult; cdecl; + TLib3MFComponent_GetTransformFunc = function(pComponent: TLib3MFHandle; pTransform: PLib3MFTransform): TLib3MFResult; cdecl; (** - * Retrieves the number of layers of this MultiPropertyGroup. + * Sets the transformation matrix of the component. * - * @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. - * @param[out] pCount - returns the number of layers + * @param[in] pComponent - Component instance. + * @param[in] pTransform - new transformation matrix * @return error code or 0 (success) *) - TLib3MFMultiPropertyGroup_GetLayerCountFunc = function(pMultiPropertyGroup: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; + TLib3MFComponent_SetTransformFunc = function(pComponent: TLib3MFHandle; const pTransform: PLib3MFTransform): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Function type definitions for ComponentsObject +**************************************************************************************************************************) + (** - * Adds a MultiPropertyLayer to this MultiPropertyGroup. + * Adds a new component to a components object. * - * @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. - * @param[in] pTheLayer - The MultiPropertyLayer to add to this MultiPropertyGroup - * @param[out] pLayerIndex - returns the index of this MultiPropertyLayer + * @param[in] pComponentsObject - ComponentsObject instance. + * @param[in] pObjectResource - object to add as component. Must not lead to circular references! + * @param[in] pTransform - optional transform matrix for the component. + * @param[out] pComponentInstance - new component instance * @return error code or 0 (success) *) - TLib3MFMultiPropertyGroup_AddLayerFunc = function(pMultiPropertyGroup: TLib3MFHandle; const pTheLayer: PLib3MFMultiPropertyLayer; out pLayerIndex: Cardinal): TLib3MFResult; cdecl; + TLib3MFComponentsObject_AddComponentFunc = function(pComponentsObject: TLib3MFHandle; const pObjectResource: TLib3MFHandle; const pTransform: PLib3MFTransform; out pComponentInstance: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Obtains a MultiPropertyLayer of this MultiPropertyGroup. + * Retrieves a component from a component object. * - * @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. - * @param[in] nLayerIndex - The Index of the MultiPropertyLayer queried - * @param[out] pTheLayer - The MultiPropertyLayer with index LayerIndex within MultiPropertyGroup + * @param[in] pComponentsObject - ComponentsObject instance. + * @param[in] nIndex - index of the component to retrieve (0 to componentcount - 1) + * @param[out] pComponentInstance - component instance * @return error code or 0 (success) *) - TLib3MFMultiPropertyGroup_GetLayerFunc = function(pMultiPropertyGroup: TLib3MFHandle; const nLayerIndex: Cardinal; pTheLayer: PLib3MFMultiPropertyLayer): TLib3MFResult; cdecl; + TLib3MFComponentsObject_GetComponentFunc = function(pComponentsObject: TLib3MFHandle; const nIndex: Cardinal; out pComponentInstance: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Removes a MultiPropertyLayer from this MultiPropertyGroup. + * Retrieves a component count of a component object. * - * @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. - * @param[in] nLayerIndex - The Index of the MultiPropertyLayer to be removed + * @param[in] pComponentsObject - ComponentsObject instance. + * @param[out] pCount - returns the component count * @return error code or 0 (success) *) - TLib3MFMultiPropertyGroup_RemoveLayerFunc = function(pMultiPropertyGroup: TLib3MFHandle; const nLayerIndex: Cardinal): TLib3MFResult; cdecl; + TLib3MFComponentsObject_GetComponentCountFunc = function(pComponentsObject: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; (************************************************************************************************************************* - Function type definitions for Attachment + Function type definitions for BeamSet **************************************************************************************************************************) (** - * Retrieves an attachment's package path. This function will be removed in a later release. + * Sets a beamset's name string * - * @param[in] pAttachment - Attachment instance. - * @param[in] nPathBufferSize - size of the buffer (including trailing 0) - * @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pPathBuffer - buffer of returns the attachment's package path string, may be NULL + * @param[in] pBeamSet - BeamSet instance. + * @param[in] pName - new name of the beamset. * @return error code or 0 (success) *) - TLib3MFAttachment_GetPathFunc = function(pAttachment: TLib3MFHandle; const nPathBufferSize: Cardinal; out pPathNeededChars: Cardinal; pPathBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFBeamSet_SetNameFunc = function(pBeamSet: TLib3MFHandle; const pName: PAnsiChar): TLib3MFResult; cdecl; (** - * Sets an attachment's package path. This function will be removed in a later release. + * Retrieves a beamset's name string * - * @param[in] pAttachment - Attachment instance. - * @param[in] pPath - new path of the attachment. + * @param[in] pBeamSet - BeamSet instance. + * @param[in] nNameBufferSize - size of the buffer (including trailing 0) + * @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pNameBuffer - buffer of returns the name of the beamset., may be NULL * @return error code or 0 (success) *) - TLib3MFAttachment_SetPathFunc = function(pAttachment: TLib3MFHandle; const pPath: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFBeamSet_GetNameFunc = function(pBeamSet: TLib3MFHandle; const nNameBufferSize: Cardinal; out pNameNeededChars: Cardinal; pNameBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * Returns the PackagePart that is this attachment. + * Sets a beamset's identifier string * - * @param[in] pAttachment - Attachment instance. - * @param[out] pPackagePart - The PackagePart of this attachment. + * @param[in] pBeamSet - BeamSet instance. + * @param[in] pIdentifier - new name of the beamset. * @return error code or 0 (success) *) - TLib3MFAttachment_PackagePartFunc = function(pAttachment: TLib3MFHandle; out pPackagePart: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFBeamSet_SetIdentifierFunc = function(pBeamSet: TLib3MFHandle; const pIdentifier: PAnsiChar): TLib3MFResult; cdecl; (** - * Retrieves an attachment's relationship type + * Retrieves a beamset's identifier string * - * @param[in] pAttachment - Attachment instance. - * @param[in] nPathBufferSize - size of the buffer (including trailing 0) - * @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pPathBuffer - buffer of returns the attachment's package relationship type string, may be NULL + * @param[in] pBeamSet - BeamSet instance. + * @param[in] nIdentifierBufferSize - size of the buffer (including trailing 0) + * @param[out] pIdentifierNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pIdentifierBuffer - buffer of returns the identifier of the beamset., may be NULL * @return error code or 0 (success) *) - TLib3MFAttachment_GetRelationShipTypeFunc = function(pAttachment: TLib3MFHandle; const nPathBufferSize: Cardinal; out pPathNeededChars: Cardinal; pPathBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFBeamSet_GetIdentifierFunc = function(pBeamSet: TLib3MFHandle; const nIdentifierBufferSize: Cardinal; out pIdentifierNeededChars: Cardinal; pIdentifierBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * Sets an attachment's relationship type. + * Retrieves the reference count of a beamset * - * @param[in] pAttachment - Attachment instance. - * @param[in] pPath - new relationship type string. + * @param[in] pBeamSet - BeamSet instance. + * @param[out] pCount - returns the reference count * @return error code or 0 (success) *) - TLib3MFAttachment_SetRelationShipTypeFunc = function(pAttachment: TLib3MFHandle; const pPath: PAnsiChar): TLib3MFResult; cdecl; - - (** - * Writes out the attachment as file. - * - * @param[in] pAttachment - Attachment instance. - * @param[in] pFileName - file to write into. - * @return error code or 0 (success) - *) - TLib3MFAttachment_WriteToFileFunc = function(pAttachment: TLib3MFHandle; const pFileName: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFBeamSet_GetReferenceCountFunc = function(pBeamSet: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; (** - * Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. + * Sets the references of a beamset * - * @param[in] pAttachment - Attachment instance. - * @param[in] pFileName - file to read from. + * @param[in] pBeamSet - BeamSet instance. + * @param[in] nReferencesCount - Number of elements in buffer + * @param[in] pReferencesBuffer - uint32 buffer of the new indices of all beams in this beamset * @return error code or 0 (success) *) - TLib3MFAttachment_ReadFromFileFunc = function(pAttachment: TLib3MFHandle; const pFileName: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFBeamSet_SetReferencesFunc = function(pBeamSet: TLib3MFHandle; const nReferencesCount: QWord; const pReferencesBuffer: PCardinal): TLib3MFResult; cdecl; (** - * Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. + * Retrieves the references of a beamset * - * @param[in] pAttachment - Attachment instance. - * @param[in] pTheReadCallback - Callback to call for reading a data chunk - * @param[in] nStreamSize - number of bytes the callback returns - * @param[in] pTheSeekCallback - Callback to call for seeking in the stream. - * @param[in] pUserData - Userdata that is passed to the callback function + * @param[in] pBeamSet - BeamSet instance. + * @param[in] nReferencesCount - Number of elements in buffer + * @param[out] pReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. + * @param[out] pReferencesBuffer - uint32 buffer of retrieves the indices of all beams in this beamset * @return error code or 0 (success) *) - TLib3MFAttachment_ReadFromCallbackFunc = function(pAttachment: TLib3MFHandle; const pTheReadCallback: PLib3MF_ReadCallback; const nStreamSize: QWord; const pTheSeekCallback: PLib3MF_SeekCallback; const pUserData: Pointer): TLib3MFResult; cdecl; + TLib3MFBeamSet_GetReferencesFunc = function(pBeamSet: TLib3MFHandle; const nReferencesCount: QWord; out pReferencesNeededCount: QWord; pReferencesBuffer: PCardinal): TLib3MFResult; cdecl; (** - * Retrieves the size of the attachment stream + * Retrieves the ball reference count of a beamset * - * @param[in] pAttachment - Attachment instance. - * @param[out] pStreamSize - the stream size + * @param[in] pBeamSet - BeamSet instance. + * @param[out] pCount - returns the ball reference count * @return error code or 0 (success) *) - TLib3MFAttachment_GetStreamSizeFunc = function(pAttachment: TLib3MFHandle; out pStreamSize: QWord): TLib3MFResult; cdecl; + TLib3MFBeamSet_GetBallReferenceCountFunc = function(pBeamSet: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; (** - * Writes out the attachment into a buffer + * Sets the ball references of a beamset * - * @param[in] pAttachment - Attachment instance. - * @param[in] nBufferCount - Number of elements in buffer - * @param[out] pBufferNeededCount - will be filled with the count of the written elements, or needed buffer size. - * @param[out] pBufferBuffer - uint8 buffer of Buffer to write into + * @param[in] pBeamSet - BeamSet instance. + * @param[in] nBallReferencesCount - Number of elements in buffer + * @param[in] pBallReferencesBuffer - uint32 buffer of the new indices of all balls in this beamset * @return error code or 0 (success) *) - TLib3MFAttachment_WriteToBufferFunc = function(pAttachment: TLib3MFHandle; const nBufferCount: QWord; out pBufferNeededCount: QWord; pBufferBuffer: PByte): TLib3MFResult; cdecl; + TLib3MFBeamSet_SetBallReferencesFunc = function(pBeamSet: TLib3MFHandle; const nBallReferencesCount: QWord; const pBallReferencesBuffer: PCardinal): TLib3MFResult; cdecl; (** - * Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). + * Retrieves the ball references of a beamset * - * @param[in] pAttachment - Attachment instance. - * @param[in] nBufferCount - Number of elements in buffer - * @param[in] pBufferBuffer - uint8 buffer of Buffer to read from + * @param[in] pBeamSet - BeamSet instance. + * @param[in] nBallReferencesCount - Number of elements in buffer + * @param[out] pBallReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. + * @param[out] pBallReferencesBuffer - uint32 buffer of retrieves the indices of all balls in this beamset * @return error code or 0 (success) *) - TLib3MFAttachment_ReadFromBufferFunc = function(pAttachment: TLib3MFHandle; const nBufferCount: QWord; const pBufferBuffer: PByte): TLib3MFResult; cdecl; + TLib3MFBeamSet_GetBallReferencesFunc = function(pBeamSet: TLib3MFHandle; const nBallReferencesCount: QWord; out pBallReferencesNeededCount: QWord; pBallReferencesBuffer: PCardinal): TLib3MFResult; cdecl; (************************************************************************************************************************* - Function type definitions for Texture2D + Function type definitions for BaseMaterialGroup **************************************************************************************************************************) (** - * Retrieves the attachment located at the path of the texture. + * Retrieves the count of base materials in the material group. * - * @param[in] pTexture2D - Texture2D instance. - * @param[out] pAttachment - attachment that holds the texture's image information. + * @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. + * @param[out] pCount - returns the count of base materials. * @return error code or 0 (success) *) - TLib3MFTexture2D_GetAttachmentFunc = function(pTexture2D: TLib3MFHandle; out pAttachment: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFBaseMaterialGroup_GetCountFunc = function(pBaseMaterialGroup: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; (** - * Sets the texture's package path to the path of the attachment. + * returns all the PropertyIDs of all materials in this group * - * @param[in] pTexture2D - Texture2D instance. - * @param[in] pAttachment - attachment that holds the texture's image information. + * @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. + * @param[in] nPropertyIDsCount - Number of elements in buffer + * @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. + * @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the material in the material group. * @return error code or 0 (success) *) - TLib3MFTexture2D_SetAttachmentFunc = function(pTexture2D: TLib3MFHandle; const pAttachment: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFBaseMaterialGroup_GetAllPropertyIDsFunc = function(pBaseMaterialGroup: TLib3MFHandle; const nPropertyIDsCount: QWord; out pPropertyIDsNeededCount: QWord; pPropertyIDsBuffer: PCardinal): TLib3MFResult; cdecl; (** - * Retrieves a texture's content type. + * Adds a new material to the material group * - * @param[in] pTexture2D - Texture2D instance. - * @param[out] pContentType - returns content type enum. + * @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. + * @param[in] pName - new name of the base material. + * @param[in] pDisplayColor - Display color of the material + * @param[out] pPropertyID - returns new PropertyID of the new material in the material group. * @return error code or 0 (success) *) - TLib3MFTexture2D_GetContentTypeFunc = function(pTexture2D: TLib3MFHandle; out pContentType: Integer): TLib3MFResult; cdecl; + TLib3MFBaseMaterialGroup_AddMaterialFunc = function(pBaseMaterialGroup: TLib3MFHandle; const pName: PAnsiChar; const pDisplayColor: PLib3MFColor; out pPropertyID: Cardinal): TLib3MFResult; cdecl; (** - * Retrieves a texture's content type. + * Removes a material from the material group. * - * @param[in] pTexture2D - Texture2D instance. - * @param[in] eContentType - new Content Type + * @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. + * @param[in] nPropertyID - PropertyID of the material in the material group. * @return error code or 0 (success) *) - TLib3MFTexture2D_SetContentTypeFunc = function(pTexture2D: TLib3MFHandle; const eContentType: Integer): TLib3MFResult; cdecl; + TLib3MFBaseMaterialGroup_RemoveMaterialFunc = function(pBaseMaterialGroup: TLib3MFHandle; const nPropertyID: Cardinal): TLib3MFResult; cdecl; (** - * Retrieves a texture's tilestyle type. + * Returns the base material's name * - * @param[in] pTexture2D - Texture2D instance. - * @param[out] pTileStyleU - returns tilestyle type enum. - * @param[out] pTileStyleV - returns tilestyle type enum. + * @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. + * @param[in] nPropertyID - PropertyID of the material in the material group. + * @param[in] nNameBufferSize - size of the buffer (including trailing 0) + * @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pNameBuffer - buffer of returns the name of the base material., may be NULL * @return error code or 0 (success) *) - TLib3MFTexture2D_GetTileStyleUVFunc = function(pTexture2D: TLib3MFHandle; out pTileStyleU: Integer; out pTileStyleV: Integer): TLib3MFResult; cdecl; + TLib3MFBaseMaterialGroup_GetNameFunc = function(pBaseMaterialGroup: TLib3MFHandle; const nPropertyID: Cardinal; const nNameBufferSize: Cardinal; out pNameNeededChars: Cardinal; pNameBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * Sets a texture's tilestyle type. + * Sets a base material's name * - * @param[in] pTexture2D - Texture2D instance. - * @param[in] eTileStyleU - new tilestyle type enum. - * @param[in] eTileStyleV - new tilestyle type enum. + * @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. + * @param[in] nPropertyID - PropertyID of the material in the material group. + * @param[in] pName - new name of the base material. * @return error code or 0 (success) *) - TLib3MFTexture2D_SetTileStyleUVFunc = function(pTexture2D: TLib3MFHandle; const eTileStyleU: Integer; const eTileStyleV: Integer): TLib3MFResult; cdecl; + TLib3MFBaseMaterialGroup_SetNameFunc = function(pBaseMaterialGroup: TLib3MFHandle; const nPropertyID: Cardinal; const pName: PAnsiChar): TLib3MFResult; cdecl; (** - * Retrieves a texture's filter type. + * Sets a base material's display color. * - * @param[in] pTexture2D - Texture2D instance. - * @param[out] pFilter - returns filter type enum. + * @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. + * @param[in] nPropertyID - PropertyID of the material in the material group. + * @param[in] pTheColor - The base material's display color * @return error code or 0 (success) *) - TLib3MFTexture2D_GetFilterFunc = function(pTexture2D: TLib3MFHandle; out pFilter: Integer): TLib3MFResult; cdecl; + TLib3MFBaseMaterialGroup_SetDisplayColorFunc = function(pBaseMaterialGroup: TLib3MFHandle; const nPropertyID: Cardinal; const pTheColor: PLib3MFColor): TLib3MFResult; cdecl; (** - * Sets a texture's filter type. + * Returns a base material's display color. * - * @param[in] pTexture2D - Texture2D instance. - * @param[in] eFilter - sets new filter type enum. + * @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. + * @param[in] nPropertyID - PropertyID of the material in the material group. + * @param[out] pTheColor - The base material's display color * @return error code or 0 (success) *) - TLib3MFTexture2D_SetFilterFunc = function(pTexture2D: TLib3MFHandle; const eFilter: Integer): TLib3MFResult; cdecl; + TLib3MFBaseMaterialGroup_GetDisplayColorFunc = function(pBaseMaterialGroup: TLib3MFHandle; const nPropertyID: Cardinal; pTheColor: PLib3MFColor): TLib3MFResult; cdecl; (************************************************************************************************************************* - Function type definitions for BuildItem + Function type definitions for ColorGroup **************************************************************************************************************************) (** - * Retrieves the object resource associated to a build item + * Retrieves the count of base materials in this Color Group. * - * @param[in] pBuildItem - BuildItem instance. - * @param[out] pObjectResource - returns the associated resource instance + * @param[in] pColorGroup - ColorGroup instance. + * @param[out] pCount - returns the count of colors within this color group. * @return error code or 0 (success) *) - TLib3MFBuildItem_GetObjectResourceFunc = function(pBuildItem: TLib3MFHandle; out pObjectResource: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFColorGroup_GetCountFunc = function(pColorGroup: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; (** - * returns, whether a build item has a UUID and, if true, the build item's UUID + * returns all the PropertyIDs of all colors within this group * - * @param[in] pBuildItem - BuildItem instance. - * @param[out] pHasUUID - flag whether the build item has a UUID - * @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) - * @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL + * @param[in] pColorGroup - ColorGroup instance. + * @param[in] nPropertyIDsCount - Number of elements in buffer + * @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. + * @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the color in the color group. * @return error code or 0 (success) *) - TLib3MFBuildItem_GetUUIDFunc = function(pBuildItem: TLib3MFHandle; out pHasUUID: Byte; const nUUIDBufferSize: Cardinal; out pUUIDNeededChars: Cardinal; pUUIDBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFColorGroup_GetAllPropertyIDsFunc = function(pColorGroup: TLib3MFHandle; const nPropertyIDsCount: QWord; out pPropertyIDsNeededCount: QWord; pPropertyIDsBuffer: PCardinal): TLib3MFResult; cdecl; (** - * sets the build item's UUID + * Adds a new value. * - * @param[in] pBuildItem - BuildItem instance. - * @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + * @param[in] pColorGroup - ColorGroup instance. + * @param[in] pTheColor - The new color + * @param[out] pPropertyID - PropertyID of the new color within this color group. * @return error code or 0 (success) *) - TLib3MFBuildItem_SetUUIDFunc = function(pBuildItem: TLib3MFHandle; const pUUID: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFColorGroup_AddColorFunc = function(pColorGroup: TLib3MFHandle; const pTheColor: PLib3MFColor; out pPropertyID: Cardinal): TLib3MFResult; cdecl; (** - * Retrieves the object UniqueResourceID associated to a build item + * Removes a color from the color group. * - * @param[in] pBuildItem - BuildItem instance. - * @param[out] pUniqueResourceID - returns the UniqueResourceID of the object + * @param[in] pColorGroup - ColorGroup instance. + * @param[in] nPropertyID - PropertyID of the color to be removed from the color group. * @return error code or 0 (success) *) - TLib3MFBuildItem_GetObjectResourceIDFunc = function(pBuildItem: TLib3MFHandle; out pUniqueResourceID: Cardinal): TLib3MFResult; cdecl; + TLib3MFColorGroup_RemoveColorFunc = function(pColorGroup: TLib3MFHandle; const nPropertyID: Cardinal): TLib3MFResult; cdecl; (** - * Checks, if a build item has a non-identity transformation matrix + * Sets a color value. * - * @param[in] pBuildItem - BuildItem instance. - * @param[out] pHasTransform - returns true, if the transformation matrix is not the identity + * @param[in] pColorGroup - ColorGroup instance. + * @param[in] nPropertyID - PropertyID of a color within this color group. + * @param[in] pTheColor - The color * @return error code or 0 (success) *) - TLib3MFBuildItem_HasObjectTransformFunc = function(pBuildItem: TLib3MFHandle; out pHasTransform: Byte): TLib3MFResult; cdecl; + TLib3MFColorGroup_SetColorFunc = function(pColorGroup: TLib3MFHandle; const nPropertyID: Cardinal; const pTheColor: PLib3MFColor): TLib3MFResult; cdecl; (** - * Retrieves a build item's transformation matrix. + * Sets a color value. * - * @param[in] pBuildItem - BuildItem instance. - * @param[out] pTransform - returns the transformation matrix + * @param[in] pColorGroup - ColorGroup instance. + * @param[in] nPropertyID - PropertyID of a color within this color group. + * @param[out] pTheColor - The color * @return error code or 0 (success) *) - TLib3MFBuildItem_GetObjectTransformFunc = function(pBuildItem: TLib3MFHandle; pTransform: PLib3MFTransform): TLib3MFResult; cdecl; + TLib3MFColorGroup_GetColorFunc = function(pColorGroup: TLib3MFHandle; const nPropertyID: Cardinal; pTheColor: PLib3MFColor): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Function type definitions for Texture2DGroup +**************************************************************************************************************************) + (** - * Sets a build item's transformation matrix. + * Retrieves the count of tex2coords in the Texture2DGroup. * - * @param[in] pBuildItem - BuildItem instance. - * @param[in] pTransform - new transformation matrix + * @param[in] pTexture2DGroup - Texture2DGroup instance. + * @param[out] pCount - returns the count of tex2coords. * @return error code or 0 (success) *) - TLib3MFBuildItem_SetObjectTransformFunc = function(pBuildItem: TLib3MFHandle; const pTransform: PLib3MFTransform): TLib3MFResult; cdecl; + TLib3MFTexture2DGroup_GetCountFunc = function(pTexture2DGroup: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; (** - * Retrieves a build item's part number string + * returns all the PropertyIDs of all tex2coords in this Texture2DGroup * - * @param[in] pBuildItem - BuildItem instance. - * @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) - * @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pPartNumberBuffer - buffer of Returns a build item's part number string, may be NULL + * @param[in] pTexture2DGroup - Texture2DGroup instance. + * @param[in] nPropertyIDsCount - Number of elements in buffer + * @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. + * @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the tex2coords in the Texture2DGroup. * @return error code or 0 (success) *) - TLib3MFBuildItem_GetPartNumberFunc = function(pBuildItem: TLib3MFHandle; const nPartNumberBufferSize: Cardinal; out pPartNumberNeededChars: Cardinal; pPartNumberBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFTexture2DGroup_GetAllPropertyIDsFunc = function(pTexture2DGroup: TLib3MFHandle; const nPropertyIDsCount: QWord; out pPropertyIDsNeededCount: QWord; pPropertyIDsBuffer: PCardinal): TLib3MFResult; cdecl; (** - * Sets a build item's part number string + * Adds a new tex2coord to the Texture2DGroup * - * @param[in] pBuildItem - BuildItem instance. - * @param[in] pSetPartnumber - new part number string for referencing parts from the outside world + * @param[in] pTexture2DGroup - Texture2DGroup instance. + * @param[in] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. + * @param[out] pPropertyID - returns new PropertyID of the new tex2coord in the Texture2DGroup. * @return error code or 0 (success) *) - TLib3MFBuildItem_SetPartNumberFunc = function(pBuildItem: TLib3MFHandle; const pSetPartnumber: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFTexture2DGroup_AddTex2CoordFunc = function(pTexture2DGroup: TLib3MFHandle; const pUVCoordinate: PLib3MFTex2Coord; out pPropertyID: Cardinal): TLib3MFResult; cdecl; (** - * Returns the metadatagroup of this build item + * Obtains a tex2coord to the Texture2DGroup * - * @param[in] pBuildItem - BuildItem instance. - * @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this build item + * @param[in] pTexture2DGroup - Texture2DGroup instance. + * @param[in] nPropertyID - the PropertyID of the tex2coord in the Texture2DGroup. + * @param[out] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. * @return error code or 0 (success) *) - TLib3MFBuildItem_GetMetaDataGroupFunc = function(pBuildItem: TLib3MFHandle; out pMetaDataGroup: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFTexture2DGroup_GetTex2CoordFunc = function(pTexture2DGroup: TLib3MFHandle; const nPropertyID: Cardinal; pUVCoordinate: PLib3MFTex2Coord): TLib3MFResult; cdecl; (** - * Returns the outbox of a build item + * Removes a tex2coords from the Texture2DGroup. * - * @param[in] pBuildItem - BuildItem instance. - * @param[out] pOutbox - Outbox of this build item + * @param[in] pTexture2DGroup - Texture2DGroup instance. + * @param[in] nPropertyID - PropertyID of the tex2coords in the Texture2DGroup. * @return error code or 0 (success) *) - TLib3MFBuildItem_GetOutboxFunc = function(pBuildItem: TLib3MFHandle; pOutbox: PLib3MFBox): TLib3MFResult; cdecl; + TLib3MFTexture2DGroup_RemoveTex2CoordFunc = function(pTexture2DGroup: TLib3MFHandle; const nPropertyID: Cardinal): TLib3MFResult; cdecl; - -(************************************************************************************************************************* - Function type definitions for BuildItemIterator -**************************************************************************************************************************) - (** - * Iterates to the next build item in the list. + * Obtains the texture2D instance of this group. * - * @param[in] pBuildItemIterator - BuildItemIterator instance. - * @param[out] pHasNext - Iterates to the next build item in the list. + * @param[in] pTexture2DGroup - Texture2DGroup instance. + * @param[out] pTexture2DInstance - the texture2D instance of this group. * @return error code or 0 (success) *) - TLib3MFBuildItemIterator_MoveNextFunc = function(pBuildItemIterator: TLib3MFHandle; out pHasNext: Byte): TLib3MFResult; cdecl; + TLib3MFTexture2DGroup_GetTexture2DFunc = function(pTexture2DGroup: TLib3MFHandle; out pTexture2DInstance: TLib3MFHandle): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Function type definitions for CompositeMaterials +**************************************************************************************************************************) + (** - * Iterates to the previous build item in the list. + * Retrieves the count of Composite-s in the CompositeMaterials. * - * @param[in] pBuildItemIterator - BuildItemIterator instance. - * @param[out] pHasPrevious - Iterates to the previous build item in the list. + * @param[in] pCompositeMaterials - CompositeMaterials instance. + * @param[out] pCount - returns the count of Composite-s * @return error code or 0 (success) *) - TLib3MFBuildItemIterator_MovePreviousFunc = function(pBuildItemIterator: TLib3MFHandle; out pHasPrevious: Byte): TLib3MFResult; cdecl; + TLib3MFCompositeMaterials_GetCountFunc = function(pCompositeMaterials: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; (** - * Returns the build item the iterator points at. + * returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials * - * @param[in] pBuildItemIterator - BuildItemIterator instance. - * @param[out] pBuildItem - returns the build item instance. + * @param[in] pCompositeMaterials - CompositeMaterials instance. + * @param[in] nPropertyIDsCount - Number of elements in buffer + * @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. + * @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the Composite-Mixing Values in the CompositeMaterials. * @return error code or 0 (success) *) - TLib3MFBuildItemIterator_GetCurrentFunc = function(pBuildItemIterator: TLib3MFHandle; out pBuildItem: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFCompositeMaterials_GetAllPropertyIDsFunc = function(pCompositeMaterials: TLib3MFHandle; const nPropertyIDsCount: QWord; out pPropertyIDsNeededCount: QWord; pPropertyIDsBuffer: PCardinal): TLib3MFResult; cdecl; (** - * Creates a new build item iterator with the same build item list. + * Obtains the BaseMaterialGroup instance of this CompositeMaterials. * - * @param[in] pBuildItemIterator - BuildItemIterator instance. - * @param[out] pOutBuildItemIterator - returns the cloned Iterator instance + * @param[in] pCompositeMaterials - CompositeMaterials instance. + * @param[out] pBaseMaterialGroupInstance - returns the BaseMaterialGroup instance of this CompositeMaterials * @return error code or 0 (success) *) - TLib3MFBuildItemIterator_CloneFunc = function(pBuildItemIterator: TLib3MFHandle; out pOutBuildItemIterator: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFCompositeMaterials_GetBaseMaterialGroupFunc = function(pCompositeMaterials: TLib3MFHandle; out pBaseMaterialGroupInstance: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Returns the number of build items the iterator captures. + * Adds a new Composite-Mixing Values to the CompositeMaterials. * - * @param[in] pBuildItemIterator - BuildItemIterator instance. - * @param[out] pCount - returns the number of build items the iterator captures. + * @param[in] pCompositeMaterials - CompositeMaterials instance. + * @param[in] nCompositeCount - Number of elements in buffer + * @param[in] pCompositeBuffer - CompositeConstituent buffer of The Composite Constituents to be added as composite + * @param[out] pPropertyID - returns new PropertyID of the new Composite in the CompositeMaterials. * @return error code or 0 (success) *) - TLib3MFBuildItemIterator_CountFunc = function(pBuildItemIterator: TLib3MFHandle; out pCount: QWord): TLib3MFResult; cdecl; + TLib3MFCompositeMaterials_AddCompositeFunc = function(pCompositeMaterials: TLib3MFHandle; const nCompositeCount: QWord; const pCompositeBuffer: PLib3MFCompositeConstituent; out pPropertyID: Cardinal): TLib3MFResult; cdecl; + + (** + * Removes a Composite-Maxing Ratio from the CompositeMaterials. + * + * @param[in] pCompositeMaterials - CompositeMaterials instance. + * @param[in] nPropertyID - PropertyID of the Composite-Mixing Values in the CompositeMaterials to be removed. + * @return error code or 0 (success) + *) + TLib3MFCompositeMaterials_RemoveCompositeFunc = function(pCompositeMaterials: TLib3MFHandle; const nPropertyID: Cardinal): TLib3MFResult; cdecl; + + (** + * Obtains a Composite-Maxing Ratio of this CompositeMaterials. + * + * @param[in] pCompositeMaterials - CompositeMaterials instance. + * @param[in] nPropertyID - the PropertyID of the Composite-Maxing Ratio in the CompositeMaterials. + * @param[in] nCompositeCount - Number of elements in buffer + * @param[out] pCompositeNeededCount - will be filled with the count of the written elements, or needed buffer size. + * @param[out] pCompositeBuffer - CompositeConstituent buffer of The Composite-Mixing Values with the given PropertyID + * @return error code or 0 (success) + *) + TLib3MFCompositeMaterials_GetCompositeFunc = function(pCompositeMaterials: TLib3MFHandle; const nPropertyID: Cardinal; const nCompositeCount: QWord; out pCompositeNeededCount: QWord; pCompositeBuffer: PLib3MFCompositeConstituent): TLib3MFResult; cdecl; (************************************************************************************************************************* - Function type definitions for Slice + Function type definitions for MultiPropertyGroup **************************************************************************************************************************) (** - * Set all vertices of a slice. All polygons will be cleared. + * Retrieves the count of MultiProperty-s in the MultiPropertyGroup. * - * @param[in] pSlice - Slice instance. - * @param[in] nVerticesCount - Number of elements in buffer - * @param[in] pVerticesBuffer - Position2D buffer of contains the positions. + * @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. + * @param[out] pCount - returns the count of MultiProperty-s * @return error code or 0 (success) *) - TLib3MFSlice_SetVerticesFunc = function(pSlice: TLib3MFHandle; const nVerticesCount: QWord; const pVerticesBuffer: PLib3MFPosition2D): TLib3MFResult; cdecl; + TLib3MFMultiPropertyGroup_GetCountFunc = function(pMultiPropertyGroup: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; (** - * Get all vertices of a slice + * returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup * - * @param[in] pSlice - Slice instance. - * @param[in] nVerticesCount - Number of elements in buffer - * @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. - * @param[out] pVerticesBuffer - Position2D buffer of contains the positions. + * @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. + * @param[in] nPropertyIDsCount - Number of elements in buffer + * @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. + * @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the MultiProperty-s in the MultiPropertyGroup. * @return error code or 0 (success) *) - TLib3MFSlice_GetVerticesFunc = function(pSlice: TLib3MFHandle; const nVerticesCount: QWord; out pVerticesNeededCount: QWord; pVerticesBuffer: PLib3MFPosition2D): TLib3MFResult; cdecl; + TLib3MFMultiPropertyGroup_GetAllPropertyIDsFunc = function(pMultiPropertyGroup: TLib3MFHandle; const nPropertyIDsCount: QWord; out pPropertyIDsNeededCount: QWord; pPropertyIDsBuffer: PCardinal): TLib3MFResult; cdecl; (** - * Get the number of vertices in a slice + * Adds a new MultiProperty to the MultiPropertyGroup. * - * @param[in] pSlice - Slice instance. - * @param[out] pCount - the number of vertices in the slice + * @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. + * @param[in] nPropertyIDsCount - Number of elements in buffer + * @param[in] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the new MultiProperty. + * @param[out] pPropertyID - returns the PropertyID of the new MultiProperty in the MultiPropertyGroup. * @return error code or 0 (success) *) - TLib3MFSlice_GetVertexCountFunc = function(pSlice: TLib3MFHandle; out pCount: QWord): TLib3MFResult; cdecl; + TLib3MFMultiPropertyGroup_AddMultiPropertyFunc = function(pMultiPropertyGroup: TLib3MFHandle; const nPropertyIDsCount: QWord; const pPropertyIDsBuffer: PCardinal; out pPropertyID: Cardinal): TLib3MFResult; cdecl; (** - * Add a new polygon to this slice + * Sets the PropertyIDs of a MultiProperty. * - * @param[in] pSlice - Slice instance. - * @param[in] nIndicesCount - Number of elements in buffer - * @param[in] pIndicesBuffer - uint32 buffer of the new indices of the new polygon - * @param[out] pIndex - the index of the new polygon + * @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. + * @param[in] nPropertyID - the PropertyID of the MultiProperty to be changed. + * @param[in] nPropertyIDsCount - Number of elements in buffer + * @param[in] pPropertyIDsBuffer - uint32 buffer of The new PropertyIDs of the MultiProperty * @return error code or 0 (success) *) - TLib3MFSlice_AddPolygonFunc = function(pSlice: TLib3MFHandle; const nIndicesCount: QWord; const pIndicesBuffer: PCardinal; out pIndex: QWord): TLib3MFResult; cdecl; + TLib3MFMultiPropertyGroup_SetMultiPropertyFunc = function(pMultiPropertyGroup: TLib3MFHandle; const nPropertyID: Cardinal; const nPropertyIDsCount: QWord; const pPropertyIDsBuffer: PCardinal): TLib3MFResult; cdecl; (** - * Get the number of polygons in the slice + * Obtains the PropertyIDs of a MultiProperty. * - * @param[in] pSlice - Slice instance. - * @param[out] pCount - the number of polygons in the slice + * @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. + * @param[in] nPropertyID - the PropertyID of the MultiProperty to be queried. + * @param[in] nPropertyIDsCount - Number of elements in buffer + * @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. + * @param[out] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the MultiProperty * @return error code or 0 (success) *) - TLib3MFSlice_GetPolygonCountFunc = function(pSlice: TLib3MFHandle; out pCount: QWord): TLib3MFResult; cdecl; + TLib3MFMultiPropertyGroup_GetMultiPropertyFunc = function(pMultiPropertyGroup: TLib3MFHandle; const nPropertyID: Cardinal; const nPropertyIDsCount: QWord; out pPropertyIDsNeededCount: QWord; pPropertyIDsBuffer: PCardinal): TLib3MFResult; cdecl; (** - * Set all indices of a polygon + * Removes a MultiProperty from this MultiPropertyGroup. * - * @param[in] pSlice - Slice instance. - * @param[in] nIndex - the index of the polygon to manipulate - * @param[in] nIndicesCount - Number of elements in buffer - * @param[in] pIndicesBuffer - uint32 buffer of the new indices of the index-th polygon + * @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. + * @param[in] nPropertyID - the PropertyID of the MultiProperty to be removed. * @return error code or 0 (success) *) - TLib3MFSlice_SetPolygonIndicesFunc = function(pSlice: TLib3MFHandle; const nIndex: QWord; const nIndicesCount: QWord; const pIndicesBuffer: PCardinal): TLib3MFResult; cdecl; + TLib3MFMultiPropertyGroup_RemoveMultiPropertyFunc = function(pMultiPropertyGroup: TLib3MFHandle; const nPropertyID: Cardinal): TLib3MFResult; cdecl; (** - * Get all vertices of a slice + * Retrieves the number of layers of this MultiPropertyGroup. * - * @param[in] pSlice - Slice instance. - * @param[in] nIndex - the index of the polygon to manipulate - * @param[in] nIndicesCount - Number of elements in buffer - * @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. - * @param[out] pIndicesBuffer - uint32 buffer of the indices of the index-th polygon + * @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. + * @param[out] pCount - returns the number of layers * @return error code or 0 (success) *) - TLib3MFSlice_GetPolygonIndicesFunc = function(pSlice: TLib3MFHandle; const nIndex: QWord; const nIndicesCount: QWord; out pIndicesNeededCount: QWord; pIndicesBuffer: PCardinal): TLib3MFResult; cdecl; + TLib3MFMultiPropertyGroup_GetLayerCountFunc = function(pMultiPropertyGroup: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; (** - * Get the number of vertices in a slice + * Adds a MultiPropertyLayer to this MultiPropertyGroup. * - * @param[in] pSlice - Slice instance. - * @param[in] nIndex - the index of the polygon to manipulate - * @param[out] pCount - the number of indices of the index-th polygon + * @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. + * @param[in] pTheLayer - The MultiPropertyLayer to add to this MultiPropertyGroup + * @param[out] pLayerIndex - returns the index of this MultiPropertyLayer * @return error code or 0 (success) *) - TLib3MFSlice_GetPolygonIndexCountFunc = function(pSlice: TLib3MFHandle; const nIndex: QWord; out pCount: QWord): TLib3MFResult; cdecl; + TLib3MFMultiPropertyGroup_AddLayerFunc = function(pMultiPropertyGroup: TLib3MFHandle; const pTheLayer: PLib3MFMultiPropertyLayer; out pLayerIndex: Cardinal): TLib3MFResult; cdecl; (** - * Get the upper Z-Coordinate of this slice. + * Obtains a MultiPropertyLayer of this MultiPropertyGroup. * - * @param[in] pSlice - Slice instance. - * @param[out] pZTop - the upper Z-Coordinate of this slice + * @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. + * @param[in] nLayerIndex - The Index of the MultiPropertyLayer queried + * @param[out] pTheLayer - The MultiPropertyLayer with index LayerIndex within MultiPropertyGroup * @return error code or 0 (success) *) - TLib3MFSlice_GetZTopFunc = function(pSlice: TLib3MFHandle; out pZTop: Double): TLib3MFResult; cdecl; + TLib3MFMultiPropertyGroup_GetLayerFunc = function(pMultiPropertyGroup: TLib3MFHandle; const nLayerIndex: Cardinal; pTheLayer: PLib3MFMultiPropertyLayer): TLib3MFResult; cdecl; + + (** + * Removes a MultiPropertyLayer from this MultiPropertyGroup. + * + * @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. + * @param[in] nLayerIndex - The Index of the MultiPropertyLayer to be removed + * @return error code or 0 (success) + *) + TLib3MFMultiPropertyGroup_RemoveLayerFunc = function(pMultiPropertyGroup: TLib3MFHandle; const nLayerIndex: Cardinal): TLib3MFResult; cdecl; (************************************************************************************************************************* - Function type definitions for SliceStack + Function type definitions for Attachment **************************************************************************************************************************) (** - * Get the lower Z-Coordinate of the slice stack. + * Retrieves an attachment's package path. This function will be removed in a later release. * - * @param[in] pSliceStack - SliceStack instance. - * @param[out] pZBottom - the lower Z-Coordinate the slice stack + * @param[in] pAttachment - Attachment instance. + * @param[in] nPathBufferSize - size of the buffer (including trailing 0) + * @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pPathBuffer - buffer of returns the attachment's package path string, may be NULL * @return error code or 0 (success) *) - TLib3MFSliceStack_GetBottomZFunc = function(pSliceStack: TLib3MFHandle; out pZBottom: Double): TLib3MFResult; cdecl; + TLib3MFAttachment_GetPathFunc = function(pAttachment: TLib3MFHandle; const nPathBufferSize: Cardinal; out pPathNeededChars: Cardinal; pPathBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * Returns the number of slices + * Sets an attachment's package path. This function will be removed in a later release. * - * @param[in] pSliceStack - SliceStack instance. - * @param[out] pCount - the number of slices + * @param[in] pAttachment - Attachment instance. + * @param[in] pPath - new path of the attachment. * @return error code or 0 (success) *) - TLib3MFSliceStack_GetSliceCountFunc = function(pSliceStack: TLib3MFHandle; out pCount: QWord): TLib3MFResult; cdecl; + TLib3MFAttachment_SetPathFunc = function(pAttachment: TLib3MFHandle; const pPath: PAnsiChar): TLib3MFResult; cdecl; (** - * Query a slice from the slice stack + * Returns the PackagePart that is this attachment. * - * @param[in] pSliceStack - SliceStack instance. - * @param[in] nSliceIndex - the index of the slice - * @param[out] pTheSlice - the Slice instance + * @param[in] pAttachment - Attachment instance. + * @param[out] pPackagePart - The PackagePart of this attachment. * @return error code or 0 (success) *) - TLib3MFSliceStack_GetSliceFunc = function(pSliceStack: TLib3MFHandle; const nSliceIndex: QWord; out pTheSlice: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFAttachment_PackagePartFunc = function(pAttachment: TLib3MFHandle; out pPackagePart: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Returns the number of slices + * Retrieves an attachment's relationship type * - * @param[in] pSliceStack - SliceStack instance. - * @param[in] dZTop - upper Z coordinate of the slice - * @param[out] pTheSlice - a new Slice instance + * @param[in] pAttachment - Attachment instance. + * @param[in] nPathBufferSize - size of the buffer (including trailing 0) + * @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pPathBuffer - buffer of returns the attachment's package relationship type string, may be NULL * @return error code or 0 (success) *) - TLib3MFSliceStack_AddSliceFunc = function(pSliceStack: TLib3MFHandle; const dZTop: Double; out pTheSlice: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFAttachment_GetRelationShipTypeFunc = function(pAttachment: TLib3MFHandle; const nPathBufferSize: Cardinal; out pPathNeededChars: Cardinal; pPathBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * Returns the number of slice refs + * Sets an attachment's relationship type. * - * @param[in] pSliceStack - SliceStack instance. - * @param[out] pCount - the number of slicereferences + * @param[in] pAttachment - Attachment instance. + * @param[in] pPath - new relationship type string. * @return error code or 0 (success) *) - TLib3MFSliceStack_GetSliceRefCountFunc = function(pSliceStack: TLib3MFHandle; out pCount: QWord): TLib3MFResult; cdecl; + TLib3MFAttachment_SetRelationShipTypeFunc = function(pAttachment: TLib3MFHandle; const pPath: PAnsiChar): TLib3MFResult; cdecl; (** - * Adds another existing slicestack as sliceref in this slicestack + * Writes out the attachment as file. * - * @param[in] pSliceStack - SliceStack instance. - * @param[in] pTheSliceStack - the slicestack to use as sliceref + * @param[in] pAttachment - Attachment instance. + * @param[in] pFileName - file to write into. * @return error code or 0 (success) *) - TLib3MFSliceStack_AddSliceStackReferenceFunc = function(pSliceStack: TLib3MFHandle; const pTheSliceStack: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFAttachment_WriteToFileFunc = function(pAttachment: TLib3MFHandle; const pFileName: PAnsiChar): TLib3MFResult; cdecl; (** - * Adds another existing slicestack as sliceref in this slicestack + * Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. * - * @param[in] pSliceStack - SliceStack instance. - * @param[in] nSliceRefIndex - the index of the slice ref - * @param[out] pTheSliceStack - the slicestack that is used as sliceref + * @param[in] pAttachment - Attachment instance. + * @param[in] pFileName - file to read from. * @return error code or 0 (success) *) - TLib3MFSliceStack_GetSliceStackReferenceFunc = function(pSliceStack: TLib3MFHandle; const nSliceRefIndex: QWord; out pTheSliceStack: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFAttachment_ReadFromFileFunc = function(pAttachment: TLib3MFHandle; const pFileName: PAnsiChar): TLib3MFResult; cdecl; (** - * Removes the indirection of slices via slice-refs, i.e. creates the slices of all slice refs of this SliceStack as actual slices of this SliceStack. All previously existing slices or slicerefs will be removed. + * Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. * - * @param[in] pSliceStack - SliceStack instance. + * @param[in] pAttachment - Attachment instance. + * @param[in] pTheReadCallback - Callback to call for reading a data chunk + * @param[in] nStreamSize - number of bytes the callback returns + * @param[in] pTheSeekCallback - Callback to call for seeking in the stream. + * @param[in] pUserData - Userdata that is passed to the callback function * @return error code or 0 (success) *) - TLib3MFSliceStack_CollapseSliceReferencesFunc = function(pSliceStack: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFAttachment_ReadFromCallbackFunc = function(pAttachment: TLib3MFHandle; const pTheReadCallback: PLib3MF_ReadCallback; const nStreamSize: QWord; const pTheSeekCallback: PLib3MF_SeekCallback; const pUserData: Pointer): TLib3MFResult; cdecl; (** - * Sets the package path where this Slice should be stored. Input an empty string to reset the path + * Retrieves the size of the attachment stream * - * @param[in] pSliceStack - SliceStack instance. - * @param[in] pPath - the package path where this Slice should be stored + * @param[in] pAttachment - Attachment instance. + * @param[out] pStreamSize - the stream size * @return error code or 0 (success) *) - TLib3MFSliceStack_SetOwnPathFunc = function(pSliceStack: TLib3MFHandle; const pPath: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFAttachment_GetStreamSizeFunc = function(pAttachment: TLib3MFHandle; out pStreamSize: QWord): TLib3MFResult; cdecl; (** - * Obtains the package path where this Slice should be stored. Returns an empty string if the slicestack is stored within the root model. + * Writes out the attachment into a buffer * - * @param[in] pSliceStack - SliceStack instance. - * @param[in] nPathBufferSize - size of the buffer (including trailing 0) - * @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pPathBuffer - buffer of the package path where this Slice will be stored, may be NULL + * @param[in] pAttachment - Attachment instance. + * @param[in] nBufferCount - Number of elements in buffer + * @param[out] pBufferNeededCount - will be filled with the count of the written elements, or needed buffer size. + * @param[out] pBufferBuffer - uint8 buffer of Buffer to write into * @return error code or 0 (success) *) - TLib3MFSliceStack_GetOwnPathFunc = function(pSliceStack: TLib3MFHandle; const nPathBufferSize: Cardinal; out pPathNeededChars: Cardinal; pPathBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFAttachment_WriteToBufferFunc = function(pAttachment: TLib3MFHandle; const nBufferCount: QWord; out pBufferNeededCount: QWord; pBufferBuffer: PByte): TLib3MFResult; cdecl; + + (** + * Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). + * + * @param[in] pAttachment - Attachment instance. + * @param[in] nBufferCount - Number of elements in buffer + * @param[in] pBufferBuffer - uint8 buffer of Buffer to read from + * @return error code or 0 (success) + *) + TLib3MFAttachment_ReadFromBufferFunc = function(pAttachment: TLib3MFHandle; const nBufferCount: QWord; const pBufferBuffer: PByte): TLib3MFResult; cdecl; (************************************************************************************************************************* - Function type definitions for Consumer + Function type definitions for Texture2D **************************************************************************************************************************) (** - * Gets the consumerid + * Retrieves the attachment located at the path of the texture. * - * @param[in] pConsumer - Consumer instance. - * @param[in] nConsumerIDBufferSize - size of the buffer (including trailing 0) - * @param[out] pConsumerIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pConsumerIDBuffer - buffer of A unique identifier for the consumers, may be NULL + * @param[in] pTexture2D - Texture2D instance. + * @param[out] pAttachment - attachment that holds the texture's image information. * @return error code or 0 (success) *) - TLib3MFConsumer_GetConsumerIDFunc = function(pConsumer: TLib3MFHandle; const nConsumerIDBufferSize: Cardinal; out pConsumerIDNeededChars: Cardinal; pConsumerIDBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFTexture2D_GetAttachmentFunc = function(pTexture2D: TLib3MFHandle; out pAttachment: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Getts the keyid + * Sets the texture's package path to the path of the attachment. * - * @param[in] pConsumer - Consumer instance. - * @param[in] nKeyIDBufferSize - size of the buffer (including trailing 0) - * @param[out] pKeyIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pKeyIDBuffer - buffer of The identifier for the key of this consumer, may be NULL + * @param[in] pTexture2D - Texture2D instance. + * @param[in] pAttachment - attachment that holds the texture's image information. * @return error code or 0 (success) *) - TLib3MFConsumer_GetKeyIDFunc = function(pConsumer: TLib3MFHandle; const nKeyIDBufferSize: Cardinal; out pKeyIDNeededChars: Cardinal; pKeyIDBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFTexture2D_SetAttachmentFunc = function(pTexture2D: TLib3MFHandle; const pAttachment: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Gets the keyvalue associated with this consumer + * Retrieves a texture's content type. * - * @param[in] pConsumer - Consumer instance. - * @param[in] nKeyValueBufferSize - size of the buffer (including trailing 0) - * @param[out] pKeyValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pKeyValueBuffer - buffer of The public key, when available, of this consumer, may be NULL + * @param[in] pTexture2D - Texture2D instance. + * @param[out] pContentType - returns content type enum. * @return error code or 0 (success) *) - TLib3MFConsumer_GetKeyValueFunc = function(pConsumer: TLib3MFHandle; const nKeyValueBufferSize: Cardinal; out pKeyValueNeededChars: Cardinal; pKeyValueBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFTexture2D_GetContentTypeFunc = function(pTexture2D: TLib3MFHandle; out pContentType: Integer): TLib3MFResult; cdecl; - -(************************************************************************************************************************* - Function type definitions for AccessRight -**************************************************************************************************************************) - (** - * Gets the consumer associated with this access right + * Retrieves a texture's content type. * - * @param[in] pAccessRight - AccessRight instance. - * @param[out] pConsumer - The consumer instance + * @param[in] pTexture2D - Texture2D instance. + * @param[in] eContentType - new Content Type * @return error code or 0 (success) *) - TLib3MFAccessRight_GetConsumerFunc = function(pAccessRight: TLib3MFHandle; out pConsumer: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFTexture2D_SetContentTypeFunc = function(pTexture2D: TLib3MFHandle; const eContentType: Integer): TLib3MFResult; cdecl; (** - * Gets the associated encryption algorithm + * Retrieves a texture's tilestyle type. * - * @param[in] pAccessRight - AccessRight instance. - * @param[out] pAlgorithm - The algorithm used for the key in this accessright + * @param[in] pTexture2D - Texture2D instance. + * @param[out] pTileStyleU - returns tilestyle type enum. + * @param[out] pTileStyleV - returns tilestyle type enum. * @return error code or 0 (success) *) - TLib3MFAccessRight_GetWrappingAlgorithmFunc = function(pAccessRight: TLib3MFHandle; out pAlgorithm: Integer): TLib3MFResult; cdecl; + TLib3MFTexture2D_GetTileStyleUVFunc = function(pTexture2D: TLib3MFHandle; out pTileStyleU: Integer; out pTileStyleV: Integer): TLib3MFResult; cdecl; (** - * Gets the associated mask generation function algorithm + * Sets a texture's tilestyle type. * - * @param[in] pAccessRight - AccessRight instance. - * @param[out] pAlgorithm - The MFG1 algorithm + * @param[in] pTexture2D - Texture2D instance. + * @param[in] eTileStyleU - new tilestyle type enum. + * @param[in] eTileStyleV - new tilestyle type enum. * @return error code or 0 (success) *) - TLib3MFAccessRight_GetMgfAlgorithmFunc = function(pAccessRight: TLib3MFHandle; out pAlgorithm: Integer): TLib3MFResult; cdecl; + TLib3MFTexture2D_SetTileStyleUVFunc = function(pTexture2D: TLib3MFHandle; const eTileStyleU: Integer; const eTileStyleV: Integer): TLib3MFResult; cdecl; (** - * Gets the digest method assoicated + * Retrieves a texture's filter type. * - * @param[in] pAccessRight - AccessRight instance. - * @param[out] pAlgorithm - The digest method for this accessright + * @param[in] pTexture2D - Texture2D instance. + * @param[out] pFilter - returns filter type enum. * @return error code or 0 (success) *) - TLib3MFAccessRight_GetDigestMethodFunc = function(pAccessRight: TLib3MFHandle; out pAlgorithm: Integer): TLib3MFResult; cdecl; + TLib3MFTexture2D_GetFilterFunc = function(pTexture2D: TLib3MFHandle; out pFilter: Integer): TLib3MFResult; cdecl; - -(************************************************************************************************************************* - Function type definitions for ContentEncryptionParams -**************************************************************************************************************************) - (** - * Returns the encryption method to be used in this encryption process + * Sets a texture's filter type. * - * @param[in] pContentEncryptionParams - ContentEncryptionParams instance. - * @param[out] pAlgorithm - + * @param[in] pTexture2D - Texture2D instance. + * @param[in] eFilter - sets new filter type enum. * @return error code or 0 (success) *) - TLib3MFContentEncryptionParams_GetEncryptionAlgorithmFunc = function(pContentEncryptionParams: TLib3MFHandle; out pAlgorithm: Integer): TLib3MFResult; cdecl; + TLib3MFTexture2D_SetFilterFunc = function(pTexture2D: TLib3MFHandle; const eFilter: Integer): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Function type definitions for BuildItem +**************************************************************************************************************************) + (** - * Gets the key for the resource associated + * Retrieves the object resource associated to a build item * - * @param[in] pContentEncryptionParams - ContentEncryptionParams instance. - * @param[in] nByteDataCount - Number of elements in buffer - * @param[out] pByteDataNeededCount - will be filled with the count of the written elements, or needed buffer size. - * @param[out] pByteDataBuffer - uint8 buffer of Pointer to a buffer where to place the key. + * @param[in] pBuildItem - BuildItem instance. + * @param[out] pObjectResource - returns the associated resource instance * @return error code or 0 (success) *) - TLib3MFContentEncryptionParams_GetKeyFunc = function(pContentEncryptionParams: TLib3MFHandle; const nByteDataCount: QWord; out pByteDataNeededCount: QWord; pByteDataBuffer: PByte): TLib3MFResult; cdecl; + TLib3MFBuildItem_GetObjectResourceFunc = function(pBuildItem: TLib3MFHandle; out pObjectResource: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Gets the IV data + * returns, whether a build item has a UUID and, if true, the build item's UUID * - * @param[in] pContentEncryptionParams - ContentEncryptionParams instance. - * @param[in] nByteDataCount - Number of elements in buffer - * @param[out] pByteDataNeededCount - will be filled with the count of the written elements, or needed buffer size. - * @param[out] pByteDataBuffer - uint8 buffer of Pointer to a buffer where to place the data. + * @param[in] pBuildItem - BuildItem instance. + * @param[out] pHasUUID - flag whether the build item has a UUID + * @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) + * @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL * @return error code or 0 (success) *) - TLib3MFContentEncryptionParams_GetInitializationVectorFunc = function(pContentEncryptionParams: TLib3MFHandle; const nByteDataCount: QWord; out pByteDataNeededCount: QWord; pByteDataBuffer: PByte): TLib3MFResult; cdecl; + TLib3MFBuildItem_GetUUIDFunc = function(pBuildItem: TLib3MFHandle; out pHasUUID: Byte; const nUUIDBufferSize: Cardinal; out pUUIDNeededChars: Cardinal; pUUIDBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * A handler descriptor that uniquely identifies the context of the resource. Each resource will be assigned a different value + * sets the build item's UUID * - * @param[in] pContentEncryptionParams - ContentEncryptionParams instance. - * @param[in] nByteDataCount - Number of elements in buffer - * @param[out] pByteDataNeededCount - will be filled with the count of the written elements, or needed buffer size. - * @param[out] pByteDataBuffer - uint8 buffer of Pointer to a buffer where to place the data. + * @param[in] pBuildItem - BuildItem instance. + * @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' * @return error code or 0 (success) *) - TLib3MFContentEncryptionParams_GetAuthenticationTagFunc = function(pContentEncryptionParams: TLib3MFHandle; const nByteDataCount: QWord; out pByteDataNeededCount: QWord; pByteDataBuffer: PByte): TLib3MFResult; cdecl; + TLib3MFBuildItem_SetUUIDFunc = function(pBuildItem: TLib3MFHandle; const pUUID: PAnsiChar): TLib3MFResult; cdecl; (** - * Sets the authentication tag + * Retrieves the object UniqueResourceID associated to a build item * - * @param[in] pContentEncryptionParams - ContentEncryptionParams instance. - * @param[in] nByteDataCount - Number of elements in buffer - * @param[in] pByteDataBuffer - uint8 buffer of The authentication tag size + * @param[in] pBuildItem - BuildItem instance. + * @param[out] pUniqueResourceID - returns the UniqueResourceID of the object * @return error code or 0 (success) *) - TLib3MFContentEncryptionParams_SetAuthenticationTagFunc = function(pContentEncryptionParams: TLib3MFHandle; const nByteDataCount: QWord; const pByteDataBuffer: PByte): TLib3MFResult; cdecl; + TLib3MFBuildItem_GetObjectResourceIDFunc = function(pBuildItem: TLib3MFHandle; out pUniqueResourceID: Cardinal): TLib3MFResult; cdecl; (** - * A handler descriptor that uniquely identifies the context of the resource. Each resource will be assigned a different value + * Checks, if a build item has a non-identity transformation matrix * - * @param[in] pContentEncryptionParams - ContentEncryptionParams instance. - * @param[in] nByteDataCount - Number of elements in buffer - * @param[out] pByteDataNeededCount - will be filled with the count of the written elements, or needed buffer size. - * @param[out] pByteDataBuffer - uint8 buffer of Buffer where the data will be placed + * @param[in] pBuildItem - BuildItem instance. + * @param[out] pHasTransform - returns true, if the transformation matrix is not the identity * @return error code or 0 (success) *) - TLib3MFContentEncryptionParams_GetAdditionalAuthenticationDataFunc = function(pContentEncryptionParams: TLib3MFHandle; const nByteDataCount: QWord; out pByteDataNeededCount: QWord; pByteDataBuffer: PByte): TLib3MFResult; cdecl; + TLib3MFBuildItem_HasObjectTransformFunc = function(pBuildItem: TLib3MFHandle; out pHasTransform: Byte): TLib3MFResult; cdecl; (** - * A handler descriptor that uniquely identifies the context of the resource. Each resource will be assigned a different value + * Retrieves a build item's transformation matrix. * - * @param[in] pContentEncryptionParams - ContentEncryptionParams instance. - * @param[out] pDescriptor - + * @param[in] pBuildItem - BuildItem instance. + * @param[out] pTransform - returns the transformation matrix * @return error code or 0 (success) *) - TLib3MFContentEncryptionParams_GetDescriptorFunc = function(pContentEncryptionParams: TLib3MFHandle; out pDescriptor: QWord): TLib3MFResult; cdecl; + TLib3MFBuildItem_GetObjectTransformFunc = function(pBuildItem: TLib3MFHandle; pTransform: PLib3MFTransform): TLib3MFResult; cdecl; (** - * Gets the resourcedatagroup keyuuid + * Sets a build item's transformation matrix. * - * @param[in] pContentEncryptionParams - ContentEncryptionParams instance. - * @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) - * @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pUUIDBuffer - buffer of The resourcedatagroup keyuuid that may be use to reference an external key, may be NULL + * @param[in] pBuildItem - BuildItem instance. + * @param[in] pTransform - new transformation matrix * @return error code or 0 (success) *) - TLib3MFContentEncryptionParams_GetKeyUUIDFunc = function(pContentEncryptionParams: TLib3MFHandle; const nUUIDBufferSize: Cardinal; out pUUIDNeededChars: Cardinal; pUUIDBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFBuildItem_SetObjectTransformFunc = function(pBuildItem: TLib3MFHandle; const pTransform: PLib3MFTransform): TLib3MFResult; cdecl; - -(************************************************************************************************************************* - Function type definitions for ResourceData -**************************************************************************************************************************) - (** - * Gets the encrypted part path + * Retrieves a build item's part number string * - * @param[in] pResourceData - ResourceData instance. - * @param[out] pPath - The part path + * @param[in] pBuildItem - BuildItem instance. + * @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) + * @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pPartNumberBuffer - buffer of Returns a build item's part number string, may be NULL * @return error code or 0 (success) *) - TLib3MFResourceData_GetPathFunc = function(pResourceData: TLib3MFHandle; out pPath: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFBuildItem_GetPartNumberFunc = function(pBuildItem: TLib3MFHandle; const nPartNumberBufferSize: Cardinal; out pPartNumberNeededChars: Cardinal; pPartNumberBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * Gets the encryption algorithm used to encrypt this ResourceData + * Sets a build item's part number string * - * @param[in] pResourceData - ResourceData instance. - * @param[out] pEncryptionAlgorithm - The encryption algorithm + * @param[in] pBuildItem - BuildItem instance. + * @param[in] pSetPartnumber - new part number string for referencing parts from the outside world * @return error code or 0 (success) *) - TLib3MFResourceData_GetEncryptionAlgorithmFunc = function(pResourceData: TLib3MFHandle; out pEncryptionAlgorithm: Integer): TLib3MFResult; cdecl; + TLib3MFBuildItem_SetPartNumberFunc = function(pBuildItem: TLib3MFHandle; const pSetPartnumber: PAnsiChar): TLib3MFResult; cdecl; (** - * Tells whether this ResourceData is compressed or not + * Returns the metadatagroup of this build item * - * @param[in] pResourceData - ResourceData instance. - * @param[out] pCompression - The compression method + * @param[in] pBuildItem - BuildItem instance. + * @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this build item * @return error code or 0 (success) *) - TLib3MFResourceData_GetCompressionFunc = function(pResourceData: TLib3MFHandle; out pCompression: Integer): TLib3MFResult; cdecl; + TLib3MFBuildItem_GetMetaDataGroupFunc = function(pBuildItem: TLib3MFHandle; out pMetaDataGroup: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Tells whether this ResourceData is compressed or not + * Returns the outbox of a build item * - * @param[in] pResourceData - ResourceData instance. - * @param[in] nByteDataCount - Number of elements in buffer - * @param[out] pByteDataNeededCount - will be filled with the count of the written elements, or needed buffer size. - * @param[out] pByteDataBuffer - uint8 buffer of The compression method + * @param[in] pBuildItem - BuildItem instance. + * @param[out] pOutbox - Outbox of this build item * @return error code or 0 (success) *) - TLib3MFResourceData_GetAdditionalAuthenticationDataFunc = function(pResourceData: TLib3MFHandle; const nByteDataCount: QWord; out pByteDataNeededCount: QWord; pByteDataBuffer: PByte): TLib3MFResult; cdecl; + TLib3MFBuildItem_GetOutboxFunc = function(pBuildItem: TLib3MFHandle; pOutbox: PLib3MFBox): TLib3MFResult; cdecl; (************************************************************************************************************************* - Function type definitions for ResourceDataGroup + Function type definitions for BuildItemIterator **************************************************************************************************************************) (** - * Sets the resourcedatagroup keyuuid + * Iterates to the next build item in the list. * - * @param[in] pResourceDataGroup - ResourceDataGroup instance. - * @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) - * @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pUUIDBuffer - buffer of The new resourcedatagroup keyuuid., may be NULL + * @param[in] pBuildItemIterator - BuildItemIterator instance. + * @param[out] pHasNext - Iterates to the next build item in the list. * @return error code or 0 (success) *) - TLib3MFResourceDataGroup_GetKeyUUIDFunc = function(pResourceDataGroup: TLib3MFHandle; const nUUIDBufferSize: Cardinal; out pUUIDNeededChars: Cardinal; pUUIDBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFBuildItemIterator_MoveNextFunc = function(pBuildItemIterator: TLib3MFHandle; out pHasNext: Byte): TLib3MFResult; cdecl; (** - * Add accessright to resourcedatagroup element + * Iterates to the previous build item in the list. * - * @param[in] pResourceDataGroup - ResourceDataGroup instance. - * @param[in] pConsumer - The Consumer reference - * @param[in] eWrappingAlgorithm - The key wrapping algorithm to be used - * @param[in] eMgfAlgorithm - The mask generation function to be used - * @param[in] eDigestMethod - The digest mechanism to be used - * @param[out] pTheAccessRight - The acess right instance + * @param[in] pBuildItemIterator - BuildItemIterator instance. + * @param[out] pHasPrevious - Iterates to the previous build item in the list. * @return error code or 0 (success) *) - TLib3MFResourceDataGroup_AddAccessRightFunc = function(pResourceDataGroup: TLib3MFHandle; const pConsumer: TLib3MFHandle; const eWrappingAlgorithm: Integer; const eMgfAlgorithm: Integer; const eDigestMethod: Integer; out pTheAccessRight: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFBuildItemIterator_MovePreviousFunc = function(pBuildItemIterator: TLib3MFHandle; out pHasPrevious: Byte): TLib3MFResult; cdecl; (** - * Finds the AccessRight associated with a Consumer + * Returns the build item the iterator points at. * - * @param[in] pResourceDataGroup - ResourceDataGroup instance. - * @param[in] pConsumer - The Consumer instance - * @param[out] pTheAccessRight - The AcessRight instance + * @param[in] pBuildItemIterator - BuildItemIterator instance. + * @param[out] pBuildItem - returns the build item instance. * @return error code or 0 (success) *) - TLib3MFResourceDataGroup_FindAccessRightByConsumerFunc = function(pResourceDataGroup: TLib3MFHandle; const pConsumer: TLib3MFHandle; out pTheAccessRight: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFBuildItemIterator_GetCurrentFunc = function(pBuildItemIterator: TLib3MFHandle; out pBuildItem: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Removes access from a Consumer on this resource data group + * Creates a new build item iterator with the same build item list. * - * @param[in] pResourceDataGroup - ResourceDataGroup instance. - * @param[in] pConsumer - The Consumer instance + * @param[in] pBuildItemIterator - BuildItemIterator instance. + * @param[out] pOutBuildItemIterator - returns the cloned Iterator instance * @return error code or 0 (success) *) - TLib3MFResourceDataGroup_RemoveAccessRightFunc = function(pResourceDataGroup: TLib3MFHandle; const pConsumer: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFBuildItemIterator_CloneFunc = function(pBuildItemIterator: TLib3MFHandle; out pOutBuildItemIterator: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Returns the number of build items the iterator captures. + * + * @param[in] pBuildItemIterator - BuildItemIterator instance. + * @param[out] pCount - returns the number of build items the iterator captures. + * @return error code or 0 (success) + *) + TLib3MFBuildItemIterator_CountFunc = function(pBuildItemIterator: TLib3MFHandle; out pCount: QWord): TLib3MFResult; cdecl; (************************************************************************************************************************* - Function type definitions for KeyStore + Function type definitions for Slice **************************************************************************************************************************) (** - * Adds a consumer to the keystore + * Set all vertices of a slice. All polygons will be cleared. * - * @param[in] pKeyStore - KeyStore instance. - * @param[in] pConsumerID - A unique identifier for the consumer - * @param[in] pKeyID - The id of the key of the consumer - * @param[in] pKeyValue - The public key for this consumer in PEM format - * @param[out] pConsumer - The consumer instance + * @param[in] pSlice - Slice instance. + * @param[in] nVerticesCount - Number of elements in buffer + * @param[in] pVerticesBuffer - Position2D buffer of contains the positions. * @return error code or 0 (success) *) - TLib3MFKeyStore_AddConsumerFunc = function(pKeyStore: TLib3MFHandle; const pConsumerID: PAnsiChar; const pKeyID: PAnsiChar; const pKeyValue: PAnsiChar; out pConsumer: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFSlice_SetVerticesFunc = function(pSlice: TLib3MFHandle; const nVerticesCount: QWord; const pVerticesBuffer: PLib3MFPosition2D): TLib3MFResult; cdecl; (** - * Gets the number of consumers in the keystore + * Get all vertices of a slice * - * @param[in] pKeyStore - KeyStore instance. - * @param[out] pCount - The consumer count + * @param[in] pSlice - Slice instance. + * @param[in] nVerticesCount - Number of elements in buffer + * @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. + * @param[out] pVerticesBuffer - Position2D buffer of contains the positions. * @return error code or 0 (success) *) - TLib3MFKeyStore_GetConsumerCountFunc = function(pKeyStore: TLib3MFHandle; out pCount: QWord): TLib3MFResult; cdecl; + TLib3MFSlice_GetVerticesFunc = function(pSlice: TLib3MFHandle; const nVerticesCount: QWord; out pVerticesNeededCount: QWord; pVerticesBuffer: PLib3MFPosition2D): TLib3MFResult; cdecl; (** - * Get a consumer from the keystore + * Get the number of vertices in a slice * - * @param[in] pKeyStore - KeyStore instance. - * @param[in] nConsumerIndex - The index of the consumer - * @param[out] pConsumer - The consumer instance + * @param[in] pSlice - Slice instance. + * @param[out] pCount - the number of vertices in the slice * @return error code or 0 (success) *) - TLib3MFKeyStore_GetConsumerFunc = function(pKeyStore: TLib3MFHandle; const nConsumerIndex: QWord; out pConsumer: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFSlice_GetVertexCountFunc = function(pSlice: TLib3MFHandle; out pCount: QWord): TLib3MFResult; cdecl; (** - * Removes a consumer from the keystore + * Add a new polygon to this slice * - * @param[in] pKeyStore - KeyStore instance. - * @param[in] pConsumer - The consumer instance to remove + * @param[in] pSlice - Slice instance. + * @param[in] nIndicesCount - Number of elements in buffer + * @param[in] pIndicesBuffer - uint32 buffer of the new indices of the new polygon + * @param[out] pIndex - the index of the new polygon * @return error code or 0 (success) *) - TLib3MFKeyStore_RemoveConsumerFunc = function(pKeyStore: TLib3MFHandle; const pConsumer: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFSlice_AddPolygonFunc = function(pSlice: TLib3MFHandle; const nIndicesCount: QWord; const pIndicesBuffer: PCardinal; out pIndex: QWord): TLib3MFResult; cdecl; (** - * Finds a consumer by ID + * Get the number of polygons in the slice * - * @param[in] pKeyStore - KeyStore instance. - * @param[in] pConsumerID - The ID of the consumer - * @param[out] pConsumer - The consumer instance + * @param[in] pSlice - Slice instance. + * @param[out] pCount - the number of polygons in the slice * @return error code or 0 (success) *) - TLib3MFKeyStore_FindConsumerFunc = function(pKeyStore: TLib3MFHandle; const pConsumerID: PAnsiChar; out pConsumer: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFSlice_GetPolygonCountFunc = function(pSlice: TLib3MFHandle; out pCount: QWord): TLib3MFResult; cdecl; (** - * Gets the number of resource data group in the keysore + * Set all indices of a polygon * - * @param[in] pKeyStore - KeyStore instance. - * @param[out] pCount - The number of resource data available + * @param[in] pSlice - Slice instance. + * @param[in] nIndex - the index of the polygon to manipulate + * @param[in] nIndicesCount - Number of elements in buffer + * @param[in] pIndicesBuffer - uint32 buffer of the new indices of the index-th polygon * @return error code or 0 (success) *) - TLib3MFKeyStore_GetResourceDataGroupCountFunc = function(pKeyStore: TLib3MFHandle; out pCount: QWord): TLib3MFResult; cdecl; + TLib3MFSlice_SetPolygonIndicesFunc = function(pSlice: TLib3MFHandle; const nIndex: QWord; const nIndicesCount: QWord; const pIndicesBuffer: PCardinal): TLib3MFResult; cdecl; (** - * Adds a resource data group into the keystore. + * Get all vertices of a slice * - * @param[in] pKeyStore - KeyStore instance. - * @param[out] pResourceDataGroup - The resource data group instance + * @param[in] pSlice - Slice instance. + * @param[in] nIndex - the index of the polygon to manipulate + * @param[in] nIndicesCount - Number of elements in buffer + * @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. + * @param[out] pIndicesBuffer - uint32 buffer of the indices of the index-th polygon * @return error code or 0 (success) *) - TLib3MFKeyStore_AddResourceDataGroupFunc = function(pKeyStore: TLib3MFHandle; out pResourceDataGroup: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFSlice_GetPolygonIndicesFunc = function(pSlice: TLib3MFHandle; const nIndex: QWord; const nIndicesCount: QWord; out pIndicesNeededCount: QWord; pIndicesBuffer: PCardinal): TLib3MFResult; cdecl; (** - * Gets a resource data group + * Get the number of vertices in a slice * - * @param[in] pKeyStore - KeyStore instance. - * @param[in] nResourceDataIndex - The index of the resource data - * @param[out] pResourceDataGroup - The resource data group instance + * @param[in] pSlice - Slice instance. + * @param[in] nIndex - the index of the polygon to manipulate + * @param[out] pCount - the number of indices of the index-th polygon * @return error code or 0 (success) *) - TLib3MFKeyStore_GetResourceDataGroupFunc = function(pKeyStore: TLib3MFHandle; const nResourceDataIndex: QWord; out pResourceDataGroup: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFSlice_GetPolygonIndexCountFunc = function(pSlice: TLib3MFHandle; const nIndex: QWord; out pCount: QWord): TLib3MFResult; cdecl; (** - * Removes a resource data group + * Get the upper Z-Coordinate of this slice. * - * @param[in] pKeyStore - KeyStore instance. - * @param[in] pResourceDataGroup - The resource data group instance + * @param[in] pSlice - Slice instance. + * @param[out] pZTop - the upper Z-Coordinate of this slice * @return error code or 0 (success) *) - TLib3MFKeyStore_RemoveResourceDataGroupFunc = function(pKeyStore: TLib3MFHandle; const pResourceDataGroup: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFSlice_GetZTopFunc = function(pSlice: TLib3MFHandle; out pZTop: Double): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Function type definitions for ToolpathProfile +**************************************************************************************************************************) + (** - * Finds a resource data group that contains a particular resourcedata + * Retrieves the profile's uuid * - * @param[in] pKeyStore - KeyStore instance. - * @param[in] pPartPath - The target path for the resourcedata hold by the resource data group - * @param[out] pResourceDataGroup - The data resource instance + * @param[in] pToolpathProfile - ToolpathProfile instance. + * @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) + * @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL * @return error code or 0 (success) *) - TLib3MFKeyStore_FindResourceDataGroupFunc = function(pKeyStore: TLib3MFHandle; const pPartPath: TLib3MFHandle; out pResourceDataGroup: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathProfile_GetUUIDFunc = function(pToolpathProfile: TLib3MFHandle; const nUUIDBufferSize: Cardinal; out pUUIDNeededChars: Cardinal; pUUIDBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * Add resourcedata to resourcedatagroup element + * Retrieves the profile's name * - * @param[in] pKeyStore - KeyStore instance. - * @param[in] pResourceDataGroup - The resource data group where to add this resource data - * @param[in] pPartPath - The path of the part to be encrypted - * @param[in] eAlgorithm - The encryption algorithm to be used to encrypt this resource - * @param[in] eCompression - Whether compression should be used prior to encryption - * @param[in] nAdditionalAuthenticationDataCount - Number of elements in buffer - * @param[in] pAdditionalAuthenticationDataBuffer - uint8 buffer of Additional data to be encrypted along the contents for better security - * @param[out] pResourceData - The data resource instance + * @param[in] pToolpathProfile - ToolpathProfile instance. + * @param[in] nNameBufferSize - size of the buffer (including trailing 0) + * @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pNameBuffer - buffer of Returns the name., may be NULL * @return error code or 0 (success) *) - TLib3MFKeyStore_AddResourceDataFunc = function(pKeyStore: TLib3MFHandle; const pResourceDataGroup: TLib3MFHandle; const pPartPath: TLib3MFHandle; const eAlgorithm: Integer; const eCompression: Integer; const nAdditionalAuthenticationDataCount: QWord; const pAdditionalAuthenticationDataBuffer: PByte; out pResourceData: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathProfile_GetNameFunc = function(pToolpathProfile: TLib3MFHandle; const nNameBufferSize: Cardinal; out pNameNeededChars: Cardinal; pNameBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * Removes a resource data + * Returns the number of parameters. * - * @param[in] pKeyStore - KeyStore instance. - * @param[in] pResourceData - The resource data to be removed + * @param[in] pToolpathProfile - ToolpathProfile instance. + * @param[out] pCount - Returns the number of parameters. * @return error code or 0 (success) *) - TLib3MFKeyStore_RemoveResourceDataFunc = function(pKeyStore: TLib3MFHandle; const pResourceData: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathProfile_GetParameterCountFunc = function(pToolpathProfile: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; (** - * Finds a resource data on this resource group + * Returns the Name of a parameter. * - * @param[in] pKeyStore - KeyStore instance. - * @param[in] pResourcePath - The target path for the resourcedata - * @param[out] pResourceData - The resource data instance + * @param[in] pToolpathProfile - ToolpathProfile instance. + * @param[in] nIndex - Index of Parameter (0-based). Call will fail if an invalid index is given. + * @param[in] nNameBufferSize - size of the buffer (including trailing 0) + * @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pNameBuffer - buffer of Returns the name of the parameter., may be NULL * @return error code or 0 (success) *) - TLib3MFKeyStore_FindResourceDataFunc = function(pKeyStore: TLib3MFHandle; const pResourcePath: TLib3MFHandle; out pResourceData: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathProfile_GetParameterNameFunc = function(pToolpathProfile: TLib3MFHandle; const nIndex: Cardinal; const nNameBufferSize: Cardinal; out pNameNeededChars: Cardinal; pNameBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * Gets the number of resource data in the keysore + * Returns the NameSpace of a parameter. * - * @param[in] pKeyStore - KeyStore instance. - * @param[out] pCount - The number of resource data available + * @param[in] pToolpathProfile - ToolpathProfile instance. + * @param[in] nIndex - Index of Parameter (0-based). Call will fail if an invalid index is given. + * @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) + * @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pNameSpaceBuffer - buffer of Returns the namespace of the parameter., may be NULL * @return error code or 0 (success) *) - TLib3MFKeyStore_GetResourceDataCountFunc = function(pKeyStore: TLib3MFHandle; out pCount: QWord): TLib3MFResult; cdecl; + TLib3MFToolpathProfile_GetParameterNameSpaceFunc = function(pToolpathProfile: TLib3MFHandle; const nIndex: Cardinal; const nNameSpaceBufferSize: Cardinal; out pNameSpaceNeededChars: Cardinal; pNameSpaceBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * Gets a resource data + * Checks if a parameter value exists. * - * @param[in] pKeyStore - KeyStore instance. - * @param[in] nResourceDataIndex - The index of the resource data - * @param[out] pResourceData - The data resource instance + * @param[in] pToolpathProfile - ToolpathProfile instance. + * @param[in] pNameSpaceName - Name of the Parameter Namespace. + * @param[in] pValueName - Value key string. + * @param[out] pValueExists - Returns if a value exists. * @return error code or 0 (success) *) - TLib3MFKeyStore_GetResourceDataFunc = function(pKeyStore: TLib3MFHandle; const nResourceDataIndex: QWord; out pResourceData: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathProfile_HasParameterValueFunc = function(pToolpathProfile: TLib3MFHandle; const pNameSpaceName: PAnsiChar; const pValueName: PAnsiChar; out pValueExists: Byte): TLib3MFResult; cdecl; (** - * Gets the keystore UUID + * Retrieves a profile's parameter value. Fails if value does not exist. * - * @param[in] pKeyStore - KeyStore instance. - * @param[out] pHasUUID - flag whether the keystore has a UUID - * @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) - * @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pUUIDBuffer - buffer of returns the keystore uuid., may be NULL + * @param[in] pToolpathProfile - ToolpathProfile instance. + * @param[in] pNameSpaceName - Name of the Parameter Namespace. + * @param[in] pValueName - Value key string. + * @param[in] nValueBufferSize - size of the buffer (including trailing 0) + * @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pValueBuffer - buffer of Returns the value of the field., may be NULL * @return error code or 0 (success) *) - TLib3MFKeyStore_GetUUIDFunc = function(pKeyStore: TLib3MFHandle; out pHasUUID: Byte; const nUUIDBufferSize: Cardinal; out pUUIDNeededChars: Cardinal; pUUIDBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFToolpathProfile_GetParameterValueFunc = function(pToolpathProfile: TLib3MFHandle; const pNameSpaceName: PAnsiChar; const pValueName: PAnsiChar; const nValueBufferSize: Cardinal; out pValueNeededChars: Cardinal; pValueBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * Sets the keystore UUID + * Retrieves a profile's parameter value * - * @param[in] pKeyStore - KeyStore instance. - * @param[in] pUUID - The new keystore uuid. + * @param[in] pToolpathProfile - ToolpathProfile instance. + * @param[in] pNameSpaceName - Name of the Parameter Namespace. + * @param[in] pValueName - Value key string. + * @param[in] pDefaultValue - Default value if value does not exist. + * @param[in] nValueBufferSize - size of the buffer (including trailing 0) + * @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pValueBuffer - buffer of Returns the value of the field., may be NULL * @return error code or 0 (success) *) - TLib3MFKeyStore_SetUUIDFunc = function(pKeyStore: TLib3MFHandle; const pUUID: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFToolpathProfile_GetParameterValueDefFunc = function(pToolpathProfile: TLib3MFHandle; const pNameSpaceName: PAnsiChar; const pValueName: PAnsiChar; const pDefaultValue: PAnsiChar; const nValueBufferSize: Cardinal; out pValueNeededChars: Cardinal; pValueBuffer: PAnsiChar): TLib3MFResult; cdecl; - -(************************************************************************************************************************* - Function type definitions for Model -**************************************************************************************************************************) - (** - * Returns the PackagePart within the OPC package that holds the root model. + * Retrieves a profile's parameter value as double. Fails if value does not exist or is not a double value. * - * @param[in] pModel - Model instance. - * @param[out] pRootModelPart - the PackagePart within the OPC package that holds the model-file + * @param[in] pToolpathProfile - ToolpathProfile instance. + * @param[in] pNameSpaceName - Name of the Parameter Namespace. + * @param[in] pValueName - Value key string. + * @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) *) - TLib3MFModel_RootModelPartFunc = function(pModel: TLib3MFHandle; out pRootModelPart: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathProfile_GetParameterDoubleValueFunc = function(pToolpathProfile: TLib3MFHandle; const pNameSpaceName: PAnsiChar; const pValueName: PAnsiChar; out pValue: Double): TLib3MFResult; cdecl; (** - * Returns a new PackagePart for use within the OPC package. + * Retrieves a profile's parameter value as double. * - * @param[in] pModel - Model instance. - * @param[in] pAbsolutePath - the absolute Path (physical location) within the OPC package - * @param[out] pModelPart - the new PackagePart within the OPC package + * @param[in] pToolpathProfile - ToolpathProfile instance. + * @param[in] pNameSpaceName - Name of the Parameter Namespace. + * @param[in] pValueName - Value key string. + * @param[in] dDefaultValue - Default value if value does not exist or is not a double value. + * @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) *) - TLib3MFModel_FindOrCreatePackagePartFunc = function(pModel: TLib3MFHandle; const pAbsolutePath: PAnsiChar; out pModelPart: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathProfile_GetParameterDoubleValueDefFunc = function(pToolpathProfile: TLib3MFHandle; const pNameSpaceName: PAnsiChar; const pValueName: PAnsiChar; const dDefaultValue: Double; out pValue: Double): TLib3MFResult; cdecl; (** - * sets the units of a model. + * Retrieves a profile's parameter value as integer. Fails if value does not exist or is not a integer value. * - * @param[in] pModel - Model instance. - * @param[in] eUnit - Unit enum value for the model unit + * @param[in] pToolpathProfile - ToolpathProfile instance. + * @param[in] pNameSpaceName - Name of the Parameter Namespace. + * @param[in] pValueName - Value key string. + * @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) *) - TLib3MFModel_SetUnitFunc = function(pModel: TLib3MFHandle; const eUnit: Integer): TLib3MFResult; cdecl; + TLib3MFToolpathProfile_GetParameterIntegerValueFunc = function(pToolpathProfile: TLib3MFHandle; const pNameSpaceName: PAnsiChar; const pValueName: PAnsiChar; out pValue: Int64): TLib3MFResult; cdecl; (** - * returns the units of a model. + * Retrieves a profile's parameter value as integer. * - * @param[in] pModel - Model instance. - * @param[out] pUnit - Unit enum value for the model unit + * @param[in] pToolpathProfile - ToolpathProfile instance. + * @param[in] pNameSpaceName - Name of the Parameter Namespace. + * @param[in] pValueName - Value key string. + * @param[in] nDefaultValue - Default value if value does not exist or is not a integer value. + * @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) *) - TLib3MFModel_GetUnitFunc = function(pModel: TLib3MFHandle; out pUnit: Integer): TLib3MFResult; cdecl; + TLib3MFToolpathProfile_GetParameterIntegerValueDefFunc = function(pToolpathProfile: TLib3MFHandle; const pNameSpaceName: PAnsiChar; const pValueName: PAnsiChar; const nDefaultValue: Int64; out pValue: Int64): TLib3MFResult; cdecl; (** - * retrieves the language of a model + * Retrieves a profile's parameter value as boolean. Fails if value does not exist or is not a boolean value. * - * @param[in] pModel - Model instance. - * @param[in] nLanguageBufferSize - size of the buffer (including trailing 0) - * @param[out] pLanguageNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pLanguageBuffer - buffer of language identifier, may be NULL + * @param[in] pToolpathProfile - ToolpathProfile instance. + * @param[in] pNameSpaceName - Name of the Parameter Namespace. + * @param[in] pValueName - Value key string. + * @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) *) - TLib3MFModel_GetLanguageFunc = function(pModel: TLib3MFHandle; const nLanguageBufferSize: Cardinal; out pLanguageNeededChars: Cardinal; pLanguageBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFToolpathProfile_GetParameterBoolValueFunc = function(pToolpathProfile: TLib3MFHandle; const pNameSpaceName: PAnsiChar; const pValueName: PAnsiChar; out pValue: Byte): TLib3MFResult; cdecl; (** - * sets the language of a model + * Retrieves a profile's parameter value as boolean. * - * @param[in] pModel - Model instance. - * @param[in] pLanguage - language identifier + * @param[in] pToolpathProfile - ToolpathProfile instance. + * @param[in] pNameSpaceName - Name of the Parameter Namespace. + * @param[in] pValueName - Value key string. + * @param[in] bDefaultValue - Default value if value does not exist or is not a boolean value. + * @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) *) - TLib3MFModel_SetLanguageFunc = function(pModel: TLib3MFHandle; const pLanguage: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFToolpathProfile_GetParameterBoolValueDefFunc = function(pToolpathProfile: TLib3MFHandle; const pNameSpaceName: PAnsiChar; const pValueName: PAnsiChar; const bDefaultValue: Byte; out pValue: Byte): TLib3MFResult; cdecl; (** - * creates a model writer instance for a specific file type + * Sets the profile's name * - * @param[in] pModel - Model instance. - * @param[in] pWriterClass - string identifier for the file type - * @param[out] pWriterInstance - string identifier for the file type + * @param[in] pToolpathProfile - ToolpathProfile instance. + * @param[in] pName - Returns the name. * @return error code or 0 (success) *) - TLib3MFModel_QueryWriterFunc = function(pModel: TLib3MFHandle; const pWriterClass: PAnsiChar; out pWriterInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathProfile_SetNameFunc = function(pToolpathProfile: TLib3MFHandle; const pName: PAnsiChar): TLib3MFResult; cdecl; (** - * creates a model reader instance for a specific file type + * Sets a profile's parameter value. * - * @param[in] pModel - Model instance. - * @param[in] pReaderClass - string identifier for the file type - * @param[out] pReaderInstance - string identifier for the file type + * @param[in] pToolpathProfile - ToolpathProfile instance. + * @param[in] pNameSpaceName - Name of the Parameter Namespace. + * @param[in] pValueName - Value key string. + * @param[in] pValue - String value of the parameter. * @return error code or 0 (success) *) - TLib3MFModel_QueryReaderFunc = function(pModel: TLib3MFHandle; const pReaderClass: PAnsiChar; out pReaderInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathProfile_SetParameterValueFunc = function(pToolpathProfile: TLib3MFHandle; const pNameSpaceName: PAnsiChar; const pValueName: PAnsiChar; const pValue: PAnsiChar): TLib3MFResult; cdecl; (** - * finds a model resource by its UniqueResourceID + * Sets a profile's parameter value as double. * - * @param[in] pModel - Model instance. - * @param[in] nUniqueResourceID - UniqueResourceID - * @param[out] pResource - returns the resource instance + * @param[in] pToolpathProfile - ToolpathProfile instance. + * @param[in] pNameSpaceName - Name of the Parameter Namespace. + * @param[in] pValueName - Value key string. + * @param[in] dValue - Double value of the parameter. * @return error code or 0 (success) *) - TLib3MFModel_GetResourceByIDFunc = function(pModel: TLib3MFHandle; const nUniqueResourceID: Cardinal; out pResource: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathProfile_SetParameterDoubleValueFunc = function(pToolpathProfile: TLib3MFHandle; const pNameSpaceName: PAnsiChar; const pValueName: PAnsiChar; const dValue: Double): TLib3MFResult; cdecl; (** - * finds a model texture by its UniqueResourceID + * Sets a profile's parameter value as integer. * - * @param[in] pModel - Model instance. - * @param[in] nUniqueResourceID - UniqueResourceID - * @param[out] pTextureInstance - returns the texture2d instance + * @param[in] pToolpathProfile - ToolpathProfile instance. + * @param[in] pNameSpaceName - Name of the Parameter Namespace. + * @param[in] pValueName - Value key string. + * @param[in] nValue - Integer value of the parameter. * @return error code or 0 (success) *) - TLib3MFModel_GetTexture2DByIDFunc = function(pModel: TLib3MFHandle; const nUniqueResourceID: Cardinal; out pTextureInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathProfile_SetParameterIntegerValueFunc = function(pToolpathProfile: TLib3MFHandle; const pNameSpaceName: PAnsiChar; const pValueName: PAnsiChar; const nValue: Int64): TLib3MFResult; cdecl; (** - * returns a Property's type + * Sets a profile's parameter value as boolean. * - * @param[in] pModel - Model instance. - * @param[in] nUniqueResourceID - Resource ID of the Property to Query - * @param[out] pThePropertyType - returns a Property's type + * @param[in] pToolpathProfile - ToolpathProfile instance. + * @param[in] pNameSpaceName - Name of the Parameter Namespace. + * @param[in] pValueName - Value key string. + * @param[in] bValue - Boolean value of the parameter. * @return error code or 0 (success) *) - TLib3MFModel_GetPropertyTypeByIDFunc = function(pModel: TLib3MFHandle; const nUniqueResourceID: Cardinal; out pThePropertyType: Integer): TLib3MFResult; cdecl; + TLib3MFToolpathProfile_SetParameterBoolValueFunc = function(pToolpathProfile: TLib3MFHandle; const pNameSpaceName: PAnsiChar; const pValueName: PAnsiChar; const bValue: Byte): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Function type definitions for ToolpathLayerReader +**************************************************************************************************************************) + (** - * finds a model base material group by its UniqueResourceID + * Retrieves the layerdata's uuid * - * @param[in] pModel - Model instance. - * @param[in] nUniqueResourceID - UniqueResourceID - * @param[out] pBaseMaterialGroupInstance - returns the BaseMaterialGroup instance + * @param[in] pToolpathLayerReader - ToolpathLayerReader instance. + * @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) + * @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL * @return error code or 0 (success) *) - TLib3MFModel_GetBaseMaterialGroupByIDFunc = function(pModel: TLib3MFHandle; const nUniqueResourceID: Cardinal; out pBaseMaterialGroupInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerReader_GetLayerDataUUIDFunc = function(pToolpathLayerReader: TLib3MFHandle; const nUUIDBufferSize: Cardinal; out pUUIDNeededChars: Cardinal; pUUIDBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * finds a model texture2d group by its UniqueResourceID + * Retrieves the count of segments. * - * @param[in] pModel - Model instance. - * @param[in] nUniqueResourceID - UniqueResourceID - * @param[out] pTexture2DGroupInstance - returns the Texture2DGroup instance + * @param[in] pToolpathLayerReader - ToolpathLayerReader instance. + * @param[out] pCount - Count * @return error code or 0 (success) *) - TLib3MFModel_GetTexture2DGroupByIDFunc = function(pModel: TLib3MFHandle; const nUniqueResourceID: Cardinal; out pTexture2DGroupInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerReader_GetSegmentCountFunc = function(pToolpathLayerReader: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; (** - * finds a model CompositeMaterials by its UniqueResourceID + * Retrieves the segment type information . * - * @param[in] pModel - Model instance. - * @param[in] nUniqueResourceID - UniqueResourceID - * @param[out] pCompositeMaterialsInstance - returns the CompositeMaterials instance + * @param[in] pToolpathLayerReader - ToolpathLayerReader instance. + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @param[out] pType - Segment Type + * @param[out] pPointCount - Point count of segment. * @return error code or 0 (success) *) - TLib3MFModel_GetCompositeMaterialsByIDFunc = function(pModel: TLib3MFHandle; const nUniqueResourceID: Cardinal; out pCompositeMaterialsInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerReader_GetSegmentInfoFunc = function(pToolpathLayerReader: TLib3MFHandle; const nIndex: Cardinal; out pType: Integer; out pPointCount: Cardinal): TLib3MFResult; cdecl; (** - * finds a model MultiPropertyGroup by its UniqueResourceID + * Retrieves the assigned segment profile. * - * @param[in] pModel - Model instance. - * @param[in] nUniqueResourceID - UniqueResourceID - * @param[out] pMultiPropertyGroupInstance - returns the MultiPropertyGroup instance + * @param[in] pToolpathLayerReader - ToolpathLayerReader instance. + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @param[out] pProfile - Segment Profile * @return error code or 0 (success) *) - TLib3MFModel_GetMultiPropertyGroupByIDFunc = function(pModel: TLib3MFHandle; const nUniqueResourceID: Cardinal; out pMultiPropertyGroupInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerReader_GetSegmentProfileFunc = function(pToolpathLayerReader: TLib3MFHandle; const nIndex: Cardinal; out pProfile: TLib3MFHandle): TLib3MFResult; cdecl; (** - * finds a mesh object by its UniqueResourceID + * Retrieves the assigned segment profile uuid. * - * @param[in] pModel - Model instance. - * @param[in] nUniqueResourceID - UniqueResourceID - * @param[out] pMeshObjectInstance - returns the mesh object instance + * @param[in] pToolpathLayerReader - ToolpathLayerReader instance. + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @param[in] nProfileUUIDBufferSize - size of the buffer (including trailing 0) + * @param[out] pProfileUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pProfileUUIDBuffer - buffer of Segment Profile UUID, may be NULL * @return error code or 0 (success) *) - TLib3MFModel_GetMeshObjectByIDFunc = function(pModel: TLib3MFHandle; const nUniqueResourceID: Cardinal; out pMeshObjectInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerReader_GetSegmentProfileUUIDFunc = function(pToolpathLayerReader: TLib3MFHandle; const nIndex: Cardinal; const nProfileUUIDBufferSize: Cardinal; out pProfileUUIDNeededChars: Cardinal; pProfileUUIDBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * finds a components object by its UniqueResourceID + * Retrieves the assigned segment profile. * - * @param[in] pModel - Model instance. - * @param[in] nUniqueResourceID - UniqueResourceID - * @param[out] pComponentsObjectInstance - returns the components object instance + * @param[in] pToolpathLayerReader - ToolpathLayerReader instance. + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @param[out] pBuildItem - Segment Build Item * @return error code or 0 (success) *) - TLib3MFModel_GetComponentsObjectByIDFunc = function(pModel: TLib3MFHandle; const nUniqueResourceID: Cardinal; out pComponentsObjectInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerReader_GetSegmentPartFunc = function(pToolpathLayerReader: TLib3MFHandle; const nIndex: Cardinal; out pBuildItem: TLib3MFHandle): TLib3MFResult; cdecl; (** - * finds a model color group by its UniqueResourceID + * Retrieves the assigned segment part uuid. * - * @param[in] pModel - Model instance. - * @param[in] nUniqueResourceID - UniqueResourceID - * @param[out] pColorGroupInstance - returns the ColorGroup instance + * @param[in] pToolpathLayerReader - ToolpathLayerReader instance. + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @param[in] nPartUUIDBufferSize - size of the buffer (including trailing 0) + * @param[out] pPartUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pPartUUIDBuffer - buffer of Segment Part UUID, may be NULL * @return error code or 0 (success) *) - TLib3MFModel_GetColorGroupByIDFunc = function(pModel: TLib3MFHandle; const nUniqueResourceID: Cardinal; out pColorGroupInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerReader_GetSegmentPartUUIDFunc = function(pToolpathLayerReader: TLib3MFHandle; const nIndex: Cardinal; const nPartUUIDBufferSize: Cardinal; out pPartUUIDNeededChars: Cardinal; pPartUUIDBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * finds a model slicestack by its UniqueResourceID + * Retrieves the assigned segment part id. ATTENTION: This ID is only unique within the layer and there is no guarantee to be globally unique or consistent across layers. * - * @param[in] pModel - Model instance. - * @param[in] nUniqueResourceID - UniqueResourceID - * @param[out] pSliceStacInstance - returns the slicestack instance + * @param[in] pToolpathLayerReader - ToolpathLayerReader instance. + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @param[out] pLocalPartID - Local Segment Part ID * @return error code or 0 (success) *) - TLib3MFModel_GetSliceStackByIDFunc = function(pModel: TLib3MFHandle; const nUniqueResourceID: Cardinal; out pSliceStacInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerReader_GetSegmentLocalPartIDFunc = function(pToolpathLayerReader: TLib3MFHandle; const nIndex: Cardinal; out pLocalPartID: Cardinal): TLib3MFResult; cdecl; (** - * returns, whether a build has a UUID and, if true, the build's UUID + * Retrieves the global part UUID by the local part ID. Fails if part ID does not exist in this layer. ATTENTION: This ID is only unique within the layer and there is no guarantee to be globally unique or consistent across layers. * - * @param[in] pModel - Model instance. - * @param[out] pHasUUID - flag whether the build has a UUID - * @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) - * @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL + * @param[in] pToolpathLayerReader - ToolpathLayerReader instance. + * @param[in] nLocalPartID - Local Segment Part ID + * @param[in] nPartUUIDBufferSize - size of the buffer (including trailing 0) + * @param[out] pPartUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pPartUUIDBuffer - buffer of Segment Part UUID, may be NULL * @return error code or 0 (success) *) - TLib3MFModel_GetBuildUUIDFunc = function(pModel: TLib3MFHandle; out pHasUUID: Byte; const nUUIDBufferSize: Cardinal; out pUUIDNeededChars: Cardinal; pUUIDBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDFunc = function(pToolpathLayerReader: TLib3MFHandle; const nLocalPartID: Cardinal; const nPartUUIDBufferSize: Cardinal; out pPartUUIDNeededChars: Cardinal; pPartUUIDBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * sets the build's UUID + * Retrieves the assigned segment point list. For type hatch, the points are taken pairwise. * - * @param[in] pModel - Model instance. - * @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + * @param[in] pToolpathLayerReader - ToolpathLayerReader instance. + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @param[in] nPointDataCount - Number of elements in buffer + * @param[out] pPointDataNeededCount - will be filled with the count of the written elements, or needed buffer size. + * @param[out] pPointDataBuffer - Position2D buffer of The point data array * @return error code or 0 (success) *) - TLib3MFModel_SetBuildUUIDFunc = function(pModel: TLib3MFHandle; const pUUID: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFToolpathLayerReader_GetSegmentPointDataFunc = function(pToolpathLayerReader: TLib3MFHandle; const nIndex: Cardinal; const nPointDataCount: QWord; out pPointDataNeededCount: QWord; pPointDataBuffer: PLib3MFPosition2D): TLib3MFResult; cdecl; (** - * creates a build item iterator instance with all build items. + * Retrieves a segment attribute Information by Attribute Name. Will fail if Attribute does not exist. * - * @param[in] pModel - Model instance. - * @param[out] pBuildItemIterator - returns the iterator instance. + * @param[in] pToolpathLayerReader - ToolpathLayerReader instance. + * @param[in] pNameSpace - Namespace of the custom attribute. + * @param[in] pAttributeName - Name of the custom attribute. + * @param[out] pID - Attribute ID. + * @param[out] pAttributeType - Attribute Type. * @return error code or 0 (success) *) - TLib3MFModel_GetBuildItemsFunc = function(pModel: TLib3MFHandle; out pBuildItemIterator: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerReader_FindAttributeInfoByNameFunc = function(pToolpathLayerReader: TLib3MFHandle; const pNameSpace: PAnsiChar; const pAttributeName: PAnsiChar; out pID: Cardinal; out pAttributeType: Integer): TLib3MFResult; cdecl; (** - * Returns the outbox of a Model + * Retrieves a segment attribute ID by Attribute Name. Will fail if Attribute does not exist. * - * @param[in] pModel - Model instance. - * @param[out] pOutbox - Outbox of this Model + * @param[in] pToolpathLayerReader - ToolpathLayerReader instance. + * @param[in] pNameSpace - Namespace of the custom attribute. + * @param[in] pAttributeName - Name of the custom attribute. + * @param[out] pID - Attribute ID. * @return error code or 0 (success) *) - TLib3MFModel_GetOutboxFunc = function(pModel: TLib3MFHandle; pOutbox: PLib3MFBox): TLib3MFResult; cdecl; + TLib3MFToolpathLayerReader_FindAttributeIDByNameFunc = function(pToolpathLayerReader: TLib3MFHandle; const pNameSpace: PAnsiChar; const pAttributeName: PAnsiChar; out pID: Cardinal): TLib3MFResult; cdecl; (** - * creates a resource iterator instance with all resources. + * Retrieves a segment attribute Type by Attribute Name. Will fail if Attribute does not exist. * - * @param[in] pModel - Model instance. - * @param[out] pResourceIterator - returns the iterator instance. + * @param[in] pToolpathLayerReader - ToolpathLayerReader instance. + * @param[in] pNameSpace - Namespace of the custom attribute. + * @param[in] pAttributeName - Name of the custom attribute. + * @param[out] pAttributeType - Attribute Type. * @return error code or 0 (success) *) - TLib3MFModel_GetResourcesFunc = function(pModel: TLib3MFHandle; out pResourceIterator: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerReader_FindAttributeValueByNameFunc = function(pToolpathLayerReader: TLib3MFHandle; const pNameSpace: PAnsiChar; const pAttributeName: PAnsiChar; out pAttributeType: Integer): TLib3MFResult; cdecl; (** - * creates a resource iterator instance with all object resources. + * Retrieves a segment Uint32 attribute by Attribute ID. Will fail if Attribute does not exist. * - * @param[in] pModel - Model instance. - * @param[out] pResourceIterator - returns the iterator instance. + * @param[in] pToolpathLayerReader - ToolpathLayerReader instance. + * @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. + * @param[in] nID - Attribute ID. + * @param[out] pValue - Attribute Value. * @return error code or 0 (success) *) - TLib3MFModel_GetObjectsFunc = function(pModel: TLib3MFHandle; out pResourceIterator: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByIDFunc = function(pToolpathLayerReader: TLib3MFHandle; const nIndex: Cardinal; const nID: Cardinal; out pValue: Int64): TLib3MFResult; cdecl; (** - * creates a resource iterator instance with all mesh object resources. + * Retrieves a segment integer attribute by Attribute Name. Will fail if Attribute does not exist or is of different type. * - * @param[in] pModel - Model instance. - * @param[out] pResourceIterator - returns the iterator instance. + * @param[in] pToolpathLayerReader - ToolpathLayerReader instance. + * @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. + * @param[in] pNameSpace - Namespace of the custom attribute. + * @param[in] pAttributeName - Name of the custom attribute. + * @param[out] pValue - Attribute Value. * @return error code or 0 (success) *) - TLib3MFModel_GetMeshObjectsFunc = function(pModel: TLib3MFHandle; out pResourceIterator: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByNameFunc = function(pToolpathLayerReader: TLib3MFHandle; const nIndex: Cardinal; const pNameSpace: PAnsiChar; const pAttributeName: PAnsiChar; out pValue: Int64): TLib3MFResult; cdecl; (** - * creates a resource iterator instance with all components object resources. + * Retrieves a segment Double attribute by Attribute ID. Will fail if Attribute does not exist. * - * @param[in] pModel - Model instance. - * @param[out] pResourceIterator - returns the iterator instance. + * @param[in] pToolpathLayerReader - ToolpathLayerReader instance. + * @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. + * @param[in] nID - Attribute ID. + * @param[out] pValue - Attribute Value. * @return error code or 0 (success) *) - TLib3MFModel_GetComponentsObjectsFunc = function(pModel: TLib3MFHandle; out pResourceIterator: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByIDFunc = function(pToolpathLayerReader: TLib3MFHandle; const nIndex: Cardinal; const nID: Cardinal; out pValue: Double): TLib3MFResult; cdecl; (** - * creates a Texture2DIterator instance with all texture2d resources. + * Retrieves a segment Double attribute by Attribute Name. Will fail if Attribute does not exist. * - * @param[in] pModel - Model instance. - * @param[out] pResourceIterator - returns the iterator instance. + * @param[in] pToolpathLayerReader - ToolpathLayerReader instance. + * @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. + * @param[in] pNameSpace - Namespace of the custom attribute. + * @param[in] pAttributeName - Name of the custom attribute. + * @param[out] pValue - Attribute Value. * @return error code or 0 (success) *) - TLib3MFModel_GetTexture2DsFunc = function(pModel: TLib3MFHandle; out pResourceIterator: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByNameFunc = function(pToolpathLayerReader: TLib3MFHandle; const nIndex: Cardinal; const pNameSpace: PAnsiChar; const pAttributeName: PAnsiChar; out pValue: Double): TLib3MFResult; cdecl; (** - * creates a BaseMaterialGroupIterator instance with all base material resources. + * Retrieves the count of custom data elements. * - * @param[in] pModel - Model instance. - * @param[out] pResourceIterator - returns the iterator instance. + * @param[in] pToolpathLayerReader - ToolpathLayerReader instance. + * @param[out] pCount - Count * @return error code or 0 (success) *) - TLib3MFModel_GetBaseMaterialGroupsFunc = function(pModel: TLib3MFHandle; out pResourceIterator: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerReader_GetCustomDataCountFunc = function(pToolpathLayerReader: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; (** - * creates a ColorGroupIterator instance with all ColorGroup resources. + * Retrieves the custom data. * - * @param[in] pModel - Model instance. - * @param[out] pResourceIterator - returns the iterator instance. + * @param[in] pToolpathLayerReader - ToolpathLayerReader instance. + * @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count + * @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) *) - TLib3MFModel_GetColorGroupsFunc = function(pModel: TLib3MFHandle; out pResourceIterator: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerReader_GetCustomDataFunc = function(pToolpathLayerReader: TLib3MFHandle; const nIndex: Cardinal; out pData: TLib3MFHandle): TLib3MFResult; cdecl; (** - * creates a Texture2DGroupIterator instance with all base material resources. + * Retrieves the node name of the custom data. * - * @param[in] pModel - Model instance. - * @param[out] pResourceIterator - returns the iterator instance. + * @param[in] pToolpathLayerReader - ToolpathLayerReader instance. + * @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count + * @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) + * @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pNameSpaceBuffer - buffer of Namespace of the custom data tree., may be NULL + * @param[in] nDataNameBufferSize - size of the buffer (including trailing 0) + * @param[out] pDataNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pDataNameBuffer - buffer of Root name of the data tree., may be NULL * @return error code or 0 (success) *) - TLib3MFModel_GetTexture2DGroupsFunc = function(pModel: TLib3MFHandle; out pResourceIterator: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerReader_GetCustomDataNameFunc = function(pToolpathLayerReader: TLib3MFHandle; const nIndex: Cardinal; const nNameSpaceBufferSize: Cardinal; out pNameSpaceNeededChars: Cardinal; pNameSpaceBuffer: PAnsiChar; const nDataNameBufferSize: Cardinal; out pDataNameNeededChars: Cardinal; pDataNameBuffer: PAnsiChar): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Function type definitions for ToolpathLayerData +**************************************************************************************************************************) + (** - * creates a CompositeMaterialsIterator instance with all CompositeMaterials resources. + * Retrieves the layerdata's uuid * - * @param[in] pModel - Model instance. - * @param[out] pResourceIterator - returns the iterator instance. + * @param[in] pToolpathLayerData - ToolpathLayerData instance. + * @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) + * @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL * @return error code or 0 (success) *) - TLib3MFModel_GetCompositeMaterialsFunc = function(pModel: TLib3MFHandle; out pResourceIterator: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerData_GetLayerDataUUIDFunc = function(pToolpathLayerData: TLib3MFHandle; const nUUIDBufferSize: Cardinal; out pUUIDNeededChars: Cardinal; pUUIDBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * creates a MultiPropertyGroupsIterator instance with all MultiPropertyGroup resources. + * Registers a toolpath profile * - * @param[in] pModel - Model instance. - * @param[out] pResourceIterator - returns the iterator instance. + * @param[in] pToolpathLayerData - ToolpathLayerData instance. + * @param[in] pProfile - The toolpath profile to register. + * @param[out] pProfileID - returns the local profile ID for the layer. * @return error code or 0 (success) *) - TLib3MFModel_GetMultiPropertyGroupsFunc = function(pModel: TLib3MFHandle; out pResourceIterator: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerData_RegisterProfileFunc = function(pToolpathLayerData: TLib3MFHandle; const pProfile: TLib3MFHandle; out pProfileID: Cardinal): TLib3MFResult; cdecl; (** - * creates a resource iterator instance with all slice stack resources. + * Registers a Model Build Item * - * @param[in] pModel - Model instance. - * @param[out] pResourceIterator - returns the iterator instance. + * @param[in] pToolpathLayerData - ToolpathLayerData instance. + * @param[in] pBuildItem - The model build item to use. + * @param[out] pPartID - returns the local part ID for the layer. * @return error code or 0 (success) *) - TLib3MFModel_GetSliceStacksFunc = function(pModel: TLib3MFHandle; out pResourceIterator: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerData_RegisterBuildItemFunc = function(pToolpathLayerData: TLib3MFHandle; const pBuildItem: TLib3MFHandle; out pPartID: Cardinal): TLib3MFResult; cdecl; (** - * Merges all components and objects which are referenced by a build item into a mesh. The memory is duplicated and a new model is created. + * Sets Segment Attribute for all following segments that are added. Overrides previously set attribute. * - * @param[in] pModel - Model instance. - * @param[out] pMergedModelInstance - returns the merged model instance + * @param[in] pToolpathLayerData - ToolpathLayerData instance. + * @param[in] pNameSpace - The namespace of the attribute to register. + * @param[in] pAttributeName - The name of the attribute to register. + * @param[in] pValue - The value of the attribute to register. * @return error code or 0 (success) *) - TLib3MFModel_MergeToModelFunc = function(pModel: TLib3MFHandle; out pMergedModelInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerData_SetSegmentAttributeFunc = function(pToolpathLayerData: TLib3MFHandle; const pNameSpace: PAnsiChar; const pAttributeName: PAnsiChar; const pValue: PAnsiChar): TLib3MFResult; cdecl; (** - * adds an empty mesh object to the model. + * Clears current segment attributes. * - * @param[in] pModel - Model instance. - * @param[out] pMeshObjectInstance - returns the mesh object instance + * @param[in] pToolpathLayerData - ToolpathLayerData instance. * @return error code or 0 (success) *) - TLib3MFModel_AddMeshObjectFunc = function(pModel: TLib3MFHandle; out pMeshObjectInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerData_ClearSegmentAttributesFunc = function(pToolpathLayerData: TLib3MFHandle): TLib3MFResult; cdecl; (** - * adds an empty component object to the model. + * writes hatch data to the layer. * - * @param[in] pModel - Model instance. - * @param[out] pComponentsObjectInstance - returns the components object instance + * @param[in] pToolpathLayerData - ToolpathLayerData instance. + * @param[in] nProfileID - The toolpath profile to use + * @param[in] nPartID - The toolpath part to use + * @param[in] nPointDataCount - Number of elements in buffer + * @param[in] pPointDataBuffer - Position2D buffer of The point data * @return error code or 0 (success) *) - TLib3MFModel_AddComponentsObjectFunc = function(pModel: TLib3MFHandle; out pComponentsObjectInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerData_WriteHatchDataFunc = function(pToolpathLayerData: TLib3MFHandle; const nProfileID: Cardinal; const nPartID: Cardinal; const nPointDataCount: QWord; const pPointDataBuffer: PLib3MFPosition2D): TLib3MFResult; cdecl; (** - * creates a new model slicestack by its id + * writes loop data to the layer. * - * @param[in] pModel - Model instance. - * @param[in] dZBottom - Bottom Z value of the slicestack - * @param[out] pSliceStackInstance - returns the new slicestack instance + * @param[in] pToolpathLayerData - ToolpathLayerData instance. + * @param[in] nProfileID - The toolpath profile to use + * @param[in] nPartID - The toolpath part to use + * @param[in] nPointDataCount - Number of elements in buffer + * @param[in] pPointDataBuffer - Position2D buffer of The point data * @return error code or 0 (success) *) - TLib3MFModel_AddSliceStackFunc = function(pModel: TLib3MFHandle; const dZBottom: Double; out pSliceStackInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerData_WriteLoopFunc = function(pToolpathLayerData: TLib3MFHandle; const nProfileID: Cardinal; const nPartID: Cardinal; const nPointDataCount: QWord; const pPointDataBuffer: PLib3MFPosition2D): TLib3MFResult; cdecl; (** - * adds a texture2d resource to the model. Its path is given by that of an existing attachment. + * writes polyline data to the layer. * - * @param[in] pModel - Model instance. - * @param[in] pTextureAttachment - attachment containing the image data. - * @param[out] pTexture2DInstance - returns the new texture instance. + * @param[in] pToolpathLayerData - ToolpathLayerData instance. + * @param[in] nProfileID - The toolpath profile to use + * @param[in] nPartID - The toolpath part to use + * @param[in] nPointDataCount - Number of elements in buffer + * @param[in] pPointDataBuffer - Position2D buffer of The point data * @return error code or 0 (success) *) - TLib3MFModel_AddTexture2DFromAttachmentFunc = function(pModel: TLib3MFHandle; const pTextureAttachment: TLib3MFHandle; out pTexture2DInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerData_WritePolylineFunc = function(pToolpathLayerData: TLib3MFHandle; const nProfileID: Cardinal; const nPartID: Cardinal; const nPointDataCount: QWord; const pPointDataBuffer: PLib3MFPosition2D): TLib3MFResult; cdecl; (** - * adds an empty BaseMaterialGroup resource to the model. + * Adds a custom data DOM tree to the layer. Layer MUST not be finished when changing the DOM tree. * - * @param[in] pModel - Model instance. - * @param[out] pBaseMaterialGroupInstance - returns the new base material instance. + * @param[in] pToolpathLayerData - ToolpathLayerData instance. + * @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. + * @param[in] pDataName - Root name of the data tree. MUST not be empty. MUST be a valid XML name string. + * @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) *) - TLib3MFModel_AddBaseMaterialGroupFunc = function(pModel: TLib3MFHandle; out pBaseMaterialGroupInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerData_AddCustomDataFunc = function(pToolpathLayerData: TLib3MFHandle; const pNameSpace: PAnsiChar; const pDataName: PAnsiChar; out pData: TLib3MFHandle): TLib3MFResult; cdecl; (** - * adds an empty ColorGroup resource to the model. + * finishes all writing of the layer and compresses toolpath data. * - * @param[in] pModel - Model instance. - * @param[out] pColorGroupInstance - returns the new ColorGroup instance. + * @param[in] pToolpathLayerData - ToolpathLayerData instance. * @return error code or 0 (success) *) - TLib3MFModel_AddColorGroupFunc = function(pModel: TLib3MFHandle; out pColorGroupInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpathLayerData_FinishFunc = function(pToolpathLayerData: TLib3MFHandle): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Function type definitions for Toolpath +**************************************************************************************************************************) + (** - * adds an empty Texture2DGroup resource to the model. + * Retrieves the unit factor * - * @param[in] pModel - Model instance. - * @param[in] pTexture2DInstance - The texture2D instance of the created Texture2DGroup. - * @param[out] pTexture2DGroupInstance - returns the new Texture2DGroup instance. + * @param[in] pToolpath - Toolpath instance. + * @param[out] pUnits - Returns the unit factor. * @return error code or 0 (success) *) - TLib3MFModel_AddTexture2DGroupFunc = function(pModel: TLib3MFHandle; const pTexture2DInstance: TLib3MFHandle; out pTexture2DGroupInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpath_GetUnitsFunc = function(pToolpath: TLib3MFHandle; out pUnits: Double): TLib3MFResult; cdecl; (** - * adds an empty CompositeMaterials resource to the model. + * Retrieves the count of layers * - * @param[in] pModel - Model instance. - * @param[in] pBaseMaterialGroupInstance - The BaseMaterialGroup instance of the created CompositeMaterials. - * @param[out] pCompositeMaterialsInstance - returns the new CompositeMaterials instance. + * @param[in] pToolpath - Toolpath instance. + * @param[out] pCount - Returns the layer count * @return error code or 0 (success) *) - TLib3MFModel_AddCompositeMaterialsFunc = function(pModel: TLib3MFHandle; const pBaseMaterialGroupInstance: TLib3MFHandle; out pCompositeMaterialsInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpath_GetLayerCountFunc = function(pToolpath: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; (** - * adds an empty MultiPropertyGroup resource to the model. + * Retrieves the count of profiles * - * @param[in] pModel - Model instance. - * @param[out] pMultiPropertyGroupInstance - returns the new MultiPropertyGroup instance. + * @param[in] pToolpath - Toolpath instance. + * @param[out] pCount - Returns the profile count * @return error code or 0 (success) *) - TLib3MFModel_AddMultiPropertyGroupFunc = function(pModel: TLib3MFHandle; out pMultiPropertyGroupInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpath_GetProfileCountFunc = function(pToolpath: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; (** - * adds a build item to the model. + * Adds a new toolpath layer * - * @param[in] pModel - Model instance. - * @param[in] pObject - Object instance. - * @param[in] pTransform - Transformation matrix. - * @param[out] pBuildItemInstance - returns the build item instance. + * @param[in] pToolpath - Toolpath instance. + * @param[in] nZMax - ZMax value + * @param[in] pPath - Package Path + * @param[in] pModelWriter - The model writer that writes out the 3MF. + * @param[out] pLayerData - Returns the layerdata object to write the layer content into. * @return error code or 0 (success) *) - TLib3MFModel_AddBuildItemFunc = function(pModel: TLib3MFHandle; const pObject: TLib3MFHandle; const pTransform: PLib3MFTransform; out pBuildItemInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpath_AddLayerFunc = function(pToolpath: TLib3MFHandle; const nZMax: Cardinal; const pPath: PAnsiChar; const pModelWriter: TLib3MFHandle; out pLayerData: TLib3MFHandle): TLib3MFResult; cdecl; (** - * removes a build item from the model + * Retrieves the Attachment of a layer * - * @param[in] pModel - Model instance. - * @param[in] pBuildItemInstance - Build item to remove. + * @param[in] pToolpath - Toolpath instance. + * @param[in] nIndex - Layer Index + * @param[out] pAttachment - Attachment * @return error code or 0 (success) *) - TLib3MFModel_RemoveBuildItemFunc = function(pModel: TLib3MFHandle; const pBuildItemInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpath_GetLayerAttachmentFunc = function(pToolpath: TLib3MFHandle; const nIndex: Cardinal; out pAttachment: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Returns the metadata of the model as MetaDataGroup + * Reads the toolpath of a layer. * - * @param[in] pModel - Model instance. - * @param[out] pTheMetaDataGroup - returns an Instance of the metadatagroup of the model + * @param[in] pToolpath - Toolpath instance. + * @param[in] nIndex - Layer Index + * @param[out] pToolpathReader - Toolpath Reader Instance * @return error code or 0 (success) *) - TLib3MFModel_GetMetaDataGroupFunc = function(pModel: TLib3MFHandle; out pTheMetaDataGroup: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpath_ReadLayerDataFunc = function(pToolpath: TLib3MFHandle; const nIndex: Cardinal; out pToolpathReader: TLib3MFHandle): TLib3MFResult; cdecl; (** - * adds an attachment stream to the model. The OPC part will be related to the model stream with a certain relationship type. + * Retrieves the Path of a layer * - * @param[in] pModel - Model instance. - * @param[in] pURI - Path of the attachment - * @param[in] pRelationShipType - Relationship type of the attachment - * @param[out] pAttachmentInstance - Instance of the attachment object + * @param[in] pToolpath - Toolpath instance. + * @param[in] nIndex - Layer Index + * @param[in] nPathBufferSize - size of the buffer (including trailing 0) + * @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pPathBuffer - buffer of Package Path, may be NULL * @return error code or 0 (success) *) - TLib3MFModel_AddAttachmentFunc = function(pModel: TLib3MFHandle; const pURI: PAnsiChar; const pRelationShipType: PAnsiChar; out pAttachmentInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpath_GetLayerPathFunc = function(pToolpath: TLib3MFHandle; const nIndex: Cardinal; const nPathBufferSize: Cardinal; out pPathNeededChars: Cardinal; pPathBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * Removes attachment from the model. + * Retrieves the ZMax of a layer * - * @param[in] pModel - Model instance. - * @param[in] pAttachmentInstance - Attachment instance to remove + * @param[in] pToolpath - Toolpath instance. + * @param[in] nIndex - Layer Index + * @param[out] pZMax - ZMax value * @return error code or 0 (success) *) - TLib3MFModel_RemoveAttachmentFunc = function(pModel: TLib3MFHandle; const pAttachmentInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpath_GetLayerZMaxFunc = function(pToolpath: TLib3MFHandle; const nIndex: Cardinal; out pZMax: Cardinal): TLib3MFResult; cdecl; (** - * retrieves an attachment stream object from the model.. + * Return the z value of a layer in units. * - * @param[in] pModel - Model instance. - * @param[in] nIndex - Index of the attachment stream - * @param[out] pAttachmentInstance - Instance of the attachment object + * @param[in] pToolpath - Toolpath instance. + * @param[in] nLayerIndex - Layer Index. + * @param[out] pZValue - Z Value in Units. * @return error code or 0 (success) *) - TLib3MFModel_GetAttachmentFunc = function(pModel: TLib3MFHandle; const nIndex: Cardinal; out pAttachmentInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpath_GetLayerZFunc = function(pToolpath: TLib3MFHandle; const nLayerIndex: Cardinal; out pZValue: Cardinal): TLib3MFResult; cdecl; (** - * retrieves an attachment stream object from the model. + * Adds a new profile to the toolpath. * - * @param[in] pModel - Model instance. - * @param[in] pURI - Path URI in the package - * @param[out] pAttachmentInstance - Instance of the attachment object + * @param[in] pToolpath - Toolpath instance. + * @param[in] pName - the name. + * @param[out] pProfile - Returns the profile. * @return error code or 0 (success) *) - TLib3MFModel_FindAttachmentFunc = function(pModel: TLib3MFHandle; const pURI: PAnsiChar; out pAttachmentInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpath_AddProfileFunc = function(pToolpath: TLib3MFHandle; const pName: PAnsiChar; out pProfile: TLib3MFHandle): TLib3MFResult; cdecl; (** - * retrieves the number of attachments of the model. + * Returns a profile of the toolpath. * - * @param[in] pModel - Model instance. - * @param[out] pAttachmentCount - Returns the number of attachments. + * @param[in] pToolpath - Toolpath instance. + * @param[in] nProfileIndex - Layer Index. + * @param[out] pProfile - Returns the profile. * @return error code or 0 (success) *) - TLib3MFModel_GetAttachmentCountFunc = function(pModel: TLib3MFHandle; out pAttachmentCount: Cardinal): TLib3MFResult; cdecl; + TLib3MFToolpath_GetProfileFunc = function(pToolpath: TLib3MFHandle; const nProfileIndex: Cardinal; out pProfile: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Retrieve whether the OPC package contains a package thumbnail. + * Returns a profile of the toolpath by UUID. * - * @param[in] pModel - Model instance. - * @param[out] pHasThumbnail - returns whether the OPC package contains a package thumbnail + * @param[in] pToolpath - Toolpath instance. + * @param[in] pProfileUUID - UUID string. + * @param[out] pProfile - Returns the profile. * @return error code or 0 (success) *) - TLib3MFModel_HasPackageThumbnailAttachmentFunc = function(pModel: TLib3MFHandle; out pHasThumbnail: Byte): TLib3MFResult; cdecl; + TLib3MFToolpath_GetProfileUUIDFunc = function(pToolpath: TLib3MFHandle; const pProfileUUID: PAnsiChar; out pProfile: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Create a new or the existing package thumbnail for the OPC package. + * Retrieves the count of custom data elements. * - * @param[in] pModel - Model instance. - * @param[out] pAttachment - Instance of a new or the existing thumbnailattachment object. + * @param[in] pToolpath - Toolpath instance. + * @param[out] pCount - Count * @return error code or 0 (success) *) - TLib3MFModel_CreatePackageThumbnailAttachmentFunc = function(pModel: TLib3MFHandle; out pAttachment: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpath_GetCustomDataCountFunc = function(pToolpath: TLib3MFHandle; out pCount: Cardinal): TLib3MFResult; cdecl; (** - * Get the attachment to the OPC package containing the package thumbnail. + * Retrieves the custom data. * - * @param[in] pModel - Model instance. - * @param[out] pAttachment - Instance of the thumbnailattachment object or NULL. + * @param[in] pToolpath - Toolpath instance. + * @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count + * @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) *) - TLib3MFModel_GetPackageThumbnailAttachmentFunc = function(pModel: TLib3MFHandle; out pAttachment: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpath_GetCustomDataFunc = function(pToolpath: TLib3MFHandle; const nIndex: Cardinal; out pData: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Remove the attachment to the OPC package containing the package thumbnail. + * Retrieves the node name of the custom data. * - * @param[in] pModel - Model instance. + * @param[in] pToolpath - Toolpath instance. + * @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count + * @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) + * @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pNameSpaceBuffer - buffer of Namespace of the custom data tree., may be NULL + * @param[in] nDataNameBufferSize - size of the buffer (including trailing 0) + * @param[out] pDataNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pDataNameBuffer - buffer of Root name of the data tree., may be NULL * @return error code or 0 (success) *) - TLib3MFModel_RemovePackageThumbnailAttachmentFunc = function(pModel: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpath_GetCustomDataNameFunc = function(pToolpath: TLib3MFHandle; const nIndex: Cardinal; const nNameSpaceBufferSize: Cardinal; out pNameSpaceNeededChars: Cardinal; pNameSpaceBuffer: PAnsiChar; const nDataNameBufferSize: Cardinal; out pDataNameNeededChars: Cardinal; pDataNameBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * Adds a new Content Type to the model. + * Retrieves if custom data with a specific namespace and name combination exists. * - * @param[in] pModel - Model instance. - * @param[in] pExtension - File Extension - * @param[in] pContentType - Content Type Identifier + * @param[in] pToolpath - Toolpath instance. + * @param[in] pNameSpace - Namespace of the custom data tree. + * @param[in] pDataName - Root name of the data tree. + * @param[out] pCustomDataExists - Returns true if DOM Tree Exists. * @return error code or 0 (success) *) - TLib3MFModel_AddCustomContentTypeFunc = function(pModel: TLib3MFHandle; const pExtension: PAnsiChar; const pContentType: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFToolpath_HasUniqueCustomDataFunc = function(pToolpath: TLib3MFHandle; const pNameSpace: PAnsiChar; const pDataName: PAnsiChar; out pCustomDataExists: Byte): TLib3MFResult; cdecl; (** - * Removes a custom Content Type from the model (UTF8 version). + * Retrieves the custom data with a specific namespace and name combination. Fails if combination is not unique. * - * @param[in] pModel - Model instance. - * @param[in] pExtension - File Extension + * @param[in] pToolpath - Toolpath instance. + * @param[in] pNameSpace - Namespace of the custom data tree. + * @param[in] pDataName - Root name of the data tree. + * @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) *) - TLib3MFModel_RemoveCustomContentTypeFunc = function(pModel: TLib3MFHandle; const pExtension: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFToolpath_FindUniqueCustomDataFunc = function(pToolpath: TLib3MFHandle; const pNameSpace: PAnsiChar; const pDataName: PAnsiChar; out pData: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Sets the random number generator callback for use in the library + * Adds a custom data DOM tree to the toolpath. * - * @param[in] pModel - Model instance. - * @param[in] pTheCallback - The callback used to generate random numbers - * @param[in] pUserData - Userdata to be passed to the callback function + * @param[in] pToolpath - Toolpath instance. + * @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. + * @param[in] pDataName - Root name of the data tree. MUST not be empty. MUST be a valid XML name string. + * @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) *) - TLib3MFModel_SetRandomNumberCallbackFunc = function(pModel: TLib3MFHandle; const pTheCallback: PLib3MF_RandomNumberCallback; const pUserData: Pointer): TLib3MFResult; cdecl; + TLib3MFToolpath_AddCustomDataFunc = function(pToolpath: TLib3MFHandle; const pNameSpace: PAnsiChar; const pDataName: PAnsiChar; out pData: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Gets the keystore associated with this model + * Deletes all custom data. * - * @param[in] pModel - Model instance. - * @param[out] pKeyStore - The package keystore + * @param[in] pToolpath - Toolpath instance. + * @param[out] pNumberOfDeletedItems - Returns number of deleted items. * @return error code or 0 (success) *) - TLib3MFModel_GetKeyStoreFunc = function(pModel: TLib3MFHandle; out pKeyStore: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFToolpath_ClearCustomDataFunc = function(pToolpath: TLib3MFHandle; out pNumberOfDeletedItems: Cardinal): TLib3MFResult; cdecl; -(************************************************************************************************************************* - Global function definitions -**************************************************************************************************************************) - (** - * retrieves the binary version of this library. + * Deletes a custom data instance from the list. * - * @param[out] pMajor - returns the major version of this library - * @param[out] pMinor - returns the minor version of this library - * @param[out] pMicro - returns the micro version of this library + * @param[in] pToolpath - Toolpath instance. + * @param[in] pData - DOM Tree of the data. + * @param[out] pSuccess - Returns if deletion was successful. * @return error code or 0 (success) *) - TLib3MFGetLibraryVersionFunc = function(out pMajor: Cardinal; out pMinor: Cardinal; out pMicro: Cardinal): TLib3MFResult; cdecl; + TLib3MFToolpath_DeleteCustomDataFunc = function(pToolpath: TLib3MFHandle; const pData: TLib3MFHandle; out pSuccess: Byte): TLib3MFResult; cdecl; (** - * retrieves prerelease information of this library. + * Registers an Integer Attribute that each segment holds. * - * @param[out] pHasPrereleaseInfo - Does the library provide prerelease version? - * @param[in] nPrereleaseInfoBufferSize - size of the buffer (including trailing 0) - * @param[out] pPrereleaseInfoNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pPrereleaseInfoBuffer - buffer of retrieves prerelease information of this library., may be NULL + * @param[in] pToolpath - Toolpath instance. + * @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. + * @param[in] pAttributeName - Attribute name. MUST not be empty. * @return error code or 0 (success) *) - TLib3MFGetPrereleaseInformationFunc = function(out pHasPrereleaseInfo: Byte; const nPrereleaseInfoBufferSize: Cardinal; out pPrereleaseInfoNeededChars: Cardinal; pPrereleaseInfoBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFToolpath_RegisterCustomIntegerAttributeFunc = function(pToolpath: TLib3MFHandle; const pNameSpace: PAnsiChar; const pAttributeName: PAnsiChar): TLib3MFResult; cdecl; (** - * retrieves build information of this library. + * Registers a Double Attribute that each segment holds. Registering only applies to reader or writer objects created after the call. * - * @param[out] pHasBuildInfo - Does the library provide build version? - * @param[in] nBuildInformationBufferSize - size of the buffer (including trailing 0) - * @param[out] pBuildInformationNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pBuildInformationBuffer - buffer of retrieves build information of this library., may be NULL + * @param[in] pToolpath - Toolpath instance. + * @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. + * @param[in] pAttributeName - Attribute name. MUST not be empty. * @return error code or 0 (success) *) - TLib3MFGetBuildInformationFunc = function(out pHasBuildInfo: Byte; const nBuildInformationBufferSize: Cardinal; out pBuildInformationNeededChars: Cardinal; pBuildInformationBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFToolpath_RegisterCustomDoubleAttributeFunc = function(pToolpath: TLib3MFHandle; const pNameSpace: PAnsiChar; const pAttributeName: PAnsiChar): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Function type definitions for ToolpathIterator +**************************************************************************************************************************) + (** - * retrieves whether a specification is supported, and if so, which version. + * Returns the Toolpath the iterator points at. * - * @param[in] pSpecificationURL - URL of extension to check - * @param[out] pIsSupported - returns whether this specification is supported - * @param[out] pMajor - returns the major version of the extension (if IsSupported) - * @param[out] pMinor - returns the minor version of the extension (if IsSupported) - * @param[out] pMicro - returns the micro version of the extension (if IsSupported) + * @param[in] pToolpathIterator - ToolpathIterator instance. + * @param[out] pResource - returns the Toolpath instance. * @return error code or 0 (success) *) - TLib3MFGetSpecificationVersionFunc = function(const pSpecificationURL: PAnsiChar; out pIsSupported: Byte; out pMajor: Cardinal; out pMinor: Cardinal; out pMicro: Cardinal): TLib3MFResult; cdecl; + TLib3MFToolpathIterator_GetCurrentToolpathFunc = function(pToolpathIterator: TLib3MFHandle; out pResource: TLib3MFHandle): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Function type definitions for SliceStack +**************************************************************************************************************************) + (** - * creates an empty model instance. + * Get the lower Z-Coordinate of the slice stack. * - * @param[out] pModel - returns an empty model instance + * @param[in] pSliceStack - SliceStack instance. + * @param[out] pZBottom - the lower Z-Coordinate the slice stack * @return error code or 0 (success) *) - TLib3MFCreateModelFunc = function(out pModel: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFSliceStack_GetBottomZFunc = function(pSliceStack: TLib3MFHandle; out pZBottom: Double): TLib3MFResult; cdecl; (** - * releases shared ownership of an object instance + * Returns the number of slices * - * @param[in] pInstance - the object instance to release + * @param[in] pSliceStack - SliceStack instance. + * @param[out] pCount - the number of slices * @return error code or 0 (success) *) - TLib3MFReleaseFunc = function(const pInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFSliceStack_GetSliceCountFunc = function(pSliceStack: TLib3MFHandle; out pCount: QWord): TLib3MFResult; cdecl; (** - * acquires shared ownership of an object instance + * Query a slice from the slice stack * - * @param[in] pInstance - the object instance to acquire + * @param[in] pSliceStack - SliceStack instance. + * @param[in] nSliceIndex - the index of the slice + * @param[out] pTheSlice - the Slice instance * @return error code or 0 (success) *) - TLib3MFAcquireFunc = function(const pInstance: TLib3MFHandle): TLib3MFResult; cdecl; + TLib3MFSliceStack_GetSliceFunc = function(pSliceStack: TLib3MFHandle; const nSliceIndex: QWord; out pTheSlice: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Sets the journal file path + * Returns the number of slices * - * @param[in] pJournalPath - File name of the journal file + * @param[in] pSliceStack - SliceStack instance. + * @param[in] dZTop - upper Z coordinate of the slice + * @param[out] pTheSlice - a new Slice instance * @return error code or 0 (success) *) - TLib3MFSetJournalFunc = function(const pJournalPath: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFSliceStack_AddSliceFunc = function(pSliceStack: TLib3MFHandle; const dZTop: Double; out pTheSlice: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Retrieves the last error string of an instance + * Returns the number of slice refs * - * @param[in] pInstance - Object where the error occured. - * @param[in] nLastErrorStringBufferSize - size of the buffer (including trailing 0) - * @param[out] pLastErrorStringNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pLastErrorStringBuffer - buffer of Last Error String, may be NULL - * @param[out] pHasLastError - Returns if the instance has a last error. + * @param[in] pSliceStack - SliceStack instance. + * @param[out] pCount - the number of slicereferences * @return error code or 0 (success) *) - TLib3MFGetLastErrorFunc = function(const pInstance: TLib3MFHandle; const nLastErrorStringBufferSize: Cardinal; out pLastErrorStringNeededChars: Cardinal; pLastErrorStringBuffer: PAnsiChar; out pHasLastError: Byte): TLib3MFResult; cdecl; + TLib3MFSliceStack_GetSliceRefCountFunc = function(pSliceStack: TLib3MFHandle; out pCount: QWord): TLib3MFResult; cdecl; (** - * Returns the address of the SymbolLookupMethod + * Adds another existing slicestack as sliceref in this slicestack * - * @param[out] pSymbolLookupMethod - Address of the SymbolAddressMethod + * @param[in] pSliceStack - SliceStack instance. + * @param[in] pTheSliceStack - the slicestack to use as sliceref * @return error code or 0 (success) *) - TLib3MFGetSymbolLookupMethodFunc = function(out pSymbolLookupMethod: Pointer): TLib3MFResult; cdecl; + TLib3MFSliceStack_AddSliceStackReferenceFunc = function(pSliceStack: TLib3MFHandle; const pTheSliceStack: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Return an English text for a progress identifier.|Note: this is the only function you can call from your callback function. + * Adds another existing slicestack as sliceref in this slicestack * - * @param[in] eTheProgressIdentifier - the progress identifier that is passed to the callback function - * @param[in] nProgressMessageBufferSize - size of the buffer (including trailing 0) - * @param[out] pProgressMessageNeededChars - will be filled with the count of the written bytes, or needed buffer size. - * @param[out] pProgressMessageBuffer - buffer of English text for the progress identifier, may be NULL + * @param[in] pSliceStack - SliceStack instance. + * @param[in] nSliceRefIndex - the index of the slice ref + * @param[out] pTheSliceStack - the slicestack that is used as sliceref * @return error code or 0 (success) *) - TLib3MFRetrieveProgressMessageFunc = function(const eTheProgressIdentifier: Integer; const nProgressMessageBufferSize: Cardinal; out pProgressMessageNeededChars: Cardinal; pProgressMessageBuffer: PAnsiChar): TLib3MFResult; cdecl; + TLib3MFSliceStack_GetSliceStackReferenceFunc = function(pSliceStack: TLib3MFHandle; const nSliceRefIndex: QWord; out pTheSliceStack: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Creates a Color from uint8 RGBA values + * Removes the indirection of slices via slice-refs, i.e. creates the slices of all slice refs of this SliceStack as actual slices of this SliceStack. All previously existing slices or slicerefs will be removed. * - * @param[in] nRed - Red value of color (0-255) - * @param[in] nGreen - Green value of color (0-255) - * @param[in] nBlue - Blue value of color (0-255) - * @param[in] nAlpha - Alpha value of color (0-255) - * @param[out] pTheColor - Assembled color + * @param[in] pSliceStack - SliceStack instance. * @return error code or 0 (success) *) - TLib3MFRGBAToColorFunc = function(const nRed: Byte; const nGreen: Byte; const nBlue: Byte; const nAlpha: Byte; pTheColor: PLib3MFColor): TLib3MFResult; cdecl; + TLib3MFSliceStack_CollapseSliceReferencesFunc = function(pSliceStack: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Creates a Color from uint8 RGBA values + * Sets the package path where this Slice should be stored. Input an empty string to reset the path * - * @param[in] fRed - Red value of color (0-1) - * @param[in] fGreen - Green value of color (0-1) - * @param[in] fBlue - Blue value of color (0-1) - * @param[in] fAlpha - Alpha value of color (0-1) - * @param[out] pTheColor - Assembled color + * @param[in] pSliceStack - SliceStack instance. + * @param[in] pPath - the package path where this Slice should be stored * @return error code or 0 (success) *) - TLib3MFFloatRGBAToColorFunc = function(const fRed: Single; const fGreen: Single; const fBlue: Single; const fAlpha: Single; pTheColor: PLib3MFColor): TLib3MFResult; cdecl; + TLib3MFSliceStack_SetOwnPathFunc = function(pSliceStack: TLib3MFHandle; const pPath: PAnsiChar): TLib3MFResult; cdecl; (** - * Calculates uint8-RGBA-values from a Color + * Obtains the package path where this Slice should be stored. Returns an empty string if the slicestack is stored within the root model. * - * @param[in] pTheColor - Color to handle - * @param[out] pRed - Red value of color (0-255) - * @param[out] pGreen - Green value of color (0-255) - * @param[out] pBlue - Blue value of color (0-255) - * @param[out] pAlpha - Alpha value of color (0-255) + * @param[in] pSliceStack - SliceStack instance. + * @param[in] nPathBufferSize - size of the buffer (including trailing 0) + * @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pPathBuffer - buffer of the package path where this Slice will be stored, may be NULL * @return error code or 0 (success) *) - TLib3MFColorToRGBAFunc = function(const pTheColor: PLib3MFColor; out pRed: Byte; out pGreen: Byte; out pBlue: Byte; out pAlpha: Byte): TLib3MFResult; cdecl; + TLib3MFSliceStack_GetOwnPathFunc = function(pSliceStack: TLib3MFHandle; const nPathBufferSize: Cardinal; out pPathNeededChars: Cardinal; pPathBuffer: PAnsiChar): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Function type definitions for Consumer +**************************************************************************************************************************) + (** - * Calculates float-RGBA-values from a Color + * Gets the consumerid * - * @param[in] pTheColor - Color to handle - * @param[out] pRed - Red value of color (0-1) - * @param[out] pGreen - Green value of color (0-1) - * @param[out] pBlue - Blue value of color (0-1) - * @param[out] pAlpha - Alpha value of color (0-1) + * @param[in] pConsumer - Consumer instance. + * @param[in] nConsumerIDBufferSize - size of the buffer (including trailing 0) + * @param[out] pConsumerIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pConsumerIDBuffer - buffer of A unique identifier for the consumers, may be NULL * @return error code or 0 (success) *) - TLib3MFColorToFloatRGBAFunc = function(const pTheColor: PLib3MFColor; out pRed: Single; out pGreen: Single; out pBlue: Single; out pAlpha: Single): TLib3MFResult; cdecl; + TLib3MFConsumer_GetConsumerIDFunc = function(pConsumer: TLib3MFHandle; const nConsumerIDBufferSize: Cardinal; out pConsumerIDNeededChars: Cardinal; pConsumerIDBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * Creates an identity transform + * Getts the keyid * - * @param[out] pTransform - Transformation matrix. + * @param[in] pConsumer - Consumer instance. + * @param[in] nKeyIDBufferSize - size of the buffer (including trailing 0) + * @param[out] pKeyIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pKeyIDBuffer - buffer of The identifier for the key of this consumer, may be NULL * @return error code or 0 (success) *) - TLib3MFGetIdentityTransformFunc = function(pTransform: PLib3MFTransform): TLib3MFResult; cdecl; + TLib3MFConsumer_GetKeyIDFunc = function(pConsumer: TLib3MFHandle; const nKeyIDBufferSize: Cardinal; out pKeyIDNeededChars: Cardinal; pKeyIDBuffer: PAnsiChar): TLib3MFResult; cdecl; (** - * Creates a uniform scale transform + * Gets the keyvalue associated with this consumer * - * @param[in] fFactor - Factor in X, Y and Z - * @param[out] pTransform - Transformation matrix. + * @param[in] pConsumer - Consumer instance. + * @param[in] nKeyValueBufferSize - size of the buffer (including trailing 0) + * @param[out] pKeyValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pKeyValueBuffer - buffer of The public key, when available, of this consumer, may be NULL * @return error code or 0 (success) *) - TLib3MFGetUniformScaleTransformFunc = function(const fFactor: Single; pTransform: PLib3MFTransform): TLib3MFResult; cdecl; + TLib3MFConsumer_GetKeyValueFunc = function(pConsumer: TLib3MFHandle; const nKeyValueBufferSize: Cardinal; out pKeyValueNeededChars: Cardinal; pKeyValueBuffer: PAnsiChar): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Function type definitions for AccessRight +**************************************************************************************************************************) + (** - * Creates a scale transform + * Gets the consumer associated with this access right * - * @param[in] fFactorX - Factor in X - * @param[in] fFactorY - Factor in Y - * @param[in] fFactorZ - Factor in Z - * @param[out] pTransform - Transformation matrix. + * @param[in] pAccessRight - AccessRight instance. + * @param[out] pConsumer - The consumer instance * @return error code or 0 (success) *) - TLib3MFGetScaleTransformFunc = function(const fFactorX: Single; const fFactorY: Single; const fFactorZ: Single; pTransform: PLib3MFTransform): TLib3MFResult; cdecl; + TLib3MFAccessRight_GetConsumerFunc = function(pAccessRight: TLib3MFHandle; out pConsumer: TLib3MFHandle): TLib3MFResult; cdecl; (** - * Creates an translation transform + * Gets the associated encryption algorithm * - * @param[in] fVectorX - Translation in X - * @param[in] fVectorY - Translation in Y - * @param[in] fVectorZ - Translation in Z - * @param[out] pTransform - Transformation matrix. + * @param[in] pAccessRight - AccessRight instance. + * @param[out] pAlgorithm - The algorithm used for the key in this accessright * @return error code or 0 (success) *) - TLib3MFGetTranslationTransformFunc = function(const fVectorX: Single; const fVectorY: Single; const fVectorZ: Single; pTransform: PLib3MFTransform): TLib3MFResult; cdecl; + TLib3MFAccessRight_GetWrappingAlgorithmFunc = function(pAccessRight: TLib3MFHandle; out pAlgorithm: Integer): TLib3MFResult; cdecl; + + (** + * Gets the associated mask generation function algorithm + * + * @param[in] pAccessRight - AccessRight instance. + * @param[out] pAlgorithm - The MFG1 algorithm + * @return error code or 0 (success) + *) + TLib3MFAccessRight_GetMgfAlgorithmFunc = function(pAccessRight: TLib3MFHandle; out pAlgorithm: Integer): TLib3MFResult; cdecl; + + (** + * Gets the digest method assoicated + * + * @param[in] pAccessRight - AccessRight instance. + * @param[out] pAlgorithm - The digest method for this accessright + * @return error code or 0 (success) + *) + TLib3MFAccessRight_GetDigestMethodFunc = function(pAccessRight: TLib3MFHandle; out pAlgorithm: Integer): TLib3MFResult; cdecl; (************************************************************************************************************************* - Helper function pointer definitions + Function type definitions for ContentEncryptionParams **************************************************************************************************************************) -TLib3MFSymbolLookupMethod = function(const pSymbolName: PAnsiChar; out pValue: Pointer): TLib3MFResult; cdecl; + + (** + * Returns the encryption method to be used in this encryption process + * + * @param[in] pContentEncryptionParams - ContentEncryptionParams instance. + * @param[out] pAlgorithm - + * @return error code or 0 (success) + *) + TLib3MFContentEncryptionParams_GetEncryptionAlgorithmFunc = function(pContentEncryptionParams: TLib3MFHandle; out pAlgorithm: Integer): TLib3MFResult; cdecl; + + (** + * Gets the key for the resource associated + * + * @param[in] pContentEncryptionParams - ContentEncryptionParams instance. + * @param[in] nByteDataCount - Number of elements in buffer + * @param[out] pByteDataNeededCount - will be filled with the count of the written elements, or needed buffer size. + * @param[out] pByteDataBuffer - uint8 buffer of Pointer to a buffer where to place the key. + * @return error code or 0 (success) + *) + TLib3MFContentEncryptionParams_GetKeyFunc = function(pContentEncryptionParams: TLib3MFHandle; const nByteDataCount: QWord; out pByteDataNeededCount: QWord; pByteDataBuffer: PByte): TLib3MFResult; cdecl; + + (** + * Gets the IV data + * + * @param[in] pContentEncryptionParams - ContentEncryptionParams instance. + * @param[in] nByteDataCount - Number of elements in buffer + * @param[out] pByteDataNeededCount - will be filled with the count of the written elements, or needed buffer size. + * @param[out] pByteDataBuffer - uint8 buffer of Pointer to a buffer where to place the data. + * @return error code or 0 (success) + *) + TLib3MFContentEncryptionParams_GetInitializationVectorFunc = function(pContentEncryptionParams: TLib3MFHandle; const nByteDataCount: QWord; out pByteDataNeededCount: QWord; pByteDataBuffer: PByte): TLib3MFResult; cdecl; + + (** + * A handler descriptor that uniquely identifies the context of the resource. Each resource will be assigned a different value + * + * @param[in] pContentEncryptionParams - ContentEncryptionParams instance. + * @param[in] nByteDataCount - Number of elements in buffer + * @param[out] pByteDataNeededCount - will be filled with the count of the written elements, or needed buffer size. + * @param[out] pByteDataBuffer - uint8 buffer of Pointer to a buffer where to place the data. + * @return error code or 0 (success) + *) + TLib3MFContentEncryptionParams_GetAuthenticationTagFunc = function(pContentEncryptionParams: TLib3MFHandle; const nByteDataCount: QWord; out pByteDataNeededCount: QWord; pByteDataBuffer: PByte): TLib3MFResult; cdecl; + + (** + * Sets the authentication tag + * + * @param[in] pContentEncryptionParams - ContentEncryptionParams instance. + * @param[in] nByteDataCount - Number of elements in buffer + * @param[in] pByteDataBuffer - uint8 buffer of The authentication tag size + * @return error code or 0 (success) + *) + TLib3MFContentEncryptionParams_SetAuthenticationTagFunc = function(pContentEncryptionParams: TLib3MFHandle; const nByteDataCount: QWord; const pByteDataBuffer: PByte): TLib3MFResult; cdecl; + + (** + * A handler descriptor that uniquely identifies the context of the resource. Each resource will be assigned a different value + * + * @param[in] pContentEncryptionParams - ContentEncryptionParams instance. + * @param[in] nByteDataCount - Number of elements in buffer + * @param[out] pByteDataNeededCount - will be filled with the count of the written elements, or needed buffer size. + * @param[out] pByteDataBuffer - uint8 buffer of Buffer where the data will be placed + * @return error code or 0 (success) + *) + TLib3MFContentEncryptionParams_GetAdditionalAuthenticationDataFunc = function(pContentEncryptionParams: TLib3MFHandle; const nByteDataCount: QWord; out pByteDataNeededCount: QWord; pByteDataBuffer: PByte): TLib3MFResult; cdecl; + + (** + * A handler descriptor that uniquely identifies the context of the resource. Each resource will be assigned a different value + * + * @param[in] pContentEncryptionParams - ContentEncryptionParams instance. + * @param[out] pDescriptor - + * @return error code or 0 (success) + *) + TLib3MFContentEncryptionParams_GetDescriptorFunc = function(pContentEncryptionParams: TLib3MFHandle; out pDescriptor: QWord): TLib3MFResult; cdecl; + + (** + * Gets the resourcedatagroup keyuuid + * + * @param[in] pContentEncryptionParams - ContentEncryptionParams instance. + * @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) + * @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pUUIDBuffer - buffer of The resourcedatagroup keyuuid that may be use to reference an external key, may be NULL + * @return error code or 0 (success) + *) + TLib3MFContentEncryptionParams_GetKeyUUIDFunc = function(pContentEncryptionParams: TLib3MFHandle; const nUUIDBufferSize: Cardinal; out pUUIDNeededChars: Cardinal; pUUIDBuffer: PAnsiChar): TLib3MFResult; cdecl; + (************************************************************************************************************************* - Exception definition + Function type definitions for ResourceData **************************************************************************************************************************) - ELib3MFException = class(Exception) - private - FErrorCode: TLib3MFResult; - FCustomMessage: String; - public - property ErrorCode: TLib3MFResult read FErrorCode; - property CustomMessage: String read FCustomMessage; - constructor Create(AErrorCode: TLib3MFResult; AMessage: String); - constructor CreateCustomMessage(AErrorCode: TLib3MFResult; AMessage: String); - end; - - -(************************************************************************************************************************* - Class definition for Base -**************************************************************************************************************************) - - TLib3MFBase = class(TObject) - private - FWrapper: TLib3MFWrapper; - FHandle: TLib3MFHandle; - public - constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); - destructor Destroy; override; - property TheHandle: TLib3MFHandle read FHandle; - function ClassTypeId(): QWord; - end; - - -(************************************************************************************************************************* - Class definition for Writer -**************************************************************************************************************************) - - TLib3MFWriter = class(TLib3MFBase) - public - constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); - destructor Destroy; override; - procedure WriteToFile(const AFilename: String); - function GetStreamSize(): QWord; - procedure WriteToBuffer(out ABuffer: TByteDynArray); - procedure WriteToCallback(const ATheWriteCallback: PLib3MF_WriteCallback; const ATheSeekCallback: PLib3MF_SeekCallback; const AUserData: Pointer); - procedure SetProgressCallback(const AProgressCallback: PLib3MF_ProgressCallback; const AUserData: Pointer); - function GetDecimalPrecision(): Cardinal; - procedure SetDecimalPrecision(const ADecimalPrecision: Cardinal); - procedure SetStrictModeActive(const AStrictModeActive: Boolean); - function GetStrictModeActive(): Boolean; - function GetWarning(const AIndex: Cardinal; out AErrorCode: Cardinal): String; - function GetWarningCount(): Cardinal; - procedure AddKeyWrappingCallback(const AConsumerID: String; const ATheCallback: PLib3MF_KeyWrappingCallback; const AUserData: Pointer); - procedure SetContentEncryptionCallback(const ATheCallback: PLib3MF_ContentEncryptionCallback; const AUserData: Pointer); - end; - - -(************************************************************************************************************************* - Class definition for Reader -**************************************************************************************************************************) - - TLib3MFReader = class(TLib3MFBase) - public - constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); - destructor Destroy; override; - procedure ReadFromFile(const AFilename: String); - procedure ReadFromBuffer(const ABuffer: TByteDynArray); - procedure ReadFromCallback(const ATheReadCallback: PLib3MF_ReadCallback; const AStreamSize: QWord; const ATheSeekCallback: PLib3MF_SeekCallback; const AUserData: Pointer); - procedure SetProgressCallback(const AProgressCallback: PLib3MF_ProgressCallback; const AUserData: Pointer); - procedure AddRelationToRead(const ARelationShipType: String); - procedure RemoveRelationToRead(const ARelationShipType: String); - procedure SetStrictModeActive(const AStrictModeActive: Boolean); - function GetStrictModeActive(): Boolean; - function GetWarning(const AIndex: Cardinal; out AErrorCode: Cardinal): String; - function GetWarningCount(): Cardinal; - procedure AddKeyWrappingCallback(const AConsumerID: String; const ATheCallback: PLib3MF_KeyWrappingCallback; const AUserData: Pointer); - procedure SetContentEncryptionCallback(const ATheCallback: PLib3MF_ContentEncryptionCallback; const AUserData: Pointer); - end; - - -(************************************************************************************************************************* - Class definition for PackagePart -**************************************************************************************************************************) - - TLib3MFPackagePart = class(TLib3MFBase) - public - constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); - destructor Destroy; override; - function GetPath(): String; - procedure SetPath(const APath: String); - end; - - -(************************************************************************************************************************* - Class definition for Resource -**************************************************************************************************************************) - - TLib3MFResource = class(TLib3MFBase) - public - constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); - destructor Destroy; override; - function GetResourceID(): Cardinal; - function GetUniqueResourceID(): Cardinal; - function PackagePart(): TLib3MFPackagePart; - procedure SetPackagePart(const APackagePart: TLib3MFPackagePart); - function GetModelResourceID(): Cardinal; - end; - - -(************************************************************************************************************************* - Class definition for ResourceIterator -**************************************************************************************************************************) - - TLib3MFResourceIterator = class(TLib3MFBase) - public - constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); - destructor Destroy; override; - function MoveNext(): Boolean; - function MovePrevious(): Boolean; - function GetCurrent(): TLib3MFResource; - function Clone(): TLib3MFResourceIterator; - function Count(): QWord; - end; - - -(************************************************************************************************************************* - Class definition for SliceStackIterator -**************************************************************************************************************************) - - TLib3MFSliceStackIterator = class(TLib3MFResourceIterator) - public - constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); - destructor Destroy; override; - function GetCurrentSliceStack(): TLib3MFSliceStack; - end; - - -(************************************************************************************************************************* - Class definition for ObjectIterator -**************************************************************************************************************************) - - TLib3MFObjectIterator = class(TLib3MFResourceIterator) - public - constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); - destructor Destroy; override; - function GetCurrentObject(): TLib3MFObject; - end; - - -(************************************************************************************************************************* - Class definition for MeshObjectIterator -**************************************************************************************************************************) - - TLib3MFMeshObjectIterator = class(TLib3MFResourceIterator) - public - constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); - destructor Destroy; override; - function GetCurrentMeshObject(): TLib3MFMeshObject; - end; - - -(************************************************************************************************************************* - Class definition for ComponentsObjectIterator -**************************************************************************************************************************) - - TLib3MFComponentsObjectIterator = class(TLib3MFResourceIterator) - public - constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); - destructor Destroy; override; - function GetCurrentComponentsObject(): TLib3MFComponentsObject; - end; - + (** + * Gets the encrypted part path + * + * @param[in] pResourceData - ResourceData instance. + * @param[out] pPath - The part path + * @return error code or 0 (success) + *) + TLib3MFResourceData_GetPathFunc = function(pResourceData: TLib3MFHandle; out pPath: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Gets the encryption algorithm used to encrypt this ResourceData + * + * @param[in] pResourceData - ResourceData instance. + * @param[out] pEncryptionAlgorithm - The encryption algorithm + * @return error code or 0 (success) + *) + TLib3MFResourceData_GetEncryptionAlgorithmFunc = function(pResourceData: TLib3MFHandle; out pEncryptionAlgorithm: Integer): TLib3MFResult; cdecl; + + (** + * Tells whether this ResourceData is compressed or not + * + * @param[in] pResourceData - ResourceData instance. + * @param[out] pCompression - The compression method + * @return error code or 0 (success) + *) + TLib3MFResourceData_GetCompressionFunc = function(pResourceData: TLib3MFHandle; out pCompression: Integer): TLib3MFResult; cdecl; + + (** + * Tells whether this ResourceData is compressed or not + * + * @param[in] pResourceData - ResourceData instance. + * @param[in] nByteDataCount - Number of elements in buffer + * @param[out] pByteDataNeededCount - will be filled with the count of the written elements, or needed buffer size. + * @param[out] pByteDataBuffer - uint8 buffer of The compression method + * @return error code or 0 (success) + *) + TLib3MFResourceData_GetAdditionalAuthenticationDataFunc = function(pResourceData: TLib3MFHandle; const nByteDataCount: QWord; out pByteDataNeededCount: QWord; pByteDataBuffer: PByte): TLib3MFResult; cdecl; + (************************************************************************************************************************* - Class definition for Texture2DIterator + Function type definitions for ResourceDataGroup **************************************************************************************************************************) - TLib3MFTexture2DIterator = class(TLib3MFResourceIterator) - public - constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); - destructor Destroy; override; - function GetCurrentTexture2D(): TLib3MFTexture2D; - end; - + (** + * Sets the resourcedatagroup keyuuid + * + * @param[in] pResourceDataGroup - ResourceDataGroup instance. + * @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) + * @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pUUIDBuffer - buffer of The new resourcedatagroup keyuuid., may be NULL + * @return error code or 0 (success) + *) + TLib3MFResourceDataGroup_GetKeyUUIDFunc = function(pResourceDataGroup: TLib3MFHandle; const nUUIDBufferSize: Cardinal; out pUUIDNeededChars: Cardinal; pUUIDBuffer: PAnsiChar): TLib3MFResult; cdecl; + + (** + * Add accessright to resourcedatagroup element + * + * @param[in] pResourceDataGroup - ResourceDataGroup instance. + * @param[in] pConsumer - The Consumer reference + * @param[in] eWrappingAlgorithm - The key wrapping algorithm to be used + * @param[in] eMgfAlgorithm - The mask generation function to be used + * @param[in] eDigestMethod - The digest mechanism to be used + * @param[out] pTheAccessRight - The acess right instance + * @return error code or 0 (success) + *) + TLib3MFResourceDataGroup_AddAccessRightFunc = function(pResourceDataGroup: TLib3MFHandle; const pConsumer: TLib3MFHandle; const eWrappingAlgorithm: Integer; const eMgfAlgorithm: Integer; const eDigestMethod: Integer; out pTheAccessRight: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Finds the AccessRight associated with a Consumer + * + * @param[in] pResourceDataGroup - ResourceDataGroup instance. + * @param[in] pConsumer - The Consumer instance + * @param[out] pTheAccessRight - The AcessRight instance + * @return error code or 0 (success) + *) + TLib3MFResourceDataGroup_FindAccessRightByConsumerFunc = function(pResourceDataGroup: TLib3MFHandle; const pConsumer: TLib3MFHandle; out pTheAccessRight: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Removes access from a Consumer on this resource data group + * + * @param[in] pResourceDataGroup - ResourceDataGroup instance. + * @param[in] pConsumer - The Consumer instance + * @return error code or 0 (success) + *) + TLib3MFResourceDataGroup_RemoveAccessRightFunc = function(pResourceDataGroup: TLib3MFHandle; const pConsumer: TLib3MFHandle): TLib3MFResult; cdecl; + (************************************************************************************************************************* - Class definition for BaseMaterialGroupIterator + Function type definitions for KeyStore **************************************************************************************************************************) - TLib3MFBaseMaterialGroupIterator = class(TLib3MFResourceIterator) - public - constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); - destructor Destroy; override; - function GetCurrentBaseMaterialGroup(): TLib3MFBaseMaterialGroup; - end; - - -(************************************************************************************************************************* - Class definition for ColorGroupIterator -**************************************************************************************************************************) - - TLib3MFColorGroupIterator = class(TLib3MFResourceIterator) - public - constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); - destructor Destroy; override; - function GetCurrentColorGroup(): TLib3MFColorGroup; - end; - - -(************************************************************************************************************************* - Class definition for Texture2DGroupIterator -**************************************************************************************************************************) - - TLib3MFTexture2DGroupIterator = class(TLib3MFResourceIterator) - public - constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); - destructor Destroy; override; - function GetCurrentTexture2DGroup(): TLib3MFTexture2DGroup; - end; - - -(************************************************************************************************************************* - Class definition for CompositeMaterialsIterator -**************************************************************************************************************************) - - TLib3MFCompositeMaterialsIterator = class(TLib3MFResourceIterator) - public - constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); - destructor Destroy; override; - function GetCurrentCompositeMaterials(): TLib3MFCompositeMaterials; - end; - - -(************************************************************************************************************************* - Class definition for MultiPropertyGroupIterator -**************************************************************************************************************************) - - TLib3MFMultiPropertyGroupIterator = class(TLib3MFResourceIterator) - public - constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); - destructor Destroy; override; - function GetCurrentMultiPropertyGroup(): TLib3MFMultiPropertyGroup; - end; - - -(************************************************************************************************************************* - Class definition for MetaData -**************************************************************************************************************************) - - TLib3MFMetaData = class(TLib3MFBase) - public - constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); - destructor Destroy; override; - function GetNameSpace(): String; - procedure SetNameSpace(const ANameSpace: String); - function GetName(): String; - procedure SetName(const AName: String); - function GetKey(): String; - function GetMustPreserve(): Boolean; - procedure SetMustPreserve(const AMustPreserve: Boolean); - function GetType(): String; - procedure SetType(const AType: String); - function GetValue(): String; - procedure SetValue(const AValue: String); - end; - + (** + * Adds a consumer to the keystore + * + * @param[in] pKeyStore - KeyStore instance. + * @param[in] pConsumerID - A unique identifier for the consumer + * @param[in] pKeyID - The id of the key of the consumer + * @param[in] pKeyValue - The public key for this consumer in PEM format + * @param[out] pConsumer - The consumer instance + * @return error code or 0 (success) + *) + TLib3MFKeyStore_AddConsumerFunc = function(pKeyStore: TLib3MFHandle; const pConsumerID: PAnsiChar; const pKeyID: PAnsiChar; const pKeyValue: PAnsiChar; out pConsumer: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Gets the number of consumers in the keystore + * + * @param[in] pKeyStore - KeyStore instance. + * @param[out] pCount - The consumer count + * @return error code or 0 (success) + *) + TLib3MFKeyStore_GetConsumerCountFunc = function(pKeyStore: TLib3MFHandle; out pCount: QWord): TLib3MFResult; cdecl; + + (** + * Get a consumer from the keystore + * + * @param[in] pKeyStore - KeyStore instance. + * @param[in] nConsumerIndex - The index of the consumer + * @param[out] pConsumer - The consumer instance + * @return error code or 0 (success) + *) + TLib3MFKeyStore_GetConsumerFunc = function(pKeyStore: TLib3MFHandle; const nConsumerIndex: QWord; out pConsumer: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Removes a consumer from the keystore + * + * @param[in] pKeyStore - KeyStore instance. + * @param[in] pConsumer - The consumer instance to remove + * @return error code or 0 (success) + *) + TLib3MFKeyStore_RemoveConsumerFunc = function(pKeyStore: TLib3MFHandle; const pConsumer: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Finds a consumer by ID + * + * @param[in] pKeyStore - KeyStore instance. + * @param[in] pConsumerID - The ID of the consumer + * @param[out] pConsumer - The consumer instance + * @return error code or 0 (success) + *) + TLib3MFKeyStore_FindConsumerFunc = function(pKeyStore: TLib3MFHandle; const pConsumerID: PAnsiChar; out pConsumer: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Gets the number of resource data group in the keysore + * + * @param[in] pKeyStore - KeyStore instance. + * @param[out] pCount - The number of resource data available + * @return error code or 0 (success) + *) + TLib3MFKeyStore_GetResourceDataGroupCountFunc = function(pKeyStore: TLib3MFHandle; out pCount: QWord): TLib3MFResult; cdecl; + + (** + * Adds a resource data group into the keystore. + * + * @param[in] pKeyStore - KeyStore instance. + * @param[out] pResourceDataGroup - The resource data group instance + * @return error code or 0 (success) + *) + TLib3MFKeyStore_AddResourceDataGroupFunc = function(pKeyStore: TLib3MFHandle; out pResourceDataGroup: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Gets a resource data group + * + * @param[in] pKeyStore - KeyStore instance. + * @param[in] nResourceDataIndex - The index of the resource data + * @param[out] pResourceDataGroup - The resource data group instance + * @return error code or 0 (success) + *) + TLib3MFKeyStore_GetResourceDataGroupFunc = function(pKeyStore: TLib3MFHandle; const nResourceDataIndex: QWord; out pResourceDataGroup: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Removes a resource data group + * + * @param[in] pKeyStore - KeyStore instance. + * @param[in] pResourceDataGroup - The resource data group instance + * @return error code or 0 (success) + *) + TLib3MFKeyStore_RemoveResourceDataGroupFunc = function(pKeyStore: TLib3MFHandle; const pResourceDataGroup: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Finds a resource data group that contains a particular resourcedata + * + * @param[in] pKeyStore - KeyStore instance. + * @param[in] pPartPath - The target path for the resourcedata hold by the resource data group + * @param[out] pResourceDataGroup - The data resource instance + * @return error code or 0 (success) + *) + TLib3MFKeyStore_FindResourceDataGroupFunc = function(pKeyStore: TLib3MFHandle; const pPartPath: TLib3MFHandle; out pResourceDataGroup: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Add resourcedata to resourcedatagroup element + * + * @param[in] pKeyStore - KeyStore instance. + * @param[in] pResourceDataGroup - The resource data group where to add this resource data + * @param[in] pPartPath - The path of the part to be encrypted + * @param[in] eAlgorithm - The encryption algorithm to be used to encrypt this resource + * @param[in] eCompression - Whether compression should be used prior to encryption + * @param[in] nAdditionalAuthenticationDataCount - Number of elements in buffer + * @param[in] pAdditionalAuthenticationDataBuffer - uint8 buffer of Additional data to be encrypted along the contents for better security + * @param[out] pResourceData - The data resource instance + * @return error code or 0 (success) + *) + TLib3MFKeyStore_AddResourceDataFunc = function(pKeyStore: TLib3MFHandle; const pResourceDataGroup: TLib3MFHandle; const pPartPath: TLib3MFHandle; const eAlgorithm: Integer; const eCompression: Integer; const nAdditionalAuthenticationDataCount: QWord; const pAdditionalAuthenticationDataBuffer: PByte; out pResourceData: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Removes a resource data + * + * @param[in] pKeyStore - KeyStore instance. + * @param[in] pResourceData - The resource data to be removed + * @return error code or 0 (success) + *) + TLib3MFKeyStore_RemoveResourceDataFunc = function(pKeyStore: TLib3MFHandle; const pResourceData: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Finds a resource data on this resource group + * + * @param[in] pKeyStore - KeyStore instance. + * @param[in] pResourcePath - The target path for the resourcedata + * @param[out] pResourceData - The resource data instance + * @return error code or 0 (success) + *) + TLib3MFKeyStore_FindResourceDataFunc = function(pKeyStore: TLib3MFHandle; const pResourcePath: TLib3MFHandle; out pResourceData: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Gets the number of resource data in the keysore + * + * @param[in] pKeyStore - KeyStore instance. + * @param[out] pCount - The number of resource data available + * @return error code or 0 (success) + *) + TLib3MFKeyStore_GetResourceDataCountFunc = function(pKeyStore: TLib3MFHandle; out pCount: QWord): TLib3MFResult; cdecl; + + (** + * Gets a resource data + * + * @param[in] pKeyStore - KeyStore instance. + * @param[in] nResourceDataIndex - The index of the resource data + * @param[out] pResourceData - The data resource instance + * @return error code or 0 (success) + *) + TLib3MFKeyStore_GetResourceDataFunc = function(pKeyStore: TLib3MFHandle; const nResourceDataIndex: QWord; out pResourceData: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Gets the keystore UUID + * + * @param[in] pKeyStore - KeyStore instance. + * @param[out] pHasUUID - flag whether the keystore has a UUID + * @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) + * @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pUUIDBuffer - buffer of returns the keystore uuid., may be NULL + * @return error code or 0 (success) + *) + TLib3MFKeyStore_GetUUIDFunc = function(pKeyStore: TLib3MFHandle; out pHasUUID: Byte; const nUUIDBufferSize: Cardinal; out pUUIDNeededChars: Cardinal; pUUIDBuffer: PAnsiChar): TLib3MFResult; cdecl; + + (** + * Sets the keystore UUID + * + * @param[in] pKeyStore - KeyStore instance. + * @param[in] pUUID - The new keystore uuid. + * @return error code or 0 (success) + *) + TLib3MFKeyStore_SetUUIDFunc = function(pKeyStore: TLib3MFHandle; const pUUID: PAnsiChar): TLib3MFResult; cdecl; + (************************************************************************************************************************* - Class definition for MetaDataGroup + Function type definitions for Model **************************************************************************************************************************) - TLib3MFMetaDataGroup = class(TLib3MFBase) - public - constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); - destructor Destroy; override; - function GetMetaDataCount(): Cardinal; - function GetMetaData(const AIndex: Cardinal): TLib3MFMetaData; - function GetMetaDataByKey(const ANameSpace: String; const AName: String): TLib3MFMetaData; + (** + * Returns the PackagePart within the OPC package that holds the root model. + * + * @param[in] pModel - Model instance. + * @param[out] pRootModelPart - the PackagePart within the OPC package that holds the model-file + * @return error code or 0 (success) + *) + TLib3MFModel_RootModelPartFunc = function(pModel: TLib3MFHandle; out pRootModelPart: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Returns a new PackagePart for use within the OPC package. + * + * @param[in] pModel - Model instance. + * @param[in] pAbsolutePath - the absolute Path (physical location) within the OPC package + * @param[out] pModelPart - the new PackagePart within the OPC package + * @return error code or 0 (success) + *) + TLib3MFModel_FindOrCreatePackagePartFunc = function(pModel: TLib3MFHandle; const pAbsolutePath: PAnsiChar; out pModelPart: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * sets the units of a model. + * + * @param[in] pModel - Model instance. + * @param[in] eUnit - Unit enum value for the model unit + * @return error code or 0 (success) + *) + TLib3MFModel_SetUnitFunc = function(pModel: TLib3MFHandle; const eUnit: Integer): TLib3MFResult; cdecl; + + (** + * returns the units of a model. + * + * @param[in] pModel - Model instance. + * @param[out] pUnit - Unit enum value for the model unit + * @return error code or 0 (success) + *) + TLib3MFModel_GetUnitFunc = function(pModel: TLib3MFHandle; out pUnit: Integer): TLib3MFResult; cdecl; + + (** + * retrieves the language of a model + * + * @param[in] pModel - Model instance. + * @param[in] nLanguageBufferSize - size of the buffer (including trailing 0) + * @param[out] pLanguageNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pLanguageBuffer - buffer of language identifier, may be NULL + * @return error code or 0 (success) + *) + TLib3MFModel_GetLanguageFunc = function(pModel: TLib3MFHandle; const nLanguageBufferSize: Cardinal; out pLanguageNeededChars: Cardinal; pLanguageBuffer: PAnsiChar): TLib3MFResult; cdecl; + + (** + * sets the language of a model + * + * @param[in] pModel - Model instance. + * @param[in] pLanguage - language identifier + * @return error code or 0 (success) + *) + TLib3MFModel_SetLanguageFunc = function(pModel: TLib3MFHandle; const pLanguage: PAnsiChar): TLib3MFResult; cdecl; + + (** + * creates a model writer instance for a specific file type + * + * @param[in] pModel - Model instance. + * @param[in] pWriterClass - string identifier for the file type + * @param[out] pWriterInstance - string identifier for the file type + * @return error code or 0 (success) + *) + TLib3MFModel_QueryWriterFunc = function(pModel: TLib3MFHandle; const pWriterClass: PAnsiChar; out pWriterInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * creates a model reader instance for a specific file type + * + * @param[in] pModel - Model instance. + * @param[in] pReaderClass - string identifier for the file type + * @param[out] pReaderInstance - string identifier for the file type + * @return error code or 0 (success) + *) + TLib3MFModel_QueryReaderFunc = function(pModel: TLib3MFHandle; const pReaderClass: PAnsiChar; out pReaderInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * finds a model resource by its UniqueResourceID + * + * @param[in] pModel - Model instance. + * @param[in] nUniqueResourceID - UniqueResourceID + * @param[out] pResource - returns the resource instance + * @return error code or 0 (success) + *) + TLib3MFModel_GetResourceByIDFunc = function(pModel: TLib3MFHandle; const nUniqueResourceID: Cardinal; out pResource: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * finds a model texture by its UniqueResourceID + * + * @param[in] pModel - Model instance. + * @param[in] nUniqueResourceID - UniqueResourceID + * @param[out] pTextureInstance - returns the texture2d instance + * @return error code or 0 (success) + *) + TLib3MFModel_GetTexture2DByIDFunc = function(pModel: TLib3MFHandle; const nUniqueResourceID: Cardinal; out pTextureInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * returns a Property's type + * + * @param[in] pModel - Model instance. + * @param[in] nUniqueResourceID - Resource ID of the Property to Query + * @param[out] pThePropertyType - returns a Property's type + * @return error code or 0 (success) + *) + TLib3MFModel_GetPropertyTypeByIDFunc = function(pModel: TLib3MFHandle; const nUniqueResourceID: Cardinal; out pThePropertyType: Integer): TLib3MFResult; cdecl; + + (** + * finds a model base material group by its UniqueResourceID + * + * @param[in] pModel - Model instance. + * @param[in] nUniqueResourceID - UniqueResourceID + * @param[out] pBaseMaterialGroupInstance - returns the BaseMaterialGroup instance + * @return error code or 0 (success) + *) + TLib3MFModel_GetBaseMaterialGroupByIDFunc = function(pModel: TLib3MFHandle; const nUniqueResourceID: Cardinal; out pBaseMaterialGroupInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * finds a model texture2d group by its UniqueResourceID + * + * @param[in] pModel - Model instance. + * @param[in] nUniqueResourceID - UniqueResourceID + * @param[out] pTexture2DGroupInstance - returns the Texture2DGroup instance + * @return error code or 0 (success) + *) + TLib3MFModel_GetTexture2DGroupByIDFunc = function(pModel: TLib3MFHandle; const nUniqueResourceID: Cardinal; out pTexture2DGroupInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * finds a model CompositeMaterials by its UniqueResourceID + * + * @param[in] pModel - Model instance. + * @param[in] nUniqueResourceID - UniqueResourceID + * @param[out] pCompositeMaterialsInstance - returns the CompositeMaterials instance + * @return error code or 0 (success) + *) + TLib3MFModel_GetCompositeMaterialsByIDFunc = function(pModel: TLib3MFHandle; const nUniqueResourceID: Cardinal; out pCompositeMaterialsInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * finds a model MultiPropertyGroup by its UniqueResourceID + * + * @param[in] pModel - Model instance. + * @param[in] nUniqueResourceID - UniqueResourceID + * @param[out] pMultiPropertyGroupInstance - returns the MultiPropertyGroup instance + * @return error code or 0 (success) + *) + TLib3MFModel_GetMultiPropertyGroupByIDFunc = function(pModel: TLib3MFHandle; const nUniqueResourceID: Cardinal; out pMultiPropertyGroupInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * finds a mesh object by its UniqueResourceID + * + * @param[in] pModel - Model instance. + * @param[in] nUniqueResourceID - UniqueResourceID + * @param[out] pMeshObjectInstance - returns the mesh object instance + * @return error code or 0 (success) + *) + TLib3MFModel_GetMeshObjectByIDFunc = function(pModel: TLib3MFHandle; const nUniqueResourceID: Cardinal; out pMeshObjectInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * finds a components object by its UniqueResourceID + * + * @param[in] pModel - Model instance. + * @param[in] nUniqueResourceID - UniqueResourceID + * @param[out] pComponentsObjectInstance - returns the components object instance + * @return error code or 0 (success) + *) + TLib3MFModel_GetComponentsObjectByIDFunc = function(pModel: TLib3MFHandle; const nUniqueResourceID: Cardinal; out pComponentsObjectInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * finds a model color group by its UniqueResourceID + * + * @param[in] pModel - Model instance. + * @param[in] nUniqueResourceID - UniqueResourceID + * @param[out] pColorGroupInstance - returns the ColorGroup instance + * @return error code or 0 (success) + *) + TLib3MFModel_GetColorGroupByIDFunc = function(pModel: TLib3MFHandle; const nUniqueResourceID: Cardinal; out pColorGroupInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * finds a model slicestack by its UniqueResourceID + * + * @param[in] pModel - Model instance. + * @param[in] nUniqueResourceID - UniqueResourceID + * @param[out] pSliceStacInstance - returns the slicestack instance + * @return error code or 0 (success) + *) + TLib3MFModel_GetSliceStackByIDFunc = function(pModel: TLib3MFHandle; const nUniqueResourceID: Cardinal; out pSliceStacInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * returns, whether a build has a UUID and, if true, the build's UUID + * + * @param[in] pModel - Model instance. + * @param[out] pHasUUID - flag whether the build has a UUID + * @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) + * @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL + * @return error code or 0 (success) + *) + TLib3MFModel_GetBuildUUIDFunc = function(pModel: TLib3MFHandle; out pHasUUID: Byte; const nUUIDBufferSize: Cardinal; out pUUIDNeededChars: Cardinal; pUUIDBuffer: PAnsiChar): TLib3MFResult; cdecl; + + (** + * sets the build's UUID + * + * @param[in] pModel - Model instance. + * @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + * @return error code or 0 (success) + *) + TLib3MFModel_SetBuildUUIDFunc = function(pModel: TLib3MFHandle; const pUUID: PAnsiChar): TLib3MFResult; cdecl; + + (** + * creates a build item iterator instance with all build items. + * + * @param[in] pModel - Model instance. + * @param[out] pBuildItemIterator - returns the iterator instance. + * @return error code or 0 (success) + *) + TLib3MFModel_GetBuildItemsFunc = function(pModel: TLib3MFHandle; out pBuildItemIterator: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Returns the outbox of a Model + * + * @param[in] pModel - Model instance. + * @param[out] pOutbox - Outbox of this Model + * @return error code or 0 (success) + *) + TLib3MFModel_GetOutboxFunc = function(pModel: TLib3MFHandle; pOutbox: PLib3MFBox): TLib3MFResult; cdecl; + + (** + * creates a resource iterator instance with all resources. + * + * @param[in] pModel - Model instance. + * @param[out] pResourceIterator - returns the iterator instance. + * @return error code or 0 (success) + *) + TLib3MFModel_GetResourcesFunc = function(pModel: TLib3MFHandle; out pResourceIterator: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * creates a resource iterator instance with all object resources. + * + * @param[in] pModel - Model instance. + * @param[out] pResourceIterator - returns the iterator instance. + * @return error code or 0 (success) + *) + TLib3MFModel_GetObjectsFunc = function(pModel: TLib3MFHandle; out pResourceIterator: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * creates a resource iterator instance with all mesh object resources. + * + * @param[in] pModel - Model instance. + * @param[out] pResourceIterator - returns the iterator instance. + * @return error code or 0 (success) + *) + TLib3MFModel_GetMeshObjectsFunc = function(pModel: TLib3MFHandle; out pResourceIterator: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * creates a resource iterator instance with all components object resources. + * + * @param[in] pModel - Model instance. + * @param[out] pResourceIterator - returns the iterator instance. + * @return error code or 0 (success) + *) + TLib3MFModel_GetComponentsObjectsFunc = function(pModel: TLib3MFHandle; out pResourceIterator: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * creates a Texture2DIterator instance with all texture2d resources. + * + * @param[in] pModel - Model instance. + * @param[out] pResourceIterator - returns the iterator instance. + * @return error code or 0 (success) + *) + TLib3MFModel_GetTexture2DsFunc = function(pModel: TLib3MFHandle; out pResourceIterator: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * creates a BaseMaterialGroupIterator instance with all base material resources. + * + * @param[in] pModel - Model instance. + * @param[out] pResourceIterator - returns the iterator instance. + * @return error code or 0 (success) + *) + TLib3MFModel_GetBaseMaterialGroupsFunc = function(pModel: TLib3MFHandle; out pResourceIterator: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * creates a ColorGroupIterator instance with all ColorGroup resources. + * + * @param[in] pModel - Model instance. + * @param[out] pResourceIterator - returns the iterator instance. + * @return error code or 0 (success) + *) + TLib3MFModel_GetColorGroupsFunc = function(pModel: TLib3MFHandle; out pResourceIterator: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * creates a Texture2DGroupIterator instance with all base material resources. + * + * @param[in] pModel - Model instance. + * @param[out] pResourceIterator - returns the iterator instance. + * @return error code or 0 (success) + *) + TLib3MFModel_GetTexture2DGroupsFunc = function(pModel: TLib3MFHandle; out pResourceIterator: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * creates a CompositeMaterialsIterator instance with all CompositeMaterials resources. + * + * @param[in] pModel - Model instance. + * @param[out] pResourceIterator - returns the iterator instance. + * @return error code or 0 (success) + *) + TLib3MFModel_GetCompositeMaterialsFunc = function(pModel: TLib3MFHandle; out pResourceIterator: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * creates a MultiPropertyGroupsIterator instance with all MultiPropertyGroup resources. + * + * @param[in] pModel - Model instance. + * @param[out] pResourceIterator - returns the iterator instance. + * @return error code or 0 (success) + *) + TLib3MFModel_GetMultiPropertyGroupsFunc = function(pModel: TLib3MFHandle; out pResourceIterator: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * creates a Toolpath instance with all toolpath resources. + * + * @param[in] pModel - Model instance. + * @param[out] pResourceIterator - returns the iterator instance. + * @return error code or 0 (success) + *) + TLib3MFModel_GetToolpathsFunc = function(pModel: TLib3MFHandle; out pResourceIterator: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * creates a resource iterator instance with all slice stack resources. + * + * @param[in] pModel - Model instance. + * @param[out] pResourceIterator - returns the iterator instance. + * @return error code or 0 (success) + *) + TLib3MFModel_GetSliceStacksFunc = function(pModel: TLib3MFHandle; out pResourceIterator: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Merges all components and objects which are referenced by a build item into a mesh. The memory is duplicated and a new model is created. + * + * @param[in] pModel - Model instance. + * @param[out] pMergedModelInstance - returns the merged model instance + * @return error code or 0 (success) + *) + TLib3MFModel_MergeToModelFunc = function(pModel: TLib3MFHandle; out pMergedModelInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * adds an empty mesh object to the model. + * + * @param[in] pModel - Model instance. + * @param[out] pMeshObjectInstance - returns the mesh object instance + * @return error code or 0 (success) + *) + TLib3MFModel_AddMeshObjectFunc = function(pModel: TLib3MFHandle; out pMeshObjectInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * adds an empty component object to the model. + * + * @param[in] pModel - Model instance. + * @param[out] pComponentsObjectInstance - returns the components object instance + * @return error code or 0 (success) + *) + TLib3MFModel_AddComponentsObjectFunc = function(pModel: TLib3MFHandle; out pComponentsObjectInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * creates a new model slicestack by its id + * + * @param[in] pModel - Model instance. + * @param[in] dZBottom - Bottom Z value of the slicestack + * @param[out] pSliceStackInstance - returns the new slicestack instance + * @return error code or 0 (success) + *) + TLib3MFModel_AddSliceStackFunc = function(pModel: TLib3MFHandle; const dZBottom: Double; out pSliceStackInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * adds a texture2d resource to the model. Its path is given by that of an existing attachment. + * + * @param[in] pModel - Model instance. + * @param[in] pTextureAttachment - attachment containing the image data. + * @param[out] pTexture2DInstance - returns the new texture instance. + * @return error code or 0 (success) + *) + TLib3MFModel_AddTexture2DFromAttachmentFunc = function(pModel: TLib3MFHandle; const pTextureAttachment: TLib3MFHandle; out pTexture2DInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * adds an empty BaseMaterialGroup resource to the model. + * + * @param[in] pModel - Model instance. + * @param[out] pBaseMaterialGroupInstance - returns the new base material instance. + * @return error code or 0 (success) + *) + TLib3MFModel_AddBaseMaterialGroupFunc = function(pModel: TLib3MFHandle; out pBaseMaterialGroupInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * adds an empty ColorGroup resource to the model. + * + * @param[in] pModel - Model instance. + * @param[out] pColorGroupInstance - returns the new ColorGroup instance. + * @return error code or 0 (success) + *) + TLib3MFModel_AddColorGroupFunc = function(pModel: TLib3MFHandle; out pColorGroupInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * adds an empty Texture2DGroup resource to the model. + * + * @param[in] pModel - Model instance. + * @param[in] pTexture2DInstance - The texture2D instance of the created Texture2DGroup. + * @param[out] pTexture2DGroupInstance - returns the new Texture2DGroup instance. + * @return error code or 0 (success) + *) + TLib3MFModel_AddTexture2DGroupFunc = function(pModel: TLib3MFHandle; const pTexture2DInstance: TLib3MFHandle; out pTexture2DGroupInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * adds an empty CompositeMaterials resource to the model. + * + * @param[in] pModel - Model instance. + * @param[in] pBaseMaterialGroupInstance - The BaseMaterialGroup instance of the created CompositeMaterials. + * @param[out] pCompositeMaterialsInstance - returns the new CompositeMaterials instance. + * @return error code or 0 (success) + *) + TLib3MFModel_AddCompositeMaterialsFunc = function(pModel: TLib3MFHandle; const pBaseMaterialGroupInstance: TLib3MFHandle; out pCompositeMaterialsInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * adds an empty MultiPropertyGroup resource to the model. + * + * @param[in] pModel - Model instance. + * @param[out] pMultiPropertyGroupInstance - returns the new MultiPropertyGroup instance. + * @return error code or 0 (success) + *) + TLib3MFModel_AddMultiPropertyGroupFunc = function(pModel: TLib3MFHandle; out pMultiPropertyGroupInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * adds a build item to the model. + * + * @param[in] pModel - Model instance. + * @param[in] pObject - Object instance. + * @param[in] pTransform - Transformation matrix. + * @param[out] pBuildItemInstance - returns the build item instance. + * @return error code or 0 (success) + *) + TLib3MFModel_AddBuildItemFunc = function(pModel: TLib3MFHandle; const pObject: TLib3MFHandle; const pTransform: PLib3MFTransform; out pBuildItemInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * removes a build item from the model + * + * @param[in] pModel - Model instance. + * @param[in] pBuildItemInstance - Build item to remove. + * @return error code or 0 (success) + *) + TLib3MFModel_RemoveBuildItemFunc = function(pModel: TLib3MFHandle; const pBuildItemInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * adds an empty Toolpath resource to the model. + * + * @param[in] pModel - Model instance. + * @param[in] dUnitFactor - The toolpath instance of the created Toolpath. + * @param[out] pToolpathInstance - The toolpath instance of the created Toolpath. + * @return error code or 0 (success) + *) + TLib3MFModel_AddToolpathFunc = function(pModel: TLib3MFHandle; const dUnitFactor: Double; out pToolpathInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Returns the metadata of the model as MetaDataGroup + * + * @param[in] pModel - Model instance. + * @param[out] pTheMetaDataGroup - returns an Instance of the metadatagroup of the model + * @return error code or 0 (success) + *) + TLib3MFModel_GetMetaDataGroupFunc = function(pModel: TLib3MFHandle; out pTheMetaDataGroup: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * adds an attachment stream to the model. The OPC part will be related to the model stream with a certain relationship type. + * + * @param[in] pModel - Model instance. + * @param[in] pURI - Path of the attachment + * @param[in] pRelationShipType - Relationship type of the attachment + * @param[out] pAttachmentInstance - Instance of the attachment object + * @return error code or 0 (success) + *) + TLib3MFModel_AddAttachmentFunc = function(pModel: TLib3MFHandle; const pURI: PAnsiChar; const pRelationShipType: PAnsiChar; out pAttachmentInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Removes attachment from the model. + * + * @param[in] pModel - Model instance. + * @param[in] pAttachmentInstance - Attachment instance to remove + * @return error code or 0 (success) + *) + TLib3MFModel_RemoveAttachmentFunc = function(pModel: TLib3MFHandle; const pAttachmentInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * retrieves an attachment stream object from the model.. + * + * @param[in] pModel - Model instance. + * @param[in] nIndex - Index of the attachment stream + * @param[out] pAttachmentInstance - Instance of the attachment object + * @return error code or 0 (success) + *) + TLib3MFModel_GetAttachmentFunc = function(pModel: TLib3MFHandle; const nIndex: Cardinal; out pAttachmentInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * retrieves an attachment stream object from the model. + * + * @param[in] pModel - Model instance. + * @param[in] pURI - Path URI in the package + * @param[out] pAttachmentInstance - Instance of the attachment object + * @return error code or 0 (success) + *) + TLib3MFModel_FindAttachmentFunc = function(pModel: TLib3MFHandle; const pURI: PAnsiChar; out pAttachmentInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * retrieves the number of attachments of the model. + * + * @param[in] pModel - Model instance. + * @param[out] pAttachmentCount - Returns the number of attachments. + * @return error code or 0 (success) + *) + TLib3MFModel_GetAttachmentCountFunc = function(pModel: TLib3MFHandle; out pAttachmentCount: Cardinal): TLib3MFResult; cdecl; + + (** + * Retrieve whether the OPC package contains a package thumbnail. + * + * @param[in] pModel - Model instance. + * @param[out] pHasThumbnail - returns whether the OPC package contains a package thumbnail + * @return error code or 0 (success) + *) + TLib3MFModel_HasPackageThumbnailAttachmentFunc = function(pModel: TLib3MFHandle; out pHasThumbnail: Byte): TLib3MFResult; cdecl; + + (** + * Create a new or the existing package thumbnail for the OPC package. + * + * @param[in] pModel - Model instance. + * @param[out] pAttachment - Instance of a new or the existing thumbnailattachment object. + * @return error code or 0 (success) + *) + TLib3MFModel_CreatePackageThumbnailAttachmentFunc = function(pModel: TLib3MFHandle; out pAttachment: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Get the attachment to the OPC package containing the package thumbnail. + * + * @param[in] pModel - Model instance. + * @param[out] pAttachment - Instance of the thumbnailattachment object or NULL. + * @return error code or 0 (success) + *) + TLib3MFModel_GetPackageThumbnailAttachmentFunc = function(pModel: TLib3MFHandle; out pAttachment: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Remove the attachment to the OPC package containing the package thumbnail. + * + * @param[in] pModel - Model instance. + * @return error code or 0 (success) + *) + TLib3MFModel_RemovePackageThumbnailAttachmentFunc = function(pModel: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Adds a new Content Type to the model. + * + * @param[in] pModel - Model instance. + * @param[in] pExtension - File Extension + * @param[in] pContentType - Content Type Identifier + * @return error code or 0 (success) + *) + TLib3MFModel_AddCustomContentTypeFunc = function(pModel: TLib3MFHandle; const pExtension: PAnsiChar; const pContentType: PAnsiChar): TLib3MFResult; cdecl; + + (** + * Removes a custom Content Type from the model (UTF8 version). + * + * @param[in] pModel - Model instance. + * @param[in] pExtension - File Extension + * @return error code or 0 (success) + *) + TLib3MFModel_RemoveCustomContentTypeFunc = function(pModel: TLib3MFHandle; const pExtension: PAnsiChar): TLib3MFResult; cdecl; + + (** + * Sets the random number generator callback for use in the library + * + * @param[in] pModel - Model instance. + * @param[in] pTheCallback - The callback used to generate random numbers + * @param[in] pUserData - Userdata to be passed to the callback function + * @return error code or 0 (success) + *) + TLib3MFModel_SetRandomNumberCallbackFunc = function(pModel: TLib3MFHandle; const pTheCallback: PLib3MF_RandomNumberCallback; const pUserData: Pointer): TLib3MFResult; cdecl; + + (** + * Gets the keystore associated with this model + * + * @param[in] pModel - Model instance. + * @param[out] pKeyStore - The package keystore + * @return error code or 0 (success) + *) + TLib3MFModel_GetKeyStoreFunc = function(pModel: TLib3MFHandle; out pKeyStore: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Creates an OPC Reader Source from a file. + * + * @param[in] pModel - Model instance. + * @param[in] pFilename - Filename to read from + * @param[out] pInstance - The instance of the created reader source + * @return error code or 0 (success) + *) + TLib3MFModel_CreatePersistentSourceFromFileFunc = function(pModel: TLib3MFHandle; const pFilename: PAnsiChar; out pInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Creates an OPC Reader Source from a memory buffer. The memory buffer MUST exist as long as the Source object exists. + * + * @param[in] pModel - Model instance. + * @param[in] nBufferCount - Number of elements in buffer + * @param[in] pBufferBuffer - uint8 buffer of Buffer to read from + * @param[out] pInstance - The instance of the created reader source + * @return error code or 0 (success) + *) + TLib3MFModel_CreatePersistentSourceFromBufferFunc = function(pModel: TLib3MFHandle; const nBufferCount: QWord; const pBufferBuffer: PByte; out pInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Creates an OPC Reader Source from a data provided by a callback function. The callbacks MUST exist as long as the source object exists. + * + * @param[in] pModel - Model instance. + * @param[in] pTheReadCallback - Callback to call for reading a data chunk + * @param[in] nStreamSize - number of bytes the callback returns + * @param[in] pTheSeekCallback - Callback to call for seeking in the stream. + * @param[in] pUserData - Userdata that is passed to the callback function + * @param[out] pInstance - The instance of the created reader source + * @return error code or 0 (success) + *) + TLib3MFModel_CreatePersistentSourceFromCallbackFunc = function(pModel: TLib3MFHandle; const pTheReadCallback: PLib3MF_ReadCallback; const nStreamSize: QWord; const pTheSeekCallback: PLib3MF_SeekCallback; const pUserData: Pointer; out pInstance: TLib3MFHandle): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Global function definitions +**************************************************************************************************************************) + + (** + * retrieves the binary version of this library. + * + * @param[out] pMajor - returns the major version of this library + * @param[out] pMinor - returns the minor version of this library + * @param[out] pMicro - returns the micro version of this library + * @return error code or 0 (success) + *) + TLib3MFGetLibraryVersionFunc = function(out pMajor: Cardinal; out pMinor: Cardinal; out pMicro: Cardinal): TLib3MFResult; cdecl; + + (** + * retrieves prerelease information of this library. + * + * @param[out] pHasPrereleaseInfo - Does the library provide prerelease version? + * @param[in] nPrereleaseInfoBufferSize - size of the buffer (including trailing 0) + * @param[out] pPrereleaseInfoNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pPrereleaseInfoBuffer - buffer of retrieves prerelease information of this library., may be NULL + * @return error code or 0 (success) + *) + TLib3MFGetPrereleaseInformationFunc = function(out pHasPrereleaseInfo: Byte; const nPrereleaseInfoBufferSize: Cardinal; out pPrereleaseInfoNeededChars: Cardinal; pPrereleaseInfoBuffer: PAnsiChar): TLib3MFResult; cdecl; + + (** + * retrieves build information of this library. + * + * @param[out] pHasBuildInfo - Does the library provide build version? + * @param[in] nBuildInformationBufferSize - size of the buffer (including trailing 0) + * @param[out] pBuildInformationNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pBuildInformationBuffer - buffer of retrieves build information of this library., may be NULL + * @return error code or 0 (success) + *) + TLib3MFGetBuildInformationFunc = function(out pHasBuildInfo: Byte; const nBuildInformationBufferSize: Cardinal; out pBuildInformationNeededChars: Cardinal; pBuildInformationBuffer: PAnsiChar): TLib3MFResult; cdecl; + + (** + * retrieves whether a specification is supported, and if so, which version. + * + * @param[in] pSpecificationURL - URL of extension to check + * @param[out] pIsSupported - returns whether this specification is supported + * @param[out] pMajor - returns the major version of the extension (if IsSupported) + * @param[out] pMinor - returns the minor version of the extension (if IsSupported) + * @param[out] pMicro - returns the micro version of the extension (if IsSupported) + * @return error code or 0 (success) + *) + TLib3MFGetSpecificationVersionFunc = function(const pSpecificationURL: PAnsiChar; out pIsSupported: Byte; out pMajor: Cardinal; out pMinor: Cardinal; out pMicro: Cardinal): TLib3MFResult; cdecl; + + (** + * creates an empty model instance. + * + * @param[out] pModel - returns an empty model instance + * @return error code or 0 (success) + *) + TLib3MFCreateModelFunc = function(out pModel: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * releases shared ownership of an object instance + * + * @param[in] pInstance - the object instance to release + * @return error code or 0 (success) + *) + TLib3MFReleaseFunc = function(const pInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * acquires shared ownership of an object instance + * + * @param[in] pInstance - the object instance to acquire + * @return error code or 0 (success) + *) + TLib3MFAcquireFunc = function(const pInstance: TLib3MFHandle): TLib3MFResult; cdecl; + + (** + * Sets the journal file path + * + * @param[in] pJournalPath - File name of the journal file + * @return error code or 0 (success) + *) + TLib3MFSetJournalFunc = function(const pJournalPath: PAnsiChar): TLib3MFResult; cdecl; + + (** + * Retrieves the last error string of an instance + * + * @param[in] pInstance - Object where the error occured. + * @param[in] nLastErrorStringBufferSize - size of the buffer (including trailing 0) + * @param[out] pLastErrorStringNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pLastErrorStringBuffer - buffer of Last Error String, may be NULL + * @param[out] pHasLastError - Returns if the instance has a last error. + * @return error code or 0 (success) + *) + TLib3MFGetLastErrorFunc = function(const pInstance: TLib3MFHandle; const nLastErrorStringBufferSize: Cardinal; out pLastErrorStringNeededChars: Cardinal; pLastErrorStringBuffer: PAnsiChar; out pHasLastError: Byte): TLib3MFResult; cdecl; + + (** + * Returns the address of the SymbolLookupMethod + * + * @param[out] pSymbolLookupMethod - Address of the SymbolAddressMethod + * @return error code or 0 (success) + *) + TLib3MFGetSymbolLookupMethodFunc = function(out pSymbolLookupMethod: Pointer): TLib3MFResult; cdecl; + + (** + * Return an English text for a progress identifier.|Note: this is the only function you can call from your callback function. + * + * @param[in] eTheProgressIdentifier - the progress identifier that is passed to the callback function + * @param[in] nProgressMessageBufferSize - size of the buffer (including trailing 0) + * @param[out] pProgressMessageNeededChars - will be filled with the count of the written bytes, or needed buffer size. + * @param[out] pProgressMessageBuffer - buffer of English text for the progress identifier, may be NULL + * @return error code or 0 (success) + *) + TLib3MFRetrieveProgressMessageFunc = function(const eTheProgressIdentifier: Integer; const nProgressMessageBufferSize: Cardinal; out pProgressMessageNeededChars: Cardinal; pProgressMessageBuffer: PAnsiChar): TLib3MFResult; cdecl; + + (** + * Creates a Color from uint8 RGBA values + * + * @param[in] nRed - Red value of color (0-255) + * @param[in] nGreen - Green value of color (0-255) + * @param[in] nBlue - Blue value of color (0-255) + * @param[in] nAlpha - Alpha value of color (0-255) + * @param[out] pTheColor - Assembled color + * @return error code or 0 (success) + *) + TLib3MFRGBAToColorFunc = function(const nRed: Byte; const nGreen: Byte; const nBlue: Byte; const nAlpha: Byte; pTheColor: PLib3MFColor): TLib3MFResult; cdecl; + + (** + * Creates a Color from uint8 RGBA values + * + * @param[in] fRed - Red value of color (0-1) + * @param[in] fGreen - Green value of color (0-1) + * @param[in] fBlue - Blue value of color (0-1) + * @param[in] fAlpha - Alpha value of color (0-1) + * @param[out] pTheColor - Assembled color + * @return error code or 0 (success) + *) + TLib3MFFloatRGBAToColorFunc = function(const fRed: Single; const fGreen: Single; const fBlue: Single; const fAlpha: Single; pTheColor: PLib3MFColor): TLib3MFResult; cdecl; + + (** + * Calculates uint8-RGBA-values from a Color + * + * @param[in] pTheColor - Color to handle + * @param[out] pRed - Red value of color (0-255) + * @param[out] pGreen - Green value of color (0-255) + * @param[out] pBlue - Blue value of color (0-255) + * @param[out] pAlpha - Alpha value of color (0-255) + * @return error code or 0 (success) + *) + TLib3MFColorToRGBAFunc = function(const pTheColor: PLib3MFColor; out pRed: Byte; out pGreen: Byte; out pBlue: Byte; out pAlpha: Byte): TLib3MFResult; cdecl; + + (** + * Calculates float-RGBA-values from a Color + * + * @param[in] pTheColor - Color to handle + * @param[out] pRed - Red value of color (0-1) + * @param[out] pGreen - Green value of color (0-1) + * @param[out] pBlue - Blue value of color (0-1) + * @param[out] pAlpha - Alpha value of color (0-1) + * @return error code or 0 (success) + *) + TLib3MFColorToFloatRGBAFunc = function(const pTheColor: PLib3MFColor; out pRed: Single; out pGreen: Single; out pBlue: Single; out pAlpha: Single): TLib3MFResult; cdecl; + + (** + * Creates an identity transform + * + * @param[out] pTransform - Transformation matrix. + * @return error code or 0 (success) + *) + TLib3MFGetIdentityTransformFunc = function(pTransform: PLib3MFTransform): TLib3MFResult; cdecl; + + (** + * Creates a uniform scale transform + * + * @param[in] fFactor - Factor in X, Y and Z + * @param[out] pTransform - Transformation matrix. + * @return error code or 0 (success) + *) + TLib3MFGetUniformScaleTransformFunc = function(const fFactor: Single; pTransform: PLib3MFTransform): TLib3MFResult; cdecl; + + (** + * Creates a scale transform + * + * @param[in] fFactorX - Factor in X + * @param[in] fFactorY - Factor in Y + * @param[in] fFactorZ - Factor in Z + * @param[out] pTransform - Transformation matrix. + * @return error code or 0 (success) + *) + TLib3MFGetScaleTransformFunc = function(const fFactorX: Single; const fFactorY: Single; const fFactorZ: Single; pTransform: PLib3MFTransform): TLib3MFResult; cdecl; + + (** + * Creates an translation transform + * + * @param[in] fVectorX - Translation in X + * @param[in] fVectorY - Translation in Y + * @param[in] fVectorZ - Translation in Z + * @param[out] pTransform - Transformation matrix. + * @return error code or 0 (success) + *) + TLib3MFGetTranslationTransformFunc = function(const fVectorX: Single; const fVectorY: Single; const fVectorZ: Single; pTransform: PLib3MFTransform): TLib3MFResult; cdecl; + + +(************************************************************************************************************************* + Helper function pointer definitions +**************************************************************************************************************************) +TLib3MFSymbolLookupMethod = function(const pSymbolName: PAnsiChar; out pValue: Pointer): TLib3MFResult; cdecl; + +(************************************************************************************************************************* + Exception definition +**************************************************************************************************************************) + + ELib3MFException = class(Exception) + private + FErrorCode: TLib3MFResult; + FCustomMessage: String; + public + property ErrorCode: TLib3MFResult read FErrorCode; + property CustomMessage: String read FCustomMessage; + constructor Create(AErrorCode: TLib3MFResult; AMessage: String); + constructor CreateCustomMessage(AErrorCode: TLib3MFResult; AMessage: String); + end; + + +(************************************************************************************************************************* + Class definition for Base +**************************************************************************************************************************) + + TLib3MFBase = class(TObject) + private + FWrapper: TLib3MFWrapper; + FHandle: TLib3MFHandle; + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + property TheHandle: TLib3MFHandle read FHandle; + function ClassTypeId(): QWord; + end; + + +(************************************************************************************************************************* + Class definition for BinaryStream +**************************************************************************************************************************) + + TLib3MFBinaryStream = class(TLib3MFBase) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetBinaryPath(): String; + function GetIndexPath(): String; + function GetUUID(): String; + procedure DisableDiscretizedArrayCompression(); + procedure EnableDiscretizedArrayCompression(const AUnits: Double; const APredictionType: TLib3MFBinaryStreamPredictionType); + procedure EnableLZMA(const ALZMALevel: Cardinal); + procedure DisableLZMA(); + end; + + +(************************************************************************************************************************* + Class definition for Writer +**************************************************************************************************************************) + + TLib3MFWriter = class(TLib3MFBase) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + procedure WriteToFile(const AFilename: String); + function GetStreamSize(): QWord; + procedure WriteToBuffer(out ABuffer: TByteDynArray); + procedure WriteToCallback(const ATheWriteCallback: PLib3MF_WriteCallback; const ATheSeekCallback: PLib3MF_SeekCallback; const AUserData: Pointer); + procedure SetProgressCallback(const AProgressCallback: PLib3MF_ProgressCallback; const AUserData: Pointer); + function GetDecimalPrecision(): Cardinal; + procedure SetDecimalPrecision(const ADecimalPrecision: Cardinal); + procedure SetStrictModeActive(const AStrictModeActive: Boolean); + function GetStrictModeActive(): Boolean; + function GetWarning(const AIndex: Cardinal; out AErrorCode: Cardinal): String; + function GetWarningCount(): Cardinal; + procedure AddKeyWrappingCallback(const AConsumerID: String; const ATheCallback: PLib3MF_KeyWrappingCallback; const AUserData: Pointer); + procedure SetContentEncryptionCallback(const ATheCallback: PLib3MF_ContentEncryptionCallback; const AUserData: Pointer); + function CreateBinaryStream(const AIndexPath: String; const ABinaryPath: String): TLib3MFBinaryStream; + procedure AssignBinaryStream(const AInstance: TLib3MFBase; const ABinaryStream: TLib3MFBinaryStream); + procedure RegisterCustomNamespace(const APrefix: String; const ANameSpace: String); + end; + + +(************************************************************************************************************************* + Class definition for PersistentReaderSource +**************************************************************************************************************************) + + TLib3MFPersistentReaderSource = class(TLib3MFBase) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetSourceType(): TLib3MFPersistentReaderSourceType; + procedure InvalidateSourceData(); + function SourceDataIsValid(): Boolean; + end; + + +(************************************************************************************************************************* + Class definition for Reader +**************************************************************************************************************************) + + TLib3MFReader = class(TLib3MFBase) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + procedure ReadFromPersistentSource(const ASource: TLib3MFPersistentReaderSource); + procedure ReadFromFile(const AFilename: String); + procedure ReadFromBuffer(const ABuffer: TByteDynArray); + procedure ReadFromCallback(const ATheReadCallback: PLib3MF_ReadCallback; const AStreamSize: QWord; const ATheSeekCallback: PLib3MF_SeekCallback; const AUserData: Pointer); + procedure SetProgressCallback(const AProgressCallback: PLib3MF_ProgressCallback; const AUserData: Pointer); + procedure AddRelationToRead(const ARelationShipType: String); + procedure RemoveRelationToRead(const ARelationShipType: String); + procedure SetStrictModeActive(const AStrictModeActive: Boolean); + function GetStrictModeActive(): Boolean; + function GetWarning(const AIndex: Cardinal; out AErrorCode: Cardinal): String; + function GetWarningCount(): Cardinal; + procedure AddKeyWrappingCallback(const AConsumerID: String; const ATheCallback: PLib3MF_KeyWrappingCallback; const AUserData: Pointer); + procedure SetContentEncryptionCallback(const ATheCallback: PLib3MF_ContentEncryptionCallback; const AUserData: Pointer); + end; + + +(************************************************************************************************************************* + Class definition for PackagePart +**************************************************************************************************************************) + + TLib3MFPackagePart = class(TLib3MFBase) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetPath(): String; + procedure SetPath(const APath: String); + end; + + +(************************************************************************************************************************* + Class definition for Resource +**************************************************************************************************************************) + + TLib3MFResource = class(TLib3MFBase) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetResourceID(): Cardinal; + function GetUniqueResourceID(): Cardinal; + function PackagePart(): TLib3MFPackagePart; + procedure SetPackagePart(const APackagePart: TLib3MFPackagePart); + function GetModelResourceID(): Cardinal; + end; + + +(************************************************************************************************************************* + Class definition for ResourceIterator +**************************************************************************************************************************) + + TLib3MFResourceIterator = class(TLib3MFBase) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function MoveNext(): Boolean; + function MovePrevious(): Boolean; + function GetCurrent(): TLib3MFResource; + function Clone(): TLib3MFResourceIterator; + function Count(): QWord; + end; + + +(************************************************************************************************************************* + Class definition for CustomXMLAttribute +**************************************************************************************************************************) + + TLib3MFCustomXMLAttribute = class(TLib3MFBase) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetName(): String; + function GetValue(): String; + function IsValidInteger(const AMinValue: Int64; const AMaxValue: Int64): Boolean; + function GetIntegerValue(const AMinValue: Int64; const AMaxValue: Int64): Int64; + function IsValidDouble(const AMinValue: Double; const AMaxValue: Double): Boolean; + function GetDoubleValue(const AMinValue: Double; const AMaxValue: Double): Double; + function IsValidBool(): Boolean; + function GetBoolValue(const AMinValue: Double; const AMaxValue: Double): Boolean; + procedure SetValue(const AValue: String); + procedure SetIntegerValue(const AValue: Int64); + procedure SetDoubleValue(const AValue: Double); + procedure SetBoolValue(const AValue: Boolean); + procedure Remove(); + end; + + +(************************************************************************************************************************* + Class definition for CustomXMLNode +**************************************************************************************************************************) + + TLib3MFCustomXMLNode = class(TLib3MFBase) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetName(): String; + function GetNameSpace(): String; + function GetAttributeCount(): QWord; + function GetAttribute(const AIndex: QWord): TLib3MFCustomXMLAttribute; + function HasAttribute(const AName: String): Boolean; + function FindAttribute(const AName: String; const AMustExist: Boolean): TLib3MFCustomXMLAttribute; + function RemoveAttribute(const AName: String): Boolean; + function RemoveAttributeByIndex(const AIndex: QWord): Boolean; + procedure AddAttribute(const AName: String; const AValue: String); + procedure AddIntegerAttribute(const AName: String; const AValue: Int64); + procedure AddDoubleAttribute(const AName: String; const AValue: Double); + procedure AddBoolAttribute(const AName: String; const AValue: Boolean); + function GetChildren(): TLib3MFCustomXMLNodes; + function CountChildrenByName(const AName: String): QWord; + function GetChildrenByName(const AName: String): TLib3MFCustomXMLNodes; + function HasChild(const AName: String): Boolean; + function HasUniqueChild(const AName: String): Boolean; + function FindChild(const AName: String; const AMustExist: Boolean): TLib3MFCustomXMLNode; + function AddChild(const AName: String): TLib3MFCustomXMLNode; + procedure RemoveChild(const AChildInstance: TLib3MFCustomXMLNode); + function RemoveChildrenWithName(const AName: String): QWord; + procedure Remove(); + end; + + +(************************************************************************************************************************* + Class definition for CustomXMLNodes +**************************************************************************************************************************) + + TLib3MFCustomXMLNodes = class(TLib3MFBase) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetNodeCount(): QWord; + function GetNode(const AIndex: QWord): TLib3MFCustomXMLNode; + function CountNodesByName(const AName: String): QWord; + function GetNodesByName(const AName: String): TLib3MFCustomXMLNodes; + function HasNode(const AName: String): Boolean; + function HasUniqueNode(const AName: String): Boolean; + function FindNode(const AName: String; const AMustExist: Boolean): TLib3MFCustomXMLNode; + end; + + +(************************************************************************************************************************* + Class definition for CustomDOMTree +**************************************************************************************************************************) + + TLib3MFCustomDOMTree = class(TLib3MFBase) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetNameSpace(): String; + function GetRootNode(): TLib3MFCustomXMLNode; + function SaveToString(): String; + end; + + +(************************************************************************************************************************* + Class definition for SliceStackIterator +**************************************************************************************************************************) + + TLib3MFSliceStackIterator = class(TLib3MFResourceIterator) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetCurrentSliceStack(): TLib3MFSliceStack; + end; + + +(************************************************************************************************************************* + Class definition for ObjectIterator +**************************************************************************************************************************) + + TLib3MFObjectIterator = class(TLib3MFResourceIterator) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetCurrentObject(): TLib3MFObject; + end; + + +(************************************************************************************************************************* + Class definition for MeshObjectIterator +**************************************************************************************************************************) + + TLib3MFMeshObjectIterator = class(TLib3MFResourceIterator) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetCurrentMeshObject(): TLib3MFMeshObject; + end; + + +(************************************************************************************************************************* + Class definition for ComponentsObjectIterator +**************************************************************************************************************************) + + TLib3MFComponentsObjectIterator = class(TLib3MFResourceIterator) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetCurrentComponentsObject(): TLib3MFComponentsObject; + end; + + +(************************************************************************************************************************* + Class definition for Texture2DIterator +**************************************************************************************************************************) + + TLib3MFTexture2DIterator = class(TLib3MFResourceIterator) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetCurrentTexture2D(): TLib3MFTexture2D; + end; + + +(************************************************************************************************************************* + Class definition for BaseMaterialGroupIterator +**************************************************************************************************************************) + + TLib3MFBaseMaterialGroupIterator = class(TLib3MFResourceIterator) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetCurrentBaseMaterialGroup(): TLib3MFBaseMaterialGroup; + end; + + +(************************************************************************************************************************* + Class definition for ColorGroupIterator +**************************************************************************************************************************) + + TLib3MFColorGroupIterator = class(TLib3MFResourceIterator) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetCurrentColorGroup(): TLib3MFColorGroup; + end; + + +(************************************************************************************************************************* + Class definition for Texture2DGroupIterator +**************************************************************************************************************************) + + TLib3MFTexture2DGroupIterator = class(TLib3MFResourceIterator) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetCurrentTexture2DGroup(): TLib3MFTexture2DGroup; + end; + + +(************************************************************************************************************************* + Class definition for CompositeMaterialsIterator +**************************************************************************************************************************) + + TLib3MFCompositeMaterialsIterator = class(TLib3MFResourceIterator) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetCurrentCompositeMaterials(): TLib3MFCompositeMaterials; + end; + + +(************************************************************************************************************************* + Class definition for MultiPropertyGroupIterator +**************************************************************************************************************************) + + TLib3MFMultiPropertyGroupIterator = class(TLib3MFResourceIterator) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetCurrentMultiPropertyGroup(): TLib3MFMultiPropertyGroup; + end; + + +(************************************************************************************************************************* + Class definition for MetaData +**************************************************************************************************************************) + + TLib3MFMetaData = class(TLib3MFBase) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetNameSpace(): String; + procedure SetNameSpace(const ANameSpace: String); + function GetName(): String; + procedure SetName(const AName: String); + function GetKey(): String; + function GetMustPreserve(): Boolean; + procedure SetMustPreserve(const AMustPreserve: Boolean); + function GetType(): String; + procedure SetType(const AType: String); + function GetValue(): String; + procedure SetValue(const AValue: String); + end; + + +(************************************************************************************************************************* + Class definition for MetaDataGroup +**************************************************************************************************************************) + + TLib3MFMetaDataGroup = class(TLib3MFBase) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetMetaDataCount(): Cardinal; + function GetMetaData(const AIndex: Cardinal): TLib3MFMetaData; + function GetMetaDataByKey(const ANameSpace: String; const AName: String): TLib3MFMetaData; procedure RemoveMetaDataByIndex(const AIndex: Cardinal); procedure RemoveMetaData(const ATheMetaData: TLib3MFMetaData); function AddMetaData(const ANameSpace: String; const AName: String; const AValue: String; const AType: String; const AMustPreserve: Boolean): TLib3MFMetaData; @@ -4756,6 +6402,133 @@ TLib3MFSlice = class(TLib3MFBase) end; +(************************************************************************************************************************* + Class definition for ToolpathProfile +**************************************************************************************************************************) + + TLib3MFToolpathProfile = class(TLib3MFBase) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetUUID(): String; + function GetName(): String; + function GetParameterCount(): Cardinal; + function GetParameterName(const AIndex: Cardinal): String; + function GetParameterNameSpace(const AIndex: Cardinal): String; + function HasParameterValue(const ANameSpaceName: String; const AValueName: String): Boolean; + function GetParameterValue(const ANameSpaceName: String; const AValueName: String): String; + function GetParameterValueDef(const ANameSpaceName: String; const AValueName: String; const ADefaultValue: String): String; + function GetParameterDoubleValue(const ANameSpaceName: String; const AValueName: String): Double; + function GetParameterDoubleValueDef(const ANameSpaceName: String; const AValueName: String; const ADefaultValue: Double): Double; + function GetParameterIntegerValue(const ANameSpaceName: String; const AValueName: String): Int64; + function GetParameterIntegerValueDef(const ANameSpaceName: String; const AValueName: String; const ADefaultValue: Int64): Int64; + function GetParameterBoolValue(const ANameSpaceName: String; const AValueName: String): Boolean; + function GetParameterBoolValueDef(const ANameSpaceName: String; const AValueName: String; const ADefaultValue: Boolean): Boolean; + procedure SetName(const AName: String); + procedure SetParameterValue(const ANameSpaceName: String; const AValueName: String; const AValue: String); + procedure SetParameterDoubleValue(const ANameSpaceName: String; const AValueName: String; const AValue: Double); + procedure SetParameterIntegerValue(const ANameSpaceName: String; const AValueName: String; const AValue: Int64); + procedure SetParameterBoolValue(const ANameSpaceName: String; const AValueName: String; const AValue: Boolean); + end; + + +(************************************************************************************************************************* + Class definition for ToolpathLayerReader +**************************************************************************************************************************) + + TLib3MFToolpathLayerReader = class(TLib3MFBase) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetLayerDataUUID(): String; + function GetSegmentCount(): Cardinal; + procedure GetSegmentInfo(const AIndex: Cardinal; out AType: TLib3MFToolpathSegmentType; out APointCount: Cardinal); + function GetSegmentProfile(const AIndex: Cardinal): TLib3MFToolpathProfile; + function GetSegmentProfileUUID(const AIndex: Cardinal): String; + function GetSegmentPart(const AIndex: Cardinal): TLib3MFBuildItem; + function GetSegmentPartUUID(const AIndex: Cardinal): String; + function GetSegmentLocalPartID(const AIndex: Cardinal): Cardinal; + function GetPartUUIDByLocalPartID(const ALocalPartID: Cardinal): String; + procedure GetSegmentPointData(const AIndex: Cardinal; out APointData: ArrayOfLib3MFPosition2D); + procedure FindAttributeInfoByName(const ANameSpace: String; const AAttributeName: String; out AID: Cardinal; out AAttributeType: TLib3MFToolpathAttributeType); + function FindAttributeIDByName(const ANameSpace: String; const AAttributeName: String): Cardinal; + function FindAttributeValueByName(const ANameSpace: String; const AAttributeName: String): TLib3MFToolpathAttributeType; + function GetSegmentIntegerAttributeByID(const AIndex: Cardinal; const AID: Cardinal): Int64; + function GetSegmentIntegerAttributeByName(const AIndex: Cardinal; const ANameSpace: String; const AAttributeName: String): Int64; + function GetSegmentDoubleAttributeByID(const AIndex: Cardinal; const AID: Cardinal): Double; + function GetSegmentDoubleAttributeByName(const AIndex: Cardinal; const ANameSpace: String; const AAttributeName: String): Double; + function GetCustomDataCount(): Cardinal; + function GetCustomData(const AIndex: Cardinal): TLib3MFCustomDOMTree; + procedure GetCustomDataName(const AIndex: Cardinal; out ANameSpace: String; out ADataName: String); + end; + + +(************************************************************************************************************************* + Class definition for ToolpathLayerData +**************************************************************************************************************************) + + TLib3MFToolpathLayerData = class(TLib3MFBase) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetLayerDataUUID(): String; + function RegisterProfile(const AProfile: TLib3MFToolpathProfile): Cardinal; + function RegisterBuildItem(const ABuildItem: TLib3MFBuildItem): Cardinal; + procedure SetSegmentAttribute(const ANameSpace: String; const AAttributeName: String; const AValue: String); + procedure ClearSegmentAttributes(); + procedure WriteHatchData(const AProfileID: Cardinal; const APartID: Cardinal; const APointData: ArrayOfLib3MFPosition2D); + procedure WriteLoop(const AProfileID: Cardinal; const APartID: Cardinal; const APointData: ArrayOfLib3MFPosition2D); + procedure WritePolyline(const AProfileID: Cardinal; const APartID: Cardinal; const APointData: ArrayOfLib3MFPosition2D); + function AddCustomData(const ANameSpace: String; const ADataName: String): TLib3MFCustomDOMTree; + procedure Finish(); + end; + + +(************************************************************************************************************************* + Class definition for Toolpath +**************************************************************************************************************************) + + TLib3MFToolpath = class(TLib3MFResource) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetUnits(): Double; + function GetLayerCount(): Cardinal; + function GetProfileCount(): Cardinal; + function AddLayer(const AZMax: Cardinal; const APath: String; const AModelWriter: TLib3MFWriter): TLib3MFToolpathLayerData; + function GetLayerAttachment(const AIndex: Cardinal): TLib3MFAttachment; + function ReadLayerData(const AIndex: Cardinal): TLib3MFToolpathLayerReader; + function GetLayerPath(const AIndex: Cardinal): String; + function GetLayerZMax(const AIndex: Cardinal): Cardinal; + function GetLayerZ(const ALayerIndex: Cardinal): Cardinal; + function AddProfile(const AName: String): TLib3MFToolpathProfile; + function GetProfile(const AProfileIndex: Cardinal): TLib3MFToolpathProfile; + function GetProfileUUID(const AProfileUUID: String): TLib3MFToolpathProfile; + function GetCustomDataCount(): Cardinal; + function GetCustomData(const AIndex: Cardinal): TLib3MFCustomDOMTree; + procedure GetCustomDataName(const AIndex: Cardinal; out ANameSpace: String; out ADataName: String); + function HasUniqueCustomData(const ANameSpace: String; const ADataName: String): Boolean; + function FindUniqueCustomData(const ANameSpace: String; const ADataName: String): TLib3MFCustomDOMTree; + function AddCustomData(const ANameSpace: String; const ADataName: String): TLib3MFCustomDOMTree; + function ClearCustomData(): Cardinal; + function DeleteCustomData(const AData: TLib3MFCustomDOMTree): Boolean; + procedure RegisterCustomIntegerAttribute(const ANameSpace: String; const AAttributeName: String); + procedure RegisterCustomDoubleAttribute(const ANameSpace: String; const AAttributeName: String); + end; + + +(************************************************************************************************************************* + Class definition for ToolpathIterator +**************************************************************************************************************************) + + TLib3MFToolpathIterator = class(TLib3MFResourceIterator) + public + constructor Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + destructor Destroy; override; + function GetCurrentToolpath(): TLib3MFToolpath; + end; + + (************************************************************************************************************************* Class definition for SliceStack **************************************************************************************************************************) @@ -4924,6 +6697,7 @@ TLib3MFModel = class(TLib3MFBase) function GetTexture2DGroups(): TLib3MFTexture2DGroupIterator; function GetCompositeMaterials(): TLib3MFCompositeMaterialsIterator; function GetMultiPropertyGroups(): TLib3MFMultiPropertyGroupIterator; + function GetToolpaths(): TLib3MFToolpathIterator; function GetSliceStacks(): TLib3MFSliceStackIterator; function MergeToModel(): TLib3MFModel; function AddMeshObject(): TLib3MFMeshObject; @@ -4937,6 +6711,7 @@ TLib3MFModel = class(TLib3MFBase) function AddMultiPropertyGroup(): TLib3MFMultiPropertyGroup; function AddBuildItem(const AObject: TLib3MFObject; const ATransform: TLib3MFTransform): TLib3MFBuildItem; procedure RemoveBuildItem(const ABuildItemInstance: TLib3MFBuildItem); + function AddToolpath(const AUnitFactor: Double): TLib3MFToolpath; function GetMetaDataGroup(): TLib3MFMetaDataGroup; function AddAttachment(const AURI: String; const ARelationShipType: String): TLib3MFAttachment; procedure RemoveAttachment(const AAttachmentInstance: TLib3MFAttachment); @@ -4951,6 +6726,9 @@ TLib3MFModel = class(TLib3MFBase) procedure RemoveCustomContentType(const AExtension: String); procedure SetRandomNumberCallback(const ATheCallback: PLib3MF_RandomNumberCallback; const AUserData: Pointer); function GetKeyStore(): TLib3MFKeyStore; + function CreatePersistentSourceFromFile(const AFilename: String): TLib3MFPersistentReaderSource; + function CreatePersistentSourceFromBuffer(const ABuffer: TByteDynArray): TLib3MFPersistentReaderSource; + function CreatePersistentSourceFromCallback(const ATheReadCallback: PLib3MF_ReadCallback; const AStreamSize: QWord; const ATheSeekCallback: PLib3MF_SeekCallback; const AUserData: Pointer): TLib3MFPersistentReaderSource; end; (************************************************************************************************************************* @@ -4961,6 +6739,13 @@ TLib3MFWrapper = class(TObject) private FModule: HMODULE; FLib3MFBase_ClassTypeIdFunc: TLib3MFBase_ClassTypeIdFunc; + FLib3MFBinaryStream_GetBinaryPathFunc: TLib3MFBinaryStream_GetBinaryPathFunc; + FLib3MFBinaryStream_GetIndexPathFunc: TLib3MFBinaryStream_GetIndexPathFunc; + FLib3MFBinaryStream_GetUUIDFunc: TLib3MFBinaryStream_GetUUIDFunc; + FLib3MFBinaryStream_DisableDiscretizedArrayCompressionFunc: TLib3MFBinaryStream_DisableDiscretizedArrayCompressionFunc; + FLib3MFBinaryStream_EnableDiscretizedArrayCompressionFunc: TLib3MFBinaryStream_EnableDiscretizedArrayCompressionFunc; + FLib3MFBinaryStream_EnableLZMAFunc: TLib3MFBinaryStream_EnableLZMAFunc; + FLib3MFBinaryStream_DisableLZMAFunc: TLib3MFBinaryStream_DisableLZMAFunc; FLib3MFWriter_WriteToFileFunc: TLib3MFWriter_WriteToFileFunc; FLib3MFWriter_GetStreamSizeFunc: TLib3MFWriter_GetStreamSizeFunc; FLib3MFWriter_WriteToBufferFunc: TLib3MFWriter_WriteToBufferFunc; @@ -4974,6 +6759,13 @@ TLib3MFWrapper = class(TObject) FLib3MFWriter_GetWarningCountFunc: TLib3MFWriter_GetWarningCountFunc; FLib3MFWriter_AddKeyWrappingCallbackFunc: TLib3MFWriter_AddKeyWrappingCallbackFunc; FLib3MFWriter_SetContentEncryptionCallbackFunc: TLib3MFWriter_SetContentEncryptionCallbackFunc; + FLib3MFWriter_CreateBinaryStreamFunc: TLib3MFWriter_CreateBinaryStreamFunc; + FLib3MFWriter_AssignBinaryStreamFunc: TLib3MFWriter_AssignBinaryStreamFunc; + FLib3MFWriter_RegisterCustomNamespaceFunc: TLib3MFWriter_RegisterCustomNamespaceFunc; + FLib3MFPersistentReaderSource_GetSourceTypeFunc: TLib3MFPersistentReaderSource_GetSourceTypeFunc; + FLib3MFPersistentReaderSource_InvalidateSourceDataFunc: TLib3MFPersistentReaderSource_InvalidateSourceDataFunc; + FLib3MFPersistentReaderSource_SourceDataIsValidFunc: TLib3MFPersistentReaderSource_SourceDataIsValidFunc; + FLib3MFReader_ReadFromPersistentSourceFunc: TLib3MFReader_ReadFromPersistentSourceFunc; FLib3MFReader_ReadFromFileFunc: TLib3MFReader_ReadFromFileFunc; FLib3MFReader_ReadFromBufferFunc: TLib3MFReader_ReadFromBufferFunc; FLib3MFReader_ReadFromCallbackFunc: TLib3MFReader_ReadFromCallbackFunc; @@ -4998,6 +6790,51 @@ TLib3MFWrapper = class(TObject) FLib3MFResourceIterator_GetCurrentFunc: TLib3MFResourceIterator_GetCurrentFunc; FLib3MFResourceIterator_CloneFunc: TLib3MFResourceIterator_CloneFunc; FLib3MFResourceIterator_CountFunc: TLib3MFResourceIterator_CountFunc; + FLib3MFCustomXMLAttribute_GetNameFunc: TLib3MFCustomXMLAttribute_GetNameFunc; + FLib3MFCustomXMLAttribute_GetValueFunc: TLib3MFCustomXMLAttribute_GetValueFunc; + FLib3MFCustomXMLAttribute_IsValidIntegerFunc: TLib3MFCustomXMLAttribute_IsValidIntegerFunc; + FLib3MFCustomXMLAttribute_GetIntegerValueFunc: TLib3MFCustomXMLAttribute_GetIntegerValueFunc; + FLib3MFCustomXMLAttribute_IsValidDoubleFunc: TLib3MFCustomXMLAttribute_IsValidDoubleFunc; + FLib3MFCustomXMLAttribute_GetDoubleValueFunc: TLib3MFCustomXMLAttribute_GetDoubleValueFunc; + FLib3MFCustomXMLAttribute_IsValidBoolFunc: TLib3MFCustomXMLAttribute_IsValidBoolFunc; + FLib3MFCustomXMLAttribute_GetBoolValueFunc: TLib3MFCustomXMLAttribute_GetBoolValueFunc; + FLib3MFCustomXMLAttribute_SetValueFunc: TLib3MFCustomXMLAttribute_SetValueFunc; + FLib3MFCustomXMLAttribute_SetIntegerValueFunc: TLib3MFCustomXMLAttribute_SetIntegerValueFunc; + FLib3MFCustomXMLAttribute_SetDoubleValueFunc: TLib3MFCustomXMLAttribute_SetDoubleValueFunc; + FLib3MFCustomXMLAttribute_SetBoolValueFunc: TLib3MFCustomXMLAttribute_SetBoolValueFunc; + FLib3MFCustomXMLAttribute_RemoveFunc: TLib3MFCustomXMLAttribute_RemoveFunc; + FLib3MFCustomXMLNode_GetNameFunc: TLib3MFCustomXMLNode_GetNameFunc; + FLib3MFCustomXMLNode_GetNameSpaceFunc: TLib3MFCustomXMLNode_GetNameSpaceFunc; + FLib3MFCustomXMLNode_GetAttributeCountFunc: TLib3MFCustomXMLNode_GetAttributeCountFunc; + FLib3MFCustomXMLNode_GetAttributeFunc: TLib3MFCustomXMLNode_GetAttributeFunc; + FLib3MFCustomXMLNode_HasAttributeFunc: TLib3MFCustomXMLNode_HasAttributeFunc; + FLib3MFCustomXMLNode_FindAttributeFunc: TLib3MFCustomXMLNode_FindAttributeFunc; + FLib3MFCustomXMLNode_RemoveAttributeFunc: TLib3MFCustomXMLNode_RemoveAttributeFunc; + FLib3MFCustomXMLNode_RemoveAttributeByIndexFunc: TLib3MFCustomXMLNode_RemoveAttributeByIndexFunc; + FLib3MFCustomXMLNode_AddAttributeFunc: TLib3MFCustomXMLNode_AddAttributeFunc; + FLib3MFCustomXMLNode_AddIntegerAttributeFunc: TLib3MFCustomXMLNode_AddIntegerAttributeFunc; + FLib3MFCustomXMLNode_AddDoubleAttributeFunc: TLib3MFCustomXMLNode_AddDoubleAttributeFunc; + FLib3MFCustomXMLNode_AddBoolAttributeFunc: TLib3MFCustomXMLNode_AddBoolAttributeFunc; + FLib3MFCustomXMLNode_GetChildrenFunc: TLib3MFCustomXMLNode_GetChildrenFunc; + FLib3MFCustomXMLNode_CountChildrenByNameFunc: TLib3MFCustomXMLNode_CountChildrenByNameFunc; + FLib3MFCustomXMLNode_GetChildrenByNameFunc: TLib3MFCustomXMLNode_GetChildrenByNameFunc; + FLib3MFCustomXMLNode_HasChildFunc: TLib3MFCustomXMLNode_HasChildFunc; + FLib3MFCustomXMLNode_HasUniqueChildFunc: TLib3MFCustomXMLNode_HasUniqueChildFunc; + FLib3MFCustomXMLNode_FindChildFunc: TLib3MFCustomXMLNode_FindChildFunc; + FLib3MFCustomXMLNode_AddChildFunc: TLib3MFCustomXMLNode_AddChildFunc; + FLib3MFCustomXMLNode_RemoveChildFunc: TLib3MFCustomXMLNode_RemoveChildFunc; + FLib3MFCustomXMLNode_RemoveChildrenWithNameFunc: TLib3MFCustomXMLNode_RemoveChildrenWithNameFunc; + FLib3MFCustomXMLNode_RemoveFunc: TLib3MFCustomXMLNode_RemoveFunc; + FLib3MFCustomXMLNodes_GetNodeCountFunc: TLib3MFCustomXMLNodes_GetNodeCountFunc; + FLib3MFCustomXMLNodes_GetNodeFunc: TLib3MFCustomXMLNodes_GetNodeFunc; + FLib3MFCustomXMLNodes_CountNodesByNameFunc: TLib3MFCustomXMLNodes_CountNodesByNameFunc; + FLib3MFCustomXMLNodes_GetNodesByNameFunc: TLib3MFCustomXMLNodes_GetNodesByNameFunc; + FLib3MFCustomXMLNodes_HasNodeFunc: TLib3MFCustomXMLNodes_HasNodeFunc; + FLib3MFCustomXMLNodes_HasUniqueNodeFunc: TLib3MFCustomXMLNodes_HasUniqueNodeFunc; + FLib3MFCustomXMLNodes_FindNodeFunc: TLib3MFCustomXMLNodes_FindNodeFunc; + FLib3MFCustomDOMTree_GetNameSpaceFunc: TLib3MFCustomDOMTree_GetNameSpaceFunc; + FLib3MFCustomDOMTree_GetRootNodeFunc: TLib3MFCustomDOMTree_GetRootNodeFunc; + FLib3MFCustomDOMTree_SaveToStringFunc: TLib3MFCustomDOMTree_SaveToStringFunc; FLib3MFSliceStackIterator_GetCurrentSliceStackFunc: TLib3MFSliceStackIterator_GetCurrentSliceStackFunc; FLib3MFObjectIterator_GetCurrentObjectFunc: TLib3MFObjectIterator_GetCurrentObjectFunc; FLib3MFMeshObjectIterator_GetCurrentMeshObjectFunc: TLib3MFMeshObjectIterator_GetCurrentMeshObjectFunc; @@ -5190,6 +7027,78 @@ TLib3MFWrapper = class(TObject) FLib3MFSlice_GetPolygonIndicesFunc: TLib3MFSlice_GetPolygonIndicesFunc; FLib3MFSlice_GetPolygonIndexCountFunc: TLib3MFSlice_GetPolygonIndexCountFunc; FLib3MFSlice_GetZTopFunc: TLib3MFSlice_GetZTopFunc; + FLib3MFToolpathProfile_GetUUIDFunc: TLib3MFToolpathProfile_GetUUIDFunc; + FLib3MFToolpathProfile_GetNameFunc: TLib3MFToolpathProfile_GetNameFunc; + FLib3MFToolpathProfile_GetParameterCountFunc: TLib3MFToolpathProfile_GetParameterCountFunc; + FLib3MFToolpathProfile_GetParameterNameFunc: TLib3MFToolpathProfile_GetParameterNameFunc; + FLib3MFToolpathProfile_GetParameterNameSpaceFunc: TLib3MFToolpathProfile_GetParameterNameSpaceFunc; + FLib3MFToolpathProfile_HasParameterValueFunc: TLib3MFToolpathProfile_HasParameterValueFunc; + FLib3MFToolpathProfile_GetParameterValueFunc: TLib3MFToolpathProfile_GetParameterValueFunc; + FLib3MFToolpathProfile_GetParameterValueDefFunc: TLib3MFToolpathProfile_GetParameterValueDefFunc; + FLib3MFToolpathProfile_GetParameterDoubleValueFunc: TLib3MFToolpathProfile_GetParameterDoubleValueFunc; + FLib3MFToolpathProfile_GetParameterDoubleValueDefFunc: TLib3MFToolpathProfile_GetParameterDoubleValueDefFunc; + FLib3MFToolpathProfile_GetParameterIntegerValueFunc: TLib3MFToolpathProfile_GetParameterIntegerValueFunc; + FLib3MFToolpathProfile_GetParameterIntegerValueDefFunc: TLib3MFToolpathProfile_GetParameterIntegerValueDefFunc; + FLib3MFToolpathProfile_GetParameterBoolValueFunc: TLib3MFToolpathProfile_GetParameterBoolValueFunc; + FLib3MFToolpathProfile_GetParameterBoolValueDefFunc: TLib3MFToolpathProfile_GetParameterBoolValueDefFunc; + FLib3MFToolpathProfile_SetNameFunc: TLib3MFToolpathProfile_SetNameFunc; + FLib3MFToolpathProfile_SetParameterValueFunc: TLib3MFToolpathProfile_SetParameterValueFunc; + FLib3MFToolpathProfile_SetParameterDoubleValueFunc: TLib3MFToolpathProfile_SetParameterDoubleValueFunc; + FLib3MFToolpathProfile_SetParameterIntegerValueFunc: TLib3MFToolpathProfile_SetParameterIntegerValueFunc; + FLib3MFToolpathProfile_SetParameterBoolValueFunc: TLib3MFToolpathProfile_SetParameterBoolValueFunc; + FLib3MFToolpathLayerReader_GetLayerDataUUIDFunc: TLib3MFToolpathLayerReader_GetLayerDataUUIDFunc; + FLib3MFToolpathLayerReader_GetSegmentCountFunc: TLib3MFToolpathLayerReader_GetSegmentCountFunc; + FLib3MFToolpathLayerReader_GetSegmentInfoFunc: TLib3MFToolpathLayerReader_GetSegmentInfoFunc; + FLib3MFToolpathLayerReader_GetSegmentProfileFunc: TLib3MFToolpathLayerReader_GetSegmentProfileFunc; + FLib3MFToolpathLayerReader_GetSegmentProfileUUIDFunc: TLib3MFToolpathLayerReader_GetSegmentProfileUUIDFunc; + FLib3MFToolpathLayerReader_GetSegmentPartFunc: TLib3MFToolpathLayerReader_GetSegmentPartFunc; + FLib3MFToolpathLayerReader_GetSegmentPartUUIDFunc: TLib3MFToolpathLayerReader_GetSegmentPartUUIDFunc; + FLib3MFToolpathLayerReader_GetSegmentLocalPartIDFunc: TLib3MFToolpathLayerReader_GetSegmentLocalPartIDFunc; + FLib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDFunc: TLib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDFunc; + FLib3MFToolpathLayerReader_GetSegmentPointDataFunc: TLib3MFToolpathLayerReader_GetSegmentPointDataFunc; + FLib3MFToolpathLayerReader_FindAttributeInfoByNameFunc: TLib3MFToolpathLayerReader_FindAttributeInfoByNameFunc; + FLib3MFToolpathLayerReader_FindAttributeIDByNameFunc: TLib3MFToolpathLayerReader_FindAttributeIDByNameFunc; + FLib3MFToolpathLayerReader_FindAttributeValueByNameFunc: TLib3MFToolpathLayerReader_FindAttributeValueByNameFunc; + FLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByIDFunc: TLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByIDFunc; + FLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByNameFunc: TLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByNameFunc; + FLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByIDFunc: TLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByIDFunc; + FLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByNameFunc: TLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByNameFunc; + FLib3MFToolpathLayerReader_GetCustomDataCountFunc: TLib3MFToolpathLayerReader_GetCustomDataCountFunc; + FLib3MFToolpathLayerReader_GetCustomDataFunc: TLib3MFToolpathLayerReader_GetCustomDataFunc; + FLib3MFToolpathLayerReader_GetCustomDataNameFunc: TLib3MFToolpathLayerReader_GetCustomDataNameFunc; + FLib3MFToolpathLayerData_GetLayerDataUUIDFunc: TLib3MFToolpathLayerData_GetLayerDataUUIDFunc; + FLib3MFToolpathLayerData_RegisterProfileFunc: TLib3MFToolpathLayerData_RegisterProfileFunc; + FLib3MFToolpathLayerData_RegisterBuildItemFunc: TLib3MFToolpathLayerData_RegisterBuildItemFunc; + FLib3MFToolpathLayerData_SetSegmentAttributeFunc: TLib3MFToolpathLayerData_SetSegmentAttributeFunc; + FLib3MFToolpathLayerData_ClearSegmentAttributesFunc: TLib3MFToolpathLayerData_ClearSegmentAttributesFunc; + FLib3MFToolpathLayerData_WriteHatchDataFunc: TLib3MFToolpathLayerData_WriteHatchDataFunc; + FLib3MFToolpathLayerData_WriteLoopFunc: TLib3MFToolpathLayerData_WriteLoopFunc; + FLib3MFToolpathLayerData_WritePolylineFunc: TLib3MFToolpathLayerData_WritePolylineFunc; + FLib3MFToolpathLayerData_AddCustomDataFunc: TLib3MFToolpathLayerData_AddCustomDataFunc; + FLib3MFToolpathLayerData_FinishFunc: TLib3MFToolpathLayerData_FinishFunc; + FLib3MFToolpath_GetUnitsFunc: TLib3MFToolpath_GetUnitsFunc; + FLib3MFToolpath_GetLayerCountFunc: TLib3MFToolpath_GetLayerCountFunc; + FLib3MFToolpath_GetProfileCountFunc: TLib3MFToolpath_GetProfileCountFunc; + FLib3MFToolpath_AddLayerFunc: TLib3MFToolpath_AddLayerFunc; + FLib3MFToolpath_GetLayerAttachmentFunc: TLib3MFToolpath_GetLayerAttachmentFunc; + FLib3MFToolpath_ReadLayerDataFunc: TLib3MFToolpath_ReadLayerDataFunc; + FLib3MFToolpath_GetLayerPathFunc: TLib3MFToolpath_GetLayerPathFunc; + FLib3MFToolpath_GetLayerZMaxFunc: TLib3MFToolpath_GetLayerZMaxFunc; + FLib3MFToolpath_GetLayerZFunc: TLib3MFToolpath_GetLayerZFunc; + FLib3MFToolpath_AddProfileFunc: TLib3MFToolpath_AddProfileFunc; + FLib3MFToolpath_GetProfileFunc: TLib3MFToolpath_GetProfileFunc; + FLib3MFToolpath_GetProfileUUIDFunc: TLib3MFToolpath_GetProfileUUIDFunc; + FLib3MFToolpath_GetCustomDataCountFunc: TLib3MFToolpath_GetCustomDataCountFunc; + FLib3MFToolpath_GetCustomDataFunc: TLib3MFToolpath_GetCustomDataFunc; + FLib3MFToolpath_GetCustomDataNameFunc: TLib3MFToolpath_GetCustomDataNameFunc; + FLib3MFToolpath_HasUniqueCustomDataFunc: TLib3MFToolpath_HasUniqueCustomDataFunc; + FLib3MFToolpath_FindUniqueCustomDataFunc: TLib3MFToolpath_FindUniqueCustomDataFunc; + FLib3MFToolpath_AddCustomDataFunc: TLib3MFToolpath_AddCustomDataFunc; + FLib3MFToolpath_ClearCustomDataFunc: TLib3MFToolpath_ClearCustomDataFunc; + FLib3MFToolpath_DeleteCustomDataFunc: TLib3MFToolpath_DeleteCustomDataFunc; + FLib3MFToolpath_RegisterCustomIntegerAttributeFunc: TLib3MFToolpath_RegisterCustomIntegerAttributeFunc; + FLib3MFToolpath_RegisterCustomDoubleAttributeFunc: TLib3MFToolpath_RegisterCustomDoubleAttributeFunc; + FLib3MFToolpathIterator_GetCurrentToolpathFunc: TLib3MFToolpathIterator_GetCurrentToolpathFunc; FLib3MFSliceStack_GetBottomZFunc: TLib3MFSliceStack_GetBottomZFunc; FLib3MFSliceStack_GetSliceCountFunc: TLib3MFSliceStack_GetSliceCountFunc; FLib3MFSliceStack_GetSliceFunc: TLib3MFSliceStack_GetSliceFunc; @@ -5273,6 +7182,7 @@ TLib3MFWrapper = class(TObject) FLib3MFModel_GetTexture2DGroupsFunc: TLib3MFModel_GetTexture2DGroupsFunc; FLib3MFModel_GetCompositeMaterialsFunc: TLib3MFModel_GetCompositeMaterialsFunc; FLib3MFModel_GetMultiPropertyGroupsFunc: TLib3MFModel_GetMultiPropertyGroupsFunc; + FLib3MFModel_GetToolpathsFunc: TLib3MFModel_GetToolpathsFunc; FLib3MFModel_GetSliceStacksFunc: TLib3MFModel_GetSliceStacksFunc; FLib3MFModel_MergeToModelFunc: TLib3MFModel_MergeToModelFunc; FLib3MFModel_AddMeshObjectFunc: TLib3MFModel_AddMeshObjectFunc; @@ -5286,6 +7196,7 @@ TLib3MFWrapper = class(TObject) FLib3MFModel_AddMultiPropertyGroupFunc: TLib3MFModel_AddMultiPropertyGroupFunc; FLib3MFModel_AddBuildItemFunc: TLib3MFModel_AddBuildItemFunc; FLib3MFModel_RemoveBuildItemFunc: TLib3MFModel_RemoveBuildItemFunc; + FLib3MFModel_AddToolpathFunc: TLib3MFModel_AddToolpathFunc; FLib3MFModel_GetMetaDataGroupFunc: TLib3MFModel_GetMetaDataGroupFunc; FLib3MFModel_AddAttachmentFunc: TLib3MFModel_AddAttachmentFunc; FLib3MFModel_RemoveAttachmentFunc: TLib3MFModel_RemoveAttachmentFunc; @@ -5300,6 +7211,9 @@ TLib3MFWrapper = class(TObject) FLib3MFModel_RemoveCustomContentTypeFunc: TLib3MFModel_RemoveCustomContentTypeFunc; FLib3MFModel_SetRandomNumberCallbackFunc: TLib3MFModel_SetRandomNumberCallbackFunc; FLib3MFModel_GetKeyStoreFunc: TLib3MFModel_GetKeyStoreFunc; + FLib3MFModel_CreatePersistentSourceFromFileFunc: TLib3MFModel_CreatePersistentSourceFromFileFunc; + FLib3MFModel_CreatePersistentSourceFromBufferFunc: TLib3MFModel_CreatePersistentSourceFromBufferFunc; + FLib3MFModel_CreatePersistentSourceFromCallbackFunc: TLib3MFModel_CreatePersistentSourceFromCallbackFunc; FLib3MFGetLibraryVersionFunc: TLib3MFGetLibraryVersionFunc; FLib3MFGetPrereleaseInformationFunc: TLib3MFGetPrereleaseInformationFunc; FLib3MFGetBuildInformationFunc: TLib3MFGetBuildInformationFunc; @@ -5330,6 +7244,13 @@ TLib3MFWrapper = class(TObject) protected property Lib3MFBase_ClassTypeIdFunc: TLib3MFBase_ClassTypeIdFunc read FLib3MFBase_ClassTypeIdFunc; + property Lib3MFBinaryStream_GetBinaryPathFunc: TLib3MFBinaryStream_GetBinaryPathFunc read FLib3MFBinaryStream_GetBinaryPathFunc; + property Lib3MFBinaryStream_GetIndexPathFunc: TLib3MFBinaryStream_GetIndexPathFunc read FLib3MFBinaryStream_GetIndexPathFunc; + property Lib3MFBinaryStream_GetUUIDFunc: TLib3MFBinaryStream_GetUUIDFunc read FLib3MFBinaryStream_GetUUIDFunc; + property Lib3MFBinaryStream_DisableDiscretizedArrayCompressionFunc: TLib3MFBinaryStream_DisableDiscretizedArrayCompressionFunc read FLib3MFBinaryStream_DisableDiscretizedArrayCompressionFunc; + property Lib3MFBinaryStream_EnableDiscretizedArrayCompressionFunc: TLib3MFBinaryStream_EnableDiscretizedArrayCompressionFunc read FLib3MFBinaryStream_EnableDiscretizedArrayCompressionFunc; + property Lib3MFBinaryStream_EnableLZMAFunc: TLib3MFBinaryStream_EnableLZMAFunc read FLib3MFBinaryStream_EnableLZMAFunc; + property Lib3MFBinaryStream_DisableLZMAFunc: TLib3MFBinaryStream_DisableLZMAFunc read FLib3MFBinaryStream_DisableLZMAFunc; property Lib3MFWriter_WriteToFileFunc: TLib3MFWriter_WriteToFileFunc read FLib3MFWriter_WriteToFileFunc; property Lib3MFWriter_GetStreamSizeFunc: TLib3MFWriter_GetStreamSizeFunc read FLib3MFWriter_GetStreamSizeFunc; property Lib3MFWriter_WriteToBufferFunc: TLib3MFWriter_WriteToBufferFunc read FLib3MFWriter_WriteToBufferFunc; @@ -5343,6 +7264,13 @@ TLib3MFWrapper = class(TObject) property Lib3MFWriter_GetWarningCountFunc: TLib3MFWriter_GetWarningCountFunc read FLib3MFWriter_GetWarningCountFunc; property Lib3MFWriter_AddKeyWrappingCallbackFunc: TLib3MFWriter_AddKeyWrappingCallbackFunc read FLib3MFWriter_AddKeyWrappingCallbackFunc; property Lib3MFWriter_SetContentEncryptionCallbackFunc: TLib3MFWriter_SetContentEncryptionCallbackFunc read FLib3MFWriter_SetContentEncryptionCallbackFunc; + property Lib3MFWriter_CreateBinaryStreamFunc: TLib3MFWriter_CreateBinaryStreamFunc read FLib3MFWriter_CreateBinaryStreamFunc; + property Lib3MFWriter_AssignBinaryStreamFunc: TLib3MFWriter_AssignBinaryStreamFunc read FLib3MFWriter_AssignBinaryStreamFunc; + property Lib3MFWriter_RegisterCustomNamespaceFunc: TLib3MFWriter_RegisterCustomNamespaceFunc read FLib3MFWriter_RegisterCustomNamespaceFunc; + property Lib3MFPersistentReaderSource_GetSourceTypeFunc: TLib3MFPersistentReaderSource_GetSourceTypeFunc read FLib3MFPersistentReaderSource_GetSourceTypeFunc; + property Lib3MFPersistentReaderSource_InvalidateSourceDataFunc: TLib3MFPersistentReaderSource_InvalidateSourceDataFunc read FLib3MFPersistentReaderSource_InvalidateSourceDataFunc; + property Lib3MFPersistentReaderSource_SourceDataIsValidFunc: TLib3MFPersistentReaderSource_SourceDataIsValidFunc read FLib3MFPersistentReaderSource_SourceDataIsValidFunc; + property Lib3MFReader_ReadFromPersistentSourceFunc: TLib3MFReader_ReadFromPersistentSourceFunc read FLib3MFReader_ReadFromPersistentSourceFunc; property Lib3MFReader_ReadFromFileFunc: TLib3MFReader_ReadFromFileFunc read FLib3MFReader_ReadFromFileFunc; property Lib3MFReader_ReadFromBufferFunc: TLib3MFReader_ReadFromBufferFunc read FLib3MFReader_ReadFromBufferFunc; property Lib3MFReader_ReadFromCallbackFunc: TLib3MFReader_ReadFromCallbackFunc read FLib3MFReader_ReadFromCallbackFunc; @@ -5367,6 +7295,51 @@ TLib3MFWrapper = class(TObject) property Lib3MFResourceIterator_GetCurrentFunc: TLib3MFResourceIterator_GetCurrentFunc read FLib3MFResourceIterator_GetCurrentFunc; property Lib3MFResourceIterator_CloneFunc: TLib3MFResourceIterator_CloneFunc read FLib3MFResourceIterator_CloneFunc; property Lib3MFResourceIterator_CountFunc: TLib3MFResourceIterator_CountFunc read FLib3MFResourceIterator_CountFunc; + property Lib3MFCustomXMLAttribute_GetNameFunc: TLib3MFCustomXMLAttribute_GetNameFunc read FLib3MFCustomXMLAttribute_GetNameFunc; + property Lib3MFCustomXMLAttribute_GetValueFunc: TLib3MFCustomXMLAttribute_GetValueFunc read FLib3MFCustomXMLAttribute_GetValueFunc; + property Lib3MFCustomXMLAttribute_IsValidIntegerFunc: TLib3MFCustomXMLAttribute_IsValidIntegerFunc read FLib3MFCustomXMLAttribute_IsValidIntegerFunc; + property Lib3MFCustomXMLAttribute_GetIntegerValueFunc: TLib3MFCustomXMLAttribute_GetIntegerValueFunc read FLib3MFCustomXMLAttribute_GetIntegerValueFunc; + property Lib3MFCustomXMLAttribute_IsValidDoubleFunc: TLib3MFCustomXMLAttribute_IsValidDoubleFunc read FLib3MFCustomXMLAttribute_IsValidDoubleFunc; + property Lib3MFCustomXMLAttribute_GetDoubleValueFunc: TLib3MFCustomXMLAttribute_GetDoubleValueFunc read FLib3MFCustomXMLAttribute_GetDoubleValueFunc; + property Lib3MFCustomXMLAttribute_IsValidBoolFunc: TLib3MFCustomXMLAttribute_IsValidBoolFunc read FLib3MFCustomXMLAttribute_IsValidBoolFunc; + property Lib3MFCustomXMLAttribute_GetBoolValueFunc: TLib3MFCustomXMLAttribute_GetBoolValueFunc read FLib3MFCustomXMLAttribute_GetBoolValueFunc; + property Lib3MFCustomXMLAttribute_SetValueFunc: TLib3MFCustomXMLAttribute_SetValueFunc read FLib3MFCustomXMLAttribute_SetValueFunc; + property Lib3MFCustomXMLAttribute_SetIntegerValueFunc: TLib3MFCustomXMLAttribute_SetIntegerValueFunc read FLib3MFCustomXMLAttribute_SetIntegerValueFunc; + property Lib3MFCustomXMLAttribute_SetDoubleValueFunc: TLib3MFCustomXMLAttribute_SetDoubleValueFunc read FLib3MFCustomXMLAttribute_SetDoubleValueFunc; + property Lib3MFCustomXMLAttribute_SetBoolValueFunc: TLib3MFCustomXMLAttribute_SetBoolValueFunc read FLib3MFCustomXMLAttribute_SetBoolValueFunc; + property Lib3MFCustomXMLAttribute_RemoveFunc: TLib3MFCustomXMLAttribute_RemoveFunc read FLib3MFCustomXMLAttribute_RemoveFunc; + property Lib3MFCustomXMLNode_GetNameFunc: TLib3MFCustomXMLNode_GetNameFunc read FLib3MFCustomXMLNode_GetNameFunc; + property Lib3MFCustomXMLNode_GetNameSpaceFunc: TLib3MFCustomXMLNode_GetNameSpaceFunc read FLib3MFCustomXMLNode_GetNameSpaceFunc; + property Lib3MFCustomXMLNode_GetAttributeCountFunc: TLib3MFCustomXMLNode_GetAttributeCountFunc read FLib3MFCustomXMLNode_GetAttributeCountFunc; + property Lib3MFCustomXMLNode_GetAttributeFunc: TLib3MFCustomXMLNode_GetAttributeFunc read FLib3MFCustomXMLNode_GetAttributeFunc; + property Lib3MFCustomXMLNode_HasAttributeFunc: TLib3MFCustomXMLNode_HasAttributeFunc read FLib3MFCustomXMLNode_HasAttributeFunc; + property Lib3MFCustomXMLNode_FindAttributeFunc: TLib3MFCustomXMLNode_FindAttributeFunc read FLib3MFCustomXMLNode_FindAttributeFunc; + property Lib3MFCustomXMLNode_RemoveAttributeFunc: TLib3MFCustomXMLNode_RemoveAttributeFunc read FLib3MFCustomXMLNode_RemoveAttributeFunc; + property Lib3MFCustomXMLNode_RemoveAttributeByIndexFunc: TLib3MFCustomXMLNode_RemoveAttributeByIndexFunc read FLib3MFCustomXMLNode_RemoveAttributeByIndexFunc; + property Lib3MFCustomXMLNode_AddAttributeFunc: TLib3MFCustomXMLNode_AddAttributeFunc read FLib3MFCustomXMLNode_AddAttributeFunc; + property Lib3MFCustomXMLNode_AddIntegerAttributeFunc: TLib3MFCustomXMLNode_AddIntegerAttributeFunc read FLib3MFCustomXMLNode_AddIntegerAttributeFunc; + property Lib3MFCustomXMLNode_AddDoubleAttributeFunc: TLib3MFCustomXMLNode_AddDoubleAttributeFunc read FLib3MFCustomXMLNode_AddDoubleAttributeFunc; + property Lib3MFCustomXMLNode_AddBoolAttributeFunc: TLib3MFCustomXMLNode_AddBoolAttributeFunc read FLib3MFCustomXMLNode_AddBoolAttributeFunc; + property Lib3MFCustomXMLNode_GetChildrenFunc: TLib3MFCustomXMLNode_GetChildrenFunc read FLib3MFCustomXMLNode_GetChildrenFunc; + property Lib3MFCustomXMLNode_CountChildrenByNameFunc: TLib3MFCustomXMLNode_CountChildrenByNameFunc read FLib3MFCustomXMLNode_CountChildrenByNameFunc; + property Lib3MFCustomXMLNode_GetChildrenByNameFunc: TLib3MFCustomXMLNode_GetChildrenByNameFunc read FLib3MFCustomXMLNode_GetChildrenByNameFunc; + property Lib3MFCustomXMLNode_HasChildFunc: TLib3MFCustomXMLNode_HasChildFunc read FLib3MFCustomXMLNode_HasChildFunc; + property Lib3MFCustomXMLNode_HasUniqueChildFunc: TLib3MFCustomXMLNode_HasUniqueChildFunc read FLib3MFCustomXMLNode_HasUniqueChildFunc; + property Lib3MFCustomXMLNode_FindChildFunc: TLib3MFCustomXMLNode_FindChildFunc read FLib3MFCustomXMLNode_FindChildFunc; + property Lib3MFCustomXMLNode_AddChildFunc: TLib3MFCustomXMLNode_AddChildFunc read FLib3MFCustomXMLNode_AddChildFunc; + property Lib3MFCustomXMLNode_RemoveChildFunc: TLib3MFCustomXMLNode_RemoveChildFunc read FLib3MFCustomXMLNode_RemoveChildFunc; + property Lib3MFCustomXMLNode_RemoveChildrenWithNameFunc: TLib3MFCustomXMLNode_RemoveChildrenWithNameFunc read FLib3MFCustomXMLNode_RemoveChildrenWithNameFunc; + property Lib3MFCustomXMLNode_RemoveFunc: TLib3MFCustomXMLNode_RemoveFunc read FLib3MFCustomXMLNode_RemoveFunc; + property Lib3MFCustomXMLNodes_GetNodeCountFunc: TLib3MFCustomXMLNodes_GetNodeCountFunc read FLib3MFCustomXMLNodes_GetNodeCountFunc; + property Lib3MFCustomXMLNodes_GetNodeFunc: TLib3MFCustomXMLNodes_GetNodeFunc read FLib3MFCustomXMLNodes_GetNodeFunc; + property Lib3MFCustomXMLNodes_CountNodesByNameFunc: TLib3MFCustomXMLNodes_CountNodesByNameFunc read FLib3MFCustomXMLNodes_CountNodesByNameFunc; + property Lib3MFCustomXMLNodes_GetNodesByNameFunc: TLib3MFCustomXMLNodes_GetNodesByNameFunc read FLib3MFCustomXMLNodes_GetNodesByNameFunc; + property Lib3MFCustomXMLNodes_HasNodeFunc: TLib3MFCustomXMLNodes_HasNodeFunc read FLib3MFCustomXMLNodes_HasNodeFunc; + property Lib3MFCustomXMLNodes_HasUniqueNodeFunc: TLib3MFCustomXMLNodes_HasUniqueNodeFunc read FLib3MFCustomXMLNodes_HasUniqueNodeFunc; + property Lib3MFCustomXMLNodes_FindNodeFunc: TLib3MFCustomXMLNodes_FindNodeFunc read FLib3MFCustomXMLNodes_FindNodeFunc; + property Lib3MFCustomDOMTree_GetNameSpaceFunc: TLib3MFCustomDOMTree_GetNameSpaceFunc read FLib3MFCustomDOMTree_GetNameSpaceFunc; + property Lib3MFCustomDOMTree_GetRootNodeFunc: TLib3MFCustomDOMTree_GetRootNodeFunc read FLib3MFCustomDOMTree_GetRootNodeFunc; + property Lib3MFCustomDOMTree_SaveToStringFunc: TLib3MFCustomDOMTree_SaveToStringFunc read FLib3MFCustomDOMTree_SaveToStringFunc; property Lib3MFSliceStackIterator_GetCurrentSliceStackFunc: TLib3MFSliceStackIterator_GetCurrentSliceStackFunc read FLib3MFSliceStackIterator_GetCurrentSliceStackFunc; property Lib3MFObjectIterator_GetCurrentObjectFunc: TLib3MFObjectIterator_GetCurrentObjectFunc read FLib3MFObjectIterator_GetCurrentObjectFunc; property Lib3MFMeshObjectIterator_GetCurrentMeshObjectFunc: TLib3MFMeshObjectIterator_GetCurrentMeshObjectFunc read FLib3MFMeshObjectIterator_GetCurrentMeshObjectFunc; @@ -5559,6 +7532,78 @@ TLib3MFWrapper = class(TObject) property Lib3MFSlice_GetPolygonIndicesFunc: TLib3MFSlice_GetPolygonIndicesFunc read FLib3MFSlice_GetPolygonIndicesFunc; property Lib3MFSlice_GetPolygonIndexCountFunc: TLib3MFSlice_GetPolygonIndexCountFunc read FLib3MFSlice_GetPolygonIndexCountFunc; property Lib3MFSlice_GetZTopFunc: TLib3MFSlice_GetZTopFunc read FLib3MFSlice_GetZTopFunc; + property Lib3MFToolpathProfile_GetUUIDFunc: TLib3MFToolpathProfile_GetUUIDFunc read FLib3MFToolpathProfile_GetUUIDFunc; + property Lib3MFToolpathProfile_GetNameFunc: TLib3MFToolpathProfile_GetNameFunc read FLib3MFToolpathProfile_GetNameFunc; + property Lib3MFToolpathProfile_GetParameterCountFunc: TLib3MFToolpathProfile_GetParameterCountFunc read FLib3MFToolpathProfile_GetParameterCountFunc; + property Lib3MFToolpathProfile_GetParameterNameFunc: TLib3MFToolpathProfile_GetParameterNameFunc read FLib3MFToolpathProfile_GetParameterNameFunc; + property Lib3MFToolpathProfile_GetParameterNameSpaceFunc: TLib3MFToolpathProfile_GetParameterNameSpaceFunc read FLib3MFToolpathProfile_GetParameterNameSpaceFunc; + property Lib3MFToolpathProfile_HasParameterValueFunc: TLib3MFToolpathProfile_HasParameterValueFunc read FLib3MFToolpathProfile_HasParameterValueFunc; + property Lib3MFToolpathProfile_GetParameterValueFunc: TLib3MFToolpathProfile_GetParameterValueFunc read FLib3MFToolpathProfile_GetParameterValueFunc; + property Lib3MFToolpathProfile_GetParameterValueDefFunc: TLib3MFToolpathProfile_GetParameterValueDefFunc read FLib3MFToolpathProfile_GetParameterValueDefFunc; + property Lib3MFToolpathProfile_GetParameterDoubleValueFunc: TLib3MFToolpathProfile_GetParameterDoubleValueFunc read FLib3MFToolpathProfile_GetParameterDoubleValueFunc; + property Lib3MFToolpathProfile_GetParameterDoubleValueDefFunc: TLib3MFToolpathProfile_GetParameterDoubleValueDefFunc read FLib3MFToolpathProfile_GetParameterDoubleValueDefFunc; + property Lib3MFToolpathProfile_GetParameterIntegerValueFunc: TLib3MFToolpathProfile_GetParameterIntegerValueFunc read FLib3MFToolpathProfile_GetParameterIntegerValueFunc; + property Lib3MFToolpathProfile_GetParameterIntegerValueDefFunc: TLib3MFToolpathProfile_GetParameterIntegerValueDefFunc read FLib3MFToolpathProfile_GetParameterIntegerValueDefFunc; + property Lib3MFToolpathProfile_GetParameterBoolValueFunc: TLib3MFToolpathProfile_GetParameterBoolValueFunc read FLib3MFToolpathProfile_GetParameterBoolValueFunc; + property Lib3MFToolpathProfile_GetParameterBoolValueDefFunc: TLib3MFToolpathProfile_GetParameterBoolValueDefFunc read FLib3MFToolpathProfile_GetParameterBoolValueDefFunc; + property Lib3MFToolpathProfile_SetNameFunc: TLib3MFToolpathProfile_SetNameFunc read FLib3MFToolpathProfile_SetNameFunc; + property Lib3MFToolpathProfile_SetParameterValueFunc: TLib3MFToolpathProfile_SetParameterValueFunc read FLib3MFToolpathProfile_SetParameterValueFunc; + property Lib3MFToolpathProfile_SetParameterDoubleValueFunc: TLib3MFToolpathProfile_SetParameterDoubleValueFunc read FLib3MFToolpathProfile_SetParameterDoubleValueFunc; + property Lib3MFToolpathProfile_SetParameterIntegerValueFunc: TLib3MFToolpathProfile_SetParameterIntegerValueFunc read FLib3MFToolpathProfile_SetParameterIntegerValueFunc; + property Lib3MFToolpathProfile_SetParameterBoolValueFunc: TLib3MFToolpathProfile_SetParameterBoolValueFunc read FLib3MFToolpathProfile_SetParameterBoolValueFunc; + property Lib3MFToolpathLayerReader_GetLayerDataUUIDFunc: TLib3MFToolpathLayerReader_GetLayerDataUUIDFunc read FLib3MFToolpathLayerReader_GetLayerDataUUIDFunc; + property Lib3MFToolpathLayerReader_GetSegmentCountFunc: TLib3MFToolpathLayerReader_GetSegmentCountFunc read FLib3MFToolpathLayerReader_GetSegmentCountFunc; + property Lib3MFToolpathLayerReader_GetSegmentInfoFunc: TLib3MFToolpathLayerReader_GetSegmentInfoFunc read FLib3MFToolpathLayerReader_GetSegmentInfoFunc; + property Lib3MFToolpathLayerReader_GetSegmentProfileFunc: TLib3MFToolpathLayerReader_GetSegmentProfileFunc read FLib3MFToolpathLayerReader_GetSegmentProfileFunc; + property Lib3MFToolpathLayerReader_GetSegmentProfileUUIDFunc: TLib3MFToolpathLayerReader_GetSegmentProfileUUIDFunc read FLib3MFToolpathLayerReader_GetSegmentProfileUUIDFunc; + property Lib3MFToolpathLayerReader_GetSegmentPartFunc: TLib3MFToolpathLayerReader_GetSegmentPartFunc read FLib3MFToolpathLayerReader_GetSegmentPartFunc; + property Lib3MFToolpathLayerReader_GetSegmentPartUUIDFunc: TLib3MFToolpathLayerReader_GetSegmentPartUUIDFunc read FLib3MFToolpathLayerReader_GetSegmentPartUUIDFunc; + property Lib3MFToolpathLayerReader_GetSegmentLocalPartIDFunc: TLib3MFToolpathLayerReader_GetSegmentLocalPartIDFunc read FLib3MFToolpathLayerReader_GetSegmentLocalPartIDFunc; + property Lib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDFunc: TLib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDFunc read FLib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDFunc; + property Lib3MFToolpathLayerReader_GetSegmentPointDataFunc: TLib3MFToolpathLayerReader_GetSegmentPointDataFunc read FLib3MFToolpathLayerReader_GetSegmentPointDataFunc; + property Lib3MFToolpathLayerReader_FindAttributeInfoByNameFunc: TLib3MFToolpathLayerReader_FindAttributeInfoByNameFunc read FLib3MFToolpathLayerReader_FindAttributeInfoByNameFunc; + property Lib3MFToolpathLayerReader_FindAttributeIDByNameFunc: TLib3MFToolpathLayerReader_FindAttributeIDByNameFunc read FLib3MFToolpathLayerReader_FindAttributeIDByNameFunc; + property Lib3MFToolpathLayerReader_FindAttributeValueByNameFunc: TLib3MFToolpathLayerReader_FindAttributeValueByNameFunc read FLib3MFToolpathLayerReader_FindAttributeValueByNameFunc; + property Lib3MFToolpathLayerReader_GetSegmentIntegerAttributeByIDFunc: TLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByIDFunc read FLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByIDFunc; + property Lib3MFToolpathLayerReader_GetSegmentIntegerAttributeByNameFunc: TLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByNameFunc read FLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByNameFunc; + property Lib3MFToolpathLayerReader_GetSegmentDoubleAttributeByIDFunc: TLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByIDFunc read FLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByIDFunc; + property Lib3MFToolpathLayerReader_GetSegmentDoubleAttributeByNameFunc: TLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByNameFunc read FLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByNameFunc; + property Lib3MFToolpathLayerReader_GetCustomDataCountFunc: TLib3MFToolpathLayerReader_GetCustomDataCountFunc read FLib3MFToolpathLayerReader_GetCustomDataCountFunc; + property Lib3MFToolpathLayerReader_GetCustomDataFunc: TLib3MFToolpathLayerReader_GetCustomDataFunc read FLib3MFToolpathLayerReader_GetCustomDataFunc; + property Lib3MFToolpathLayerReader_GetCustomDataNameFunc: TLib3MFToolpathLayerReader_GetCustomDataNameFunc read FLib3MFToolpathLayerReader_GetCustomDataNameFunc; + property Lib3MFToolpathLayerData_GetLayerDataUUIDFunc: TLib3MFToolpathLayerData_GetLayerDataUUIDFunc read FLib3MFToolpathLayerData_GetLayerDataUUIDFunc; + property Lib3MFToolpathLayerData_RegisterProfileFunc: TLib3MFToolpathLayerData_RegisterProfileFunc read FLib3MFToolpathLayerData_RegisterProfileFunc; + property Lib3MFToolpathLayerData_RegisterBuildItemFunc: TLib3MFToolpathLayerData_RegisterBuildItemFunc read FLib3MFToolpathLayerData_RegisterBuildItemFunc; + property Lib3MFToolpathLayerData_SetSegmentAttributeFunc: TLib3MFToolpathLayerData_SetSegmentAttributeFunc read FLib3MFToolpathLayerData_SetSegmentAttributeFunc; + property Lib3MFToolpathLayerData_ClearSegmentAttributesFunc: TLib3MFToolpathLayerData_ClearSegmentAttributesFunc read FLib3MFToolpathLayerData_ClearSegmentAttributesFunc; + property Lib3MFToolpathLayerData_WriteHatchDataFunc: TLib3MFToolpathLayerData_WriteHatchDataFunc read FLib3MFToolpathLayerData_WriteHatchDataFunc; + property Lib3MFToolpathLayerData_WriteLoopFunc: TLib3MFToolpathLayerData_WriteLoopFunc read FLib3MFToolpathLayerData_WriteLoopFunc; + property Lib3MFToolpathLayerData_WritePolylineFunc: TLib3MFToolpathLayerData_WritePolylineFunc read FLib3MFToolpathLayerData_WritePolylineFunc; + property Lib3MFToolpathLayerData_AddCustomDataFunc: TLib3MFToolpathLayerData_AddCustomDataFunc read FLib3MFToolpathLayerData_AddCustomDataFunc; + property Lib3MFToolpathLayerData_FinishFunc: TLib3MFToolpathLayerData_FinishFunc read FLib3MFToolpathLayerData_FinishFunc; + property Lib3MFToolpath_GetUnitsFunc: TLib3MFToolpath_GetUnitsFunc read FLib3MFToolpath_GetUnitsFunc; + property Lib3MFToolpath_GetLayerCountFunc: TLib3MFToolpath_GetLayerCountFunc read FLib3MFToolpath_GetLayerCountFunc; + property Lib3MFToolpath_GetProfileCountFunc: TLib3MFToolpath_GetProfileCountFunc read FLib3MFToolpath_GetProfileCountFunc; + property Lib3MFToolpath_AddLayerFunc: TLib3MFToolpath_AddLayerFunc read FLib3MFToolpath_AddLayerFunc; + property Lib3MFToolpath_GetLayerAttachmentFunc: TLib3MFToolpath_GetLayerAttachmentFunc read FLib3MFToolpath_GetLayerAttachmentFunc; + property Lib3MFToolpath_ReadLayerDataFunc: TLib3MFToolpath_ReadLayerDataFunc read FLib3MFToolpath_ReadLayerDataFunc; + property Lib3MFToolpath_GetLayerPathFunc: TLib3MFToolpath_GetLayerPathFunc read FLib3MFToolpath_GetLayerPathFunc; + property Lib3MFToolpath_GetLayerZMaxFunc: TLib3MFToolpath_GetLayerZMaxFunc read FLib3MFToolpath_GetLayerZMaxFunc; + property Lib3MFToolpath_GetLayerZFunc: TLib3MFToolpath_GetLayerZFunc read FLib3MFToolpath_GetLayerZFunc; + property Lib3MFToolpath_AddProfileFunc: TLib3MFToolpath_AddProfileFunc read FLib3MFToolpath_AddProfileFunc; + property Lib3MFToolpath_GetProfileFunc: TLib3MFToolpath_GetProfileFunc read FLib3MFToolpath_GetProfileFunc; + property Lib3MFToolpath_GetProfileUUIDFunc: TLib3MFToolpath_GetProfileUUIDFunc read FLib3MFToolpath_GetProfileUUIDFunc; + property Lib3MFToolpath_GetCustomDataCountFunc: TLib3MFToolpath_GetCustomDataCountFunc read FLib3MFToolpath_GetCustomDataCountFunc; + property Lib3MFToolpath_GetCustomDataFunc: TLib3MFToolpath_GetCustomDataFunc read FLib3MFToolpath_GetCustomDataFunc; + property Lib3MFToolpath_GetCustomDataNameFunc: TLib3MFToolpath_GetCustomDataNameFunc read FLib3MFToolpath_GetCustomDataNameFunc; + property Lib3MFToolpath_HasUniqueCustomDataFunc: TLib3MFToolpath_HasUniqueCustomDataFunc read FLib3MFToolpath_HasUniqueCustomDataFunc; + property Lib3MFToolpath_FindUniqueCustomDataFunc: TLib3MFToolpath_FindUniqueCustomDataFunc read FLib3MFToolpath_FindUniqueCustomDataFunc; + property Lib3MFToolpath_AddCustomDataFunc: TLib3MFToolpath_AddCustomDataFunc read FLib3MFToolpath_AddCustomDataFunc; + property Lib3MFToolpath_ClearCustomDataFunc: TLib3MFToolpath_ClearCustomDataFunc read FLib3MFToolpath_ClearCustomDataFunc; + property Lib3MFToolpath_DeleteCustomDataFunc: TLib3MFToolpath_DeleteCustomDataFunc read FLib3MFToolpath_DeleteCustomDataFunc; + property Lib3MFToolpath_RegisterCustomIntegerAttributeFunc: TLib3MFToolpath_RegisterCustomIntegerAttributeFunc read FLib3MFToolpath_RegisterCustomIntegerAttributeFunc; + property Lib3MFToolpath_RegisterCustomDoubleAttributeFunc: TLib3MFToolpath_RegisterCustomDoubleAttributeFunc read FLib3MFToolpath_RegisterCustomDoubleAttributeFunc; + property Lib3MFToolpathIterator_GetCurrentToolpathFunc: TLib3MFToolpathIterator_GetCurrentToolpathFunc read FLib3MFToolpathIterator_GetCurrentToolpathFunc; property Lib3MFSliceStack_GetBottomZFunc: TLib3MFSliceStack_GetBottomZFunc read FLib3MFSliceStack_GetBottomZFunc; property Lib3MFSliceStack_GetSliceCountFunc: TLib3MFSliceStack_GetSliceCountFunc read FLib3MFSliceStack_GetSliceCountFunc; property Lib3MFSliceStack_GetSliceFunc: TLib3MFSliceStack_GetSliceFunc read FLib3MFSliceStack_GetSliceFunc; @@ -5642,6 +7687,7 @@ TLib3MFWrapper = class(TObject) property Lib3MFModel_GetTexture2DGroupsFunc: TLib3MFModel_GetTexture2DGroupsFunc read FLib3MFModel_GetTexture2DGroupsFunc; property Lib3MFModel_GetCompositeMaterialsFunc: TLib3MFModel_GetCompositeMaterialsFunc read FLib3MFModel_GetCompositeMaterialsFunc; property Lib3MFModel_GetMultiPropertyGroupsFunc: TLib3MFModel_GetMultiPropertyGroupsFunc read FLib3MFModel_GetMultiPropertyGroupsFunc; + property Lib3MFModel_GetToolpathsFunc: TLib3MFModel_GetToolpathsFunc read FLib3MFModel_GetToolpathsFunc; property Lib3MFModel_GetSliceStacksFunc: TLib3MFModel_GetSliceStacksFunc read FLib3MFModel_GetSliceStacksFunc; property Lib3MFModel_MergeToModelFunc: TLib3MFModel_MergeToModelFunc read FLib3MFModel_MergeToModelFunc; property Lib3MFModel_AddMeshObjectFunc: TLib3MFModel_AddMeshObjectFunc read FLib3MFModel_AddMeshObjectFunc; @@ -5655,6 +7701,7 @@ TLib3MFWrapper = class(TObject) property Lib3MFModel_AddMultiPropertyGroupFunc: TLib3MFModel_AddMultiPropertyGroupFunc read FLib3MFModel_AddMultiPropertyGroupFunc; property Lib3MFModel_AddBuildItemFunc: TLib3MFModel_AddBuildItemFunc read FLib3MFModel_AddBuildItemFunc; property Lib3MFModel_RemoveBuildItemFunc: TLib3MFModel_RemoveBuildItemFunc read FLib3MFModel_RemoveBuildItemFunc; + property Lib3MFModel_AddToolpathFunc: TLib3MFModel_AddToolpathFunc read FLib3MFModel_AddToolpathFunc; property Lib3MFModel_GetMetaDataGroupFunc: TLib3MFModel_GetMetaDataGroupFunc read FLib3MFModel_GetMetaDataGroupFunc; property Lib3MFModel_AddAttachmentFunc: TLib3MFModel_AddAttachmentFunc read FLib3MFModel_AddAttachmentFunc; property Lib3MFModel_RemoveAttachmentFunc: TLib3MFModel_RemoveAttachmentFunc read FLib3MFModel_RemoveAttachmentFunc; @@ -5669,6 +7716,9 @@ TLib3MFWrapper = class(TObject) property Lib3MFModel_RemoveCustomContentTypeFunc: TLib3MFModel_RemoveCustomContentTypeFunc read FLib3MFModel_RemoveCustomContentTypeFunc; property Lib3MFModel_SetRandomNumberCallbackFunc: TLib3MFModel_SetRandomNumberCallbackFunc read FLib3MFModel_SetRandomNumberCallbackFunc; property Lib3MFModel_GetKeyStoreFunc: TLib3MFModel_GetKeyStoreFunc read FLib3MFModel_GetKeyStoreFunc; + property Lib3MFModel_CreatePersistentSourceFromFileFunc: TLib3MFModel_CreatePersistentSourceFromFileFunc read FLib3MFModel_CreatePersistentSourceFromFileFunc; + property Lib3MFModel_CreatePersistentSourceFromBufferFunc: TLib3MFModel_CreatePersistentSourceFromBufferFunc read FLib3MFModel_CreatePersistentSourceFromBufferFunc; + property Lib3MFModel_CreatePersistentSourceFromCallbackFunc: TLib3MFModel_CreatePersistentSourceFromCallbackFunc read FLib3MFModel_CreatePersistentSourceFromCallbackFunc; property Lib3MFGetLibraryVersionFunc: TLib3MFGetLibraryVersionFunc read FLib3MFGetLibraryVersionFunc; property Lib3MFGetPrereleaseInformationFunc: TLib3MFGetPrereleaseInformationFunc read FLib3MFGetPrereleaseInformationFunc; property Lib3MFGetBuildInformationFunc: TLib3MFGetBuildInformationFunc read FLib3MFGetBuildInformationFunc; @@ -5715,3291 +7765,4822 @@ TLib3MFWrapper = class(TObject) end; (************************************************************************************************************************* - Enum conversion + Enum conversion +**************************************************************************************************************************) + + function convertPropertyTypeToConst(const AValue: TLib3MFPropertyType): Integer; + function convertConstToPropertyType(const AValue: Integer): TLib3MFPropertyType; + function convertSlicesMeshResolutionToConst(const AValue: TLib3MFSlicesMeshResolution): Integer; + function convertConstToSlicesMeshResolution(const AValue: Integer): TLib3MFSlicesMeshResolution; + function convertPersistentReaderSourceTypeToConst(const AValue: TLib3MFPersistentReaderSourceType): Integer; + function convertConstToPersistentReaderSourceType(const AValue: Integer): TLib3MFPersistentReaderSourceType; + function convertModelUnitToConst(const AValue: TLib3MFModelUnit): Integer; + function convertConstToModelUnit(const AValue: Integer): TLib3MFModelUnit; + function convertObjectTypeToConst(const AValue: TLib3MFObjectType): Integer; + function convertConstToObjectType(const AValue: Integer): TLib3MFObjectType; + function convertTextureTypeToConst(const AValue: TLib3MFTextureType): Integer; + function convertConstToTextureType(const AValue: Integer): TLib3MFTextureType; + function convertTextureTileStyleToConst(const AValue: TLib3MFTextureTileStyle): Integer; + function convertConstToTextureTileStyle(const AValue: Integer): TLib3MFTextureTileStyle; + function convertTextureFilterToConst(const AValue: TLib3MFTextureFilter): Integer; + function convertConstToTextureFilter(const AValue: Integer): TLib3MFTextureFilter; + function convertBeamLatticeCapModeToConst(const AValue: TLib3MFBeamLatticeCapMode): Integer; + function convertConstToBeamLatticeCapMode(const AValue: Integer): TLib3MFBeamLatticeCapMode; + function convertBeamLatticeClipModeToConst(const AValue: TLib3MFBeamLatticeClipMode): Integer; + function convertConstToBeamLatticeClipMode(const AValue: Integer): TLib3MFBeamLatticeClipMode; + function convertBeamLatticeBallModeToConst(const AValue: TLib3MFBeamLatticeBallMode): Integer; + function convertConstToBeamLatticeBallMode(const AValue: Integer): TLib3MFBeamLatticeBallMode; + function convertBinaryStreamPredictionTypeToConst(const AValue: TLib3MFBinaryStreamPredictionType): Integer; + function convertConstToBinaryStreamPredictionType(const AValue: Integer): TLib3MFBinaryStreamPredictionType; + function convertProgressIdentifierToConst(const AValue: TLib3MFProgressIdentifier): Integer; + function convertConstToProgressIdentifier(const AValue: Integer): TLib3MFProgressIdentifier; + function convertBlendMethodToConst(const AValue: TLib3MFBlendMethod): Integer; + function convertConstToBlendMethod(const AValue: Integer): TLib3MFBlendMethod; + function convertToolpathSegmentTypeToConst(const AValue: TLib3MFToolpathSegmentType): Integer; + function convertConstToToolpathSegmentType(const AValue: Integer): TLib3MFToolpathSegmentType; + function convertToolpathAttributeTypeToConst(const AValue: TLib3MFToolpathAttributeType): Integer; + function convertConstToToolpathAttributeType(const AValue: Integer): TLib3MFToolpathAttributeType; + function convertEncryptionAlgorithmToConst(const AValue: TLib3MFEncryptionAlgorithm): Integer; + function convertConstToEncryptionAlgorithm(const AValue: Integer): TLib3MFEncryptionAlgorithm; + function convertWrappingAlgorithmToConst(const AValue: TLib3MFWrappingAlgorithm): Integer; + function convertConstToWrappingAlgorithm(const AValue: Integer): TLib3MFWrappingAlgorithm; + function convertMgfAlgorithmToConst(const AValue: TLib3MFMgfAlgorithm): Integer; + function convertConstToMgfAlgorithm(const AValue: Integer): TLib3MFMgfAlgorithm; + function convertDigestMethodToConst(const AValue: TLib3MFDigestMethod): Integer; + function convertConstToDigestMethod(const AValue: Integer): TLib3MFDigestMethod; + function convertCompressionToConst(const AValue: TLib3MFCompression): Integer; + function convertConstToCompression(const AValue: Integer): TLib3MFCompression; + + TLib3MFPolymorphicFactory<_T:class; _B> = record + class function Make(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): _T; static; + end; + function TLib3MFPolymorphicFactoryMakeBase(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBase; + function TLib3MFPolymorphicFactoryMakeBinaryStream(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBinaryStream; + function TLib3MFPolymorphicFactoryMakeWriter(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFWriter; + function TLib3MFPolymorphicFactoryMakePersistentReaderSource(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFPersistentReaderSource; + function TLib3MFPolymorphicFactoryMakeReader(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFReader; + function TLib3MFPolymorphicFactoryMakePackagePart(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFPackagePart; + function TLib3MFPolymorphicFactoryMakeResource(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFResource; + function TLib3MFPolymorphicFactoryMakeResourceIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFResourceIterator; + function TLib3MFPolymorphicFactoryMakeCustomXMLAttribute(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFCustomXMLAttribute; + function TLib3MFPolymorphicFactoryMakeCustomXMLNode(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFCustomXMLNode; + function TLib3MFPolymorphicFactoryMakeCustomXMLNodes(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFCustomXMLNodes; + function TLib3MFPolymorphicFactoryMakeCustomDOMTree(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFCustomDOMTree; + function TLib3MFPolymorphicFactoryMakeSliceStackIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFSliceStackIterator; + function TLib3MFPolymorphicFactoryMakeObjectIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFObjectIterator; + function TLib3MFPolymorphicFactoryMakeMeshObjectIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMeshObjectIterator; + function TLib3MFPolymorphicFactoryMakeComponentsObjectIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFComponentsObjectIterator; + function TLib3MFPolymorphicFactoryMakeTexture2DIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFTexture2DIterator; + function TLib3MFPolymorphicFactoryMakeBaseMaterialGroupIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBaseMaterialGroupIterator; + function TLib3MFPolymorphicFactoryMakeColorGroupIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFColorGroupIterator; + function TLib3MFPolymorphicFactoryMakeTexture2DGroupIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFTexture2DGroupIterator; + function TLib3MFPolymorphicFactoryMakeCompositeMaterialsIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFCompositeMaterialsIterator; + function TLib3MFPolymorphicFactoryMakeMultiPropertyGroupIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMultiPropertyGroupIterator; + function TLib3MFPolymorphicFactoryMakeMetaData(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMetaData; + function TLib3MFPolymorphicFactoryMakeMetaDataGroup(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMetaDataGroup; + function TLib3MFPolymorphicFactoryMakeObject(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFObject; + function TLib3MFPolymorphicFactoryMakeMeshObject(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMeshObject; + function TLib3MFPolymorphicFactoryMakeBeamLattice(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBeamLattice; + function TLib3MFPolymorphicFactoryMakeComponent(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFComponent; + function TLib3MFPolymorphicFactoryMakeComponentsObject(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFComponentsObject; + function TLib3MFPolymorphicFactoryMakeBeamSet(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBeamSet; + function TLib3MFPolymorphicFactoryMakeBaseMaterialGroup(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBaseMaterialGroup; + function TLib3MFPolymorphicFactoryMakeColorGroup(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFColorGroup; + function TLib3MFPolymorphicFactoryMakeTexture2DGroup(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFTexture2DGroup; + function TLib3MFPolymorphicFactoryMakeCompositeMaterials(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFCompositeMaterials; + function TLib3MFPolymorphicFactoryMakeMultiPropertyGroup(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMultiPropertyGroup; + function TLib3MFPolymorphicFactoryMakeAttachment(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFAttachment; + function TLib3MFPolymorphicFactoryMakeTexture2D(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFTexture2D; + function TLib3MFPolymorphicFactoryMakeBuildItem(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBuildItem; + function TLib3MFPolymorphicFactoryMakeBuildItemIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBuildItemIterator; + function TLib3MFPolymorphicFactoryMakeSlice(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFSlice; + function TLib3MFPolymorphicFactoryMakeToolpathProfile(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFToolpathProfile; + function TLib3MFPolymorphicFactoryMakeToolpathLayerReader(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFToolpathLayerReader; + function TLib3MFPolymorphicFactoryMakeToolpathLayerData(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFToolpathLayerData; + function TLib3MFPolymorphicFactoryMakeToolpath(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFToolpath; + function TLib3MFPolymorphicFactoryMakeToolpathIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFToolpathIterator; + function TLib3MFPolymorphicFactoryMakeSliceStack(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFSliceStack; + function TLib3MFPolymorphicFactoryMakeConsumer(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFConsumer; + function TLib3MFPolymorphicFactoryMakeAccessRight(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFAccessRight; + function TLib3MFPolymorphicFactoryMakeContentEncryptionParams(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFContentEncryptionParams; + function TLib3MFPolymorphicFactoryMakeResourceData(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFResourceData; + function TLib3MFPolymorphicFactoryMakeResourceDataGroup(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFResourceDataGroup; + function TLib3MFPolymorphicFactoryMakeKeyStore(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFKeyStore; + function TLib3MFPolymorphicFactoryMakeModel(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFModel; + +implementation + +(************************************************************************************************************************* + Enum conversion +**************************************************************************************************************************) + + function convertPropertyTypeToConst(const AValue: TLib3MFPropertyType): Integer; + begin + case AValue of + ePropertyTypeNoPropertyType: Result := 0; + ePropertyTypeBaseMaterial: Result := 1; + ePropertyTypeTexCoord: Result := 2; + ePropertyTypeColors: Result := 3; + ePropertyTypeComposite: Result := 4; + ePropertyTypeMulti: Result := 5; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); + end; + end; + + function convertConstToPropertyType(const AValue: Integer): TLib3MFPropertyType; + begin + case AValue of + 0: Result := ePropertyTypeNoPropertyType; + 1: Result := ePropertyTypeBaseMaterial; + 2: Result := ePropertyTypeTexCoord; + 3: Result := ePropertyTypeColors; + 4: Result := ePropertyTypeComposite; + 5: Result := ePropertyTypeMulti; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); + end; + end; + + + function convertSlicesMeshResolutionToConst(const AValue: TLib3MFSlicesMeshResolution): Integer; + begin + case AValue of + eSlicesMeshResolutionFullres: Result := 0; + eSlicesMeshResolutionLowres: Result := 1; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); + end; + end; + + function convertConstToSlicesMeshResolution(const AValue: Integer): TLib3MFSlicesMeshResolution; + begin + case AValue of + 0: Result := eSlicesMeshResolutionFullres; + 1: Result := eSlicesMeshResolutionLowres; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); + end; + end; + + + function convertPersistentReaderSourceTypeToConst(const AValue: TLib3MFPersistentReaderSourceType): Integer; + begin + case AValue of + ePersistentReaderSourceTypeUnknown: Result := 0; + ePersistentReaderSourceTypeFileOnDisk: Result := 1; + ePersistentReaderSourceTypeMemoryBuffer: Result := 2; + ePersistentReaderSourceTypeCallback: Result := 3; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); + end; + end; + + function convertConstToPersistentReaderSourceType(const AValue: Integer): TLib3MFPersistentReaderSourceType; + begin + case AValue of + 0: Result := ePersistentReaderSourceTypeUnknown; + 1: Result := ePersistentReaderSourceTypeFileOnDisk; + 2: Result := ePersistentReaderSourceTypeMemoryBuffer; + 3: Result := ePersistentReaderSourceTypeCallback; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); + end; + end; + + + function convertModelUnitToConst(const AValue: TLib3MFModelUnit): Integer; + begin + case AValue of + eModelUnitMicroMeter: Result := 0; + eModelUnitMilliMeter: Result := 1; + eModelUnitCentiMeter: Result := 2; + eModelUnitInch: Result := 3; + eModelUnitFoot: Result := 4; + eModelUnitMeter: Result := 5; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); + end; + end; + + function convertConstToModelUnit(const AValue: Integer): TLib3MFModelUnit; + begin + case AValue of + 0: Result := eModelUnitMicroMeter; + 1: Result := eModelUnitMilliMeter; + 2: Result := eModelUnitCentiMeter; + 3: Result := eModelUnitInch; + 4: Result := eModelUnitFoot; + 5: Result := eModelUnitMeter; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); + end; + end; + + + function convertObjectTypeToConst(const AValue: TLib3MFObjectType): Integer; + begin + case AValue of + eObjectTypeOther: Result := 0; + eObjectTypeModel: Result := 1; + eObjectTypeSupport: Result := 2; + eObjectTypeSolidSupport: Result := 3; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); + end; + end; + + function convertConstToObjectType(const AValue: Integer): TLib3MFObjectType; + begin + case AValue of + 0: Result := eObjectTypeOther; + 1: Result := eObjectTypeModel; + 2: Result := eObjectTypeSupport; + 3: Result := eObjectTypeSolidSupport; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); + end; + end; + + + function convertTextureTypeToConst(const AValue: TLib3MFTextureType): Integer; + begin + case AValue of + eTextureTypeUnknown: Result := 0; + eTextureTypePNG: Result := 1; + eTextureTypeJPEG: Result := 2; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); + end; + end; + + function convertConstToTextureType(const AValue: Integer): TLib3MFTextureType; + begin + case AValue of + 0: Result := eTextureTypeUnknown; + 1: Result := eTextureTypePNG; + 2: Result := eTextureTypeJPEG; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); + end; + end; + + + function convertTextureTileStyleToConst(const AValue: TLib3MFTextureTileStyle): Integer; + begin + case AValue of + eTextureTileStyleWrap: Result := 0; + eTextureTileStyleMirror: Result := 1; + eTextureTileStyleClamp: Result := 2; + eTextureTileStyleNoTileStyle: Result := 3; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); + end; + end; + + function convertConstToTextureTileStyle(const AValue: Integer): TLib3MFTextureTileStyle; + begin + case AValue of + 0: Result := eTextureTileStyleWrap; + 1: Result := eTextureTileStyleMirror; + 2: Result := eTextureTileStyleClamp; + 3: Result := eTextureTileStyleNoTileStyle; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); + end; + end; + + + function convertTextureFilterToConst(const AValue: TLib3MFTextureFilter): Integer; + begin + case AValue of + eTextureFilterAuto: Result := 0; + eTextureFilterLinear: Result := 1; + eTextureFilterNearest: Result := 2; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); + end; + end; + + function convertConstToTextureFilter(const AValue: Integer): TLib3MFTextureFilter; + begin + case AValue of + 0: Result := eTextureFilterAuto; + 1: Result := eTextureFilterLinear; + 2: Result := eTextureFilterNearest; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); + end; + end; + + + function convertBeamLatticeCapModeToConst(const AValue: TLib3MFBeamLatticeCapMode): Integer; + begin + case AValue of + eBeamLatticeCapModeSphere: Result := 0; + eBeamLatticeCapModeHemiSphere: Result := 1; + eBeamLatticeCapModeButt: Result := 2; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); + end; + end; + + function convertConstToBeamLatticeCapMode(const AValue: Integer): TLib3MFBeamLatticeCapMode; + begin + case AValue of + 0: Result := eBeamLatticeCapModeSphere; + 1: Result := eBeamLatticeCapModeHemiSphere; + 2: Result := eBeamLatticeCapModeButt; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); + end; + end; + + + function convertBeamLatticeClipModeToConst(const AValue: TLib3MFBeamLatticeClipMode): Integer; + begin + case AValue of + eBeamLatticeClipModeNoClipMode: Result := 0; + eBeamLatticeClipModeInside: Result := 1; + eBeamLatticeClipModeOutside: Result := 2; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); + end; + end; + + function convertConstToBeamLatticeClipMode(const AValue: Integer): TLib3MFBeamLatticeClipMode; + begin + case AValue of + 0: Result := eBeamLatticeClipModeNoClipMode; + 1: Result := eBeamLatticeClipModeInside; + 2: Result := eBeamLatticeClipModeOutside; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); + end; + end; + + + function convertBeamLatticeBallModeToConst(const AValue: TLib3MFBeamLatticeBallMode): Integer; + begin + case AValue of + eBeamLatticeBallModeNone: Result := 0; + eBeamLatticeBallModeMixed: Result := 1; + eBeamLatticeBallModeAll: Result := 2; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); + end; + end; + + function convertConstToBeamLatticeBallMode(const AValue: Integer): TLib3MFBeamLatticeBallMode; + begin + case AValue of + 0: Result := eBeamLatticeBallModeNone; + 1: Result := eBeamLatticeBallModeMixed; + 2: Result := eBeamLatticeBallModeAll; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); + end; + end; + + + function convertBinaryStreamPredictionTypeToConst(const AValue: TLib3MFBinaryStreamPredictionType): Integer; + begin + case AValue of + eBinaryStreamPredictionTypeNoPrediction: Result := 0; + eBinaryStreamPredictionTypeDeltaPrediction: Result := 1; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); + end; + end; + + function convertConstToBinaryStreamPredictionType(const AValue: Integer): TLib3MFBinaryStreamPredictionType; + begin + case AValue of + 0: Result := eBinaryStreamPredictionTypeNoPrediction; + 1: Result := eBinaryStreamPredictionTypeDeltaPrediction; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); + end; + end; + + + function convertProgressIdentifierToConst(const AValue: TLib3MFProgressIdentifier): Integer; + begin + case AValue of + eProgressIdentifierQUERYCANCELED: Result := 0; + eProgressIdentifierDONE: Result := 1; + eProgressIdentifierCLEANUP: Result := 2; + eProgressIdentifierREADSTREAM: Result := 3; + eProgressIdentifierEXTRACTOPCPACKAGE: Result := 4; + eProgressIdentifierREADNONROOTMODELS: Result := 5; + eProgressIdentifierREADROOTMODEL: Result := 6; + eProgressIdentifierREADRESOURCES: Result := 7; + eProgressIdentifierREADMESH: Result := 8; + eProgressIdentifierREADSLICES: Result := 9; + eProgressIdentifierREADBUILD: Result := 10; + eProgressIdentifierREADCUSTOMATTACHMENT: Result := 11; + eProgressIdentifierREADTEXTURETACHMENTS: Result := 12; + eProgressIdentifierCREATEOPCPACKAGE: Result := 13; + eProgressIdentifierWRITEMODELSTOSTREAM: Result := 14; + eProgressIdentifierWRITEROOTMODEL: Result := 15; + eProgressIdentifierWRITENONROOTMODELS: Result := 16; + eProgressIdentifierWRITEATTACHMENTS: Result := 17; + eProgressIdentifierWRITECONTENTTYPES: Result := 18; + eProgressIdentifierWRITENOBJECTS: Result := 19; + eProgressIdentifierWRITENODES: Result := 20; + eProgressIdentifierWRITETRIANGLES: Result := 21; + eProgressIdentifierWRITESLICES: Result := 22; + eProgressIdentifierWRITEKEYSTORE: Result := 23; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); + end; + end; + + function convertConstToProgressIdentifier(const AValue: Integer): TLib3MFProgressIdentifier; + begin + case AValue of + 0: Result := eProgressIdentifierQUERYCANCELED; + 1: Result := eProgressIdentifierDONE; + 2: Result := eProgressIdentifierCLEANUP; + 3: Result := eProgressIdentifierREADSTREAM; + 4: Result := eProgressIdentifierEXTRACTOPCPACKAGE; + 5: Result := eProgressIdentifierREADNONROOTMODELS; + 6: Result := eProgressIdentifierREADROOTMODEL; + 7: Result := eProgressIdentifierREADRESOURCES; + 8: Result := eProgressIdentifierREADMESH; + 9: Result := eProgressIdentifierREADSLICES; + 10: Result := eProgressIdentifierREADBUILD; + 11: Result := eProgressIdentifierREADCUSTOMATTACHMENT; + 12: Result := eProgressIdentifierREADTEXTURETACHMENTS; + 13: Result := eProgressIdentifierCREATEOPCPACKAGE; + 14: Result := eProgressIdentifierWRITEMODELSTOSTREAM; + 15: Result := eProgressIdentifierWRITEROOTMODEL; + 16: Result := eProgressIdentifierWRITENONROOTMODELS; + 17: Result := eProgressIdentifierWRITEATTACHMENTS; + 18: Result := eProgressIdentifierWRITECONTENTTYPES; + 19: Result := eProgressIdentifierWRITENOBJECTS; + 20: Result := eProgressIdentifierWRITENODES; + 21: Result := eProgressIdentifierWRITETRIANGLES; + 22: Result := eProgressIdentifierWRITESLICES; + 23: Result := eProgressIdentifierWRITEKEYSTORE; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); + end; + end; + + + function convertBlendMethodToConst(const AValue: TLib3MFBlendMethod): Integer; + begin + case AValue of + eBlendMethodNoBlendMethod: Result := 0; + eBlendMethodMix: Result := 1; + eBlendMethodMultiply: Result := 2; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); + end; + end; + + function convertConstToBlendMethod(const AValue: Integer): TLib3MFBlendMethod; + begin + case AValue of + 0: Result := eBlendMethodNoBlendMethod; + 1: Result := eBlendMethodMix; + 2: Result := eBlendMethodMultiply; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); + end; + end; + + + function convertToolpathSegmentTypeToConst(const AValue: TLib3MFToolpathSegmentType): Integer; + begin + case AValue of + eToolpathSegmentTypeUnknown: Result := 0; + eToolpathSegmentTypeHatch: Result := 1; + eToolpathSegmentTypeLoop: Result := 2; + eToolpathSegmentTypePolyline: Result := 3; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); + end; + end; + + function convertConstToToolpathSegmentType(const AValue: Integer): TLib3MFToolpathSegmentType; + begin + case AValue of + 0: Result := eToolpathSegmentTypeUnknown; + 1: Result := eToolpathSegmentTypeHatch; + 2: Result := eToolpathSegmentTypeLoop; + 3: Result := eToolpathSegmentTypePolyline; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); + end; + end; + + + function convertToolpathAttributeTypeToConst(const AValue: TLib3MFToolpathAttributeType): Integer; + begin + case AValue of + eToolpathAttributeTypeUnknown: Result := 0; + eToolpathAttributeTypeInteger: Result := 1; + eToolpathAttributeTypeDouble: Result := 2; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); + end; + end; + + function convertConstToToolpathAttributeType(const AValue: Integer): TLib3MFToolpathAttributeType; + begin + case AValue of + 0: Result := eToolpathAttributeTypeUnknown; + 1: Result := eToolpathAttributeTypeInteger; + 2: Result := eToolpathAttributeTypeDouble; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); + end; + end; + + + function convertEncryptionAlgorithmToConst(const AValue: TLib3MFEncryptionAlgorithm): Integer; + begin + case AValue of + eEncryptionAlgorithmAES256_GCM: Result := 1; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); + end; + end; + + function convertConstToEncryptionAlgorithm(const AValue: Integer): TLib3MFEncryptionAlgorithm; + begin + case AValue of + 1: Result := eEncryptionAlgorithmAES256_GCM; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); + end; + end; + + + function convertWrappingAlgorithmToConst(const AValue: TLib3MFWrappingAlgorithm): Integer; + begin + case AValue of + eWrappingAlgorithmRSA_OAEP: Result := 0; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); + end; + end; + + function convertConstToWrappingAlgorithm(const AValue: Integer): TLib3MFWrappingAlgorithm; + begin + case AValue of + 0: Result := eWrappingAlgorithmRSA_OAEP; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); + end; + end; + + + function convertMgfAlgorithmToConst(const AValue: TLib3MFMgfAlgorithm): Integer; + begin + case AValue of + eMgfAlgorithmMGF1_SHA1: Result := 160; + eMgfAlgorithmMGF1_SHA224: Result := 224; + eMgfAlgorithmMGF1_SHA256: Result := 256; + eMgfAlgorithmMGF1_SHA384: Result := 384; + eMgfAlgorithmMGF1_SHA512: Result := 512; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); + end; + end; + + function convertConstToMgfAlgorithm(const AValue: Integer): TLib3MFMgfAlgorithm; + begin + case AValue of + 160: Result := eMgfAlgorithmMGF1_SHA1; + 224: Result := eMgfAlgorithmMGF1_SHA224; + 256: Result := eMgfAlgorithmMGF1_SHA256; + 384: Result := eMgfAlgorithmMGF1_SHA384; + 512: Result := eMgfAlgorithmMGF1_SHA512; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); + end; + end; + + + function convertDigestMethodToConst(const AValue: TLib3MFDigestMethod): Integer; + begin + case AValue of + eDigestMethodSHA1: Result := 160; + eDigestMethodSHA256: Result := 256; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); + end; + end; + + function convertConstToDigestMethod(const AValue: Integer): TLib3MFDigestMethod; + begin + case AValue of + 160: Result := eDigestMethodSHA1; + 256: Result := eDigestMethodSHA256; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); + end; + end; + + + function convertCompressionToConst(const AValue: TLib3MFCompression): Integer; + begin + case AValue of + eCompressionNoCompression: Result := 0; + eCompressionDeflate: Result := 1; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); + end; + end; + + function convertConstToCompression(const AValue: Integer): TLib3MFCompression; + begin + case AValue of + 0: Result := eCompressionNoCompression; + 1: Result := eCompressionDeflate; + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); + end; + end; + + + + +(************************************************************************************************************************* + PolymorficFactory implementation +**************************************************************************************************************************) + + (** + * IMPORTANT: PolymorphicFactory method should not be used by application directly. + * It's designed to be used on Lib3MFHandle object only once. + * If it's used on any existing object as a form of dynamic cast then + * TLIB3MFWrapper::AcquireInstance(object: TLIB3MFBase) must be called after instantiating new object. + * This is important to keep reference count matching between application and library sides. + *) + class function TLib3MFPolymorphicFactory<_T, _B>.Make(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): _T; + var + ClassTypeId: QWord; + Obj: TLIB3MFBase; + begin + Result := nil; + Wrapper.CheckError(nil, Wrapper.Lib3MFBase_ClassTypeIdFunc(handle, ClassTypeId)); + case (ClassTypeId) of + QWord($856632D0BAF1D8B7): begin Obj := TLIB3MFBase.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Base" + QWord($A0EB26254C981E1A): begin Obj := TLIB3MFBinaryStream.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::BinaryStream" + QWord($E76F642F363FD7E9): begin Obj := TLIB3MFWriter.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Writer" + QWord($BE46884397CE1319): begin Obj := TLIB3MFPersistentReaderSource.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::PersistentReaderSource" + QWord($2D86831DA59FBE72): begin Obj := TLIB3MFReader.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Reader" + QWord($0E55A826D377483E): begin Obj := TLIB3MFPackagePart.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::PackagePart" + QWord($DFE3889D1B269CBB): begin Obj := TLIB3MFResource.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Resource" + QWord($460F3515E2621DBE): begin Obj := TLIB3MFResourceIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ResourceIterator" + QWord($EA18C54DBD42B5F6): begin Obj := TLIB3MFCustomXMLAttribute.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::CustomXMLAttribute" + QWord($26B5AD02041EDF96): begin Obj := TLIB3MFCustomXMLNode.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::CustomXMLNode" + QWord($8C4B47C97D310E89): begin Obj := TLIB3MFCustomXMLNodes.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::CustomXMLNodes" + QWord($5E0CF70A6DB6256A): begin Obj := TLIB3MFCustomDOMTree.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::CustomDOMTree" + QWord($69684DB99FA813F6): begin Obj := TLIB3MFSliceStackIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::SliceStackIterator" + QWord($DE92510BD2112288): begin Obj := TLIB3MFObjectIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ObjectIterator" + QWord($F4196034E2B9FDE6): begin Obj := TLIB3MFMeshObjectIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::MeshObjectIterator" + QWord($564DE4217ED7614A): begin Obj := TLIB3MFComponentsObjectIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ComponentsObjectIterator" + QWord($4BD32B4870FFC03B): begin Obj := TLIB3MFTexture2DIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2DIterator" + QWord($65E6EDD9362C79CB): begin Obj := TLIB3MFBaseMaterialGroupIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::BaseMaterialGroupIterator" + QWord($10274A1757C729C0): begin Obj := TLIB3MFColorGroupIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ColorGroupIterator" + QWord($30D55F4DB88FE0CA): begin Obj := TLIB3MFTexture2DGroupIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2DGroupIterator" + QWord($A99CC6C3F70FB6F9): begin Obj := TLIB3MFCompositeMaterialsIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::CompositeMaterialsIterator" + QWord($C2BDF5D8CBBDB1F0): begin Obj := TLIB3MFMultiPropertyGroupIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::MultiPropertyGroupIterator" + QWord($D17716D063DE2C22): begin Obj := TLIB3MFMetaData.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::MetaData" + QWord($0C3B85369E9B25D3): begin Obj := TLIB3MFMetaDataGroup.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::MetaDataGroup" + QWord($2DA2136F577A779C): begin Obj := TLIB3MFObject.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Object" + QWord($3B3A6DC6EC610497): begin Obj := TLIB3MFMeshObject.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::MeshObject" + QWord($63B3B461B30B4BA5): begin Obj := TLIB3MFBeamLattice.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::BeamLattice" + QWord($4ECDB6A6F69F2BEB): begin Obj := TLIB3MFComponent.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Component" + QWord($6522CF04EB283FED): begin Obj := TLIB3MFComponentsObject.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ComponentsObject" + QWord($30CCDBE90E00B55B): begin Obj := TLIB3MFBeamSet.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::BeamSet" + QWord($B27D4656E16609FA): begin Obj := TLIB3MFBaseMaterialGroup.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::BaseMaterialGroup" + QWord($D085FB2E49CDB5B1): begin Obj := TLIB3MFColorGroup.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ColorGroup" + QWord($BC1208397E37055D): begin Obj := TLIB3MFTexture2DGroup.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2DGroup" + QWord($CE16224D688B86F2): begin Obj := TLIB3MFCompositeMaterials.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::CompositeMaterials" + QWord($B989E02E43158FE6): begin Obj := TLIB3MFMultiPropertyGroup.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::MultiPropertyGroup" + QWord($8CE7A1191A63A35D): begin Obj := TLIB3MFAttachment.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Attachment" + QWord($E0441CF976B36319): begin Obj := TLIB3MFTexture2D.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2D" + QWord($68FB2D5FFC4BA12A): begin Obj := TLIB3MFBuildItem.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::BuildItem" + QWord($A7D21BD364910860): begin Obj := TLIB3MFBuildItemIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::BuildItemIterator" + QWord($2198BCF4D8DF9C40): begin Obj := TLIB3MFSlice.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Slice" + QWord($C869620B90242CA7): begin Obj := TLIB3MFToolpathProfile.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ToolpathProfile" + QWord($28DD7D3718F0616E): begin Obj := TLIB3MFToolpathLayerReader.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ToolpathLayerReader" + QWord($28C0E70CC44F931A): begin Obj := TLIB3MFToolpathLayerData.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ToolpathLayerData" + QWord($F0AAB2C814D9FFB1): begin Obj := TLIB3MFToolpath.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Toolpath" + QWord($D0F24425A07F2A81): begin Obj := TLIB3MFToolpathIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ToolpathIterator" + QWord($6594B031B6096238): begin Obj := TLIB3MFSliceStack.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::SliceStack" + QWord($D9E46D5E6D8118EE): begin Obj := TLIB3MFConsumer.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Consumer" + QWord($385C42FC5609498A): begin Obj := TLIB3MFAccessRight.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::AccessRight" + QWord($7FB36B91D4CE4671): begin Obj := TLIB3MFContentEncryptionParams.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ContentEncryptionParams" + QWord($1A47A5E258E22EF9): begin Obj := TLIB3MFResourceData.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ResourceData" + QWord($D59067227E428AA4): begin Obj := TLIB3MFResourceDataGroup.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ResourceDataGroup" + QWord($1CC9E0CC082253C6): begin Obj := TLIB3MFKeyStore.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::KeyStore" + QWord($5A8164ECEDB03F09): begin Obj := TLIB3MFModel.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Model" + end; + if Result = nil then Result := _B.Create(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeBase(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBase; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeBinaryStream(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBinaryStream; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeWriter(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFWriter; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakePersistentReaderSource(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFPersistentReaderSource; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeReader(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFReader; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakePackagePart(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFPackagePart; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeResource(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFResource; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeResourceIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFResourceIterator; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeCustomXMLAttribute(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFCustomXMLAttribute; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeCustomXMLNode(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFCustomXMLNode; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeCustomXMLNodes(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFCustomXMLNodes; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeCustomDOMTree(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFCustomDOMTree; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeSliceStackIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFSliceStackIterator; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeObjectIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFObjectIterator; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeMeshObjectIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMeshObjectIterator; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeComponentsObjectIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFComponentsObjectIterator; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeTexture2DIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFTexture2DIterator; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeBaseMaterialGroupIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBaseMaterialGroupIterator; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeColorGroupIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFColorGroupIterator; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeTexture2DGroupIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFTexture2DGroupIterator; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeCompositeMaterialsIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFCompositeMaterialsIterator; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeMultiPropertyGroupIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMultiPropertyGroupIterator; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeMetaData(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMetaData; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeMetaDataGroup(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMetaDataGroup; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeObject(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFObject; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeMeshObject(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMeshObject; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeBeamLattice(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBeamLattice; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeComponent(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFComponent; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeComponentsObject(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFComponentsObject; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeBeamSet(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBeamSet; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeBaseMaterialGroup(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBaseMaterialGroup; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeColorGroup(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFColorGroup; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeTexture2DGroup(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFTexture2DGroup; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeCompositeMaterials(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFCompositeMaterials; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeMultiPropertyGroup(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMultiPropertyGroup; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeAttachment(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFAttachment; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeTexture2D(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFTexture2D; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeBuildItem(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBuildItem; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeBuildItemIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBuildItemIterator; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeSlice(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFSlice; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeToolpathProfile(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFToolpathProfile; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeToolpathLayerReader(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFToolpathLayerReader; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeToolpathLayerData(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFToolpathLayerData; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeToolpath(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFToolpath; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeToolpathIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFToolpathIterator; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeSliceStack(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFSliceStack; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeConsumer(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFConsumer; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeAccessRight(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFAccessRight; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeContentEncryptionParams(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFContentEncryptionParams; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeResourceData(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFResourceData; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeResourceDataGroup(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFResourceDataGroup; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeKeyStore(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFKeyStore; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + function TLib3MFPolymorphicFactoryMakeModel(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFModel; + begin + Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + end; + +(************************************************************************************************************************* + Exception implementation +**************************************************************************************************************************) + + constructor ELib3MFException.Create(AErrorCode: TLib3MFResult; AMessage: String); + var + ADescription: String; + begin + FErrorCode := AErrorCode; + case FErrorCode of + LIB3MF_ERROR_NOTIMPLEMENTED: ADescription := 'functionality not implemented'; + LIB3MF_ERROR_INVALIDPARAM: ADescription := 'an invalid parameter was passed'; + LIB3MF_ERROR_INVALIDCAST: ADescription := 'a type cast failed'; + LIB3MF_ERROR_BUFFERTOOSMALL: ADescription := 'a provided buffer is too small'; + LIB3MF_ERROR_GENERICEXCEPTION: ADescription := 'a generic exception occurred'; + LIB3MF_ERROR_COULDNOTLOADLIBRARY: ADescription := 'the library could not be loaded'; + LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT: ADescription := 'a required exported symbol could not be found in the library'; + LIB3MF_ERROR_INCOMPATIBLEBINARYVERSION: ADescription := 'the version of the binary interface does not match the bindings interface'; + LIB3MF_ERROR_CALCULATIONABORTED: ADescription := 'a calculation has been aborted'; + LIB3MF_ERROR_SHOULDNOTBECALLED: ADescription := 'functionality should not be called'; + LIB3MF_ERROR_READERCLASSUNKNOWN: ADescription := 'the queried reader class is unknown'; + LIB3MF_ERROR_WRITERCLASSUNKNOWN: ADescription := 'the queried writer class is unknown'; + LIB3MF_ERROR_ITERATORINVALIDINDEX: ADescription := 'the current index of an iterator is invalid'; + LIB3MF_ERROR_INVALIDMODELRESOURCE: ADescription := 'no Model Resource has been given'; + LIB3MF_ERROR_RESOURCENOTFOUND: ADescription := 'Resource not found'; + LIB3MF_ERROR_INVALIDMODEL: ADescription := 'A model is invalid'; + LIB3MF_ERROR_INVALIDOBJECT: ADescription := 'An object is invalid'; + LIB3MF_ERROR_INVALIDMESHOBJECT: ADescription := 'A mesh object is invalid'; + LIB3MF_ERROR_INVALIDCOMPONENTSOBJECT: ADescription := 'A components object is invalid'; + LIB3MF_ERROR_INVALIDCOMPONENT: ADescription := 'A component is invalid'; + LIB3MF_ERROR_INVALIDBUILDITEM: ADescription := 'A build item is invalid'; + LIB3MF_ERROR_INVALIDBASEMATERIALGROUP: ADescription := 'A basematerialgroup is invalid'; + LIB3MF_ERROR_INVALIDSLICESTACKRESOURCE: ADescription := 'A slicestack resource is invalid'; + LIB3MF_ERROR_INVALIDTEXTURERESOURCE: ADescription := 'A texture resource is invalid'; + LIB3MF_ERROR_INVALIDCOLORGROUP: ADescription := 'A color group resource is invalid'; + LIB3MF_ERROR_INVALIDTEXTURE2DGROUP: ADescription := 'A texture2d group resource is invalid'; + LIB3MF_ERROR_INVALIDCOMPOSITEMATERIALS: ADescription := 'A composite materials resource is invalid'; + LIB3MF_ERROR_INVALIDMULTIPROPERTYGROUP: ADescription := 'A MultiPropertyGroup resource is invalid'; + LIB3MF_ERROR_INVALIDRESOURCEINDEX: ADescription := 'A resource index is invalid'; + LIB3MF_ERROR_ATTACHMENTNOTFOUND: ADescription := 'Attachment not found'; + LIB3MF_ERROR_FORBIDDENCYCLICREFERENCE: ADescription := 'A component references one of its ancestors'; + LIB3MF_ERROR_INVALIDATTACHMENTSTREAM: ADescription := 'An attachment stream is invalid'; + LIB3MF_ERROR_INVALIDPROPERTYCOUNT: ADescription := 'Invalid property count.'; + LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER: ADescription := 'A progress identifier is unknown'; + LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT: ADescription := 'An element buffer exceeds its spec limit'; + LIB3MF_ERROR_INVALIDRESOURCE: ADescription := 'A resource is invalid'; + LIB3MF_ERROR_INVALIDNODEINDEX: ADescription := 'Invalid node index'; + LIB3MF_ERROR_INVALIDATTRIBUTEINDEX: ADescription := 'Invalid attribute index'; + LIB3MF_ERROR_DUPLICATECUSTOMDATA: ADescription := 'Duplicate custom data'; + LIB3MF_ERROR_CUSTOMDATANOTFOUND: ADescription := 'Custom data not found'; + LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE: ADescription := 'This object type is not valid for beamlattices'; + LIB3MF_ERROR_INVALIDKEYSTORE: ADescription := 'The keystore object is invalid'; + LIB3MF_ERROR_INVALIDKEYSTORECONSUMER: ADescription := 'The consumer keystore object is invalid'; + LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND: ADescription := 'A consumer has not been found'; + LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND: ADescription := 'A resource data has not been found'; + LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED: ADescription := 'A Key or Conentent encryption callback has not been registered'; + LIB3MF_ERROR_INVALIDKEYSIZE: ADescription := 'The key size is invalid'; + LIB3MF_ERROR_TOOLPATH_NOTWRITINGHEADER: ADescription := 'Not in toolpath header writing mode'; + LIB3MF_ERROR_TOOLPATH_NOTWRITINGDATA: ADescription := 'Not in toolpath data writing mode'; + LIB3MF_ERROR_TOOLPATH_DATAHASBEENWRITTEN: ADescription := 'Toolpath has already been written out'; + LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT: ADescription := 'Toolpath has an invalid number of points'; + LIB3MF_ERROR_TOOLPATH_ATTRIBUTEALREADYDEFINED: ADescription := 'Toolpath attribute already defined'; + LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE: ADescription := 'Toolpath attribute is of invalid type'; + LIB3MF_ERROR_EMPTYNAMESPACEPREFIX: ADescription := 'Empty namespace prefix.'; + LIB3MF_ERROR_EMPTYNAMESPACE: ADescription := 'Empty namespace.'; + LIB3MF_ERROR_INVALIDNAMESPACEPREFIX: ADescription := 'Invalid namespace prefix.'; + LIB3MF_ERROR_WRITERDOESNOTSUPPORTNAMESPACES: ADescription := 'Writer does not support namespaces.'; + else + ADescription := 'unknown'; + end; + + inherited Create(Format('the 3MF Library Error - %s (#%d, %s)', [ ADescription, AErrorCode, AMessage ])); + end; + + constructor ELib3MFException.CreateCustomMessage(AErrorCode: TLib3MFResult; AMessage: String); + begin + FCustomMessage := AMessage; + FErrorCode := AErrorCode; + inherited Create(Format('%s (%d)', [FCustomMessage, AErrorCode])); + end; + +(************************************************************************************************************************* + Class implementation for Base +**************************************************************************************************************************) + + constructor TLib3MFBase.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + begin + if not Assigned(AWrapper) then + raise ELib3MFException.Create(LIB3MF_ERROR_INVALIDPARAM, ''); + if not Assigned(AHandle) then + raise ELib3MFException.Create(LIB3MF_ERROR_INVALIDPARAM, ''); + + inherited Create(); + FWrapper := AWrapper; + FHandle := AHandle; + end; + + destructor TLib3MFBase.Destroy; + begin + FWrapper.Release(self); + inherited; + end; + + function TLib3MFBase.ClassTypeId(): QWord; + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFBase_ClassTypeIdFunc(FHandle, Result)); + end; + +(************************************************************************************************************************* + Class implementation for BinaryStream +**************************************************************************************************************************) + + constructor TLib3MFBinaryStream.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + begin + inherited Create(AWrapper, AHandle); + end; + + destructor TLib3MFBinaryStream.Destroy; + begin + inherited; + end; + + function TLib3MFBinaryStream.GetBinaryPath(): String; + var + bytesNeededPath: Cardinal; + bytesWrittenPath: Cardinal; + bufferPath: array of Char; + begin + bytesNeededPath:= 0; + bytesWrittenPath:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFBinaryStream_GetBinaryPathFunc(FHandle, 0, bytesNeededPath, nil)); + SetLength(bufferPath, bytesNeededPath); + FWrapper.CheckError(Self, FWrapper.Lib3MFBinaryStream_GetBinaryPathFunc(FHandle, bytesNeededPath, bytesWrittenPath, @bufferPath[0])); + Result := StrPas(@bufferPath[0]); + end; + + function TLib3MFBinaryStream.GetIndexPath(): String; + var + bytesNeededPath: Cardinal; + bytesWrittenPath: Cardinal; + bufferPath: array of Char; + begin + bytesNeededPath:= 0; + bytesWrittenPath:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFBinaryStream_GetIndexPathFunc(FHandle, 0, bytesNeededPath, nil)); + SetLength(bufferPath, bytesNeededPath); + FWrapper.CheckError(Self, FWrapper.Lib3MFBinaryStream_GetIndexPathFunc(FHandle, bytesNeededPath, bytesWrittenPath, @bufferPath[0])); + Result := StrPas(@bufferPath[0]); + end; + + function TLib3MFBinaryStream.GetUUID(): String; + var + bytesNeededUUID: Cardinal; + bytesWrittenUUID: Cardinal; + bufferUUID: array of Char; + begin + bytesNeededUUID:= 0; + bytesWrittenUUID:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFBinaryStream_GetUUIDFunc(FHandle, 0, bytesNeededUUID, nil)); + SetLength(bufferUUID, bytesNeededUUID); + FWrapper.CheckError(Self, FWrapper.Lib3MFBinaryStream_GetUUIDFunc(FHandle, bytesNeededUUID, bytesWrittenUUID, @bufferUUID[0])); + Result := StrPas(@bufferUUID[0]); + end; + + procedure TLib3MFBinaryStream.DisableDiscretizedArrayCompression(); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFBinaryStream_DisableDiscretizedArrayCompressionFunc(FHandle)); + end; + + procedure TLib3MFBinaryStream.EnableDiscretizedArrayCompression(const AUnits: Double; const APredictionType: TLib3MFBinaryStreamPredictionType); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFBinaryStream_EnableDiscretizedArrayCompressionFunc(FHandle, AUnits, convertBinaryStreamPredictionTypeToConst(APredictionType))); + end; + + procedure TLib3MFBinaryStream.EnableLZMA(const ALZMALevel: Cardinal); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFBinaryStream_EnableLZMAFunc(FHandle, ALZMALevel)); + end; + + procedure TLib3MFBinaryStream.DisableLZMA(); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFBinaryStream_DisableLZMAFunc(FHandle)); + end; + +(************************************************************************************************************************* + Class implementation for Writer **************************************************************************************************************************) - function convertPropertyTypeToConst(const AValue: TLib3MFPropertyType): Integer; - function convertConstToPropertyType(const AValue: Integer): TLib3MFPropertyType; - function convertSlicesMeshResolutionToConst(const AValue: TLib3MFSlicesMeshResolution): Integer; - function convertConstToSlicesMeshResolution(const AValue: Integer): TLib3MFSlicesMeshResolution; - function convertModelUnitToConst(const AValue: TLib3MFModelUnit): Integer; - function convertConstToModelUnit(const AValue: Integer): TLib3MFModelUnit; - function convertObjectTypeToConst(const AValue: TLib3MFObjectType): Integer; - function convertConstToObjectType(const AValue: Integer): TLib3MFObjectType; - function convertTextureTypeToConst(const AValue: TLib3MFTextureType): Integer; - function convertConstToTextureType(const AValue: Integer): TLib3MFTextureType; - function convertTextureTileStyleToConst(const AValue: TLib3MFTextureTileStyle): Integer; - function convertConstToTextureTileStyle(const AValue: Integer): TLib3MFTextureTileStyle; - function convertTextureFilterToConst(const AValue: TLib3MFTextureFilter): Integer; - function convertConstToTextureFilter(const AValue: Integer): TLib3MFTextureFilter; - function convertBeamLatticeCapModeToConst(const AValue: TLib3MFBeamLatticeCapMode): Integer; - function convertConstToBeamLatticeCapMode(const AValue: Integer): TLib3MFBeamLatticeCapMode; - function convertBeamLatticeClipModeToConst(const AValue: TLib3MFBeamLatticeClipMode): Integer; - function convertConstToBeamLatticeClipMode(const AValue: Integer): TLib3MFBeamLatticeClipMode; - function convertBeamLatticeBallModeToConst(const AValue: TLib3MFBeamLatticeBallMode): Integer; - function convertConstToBeamLatticeBallMode(const AValue: Integer): TLib3MFBeamLatticeBallMode; - function convertProgressIdentifierToConst(const AValue: TLib3MFProgressIdentifier): Integer; - function convertConstToProgressIdentifier(const AValue: Integer): TLib3MFProgressIdentifier; - function convertBlendMethodToConst(const AValue: TLib3MFBlendMethod): Integer; - function convertConstToBlendMethod(const AValue: Integer): TLib3MFBlendMethod; - function convertEncryptionAlgorithmToConst(const AValue: TLib3MFEncryptionAlgorithm): Integer; - function convertConstToEncryptionAlgorithm(const AValue: Integer): TLib3MFEncryptionAlgorithm; - function convertWrappingAlgorithmToConst(const AValue: TLib3MFWrappingAlgorithm): Integer; - function convertConstToWrappingAlgorithm(const AValue: Integer): TLib3MFWrappingAlgorithm; - function convertMgfAlgorithmToConst(const AValue: TLib3MFMgfAlgorithm): Integer; - function convertConstToMgfAlgorithm(const AValue: Integer): TLib3MFMgfAlgorithm; - function convertDigestMethodToConst(const AValue: TLib3MFDigestMethod): Integer; - function convertConstToDigestMethod(const AValue: Integer): TLib3MFDigestMethod; - function convertCompressionToConst(const AValue: TLib3MFCompression): Integer; - function convertConstToCompression(const AValue: Integer): TLib3MFCompression; + constructor TLib3MFWriter.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + begin + inherited Create(AWrapper, AHandle); + end; - TLib3MFPolymorphicFactory<_T:class; _B> = record - class function Make(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): _T; static; + destructor TLib3MFWriter.Destroy; + begin + inherited; + end; + + procedure TLib3MFWriter.WriteToFile(const AFilename: String); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_WriteToFileFunc(FHandle, PAnsiChar(AFilename))); + end; + + function TLib3MFWriter.GetStreamSize(): QWord; + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_GetStreamSizeFunc(FHandle, Result)); + end; + + procedure TLib3MFWriter.WriteToBuffer(out ABuffer: TByteDynArray); + var + countNeededBuffer: QWord; + countWrittenBuffer: QWord; + begin + countNeededBuffer:= 0; + countWrittenBuffer:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_WriteToBufferFunc(FHandle, 0, countNeededBuffer, nil)); + SetLength(ABuffer, countNeededBuffer); + FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_WriteToBufferFunc(FHandle, countNeededBuffer, countWrittenBuffer, @ABuffer[0])); + end; + + procedure TLib3MFWriter.WriteToCallback(const ATheWriteCallback: PLib3MF_WriteCallback; const ATheSeekCallback: PLib3MF_SeekCallback; const AUserData: Pointer); + begin + if not Assigned(ATheWriteCallback) then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ATheWriteCallback is a nil value.'); + if not Assigned(ATheSeekCallback) then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ATheSeekCallback is a nil value.'); + FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_WriteToCallbackFunc(FHandle, ATheWriteCallback, ATheSeekCallback, AUserData)); + end; + + procedure TLib3MFWriter.SetProgressCallback(const AProgressCallback: PLib3MF_ProgressCallback; const AUserData: Pointer); + begin + if not Assigned(AProgressCallback) then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'AProgressCallback is a nil value.'); + FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_SetProgressCallbackFunc(FHandle, AProgressCallback, AUserData)); + end; + + function TLib3MFWriter.GetDecimalPrecision(): Cardinal; + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_GetDecimalPrecisionFunc(FHandle, Result)); + end; + + procedure TLib3MFWriter.SetDecimalPrecision(const ADecimalPrecision: Cardinal); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_SetDecimalPrecisionFunc(FHandle, ADecimalPrecision)); + end; + + procedure TLib3MFWriter.SetStrictModeActive(const AStrictModeActive: Boolean); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_SetStrictModeActiveFunc(FHandle, Ord(AStrictModeActive))); + end; + + function TLib3MFWriter.GetStrictModeActive(): Boolean; + var + ResultStrictModeActive: Byte; + begin + ResultStrictModeActive := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_GetStrictModeActiveFunc(FHandle, ResultStrictModeActive)); + Result := (ResultStrictModeActive <> 0); + end; + + function TLib3MFWriter.GetWarning(const AIndex: Cardinal; out AErrorCode: Cardinal): String; + var + bytesNeededWarning: Cardinal; + bytesWrittenWarning: Cardinal; + bufferWarning: array of Char; + begin + bytesNeededWarning:= 0; + bytesWrittenWarning:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_GetWarningFunc(FHandle, AIndex, AErrorCode, 0, bytesNeededWarning, nil)); + SetLength(bufferWarning, bytesNeededWarning); + FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_GetWarningFunc(FHandle, AIndex, AErrorCode, bytesNeededWarning, bytesWrittenWarning, @bufferWarning[0])); + Result := StrPas(@bufferWarning[0]); + end; + + function TLib3MFWriter.GetWarningCount(): Cardinal; + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_GetWarningCountFunc(FHandle, Result)); + end; + + procedure TLib3MFWriter.AddKeyWrappingCallback(const AConsumerID: String; const ATheCallback: PLib3MF_KeyWrappingCallback; const AUserData: Pointer); + begin + if not Assigned(ATheCallback) then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ATheCallback is a nil value.'); + FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_AddKeyWrappingCallbackFunc(FHandle, PAnsiChar(AConsumerID), ATheCallback, AUserData)); + end; + + procedure TLib3MFWriter.SetContentEncryptionCallback(const ATheCallback: PLib3MF_ContentEncryptionCallback; const AUserData: Pointer); + begin + if not Assigned(ATheCallback) then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ATheCallback is a nil value.'); + FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_SetContentEncryptionCallbackFunc(FHandle, ATheCallback, AUserData)); + end; + + function TLib3MFWriter.CreateBinaryStream(const AIndexPath: String; const ABinaryPath: String): TLib3MFBinaryStream; + var + HBinaryStream: TLib3MFHandle; + begin + Result := nil; + HBinaryStream := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_CreateBinaryStreamFunc(FHandle, PAnsiChar(AIndexPath), PAnsiChar(ABinaryPath), HBinaryStream)); + if Assigned(HBinaryStream) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HBinaryStream); + end; + + procedure TLib3MFWriter.AssignBinaryStream(const AInstance: TLib3MFBase; const ABinaryStream: TLib3MFBinaryStream); + var + AInstanceHandle: TLib3MFHandle; + ABinaryStreamHandle: TLib3MFHandle; + begin + if Assigned(AInstance) then + AInstanceHandle := AInstance.TheHandle + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'AInstance is a nil value.'); + if Assigned(ABinaryStream) then + ABinaryStreamHandle := ABinaryStream.TheHandle + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ABinaryStream is a nil value.'); + FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_AssignBinaryStreamFunc(FHandle, AInstanceHandle, ABinaryStreamHandle)); + end; + + procedure TLib3MFWriter.RegisterCustomNamespace(const APrefix: String; const ANameSpace: String); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_RegisterCustomNamespaceFunc(FHandle, PAnsiChar(APrefix), PAnsiChar(ANameSpace))); + end; + +(************************************************************************************************************************* + Class implementation for PersistentReaderSource +**************************************************************************************************************************) + + constructor TLib3MFPersistentReaderSource.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + begin + inherited Create(AWrapper, AHandle); + end; + + destructor TLib3MFPersistentReaderSource.Destroy; + begin + inherited; + end; + + function TLib3MFPersistentReaderSource.GetSourceType(): TLib3MFPersistentReaderSourceType; + var + ResultSourceType: Integer; + begin + ResultSourceType := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFPersistentReaderSource_GetSourceTypeFunc(FHandle, ResultSourceType)); + Result := convertConstToPersistentReaderSourceType(ResultSourceType); + end; + + procedure TLib3MFPersistentReaderSource.InvalidateSourceData(); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFPersistentReaderSource_InvalidateSourceDataFunc(FHandle)); + end; + + function TLib3MFPersistentReaderSource.SourceDataIsValid(): Boolean; + var + ResultDataIsValid: Byte; + begin + ResultDataIsValid := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFPersistentReaderSource_SourceDataIsValidFunc(FHandle, ResultDataIsValid)); + Result := (ResultDataIsValid <> 0); + end; + +(************************************************************************************************************************* + Class implementation for Reader +**************************************************************************************************************************) + + constructor TLib3MFReader.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + begin + inherited Create(AWrapper, AHandle); + end; + + destructor TLib3MFReader.Destroy; + begin + inherited; + end; + + procedure TLib3MFReader.ReadFromPersistentSource(const ASource: TLib3MFPersistentReaderSource); + var + ASourceHandle: TLib3MFHandle; + begin + if Assigned(ASource) then + ASourceHandle := ASource.TheHandle + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ASource is a nil value.'); + FWrapper.CheckError(Self, FWrapper.Lib3MFReader_ReadFromPersistentSourceFunc(FHandle, ASourceHandle)); + end; + + procedure TLib3MFReader.ReadFromFile(const AFilename: String); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFReader_ReadFromFileFunc(FHandle, PAnsiChar(AFilename))); + end; + + procedure TLib3MFReader.ReadFromBuffer(const ABuffer: TByteDynArray); + var + PtrBuffer: PByte; + LenBuffer: QWord; + begin + LenBuffer := Length(ABuffer); + if LenBuffer > $FFFFFFFF then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); + if LenBuffer > 0 then + PtrBuffer := @ABuffer[0] + else + PtrBuffer := nil; + + FWrapper.CheckError(Self, FWrapper.Lib3MFReader_ReadFromBufferFunc(FHandle, QWord(LenBuffer), PtrBuffer)); + end; + + procedure TLib3MFReader.ReadFromCallback(const ATheReadCallback: PLib3MF_ReadCallback; const AStreamSize: QWord; const ATheSeekCallback: PLib3MF_SeekCallback; const AUserData: Pointer); + begin + if not Assigned(ATheReadCallback) then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ATheReadCallback is a nil value.'); + if not Assigned(ATheSeekCallback) then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ATheSeekCallback is a nil value.'); + FWrapper.CheckError(Self, FWrapper.Lib3MFReader_ReadFromCallbackFunc(FHandle, ATheReadCallback, AStreamSize, ATheSeekCallback, AUserData)); + end; + + procedure TLib3MFReader.SetProgressCallback(const AProgressCallback: PLib3MF_ProgressCallback; const AUserData: Pointer); + begin + if not Assigned(AProgressCallback) then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'AProgressCallback is a nil value.'); + FWrapper.CheckError(Self, FWrapper.Lib3MFReader_SetProgressCallbackFunc(FHandle, AProgressCallback, AUserData)); + end; + + procedure TLib3MFReader.AddRelationToRead(const ARelationShipType: String); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFReader_AddRelationToReadFunc(FHandle, PAnsiChar(ARelationShipType))); + end; + + procedure TLib3MFReader.RemoveRelationToRead(const ARelationShipType: String); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFReader_RemoveRelationToReadFunc(FHandle, PAnsiChar(ARelationShipType))); end; - function TLib3MFPolymorphicFactoryMakeBase(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBase; - function TLib3MFPolymorphicFactoryMakeWriter(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFWriter; - function TLib3MFPolymorphicFactoryMakeReader(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFReader; - function TLib3MFPolymorphicFactoryMakePackagePart(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFPackagePart; - function TLib3MFPolymorphicFactoryMakeResource(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFResource; - function TLib3MFPolymorphicFactoryMakeResourceIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFResourceIterator; - function TLib3MFPolymorphicFactoryMakeSliceStackIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFSliceStackIterator; - function TLib3MFPolymorphicFactoryMakeObjectIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFObjectIterator; - function TLib3MFPolymorphicFactoryMakeMeshObjectIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMeshObjectIterator; - function TLib3MFPolymorphicFactoryMakeComponentsObjectIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFComponentsObjectIterator; - function TLib3MFPolymorphicFactoryMakeTexture2DIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFTexture2DIterator; - function TLib3MFPolymorphicFactoryMakeBaseMaterialGroupIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBaseMaterialGroupIterator; - function TLib3MFPolymorphicFactoryMakeColorGroupIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFColorGroupIterator; - function TLib3MFPolymorphicFactoryMakeTexture2DGroupIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFTexture2DGroupIterator; - function TLib3MFPolymorphicFactoryMakeCompositeMaterialsIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFCompositeMaterialsIterator; - function TLib3MFPolymorphicFactoryMakeMultiPropertyGroupIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMultiPropertyGroupIterator; - function TLib3MFPolymorphicFactoryMakeMetaData(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMetaData; - function TLib3MFPolymorphicFactoryMakeMetaDataGroup(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMetaDataGroup; - function TLib3MFPolymorphicFactoryMakeObject(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFObject; - function TLib3MFPolymorphicFactoryMakeMeshObject(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMeshObject; - function TLib3MFPolymorphicFactoryMakeBeamLattice(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBeamLattice; - function TLib3MFPolymorphicFactoryMakeComponent(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFComponent; - function TLib3MFPolymorphicFactoryMakeComponentsObject(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFComponentsObject; - function TLib3MFPolymorphicFactoryMakeBeamSet(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBeamSet; - function TLib3MFPolymorphicFactoryMakeBaseMaterialGroup(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBaseMaterialGroup; - function TLib3MFPolymorphicFactoryMakeColorGroup(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFColorGroup; - function TLib3MFPolymorphicFactoryMakeTexture2DGroup(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFTexture2DGroup; - function TLib3MFPolymorphicFactoryMakeCompositeMaterials(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFCompositeMaterials; - function TLib3MFPolymorphicFactoryMakeMultiPropertyGroup(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMultiPropertyGroup; - function TLib3MFPolymorphicFactoryMakeAttachment(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFAttachment; - function TLib3MFPolymorphicFactoryMakeTexture2D(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFTexture2D; - function TLib3MFPolymorphicFactoryMakeBuildItem(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBuildItem; - function TLib3MFPolymorphicFactoryMakeBuildItemIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBuildItemIterator; - function TLib3MFPolymorphicFactoryMakeSlice(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFSlice; - function TLib3MFPolymorphicFactoryMakeSliceStack(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFSliceStack; - function TLib3MFPolymorphicFactoryMakeConsumer(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFConsumer; - function TLib3MFPolymorphicFactoryMakeAccessRight(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFAccessRight; - function TLib3MFPolymorphicFactoryMakeContentEncryptionParams(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFContentEncryptionParams; - function TLib3MFPolymorphicFactoryMakeResourceData(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFResourceData; - function TLib3MFPolymorphicFactoryMakeResourceDataGroup(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFResourceDataGroup; - function TLib3MFPolymorphicFactoryMakeKeyStore(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFKeyStore; - function TLib3MFPolymorphicFactoryMakeModel(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFModel; -implementation + procedure TLib3MFReader.SetStrictModeActive(const AStrictModeActive: Boolean); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFReader_SetStrictModeActiveFunc(FHandle, Ord(AStrictModeActive))); + end; -(************************************************************************************************************************* - Enum conversion -**************************************************************************************************************************) + function TLib3MFReader.GetStrictModeActive(): Boolean; + var + ResultStrictModeActive: Byte; + begin + ResultStrictModeActive := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFReader_GetStrictModeActiveFunc(FHandle, ResultStrictModeActive)); + Result := (ResultStrictModeActive <> 0); + end; - function convertPropertyTypeToConst(const AValue: TLib3MFPropertyType): Integer; + function TLib3MFReader.GetWarning(const AIndex: Cardinal; out AErrorCode: Cardinal): String; + var + bytesNeededWarning: Cardinal; + bytesWrittenWarning: Cardinal; + bufferWarning: array of Char; begin - case AValue of - ePropertyTypeNoPropertyType: Result := 0; - ePropertyTypeBaseMaterial: Result := 1; - ePropertyTypeTexCoord: Result := 2; - ePropertyTypeColors: Result := 3; - ePropertyTypeComposite: Result := 4; - ePropertyTypeMulti: Result := 5; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); - end; + bytesNeededWarning:= 0; + bytesWrittenWarning:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFReader_GetWarningFunc(FHandle, AIndex, AErrorCode, 0, bytesNeededWarning, nil)); + SetLength(bufferWarning, bytesNeededWarning); + FWrapper.CheckError(Self, FWrapper.Lib3MFReader_GetWarningFunc(FHandle, AIndex, AErrorCode, bytesNeededWarning, bytesWrittenWarning, @bufferWarning[0])); + Result := StrPas(@bufferWarning[0]); end; - - function convertConstToPropertyType(const AValue: Integer): TLib3MFPropertyType; + + function TLib3MFReader.GetWarningCount(): Cardinal; begin - case AValue of - 0: Result := ePropertyTypeNoPropertyType; - 1: Result := ePropertyTypeBaseMaterial; - 2: Result := ePropertyTypeTexCoord; - 3: Result := ePropertyTypeColors; - 4: Result := ePropertyTypeComposite; - 5: Result := ePropertyTypeMulti; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); - end; + FWrapper.CheckError(Self, FWrapper.Lib3MFReader_GetWarningCountFunc(FHandle, Result)); end; - - - function convertSlicesMeshResolutionToConst(const AValue: TLib3MFSlicesMeshResolution): Integer; + + procedure TLib3MFReader.AddKeyWrappingCallback(const AConsumerID: String; const ATheCallback: PLib3MF_KeyWrappingCallback; const AUserData: Pointer); begin - case AValue of - eSlicesMeshResolutionFullres: Result := 0; - eSlicesMeshResolutionLowres: Result := 1; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); - end; + if not Assigned(ATheCallback) then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ATheCallback is a nil value.'); + FWrapper.CheckError(Self, FWrapper.Lib3MFReader_AddKeyWrappingCallbackFunc(FHandle, PAnsiChar(AConsumerID), ATheCallback, AUserData)); end; - - function convertConstToSlicesMeshResolution(const AValue: Integer): TLib3MFSlicesMeshResolution; + + procedure TLib3MFReader.SetContentEncryptionCallback(const ATheCallback: PLib3MF_ContentEncryptionCallback; const AUserData: Pointer); begin - case AValue of - 0: Result := eSlicesMeshResolutionFullres; - 1: Result := eSlicesMeshResolutionLowres; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); - end; + if not Assigned(ATheCallback) then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ATheCallback is a nil value.'); + FWrapper.CheckError(Self, FWrapper.Lib3MFReader_SetContentEncryptionCallbackFunc(FHandle, ATheCallback, AUserData)); end; - - - function convertModelUnitToConst(const AValue: TLib3MFModelUnit): Integer; + +(************************************************************************************************************************* + Class implementation for PackagePart +**************************************************************************************************************************) + + constructor TLib3MFPackagePart.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin - case AValue of - eModelUnitMicroMeter: Result := 0; - eModelUnitMilliMeter: Result := 1; - eModelUnitCentiMeter: Result := 2; - eModelUnitInch: Result := 3; - eModelUnitFoot: Result := 4; - eModelUnitMeter: Result := 5; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); - end; + inherited Create(AWrapper, AHandle); end; - - function convertConstToModelUnit(const AValue: Integer): TLib3MFModelUnit; + + destructor TLib3MFPackagePart.Destroy; begin - case AValue of - 0: Result := eModelUnitMicroMeter; - 1: Result := eModelUnitMilliMeter; - 2: Result := eModelUnitCentiMeter; - 3: Result := eModelUnitInch; - 4: Result := eModelUnitFoot; - 5: Result := eModelUnitMeter; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); - end; + inherited; end; - - - function convertObjectTypeToConst(const AValue: TLib3MFObjectType): Integer; + + function TLib3MFPackagePart.GetPath(): String; + var + bytesNeededPath: Cardinal; + bytesWrittenPath: Cardinal; + bufferPath: array of Char; begin - case AValue of - eObjectTypeOther: Result := 0; - eObjectTypeModel: Result := 1; - eObjectTypeSupport: Result := 2; - eObjectTypeSolidSupport: Result := 3; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); - end; + bytesNeededPath:= 0; + bytesWrittenPath:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFPackagePart_GetPathFunc(FHandle, 0, bytesNeededPath, nil)); + SetLength(bufferPath, bytesNeededPath); + FWrapper.CheckError(Self, FWrapper.Lib3MFPackagePart_GetPathFunc(FHandle, bytesNeededPath, bytesWrittenPath, @bufferPath[0])); + Result := StrPas(@bufferPath[0]); end; - - function convertConstToObjectType(const AValue: Integer): TLib3MFObjectType; + + procedure TLib3MFPackagePart.SetPath(const APath: String); begin - case AValue of - 0: Result := eObjectTypeOther; - 1: Result := eObjectTypeModel; - 2: Result := eObjectTypeSupport; - 3: Result := eObjectTypeSolidSupport; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); - end; + FWrapper.CheckError(Self, FWrapper.Lib3MFPackagePart_SetPathFunc(FHandle, PAnsiChar(APath))); end; - - - function convertTextureTypeToConst(const AValue: TLib3MFTextureType): Integer; + +(************************************************************************************************************************* + Class implementation for Resource +**************************************************************************************************************************) + + constructor TLib3MFResource.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin - case AValue of - eTextureTypeUnknown: Result := 0; - eTextureTypePNG: Result := 1; - eTextureTypeJPEG: Result := 2; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); - end; + inherited Create(AWrapper, AHandle); end; - - function convertConstToTextureType(const AValue: Integer): TLib3MFTextureType; + + destructor TLib3MFResource.Destroy; begin - case AValue of - 0: Result := eTextureTypeUnknown; - 1: Result := eTextureTypePNG; - 2: Result := eTextureTypeJPEG; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); - end; + inherited; end; - - - function convertTextureTileStyleToConst(const AValue: TLib3MFTextureTileStyle): Integer; + + function TLib3MFResource.GetResourceID(): Cardinal; begin - case AValue of - eTextureTileStyleWrap: Result := 0; - eTextureTileStyleMirror: Result := 1; - eTextureTileStyleClamp: Result := 2; - eTextureTileStyleNoTileStyle: Result := 3; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); - end; + FWrapper.CheckError(Self, FWrapper.Lib3MFResource_GetResourceIDFunc(FHandle, Result)); end; - - function convertConstToTextureTileStyle(const AValue: Integer): TLib3MFTextureTileStyle; + + function TLib3MFResource.GetUniqueResourceID(): Cardinal; begin - case AValue of - 0: Result := eTextureTileStyleWrap; - 1: Result := eTextureTileStyleMirror; - 2: Result := eTextureTileStyleClamp; - 3: Result := eTextureTileStyleNoTileStyle; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); - end; + FWrapper.CheckError(Self, FWrapper.Lib3MFResource_GetUniqueResourceIDFunc(FHandle, Result)); + end; + + function TLib3MFResource.PackagePart(): TLib3MFPackagePart; + var + HPackagePart: TLib3MFHandle; + begin + Result := nil; + HPackagePart := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFResource_PackagePartFunc(FHandle, HPackagePart)); + if Assigned(HPackagePart) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HPackagePart); end; - - - function convertTextureFilterToConst(const AValue: TLib3MFTextureFilter): Integer; + + procedure TLib3MFResource.SetPackagePart(const APackagePart: TLib3MFPackagePart); + var + APackagePartHandle: TLib3MFHandle; begin - case AValue of - eTextureFilterAuto: Result := 0; - eTextureFilterLinear: Result := 1; - eTextureFilterNearest: Result := 2; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); - end; + if Assigned(APackagePart) then + APackagePartHandle := APackagePart.TheHandle + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'APackagePart is a nil value.'); + FWrapper.CheckError(Self, FWrapper.Lib3MFResource_SetPackagePartFunc(FHandle, APackagePartHandle)); end; - - function convertConstToTextureFilter(const AValue: Integer): TLib3MFTextureFilter; + + function TLib3MFResource.GetModelResourceID(): Cardinal; begin - case AValue of - 0: Result := eTextureFilterAuto; - 1: Result := eTextureFilterLinear; - 2: Result := eTextureFilterNearest; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); - end; + FWrapper.CheckError(Self, FWrapper.Lib3MFResource_GetModelResourceIDFunc(FHandle, Result)); end; - - - function convertBeamLatticeCapModeToConst(const AValue: TLib3MFBeamLatticeCapMode): Integer; + +(************************************************************************************************************************* + Class implementation for ResourceIterator +**************************************************************************************************************************) + + constructor TLib3MFResourceIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin - case AValue of - eBeamLatticeCapModeSphere: Result := 0; - eBeamLatticeCapModeHemiSphere: Result := 1; - eBeamLatticeCapModeButt: Result := 2; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); - end; + inherited Create(AWrapper, AHandle); end; - - function convertConstToBeamLatticeCapMode(const AValue: Integer): TLib3MFBeamLatticeCapMode; + + destructor TLib3MFResourceIterator.Destroy; begin - case AValue of - 0: Result := eBeamLatticeCapModeSphere; - 1: Result := eBeamLatticeCapModeHemiSphere; - 2: Result := eBeamLatticeCapModeButt; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); - end; + inherited; end; - - - function convertBeamLatticeClipModeToConst(const AValue: TLib3MFBeamLatticeClipMode): Integer; + + function TLib3MFResourceIterator.MoveNext(): Boolean; + var + ResultHasNext: Byte; begin - case AValue of - eBeamLatticeClipModeNoClipMode: Result := 0; - eBeamLatticeClipModeInside: Result := 1; - eBeamLatticeClipModeOutside: Result := 2; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); - end; + ResultHasNext := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFResourceIterator_MoveNextFunc(FHandle, ResultHasNext)); + Result := (ResultHasNext <> 0); end; - - function convertConstToBeamLatticeClipMode(const AValue: Integer): TLib3MFBeamLatticeClipMode; + + function TLib3MFResourceIterator.MovePrevious(): Boolean; + var + ResultHasPrevious: Byte; begin - case AValue of - 0: Result := eBeamLatticeClipModeNoClipMode; - 1: Result := eBeamLatticeClipModeInside; - 2: Result := eBeamLatticeClipModeOutside; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); - end; + ResultHasPrevious := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFResourceIterator_MovePreviousFunc(FHandle, ResultHasPrevious)); + Result := (ResultHasPrevious <> 0); end; - - - function convertBeamLatticeBallModeToConst(const AValue: TLib3MFBeamLatticeBallMode): Integer; + + function TLib3MFResourceIterator.GetCurrent(): TLib3MFResource; + var + HResource: TLib3MFHandle; begin - case AValue of - eBeamLatticeBallModeNone: Result := 0; - eBeamLatticeBallModeMixed: Result := 1; - eBeamLatticeBallModeAll: Result := 2; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); - end; + Result := nil; + HResource := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFResourceIterator_GetCurrentFunc(FHandle, HResource)); + if Assigned(HResource) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResource); end; - - function convertConstToBeamLatticeBallMode(const AValue: Integer): TLib3MFBeamLatticeBallMode; + + function TLib3MFResourceIterator.Clone(): TLib3MFResourceIterator; + var + HOutResourceIterator: TLib3MFHandle; begin - case AValue of - 0: Result := eBeamLatticeBallModeNone; - 1: Result := eBeamLatticeBallModeMixed; - 2: Result := eBeamLatticeBallModeAll; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); - end; + Result := nil; + HOutResourceIterator := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFResourceIterator_CloneFunc(FHandle, HOutResourceIterator)); + if Assigned(HOutResourceIterator) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HOutResourceIterator); end; - - - function convertProgressIdentifierToConst(const AValue: TLib3MFProgressIdentifier): Integer; + + function TLib3MFResourceIterator.Count(): QWord; begin - case AValue of - eProgressIdentifierQUERYCANCELED: Result := 0; - eProgressIdentifierDONE: Result := 1; - eProgressIdentifierCLEANUP: Result := 2; - eProgressIdentifierREADSTREAM: Result := 3; - eProgressIdentifierEXTRACTOPCPACKAGE: Result := 4; - eProgressIdentifierREADNONROOTMODELS: Result := 5; - eProgressIdentifierREADROOTMODEL: Result := 6; - eProgressIdentifierREADRESOURCES: Result := 7; - eProgressIdentifierREADMESH: Result := 8; - eProgressIdentifierREADSLICES: Result := 9; - eProgressIdentifierREADBUILD: Result := 10; - eProgressIdentifierREADCUSTOMATTACHMENT: Result := 11; - eProgressIdentifierREADTEXTURETACHMENTS: Result := 12; - eProgressIdentifierCREATEOPCPACKAGE: Result := 13; - eProgressIdentifierWRITEMODELSTOSTREAM: Result := 14; - eProgressIdentifierWRITEROOTMODEL: Result := 15; - eProgressIdentifierWRITENONROOTMODELS: Result := 16; - eProgressIdentifierWRITEATTACHMENTS: Result := 17; - eProgressIdentifierWRITECONTENTTYPES: Result := 18; - eProgressIdentifierWRITENOBJECTS: Result := 19; - eProgressIdentifierWRITENODES: Result := 20; - eProgressIdentifierWRITETRIANGLES: Result := 21; - eProgressIdentifierWRITESLICES: Result := 22; - eProgressIdentifierWRITEKEYSTORE: Result := 23; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); - end; + FWrapper.CheckError(Self, FWrapper.Lib3MFResourceIterator_CountFunc(FHandle, Result)); end; - - function convertConstToProgressIdentifier(const AValue: Integer): TLib3MFProgressIdentifier; + +(************************************************************************************************************************* + Class implementation for CustomXMLAttribute +**************************************************************************************************************************) + + constructor TLib3MFCustomXMLAttribute.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin - case AValue of - 0: Result := eProgressIdentifierQUERYCANCELED; - 1: Result := eProgressIdentifierDONE; - 2: Result := eProgressIdentifierCLEANUP; - 3: Result := eProgressIdentifierREADSTREAM; - 4: Result := eProgressIdentifierEXTRACTOPCPACKAGE; - 5: Result := eProgressIdentifierREADNONROOTMODELS; - 6: Result := eProgressIdentifierREADROOTMODEL; - 7: Result := eProgressIdentifierREADRESOURCES; - 8: Result := eProgressIdentifierREADMESH; - 9: Result := eProgressIdentifierREADSLICES; - 10: Result := eProgressIdentifierREADBUILD; - 11: Result := eProgressIdentifierREADCUSTOMATTACHMENT; - 12: Result := eProgressIdentifierREADTEXTURETACHMENTS; - 13: Result := eProgressIdentifierCREATEOPCPACKAGE; - 14: Result := eProgressIdentifierWRITEMODELSTOSTREAM; - 15: Result := eProgressIdentifierWRITEROOTMODEL; - 16: Result := eProgressIdentifierWRITENONROOTMODELS; - 17: Result := eProgressIdentifierWRITEATTACHMENTS; - 18: Result := eProgressIdentifierWRITECONTENTTYPES; - 19: Result := eProgressIdentifierWRITENOBJECTS; - 20: Result := eProgressIdentifierWRITENODES; - 21: Result := eProgressIdentifierWRITETRIANGLES; - 22: Result := eProgressIdentifierWRITESLICES; - 23: Result := eProgressIdentifierWRITEKEYSTORE; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); - end; + inherited Create(AWrapper, AHandle); end; - - - function convertBlendMethodToConst(const AValue: TLib3MFBlendMethod): Integer; + + destructor TLib3MFCustomXMLAttribute.Destroy; begin - case AValue of - eBlendMethodNoBlendMethod: Result := 0; - eBlendMethodMix: Result := 1; - eBlendMethodMultiply: Result := 2; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); - end; + inherited; end; - - function convertConstToBlendMethod(const AValue: Integer): TLib3MFBlendMethod; + + function TLib3MFCustomXMLAttribute.GetName(): String; + var + bytesNeededName: Cardinal; + bytesWrittenName: Cardinal; + bufferName: array of Char; begin - case AValue of - 0: Result := eBlendMethodNoBlendMethod; - 1: Result := eBlendMethodMix; - 2: Result := eBlendMethodMultiply; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); - end; + bytesNeededName:= 0; + bytesWrittenName:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLAttribute_GetNameFunc(FHandle, 0, bytesNeededName, nil)); + SetLength(bufferName, bytesNeededName); + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLAttribute_GetNameFunc(FHandle, bytesNeededName, bytesWrittenName, @bufferName[0])); + Result := StrPas(@bufferName[0]); end; - - - function convertEncryptionAlgorithmToConst(const AValue: TLib3MFEncryptionAlgorithm): Integer; + + function TLib3MFCustomXMLAttribute.GetValue(): String; + var + bytesNeededValue: Cardinal; + bytesWrittenValue: Cardinal; + bufferValue: array of Char; begin - case AValue of - eEncryptionAlgorithmAES256_GCM: Result := 1; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); - end; + bytesNeededValue:= 0; + bytesWrittenValue:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLAttribute_GetValueFunc(FHandle, 0, bytesNeededValue, nil)); + SetLength(bufferValue, bytesNeededValue); + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLAttribute_GetValueFunc(FHandle, bytesNeededValue, bytesWrittenValue, @bufferValue[0])); + Result := StrPas(@bufferValue[0]); + end; + + function TLib3MFCustomXMLAttribute.IsValidInteger(const AMinValue: Int64; const AMaxValue: Int64): Boolean; + var + ResultIsValid: Byte; + begin + ResultIsValid := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLAttribute_IsValidIntegerFunc(FHandle, AMinValue, AMaxValue, ResultIsValid)); + Result := (ResultIsValid <> 0); end; - - function convertConstToEncryptionAlgorithm(const AValue: Integer): TLib3MFEncryptionAlgorithm; + + function TLib3MFCustomXMLAttribute.GetIntegerValue(const AMinValue: Int64; const AMaxValue: Int64): Int64; begin - case AValue of - 1: Result := eEncryptionAlgorithmAES256_GCM; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); - end; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLAttribute_GetIntegerValueFunc(FHandle, AMinValue, AMaxValue, Result)); end; - - - function convertWrappingAlgorithmToConst(const AValue: TLib3MFWrappingAlgorithm): Integer; + + function TLib3MFCustomXMLAttribute.IsValidDouble(const AMinValue: Double; const AMaxValue: Double): Boolean; + var + ResultIsValid: Byte; begin - case AValue of - eWrappingAlgorithmRSA_OAEP: Result := 0; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); - end; + ResultIsValid := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLAttribute_IsValidDoubleFunc(FHandle, AMinValue, AMaxValue, ResultIsValid)); + Result := (ResultIsValid <> 0); end; - - function convertConstToWrappingAlgorithm(const AValue: Integer): TLib3MFWrappingAlgorithm; + + function TLib3MFCustomXMLAttribute.GetDoubleValue(const AMinValue: Double; const AMaxValue: Double): Double; begin - case AValue of - 0: Result := eWrappingAlgorithmRSA_OAEP; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); - end; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLAttribute_GetDoubleValueFunc(FHandle, AMinValue, AMaxValue, Result)); end; - - - function convertMgfAlgorithmToConst(const AValue: TLib3MFMgfAlgorithm): Integer; + + function TLib3MFCustomXMLAttribute.IsValidBool(): Boolean; + var + ResultIsValid: Byte; begin - case AValue of - eMgfAlgorithmMGF1_SHA1: Result := 160; - eMgfAlgorithmMGF1_SHA224: Result := 224; - eMgfAlgorithmMGF1_SHA256: Result := 256; - eMgfAlgorithmMGF1_SHA384: Result := 384; - eMgfAlgorithmMGF1_SHA512: Result := 512; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); - end; + ResultIsValid := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLAttribute_IsValidBoolFunc(FHandle, ResultIsValid)); + Result := (ResultIsValid <> 0); end; - - function convertConstToMgfAlgorithm(const AValue: Integer): TLib3MFMgfAlgorithm; + + function TLib3MFCustomXMLAttribute.GetBoolValue(const AMinValue: Double; const AMaxValue: Double): Boolean; + var + ResultValue: Byte; begin - case AValue of - 160: Result := eMgfAlgorithmMGF1_SHA1; - 224: Result := eMgfAlgorithmMGF1_SHA224; - 256: Result := eMgfAlgorithmMGF1_SHA256; - 384: Result := eMgfAlgorithmMGF1_SHA384; - 512: Result := eMgfAlgorithmMGF1_SHA512; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); - end; + ResultValue := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLAttribute_GetBoolValueFunc(FHandle, AMinValue, AMaxValue, ResultValue)); + Result := (ResultValue <> 0); end; - - - function convertDigestMethodToConst(const AValue: TLib3MFDigestMethod): Integer; + + procedure TLib3MFCustomXMLAttribute.SetValue(const AValue: String); begin - case AValue of - eDigestMethodSHA1: Result := 160; - eDigestMethodSHA256: Result := 256; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); - end; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLAttribute_SetValueFunc(FHandle, PAnsiChar(AValue))); end; - - function convertConstToDigestMethod(const AValue: Integer): TLib3MFDigestMethod; + + procedure TLib3MFCustomXMLAttribute.SetIntegerValue(const AValue: Int64); begin - case AValue of - 160: Result := eDigestMethodSHA1; - 256: Result := eDigestMethodSHA256; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); - end; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLAttribute_SetIntegerValueFunc(FHandle, AValue)); end; - - - function convertCompressionToConst(const AValue: TLib3MFCompression): Integer; + + procedure TLib3MFCustomXMLAttribute.SetDoubleValue(const AValue: Double); begin - case AValue of - eCompressionNoCompression: Result := 0; - eCompressionDeflate: Result := 1; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum value'); - end; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLAttribute_SetDoubleValueFunc(FHandle, AValue)); end; - - function convertConstToCompression(const AValue: Integer): TLib3MFCompression; + + procedure TLib3MFCustomXMLAttribute.SetBoolValue(const AValue: Boolean); begin - case AValue of - 0: Result := eCompressionNoCompression; - 1: Result := eCompressionDeflate; - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'invalid enum constant'); - end; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLAttribute_SetBoolValueFunc(FHandle, Ord(AValue))); end; - - + procedure TLib3MFCustomXMLAttribute.Remove(); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLAttribute_RemoveFunc(FHandle)); + end; (************************************************************************************************************************* - PolymorficFactory implementation + Class implementation for CustomXMLNode **************************************************************************************************************************) - (** - * IMPORTANT: PolymorphicFactory method should not be used by application directly. - * It's designed to be used on Lib3MFHandle object only once. - * If it's used on any existing object as a form of dynamic cast then - * TLIB3MFWrapper::AcquireInstance(object: TLIB3MFBase) must be called after instantiating new object. - * This is important to keep reference count matching between application and library sides. - *) - class function TLib3MFPolymorphicFactory<_T, _B>.Make(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): _T; + constructor TLib3MFCustomXMLNode.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + begin + inherited Create(AWrapper, AHandle); + end; + + destructor TLib3MFCustomXMLNode.Destroy; + begin + inherited; + end; + + function TLib3MFCustomXMLNode.GetName(): String; var - ClassTypeId: QWord; - Obj: TLIB3MFBase; + bytesNeededName: Cardinal; + bytesWrittenName: Cardinal; + bufferName: array of Char; begin - Result := nil; - Wrapper.CheckError(nil, Wrapper.Lib3MFBase_ClassTypeIdFunc(handle, ClassTypeId)); - case (ClassTypeId) of - QWord($856632D0BAF1D8B7): begin Obj := TLIB3MFBase.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Base" - QWord($E76F642F363FD7E9): begin Obj := TLIB3MFWriter.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Writer" - QWord($2D86831DA59FBE72): begin Obj := TLIB3MFReader.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Reader" - QWord($0E55A826D377483E): begin Obj := TLIB3MFPackagePart.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::PackagePart" - QWord($DFE3889D1B269CBB): begin Obj := TLIB3MFResource.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Resource" - QWord($460F3515E2621DBE): begin Obj := TLIB3MFResourceIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ResourceIterator" - QWord($69684DB99FA813F6): begin Obj := TLIB3MFSliceStackIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::SliceStackIterator" - QWord($DE92510BD2112288): begin Obj := TLIB3MFObjectIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ObjectIterator" - QWord($F4196034E2B9FDE6): begin Obj := TLIB3MFMeshObjectIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::MeshObjectIterator" - QWord($564DE4217ED7614A): begin Obj := TLIB3MFComponentsObjectIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ComponentsObjectIterator" - QWord($4BD32B4870FFC03B): begin Obj := TLIB3MFTexture2DIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2DIterator" - QWord($65E6EDD9362C79CB): begin Obj := TLIB3MFBaseMaterialGroupIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::BaseMaterialGroupIterator" - QWord($10274A1757C729C0): begin Obj := TLIB3MFColorGroupIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ColorGroupIterator" - QWord($30D55F4DB88FE0CA): begin Obj := TLIB3MFTexture2DGroupIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2DGroupIterator" - QWord($A99CC6C3F70FB6F9): begin Obj := TLIB3MFCompositeMaterialsIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::CompositeMaterialsIterator" - QWord($C2BDF5D8CBBDB1F0): begin Obj := TLIB3MFMultiPropertyGroupIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::MultiPropertyGroupIterator" - QWord($D17716D063DE2C22): begin Obj := TLIB3MFMetaData.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::MetaData" - QWord($0C3B85369E9B25D3): begin Obj := TLIB3MFMetaDataGroup.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::MetaDataGroup" - QWord($2DA2136F577A779C): begin Obj := TLIB3MFObject.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Object" - QWord($3B3A6DC6EC610497): begin Obj := TLIB3MFMeshObject.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::MeshObject" - QWord($63B3B461B30B4BA5): begin Obj := TLIB3MFBeamLattice.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::BeamLattice" - QWord($4ECDB6A6F69F2BEB): begin Obj := TLIB3MFComponent.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Component" - QWord($6522CF04EB283FED): begin Obj := TLIB3MFComponentsObject.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ComponentsObject" - QWord($30CCDBE90E00B55B): begin Obj := TLIB3MFBeamSet.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::BeamSet" - QWord($B27D4656E16609FA): begin Obj := TLIB3MFBaseMaterialGroup.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::BaseMaterialGroup" - QWord($D085FB2E49CDB5B1): begin Obj := TLIB3MFColorGroup.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ColorGroup" - QWord($BC1208397E37055D): begin Obj := TLIB3MFTexture2DGroup.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2DGroup" - QWord($CE16224D688B86F2): begin Obj := TLIB3MFCompositeMaterials.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::CompositeMaterials" - QWord($B989E02E43158FE6): begin Obj := TLIB3MFMultiPropertyGroup.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::MultiPropertyGroup" - QWord($8CE7A1191A63A35D): begin Obj := TLIB3MFAttachment.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Attachment" - QWord($E0441CF976B36319): begin Obj := TLIB3MFTexture2D.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2D" - QWord($68FB2D5FFC4BA12A): begin Obj := TLIB3MFBuildItem.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::BuildItem" - QWord($A7D21BD364910860): begin Obj := TLIB3MFBuildItemIterator.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::BuildItemIterator" - QWord($2198BCF4D8DF9C40): begin Obj := TLIB3MFSlice.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Slice" - QWord($6594B031B6096238): begin Obj := TLIB3MFSliceStack.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::SliceStack" - QWord($D9E46D5E6D8118EE): begin Obj := TLIB3MFConsumer.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Consumer" - QWord($385C42FC5609498A): begin Obj := TLIB3MFAccessRight.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::AccessRight" - QWord($7FB36B91D4CE4671): begin Obj := TLIB3MFContentEncryptionParams.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ContentEncryptionParams" - QWord($1A47A5E258E22EF9): begin Obj := TLIB3MFResourceData.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ResourceData" - QWord($D59067227E428AA4): begin Obj := TLIB3MFResourceDataGroup.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::ResourceDataGroup" - QWord($1CC9E0CC082253C6): begin Obj := TLIB3MFKeyStore.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::KeyStore" - QWord($5A8164ECEDB03F09): begin Obj := TLIB3MFModel.Create(Wrapper, Handle); if Obj.inheritsFrom(_T) then Result := Obj as _T; end; // First 64 bits of SHA1 of a string: "Lib3MF::Model" - end; - if Result = nil then Result := _B.Create(Wrapper, Handle); + bytesNeededName:= 0; + bytesWrittenName:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNode_GetNameFunc(FHandle, 0, bytesNeededName, nil)); + SetLength(bufferName, bytesNeededName); + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNode_GetNameFunc(FHandle, bytesNeededName, bytesWrittenName, @bufferName[0])); + Result := StrPas(@bufferName[0]); end; - function TLib3MFPolymorphicFactoryMakeBase(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBase; + + function TLib3MFCustomXMLNode.GetNameSpace(): String; + var + bytesNeededNameSpace: Cardinal; + bytesWrittenNameSpace: Cardinal; + bufferNameSpace: array of Char; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + bytesNeededNameSpace:= 0; + bytesWrittenNameSpace:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNode_GetNameSpaceFunc(FHandle, 0, bytesNeededNameSpace, nil)); + SetLength(bufferNameSpace, bytesNeededNameSpace); + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNode_GetNameSpaceFunc(FHandle, bytesNeededNameSpace, bytesWrittenNameSpace, @bufferNameSpace[0])); + Result := StrPas(@bufferNameSpace[0]); end; - function TLib3MFPolymorphicFactoryMakeWriter(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFWriter; + + function TLib3MFCustomXMLNode.GetAttributeCount(): QWord; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNode_GetAttributeCountFunc(FHandle, Result)); end; - function TLib3MFPolymorphicFactoryMakeReader(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFReader; + + function TLib3MFCustomXMLNode.GetAttribute(const AIndex: QWord): TLib3MFCustomXMLAttribute; + var + HAttributeInstance: TLib3MFHandle; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + Result := nil; + HAttributeInstance := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNode_GetAttributeFunc(FHandle, AIndex, HAttributeInstance)); + if Assigned(HAttributeInstance) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HAttributeInstance); end; - function TLib3MFPolymorphicFactoryMakePackagePart(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFPackagePart; + + function TLib3MFCustomXMLNode.HasAttribute(const AName: String): Boolean; + var + ResultAttributeExists: Byte; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + ResultAttributeExists := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNode_HasAttributeFunc(FHandle, PAnsiChar(AName), ResultAttributeExists)); + Result := (ResultAttributeExists <> 0); end; - function TLib3MFPolymorphicFactoryMakeResource(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFResource; + + function TLib3MFCustomXMLNode.FindAttribute(const AName: String; const AMustExist: Boolean): TLib3MFCustomXMLAttribute; + var + HAttributeInstance: TLib3MFHandle; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + Result := nil; + HAttributeInstance := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNode_FindAttributeFunc(FHandle, PAnsiChar(AName), Ord(AMustExist), HAttributeInstance)); + if Assigned(HAttributeInstance) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HAttributeInstance); end; - function TLib3MFPolymorphicFactoryMakeResourceIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFResourceIterator; + + function TLib3MFCustomXMLNode.RemoveAttribute(const AName: String): Boolean; + var + ResultAttributeRemoved: Byte; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + ResultAttributeRemoved := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNode_RemoveAttributeFunc(FHandle, PAnsiChar(AName), ResultAttributeRemoved)); + Result := (ResultAttributeRemoved <> 0); end; - function TLib3MFPolymorphicFactoryMakeSliceStackIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFSliceStackIterator; + + function TLib3MFCustomXMLNode.RemoveAttributeByIndex(const AIndex: QWord): Boolean; + var + ResultAttributeRemoved: Byte; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + ResultAttributeRemoved := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNode_RemoveAttributeByIndexFunc(FHandle, AIndex, ResultAttributeRemoved)); + Result := (ResultAttributeRemoved <> 0); end; - function TLib3MFPolymorphicFactoryMakeObjectIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFObjectIterator; + + procedure TLib3MFCustomXMLNode.AddAttribute(const AName: String; const AValue: String); begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNode_AddAttributeFunc(FHandle, PAnsiChar(AName), PAnsiChar(AValue))); end; - function TLib3MFPolymorphicFactoryMakeMeshObjectIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMeshObjectIterator; + + procedure TLib3MFCustomXMLNode.AddIntegerAttribute(const AName: String; const AValue: Int64); begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNode_AddIntegerAttributeFunc(FHandle, PAnsiChar(AName), AValue)); end; - function TLib3MFPolymorphicFactoryMakeComponentsObjectIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFComponentsObjectIterator; + + procedure TLib3MFCustomXMLNode.AddDoubleAttribute(const AName: String; const AValue: Double); begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNode_AddDoubleAttributeFunc(FHandle, PAnsiChar(AName), AValue)); end; - function TLib3MFPolymorphicFactoryMakeTexture2DIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFTexture2DIterator; + + procedure TLib3MFCustomXMLNode.AddBoolAttribute(const AName: String; const AValue: Boolean); begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNode_AddBoolAttributeFunc(FHandle, PAnsiChar(AName), Ord(AValue))); end; - function TLib3MFPolymorphicFactoryMakeBaseMaterialGroupIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBaseMaterialGroupIterator; + + function TLib3MFCustomXMLNode.GetChildren(): TLib3MFCustomXMLNodes; + var + HChildNodes: TLib3MFHandle; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + Result := nil; + HChildNodes := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNode_GetChildrenFunc(FHandle, HChildNodes)); + if Assigned(HChildNodes) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HChildNodes); end; - function TLib3MFPolymorphicFactoryMakeColorGroupIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFColorGroupIterator; + + function TLib3MFCustomXMLNode.CountChildrenByName(const AName: String): QWord; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNode_CountChildrenByNameFunc(FHandle, PAnsiChar(AName), Result)); end; - function TLib3MFPolymorphicFactoryMakeTexture2DGroupIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFTexture2DGroupIterator; + + function TLib3MFCustomXMLNode.GetChildrenByName(const AName: String): TLib3MFCustomXMLNodes; + var + HChildNodes: TLib3MFHandle; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + Result := nil; + HChildNodes := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNode_GetChildrenByNameFunc(FHandle, PAnsiChar(AName), HChildNodes)); + if Assigned(HChildNodes) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HChildNodes); end; - function TLib3MFPolymorphicFactoryMakeCompositeMaterialsIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFCompositeMaterialsIterator; + + function TLib3MFCustomXMLNode.HasChild(const AName: String): Boolean; + var + ResultChildExists: Byte; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + ResultChildExists := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNode_HasChildFunc(FHandle, PAnsiChar(AName), ResultChildExists)); + Result := (ResultChildExists <> 0); end; - function TLib3MFPolymorphicFactoryMakeMultiPropertyGroupIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMultiPropertyGroupIterator; + + function TLib3MFCustomXMLNode.HasUniqueChild(const AName: String): Boolean; + var + ResultChildExists: Byte; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + ResultChildExists := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNode_HasUniqueChildFunc(FHandle, PAnsiChar(AName), ResultChildExists)); + Result := (ResultChildExists <> 0); + end; + + function TLib3MFCustomXMLNode.FindChild(const AName: String; const AMustExist: Boolean): TLib3MFCustomXMLNode; + var + HChildInstance: TLib3MFHandle; + begin + Result := nil; + HChildInstance := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNode_FindChildFunc(FHandle, PAnsiChar(AName), Ord(AMustExist), HChildInstance)); + if Assigned(HChildInstance) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HChildInstance); + end; + + function TLib3MFCustomXMLNode.AddChild(const AName: String): TLib3MFCustomXMLNode; + var + HChildInstance: TLib3MFHandle; + begin + Result := nil; + HChildInstance := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNode_AddChildFunc(FHandle, PAnsiChar(AName), HChildInstance)); + if Assigned(HChildInstance) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HChildInstance); end; - function TLib3MFPolymorphicFactoryMakeMetaData(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMetaData; + + procedure TLib3MFCustomXMLNode.RemoveChild(const AChildInstance: TLib3MFCustomXMLNode); + var + AChildInstanceHandle: TLib3MFHandle; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + if Assigned(AChildInstance) then + AChildInstanceHandle := AChildInstance.TheHandle + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'AChildInstance is a nil value.'); + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNode_RemoveChildFunc(FHandle, AChildInstanceHandle)); end; - function TLib3MFPolymorphicFactoryMakeMetaDataGroup(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMetaDataGroup; + + function TLib3MFCustomXMLNode.RemoveChildrenWithName(const AName: String): QWord; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNode_RemoveChildrenWithNameFunc(FHandle, PAnsiChar(AName), Result)); end; - function TLib3MFPolymorphicFactoryMakeObject(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFObject; + + procedure TLib3MFCustomXMLNode.Remove(); begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNode_RemoveFunc(FHandle)); end; - function TLib3MFPolymorphicFactoryMakeMeshObject(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMeshObject; + +(************************************************************************************************************************* + Class implementation for CustomXMLNodes +**************************************************************************************************************************) + + constructor TLib3MFCustomXMLNodes.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + inherited Create(AWrapper, AHandle); end; - function TLib3MFPolymorphicFactoryMakeBeamLattice(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBeamLattice; + + destructor TLib3MFCustomXMLNodes.Destroy; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + inherited; end; - function TLib3MFPolymorphicFactoryMakeComponent(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFComponent; + + function TLib3MFCustomXMLNodes.GetNodeCount(): QWord; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNodes_GetNodeCountFunc(FHandle, Result)); end; - function TLib3MFPolymorphicFactoryMakeComponentsObject(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFComponentsObject; + + function TLib3MFCustomXMLNodes.GetNode(const AIndex: QWord): TLib3MFCustomXMLNode; + var + HNodeInstance: TLib3MFHandle; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + Result := nil; + HNodeInstance := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNodes_GetNodeFunc(FHandle, AIndex, HNodeInstance)); + if Assigned(HNodeInstance) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HNodeInstance); end; - function TLib3MFPolymorphicFactoryMakeBeamSet(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBeamSet; + + function TLib3MFCustomXMLNodes.CountNodesByName(const AName: String): QWord; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNodes_CountNodesByNameFunc(FHandle, PAnsiChar(AName), Result)); end; - function TLib3MFPolymorphicFactoryMakeBaseMaterialGroup(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBaseMaterialGroup; + + function TLib3MFCustomXMLNodes.GetNodesByName(const AName: String): TLib3MFCustomXMLNodes; + var + HNodes: TLib3MFHandle; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + Result := nil; + HNodes := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNodes_GetNodesByNameFunc(FHandle, PAnsiChar(AName), HNodes)); + if Assigned(HNodes) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HNodes); end; - function TLib3MFPolymorphicFactoryMakeColorGroup(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFColorGroup; + + function TLib3MFCustomXMLNodes.HasNode(const AName: String): Boolean; + var + ResultNodeExists: Byte; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + ResultNodeExists := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNodes_HasNodeFunc(FHandle, PAnsiChar(AName), ResultNodeExists)); + Result := (ResultNodeExists <> 0); end; - function TLib3MFPolymorphicFactoryMakeTexture2DGroup(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFTexture2DGroup; + + function TLib3MFCustomXMLNodes.HasUniqueNode(const AName: String): Boolean; + var + ResultNodeExists: Byte; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + ResultNodeExists := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNodes_HasUniqueNodeFunc(FHandle, PAnsiChar(AName), ResultNodeExists)); + Result := (ResultNodeExists <> 0); end; - function TLib3MFPolymorphicFactoryMakeCompositeMaterials(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFCompositeMaterials; + + function TLib3MFCustomXMLNodes.FindNode(const AName: String; const AMustExist: Boolean): TLib3MFCustomXMLNode; + var + HNodeInstance: TLib3MFHandle; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + Result := nil; + HNodeInstance := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomXMLNodes_FindNodeFunc(FHandle, PAnsiChar(AName), Ord(AMustExist), HNodeInstance)); + if Assigned(HNodeInstance) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HNodeInstance); end; - function TLib3MFPolymorphicFactoryMakeMultiPropertyGroup(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFMultiPropertyGroup; + +(************************************************************************************************************************* + Class implementation for CustomDOMTree +**************************************************************************************************************************) + + constructor TLib3MFCustomDOMTree.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + inherited Create(AWrapper, AHandle); end; - function TLib3MFPolymorphicFactoryMakeAttachment(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFAttachment; + + destructor TLib3MFCustomDOMTree.Destroy; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + inherited; end; - function TLib3MFPolymorphicFactoryMakeTexture2D(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFTexture2D; + + function TLib3MFCustomDOMTree.GetNameSpace(): String; + var + bytesNeededNameSpace: Cardinal; + bytesWrittenNameSpace: Cardinal; + bufferNameSpace: array of Char; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + bytesNeededNameSpace:= 0; + bytesWrittenNameSpace:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomDOMTree_GetNameSpaceFunc(FHandle, 0, bytesNeededNameSpace, nil)); + SetLength(bufferNameSpace, bytesNeededNameSpace); + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomDOMTree_GetNameSpaceFunc(FHandle, bytesNeededNameSpace, bytesWrittenNameSpace, @bufferNameSpace[0])); + Result := StrPas(@bufferNameSpace[0]); end; - function TLib3MFPolymorphicFactoryMakeBuildItem(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBuildItem; + + function TLib3MFCustomDOMTree.GetRootNode(): TLib3MFCustomXMLNode; + var + HRootNode: TLib3MFHandle; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + Result := nil; + HRootNode := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomDOMTree_GetRootNodeFunc(FHandle, HRootNode)); + if Assigned(HRootNode) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HRootNode); end; - function TLib3MFPolymorphicFactoryMakeBuildItemIterator(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFBuildItemIterator; + + function TLib3MFCustomDOMTree.SaveToString(): String; + var + bytesNeededXMLString: Cardinal; + bytesWrittenXMLString: Cardinal; + bufferXMLString: array of Char; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + bytesNeededXMLString:= 0; + bytesWrittenXMLString:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomDOMTree_SaveToStringFunc(FHandle, 0, bytesNeededXMLString, nil)); + SetLength(bufferXMLString, bytesNeededXMLString); + FWrapper.CheckError(Self, FWrapper.Lib3MFCustomDOMTree_SaveToStringFunc(FHandle, bytesNeededXMLString, bytesWrittenXMLString, @bufferXMLString[0])); + Result := StrPas(@bufferXMLString[0]); end; - function TLib3MFPolymorphicFactoryMakeSlice(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFSlice; + +(************************************************************************************************************************* + Class implementation for SliceStackIterator +**************************************************************************************************************************) + + constructor TLib3MFSliceStackIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + inherited Create(AWrapper, AHandle); end; - function TLib3MFPolymorphicFactoryMakeSliceStack(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFSliceStack; + + destructor TLib3MFSliceStackIterator.Destroy; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + inherited; end; - function TLib3MFPolymorphicFactoryMakeConsumer(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFConsumer; + + function TLib3MFSliceStackIterator.GetCurrentSliceStack(): TLib3MFSliceStack; + var + HResource: TLib3MFHandle; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + Result := nil; + HResource := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFSliceStackIterator_GetCurrentSliceStackFunc(FHandle, HResource)); + if Assigned(HResource) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResource); end; - function TLib3MFPolymorphicFactoryMakeAccessRight(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFAccessRight; + +(************************************************************************************************************************* + Class implementation for ObjectIterator +**************************************************************************************************************************) + + constructor TLib3MFObjectIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + inherited Create(AWrapper, AHandle); end; - function TLib3MFPolymorphicFactoryMakeContentEncryptionParams(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFContentEncryptionParams; + + destructor TLib3MFObjectIterator.Destroy; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + inherited; end; - function TLib3MFPolymorphicFactoryMakeResourceData(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFResourceData; + + function TLib3MFObjectIterator.GetCurrentObject(): TLib3MFObject; + var + HResource: TLib3MFHandle; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + Result := nil; + HResource := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFObjectIterator_GetCurrentObjectFunc(FHandle, HResource)); + if Assigned(HResource) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResource); end; - function TLib3MFPolymorphicFactoryMakeResourceDataGroup(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFResourceDataGroup; + +(************************************************************************************************************************* + Class implementation for MeshObjectIterator +**************************************************************************************************************************) + + constructor TLib3MFMeshObjectIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + inherited Create(AWrapper, AHandle); end; - function TLib3MFPolymorphicFactoryMakeKeyStore(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFKeyStore; + + destructor TLib3MFMeshObjectIterator.Destroy; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + inherited; end; - function TLib3MFPolymorphicFactoryMakeModel(Wrapper: TLib3MFWrapper; Handle: TLib3MFHandle): TLIB3MFModel; + + function TLib3MFMeshObjectIterator.GetCurrentMeshObject(): TLib3MFMeshObject; + var + HResource: TLib3MFHandle; begin - Result := TLib3MFPolymorphicFactory.Make(Wrapper, Handle); + Result := nil; + HResource := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObjectIterator_GetCurrentMeshObjectFunc(FHandle, HResource)); + if Assigned(HResource) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResource); end; (************************************************************************************************************************* - Exception implementation + Class implementation for ComponentsObjectIterator **************************************************************************************************************************) - constructor ELib3MFException.Create(AErrorCode: TLib3MFResult; AMessage: String); - var - ADescription: String; + constructor TLib3MFComponentsObjectIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin - FErrorCode := AErrorCode; - case FErrorCode of - LIB3MF_ERROR_NOTIMPLEMENTED: ADescription := 'functionality not implemented'; - LIB3MF_ERROR_INVALIDPARAM: ADescription := 'an invalid parameter was passed'; - LIB3MF_ERROR_INVALIDCAST: ADescription := 'a type cast failed'; - LIB3MF_ERROR_BUFFERTOOSMALL: ADescription := 'a provided buffer is too small'; - LIB3MF_ERROR_GENERICEXCEPTION: ADescription := 'a generic exception occurred'; - LIB3MF_ERROR_COULDNOTLOADLIBRARY: ADescription := 'the library could not be loaded'; - LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT: ADescription := 'a required exported symbol could not be found in the library'; - LIB3MF_ERROR_INCOMPATIBLEBINARYVERSION: ADescription := 'the version of the binary interface does not match the bindings interface'; - LIB3MF_ERROR_CALCULATIONABORTED: ADescription := 'a calculation has been aborted'; - LIB3MF_ERROR_SHOULDNOTBECALLED: ADescription := 'functionality should not be called'; - LIB3MF_ERROR_READERCLASSUNKNOWN: ADescription := 'the queried reader class is unknown'; - LIB3MF_ERROR_WRITERCLASSUNKNOWN: ADescription := 'the queried writer class is unknown'; - LIB3MF_ERROR_ITERATORINVALIDINDEX: ADescription := 'the current index of an iterator is invalid'; - LIB3MF_ERROR_INVALIDMODELRESOURCE: ADescription := 'no Model Resource has been given'; - LIB3MF_ERROR_RESOURCENOTFOUND: ADescription := 'Resource not found'; - LIB3MF_ERROR_INVALIDMODEL: ADescription := 'A model is invalid'; - LIB3MF_ERROR_INVALIDOBJECT: ADescription := 'An object is invalid'; - LIB3MF_ERROR_INVALIDMESHOBJECT: ADescription := 'A mesh object is invalid'; - LIB3MF_ERROR_INVALIDCOMPONENTSOBJECT: ADescription := 'A components object is invalid'; - LIB3MF_ERROR_INVALIDCOMPONENT: ADescription := 'A component is invalid'; - LIB3MF_ERROR_INVALIDBUILDITEM: ADescription := 'A build item is invalid'; - LIB3MF_ERROR_INVALIDBASEMATERIALGROUP: ADescription := 'A basematerialgroup is invalid'; - LIB3MF_ERROR_INVALIDSLICESTACKRESOURCE: ADescription := 'A slicestack resource is invalid'; - LIB3MF_ERROR_INVALIDTEXTURERESOURCE: ADescription := 'A texture resource is invalid'; - LIB3MF_ERROR_INVALIDCOLORGROUP: ADescription := 'A color group resource is invalid'; - LIB3MF_ERROR_INVALIDTEXTURE2DGROUP: ADescription := 'A texture2d group resource is invalid'; - LIB3MF_ERROR_INVALIDCOMPOSITEMATERIALS: ADescription := 'A composite materials resource is invalid'; - LIB3MF_ERROR_INVALIDMULTIPROPERTYGROUP: ADescription := 'A MultiPropertyGroup resource is invalid'; - LIB3MF_ERROR_INVALIDRESOURCEINDEX: ADescription := 'A resource index is invalid'; - LIB3MF_ERROR_ATTACHMENTNOTFOUND: ADescription := 'Attachment not found'; - LIB3MF_ERROR_FORBIDDENCYCLICREFERENCE: ADescription := 'A component references one of its ancestors'; - LIB3MF_ERROR_INVALIDATTACHMENTSTREAM: ADescription := 'An attachment stream is invalid'; - LIB3MF_ERROR_INVALIDPROPERTYCOUNT: ADescription := 'Invalid property count.'; - LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER: ADescription := 'A progress identifier is unknown'; - LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT: ADescription := 'An element buffer exceeds its spec limit'; - LIB3MF_ERROR_INVALIDRESOURCE: ADescription := 'A resource is invalid'; - LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE: ADescription := 'This object type is not valid for beamlattices'; - LIB3MF_ERROR_INVALIDKEYSTORE: ADescription := 'The keystore object is invalid'; - LIB3MF_ERROR_INVALIDKEYSTORECONSUMER: ADescription := 'The consumer keystore object is invalid'; - LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND: ADescription := 'A consumer has not been found'; - LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND: ADescription := 'A resource data has not been found'; - LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED: ADescription := 'A Key or Conentent encryption callback has not been registered'; - LIB3MF_ERROR_INVALIDKEYSIZE: ADescription := 'The key siue is invalid'; - else - ADescription := 'unknown'; - end; + inherited Create(AWrapper, AHandle); + end; - inherited Create(Format('the 3MF Library Error - %s (#%d, %s)', [ ADescription, AErrorCode, AMessage ])); + destructor TLib3MFComponentsObjectIterator.Destroy; + begin + inherited; end; - constructor ELib3MFException.CreateCustomMessage(AErrorCode: TLib3MFResult; AMessage: String); + function TLib3MFComponentsObjectIterator.GetCurrentComponentsObject(): TLib3MFComponentsObject; + var + HResource: TLib3MFHandle; begin - FCustomMessage := AMessage; - FErrorCode := AErrorCode; - inherited Create(Format('%s (%d)', [FCustomMessage, AErrorCode])); + Result := nil; + HResource := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFComponentsObjectIterator_GetCurrentComponentsObjectFunc(FHandle, HResource)); + if Assigned(HResource) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResource); end; (************************************************************************************************************************* - Class implementation for Base + Class implementation for Texture2DIterator **************************************************************************************************************************) - constructor TLib3MFBase.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + constructor TLib3MFTexture2DIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin - if not Assigned(AWrapper) then - raise ELib3MFException.Create(LIB3MF_ERROR_INVALIDPARAM, ''); - if not Assigned(AHandle) then - raise ELib3MFException.Create(LIB3MF_ERROR_INVALIDPARAM, ''); - - inherited Create(); - FWrapper := AWrapper; - FHandle := AHandle; + inherited Create(AWrapper, AHandle); end; - destructor TLib3MFBase.Destroy; + destructor TLib3MFTexture2DIterator.Destroy; begin - FWrapper.Release(self); inherited; end; - function TLib3MFBase.ClassTypeId(): QWord; + function TLib3MFTexture2DIterator.GetCurrentTexture2D(): TLib3MFTexture2D; + var + HResource: TLib3MFHandle; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBase_ClassTypeIdFunc(FHandle, Result)); + Result := nil; + HResource := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2DIterator_GetCurrentTexture2DFunc(FHandle, HResource)); + if Assigned(HResource) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResource); end; (************************************************************************************************************************* - Class implementation for Writer + Class implementation for BaseMaterialGroupIterator **************************************************************************************************************************) - constructor TLib3MFWriter.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + constructor TLib3MFBaseMaterialGroupIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin inherited Create(AWrapper, AHandle); end; - destructor TLib3MFWriter.Destroy; + destructor TLib3MFBaseMaterialGroupIterator.Destroy; begin inherited; end; - procedure TLib3MFWriter.WriteToFile(const AFilename: String); + function TLib3MFBaseMaterialGroupIterator.GetCurrentBaseMaterialGroup(): TLib3MFBaseMaterialGroup; + var + HResource: TLib3MFHandle; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_WriteToFileFunc(FHandle, PAnsiChar(AFilename))); + Result := nil; + HResource := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupFunc(FHandle, HResource)); + if Assigned(HResource) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResource); end; - function TLib3MFWriter.GetStreamSize(): QWord; - begin - FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_GetStreamSizeFunc(FHandle, Result)); - end; +(************************************************************************************************************************* + Class implementation for ColorGroupIterator +**************************************************************************************************************************) - procedure TLib3MFWriter.WriteToBuffer(out ABuffer: TByteDynArray); - var - countNeededBuffer: QWord; - countWrittenBuffer: QWord; + constructor TLib3MFColorGroupIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin - countNeededBuffer:= 0; - countWrittenBuffer:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_WriteToBufferFunc(FHandle, 0, countNeededBuffer, nil)); - SetLength(ABuffer, countNeededBuffer); - FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_WriteToBufferFunc(FHandle, countNeededBuffer, countWrittenBuffer, @ABuffer[0])); + inherited Create(AWrapper, AHandle); end; - procedure TLib3MFWriter.WriteToCallback(const ATheWriteCallback: PLib3MF_WriteCallback; const ATheSeekCallback: PLib3MF_SeekCallback; const AUserData: Pointer); + destructor TLib3MFColorGroupIterator.Destroy; begin - if not Assigned(ATheWriteCallback) then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ATheWriteCallback is a nil value.'); - if not Assigned(ATheSeekCallback) then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ATheSeekCallback is a nil value.'); - FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_WriteToCallbackFunc(FHandle, ATheWriteCallback, ATheSeekCallback, AUserData)); + inherited; end; - procedure TLib3MFWriter.SetProgressCallback(const AProgressCallback: PLib3MF_ProgressCallback; const AUserData: Pointer); + function TLib3MFColorGroupIterator.GetCurrentColorGroup(): TLib3MFColorGroup; + var + HResource: TLib3MFHandle; begin - if not Assigned(AProgressCallback) then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'AProgressCallback is a nil value.'); - FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_SetProgressCallbackFunc(FHandle, AProgressCallback, AUserData)); + Result := nil; + HResource := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFColorGroupIterator_GetCurrentColorGroupFunc(FHandle, HResource)); + if Assigned(HResource) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResource); end; - function TLib3MFWriter.GetDecimalPrecision(): Cardinal; - begin - FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_GetDecimalPrecisionFunc(FHandle, Result)); - end; +(************************************************************************************************************************* + Class implementation for Texture2DGroupIterator +**************************************************************************************************************************) - procedure TLib3MFWriter.SetDecimalPrecision(const ADecimalPrecision: Cardinal); + constructor TLib3MFTexture2DGroupIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_SetDecimalPrecisionFunc(FHandle, ADecimalPrecision)); + inherited Create(AWrapper, AHandle); end; - procedure TLib3MFWriter.SetStrictModeActive(const AStrictModeActive: Boolean); + destructor TLib3MFTexture2DGroupIterator.Destroy; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_SetStrictModeActiveFunc(FHandle, Ord(AStrictModeActive))); + inherited; end; - function TLib3MFWriter.GetStrictModeActive(): Boolean; + function TLib3MFTexture2DGroupIterator.GetCurrentTexture2DGroup(): TLib3MFTexture2DGroup; var - ResultStrictModeActive: Byte; + HResource: TLib3MFHandle; begin - ResultStrictModeActive := 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_GetStrictModeActiveFunc(FHandle, ResultStrictModeActive)); - Result := (ResultStrictModeActive <> 0); + Result := nil; + HResource := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupFunc(FHandle, HResource)); + if Assigned(HResource) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResource); end; - function TLib3MFWriter.GetWarning(const AIndex: Cardinal; out AErrorCode: Cardinal): String; - var - bytesNeededWarning: Cardinal; - bytesWrittenWarning: Cardinal; - bufferWarning: array of Char; - begin - bytesNeededWarning:= 0; - bytesWrittenWarning:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_GetWarningFunc(FHandle, AIndex, AErrorCode, 0, bytesNeededWarning, nil)); - SetLength(bufferWarning, bytesNeededWarning); - FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_GetWarningFunc(FHandle, AIndex, AErrorCode, bytesNeededWarning, bytesWrittenWarning, @bufferWarning[0])); - Result := StrPas(@bufferWarning[0]); - end; +(************************************************************************************************************************* + Class implementation for CompositeMaterialsIterator +**************************************************************************************************************************) - function TLib3MFWriter.GetWarningCount(): Cardinal; + constructor TLib3MFCompositeMaterialsIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_GetWarningCountFunc(FHandle, Result)); + inherited Create(AWrapper, AHandle); end; - procedure TLib3MFWriter.AddKeyWrappingCallback(const AConsumerID: String; const ATheCallback: PLib3MF_KeyWrappingCallback; const AUserData: Pointer); + destructor TLib3MFCompositeMaterialsIterator.Destroy; begin - if not Assigned(ATheCallback) then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ATheCallback is a nil value.'); - FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_AddKeyWrappingCallbackFunc(FHandle, PAnsiChar(AConsumerID), ATheCallback, AUserData)); + inherited; end; - procedure TLib3MFWriter.SetContentEncryptionCallback(const ATheCallback: PLib3MF_ContentEncryptionCallback; const AUserData: Pointer); + function TLib3MFCompositeMaterialsIterator.GetCurrentCompositeMaterials(): TLib3MFCompositeMaterials; + var + HResource: TLib3MFHandle; begin - if not Assigned(ATheCallback) then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ATheCallback is a nil value.'); - FWrapper.CheckError(Self, FWrapper.Lib3MFWriter_SetContentEncryptionCallbackFunc(FHandle, ATheCallback, AUserData)); + Result := nil; + HResource := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsFunc(FHandle, HResource)); + if Assigned(HResource) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResource); end; (************************************************************************************************************************* - Class implementation for Reader + Class implementation for MultiPropertyGroupIterator **************************************************************************************************************************) - constructor TLib3MFReader.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + constructor TLib3MFMultiPropertyGroupIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin inherited Create(AWrapper, AHandle); end; - destructor TLib3MFReader.Destroy; + destructor TLib3MFMultiPropertyGroupIterator.Destroy; begin inherited; end; - procedure TLib3MFReader.ReadFromFile(const AFilename: String); - begin - FWrapper.CheckError(Self, FWrapper.Lib3MFReader_ReadFromFileFunc(FHandle, PAnsiChar(AFilename))); - end; - - procedure TLib3MFReader.ReadFromBuffer(const ABuffer: TByteDynArray); + function TLib3MFMultiPropertyGroupIterator.GetCurrentMultiPropertyGroup(): TLib3MFMultiPropertyGroup; var - PtrBuffer: PByte; - LenBuffer: QWord; + HResource: TLib3MFHandle; begin - LenBuffer := Length(ABuffer); - if LenBuffer > $FFFFFFFF then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); - if LenBuffer > 0 then - PtrBuffer := @ABuffer[0] - else - PtrBuffer := nil; - - FWrapper.CheckError(Self, FWrapper.Lib3MFReader_ReadFromBufferFunc(FHandle, QWord(LenBuffer), PtrBuffer)); + Result := nil; + HResource := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupFunc(FHandle, HResource)); + if Assigned(HResource) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResource); end; - procedure TLib3MFReader.ReadFromCallback(const ATheReadCallback: PLib3MF_ReadCallback; const AStreamSize: QWord; const ATheSeekCallback: PLib3MF_SeekCallback; const AUserData: Pointer); - begin - if not Assigned(ATheReadCallback) then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ATheReadCallback is a nil value.'); - if not Assigned(ATheSeekCallback) then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ATheSeekCallback is a nil value.'); - FWrapper.CheckError(Self, FWrapper.Lib3MFReader_ReadFromCallbackFunc(FHandle, ATheReadCallback, AStreamSize, ATheSeekCallback, AUserData)); - end; +(************************************************************************************************************************* + Class implementation for MetaData +**************************************************************************************************************************) - procedure TLib3MFReader.SetProgressCallback(const AProgressCallback: PLib3MF_ProgressCallback; const AUserData: Pointer); + constructor TLib3MFMetaData.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin - if not Assigned(AProgressCallback) then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'AProgressCallback is a nil value.'); - FWrapper.CheckError(Self, FWrapper.Lib3MFReader_SetProgressCallbackFunc(FHandle, AProgressCallback, AUserData)); + inherited Create(AWrapper, AHandle); end; - procedure TLib3MFReader.AddRelationToRead(const ARelationShipType: String); + destructor TLib3MFMetaData.Destroy; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFReader_AddRelationToReadFunc(FHandle, PAnsiChar(ARelationShipType))); + inherited; end; - procedure TLib3MFReader.RemoveRelationToRead(const ARelationShipType: String); + function TLib3MFMetaData.GetNameSpace(): String; + var + bytesNeededNameSpace: Cardinal; + bytesWrittenNameSpace: Cardinal; + bufferNameSpace: array of Char; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFReader_RemoveRelationToReadFunc(FHandle, PAnsiChar(ARelationShipType))); + bytesNeededNameSpace:= 0; + bytesWrittenNameSpace:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_GetNameSpaceFunc(FHandle, 0, bytesNeededNameSpace, nil)); + SetLength(bufferNameSpace, bytesNeededNameSpace); + FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_GetNameSpaceFunc(FHandle, bytesNeededNameSpace, bytesWrittenNameSpace, @bufferNameSpace[0])); + Result := StrPas(@bufferNameSpace[0]); end; - procedure TLib3MFReader.SetStrictModeActive(const AStrictModeActive: Boolean); + procedure TLib3MFMetaData.SetNameSpace(const ANameSpace: String); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFReader_SetStrictModeActiveFunc(FHandle, Ord(AStrictModeActive))); + FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_SetNameSpaceFunc(FHandle, PAnsiChar(ANameSpace))); end; - function TLib3MFReader.GetStrictModeActive(): Boolean; + function TLib3MFMetaData.GetName(): String; var - ResultStrictModeActive: Byte; + bytesNeededName: Cardinal; + bytesWrittenName: Cardinal; + bufferName: array of Char; begin - ResultStrictModeActive := 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFReader_GetStrictModeActiveFunc(FHandle, ResultStrictModeActive)); - Result := (ResultStrictModeActive <> 0); + bytesNeededName:= 0; + bytesWrittenName:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_GetNameFunc(FHandle, 0, bytesNeededName, nil)); + SetLength(bufferName, bytesNeededName); + FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_GetNameFunc(FHandle, bytesNeededName, bytesWrittenName, @bufferName[0])); + Result := StrPas(@bufferName[0]); end; - function TLib3MFReader.GetWarning(const AIndex: Cardinal; out AErrorCode: Cardinal): String; - var - bytesNeededWarning: Cardinal; - bytesWrittenWarning: Cardinal; - bufferWarning: array of Char; + procedure TLib3MFMetaData.SetName(const AName: String); begin - bytesNeededWarning:= 0; - bytesWrittenWarning:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFReader_GetWarningFunc(FHandle, AIndex, AErrorCode, 0, bytesNeededWarning, nil)); - SetLength(bufferWarning, bytesNeededWarning); - FWrapper.CheckError(Self, FWrapper.Lib3MFReader_GetWarningFunc(FHandle, AIndex, AErrorCode, bytesNeededWarning, bytesWrittenWarning, @bufferWarning[0])); - Result := StrPas(@bufferWarning[0]); + FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_SetNameFunc(FHandle, PAnsiChar(AName))); end; - function TLib3MFReader.GetWarningCount(): Cardinal; + function TLib3MFMetaData.GetKey(): String; + var + bytesNeededKey: Cardinal; + bytesWrittenKey: Cardinal; + bufferKey: array of Char; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFReader_GetWarningCountFunc(FHandle, Result)); + bytesNeededKey:= 0; + bytesWrittenKey:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_GetKeyFunc(FHandle, 0, bytesNeededKey, nil)); + SetLength(bufferKey, bytesNeededKey); + FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_GetKeyFunc(FHandle, bytesNeededKey, bytesWrittenKey, @bufferKey[0])); + Result := StrPas(@bufferKey[0]); end; - procedure TLib3MFReader.AddKeyWrappingCallback(const AConsumerID: String; const ATheCallback: PLib3MF_KeyWrappingCallback; const AUserData: Pointer); + function TLib3MFMetaData.GetMustPreserve(): Boolean; + var + ResultMustPreserve: Byte; begin - if not Assigned(ATheCallback) then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ATheCallback is a nil value.'); - FWrapper.CheckError(Self, FWrapper.Lib3MFReader_AddKeyWrappingCallbackFunc(FHandle, PAnsiChar(AConsumerID), ATheCallback, AUserData)); + ResultMustPreserve := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_GetMustPreserveFunc(FHandle, ResultMustPreserve)); + Result := (ResultMustPreserve <> 0); end; - procedure TLib3MFReader.SetContentEncryptionCallback(const ATheCallback: PLib3MF_ContentEncryptionCallback; const AUserData: Pointer); + procedure TLib3MFMetaData.SetMustPreserve(const AMustPreserve: Boolean); begin - if not Assigned(ATheCallback) then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ATheCallback is a nil value.'); - FWrapper.CheckError(Self, FWrapper.Lib3MFReader_SetContentEncryptionCallbackFunc(FHandle, ATheCallback, AUserData)); + FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_SetMustPreserveFunc(FHandle, Ord(AMustPreserve))); end; -(************************************************************************************************************************* - Class implementation for PackagePart -**************************************************************************************************************************) - - constructor TLib3MFPackagePart.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + function TLib3MFMetaData.GetType(): String; + var + bytesNeededType: Cardinal; + bytesWrittenType: Cardinal; + bufferType: array of Char; begin - inherited Create(AWrapper, AHandle); + bytesNeededType:= 0; + bytesWrittenType:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_GetTypeFunc(FHandle, 0, bytesNeededType, nil)); + SetLength(bufferType, bytesNeededType); + FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_GetTypeFunc(FHandle, bytesNeededType, bytesWrittenType, @bufferType[0])); + Result := StrPas(@bufferType[0]); end; - destructor TLib3MFPackagePart.Destroy; + procedure TLib3MFMetaData.SetType(const AType: String); begin - inherited; + FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_SetTypeFunc(FHandle, PAnsiChar(AType))); end; - function TLib3MFPackagePart.GetPath(): String; + function TLib3MFMetaData.GetValue(): String; var - bytesNeededPath: Cardinal; - bytesWrittenPath: Cardinal; - bufferPath: array of Char; + bytesNeededValue: Cardinal; + bytesWrittenValue: Cardinal; + bufferValue: array of Char; begin - bytesNeededPath:= 0; - bytesWrittenPath:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFPackagePart_GetPathFunc(FHandle, 0, bytesNeededPath, nil)); - SetLength(bufferPath, bytesNeededPath); - FWrapper.CheckError(Self, FWrapper.Lib3MFPackagePart_GetPathFunc(FHandle, bytesNeededPath, bytesWrittenPath, @bufferPath[0])); - Result := StrPas(@bufferPath[0]); + bytesNeededValue:= 0; + bytesWrittenValue:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_GetValueFunc(FHandle, 0, bytesNeededValue, nil)); + SetLength(bufferValue, bytesNeededValue); + FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_GetValueFunc(FHandle, bytesNeededValue, bytesWrittenValue, @bufferValue[0])); + Result := StrPas(@bufferValue[0]); end; - procedure TLib3MFPackagePart.SetPath(const APath: String); + procedure TLib3MFMetaData.SetValue(const AValue: String); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFPackagePart_SetPathFunc(FHandle, PAnsiChar(APath))); + FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_SetValueFunc(FHandle, PAnsiChar(AValue))); end; (************************************************************************************************************************* - Class implementation for Resource + Class implementation for MetaDataGroup **************************************************************************************************************************) - constructor TLib3MFResource.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + constructor TLib3MFMetaDataGroup.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin inherited Create(AWrapper, AHandle); end; - destructor TLib3MFResource.Destroy; + destructor TLib3MFMetaDataGroup.Destroy; begin inherited; end; - function TLib3MFResource.GetResourceID(): Cardinal; + function TLib3MFMetaDataGroup.GetMetaDataCount(): Cardinal; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFResource_GetResourceIDFunc(FHandle, Result)); + FWrapper.CheckError(Self, FWrapper.Lib3MFMetaDataGroup_GetMetaDataCountFunc(FHandle, Result)); end; - function TLib3MFResource.GetUniqueResourceID(): Cardinal; + function TLib3MFMetaDataGroup.GetMetaData(const AIndex: Cardinal): TLib3MFMetaData; + var + HMetaData: TLib3MFHandle; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFResource_GetUniqueResourceIDFunc(FHandle, Result)); + Result := nil; + HMetaData := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFMetaDataGroup_GetMetaDataFunc(FHandle, AIndex, HMetaData)); + if Assigned(HMetaData) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HMetaData); end; - function TLib3MFResource.PackagePart(): TLib3MFPackagePart; + function TLib3MFMetaDataGroup.GetMetaDataByKey(const ANameSpace: String; const AName: String): TLib3MFMetaData; var - HPackagePart: TLib3MFHandle; + HMetaData: TLib3MFHandle; begin Result := nil; - HPackagePart := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFResource_PackagePartFunc(FHandle, HPackagePart)); - if Assigned(HPackagePart) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HPackagePart); + HMetaData := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFMetaDataGroup_GetMetaDataByKeyFunc(FHandle, PAnsiChar(ANameSpace), PAnsiChar(AName), HMetaData)); + if Assigned(HMetaData) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HMetaData); end; - procedure TLib3MFResource.SetPackagePart(const APackagePart: TLib3MFPackagePart); + procedure TLib3MFMetaDataGroup.RemoveMetaDataByIndex(const AIndex: Cardinal); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFMetaDataGroup_RemoveMetaDataByIndexFunc(FHandle, AIndex)); + end; + + procedure TLib3MFMetaDataGroup.RemoveMetaData(const ATheMetaData: TLib3MFMetaData); var - APackagePartHandle: TLib3MFHandle; + ATheMetaDataHandle: TLib3MFHandle; begin - if Assigned(APackagePart) then - APackagePartHandle := APackagePart.TheHandle + if Assigned(ATheMetaData) then + ATheMetaDataHandle := ATheMetaData.TheHandle else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'APackagePart is a nil value.'); - FWrapper.CheckError(Self, FWrapper.Lib3MFResource_SetPackagePartFunc(FHandle, APackagePartHandle)); + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ATheMetaData is a nil value.'); + FWrapper.CheckError(Self, FWrapper.Lib3MFMetaDataGroup_RemoveMetaDataFunc(FHandle, ATheMetaDataHandle)); end; - function TLib3MFResource.GetModelResourceID(): Cardinal; + function TLib3MFMetaDataGroup.AddMetaData(const ANameSpace: String; const AName: String; const AValue: String; const AType: String; const AMustPreserve: Boolean): TLib3MFMetaData; + var + HMetaData: TLib3MFHandle; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFResource_GetModelResourceIDFunc(FHandle, Result)); + Result := nil; + HMetaData := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFMetaDataGroup_AddMetaDataFunc(FHandle, PAnsiChar(ANameSpace), PAnsiChar(AName), PAnsiChar(AValue), PAnsiChar(AType), Ord(AMustPreserve), HMetaData)); + if Assigned(HMetaData) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HMetaData); end; (************************************************************************************************************************* - Class implementation for ResourceIterator + Class implementation for Object **************************************************************************************************************************) - constructor TLib3MFResourceIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + constructor TLib3MFObject.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin inherited Create(AWrapper, AHandle); end; - destructor TLib3MFResourceIterator.Destroy; + destructor TLib3MFObject.Destroy; begin inherited; end; - function TLib3MFResourceIterator.MoveNext(): Boolean; + function TLib3MFObject.GetType(): TLib3MFObjectType; var - ResultHasNext: Byte; + ResultObjectType: Integer; begin - ResultHasNext := 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFResourceIterator_MoveNextFunc(FHandle, ResultHasNext)); - Result := (ResultHasNext <> 0); + ResultObjectType := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_GetTypeFunc(FHandle, ResultObjectType)); + Result := convertConstToObjectType(ResultObjectType); end; - function TLib3MFResourceIterator.MovePrevious(): Boolean; - var - ResultHasPrevious: Byte; + procedure TLib3MFObject.SetType(const AObjectType: TLib3MFObjectType); begin - ResultHasPrevious := 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFResourceIterator_MovePreviousFunc(FHandle, ResultHasPrevious)); - Result := (ResultHasPrevious <> 0); + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_SetTypeFunc(FHandle, convertObjectTypeToConst(AObjectType))); end; - function TLib3MFResourceIterator.GetCurrent(): TLib3MFResource; + function TLib3MFObject.GetName(): String; var - HResource: TLib3MFHandle; + bytesNeededName: Cardinal; + bytesWrittenName: Cardinal; + bufferName: array of Char; begin - Result := nil; - HResource := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFResourceIterator_GetCurrentFunc(FHandle, HResource)); - if Assigned(HResource) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResource); + bytesNeededName:= 0; + bytesWrittenName:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_GetNameFunc(FHandle, 0, bytesNeededName, nil)); + SetLength(bufferName, bytesNeededName); + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_GetNameFunc(FHandle, bytesNeededName, bytesWrittenName, @bufferName[0])); + Result := StrPas(@bufferName[0]); end; - function TLib3MFResourceIterator.Clone(): TLib3MFResourceIterator; + procedure TLib3MFObject.SetName(const AName: String); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_SetNameFunc(FHandle, PAnsiChar(AName))); + end; + + function TLib3MFObject.GetPartNumber(): String; var - HOutResourceIterator: TLib3MFHandle; + bytesNeededPartNumber: Cardinal; + bytesWrittenPartNumber: Cardinal; + bufferPartNumber: array of Char; begin - Result := nil; - HOutResourceIterator := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFResourceIterator_CloneFunc(FHandle, HOutResourceIterator)); - if Assigned(HOutResourceIterator) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HOutResourceIterator); + bytesNeededPartNumber:= 0; + bytesWrittenPartNumber:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_GetPartNumberFunc(FHandle, 0, bytesNeededPartNumber, nil)); + SetLength(bufferPartNumber, bytesNeededPartNumber); + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_GetPartNumberFunc(FHandle, bytesNeededPartNumber, bytesWrittenPartNumber, @bufferPartNumber[0])); + Result := StrPas(@bufferPartNumber[0]); end; - function TLib3MFResourceIterator.Count(): QWord; + procedure TLib3MFObject.SetPartNumber(const APartNumber: String); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFResourceIterator_CountFunc(FHandle, Result)); + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_SetPartNumberFunc(FHandle, PAnsiChar(APartNumber))); end; -(************************************************************************************************************************* - Class implementation for SliceStackIterator -**************************************************************************************************************************) + function TLib3MFObject.IsMeshObject(): Boolean; + var + ResultIsMeshObject: Byte; + begin + ResultIsMeshObject := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_IsMeshObjectFunc(FHandle, ResultIsMeshObject)); + Result := (ResultIsMeshObject <> 0); + end; - constructor TLib3MFSliceStackIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + function TLib3MFObject.IsComponentsObject(): Boolean; + var + ResultIsComponentsObject: Byte; begin - inherited Create(AWrapper, AHandle); + ResultIsComponentsObject := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_IsComponentsObjectFunc(FHandle, ResultIsComponentsObject)); + Result := (ResultIsComponentsObject <> 0); end; - destructor TLib3MFSliceStackIterator.Destroy; + function TLib3MFObject.IsValid(): Boolean; + var + ResultIsValid: Byte; begin - inherited; + ResultIsValid := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_IsValidFunc(FHandle, ResultIsValid)); + Result := (ResultIsValid <> 0); end; - function TLib3MFSliceStackIterator.GetCurrentSliceStack(): TLib3MFSliceStack; + procedure TLib3MFObject.SetAttachmentAsThumbnail(const AAttachment: TLib3MFAttachment); var - HResource: TLib3MFHandle; + AAttachmentHandle: TLib3MFHandle; + begin + if Assigned(AAttachment) then + AAttachmentHandle := AAttachment.TheHandle + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'AAttachment is a nil value.'); + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_SetAttachmentAsThumbnailFunc(FHandle, AAttachmentHandle)); + end; + + function TLib3MFObject.GetThumbnailAttachment(): TLib3MFAttachment; + var + HAttachment: TLib3MFHandle; begin Result := nil; - HResource := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFSliceStackIterator_GetCurrentSliceStackFunc(FHandle, HResource)); - if Assigned(HResource) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResource); + HAttachment := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_GetThumbnailAttachmentFunc(FHandle, HAttachment)); + if Assigned(HAttachment) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HAttachment); end; -(************************************************************************************************************************* - Class implementation for ObjectIterator -**************************************************************************************************************************) + procedure TLib3MFObject.ClearThumbnailAttachment(); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_ClearThumbnailAttachmentFunc(FHandle)); + end; - constructor TLib3MFObjectIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + function TLib3MFObject.GetOutbox(): TLib3MFBox; begin - inherited Create(AWrapper, AHandle); + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_GetOutboxFunc(FHandle, @Result)); end; - destructor TLib3MFObjectIterator.Destroy; + function TLib3MFObject.GetUUID(out AHasUUID: Boolean): String; + var + ResultHasUUID: Byte; + bytesNeededUUID: Cardinal; + bytesWrittenUUID: Cardinal; + bufferUUID: array of Char; begin - inherited; + ResultHasUUID := 0; + bytesNeededUUID:= 0; + bytesWrittenUUID:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_GetUUIDFunc(FHandle, ResultHasUUID, 0, bytesNeededUUID, nil)); + SetLength(bufferUUID, bytesNeededUUID); + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_GetUUIDFunc(FHandle, ResultHasUUID, bytesNeededUUID, bytesWrittenUUID, @bufferUUID[0])); + AHasUUID := ResultHasUUID <> 0; + Result := StrPas(@bufferUUID[0]); end; - function TLib3MFObjectIterator.GetCurrentObject(): TLib3MFObject; + procedure TLib3MFObject.SetUUID(const AUUID: String); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_SetUUIDFunc(FHandle, PAnsiChar(AUUID))); + end; + + function TLib3MFObject.GetMetaDataGroup(): TLib3MFMetaDataGroup; var - HResource: TLib3MFHandle; + HMetaDataGroup: TLib3MFHandle; begin Result := nil; - HResource := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFObjectIterator_GetCurrentObjectFunc(FHandle, HResource)); - if Assigned(HResource) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResource); + HMetaDataGroup := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_GetMetaDataGroupFunc(FHandle, HMetaDataGroup)); + if Assigned(HMetaDataGroup) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HMetaDataGroup); end; -(************************************************************************************************************************* - Class implementation for MeshObjectIterator -**************************************************************************************************************************) - - constructor TLib3MFMeshObjectIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + procedure TLib3MFObject.SetSlicesMeshResolution(const AMeshResolution: TLib3MFSlicesMeshResolution); begin - inherited Create(AWrapper, AHandle); + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_SetSlicesMeshResolutionFunc(FHandle, convertSlicesMeshResolutionToConst(AMeshResolution))); end; - destructor TLib3MFMeshObjectIterator.Destroy; + function TLib3MFObject.GetSlicesMeshResolution(): TLib3MFSlicesMeshResolution; + var + ResultMeshResolution: Integer; begin - inherited; + ResultMeshResolution := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_GetSlicesMeshResolutionFunc(FHandle, ResultMeshResolution)); + Result := convertConstToSlicesMeshResolution(ResultMeshResolution); end; - function TLib3MFMeshObjectIterator.GetCurrentMeshObject(): TLib3MFMeshObject; + function TLib3MFObject.HasSlices(const ARecursive: Boolean): Boolean; var - HResource: TLib3MFHandle; + ResultHasSlices: Byte; begin - Result := nil; - HResource := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObjectIterator_GetCurrentMeshObjectFunc(FHandle, HResource)); - if Assigned(HResource) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResource); + ResultHasSlices := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_HasSlicesFunc(FHandle, Ord(ARecursive), ResultHasSlices)); + Result := (ResultHasSlices <> 0); end; -(************************************************************************************************************************* - Class implementation for ComponentsObjectIterator -**************************************************************************************************************************) - - constructor TLib3MFComponentsObjectIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + procedure TLib3MFObject.ClearSliceStack(); begin - inherited Create(AWrapper, AHandle); + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_ClearSliceStackFunc(FHandle)); end; - destructor TLib3MFComponentsObjectIterator.Destroy; + function TLib3MFObject.GetSliceStack(): TLib3MFSliceStack; + var + HSliceStackInstance: TLib3MFHandle; begin - inherited; + Result := nil; + HSliceStackInstance := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_GetSliceStackFunc(FHandle, HSliceStackInstance)); + if Assigned(HSliceStackInstance) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HSliceStackInstance); end; - function TLib3MFComponentsObjectIterator.GetCurrentComponentsObject(): TLib3MFComponentsObject; + procedure TLib3MFObject.AssignSliceStack(const ASliceStackInstance: TLib3MFSliceStack); var - HResource: TLib3MFHandle; + ASliceStackInstanceHandle: TLib3MFHandle; begin - Result := nil; - HResource := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFComponentsObjectIterator_GetCurrentComponentsObjectFunc(FHandle, HResource)); - if Assigned(HResource) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResource); + if Assigned(ASliceStackInstance) then + ASliceStackInstanceHandle := ASliceStackInstance.TheHandle + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ASliceStackInstance is a nil value.'); + FWrapper.CheckError(Self, FWrapper.Lib3MFObject_AssignSliceStackFunc(FHandle, ASliceStackInstanceHandle)); end; (************************************************************************************************************************* - Class implementation for Texture2DIterator + Class implementation for MeshObject **************************************************************************************************************************) - constructor TLib3MFTexture2DIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + constructor TLib3MFMeshObject.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin inherited Create(AWrapper, AHandle); end; - destructor TLib3MFTexture2DIterator.Destroy; + destructor TLib3MFMeshObject.Destroy; begin inherited; end; - function TLib3MFTexture2DIterator.GetCurrentTexture2D(): TLib3MFTexture2D; - var - HResource: TLib3MFHandle; + function TLib3MFMeshObject.GetVertexCount(): Cardinal; begin - Result := nil; - HResource := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2DIterator_GetCurrentTexture2DFunc(FHandle, HResource)); - if Assigned(HResource) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResource); + FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_GetVertexCountFunc(FHandle, Result)); end; -(************************************************************************************************************************* - Class implementation for BaseMaterialGroupIterator -**************************************************************************************************************************) - - constructor TLib3MFBaseMaterialGroupIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + function TLib3MFMeshObject.GetTriangleCount(): Cardinal; begin - inherited Create(AWrapper, AHandle); + FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_GetTriangleCountFunc(FHandle, Result)); end; - destructor TLib3MFBaseMaterialGroupIterator.Destroy; + function TLib3MFMeshObject.GetVertex(const AIndex: Cardinal): TLib3MFPosition; begin - inherited; + FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_GetVertexFunc(FHandle, AIndex, @Result)); end; - function TLib3MFBaseMaterialGroupIterator.GetCurrentBaseMaterialGroup(): TLib3MFBaseMaterialGroup; - var - HResource: TLib3MFHandle; + procedure TLib3MFMeshObject.SetVertex(const AIndex: Cardinal; const ACoordinates: TLib3MFPosition); begin - Result := nil; - HResource := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFBaseMaterialGroupIterator_GetCurrentBaseMaterialGroupFunc(FHandle, HResource)); - if Assigned(HResource) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResource); + FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_SetVertexFunc(FHandle, AIndex, @ACoordinates)); end; -(************************************************************************************************************************* - Class implementation for ColorGroupIterator -**************************************************************************************************************************) + function TLib3MFMeshObject.AddVertex(const ACoordinates: TLib3MFPosition): Cardinal; + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_AddVertexFunc(FHandle, @ACoordinates, Result)); + end; - constructor TLib3MFColorGroupIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + procedure TLib3MFMeshObject.GetVertices(out AVertices: ArrayOfLib3MFPosition); + var + countNeededVertices: QWord; + countWrittenVertices: QWord; begin - inherited Create(AWrapper, AHandle); + countNeededVertices:= 0; + countWrittenVertices:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_GetVerticesFunc(FHandle, 0, countNeededVertices, nil)); + SetLength(AVertices, countNeededVertices); + FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_GetVerticesFunc(FHandle, countNeededVertices, countWrittenVertices, @AVertices[0])); end; - destructor TLib3MFColorGroupIterator.Destroy; + function TLib3MFMeshObject.GetTriangle(const AIndex: Cardinal): TLib3MFTriangle; begin - inherited; + FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_GetTriangleFunc(FHandle, AIndex, @Result)); end; - function TLib3MFColorGroupIterator.GetCurrentColorGroup(): TLib3MFColorGroup; - var - HResource: TLib3MFHandle; + procedure TLib3MFMeshObject.SetTriangle(const AIndex: Cardinal; const AIndices: TLib3MFTriangle); begin - Result := nil; - HResource := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFColorGroupIterator_GetCurrentColorGroupFunc(FHandle, HResource)); - if Assigned(HResource) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResource); + FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_SetTriangleFunc(FHandle, AIndex, @AIndices)); end; -(************************************************************************************************************************* - Class implementation for Texture2DGroupIterator -**************************************************************************************************************************) + function TLib3MFMeshObject.AddTriangle(const AIndices: TLib3MFTriangle): Cardinal; + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_AddTriangleFunc(FHandle, @AIndices, Result)); + end; - constructor TLib3MFTexture2DGroupIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + procedure TLib3MFMeshObject.GetTriangleIndices(out AIndices: ArrayOfLib3MFTriangle); + var + countNeededIndices: QWord; + countWrittenIndices: QWord; begin - inherited Create(AWrapper, AHandle); + countNeededIndices:= 0; + countWrittenIndices:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_GetTriangleIndicesFunc(FHandle, 0, countNeededIndices, nil)); + SetLength(AIndices, countNeededIndices); + FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_GetTriangleIndicesFunc(FHandle, countNeededIndices, countWrittenIndices, @AIndices[0])); end; - destructor TLib3MFTexture2DGroupIterator.Destroy; + procedure TLib3MFMeshObject.SetObjectLevelProperty(const AUniqueResourceID: Cardinal; const APropertyID: Cardinal); begin - inherited; + FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_SetObjectLevelPropertyFunc(FHandle, AUniqueResourceID, APropertyID)); end; - function TLib3MFTexture2DGroupIterator.GetCurrentTexture2DGroup(): TLib3MFTexture2DGroup; + function TLib3MFMeshObject.GetObjectLevelProperty(out AUniqueResourceID: Cardinal; out APropertyID: Cardinal): Boolean; var - HResource: TLib3MFHandle; + ResultHasObjectLevelProperty: Byte; begin - Result := nil; - HResource := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2DGroupIterator_GetCurrentTexture2DGroupFunc(FHandle, HResource)); - if Assigned(HResource) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResource); + ResultHasObjectLevelProperty := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_GetObjectLevelPropertyFunc(FHandle, AUniqueResourceID, APropertyID, ResultHasObjectLevelProperty)); + Result := (ResultHasObjectLevelProperty <> 0); end; -(************************************************************************************************************************* - Class implementation for CompositeMaterialsIterator -**************************************************************************************************************************) + procedure TLib3MFMeshObject.SetTriangleProperties(const AIndex: Cardinal; const AProperties: TLib3MFTriangleProperties); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_SetTrianglePropertiesFunc(FHandle, AIndex, @AProperties)); + end; - constructor TLib3MFCompositeMaterialsIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + procedure TLib3MFMeshObject.GetTriangleProperties(const AIndex: Cardinal; out AProperty: TLib3MFTriangleProperties); begin - inherited Create(AWrapper, AHandle); + FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_GetTrianglePropertiesFunc(FHandle, AIndex, @AProperty)); end; - destructor TLib3MFCompositeMaterialsIterator.Destroy; + procedure TLib3MFMeshObject.SetAllTriangleProperties(const APropertiesArray: ArrayOfLib3MFTriangleProperties); + var + PtrPropertiesArray: PLib3MFTriangleProperties; + LenPropertiesArray: QWord; begin - inherited; + LenPropertiesArray := Length(APropertiesArray); + if LenPropertiesArray > $FFFFFFFF then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); + if LenPropertiesArray > 0 then + PtrPropertiesArray := @APropertiesArray[0] + else + PtrPropertiesArray := nil; + + FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_SetAllTrianglePropertiesFunc(FHandle, QWord(LenPropertiesArray), PtrPropertiesArray)); end; - function TLib3MFCompositeMaterialsIterator.GetCurrentCompositeMaterials(): TLib3MFCompositeMaterials; + procedure TLib3MFMeshObject.GetAllTriangleProperties(out APropertiesArray: ArrayOfLib3MFTriangleProperties); var - HResource: TLib3MFHandle; + countNeededPropertiesArray: QWord; + countWrittenPropertiesArray: QWord; begin - Result := nil; - HResource := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFCompositeMaterialsIterator_GetCurrentCompositeMaterialsFunc(FHandle, HResource)); - if Assigned(HResource) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResource); + countNeededPropertiesArray:= 0; + countWrittenPropertiesArray:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_GetAllTrianglePropertiesFunc(FHandle, 0, countNeededPropertiesArray, nil)); + SetLength(APropertiesArray, countNeededPropertiesArray); + FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_GetAllTrianglePropertiesFunc(FHandle, countNeededPropertiesArray, countWrittenPropertiesArray, @APropertiesArray[0])); end; -(************************************************************************************************************************* - Class implementation for MultiPropertyGroupIterator -**************************************************************************************************************************) + procedure TLib3MFMeshObject.ClearAllProperties(); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_ClearAllPropertiesFunc(FHandle)); + end; - constructor TLib3MFMultiPropertyGroupIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + procedure TLib3MFMeshObject.SetGeometry(const AVertices: ArrayOfLib3MFPosition; const AIndices: ArrayOfLib3MFTriangle); + var + PtrVertices: PLib3MFPosition; + LenVertices: QWord; + PtrIndices: PLib3MFTriangle; + LenIndices: QWord; begin - inherited Create(AWrapper, AHandle); + LenVertices := Length(AVertices); + if LenVertices > $FFFFFFFF then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); + if LenVertices > 0 then + PtrVertices := @AVertices[0] + else + PtrVertices := nil; + + LenIndices := Length(AIndices); + if LenIndices > $FFFFFFFF then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); + if LenIndices > 0 then + PtrIndices := @AIndices[0] + else + PtrIndices := nil; + + FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_SetGeometryFunc(FHandle, QWord(LenVertices), PtrVertices, QWord(LenIndices), PtrIndices)); end; - destructor TLib3MFMultiPropertyGroupIterator.Destroy; + function TLib3MFMeshObject.IsManifoldAndOriented(): Boolean; + var + ResultIsManifoldAndOriented: Byte; begin - inherited; + ResultIsManifoldAndOriented := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_IsManifoldAndOrientedFunc(FHandle, ResultIsManifoldAndOriented)); + Result := (ResultIsManifoldAndOriented <> 0); end; - function TLib3MFMultiPropertyGroupIterator.GetCurrentMultiPropertyGroup(): TLib3MFMultiPropertyGroup; + function TLib3MFMeshObject.BeamLattice(): TLib3MFBeamLattice; var - HResource: TLib3MFHandle; + HTheBeamLattice: TLib3MFHandle; begin Result := nil; - HResource := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroupIterator_GetCurrentMultiPropertyGroupFunc(FHandle, HResource)); - if Assigned(HResource) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResource); + HTheBeamLattice := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_BeamLatticeFunc(FHandle, HTheBeamLattice)); + if Assigned(HTheBeamLattice) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HTheBeamLattice); end; (************************************************************************************************************************* - Class implementation for MetaData + Class implementation for BeamLattice **************************************************************************************************************************) - constructor TLib3MFMetaData.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + constructor TLib3MFBeamLattice.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin inherited Create(AWrapper, AHandle); end; - destructor TLib3MFMetaData.Destroy; + destructor TLib3MFBeamLattice.Destroy; begin inherited; end; - function TLib3MFMetaData.GetNameSpace(): String; - var - bytesNeededNameSpace: Cardinal; - bytesWrittenNameSpace: Cardinal; - bufferNameSpace: array of Char; + function TLib3MFBeamLattice.GetMinLength(): Double; begin - bytesNeededNameSpace:= 0; - bytesWrittenNameSpace:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_GetNameSpaceFunc(FHandle, 0, bytesNeededNameSpace, nil)); - SetLength(bufferNameSpace, bytesNeededNameSpace); - FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_GetNameSpaceFunc(FHandle, bytesNeededNameSpace, bytesWrittenNameSpace, @bufferNameSpace[0])); - Result := StrPas(@bufferNameSpace[0]); + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetMinLengthFunc(FHandle, Result)); end; - procedure TLib3MFMetaData.SetNameSpace(const ANameSpace: String); + procedure TLib3MFBeamLattice.SetMinLength(const AMinLength: Double); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_SetNameSpaceFunc(FHandle, PAnsiChar(ANameSpace))); + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_SetMinLengthFunc(FHandle, AMinLength)); end; - function TLib3MFMetaData.GetName(): String; + procedure TLib3MFBeamLattice.GetClipping(out AClipMode: TLib3MFBeamLatticeClipMode; out AUniqueResourceID: Cardinal); var - bytesNeededName: Cardinal; - bytesWrittenName: Cardinal; - bufferName: array of Char; + ResultClipMode: Integer; begin - bytesNeededName:= 0; - bytesWrittenName:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_GetNameFunc(FHandle, 0, bytesNeededName, nil)); - SetLength(bufferName, bytesNeededName); - FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_GetNameFunc(FHandle, bytesNeededName, bytesWrittenName, @bufferName[0])); - Result := StrPas(@bufferName[0]); + ResultClipMode := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetClippingFunc(FHandle, ResultClipMode, AUniqueResourceID)); + AClipMode := convertConstToBeamLatticeClipMode(ResultClipMode); end; - procedure TLib3MFMetaData.SetName(const AName: String); + procedure TLib3MFBeamLattice.SetClipping(const AClipMode: TLib3MFBeamLatticeClipMode; const AUniqueResourceID: Cardinal); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_SetNameFunc(FHandle, PAnsiChar(AName))); + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_SetClippingFunc(FHandle, convertBeamLatticeClipModeToConst(AClipMode), AUniqueResourceID)); end; - function TLib3MFMetaData.GetKey(): String; + function TLib3MFBeamLattice.GetRepresentation(out AUniqueResourceID: Cardinal): Boolean; var - bytesNeededKey: Cardinal; - bytesWrittenKey: Cardinal; - bufferKey: array of Char; + ResultHasRepresentation: Byte; begin - bytesNeededKey:= 0; - bytesWrittenKey:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_GetKeyFunc(FHandle, 0, bytesNeededKey, nil)); - SetLength(bufferKey, bytesNeededKey); - FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_GetKeyFunc(FHandle, bytesNeededKey, bytesWrittenKey, @bufferKey[0])); - Result := StrPas(@bufferKey[0]); + ResultHasRepresentation := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetRepresentationFunc(FHandle, ResultHasRepresentation, AUniqueResourceID)); + Result := (ResultHasRepresentation <> 0); end; - function TLib3MFMetaData.GetMustPreserve(): Boolean; + procedure TLib3MFBeamLattice.SetRepresentation(const AUniqueResourceID: Cardinal); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_SetRepresentationFunc(FHandle, AUniqueResourceID)); + end; + + procedure TLib3MFBeamLattice.GetBallOptions(out ABallMode: TLib3MFBeamLatticeBallMode; out ABallRadius: Double); var - ResultMustPreserve: Byte; + ResultBallMode: Integer; begin - ResultMustPreserve := 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_GetMustPreserveFunc(FHandle, ResultMustPreserve)); - Result := (ResultMustPreserve <> 0); + ResultBallMode := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetBallOptionsFunc(FHandle, ResultBallMode, ABallRadius)); + ABallMode := convertConstToBeamLatticeBallMode(ResultBallMode); end; - procedure TLib3MFMetaData.SetMustPreserve(const AMustPreserve: Boolean); + procedure TLib3MFBeamLattice.SetBallOptions(const ABallMode: TLib3MFBeamLatticeBallMode; const ABallRadius: Double); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_SetMustPreserveFunc(FHandle, Ord(AMustPreserve))); + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_SetBallOptionsFunc(FHandle, convertBeamLatticeBallModeToConst(ABallMode), ABallRadius)); end; - function TLib3MFMetaData.GetType(): String; - var - bytesNeededType: Cardinal; - bytesWrittenType: Cardinal; - bufferType: array of Char; + function TLib3MFBeamLattice.GetBeamCount(): Cardinal; begin - bytesNeededType:= 0; - bytesWrittenType:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_GetTypeFunc(FHandle, 0, bytesNeededType, nil)); - SetLength(bufferType, bytesNeededType); - FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_GetTypeFunc(FHandle, bytesNeededType, bytesWrittenType, @bufferType[0])); - Result := StrPas(@bufferType[0]); + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetBeamCountFunc(FHandle, Result)); end; - procedure TLib3MFMetaData.SetType(const AType: String); + function TLib3MFBeamLattice.GetBeam(const AIndex: Cardinal): TLib3MFBeam; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_SetTypeFunc(FHandle, PAnsiChar(AType))); + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetBeamFunc(FHandle, AIndex, @Result)); end; - function TLib3MFMetaData.GetValue(): String; + function TLib3MFBeamLattice.AddBeam(const ABeamInfo: TLib3MFBeam): Cardinal; + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_AddBeamFunc(FHandle, @ABeamInfo, Result)); + end; + + procedure TLib3MFBeamLattice.SetBeam(const AIndex: Cardinal; const ABeamInfo: TLib3MFBeam); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_SetBeamFunc(FHandle, AIndex, @ABeamInfo)); + end; + + procedure TLib3MFBeamLattice.SetBeams(const ABeamInfo: ArrayOfLib3MFBeam); var - bytesNeededValue: Cardinal; - bytesWrittenValue: Cardinal; - bufferValue: array of Char; + PtrBeamInfo: PLib3MFBeam; + LenBeamInfo: QWord; begin - bytesNeededValue:= 0; - bytesWrittenValue:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_GetValueFunc(FHandle, 0, bytesNeededValue, nil)); - SetLength(bufferValue, bytesNeededValue); - FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_GetValueFunc(FHandle, bytesNeededValue, bytesWrittenValue, @bufferValue[0])); - Result := StrPas(@bufferValue[0]); + LenBeamInfo := Length(ABeamInfo); + if LenBeamInfo > $FFFFFFFF then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); + if LenBeamInfo > 0 then + PtrBeamInfo := @ABeamInfo[0] + else + PtrBeamInfo := nil; + + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_SetBeamsFunc(FHandle, QWord(LenBeamInfo), PtrBeamInfo)); end; - procedure TLib3MFMetaData.SetValue(const AValue: String); + procedure TLib3MFBeamLattice.GetBeams(out ABeamInfo: ArrayOfLib3MFBeam); + var + countNeededBeamInfo: QWord; + countWrittenBeamInfo: QWord; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFMetaData_SetValueFunc(FHandle, PAnsiChar(AValue))); + countNeededBeamInfo:= 0; + countWrittenBeamInfo:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetBeamsFunc(FHandle, 0, countNeededBeamInfo, nil)); + SetLength(ABeamInfo, countNeededBeamInfo); + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetBeamsFunc(FHandle, countNeededBeamInfo, countWrittenBeamInfo, @ABeamInfo[0])); end; -(************************************************************************************************************************* - Class implementation for MetaDataGroup -**************************************************************************************************************************) + function TLib3MFBeamLattice.GetBallCount(): Cardinal; + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetBallCountFunc(FHandle, Result)); + end; - constructor TLib3MFMetaDataGroup.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + function TLib3MFBeamLattice.GetBall(const AIndex: Cardinal): TLib3MFBall; begin - inherited Create(AWrapper, AHandle); + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetBallFunc(FHandle, AIndex, @Result)); end; - destructor TLib3MFMetaDataGroup.Destroy; + function TLib3MFBeamLattice.AddBall(const ABallInfo: TLib3MFBall): Cardinal; begin - inherited; + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_AddBallFunc(FHandle, @ABallInfo, Result)); end; - function TLib3MFMetaDataGroup.GetMetaDataCount(): Cardinal; + procedure TLib3MFBeamLattice.SetBall(const AIndex: Cardinal; const ABallInfo: TLib3MFBall); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFMetaDataGroup_GetMetaDataCountFunc(FHandle, Result)); + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_SetBallFunc(FHandle, AIndex, @ABallInfo)); end; - function TLib3MFMetaDataGroup.GetMetaData(const AIndex: Cardinal): TLib3MFMetaData; + procedure TLib3MFBeamLattice.SetBalls(const ABallInfo: ArrayOfLib3MFBall); var - HMetaData: TLib3MFHandle; + PtrBallInfo: PLib3MFBall; + LenBallInfo: QWord; begin - Result := nil; - HMetaData := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFMetaDataGroup_GetMetaDataFunc(FHandle, AIndex, HMetaData)); - if Assigned(HMetaData) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HMetaData); + LenBallInfo := Length(ABallInfo); + if LenBallInfo > $FFFFFFFF then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); + if LenBallInfo > 0 then + PtrBallInfo := @ABallInfo[0] + else + PtrBallInfo := nil; + + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_SetBallsFunc(FHandle, QWord(LenBallInfo), PtrBallInfo)); end; - function TLib3MFMetaDataGroup.GetMetaDataByKey(const ANameSpace: String; const AName: String): TLib3MFMetaData; + procedure TLib3MFBeamLattice.GetBalls(out ABallInfo: ArrayOfLib3MFBall); var - HMetaData: TLib3MFHandle; + countNeededBallInfo: QWord; + countWrittenBallInfo: QWord; begin - Result := nil; - HMetaData := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFMetaDataGroup_GetMetaDataByKeyFunc(FHandle, PAnsiChar(ANameSpace), PAnsiChar(AName), HMetaData)); - if Assigned(HMetaData) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HMetaData); + countNeededBallInfo:= 0; + countWrittenBallInfo:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetBallsFunc(FHandle, 0, countNeededBallInfo, nil)); + SetLength(ABallInfo, countNeededBallInfo); + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetBallsFunc(FHandle, countNeededBallInfo, countWrittenBallInfo, @ABallInfo[0])); end; - procedure TLib3MFMetaDataGroup.RemoveMetaDataByIndex(const AIndex: Cardinal); + function TLib3MFBeamLattice.GetBeamSetCount(): Cardinal; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFMetaDataGroup_RemoveMetaDataByIndexFunc(FHandle, AIndex)); + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetBeamSetCountFunc(FHandle, Result)); end; - procedure TLib3MFMetaDataGroup.RemoveMetaData(const ATheMetaData: TLib3MFMetaData); + function TLib3MFBeamLattice.AddBeamSet(): TLib3MFBeamSet; var - ATheMetaDataHandle: TLib3MFHandle; + HBeamSet: TLib3MFHandle; begin - if Assigned(ATheMetaData) then - ATheMetaDataHandle := ATheMetaData.TheHandle - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ATheMetaData is a nil value.'); - FWrapper.CheckError(Self, FWrapper.Lib3MFMetaDataGroup_RemoveMetaDataFunc(FHandle, ATheMetaDataHandle)); + Result := nil; + HBeamSet := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_AddBeamSetFunc(FHandle, HBeamSet)); + if Assigned(HBeamSet) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HBeamSet); end; - function TLib3MFMetaDataGroup.AddMetaData(const ANameSpace: String; const AName: String; const AValue: String; const AType: String; const AMustPreserve: Boolean): TLib3MFMetaData; + function TLib3MFBeamLattice.GetBeamSet(const AIndex: Cardinal): TLib3MFBeamSet; var - HMetaData: TLib3MFHandle; + HBeamSet: TLib3MFHandle; begin Result := nil; - HMetaData := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFMetaDataGroup_AddMetaDataFunc(FHandle, PAnsiChar(ANameSpace), PAnsiChar(AName), PAnsiChar(AValue), PAnsiChar(AType), Ord(AMustPreserve), HMetaData)); - if Assigned(HMetaData) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HMetaData); + HBeamSet := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetBeamSetFunc(FHandle, AIndex, HBeamSet)); + if Assigned(HBeamSet) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HBeamSet); end; (************************************************************************************************************************* - Class implementation for Object + Class implementation for Component **************************************************************************************************************************) - constructor TLib3MFObject.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + constructor TLib3MFComponent.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin inherited Create(AWrapper, AHandle); end; - destructor TLib3MFObject.Destroy; + destructor TLib3MFComponent.Destroy; begin inherited; end; - function TLib3MFObject.GetType(): TLib3MFObjectType; + function TLib3MFComponent.GetObjectResource(): TLib3MFObject; var - ResultObjectType: Integer; + HObjectResource: TLib3MFHandle; begin - ResultObjectType := 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFObject_GetTypeFunc(FHandle, ResultObjectType)); - Result := convertConstToObjectType(ResultObjectType); + Result := nil; + HObjectResource := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFComponent_GetObjectResourceFunc(FHandle, HObjectResource)); + if Assigned(HObjectResource) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HObjectResource); + end; + + function TLib3MFComponent.GetObjectResourceID(): Cardinal; + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFComponent_GetObjectResourceIDFunc(FHandle, Result)); + end; + + function TLib3MFComponent.GetUUID(out AHasUUID: Boolean): String; + var + ResultHasUUID: Byte; + bytesNeededUUID: Cardinal; + bytesWrittenUUID: Cardinal; + bufferUUID: array of Char; + begin + ResultHasUUID := 0; + bytesNeededUUID:= 0; + bytesWrittenUUID:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFComponent_GetUUIDFunc(FHandle, ResultHasUUID, 0, bytesNeededUUID, nil)); + SetLength(bufferUUID, bytesNeededUUID); + FWrapper.CheckError(Self, FWrapper.Lib3MFComponent_GetUUIDFunc(FHandle, ResultHasUUID, bytesNeededUUID, bytesWrittenUUID, @bufferUUID[0])); + AHasUUID := ResultHasUUID <> 0; + Result := StrPas(@bufferUUID[0]); end; - procedure TLib3MFObject.SetType(const AObjectType: TLib3MFObjectType); + procedure TLib3MFComponent.SetUUID(const AUUID: String); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFObject_SetTypeFunc(FHandle, convertObjectTypeToConst(AObjectType))); + FWrapper.CheckError(Self, FWrapper.Lib3MFComponent_SetUUIDFunc(FHandle, PAnsiChar(AUUID))); end; - function TLib3MFObject.GetName(): String; + function TLib3MFComponent.HasTransform(): Boolean; var - bytesNeededName: Cardinal; - bytesWrittenName: Cardinal; - bufferName: array of Char; + ResultHasTransform: Byte; begin - bytesNeededName:= 0; - bytesWrittenName:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFObject_GetNameFunc(FHandle, 0, bytesNeededName, nil)); - SetLength(bufferName, bytesNeededName); - FWrapper.CheckError(Self, FWrapper.Lib3MFObject_GetNameFunc(FHandle, bytesNeededName, bytesWrittenName, @bufferName[0])); - Result := StrPas(@bufferName[0]); + ResultHasTransform := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFComponent_HasTransformFunc(FHandle, ResultHasTransform)); + Result := (ResultHasTransform <> 0); end; - procedure TLib3MFObject.SetName(const AName: String); + function TLib3MFComponent.GetTransform(): TLib3MFTransform; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFObject_SetNameFunc(FHandle, PAnsiChar(AName))); + FWrapper.CheckError(Self, FWrapper.Lib3MFComponent_GetTransformFunc(FHandle, @Result)); end; - function TLib3MFObject.GetPartNumber(): String; - var - bytesNeededPartNumber: Cardinal; - bytesWrittenPartNumber: Cardinal; - bufferPartNumber: array of Char; + procedure TLib3MFComponent.SetTransform(const ATransform: TLib3MFTransform); begin - bytesNeededPartNumber:= 0; - bytesWrittenPartNumber:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFObject_GetPartNumberFunc(FHandle, 0, bytesNeededPartNumber, nil)); - SetLength(bufferPartNumber, bytesNeededPartNumber); - FWrapper.CheckError(Self, FWrapper.Lib3MFObject_GetPartNumberFunc(FHandle, bytesNeededPartNumber, bytesWrittenPartNumber, @bufferPartNumber[0])); - Result := StrPas(@bufferPartNumber[0]); + FWrapper.CheckError(Self, FWrapper.Lib3MFComponent_SetTransformFunc(FHandle, @ATransform)); end; - procedure TLib3MFObject.SetPartNumber(const APartNumber: String); +(************************************************************************************************************************* + Class implementation for ComponentsObject +**************************************************************************************************************************) + + constructor TLib3MFComponentsObject.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFObject_SetPartNumberFunc(FHandle, PAnsiChar(APartNumber))); + inherited Create(AWrapper, AHandle); end; - function TLib3MFObject.IsMeshObject(): Boolean; - var - ResultIsMeshObject: Byte; + destructor TLib3MFComponentsObject.Destroy; begin - ResultIsMeshObject := 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFObject_IsMeshObjectFunc(FHandle, ResultIsMeshObject)); - Result := (ResultIsMeshObject <> 0); + inherited; end; - function TLib3MFObject.IsComponentsObject(): Boolean; + function TLib3MFComponentsObject.AddComponent(const AObjectResource: TLib3MFObject; const ATransform: TLib3MFTransform): TLib3MFComponent; var - ResultIsComponentsObject: Byte; + AObjectResourceHandle: TLib3MFHandle; + HComponentInstance: TLib3MFHandle; begin - ResultIsComponentsObject := 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFObject_IsComponentsObjectFunc(FHandle, ResultIsComponentsObject)); - Result := (ResultIsComponentsObject <> 0); + if Assigned(AObjectResource) then + AObjectResourceHandle := AObjectResource.TheHandle + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'AObjectResource is a nil value.'); + Result := nil; + HComponentInstance := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFComponentsObject_AddComponentFunc(FHandle, AObjectResourceHandle, @ATransform, HComponentInstance)); + if Assigned(HComponentInstance) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HComponentInstance); end; - function TLib3MFObject.IsValid(): Boolean; + function TLib3MFComponentsObject.GetComponent(const AIndex: Cardinal): TLib3MFComponent; var - ResultIsValid: Byte; + HComponentInstance: TLib3MFHandle; begin - ResultIsValid := 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFObject_IsValidFunc(FHandle, ResultIsValid)); - Result := (ResultIsValid <> 0); + Result := nil; + HComponentInstance := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFComponentsObject_GetComponentFunc(FHandle, AIndex, HComponentInstance)); + if Assigned(HComponentInstance) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HComponentInstance); end; - procedure TLib3MFObject.SetAttachmentAsThumbnail(const AAttachment: TLib3MFAttachment); - var - AAttachmentHandle: TLib3MFHandle; + function TLib3MFComponentsObject.GetComponentCount(): Cardinal; begin - if Assigned(AAttachment) then - AAttachmentHandle := AAttachment.TheHandle - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'AAttachment is a nil value.'); - FWrapper.CheckError(Self, FWrapper.Lib3MFObject_SetAttachmentAsThumbnailFunc(FHandle, AAttachmentHandle)); + FWrapper.CheckError(Self, FWrapper.Lib3MFComponentsObject_GetComponentCountFunc(FHandle, Result)); end; - function TLib3MFObject.GetThumbnailAttachment(): TLib3MFAttachment; - var - HAttachment: TLib3MFHandle; +(************************************************************************************************************************* + Class implementation for BeamSet +**************************************************************************************************************************) + + constructor TLib3MFBeamSet.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin - Result := nil; - HAttachment := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFObject_GetThumbnailAttachmentFunc(FHandle, HAttachment)); - if Assigned(HAttachment) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HAttachment); + inherited Create(AWrapper, AHandle); end; - procedure TLib3MFObject.ClearThumbnailAttachment(); + destructor TLib3MFBeamSet.Destroy; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFObject_ClearThumbnailAttachmentFunc(FHandle)); + inherited; end; - function TLib3MFObject.GetOutbox(): TLib3MFBox; + procedure TLib3MFBeamSet.SetName(const AName: String); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFObject_GetOutboxFunc(FHandle, @Result)); + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_SetNameFunc(FHandle, PAnsiChar(AName))); end; - function TLib3MFObject.GetUUID(out AHasUUID: Boolean): String; + function TLib3MFBeamSet.GetName(): String; var - ResultHasUUID: Byte; - bytesNeededUUID: Cardinal; - bytesWrittenUUID: Cardinal; - bufferUUID: array of Char; + bytesNeededName: Cardinal; + bytesWrittenName: Cardinal; + bufferName: array of Char; begin - ResultHasUUID := 0; - bytesNeededUUID:= 0; - bytesWrittenUUID:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFObject_GetUUIDFunc(FHandle, ResultHasUUID, 0, bytesNeededUUID, nil)); - SetLength(bufferUUID, bytesNeededUUID); - FWrapper.CheckError(Self, FWrapper.Lib3MFObject_GetUUIDFunc(FHandle, ResultHasUUID, bytesNeededUUID, bytesWrittenUUID, @bufferUUID[0])); - AHasUUID := ResultHasUUID <> 0; - Result := StrPas(@bufferUUID[0]); + bytesNeededName:= 0; + bytesWrittenName:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_GetNameFunc(FHandle, 0, bytesNeededName, nil)); + SetLength(bufferName, bytesNeededName); + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_GetNameFunc(FHandle, bytesNeededName, bytesWrittenName, @bufferName[0])); + Result := StrPas(@bufferName[0]); end; - procedure TLib3MFObject.SetUUID(const AUUID: String); + procedure TLib3MFBeamSet.SetIdentifier(const AIdentifier: String); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFObject_SetUUIDFunc(FHandle, PAnsiChar(AUUID))); + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_SetIdentifierFunc(FHandle, PAnsiChar(AIdentifier))); end; - function TLib3MFObject.GetMetaDataGroup(): TLib3MFMetaDataGroup; + function TLib3MFBeamSet.GetIdentifier(): String; var - HMetaDataGroup: TLib3MFHandle; + bytesNeededIdentifier: Cardinal; + bytesWrittenIdentifier: Cardinal; + bufferIdentifier: array of Char; begin - Result := nil; - HMetaDataGroup := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFObject_GetMetaDataGroupFunc(FHandle, HMetaDataGroup)); - if Assigned(HMetaDataGroup) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HMetaDataGroup); + bytesNeededIdentifier:= 0; + bytesWrittenIdentifier:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_GetIdentifierFunc(FHandle, 0, bytesNeededIdentifier, nil)); + SetLength(bufferIdentifier, bytesNeededIdentifier); + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_GetIdentifierFunc(FHandle, bytesNeededIdentifier, bytesWrittenIdentifier, @bufferIdentifier[0])); + Result := StrPas(@bufferIdentifier[0]); end; - procedure TLib3MFObject.SetSlicesMeshResolution(const AMeshResolution: TLib3MFSlicesMeshResolution); + function TLib3MFBeamSet.GetReferenceCount(): Cardinal; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFObject_SetSlicesMeshResolutionFunc(FHandle, convertSlicesMeshResolutionToConst(AMeshResolution))); + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_GetReferenceCountFunc(FHandle, Result)); end; - function TLib3MFObject.GetSlicesMeshResolution(): TLib3MFSlicesMeshResolution; + procedure TLib3MFBeamSet.SetReferences(const AReferences: TCardinalDynArray); var - ResultMeshResolution: Integer; + PtrReferences: PCardinal; + LenReferences: QWord; begin - ResultMeshResolution := 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFObject_GetSlicesMeshResolutionFunc(FHandle, ResultMeshResolution)); - Result := convertConstToSlicesMeshResolution(ResultMeshResolution); + LenReferences := Length(AReferences); + if LenReferences > $FFFFFFFF then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); + if LenReferences > 0 then + PtrReferences := @AReferences[0] + else + PtrReferences := nil; + + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_SetReferencesFunc(FHandle, QWord(LenReferences), PtrReferences)); end; - function TLib3MFObject.HasSlices(const ARecursive: Boolean): Boolean; + procedure TLib3MFBeamSet.GetReferences(out AReferences: TCardinalDynArray); var - ResultHasSlices: Byte; + countNeededReferences: QWord; + countWrittenReferences: QWord; begin - ResultHasSlices := 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFObject_HasSlicesFunc(FHandle, Ord(ARecursive), ResultHasSlices)); - Result := (ResultHasSlices <> 0); + countNeededReferences:= 0; + countWrittenReferences:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_GetReferencesFunc(FHandle, 0, countNeededReferences, nil)); + SetLength(AReferences, countNeededReferences); + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_GetReferencesFunc(FHandle, countNeededReferences, countWrittenReferences, @AReferences[0])); end; - procedure TLib3MFObject.ClearSliceStack(); + function TLib3MFBeamSet.GetBallReferenceCount(): Cardinal; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFObject_ClearSliceStackFunc(FHandle)); + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_GetBallReferenceCountFunc(FHandle, Result)); end; - function TLib3MFObject.GetSliceStack(): TLib3MFSliceStack; + procedure TLib3MFBeamSet.SetBallReferences(const ABallReferences: TCardinalDynArray); var - HSliceStackInstance: TLib3MFHandle; + PtrBallReferences: PCardinal; + LenBallReferences: QWord; begin - Result := nil; - HSliceStackInstance := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFObject_GetSliceStackFunc(FHandle, HSliceStackInstance)); - if Assigned(HSliceStackInstance) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HSliceStackInstance); + LenBallReferences := Length(ABallReferences); + if LenBallReferences > $FFFFFFFF then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); + if LenBallReferences > 0 then + PtrBallReferences := @ABallReferences[0] + else + PtrBallReferences := nil; + + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_SetBallReferencesFunc(FHandle, QWord(LenBallReferences), PtrBallReferences)); end; - procedure TLib3MFObject.AssignSliceStack(const ASliceStackInstance: TLib3MFSliceStack); + procedure TLib3MFBeamSet.GetBallReferences(out ABallReferences: TCardinalDynArray); var - ASliceStackInstanceHandle: TLib3MFHandle; + countNeededBallReferences: QWord; + countWrittenBallReferences: QWord; begin - if Assigned(ASliceStackInstance) then - ASliceStackInstanceHandle := ASliceStackInstance.TheHandle - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ASliceStackInstance is a nil value.'); - FWrapper.CheckError(Self, FWrapper.Lib3MFObject_AssignSliceStackFunc(FHandle, ASliceStackInstanceHandle)); + countNeededBallReferences:= 0; + countWrittenBallReferences:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_GetBallReferencesFunc(FHandle, 0, countNeededBallReferences, nil)); + SetLength(ABallReferences, countNeededBallReferences); + FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_GetBallReferencesFunc(FHandle, countNeededBallReferences, countWrittenBallReferences, @ABallReferences[0])); end; (************************************************************************************************************************* - Class implementation for MeshObject + Class implementation for BaseMaterialGroup **************************************************************************************************************************) - constructor TLib3MFMeshObject.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + constructor TLib3MFBaseMaterialGroup.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin inherited Create(AWrapper, AHandle); end; - destructor TLib3MFMeshObject.Destroy; - begin - inherited; - end; - - function TLib3MFMeshObject.GetVertexCount(): Cardinal; - begin - FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_GetVertexCountFunc(FHandle, Result)); - end; - - function TLib3MFMeshObject.GetTriangleCount(): Cardinal; - begin - FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_GetTriangleCountFunc(FHandle, Result)); - end; - - function TLib3MFMeshObject.GetVertex(const AIndex: Cardinal): TLib3MFPosition; - begin - FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_GetVertexFunc(FHandle, AIndex, @Result)); - end; - - procedure TLib3MFMeshObject.SetVertex(const AIndex: Cardinal; const ACoordinates: TLib3MFPosition); + destructor TLib3MFBaseMaterialGroup.Destroy; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_SetVertexFunc(FHandle, AIndex, @ACoordinates)); + inherited; end; - function TLib3MFMeshObject.AddVertex(const ACoordinates: TLib3MFPosition): Cardinal; + function TLib3MFBaseMaterialGroup.GetCount(): Cardinal; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_AddVertexFunc(FHandle, @ACoordinates, Result)); + FWrapper.CheckError(Self, FWrapper.Lib3MFBaseMaterialGroup_GetCountFunc(FHandle, Result)); end; - procedure TLib3MFMeshObject.GetVertices(out AVertices: ArrayOfLib3MFPosition); + procedure TLib3MFBaseMaterialGroup.GetAllPropertyIDs(out APropertyIDs: TCardinalDynArray); var - countNeededVertices: QWord; - countWrittenVertices: QWord; + countNeededPropertyIDs: QWord; + countWrittenPropertyIDs: QWord; begin - countNeededVertices:= 0; - countWrittenVertices:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_GetVerticesFunc(FHandle, 0, countNeededVertices, nil)); - SetLength(AVertices, countNeededVertices); - FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_GetVerticesFunc(FHandle, countNeededVertices, countWrittenVertices, @AVertices[0])); + countNeededPropertyIDs:= 0; + countWrittenPropertyIDs:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFBaseMaterialGroup_GetAllPropertyIDsFunc(FHandle, 0, countNeededPropertyIDs, nil)); + SetLength(APropertyIDs, countNeededPropertyIDs); + FWrapper.CheckError(Self, FWrapper.Lib3MFBaseMaterialGroup_GetAllPropertyIDsFunc(FHandle, countNeededPropertyIDs, countWrittenPropertyIDs, @APropertyIDs[0])); end; - function TLib3MFMeshObject.GetTriangle(const AIndex: Cardinal): TLib3MFTriangle; + function TLib3MFBaseMaterialGroup.AddMaterial(const AName: String; const ADisplayColor: TLib3MFColor): Cardinal; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_GetTriangleFunc(FHandle, AIndex, @Result)); + FWrapper.CheckError(Self, FWrapper.Lib3MFBaseMaterialGroup_AddMaterialFunc(FHandle, PAnsiChar(AName), @ADisplayColor, Result)); end; - procedure TLib3MFMeshObject.SetTriangle(const AIndex: Cardinal; const AIndices: TLib3MFTriangle); + procedure TLib3MFBaseMaterialGroup.RemoveMaterial(const APropertyID: Cardinal); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_SetTriangleFunc(FHandle, AIndex, @AIndices)); + FWrapper.CheckError(Self, FWrapper.Lib3MFBaseMaterialGroup_RemoveMaterialFunc(FHandle, APropertyID)); end; - function TLib3MFMeshObject.AddTriangle(const AIndices: TLib3MFTriangle): Cardinal; + function TLib3MFBaseMaterialGroup.GetName(const APropertyID: Cardinal): String; + var + bytesNeededName: Cardinal; + bytesWrittenName: Cardinal; + bufferName: array of Char; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_AddTriangleFunc(FHandle, @AIndices, Result)); + bytesNeededName:= 0; + bytesWrittenName:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFBaseMaterialGroup_GetNameFunc(FHandle, APropertyID, 0, bytesNeededName, nil)); + SetLength(bufferName, bytesNeededName); + FWrapper.CheckError(Self, FWrapper.Lib3MFBaseMaterialGroup_GetNameFunc(FHandle, APropertyID, bytesNeededName, bytesWrittenName, @bufferName[0])); + Result := StrPas(@bufferName[0]); end; - procedure TLib3MFMeshObject.GetTriangleIndices(out AIndices: ArrayOfLib3MFTriangle); - var - countNeededIndices: QWord; - countWrittenIndices: QWord; + procedure TLib3MFBaseMaterialGroup.SetName(const APropertyID: Cardinal; const AName: String); begin - countNeededIndices:= 0; - countWrittenIndices:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_GetTriangleIndicesFunc(FHandle, 0, countNeededIndices, nil)); - SetLength(AIndices, countNeededIndices); - FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_GetTriangleIndicesFunc(FHandle, countNeededIndices, countWrittenIndices, @AIndices[0])); + FWrapper.CheckError(Self, FWrapper.Lib3MFBaseMaterialGroup_SetNameFunc(FHandle, APropertyID, PAnsiChar(AName))); end; - procedure TLib3MFMeshObject.SetObjectLevelProperty(const AUniqueResourceID: Cardinal; const APropertyID: Cardinal); + procedure TLib3MFBaseMaterialGroup.SetDisplayColor(const APropertyID: Cardinal; const ATheColor: TLib3MFColor); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_SetObjectLevelPropertyFunc(FHandle, AUniqueResourceID, APropertyID)); + FWrapper.CheckError(Self, FWrapper.Lib3MFBaseMaterialGroup_SetDisplayColorFunc(FHandle, APropertyID, @ATheColor)); end; - function TLib3MFMeshObject.GetObjectLevelProperty(out AUniqueResourceID: Cardinal; out APropertyID: Cardinal): Boolean; - var - ResultHasObjectLevelProperty: Byte; + function TLib3MFBaseMaterialGroup.GetDisplayColor(const APropertyID: Cardinal): TLib3MFColor; begin - ResultHasObjectLevelProperty := 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_GetObjectLevelPropertyFunc(FHandle, AUniqueResourceID, APropertyID, ResultHasObjectLevelProperty)); - Result := (ResultHasObjectLevelProperty <> 0); + FWrapper.CheckError(Self, FWrapper.Lib3MFBaseMaterialGroup_GetDisplayColorFunc(FHandle, APropertyID, @Result)); end; - procedure TLib3MFMeshObject.SetTriangleProperties(const AIndex: Cardinal; const AProperties: TLib3MFTriangleProperties); +(************************************************************************************************************************* + Class implementation for ColorGroup +**************************************************************************************************************************) + + constructor TLib3MFColorGroup.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_SetTrianglePropertiesFunc(FHandle, AIndex, @AProperties)); + inherited Create(AWrapper, AHandle); end; - procedure TLib3MFMeshObject.GetTriangleProperties(const AIndex: Cardinal; out AProperty: TLib3MFTriangleProperties); + destructor TLib3MFColorGroup.Destroy; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_GetTrianglePropertiesFunc(FHandle, AIndex, @AProperty)); + inherited; end; - procedure TLib3MFMeshObject.SetAllTriangleProperties(const APropertiesArray: ArrayOfLib3MFTriangleProperties); - var - PtrPropertiesArray: PLib3MFTriangleProperties; - LenPropertiesArray: QWord; + function TLib3MFColorGroup.GetCount(): Cardinal; begin - LenPropertiesArray := Length(APropertiesArray); - if LenPropertiesArray > $FFFFFFFF then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); - if LenPropertiesArray > 0 then - PtrPropertiesArray := @APropertiesArray[0] - else - PtrPropertiesArray := nil; - - FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_SetAllTrianglePropertiesFunc(FHandle, QWord(LenPropertiesArray), PtrPropertiesArray)); + FWrapper.CheckError(Self, FWrapper.Lib3MFColorGroup_GetCountFunc(FHandle, Result)); end; - procedure TLib3MFMeshObject.GetAllTriangleProperties(out APropertiesArray: ArrayOfLib3MFTriangleProperties); + procedure TLib3MFColorGroup.GetAllPropertyIDs(out APropertyIDs: TCardinalDynArray); var - countNeededPropertiesArray: QWord; - countWrittenPropertiesArray: QWord; + countNeededPropertyIDs: QWord; + countWrittenPropertyIDs: QWord; begin - countNeededPropertiesArray:= 0; - countWrittenPropertiesArray:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_GetAllTrianglePropertiesFunc(FHandle, 0, countNeededPropertiesArray, nil)); - SetLength(APropertiesArray, countNeededPropertiesArray); - FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_GetAllTrianglePropertiesFunc(FHandle, countNeededPropertiesArray, countWrittenPropertiesArray, @APropertiesArray[0])); + countNeededPropertyIDs:= 0; + countWrittenPropertyIDs:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFColorGroup_GetAllPropertyIDsFunc(FHandle, 0, countNeededPropertyIDs, nil)); + SetLength(APropertyIDs, countNeededPropertyIDs); + FWrapper.CheckError(Self, FWrapper.Lib3MFColorGroup_GetAllPropertyIDsFunc(FHandle, countNeededPropertyIDs, countWrittenPropertyIDs, @APropertyIDs[0])); end; - procedure TLib3MFMeshObject.ClearAllProperties(); + function TLib3MFColorGroup.AddColor(const ATheColor: TLib3MFColor): Cardinal; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_ClearAllPropertiesFunc(FHandle)); + FWrapper.CheckError(Self, FWrapper.Lib3MFColorGroup_AddColorFunc(FHandle, @ATheColor, Result)); end; - procedure TLib3MFMeshObject.SetGeometry(const AVertices: ArrayOfLib3MFPosition; const AIndices: ArrayOfLib3MFTriangle); - var - PtrVertices: PLib3MFPosition; - LenVertices: QWord; - PtrIndices: PLib3MFTriangle; - LenIndices: QWord; + procedure TLib3MFColorGroup.RemoveColor(const APropertyID: Cardinal); begin - LenVertices := Length(AVertices); - if LenVertices > $FFFFFFFF then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); - if LenVertices > 0 then - PtrVertices := @AVertices[0] - else - PtrVertices := nil; - - LenIndices := Length(AIndices); - if LenIndices > $FFFFFFFF then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); - if LenIndices > 0 then - PtrIndices := @AIndices[0] - else - PtrIndices := nil; - - FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_SetGeometryFunc(FHandle, QWord(LenVertices), PtrVertices, QWord(LenIndices), PtrIndices)); + FWrapper.CheckError(Self, FWrapper.Lib3MFColorGroup_RemoveColorFunc(FHandle, APropertyID)); end; - function TLib3MFMeshObject.IsManifoldAndOriented(): Boolean; - var - ResultIsManifoldAndOriented: Byte; + procedure TLib3MFColorGroup.SetColor(const APropertyID: Cardinal; const ATheColor: TLib3MFColor); begin - ResultIsManifoldAndOriented := 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_IsManifoldAndOrientedFunc(FHandle, ResultIsManifoldAndOriented)); - Result := (ResultIsManifoldAndOriented <> 0); + FWrapper.CheckError(Self, FWrapper.Lib3MFColorGroup_SetColorFunc(FHandle, APropertyID, @ATheColor)); end; - function TLib3MFMeshObject.BeamLattice(): TLib3MFBeamLattice; - var - HTheBeamLattice: TLib3MFHandle; + function TLib3MFColorGroup.GetColor(const APropertyID: Cardinal): TLib3MFColor; begin - Result := nil; - HTheBeamLattice := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFMeshObject_BeamLatticeFunc(FHandle, HTheBeamLattice)); - if Assigned(HTheBeamLattice) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HTheBeamLattice); + FWrapper.CheckError(Self, FWrapper.Lib3MFColorGroup_GetColorFunc(FHandle, APropertyID, @Result)); end; (************************************************************************************************************************* - Class implementation for BeamLattice + Class implementation for Texture2DGroup **************************************************************************************************************************) - constructor TLib3MFBeamLattice.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + constructor TLib3MFTexture2DGroup.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin inherited Create(AWrapper, AHandle); end; - destructor TLib3MFBeamLattice.Destroy; + destructor TLib3MFTexture2DGroup.Destroy; begin inherited; end; - function TLib3MFBeamLattice.GetMinLength(): Double; + function TLib3MFTexture2DGroup.GetCount(): Cardinal; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetMinLengthFunc(FHandle, Result)); + FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2DGroup_GetCountFunc(FHandle, Result)); end; - procedure TLib3MFBeamLattice.SetMinLength(const AMinLength: Double); + procedure TLib3MFTexture2DGroup.GetAllPropertyIDs(out APropertyIDs: TCardinalDynArray); + var + countNeededPropertyIDs: QWord; + countWrittenPropertyIDs: QWord; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_SetMinLengthFunc(FHandle, AMinLength)); + countNeededPropertyIDs:= 0; + countWrittenPropertyIDs:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2DGroup_GetAllPropertyIDsFunc(FHandle, 0, countNeededPropertyIDs, nil)); + SetLength(APropertyIDs, countNeededPropertyIDs); + FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2DGroup_GetAllPropertyIDsFunc(FHandle, countNeededPropertyIDs, countWrittenPropertyIDs, @APropertyIDs[0])); end; - procedure TLib3MFBeamLattice.GetClipping(out AClipMode: TLib3MFBeamLatticeClipMode; out AUniqueResourceID: Cardinal); - var - ResultClipMode: Integer; + function TLib3MFTexture2DGroup.AddTex2Coord(const AUVCoordinate: TLib3MFTex2Coord): Cardinal; begin - ResultClipMode := 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetClippingFunc(FHandle, ResultClipMode, AUniqueResourceID)); - AClipMode := convertConstToBeamLatticeClipMode(ResultClipMode); + FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2DGroup_AddTex2CoordFunc(FHandle, @AUVCoordinate, Result)); end; - procedure TLib3MFBeamLattice.SetClipping(const AClipMode: TLib3MFBeamLatticeClipMode; const AUniqueResourceID: Cardinal); + function TLib3MFTexture2DGroup.GetTex2Coord(const APropertyID: Cardinal): TLib3MFTex2Coord; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_SetClippingFunc(FHandle, convertBeamLatticeClipModeToConst(AClipMode), AUniqueResourceID)); + FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2DGroup_GetTex2CoordFunc(FHandle, APropertyID, @Result)); end; - function TLib3MFBeamLattice.GetRepresentation(out AUniqueResourceID: Cardinal): Boolean; + procedure TLib3MFTexture2DGroup.RemoveTex2Coord(const APropertyID: Cardinal); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2DGroup_RemoveTex2CoordFunc(FHandle, APropertyID)); + end; + + function TLib3MFTexture2DGroup.GetTexture2D(): TLib3MFTexture2D; var - ResultHasRepresentation: Byte; + HTexture2DInstance: TLib3MFHandle; begin - ResultHasRepresentation := 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetRepresentationFunc(FHandle, ResultHasRepresentation, AUniqueResourceID)); - Result := (ResultHasRepresentation <> 0); + Result := nil; + HTexture2DInstance := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2DGroup_GetTexture2DFunc(FHandle, HTexture2DInstance)); + if Assigned(HTexture2DInstance) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HTexture2DInstance); end; - procedure TLib3MFBeamLattice.SetRepresentation(const AUniqueResourceID: Cardinal); +(************************************************************************************************************************* + Class implementation for CompositeMaterials +**************************************************************************************************************************) + + constructor TLib3MFCompositeMaterials.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_SetRepresentationFunc(FHandle, AUniqueResourceID)); + inherited Create(AWrapper, AHandle); end; - procedure TLib3MFBeamLattice.GetBallOptions(out ABallMode: TLib3MFBeamLatticeBallMode; out ABallRadius: Double); - var - ResultBallMode: Integer; + destructor TLib3MFCompositeMaterials.Destroy; begin - ResultBallMode := 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetBallOptionsFunc(FHandle, ResultBallMode, ABallRadius)); - ABallMode := convertConstToBeamLatticeBallMode(ResultBallMode); + inherited; end; - procedure TLib3MFBeamLattice.SetBallOptions(const ABallMode: TLib3MFBeamLatticeBallMode; const ABallRadius: Double); + function TLib3MFCompositeMaterials.GetCount(): Cardinal; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_SetBallOptionsFunc(FHandle, convertBeamLatticeBallModeToConst(ABallMode), ABallRadius)); + FWrapper.CheckError(Self, FWrapper.Lib3MFCompositeMaterials_GetCountFunc(FHandle, Result)); end; - function TLib3MFBeamLattice.GetBeamCount(): Cardinal; + procedure TLib3MFCompositeMaterials.GetAllPropertyIDs(out APropertyIDs: TCardinalDynArray); + var + countNeededPropertyIDs: QWord; + countWrittenPropertyIDs: QWord; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetBeamCountFunc(FHandle, Result)); + countNeededPropertyIDs:= 0; + countWrittenPropertyIDs:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFCompositeMaterials_GetAllPropertyIDsFunc(FHandle, 0, countNeededPropertyIDs, nil)); + SetLength(APropertyIDs, countNeededPropertyIDs); + FWrapper.CheckError(Self, FWrapper.Lib3MFCompositeMaterials_GetAllPropertyIDsFunc(FHandle, countNeededPropertyIDs, countWrittenPropertyIDs, @APropertyIDs[0])); end; - function TLib3MFBeamLattice.GetBeam(const AIndex: Cardinal): TLib3MFBeam; + function TLib3MFCompositeMaterials.GetBaseMaterialGroup(): TLib3MFBaseMaterialGroup; + var + HBaseMaterialGroupInstance: TLib3MFHandle; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetBeamFunc(FHandle, AIndex, @Result)); + Result := nil; + HBaseMaterialGroupInstance := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFCompositeMaterials_GetBaseMaterialGroupFunc(FHandle, HBaseMaterialGroupInstance)); + if Assigned(HBaseMaterialGroupInstance) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HBaseMaterialGroupInstance); end; - function TLib3MFBeamLattice.AddBeam(const ABeamInfo: TLib3MFBeam): Cardinal; + function TLib3MFCompositeMaterials.AddComposite(const AComposite: ArrayOfLib3MFCompositeConstituent): Cardinal; + var + PtrComposite: PLib3MFCompositeConstituent; + LenComposite: QWord; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_AddBeamFunc(FHandle, @ABeamInfo, Result)); + LenComposite := Length(AComposite); + if LenComposite > $FFFFFFFF then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); + if LenComposite > 0 then + PtrComposite := @AComposite[0] + else + PtrComposite := nil; + + FWrapper.CheckError(Self, FWrapper.Lib3MFCompositeMaterials_AddCompositeFunc(FHandle, QWord(LenComposite), PtrComposite, Result)); end; - procedure TLib3MFBeamLattice.SetBeam(const AIndex: Cardinal; const ABeamInfo: TLib3MFBeam); + procedure TLib3MFCompositeMaterials.RemoveComposite(const APropertyID: Cardinal); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_SetBeamFunc(FHandle, AIndex, @ABeamInfo)); + FWrapper.CheckError(Self, FWrapper.Lib3MFCompositeMaterials_RemoveCompositeFunc(FHandle, APropertyID)); end; - procedure TLib3MFBeamLattice.SetBeams(const ABeamInfo: ArrayOfLib3MFBeam); + procedure TLib3MFCompositeMaterials.GetComposite(const APropertyID: Cardinal; out AComposite: ArrayOfLib3MFCompositeConstituent); var - PtrBeamInfo: PLib3MFBeam; - LenBeamInfo: QWord; + countNeededComposite: QWord; + countWrittenComposite: QWord; begin - LenBeamInfo := Length(ABeamInfo); - if LenBeamInfo > $FFFFFFFF then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); - if LenBeamInfo > 0 then - PtrBeamInfo := @ABeamInfo[0] - else - PtrBeamInfo := nil; - - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_SetBeamsFunc(FHandle, QWord(LenBeamInfo), PtrBeamInfo)); + countNeededComposite:= 0; + countWrittenComposite:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFCompositeMaterials_GetCompositeFunc(FHandle, APropertyID, 0, countNeededComposite, nil)); + SetLength(AComposite, countNeededComposite); + FWrapper.CheckError(Self, FWrapper.Lib3MFCompositeMaterials_GetCompositeFunc(FHandle, APropertyID, countNeededComposite, countWrittenComposite, @AComposite[0])); end; - procedure TLib3MFBeamLattice.GetBeams(out ABeamInfo: ArrayOfLib3MFBeam); - var - countNeededBeamInfo: QWord; - countWrittenBeamInfo: QWord; +(************************************************************************************************************************* + Class implementation for MultiPropertyGroup +**************************************************************************************************************************) + + constructor TLib3MFMultiPropertyGroup.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin - countNeededBeamInfo:= 0; - countWrittenBeamInfo:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetBeamsFunc(FHandle, 0, countNeededBeamInfo, nil)); - SetLength(ABeamInfo, countNeededBeamInfo); - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetBeamsFunc(FHandle, countNeededBeamInfo, countWrittenBeamInfo, @ABeamInfo[0])); + inherited Create(AWrapper, AHandle); end; - function TLib3MFBeamLattice.GetBallCount(): Cardinal; + destructor TLib3MFMultiPropertyGroup.Destroy; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetBallCountFunc(FHandle, Result)); + inherited; end; - function TLib3MFBeamLattice.GetBall(const AIndex: Cardinal): TLib3MFBall; + function TLib3MFMultiPropertyGroup.GetCount(): Cardinal; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetBallFunc(FHandle, AIndex, @Result)); + FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroup_GetCountFunc(FHandle, Result)); end; - function TLib3MFBeamLattice.AddBall(const ABallInfo: TLib3MFBall): Cardinal; + procedure TLib3MFMultiPropertyGroup.GetAllPropertyIDs(out APropertyIDs: TCardinalDynArray); + var + countNeededPropertyIDs: QWord; + countWrittenPropertyIDs: QWord; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_AddBallFunc(FHandle, @ABallInfo, Result)); + countNeededPropertyIDs:= 0; + countWrittenPropertyIDs:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroup_GetAllPropertyIDsFunc(FHandle, 0, countNeededPropertyIDs, nil)); + SetLength(APropertyIDs, countNeededPropertyIDs); + FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroup_GetAllPropertyIDsFunc(FHandle, countNeededPropertyIDs, countWrittenPropertyIDs, @APropertyIDs[0])); end; - procedure TLib3MFBeamLattice.SetBall(const AIndex: Cardinal; const ABallInfo: TLib3MFBall); + function TLib3MFMultiPropertyGroup.AddMultiProperty(const APropertyIDs: TCardinalDynArray): Cardinal; + var + PtrPropertyIDs: PCardinal; + LenPropertyIDs: QWord; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_SetBallFunc(FHandle, AIndex, @ABallInfo)); + LenPropertyIDs := Length(APropertyIDs); + if LenPropertyIDs > $FFFFFFFF then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); + if LenPropertyIDs > 0 then + PtrPropertyIDs := @APropertyIDs[0] + else + PtrPropertyIDs := nil; + + FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroup_AddMultiPropertyFunc(FHandle, QWord(LenPropertyIDs), PtrPropertyIDs, Result)); end; - procedure TLib3MFBeamLattice.SetBalls(const ABallInfo: ArrayOfLib3MFBall); + procedure TLib3MFMultiPropertyGroup.SetMultiProperty(const APropertyID: Cardinal; const APropertyIDs: TCardinalDynArray); var - PtrBallInfo: PLib3MFBall; - LenBallInfo: QWord; + PtrPropertyIDs: PCardinal; + LenPropertyIDs: QWord; begin - LenBallInfo := Length(ABallInfo); - if LenBallInfo > $FFFFFFFF then + LenPropertyIDs := Length(APropertyIDs); + if LenPropertyIDs > $FFFFFFFF then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); - if LenBallInfo > 0 then - PtrBallInfo := @ABallInfo[0] + if LenPropertyIDs > 0 then + PtrPropertyIDs := @APropertyIDs[0] else - PtrBallInfo := nil; + PtrPropertyIDs := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_SetBallsFunc(FHandle, QWord(LenBallInfo), PtrBallInfo)); + FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroup_SetMultiPropertyFunc(FHandle, APropertyID, QWord(LenPropertyIDs), PtrPropertyIDs)); end; - procedure TLib3MFBeamLattice.GetBalls(out ABallInfo: ArrayOfLib3MFBall); + procedure TLib3MFMultiPropertyGroup.GetMultiProperty(const APropertyID: Cardinal; out APropertyIDs: TCardinalDynArray); var - countNeededBallInfo: QWord; - countWrittenBallInfo: QWord; + countNeededPropertyIDs: QWord; + countWrittenPropertyIDs: QWord; begin - countNeededBallInfo:= 0; - countWrittenBallInfo:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetBallsFunc(FHandle, 0, countNeededBallInfo, nil)); - SetLength(ABallInfo, countNeededBallInfo); - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetBallsFunc(FHandle, countNeededBallInfo, countWrittenBallInfo, @ABallInfo[0])); + countNeededPropertyIDs:= 0; + countWrittenPropertyIDs:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroup_GetMultiPropertyFunc(FHandle, APropertyID, 0, countNeededPropertyIDs, nil)); + SetLength(APropertyIDs, countNeededPropertyIDs); + FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroup_GetMultiPropertyFunc(FHandle, APropertyID, countNeededPropertyIDs, countWrittenPropertyIDs, @APropertyIDs[0])); end; - function TLib3MFBeamLattice.GetBeamSetCount(): Cardinal; + procedure TLib3MFMultiPropertyGroup.RemoveMultiProperty(const APropertyID: Cardinal); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetBeamSetCountFunc(FHandle, Result)); + FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroup_RemoveMultiPropertyFunc(FHandle, APropertyID)); end; - function TLib3MFBeamLattice.AddBeamSet(): TLib3MFBeamSet; - var - HBeamSet: TLib3MFHandle; + function TLib3MFMultiPropertyGroup.GetLayerCount(): Cardinal; begin - Result := nil; - HBeamSet := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_AddBeamSetFunc(FHandle, HBeamSet)); - if Assigned(HBeamSet) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HBeamSet); + FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroup_GetLayerCountFunc(FHandle, Result)); end; - function TLib3MFBeamLattice.GetBeamSet(const AIndex: Cardinal): TLib3MFBeamSet; - var - HBeamSet: TLib3MFHandle; + function TLib3MFMultiPropertyGroup.AddLayer(const ATheLayer: TLib3MFMultiPropertyLayer): Cardinal; begin - Result := nil; - HBeamSet := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamLattice_GetBeamSetFunc(FHandle, AIndex, HBeamSet)); - if Assigned(HBeamSet) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HBeamSet); + FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroup_AddLayerFunc(FHandle, @ATheLayer, Result)); + end; + + function TLib3MFMultiPropertyGroup.GetLayer(const ALayerIndex: Cardinal): TLib3MFMultiPropertyLayer; + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroup_GetLayerFunc(FHandle, ALayerIndex, @Result)); + end; + + procedure TLib3MFMultiPropertyGroup.RemoveLayer(const ALayerIndex: Cardinal); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroup_RemoveLayerFunc(FHandle, ALayerIndex)); end; (************************************************************************************************************************* - Class implementation for Component + Class implementation for Attachment **************************************************************************************************************************) - constructor TLib3MFComponent.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + constructor TLib3MFAttachment.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin inherited Create(AWrapper, AHandle); end; - destructor TLib3MFComponent.Destroy; + destructor TLib3MFAttachment.Destroy; begin inherited; end; - function TLib3MFComponent.GetObjectResource(): TLib3MFObject; + function TLib3MFAttachment.GetPath(): String; var - HObjectResource: TLib3MFHandle; + bytesNeededPath: Cardinal; + bytesWrittenPath: Cardinal; + bufferPath: array of Char; begin - Result := nil; - HObjectResource := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFComponent_GetObjectResourceFunc(FHandle, HObjectResource)); - if Assigned(HObjectResource) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HObjectResource); + bytesNeededPath:= 0; + bytesWrittenPath:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_GetPathFunc(FHandle, 0, bytesNeededPath, nil)); + SetLength(bufferPath, bytesNeededPath); + FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_GetPathFunc(FHandle, bytesNeededPath, bytesWrittenPath, @bufferPath[0])); + Result := StrPas(@bufferPath[0]); end; - function TLib3MFComponent.GetObjectResourceID(): Cardinal; + procedure TLib3MFAttachment.SetPath(const APath: String); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFComponent_GetObjectResourceIDFunc(FHandle, Result)); + FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_SetPathFunc(FHandle, PAnsiChar(APath))); end; - function TLib3MFComponent.GetUUID(out AHasUUID: Boolean): String; + function TLib3MFAttachment.PackagePart(): TLib3MFPackagePart; var - ResultHasUUID: Byte; - bytesNeededUUID: Cardinal; - bytesWrittenUUID: Cardinal; - bufferUUID: array of Char; - begin - ResultHasUUID := 0; - bytesNeededUUID:= 0; - bytesWrittenUUID:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFComponent_GetUUIDFunc(FHandle, ResultHasUUID, 0, bytesNeededUUID, nil)); - SetLength(bufferUUID, bytesNeededUUID); - FWrapper.CheckError(Self, FWrapper.Lib3MFComponent_GetUUIDFunc(FHandle, ResultHasUUID, bytesNeededUUID, bytesWrittenUUID, @bufferUUID[0])); - AHasUUID := ResultHasUUID <> 0; - Result := StrPas(@bufferUUID[0]); - end; - - procedure TLib3MFComponent.SetUUID(const AUUID: String); + HPackagePart: TLib3MFHandle; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFComponent_SetUUIDFunc(FHandle, PAnsiChar(AUUID))); + Result := nil; + HPackagePart := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_PackagePartFunc(FHandle, HPackagePart)); + if Assigned(HPackagePart) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HPackagePart); end; - function TLib3MFComponent.HasTransform(): Boolean; + function TLib3MFAttachment.GetRelationShipType(): String; var - ResultHasTransform: Byte; + bytesNeededPath: Cardinal; + bytesWrittenPath: Cardinal; + bufferPath: array of Char; begin - ResultHasTransform := 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFComponent_HasTransformFunc(FHandle, ResultHasTransform)); - Result := (ResultHasTransform <> 0); + bytesNeededPath:= 0; + bytesWrittenPath:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_GetRelationShipTypeFunc(FHandle, 0, bytesNeededPath, nil)); + SetLength(bufferPath, bytesNeededPath); + FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_GetRelationShipTypeFunc(FHandle, bytesNeededPath, bytesWrittenPath, @bufferPath[0])); + Result := StrPas(@bufferPath[0]); end; - function TLib3MFComponent.GetTransform(): TLib3MFTransform; + procedure TLib3MFAttachment.SetRelationShipType(const APath: String); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFComponent_GetTransformFunc(FHandle, @Result)); + FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_SetRelationShipTypeFunc(FHandle, PAnsiChar(APath))); end; - procedure TLib3MFComponent.SetTransform(const ATransform: TLib3MFTransform); + procedure TLib3MFAttachment.WriteToFile(const AFileName: String); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFComponent_SetTransformFunc(FHandle, @ATransform)); + FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_WriteToFileFunc(FHandle, PAnsiChar(AFileName))); end; -(************************************************************************************************************************* - Class implementation for ComponentsObject -**************************************************************************************************************************) - - constructor TLib3MFComponentsObject.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + procedure TLib3MFAttachment.ReadFromFile(const AFileName: String); begin - inherited Create(AWrapper, AHandle); + FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_ReadFromFileFunc(FHandle, PAnsiChar(AFileName))); end; - destructor TLib3MFComponentsObject.Destroy; + procedure TLib3MFAttachment.ReadFromCallback(const ATheReadCallback: PLib3MF_ReadCallback; const AStreamSize: QWord; const ATheSeekCallback: PLib3MF_SeekCallback; const AUserData: Pointer); begin - inherited; + if not Assigned(ATheReadCallback) then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ATheReadCallback is a nil value.'); + if not Assigned(ATheSeekCallback) then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ATheSeekCallback is a nil value.'); + FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_ReadFromCallbackFunc(FHandle, ATheReadCallback, AStreamSize, ATheSeekCallback, AUserData)); end; - function TLib3MFComponentsObject.AddComponent(const AObjectResource: TLib3MFObject; const ATransform: TLib3MFTransform): TLib3MFComponent; - var - AObjectResourceHandle: TLib3MFHandle; - HComponentInstance: TLib3MFHandle; + function TLib3MFAttachment.GetStreamSize(): QWord; begin - if Assigned(AObjectResource) then - AObjectResourceHandle := AObjectResource.TheHandle - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'AObjectResource is a nil value.'); - Result := nil; - HComponentInstance := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFComponentsObject_AddComponentFunc(FHandle, AObjectResourceHandle, @ATransform, HComponentInstance)); - if Assigned(HComponentInstance) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HComponentInstance); + FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_GetStreamSizeFunc(FHandle, Result)); end; - function TLib3MFComponentsObject.GetComponent(const AIndex: Cardinal): TLib3MFComponent; + procedure TLib3MFAttachment.WriteToBuffer(out ABuffer: TByteDynArray); var - HComponentInstance: TLib3MFHandle; + countNeededBuffer: QWord; + countWrittenBuffer: QWord; begin - Result := nil; - HComponentInstance := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFComponentsObject_GetComponentFunc(FHandle, AIndex, HComponentInstance)); - if Assigned(HComponentInstance) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HComponentInstance); + countNeededBuffer:= 0; + countWrittenBuffer:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_WriteToBufferFunc(FHandle, 0, countNeededBuffer, nil)); + SetLength(ABuffer, countNeededBuffer); + FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_WriteToBufferFunc(FHandle, countNeededBuffer, countWrittenBuffer, @ABuffer[0])); end; - function TLib3MFComponentsObject.GetComponentCount(): Cardinal; + procedure TLib3MFAttachment.ReadFromBuffer(const ABuffer: TByteDynArray); + var + PtrBuffer: PByte; + LenBuffer: QWord; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFComponentsObject_GetComponentCountFunc(FHandle, Result)); + LenBuffer := Length(ABuffer); + if LenBuffer > $FFFFFFFF then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); + if LenBuffer > 0 then + PtrBuffer := @ABuffer[0] + else + PtrBuffer := nil; + + FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_ReadFromBufferFunc(FHandle, QWord(LenBuffer), PtrBuffer)); end; (************************************************************************************************************************* - Class implementation for BeamSet + Class implementation for Texture2D **************************************************************************************************************************) - constructor TLib3MFBeamSet.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + constructor TLib3MFTexture2D.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin inherited Create(AWrapper, AHandle); end; - destructor TLib3MFBeamSet.Destroy; + destructor TLib3MFTexture2D.Destroy; begin inherited; end; - procedure TLib3MFBeamSet.SetName(const AName: String); - begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_SetNameFunc(FHandle, PAnsiChar(AName))); - end; - - function TLib3MFBeamSet.GetName(): String; + function TLib3MFTexture2D.GetAttachment(): TLib3MFAttachment; var - bytesNeededName: Cardinal; - bytesWrittenName: Cardinal; - bufferName: array of Char; - begin - bytesNeededName:= 0; - bytesWrittenName:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_GetNameFunc(FHandle, 0, bytesNeededName, nil)); - SetLength(bufferName, bytesNeededName); - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_GetNameFunc(FHandle, bytesNeededName, bytesWrittenName, @bufferName[0])); - Result := StrPas(@bufferName[0]); - end; - - procedure TLib3MFBeamSet.SetIdentifier(const AIdentifier: String); + HAttachment: TLib3MFHandle; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_SetIdentifierFunc(FHandle, PAnsiChar(AIdentifier))); + Result := nil; + HAttachment := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2D_GetAttachmentFunc(FHandle, HAttachment)); + if Assigned(HAttachment) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HAttachment); end; - function TLib3MFBeamSet.GetIdentifier(): String; + procedure TLib3MFTexture2D.SetAttachment(const AAttachment: TLib3MFAttachment); var - bytesNeededIdentifier: Cardinal; - bytesWrittenIdentifier: Cardinal; - bufferIdentifier: array of Char; + AAttachmentHandle: TLib3MFHandle; begin - bytesNeededIdentifier:= 0; - bytesWrittenIdentifier:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_GetIdentifierFunc(FHandle, 0, bytesNeededIdentifier, nil)); - SetLength(bufferIdentifier, bytesNeededIdentifier); - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_GetIdentifierFunc(FHandle, bytesNeededIdentifier, bytesWrittenIdentifier, @bufferIdentifier[0])); - Result := StrPas(@bufferIdentifier[0]); + if Assigned(AAttachment) then + AAttachmentHandle := AAttachment.TheHandle + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'AAttachment is a nil value.'); + FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2D_SetAttachmentFunc(FHandle, AAttachmentHandle)); end; - function TLib3MFBeamSet.GetReferenceCount(): Cardinal; + function TLib3MFTexture2D.GetContentType(): TLib3MFTextureType; + var + ResultContentType: Integer; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_GetReferenceCountFunc(FHandle, Result)); + ResultContentType := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2D_GetContentTypeFunc(FHandle, ResultContentType)); + Result := convertConstToTextureType(ResultContentType); end; - procedure TLib3MFBeamSet.SetReferences(const AReferences: TCardinalDynArray); - var - PtrReferences: PCardinal; - LenReferences: QWord; + procedure TLib3MFTexture2D.SetContentType(const AContentType: TLib3MFTextureType); begin - LenReferences := Length(AReferences); - if LenReferences > $FFFFFFFF then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); - if LenReferences > 0 then - PtrReferences := @AReferences[0] - else - PtrReferences := nil; - - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_SetReferencesFunc(FHandle, QWord(LenReferences), PtrReferences)); + FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2D_SetContentTypeFunc(FHandle, convertTextureTypeToConst(AContentType))); end; - procedure TLib3MFBeamSet.GetReferences(out AReferences: TCardinalDynArray); + procedure TLib3MFTexture2D.GetTileStyleUV(out ATileStyleU: TLib3MFTextureTileStyle; out ATileStyleV: TLib3MFTextureTileStyle); var - countNeededReferences: QWord; - countWrittenReferences: QWord; + ResultTileStyleU: Integer; + ResultTileStyleV: Integer; begin - countNeededReferences:= 0; - countWrittenReferences:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_GetReferencesFunc(FHandle, 0, countNeededReferences, nil)); - SetLength(AReferences, countNeededReferences); - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_GetReferencesFunc(FHandle, countNeededReferences, countWrittenReferences, @AReferences[0])); + ResultTileStyleU := 0; + ResultTileStyleV := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2D_GetTileStyleUVFunc(FHandle, ResultTileStyleU, ResultTileStyleV)); + ATileStyleU := convertConstToTextureTileStyle(ResultTileStyleU); + ATileStyleV := convertConstToTextureTileStyle(ResultTileStyleV); end; - function TLib3MFBeamSet.GetBallReferenceCount(): Cardinal; + procedure TLib3MFTexture2D.SetTileStyleUV(const ATileStyleU: TLib3MFTextureTileStyle; const ATileStyleV: TLib3MFTextureTileStyle); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_GetBallReferenceCountFunc(FHandle, Result)); + FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2D_SetTileStyleUVFunc(FHandle, convertTextureTileStyleToConst(ATileStyleU), convertTextureTileStyleToConst(ATileStyleV))); end; - procedure TLib3MFBeamSet.SetBallReferences(const ABallReferences: TCardinalDynArray); + function TLib3MFTexture2D.GetFilter(): TLib3MFTextureFilter; var - PtrBallReferences: PCardinal; - LenBallReferences: QWord; + ResultFilter: Integer; begin - LenBallReferences := Length(ABallReferences); - if LenBallReferences > $FFFFFFFF then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); - if LenBallReferences > 0 then - PtrBallReferences := @ABallReferences[0] - else - PtrBallReferences := nil; - - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_SetBallReferencesFunc(FHandle, QWord(LenBallReferences), PtrBallReferences)); + ResultFilter := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2D_GetFilterFunc(FHandle, ResultFilter)); + Result := convertConstToTextureFilter(ResultFilter); end; - procedure TLib3MFBeamSet.GetBallReferences(out ABallReferences: TCardinalDynArray); - var - countNeededBallReferences: QWord; - countWrittenBallReferences: QWord; + procedure TLib3MFTexture2D.SetFilter(const AFilter: TLib3MFTextureFilter); begin - countNeededBallReferences:= 0; - countWrittenBallReferences:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_GetBallReferencesFunc(FHandle, 0, countNeededBallReferences, nil)); - SetLength(ABallReferences, countNeededBallReferences); - FWrapper.CheckError(Self, FWrapper.Lib3MFBeamSet_GetBallReferencesFunc(FHandle, countNeededBallReferences, countWrittenBallReferences, @ABallReferences[0])); + FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2D_SetFilterFunc(FHandle, convertTextureFilterToConst(AFilter))); end; (************************************************************************************************************************* - Class implementation for BaseMaterialGroup + Class implementation for BuildItem **************************************************************************************************************************) - constructor TLib3MFBaseMaterialGroup.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + constructor TLib3MFBuildItem.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin inherited Create(AWrapper, AHandle); end; - destructor TLib3MFBaseMaterialGroup.Destroy; + destructor TLib3MFBuildItem.Destroy; begin inherited; end; - function TLib3MFBaseMaterialGroup.GetCount(): Cardinal; + function TLib3MFBuildItem.GetObjectResource(): TLib3MFObject; + var + HObjectResource: TLib3MFHandle; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBaseMaterialGroup_GetCountFunc(FHandle, Result)); + Result := nil; + HObjectResource := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_GetObjectResourceFunc(FHandle, HObjectResource)); + if Assigned(HObjectResource) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HObjectResource); end; - procedure TLib3MFBaseMaterialGroup.GetAllPropertyIDs(out APropertyIDs: TCardinalDynArray); + function TLib3MFBuildItem.GetUUID(out AHasUUID: Boolean): String; var - countNeededPropertyIDs: QWord; - countWrittenPropertyIDs: QWord; + ResultHasUUID: Byte; + bytesNeededUUID: Cardinal; + bytesWrittenUUID: Cardinal; + bufferUUID: array of Char; begin - countNeededPropertyIDs:= 0; - countWrittenPropertyIDs:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFBaseMaterialGroup_GetAllPropertyIDsFunc(FHandle, 0, countNeededPropertyIDs, nil)); - SetLength(APropertyIDs, countNeededPropertyIDs); - FWrapper.CheckError(Self, FWrapper.Lib3MFBaseMaterialGroup_GetAllPropertyIDsFunc(FHandle, countNeededPropertyIDs, countWrittenPropertyIDs, @APropertyIDs[0])); + ResultHasUUID := 0; + bytesNeededUUID:= 0; + bytesWrittenUUID:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_GetUUIDFunc(FHandle, ResultHasUUID, 0, bytesNeededUUID, nil)); + SetLength(bufferUUID, bytesNeededUUID); + FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_GetUUIDFunc(FHandle, ResultHasUUID, bytesNeededUUID, bytesWrittenUUID, @bufferUUID[0])); + AHasUUID := ResultHasUUID <> 0; + Result := StrPas(@bufferUUID[0]); end; - function TLib3MFBaseMaterialGroup.AddMaterial(const AName: String; const ADisplayColor: TLib3MFColor): Cardinal; + procedure TLib3MFBuildItem.SetUUID(const AUUID: String); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBaseMaterialGroup_AddMaterialFunc(FHandle, PAnsiChar(AName), @ADisplayColor, Result)); + FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_SetUUIDFunc(FHandle, PAnsiChar(AUUID))); end; - procedure TLib3MFBaseMaterialGroup.RemoveMaterial(const APropertyID: Cardinal); + function TLib3MFBuildItem.GetObjectResourceID(): Cardinal; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBaseMaterialGroup_RemoveMaterialFunc(FHandle, APropertyID)); + FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_GetObjectResourceIDFunc(FHandle, Result)); end; - function TLib3MFBaseMaterialGroup.GetName(const APropertyID: Cardinal): String; + function TLib3MFBuildItem.HasObjectTransform(): Boolean; var - bytesNeededName: Cardinal; - bytesWrittenName: Cardinal; - bufferName: array of Char; + ResultHasTransform: Byte; begin - bytesNeededName:= 0; - bytesWrittenName:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFBaseMaterialGroup_GetNameFunc(FHandle, APropertyID, 0, bytesNeededName, nil)); - SetLength(bufferName, bytesNeededName); - FWrapper.CheckError(Self, FWrapper.Lib3MFBaseMaterialGroup_GetNameFunc(FHandle, APropertyID, bytesNeededName, bytesWrittenName, @bufferName[0])); - Result := StrPas(@bufferName[0]); + ResultHasTransform := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_HasObjectTransformFunc(FHandle, ResultHasTransform)); + Result := (ResultHasTransform <> 0); end; - procedure TLib3MFBaseMaterialGroup.SetName(const APropertyID: Cardinal; const AName: String); + function TLib3MFBuildItem.GetObjectTransform(): TLib3MFTransform; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBaseMaterialGroup_SetNameFunc(FHandle, APropertyID, PAnsiChar(AName))); + FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_GetObjectTransformFunc(FHandle, @Result)); end; - procedure TLib3MFBaseMaterialGroup.SetDisplayColor(const APropertyID: Cardinal; const ATheColor: TLib3MFColor); + procedure TLib3MFBuildItem.SetObjectTransform(const ATransform: TLib3MFTransform); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBaseMaterialGroup_SetDisplayColorFunc(FHandle, APropertyID, @ATheColor)); + FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_SetObjectTransformFunc(FHandle, @ATransform)); end; - function TLib3MFBaseMaterialGroup.GetDisplayColor(const APropertyID: Cardinal): TLib3MFColor; + function TLib3MFBuildItem.GetPartNumber(): String; + var + bytesNeededPartNumber: Cardinal; + bytesWrittenPartNumber: Cardinal; + bufferPartNumber: array of Char; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBaseMaterialGroup_GetDisplayColorFunc(FHandle, APropertyID, @Result)); + bytesNeededPartNumber:= 0; + bytesWrittenPartNumber:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_GetPartNumberFunc(FHandle, 0, bytesNeededPartNumber, nil)); + SetLength(bufferPartNumber, bytesNeededPartNumber); + FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_GetPartNumberFunc(FHandle, bytesNeededPartNumber, bytesWrittenPartNumber, @bufferPartNumber[0])); + Result := StrPas(@bufferPartNumber[0]); end; -(************************************************************************************************************************* - Class implementation for ColorGroup -**************************************************************************************************************************) + procedure TLib3MFBuildItem.SetPartNumber(const ASetPartnumber: String); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_SetPartNumberFunc(FHandle, PAnsiChar(ASetPartnumber))); + end; - constructor TLib3MFColorGroup.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + function TLib3MFBuildItem.GetMetaDataGroup(): TLib3MFMetaDataGroup; + var + HMetaDataGroup: TLib3MFHandle; begin - inherited Create(AWrapper, AHandle); + Result := nil; + HMetaDataGroup := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_GetMetaDataGroupFunc(FHandle, HMetaDataGroup)); + if Assigned(HMetaDataGroup) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HMetaDataGroup); end; - destructor TLib3MFColorGroup.Destroy; + function TLib3MFBuildItem.GetOutbox(): TLib3MFBox; + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_GetOutboxFunc(FHandle, @Result)); + end; + +(************************************************************************************************************************* + Class implementation for BuildItemIterator +**************************************************************************************************************************) + + constructor TLib3MFBuildItemIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin - inherited; + inherited Create(AWrapper, AHandle); end; - function TLib3MFColorGroup.GetCount(): Cardinal; + destructor TLib3MFBuildItemIterator.Destroy; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFColorGroup_GetCountFunc(FHandle, Result)); + inherited; end; - procedure TLib3MFColorGroup.GetAllPropertyIDs(out APropertyIDs: TCardinalDynArray); + function TLib3MFBuildItemIterator.MoveNext(): Boolean; var - countNeededPropertyIDs: QWord; - countWrittenPropertyIDs: QWord; + ResultHasNext: Byte; begin - countNeededPropertyIDs:= 0; - countWrittenPropertyIDs:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFColorGroup_GetAllPropertyIDsFunc(FHandle, 0, countNeededPropertyIDs, nil)); - SetLength(APropertyIDs, countNeededPropertyIDs); - FWrapper.CheckError(Self, FWrapper.Lib3MFColorGroup_GetAllPropertyIDsFunc(FHandle, countNeededPropertyIDs, countWrittenPropertyIDs, @APropertyIDs[0])); + ResultHasNext := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItemIterator_MoveNextFunc(FHandle, ResultHasNext)); + Result := (ResultHasNext <> 0); end; - function TLib3MFColorGroup.AddColor(const ATheColor: TLib3MFColor): Cardinal; + function TLib3MFBuildItemIterator.MovePrevious(): Boolean; + var + ResultHasPrevious: Byte; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFColorGroup_AddColorFunc(FHandle, @ATheColor, Result)); + ResultHasPrevious := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItemIterator_MovePreviousFunc(FHandle, ResultHasPrevious)); + Result := (ResultHasPrevious <> 0); end; - procedure TLib3MFColorGroup.RemoveColor(const APropertyID: Cardinal); + function TLib3MFBuildItemIterator.GetCurrent(): TLib3MFBuildItem; + var + HBuildItem: TLib3MFHandle; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFColorGroup_RemoveColorFunc(FHandle, APropertyID)); + Result := nil; + HBuildItem := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItemIterator_GetCurrentFunc(FHandle, HBuildItem)); + if Assigned(HBuildItem) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HBuildItem); end; - procedure TLib3MFColorGroup.SetColor(const APropertyID: Cardinal; const ATheColor: TLib3MFColor); + function TLib3MFBuildItemIterator.Clone(): TLib3MFBuildItemIterator; + var + HOutBuildItemIterator: TLib3MFHandle; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFColorGroup_SetColorFunc(FHandle, APropertyID, @ATheColor)); + Result := nil; + HOutBuildItemIterator := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItemIterator_CloneFunc(FHandle, HOutBuildItemIterator)); + if Assigned(HOutBuildItemIterator) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HOutBuildItemIterator); end; - function TLib3MFColorGroup.GetColor(const APropertyID: Cardinal): TLib3MFColor; + function TLib3MFBuildItemIterator.Count(): QWord; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFColorGroup_GetColorFunc(FHandle, APropertyID, @Result)); + FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItemIterator_CountFunc(FHandle, Result)); end; (************************************************************************************************************************* - Class implementation for Texture2DGroup + Class implementation for Slice **************************************************************************************************************************) - constructor TLib3MFTexture2DGroup.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + constructor TLib3MFSlice.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin inherited Create(AWrapper, AHandle); end; - destructor TLib3MFTexture2DGroup.Destroy; + destructor TLib3MFSlice.Destroy; begin inherited; end; - function TLib3MFTexture2DGroup.GetCount(): Cardinal; + procedure TLib3MFSlice.SetVertices(const AVertices: ArrayOfLib3MFPosition2D); + var + PtrVertices: PLib3MFPosition2D; + LenVertices: QWord; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2DGroup_GetCountFunc(FHandle, Result)); + LenVertices := Length(AVertices); + if LenVertices > $FFFFFFFF then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); + if LenVertices > 0 then + PtrVertices := @AVertices[0] + else + PtrVertices := nil; + + FWrapper.CheckError(Self, FWrapper.Lib3MFSlice_SetVerticesFunc(FHandle, QWord(LenVertices), PtrVertices)); end; - procedure TLib3MFTexture2DGroup.GetAllPropertyIDs(out APropertyIDs: TCardinalDynArray); + procedure TLib3MFSlice.GetVertices(out AVertices: ArrayOfLib3MFPosition2D); var - countNeededPropertyIDs: QWord; - countWrittenPropertyIDs: QWord; + countNeededVertices: QWord; + countWrittenVertices: QWord; begin - countNeededPropertyIDs:= 0; - countWrittenPropertyIDs:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2DGroup_GetAllPropertyIDsFunc(FHandle, 0, countNeededPropertyIDs, nil)); - SetLength(APropertyIDs, countNeededPropertyIDs); - FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2DGroup_GetAllPropertyIDsFunc(FHandle, countNeededPropertyIDs, countWrittenPropertyIDs, @APropertyIDs[0])); + countNeededVertices:= 0; + countWrittenVertices:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFSlice_GetVerticesFunc(FHandle, 0, countNeededVertices, nil)); + SetLength(AVertices, countNeededVertices); + FWrapper.CheckError(Self, FWrapper.Lib3MFSlice_GetVerticesFunc(FHandle, countNeededVertices, countWrittenVertices, @AVertices[0])); end; - function TLib3MFTexture2DGroup.AddTex2Coord(const AUVCoordinate: TLib3MFTex2Coord): Cardinal; + function TLib3MFSlice.GetVertexCount(): QWord; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2DGroup_AddTex2CoordFunc(FHandle, @AUVCoordinate, Result)); + FWrapper.CheckError(Self, FWrapper.Lib3MFSlice_GetVertexCountFunc(FHandle, Result)); end; - function TLib3MFTexture2DGroup.GetTex2Coord(const APropertyID: Cardinal): TLib3MFTex2Coord; + function TLib3MFSlice.AddPolygon(const AIndices: TCardinalDynArray): QWord; + var + PtrIndices: PCardinal; + LenIndices: QWord; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2DGroup_GetTex2CoordFunc(FHandle, APropertyID, @Result)); + LenIndices := Length(AIndices); + if LenIndices > $FFFFFFFF then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); + if LenIndices > 0 then + PtrIndices := @AIndices[0] + else + PtrIndices := nil; + + FWrapper.CheckError(Self, FWrapper.Lib3MFSlice_AddPolygonFunc(FHandle, QWord(LenIndices), PtrIndices, Result)); end; - procedure TLib3MFTexture2DGroup.RemoveTex2Coord(const APropertyID: Cardinal); + function TLib3MFSlice.GetPolygonCount(): QWord; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2DGroup_RemoveTex2CoordFunc(FHandle, APropertyID)); + FWrapper.CheckError(Self, FWrapper.Lib3MFSlice_GetPolygonCountFunc(FHandle, Result)); end; - function TLib3MFTexture2DGroup.GetTexture2D(): TLib3MFTexture2D; + procedure TLib3MFSlice.SetPolygonIndices(const AIndex: QWord; const AIndices: TCardinalDynArray); var - HTexture2DInstance: TLib3MFHandle; + PtrIndices: PCardinal; + LenIndices: QWord; begin - Result := nil; - HTexture2DInstance := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2DGroup_GetTexture2DFunc(FHandle, HTexture2DInstance)); - if Assigned(HTexture2DInstance) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HTexture2DInstance); + LenIndices := Length(AIndices); + if LenIndices > $FFFFFFFF then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); + if LenIndices > 0 then + PtrIndices := @AIndices[0] + else + PtrIndices := nil; + + FWrapper.CheckError(Self, FWrapper.Lib3MFSlice_SetPolygonIndicesFunc(FHandle, AIndex, QWord(LenIndices), PtrIndices)); + end; + + procedure TLib3MFSlice.GetPolygonIndices(const AIndex: QWord; out AIndices: TCardinalDynArray); + var + countNeededIndices: QWord; + countWrittenIndices: QWord; + begin + countNeededIndices:= 0; + countWrittenIndices:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFSlice_GetPolygonIndicesFunc(FHandle, AIndex, 0, countNeededIndices, nil)); + SetLength(AIndices, countNeededIndices); + FWrapper.CheckError(Self, FWrapper.Lib3MFSlice_GetPolygonIndicesFunc(FHandle, AIndex, countNeededIndices, countWrittenIndices, @AIndices[0])); + end; + + function TLib3MFSlice.GetPolygonIndexCount(const AIndex: QWord): QWord; + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFSlice_GetPolygonIndexCountFunc(FHandle, AIndex, Result)); + end; + + function TLib3MFSlice.GetZTop(): Double; + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFSlice_GetZTopFunc(FHandle, Result)); end; (************************************************************************************************************************* - Class implementation for CompositeMaterials + Class implementation for ToolpathProfile **************************************************************************************************************************) - constructor TLib3MFCompositeMaterials.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + constructor TLib3MFToolpathProfile.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin inherited Create(AWrapper, AHandle); end; - destructor TLib3MFCompositeMaterials.Destroy; + destructor TLib3MFToolpathProfile.Destroy; begin inherited; end; - function TLib3MFCompositeMaterials.GetCount(): Cardinal; + function TLib3MFToolpathProfile.GetUUID(): String; + var + bytesNeededUUID: Cardinal; + bytesWrittenUUID: Cardinal; + bufferUUID: array of Char; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFCompositeMaterials_GetCountFunc(FHandle, Result)); + bytesNeededUUID:= 0; + bytesWrittenUUID:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathProfile_GetUUIDFunc(FHandle, 0, bytesNeededUUID, nil)); + SetLength(bufferUUID, bytesNeededUUID); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathProfile_GetUUIDFunc(FHandle, bytesNeededUUID, bytesWrittenUUID, @bufferUUID[0])); + Result := StrPas(@bufferUUID[0]); end; - procedure TLib3MFCompositeMaterials.GetAllPropertyIDs(out APropertyIDs: TCardinalDynArray); + function TLib3MFToolpathProfile.GetName(): String; var - countNeededPropertyIDs: QWord; - countWrittenPropertyIDs: QWord; + bytesNeededName: Cardinal; + bytesWrittenName: Cardinal; + bufferName: array of Char; begin - countNeededPropertyIDs:= 0; - countWrittenPropertyIDs:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFCompositeMaterials_GetAllPropertyIDsFunc(FHandle, 0, countNeededPropertyIDs, nil)); - SetLength(APropertyIDs, countNeededPropertyIDs); - FWrapper.CheckError(Self, FWrapper.Lib3MFCompositeMaterials_GetAllPropertyIDsFunc(FHandle, countNeededPropertyIDs, countWrittenPropertyIDs, @APropertyIDs[0])); + bytesNeededName:= 0; + bytesWrittenName:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathProfile_GetNameFunc(FHandle, 0, bytesNeededName, nil)); + SetLength(bufferName, bytesNeededName); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathProfile_GetNameFunc(FHandle, bytesNeededName, bytesWrittenName, @bufferName[0])); + Result := StrPas(@bufferName[0]); end; - function TLib3MFCompositeMaterials.GetBaseMaterialGroup(): TLib3MFBaseMaterialGroup; - var - HBaseMaterialGroupInstance: TLib3MFHandle; + function TLib3MFToolpathProfile.GetParameterCount(): Cardinal; begin - Result := nil; - HBaseMaterialGroupInstance := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFCompositeMaterials_GetBaseMaterialGroupFunc(FHandle, HBaseMaterialGroupInstance)); - if Assigned(HBaseMaterialGroupInstance) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HBaseMaterialGroupInstance); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathProfile_GetParameterCountFunc(FHandle, Result)); end; - function TLib3MFCompositeMaterials.AddComposite(const AComposite: ArrayOfLib3MFCompositeConstituent): Cardinal; + function TLib3MFToolpathProfile.GetParameterName(const AIndex: Cardinal): String; var - PtrComposite: PLib3MFCompositeConstituent; - LenComposite: QWord; + bytesNeededName: Cardinal; + bytesWrittenName: Cardinal; + bufferName: array of Char; begin - LenComposite := Length(AComposite); - if LenComposite > $FFFFFFFF then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); - if LenComposite > 0 then - PtrComposite := @AComposite[0] - else - PtrComposite := nil; - - FWrapper.CheckError(Self, FWrapper.Lib3MFCompositeMaterials_AddCompositeFunc(FHandle, QWord(LenComposite), PtrComposite, Result)); + bytesNeededName:= 0; + bytesWrittenName:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathProfile_GetParameterNameFunc(FHandle, AIndex, 0, bytesNeededName, nil)); + SetLength(bufferName, bytesNeededName); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathProfile_GetParameterNameFunc(FHandle, AIndex, bytesNeededName, bytesWrittenName, @bufferName[0])); + Result := StrPas(@bufferName[0]); end; - procedure TLib3MFCompositeMaterials.RemoveComposite(const APropertyID: Cardinal); + function TLib3MFToolpathProfile.GetParameterNameSpace(const AIndex: Cardinal): String; + var + bytesNeededNameSpace: Cardinal; + bytesWrittenNameSpace: Cardinal; + bufferNameSpace: array of Char; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFCompositeMaterials_RemoveCompositeFunc(FHandle, APropertyID)); + bytesNeededNameSpace:= 0; + bytesWrittenNameSpace:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathProfile_GetParameterNameSpaceFunc(FHandle, AIndex, 0, bytesNeededNameSpace, nil)); + SetLength(bufferNameSpace, bytesNeededNameSpace); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathProfile_GetParameterNameSpaceFunc(FHandle, AIndex, bytesNeededNameSpace, bytesWrittenNameSpace, @bufferNameSpace[0])); + Result := StrPas(@bufferNameSpace[0]); end; - procedure TLib3MFCompositeMaterials.GetComposite(const APropertyID: Cardinal; out AComposite: ArrayOfLib3MFCompositeConstituent); + function TLib3MFToolpathProfile.HasParameterValue(const ANameSpaceName: String; const AValueName: String): Boolean; var - countNeededComposite: QWord; - countWrittenComposite: QWord; + ResultValueExists: Byte; begin - countNeededComposite:= 0; - countWrittenComposite:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFCompositeMaterials_GetCompositeFunc(FHandle, APropertyID, 0, countNeededComposite, nil)); - SetLength(AComposite, countNeededComposite); - FWrapper.CheckError(Self, FWrapper.Lib3MFCompositeMaterials_GetCompositeFunc(FHandle, APropertyID, countNeededComposite, countWrittenComposite, @AComposite[0])); + ResultValueExists := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathProfile_HasParameterValueFunc(FHandle, PAnsiChar(ANameSpaceName), PAnsiChar(AValueName), ResultValueExists)); + Result := (ResultValueExists <> 0); end; -(************************************************************************************************************************* - Class implementation for MultiPropertyGroup -**************************************************************************************************************************) + function TLib3MFToolpathProfile.GetParameterValue(const ANameSpaceName: String; const AValueName: String): String; + var + bytesNeededValue: Cardinal; + bytesWrittenValue: Cardinal; + bufferValue: array of Char; + begin + bytesNeededValue:= 0; + bytesWrittenValue:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathProfile_GetParameterValueFunc(FHandle, PAnsiChar(ANameSpaceName), PAnsiChar(AValueName), 0, bytesNeededValue, nil)); + SetLength(bufferValue, bytesNeededValue); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathProfile_GetParameterValueFunc(FHandle, PAnsiChar(ANameSpaceName), PAnsiChar(AValueName), bytesNeededValue, bytesWrittenValue, @bufferValue[0])); + Result := StrPas(@bufferValue[0]); + end; - constructor TLib3MFMultiPropertyGroup.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + function TLib3MFToolpathProfile.GetParameterValueDef(const ANameSpaceName: String; const AValueName: String; const ADefaultValue: String): String; + var + bytesNeededValue: Cardinal; + bytesWrittenValue: Cardinal; + bufferValue: array of Char; begin - inherited Create(AWrapper, AHandle); + bytesNeededValue:= 0; + bytesWrittenValue:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathProfile_GetParameterValueDefFunc(FHandle, PAnsiChar(ANameSpaceName), PAnsiChar(AValueName), PAnsiChar(ADefaultValue), 0, bytesNeededValue, nil)); + SetLength(bufferValue, bytesNeededValue); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathProfile_GetParameterValueDefFunc(FHandle, PAnsiChar(ANameSpaceName), PAnsiChar(AValueName), PAnsiChar(ADefaultValue), bytesNeededValue, bytesWrittenValue, @bufferValue[0])); + Result := StrPas(@bufferValue[0]); end; - destructor TLib3MFMultiPropertyGroup.Destroy; + function TLib3MFToolpathProfile.GetParameterDoubleValue(const ANameSpaceName: String; const AValueName: String): Double; begin - inherited; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathProfile_GetParameterDoubleValueFunc(FHandle, PAnsiChar(ANameSpaceName), PAnsiChar(AValueName), Result)); end; - function TLib3MFMultiPropertyGroup.GetCount(): Cardinal; + function TLib3MFToolpathProfile.GetParameterDoubleValueDef(const ANameSpaceName: String; const AValueName: String; const ADefaultValue: Double): Double; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroup_GetCountFunc(FHandle, Result)); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathProfile_GetParameterDoubleValueDefFunc(FHandle, PAnsiChar(ANameSpaceName), PAnsiChar(AValueName), ADefaultValue, Result)); end; - procedure TLib3MFMultiPropertyGroup.GetAllPropertyIDs(out APropertyIDs: TCardinalDynArray); - var - countNeededPropertyIDs: QWord; - countWrittenPropertyIDs: QWord; + function TLib3MFToolpathProfile.GetParameterIntegerValue(const ANameSpaceName: String; const AValueName: String): Int64; begin - countNeededPropertyIDs:= 0; - countWrittenPropertyIDs:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroup_GetAllPropertyIDsFunc(FHandle, 0, countNeededPropertyIDs, nil)); - SetLength(APropertyIDs, countNeededPropertyIDs); - FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroup_GetAllPropertyIDsFunc(FHandle, countNeededPropertyIDs, countWrittenPropertyIDs, @APropertyIDs[0])); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathProfile_GetParameterIntegerValueFunc(FHandle, PAnsiChar(ANameSpaceName), PAnsiChar(AValueName), Result)); end; - function TLib3MFMultiPropertyGroup.AddMultiProperty(const APropertyIDs: TCardinalDynArray): Cardinal; - var - PtrPropertyIDs: PCardinal; - LenPropertyIDs: QWord; + function TLib3MFToolpathProfile.GetParameterIntegerValueDef(const ANameSpaceName: String; const AValueName: String; const ADefaultValue: Int64): Int64; begin - LenPropertyIDs := Length(APropertyIDs); - if LenPropertyIDs > $FFFFFFFF then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); - if LenPropertyIDs > 0 then - PtrPropertyIDs := @APropertyIDs[0] - else - PtrPropertyIDs := nil; - - FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroup_AddMultiPropertyFunc(FHandle, QWord(LenPropertyIDs), PtrPropertyIDs, Result)); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathProfile_GetParameterIntegerValueDefFunc(FHandle, PAnsiChar(ANameSpaceName), PAnsiChar(AValueName), ADefaultValue, Result)); end; - procedure TLib3MFMultiPropertyGroup.SetMultiProperty(const APropertyID: Cardinal; const APropertyIDs: TCardinalDynArray); + function TLib3MFToolpathProfile.GetParameterBoolValue(const ANameSpaceName: String; const AValueName: String): Boolean; var - PtrPropertyIDs: PCardinal; - LenPropertyIDs: QWord; + ResultValue: Byte; begin - LenPropertyIDs := Length(APropertyIDs); - if LenPropertyIDs > $FFFFFFFF then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); - if LenPropertyIDs > 0 then - PtrPropertyIDs := @APropertyIDs[0] - else - PtrPropertyIDs := nil; - - FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroup_SetMultiPropertyFunc(FHandle, APropertyID, QWord(LenPropertyIDs), PtrPropertyIDs)); + ResultValue := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathProfile_GetParameterBoolValueFunc(FHandle, PAnsiChar(ANameSpaceName), PAnsiChar(AValueName), ResultValue)); + Result := (ResultValue <> 0); end; - procedure TLib3MFMultiPropertyGroup.GetMultiProperty(const APropertyID: Cardinal; out APropertyIDs: TCardinalDynArray); + function TLib3MFToolpathProfile.GetParameterBoolValueDef(const ANameSpaceName: String; const AValueName: String; const ADefaultValue: Boolean): Boolean; var - countNeededPropertyIDs: QWord; - countWrittenPropertyIDs: QWord; + ResultValue: Byte; begin - countNeededPropertyIDs:= 0; - countWrittenPropertyIDs:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroup_GetMultiPropertyFunc(FHandle, APropertyID, 0, countNeededPropertyIDs, nil)); - SetLength(APropertyIDs, countNeededPropertyIDs); - FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroup_GetMultiPropertyFunc(FHandle, APropertyID, countNeededPropertyIDs, countWrittenPropertyIDs, @APropertyIDs[0])); + ResultValue := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathProfile_GetParameterBoolValueDefFunc(FHandle, PAnsiChar(ANameSpaceName), PAnsiChar(AValueName), Ord(ADefaultValue), ResultValue)); + Result := (ResultValue <> 0); end; - procedure TLib3MFMultiPropertyGroup.RemoveMultiProperty(const APropertyID: Cardinal); + procedure TLib3MFToolpathProfile.SetName(const AName: String); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroup_RemoveMultiPropertyFunc(FHandle, APropertyID)); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathProfile_SetNameFunc(FHandle, PAnsiChar(AName))); end; - function TLib3MFMultiPropertyGroup.GetLayerCount(): Cardinal; + procedure TLib3MFToolpathProfile.SetParameterValue(const ANameSpaceName: String; const AValueName: String; const AValue: String); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroup_GetLayerCountFunc(FHandle, Result)); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathProfile_SetParameterValueFunc(FHandle, PAnsiChar(ANameSpaceName), PAnsiChar(AValueName), PAnsiChar(AValue))); end; - function TLib3MFMultiPropertyGroup.AddLayer(const ATheLayer: TLib3MFMultiPropertyLayer): Cardinal; + procedure TLib3MFToolpathProfile.SetParameterDoubleValue(const ANameSpaceName: String; const AValueName: String; const AValue: Double); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroup_AddLayerFunc(FHandle, @ATheLayer, Result)); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathProfile_SetParameterDoubleValueFunc(FHandle, PAnsiChar(ANameSpaceName), PAnsiChar(AValueName), AValue)); end; - function TLib3MFMultiPropertyGroup.GetLayer(const ALayerIndex: Cardinal): TLib3MFMultiPropertyLayer; + procedure TLib3MFToolpathProfile.SetParameterIntegerValue(const ANameSpaceName: String; const AValueName: String; const AValue: Int64); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroup_GetLayerFunc(FHandle, ALayerIndex, @Result)); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathProfile_SetParameterIntegerValueFunc(FHandle, PAnsiChar(ANameSpaceName), PAnsiChar(AValueName), AValue)); end; - procedure TLib3MFMultiPropertyGroup.RemoveLayer(const ALayerIndex: Cardinal); + procedure TLib3MFToolpathProfile.SetParameterBoolValue(const ANameSpaceName: String; const AValueName: String; const AValue: Boolean); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFMultiPropertyGroup_RemoveLayerFunc(FHandle, ALayerIndex)); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathProfile_SetParameterBoolValueFunc(FHandle, PAnsiChar(ANameSpaceName), PAnsiChar(AValueName), Ord(AValue))); end; (************************************************************************************************************************* - Class implementation for Attachment + Class implementation for ToolpathLayerReader **************************************************************************************************************************) - constructor TLib3MFAttachment.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + constructor TLib3MFToolpathLayerReader.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin inherited Create(AWrapper, AHandle); end; - destructor TLib3MFAttachment.Destroy; + destructor TLib3MFToolpathLayerReader.Destroy; begin inherited; end; - function TLib3MFAttachment.GetPath(): String; + function TLib3MFToolpathLayerReader.GetLayerDataUUID(): String; var - bytesNeededPath: Cardinal; - bytesWrittenPath: Cardinal; - bufferPath: array of Char; + bytesNeededUUID: Cardinal; + bytesWrittenUUID: Cardinal; + bufferUUID: array of Char; begin - bytesNeededPath:= 0; - bytesWrittenPath:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_GetPathFunc(FHandle, 0, bytesNeededPath, nil)); - SetLength(bufferPath, bytesNeededPath); - FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_GetPathFunc(FHandle, bytesNeededPath, bytesWrittenPath, @bufferPath[0])); - Result := StrPas(@bufferPath[0]); + bytesNeededUUID:= 0; + bytesWrittenUUID:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_GetLayerDataUUIDFunc(FHandle, 0, bytesNeededUUID, nil)); + SetLength(bufferUUID, bytesNeededUUID); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_GetLayerDataUUIDFunc(FHandle, bytesNeededUUID, bytesWrittenUUID, @bufferUUID[0])); + Result := StrPas(@bufferUUID[0]); end; - procedure TLib3MFAttachment.SetPath(const APath: String); + function TLib3MFToolpathLayerReader.GetSegmentCount(): Cardinal; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_SetPathFunc(FHandle, PAnsiChar(APath))); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_GetSegmentCountFunc(FHandle, Result)); end; - function TLib3MFAttachment.PackagePart(): TLib3MFPackagePart; + procedure TLib3MFToolpathLayerReader.GetSegmentInfo(const AIndex: Cardinal; out AType: TLib3MFToolpathSegmentType; out APointCount: Cardinal); var - HPackagePart: TLib3MFHandle; + ResultType: Integer; + begin + ResultType := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_GetSegmentInfoFunc(FHandle, AIndex, ResultType, APointCount)); + AType := convertConstToToolpathSegmentType(ResultType); + end; + + function TLib3MFToolpathLayerReader.GetSegmentProfile(const AIndex: Cardinal): TLib3MFToolpathProfile; + var + HProfile: TLib3MFHandle; begin Result := nil; - HPackagePart := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_PackagePartFunc(FHandle, HPackagePart)); - if Assigned(HPackagePart) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HPackagePart); + HProfile := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_GetSegmentProfileFunc(FHandle, AIndex, HProfile)); + if Assigned(HProfile) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HProfile); end; - function TLib3MFAttachment.GetRelationShipType(): String; + function TLib3MFToolpathLayerReader.GetSegmentProfileUUID(const AIndex: Cardinal): String; var - bytesNeededPath: Cardinal; - bytesWrittenPath: Cardinal; - bufferPath: array of Char; + bytesNeededProfileUUID: Cardinal; + bytesWrittenProfileUUID: Cardinal; + bufferProfileUUID: array of Char; begin - bytesNeededPath:= 0; - bytesWrittenPath:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_GetRelationShipTypeFunc(FHandle, 0, bytesNeededPath, nil)); - SetLength(bufferPath, bytesNeededPath); - FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_GetRelationShipTypeFunc(FHandle, bytesNeededPath, bytesWrittenPath, @bufferPath[0])); - Result := StrPas(@bufferPath[0]); + bytesNeededProfileUUID:= 0; + bytesWrittenProfileUUID:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_GetSegmentProfileUUIDFunc(FHandle, AIndex, 0, bytesNeededProfileUUID, nil)); + SetLength(bufferProfileUUID, bytesNeededProfileUUID); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_GetSegmentProfileUUIDFunc(FHandle, AIndex, bytesNeededProfileUUID, bytesWrittenProfileUUID, @bufferProfileUUID[0])); + Result := StrPas(@bufferProfileUUID[0]); end; - procedure TLib3MFAttachment.SetRelationShipType(const APath: String); + function TLib3MFToolpathLayerReader.GetSegmentPart(const AIndex: Cardinal): TLib3MFBuildItem; + var + HBuildItem: TLib3MFHandle; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_SetRelationShipTypeFunc(FHandle, PAnsiChar(APath))); + Result := nil; + HBuildItem := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_GetSegmentPartFunc(FHandle, AIndex, HBuildItem)); + if Assigned(HBuildItem) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HBuildItem); end; - procedure TLib3MFAttachment.WriteToFile(const AFileName: String); + function TLib3MFToolpathLayerReader.GetSegmentPartUUID(const AIndex: Cardinal): String; + var + bytesNeededPartUUID: Cardinal; + bytesWrittenPartUUID: Cardinal; + bufferPartUUID: array of Char; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_WriteToFileFunc(FHandle, PAnsiChar(AFileName))); + bytesNeededPartUUID:= 0; + bytesWrittenPartUUID:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_GetSegmentPartUUIDFunc(FHandle, AIndex, 0, bytesNeededPartUUID, nil)); + SetLength(bufferPartUUID, bytesNeededPartUUID); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_GetSegmentPartUUIDFunc(FHandle, AIndex, bytesNeededPartUUID, bytesWrittenPartUUID, @bufferPartUUID[0])); + Result := StrPas(@bufferPartUUID[0]); end; - procedure TLib3MFAttachment.ReadFromFile(const AFileName: String); + function TLib3MFToolpathLayerReader.GetSegmentLocalPartID(const AIndex: Cardinal): Cardinal; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_ReadFromFileFunc(FHandle, PAnsiChar(AFileName))); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_GetSegmentLocalPartIDFunc(FHandle, AIndex, Result)); end; - procedure TLib3MFAttachment.ReadFromCallback(const ATheReadCallback: PLib3MF_ReadCallback; const AStreamSize: QWord; const ATheSeekCallback: PLib3MF_SeekCallback; const AUserData: Pointer); + function TLib3MFToolpathLayerReader.GetPartUUIDByLocalPartID(const ALocalPartID: Cardinal): String; + var + bytesNeededPartUUID: Cardinal; + bytesWrittenPartUUID: Cardinal; + bufferPartUUID: array of Char; begin - if not Assigned(ATheReadCallback) then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ATheReadCallback is a nil value.'); - if not Assigned(ATheSeekCallback) then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ATheSeekCallback is a nil value.'); - FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_ReadFromCallbackFunc(FHandle, ATheReadCallback, AStreamSize, ATheSeekCallback, AUserData)); + bytesNeededPartUUID:= 0; + bytesWrittenPartUUID:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDFunc(FHandle, ALocalPartID, 0, bytesNeededPartUUID, nil)); + SetLength(bufferPartUUID, bytesNeededPartUUID); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDFunc(FHandle, ALocalPartID, bytesNeededPartUUID, bytesWrittenPartUUID, @bufferPartUUID[0])); + Result := StrPas(@bufferPartUUID[0]); end; - function TLib3MFAttachment.GetStreamSize(): QWord; + procedure TLib3MFToolpathLayerReader.GetSegmentPointData(const AIndex: Cardinal; out APointData: ArrayOfLib3MFPosition2D); + var + countNeededPointData: QWord; + countWrittenPointData: QWord; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_GetStreamSizeFunc(FHandle, Result)); + countNeededPointData:= 0; + countWrittenPointData:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_GetSegmentPointDataFunc(FHandle, AIndex, 0, countNeededPointData, nil)); + SetLength(APointData, countNeededPointData); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_GetSegmentPointDataFunc(FHandle, AIndex, countNeededPointData, countWrittenPointData, @APointData[0])); end; - procedure TLib3MFAttachment.WriteToBuffer(out ABuffer: TByteDynArray); + procedure TLib3MFToolpathLayerReader.FindAttributeInfoByName(const ANameSpace: String; const AAttributeName: String; out AID: Cardinal; out AAttributeType: TLib3MFToolpathAttributeType); var - countNeededBuffer: QWord; - countWrittenBuffer: QWord; + ResultAttributeType: Integer; begin - countNeededBuffer:= 0; - countWrittenBuffer:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_WriteToBufferFunc(FHandle, 0, countNeededBuffer, nil)); - SetLength(ABuffer, countNeededBuffer); - FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_WriteToBufferFunc(FHandle, countNeededBuffer, countWrittenBuffer, @ABuffer[0])); + ResultAttributeType := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_FindAttributeInfoByNameFunc(FHandle, PAnsiChar(ANameSpace), PAnsiChar(AAttributeName), AID, ResultAttributeType)); + AAttributeType := convertConstToToolpathAttributeType(ResultAttributeType); end; - procedure TLib3MFAttachment.ReadFromBuffer(const ABuffer: TByteDynArray); + function TLib3MFToolpathLayerReader.FindAttributeIDByName(const ANameSpace: String; const AAttributeName: String): Cardinal; + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_FindAttributeIDByNameFunc(FHandle, PAnsiChar(ANameSpace), PAnsiChar(AAttributeName), Result)); + end; + + function TLib3MFToolpathLayerReader.FindAttributeValueByName(const ANameSpace: String; const AAttributeName: String): TLib3MFToolpathAttributeType; var - PtrBuffer: PByte; - LenBuffer: QWord; + ResultAttributeType: Integer; begin - LenBuffer := Length(ABuffer); - if LenBuffer > $FFFFFFFF then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); - if LenBuffer > 0 then - PtrBuffer := @ABuffer[0] - else - PtrBuffer := nil; - - FWrapper.CheckError(Self, FWrapper.Lib3MFAttachment_ReadFromBufferFunc(FHandle, QWord(LenBuffer), PtrBuffer)); + ResultAttributeType := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_FindAttributeValueByNameFunc(FHandle, PAnsiChar(ANameSpace), PAnsiChar(AAttributeName), ResultAttributeType)); + Result := convertConstToToolpathAttributeType(ResultAttributeType); end; -(************************************************************************************************************************* - Class implementation for Texture2D -**************************************************************************************************************************) + function TLib3MFToolpathLayerReader.GetSegmentIntegerAttributeByID(const AIndex: Cardinal; const AID: Cardinal): Int64; + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_GetSegmentIntegerAttributeByIDFunc(FHandle, AIndex, AID, Result)); + end; - constructor TLib3MFTexture2D.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + function TLib3MFToolpathLayerReader.GetSegmentIntegerAttributeByName(const AIndex: Cardinal; const ANameSpace: String; const AAttributeName: String): Int64; begin - inherited Create(AWrapper, AHandle); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_GetSegmentIntegerAttributeByNameFunc(FHandle, AIndex, PAnsiChar(ANameSpace), PAnsiChar(AAttributeName), Result)); end; - destructor TLib3MFTexture2D.Destroy; + function TLib3MFToolpathLayerReader.GetSegmentDoubleAttributeByID(const AIndex: Cardinal; const AID: Cardinal): Double; begin - inherited; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_GetSegmentDoubleAttributeByIDFunc(FHandle, AIndex, AID, Result)); end; - function TLib3MFTexture2D.GetAttachment(): TLib3MFAttachment; + function TLib3MFToolpathLayerReader.GetSegmentDoubleAttributeByName(const AIndex: Cardinal; const ANameSpace: String; const AAttributeName: String): Double; + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_GetSegmentDoubleAttributeByNameFunc(FHandle, AIndex, PAnsiChar(ANameSpace), PAnsiChar(AAttributeName), Result)); + end; + + function TLib3MFToolpathLayerReader.GetCustomDataCount(): Cardinal; + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_GetCustomDataCountFunc(FHandle, Result)); + end; + + function TLib3MFToolpathLayerReader.GetCustomData(const AIndex: Cardinal): TLib3MFCustomDOMTree; var - HAttachment: TLib3MFHandle; + HData: TLib3MFHandle; begin Result := nil; - HAttachment := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2D_GetAttachmentFunc(FHandle, HAttachment)); - if Assigned(HAttachment) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HAttachment); + HData := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_GetCustomDataFunc(FHandle, AIndex, HData)); + if Assigned(HData) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HData); end; - procedure TLib3MFTexture2D.SetAttachment(const AAttachment: TLib3MFAttachment); + procedure TLib3MFToolpathLayerReader.GetCustomDataName(const AIndex: Cardinal; out ANameSpace: String; out ADataName: String); var - AAttachmentHandle: TLib3MFHandle; + bytesNeededNameSpace: Cardinal; + bytesWrittenNameSpace: Cardinal; + bufferNameSpace: array of Char; + bytesNeededDataName: Cardinal; + bytesWrittenDataName: Cardinal; + bufferDataName: array of Char; begin - if Assigned(AAttachment) then - AAttachmentHandle := AAttachment.TheHandle - else - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'AAttachment is a nil value.'); - FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2D_SetAttachmentFunc(FHandle, AAttachmentHandle)); + bytesNeededNameSpace:= 0; + bytesWrittenNameSpace:= 0; + bytesNeededDataName:= 0; + bytesWrittenDataName:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_GetCustomDataNameFunc(FHandle, AIndex, 0, bytesNeededNameSpace, nil, 0, bytesNeededDataName, nil)); + SetLength(bufferNameSpace, bytesNeededNameSpace); + SetLength(bufferDataName, bytesNeededDataName); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerReader_GetCustomDataNameFunc(FHandle, AIndex, bytesNeededNameSpace, bytesWrittenNameSpace, @bufferNameSpace[0], bytesNeededDataName, bytesWrittenDataName, @bufferDataName[0])); + ANameSpace := StrPas(@bufferNameSpace[0]); + ADataName := StrPas(@bufferDataName[0]); end; - function TLib3MFTexture2D.GetContentType(): TLib3MFTextureType; - var - ResultContentType: Integer; +(************************************************************************************************************************* + Class implementation for ToolpathLayerData +**************************************************************************************************************************) + + constructor TLib3MFToolpathLayerData.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin - ResultContentType := 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2D_GetContentTypeFunc(FHandle, ResultContentType)); - Result := convertConstToTextureType(ResultContentType); + inherited Create(AWrapper, AHandle); end; - procedure TLib3MFTexture2D.SetContentType(const AContentType: TLib3MFTextureType); + destructor TLib3MFToolpathLayerData.Destroy; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2D_SetContentTypeFunc(FHandle, convertTextureTypeToConst(AContentType))); + inherited; end; - procedure TLib3MFTexture2D.GetTileStyleUV(out ATileStyleU: TLib3MFTextureTileStyle; out ATileStyleV: TLib3MFTextureTileStyle); + function TLib3MFToolpathLayerData.GetLayerDataUUID(): String; var - ResultTileStyleU: Integer; - ResultTileStyleV: Integer; + bytesNeededUUID: Cardinal; + bytesWrittenUUID: Cardinal; + bufferUUID: array of Char; begin - ResultTileStyleU := 0; - ResultTileStyleV := 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2D_GetTileStyleUVFunc(FHandle, ResultTileStyleU, ResultTileStyleV)); - ATileStyleU := convertConstToTextureTileStyle(ResultTileStyleU); - ATileStyleV := convertConstToTextureTileStyle(ResultTileStyleV); + bytesNeededUUID:= 0; + bytesWrittenUUID:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerData_GetLayerDataUUIDFunc(FHandle, 0, bytesNeededUUID, nil)); + SetLength(bufferUUID, bytesNeededUUID); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerData_GetLayerDataUUIDFunc(FHandle, bytesNeededUUID, bytesWrittenUUID, @bufferUUID[0])); + Result := StrPas(@bufferUUID[0]); end; - procedure TLib3MFTexture2D.SetTileStyleUV(const ATileStyleU: TLib3MFTextureTileStyle; const ATileStyleV: TLib3MFTextureTileStyle); + function TLib3MFToolpathLayerData.RegisterProfile(const AProfile: TLib3MFToolpathProfile): Cardinal; + var + AProfileHandle: TLib3MFHandle; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2D_SetTileStyleUVFunc(FHandle, convertTextureTileStyleToConst(ATileStyleU), convertTextureTileStyleToConst(ATileStyleV))); + if Assigned(AProfile) then + AProfileHandle := AProfile.TheHandle + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'AProfile is a nil value.'); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerData_RegisterProfileFunc(FHandle, AProfileHandle, Result)); end; - function TLib3MFTexture2D.GetFilter(): TLib3MFTextureFilter; + function TLib3MFToolpathLayerData.RegisterBuildItem(const ABuildItem: TLib3MFBuildItem): Cardinal; var - ResultFilter: Integer; + ABuildItemHandle: TLib3MFHandle; begin - ResultFilter := 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2D_GetFilterFunc(FHandle, ResultFilter)); - Result := convertConstToTextureFilter(ResultFilter); + if Assigned(ABuildItem) then + ABuildItemHandle := ABuildItem.TheHandle + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ABuildItem is a nil value.'); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerData_RegisterBuildItemFunc(FHandle, ABuildItemHandle, Result)); end; - procedure TLib3MFTexture2D.SetFilter(const AFilter: TLib3MFTextureFilter); + procedure TLib3MFToolpathLayerData.SetSegmentAttribute(const ANameSpace: String; const AAttributeName: String; const AValue: String); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFTexture2D_SetFilterFunc(FHandle, convertTextureFilterToConst(AFilter))); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerData_SetSegmentAttributeFunc(FHandle, PAnsiChar(ANameSpace), PAnsiChar(AAttributeName), PAnsiChar(AValue))); end; -(************************************************************************************************************************* - Class implementation for BuildItem -**************************************************************************************************************************) + procedure TLib3MFToolpathLayerData.ClearSegmentAttributes(); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerData_ClearSegmentAttributesFunc(FHandle)); + end; - constructor TLib3MFBuildItem.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + procedure TLib3MFToolpathLayerData.WriteHatchData(const AProfileID: Cardinal; const APartID: Cardinal; const APointData: ArrayOfLib3MFPosition2D); + var + PtrPointData: PLib3MFPosition2D; + LenPointData: QWord; begin - inherited Create(AWrapper, AHandle); + LenPointData := Length(APointData); + if LenPointData > $FFFFFFFF then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); + if LenPointData > 0 then + PtrPointData := @APointData[0] + else + PtrPointData := nil; + + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerData_WriteHatchDataFunc(FHandle, AProfileID, APartID, QWord(LenPointData), PtrPointData)); end; - destructor TLib3MFBuildItem.Destroy; + procedure TLib3MFToolpathLayerData.WriteLoop(const AProfileID: Cardinal; const APartID: Cardinal; const APointData: ArrayOfLib3MFPosition2D); + var + PtrPointData: PLib3MFPosition2D; + LenPointData: QWord; begin - inherited; + LenPointData := Length(APointData); + if LenPointData > $FFFFFFFF then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); + if LenPointData > 0 then + PtrPointData := @APointData[0] + else + PtrPointData := nil; + + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerData_WriteLoopFunc(FHandle, AProfileID, APartID, QWord(LenPointData), PtrPointData)); end; - function TLib3MFBuildItem.GetObjectResource(): TLib3MFObject; + procedure TLib3MFToolpathLayerData.WritePolyline(const AProfileID: Cardinal; const APartID: Cardinal; const APointData: ArrayOfLib3MFPosition2D); var - HObjectResource: TLib3MFHandle; + PtrPointData: PLib3MFPosition2D; + LenPointData: QWord; begin - Result := nil; - HObjectResource := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_GetObjectResourceFunc(FHandle, HObjectResource)); - if Assigned(HObjectResource) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HObjectResource); + LenPointData := Length(APointData); + if LenPointData > $FFFFFFFF then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); + if LenPointData > 0 then + PtrPointData := @APointData[0] + else + PtrPointData := nil; + + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerData_WritePolylineFunc(FHandle, AProfileID, APartID, QWord(LenPointData), PtrPointData)); end; - function TLib3MFBuildItem.GetUUID(out AHasUUID: Boolean): String; + function TLib3MFToolpathLayerData.AddCustomData(const ANameSpace: String; const ADataName: String): TLib3MFCustomDOMTree; var - ResultHasUUID: Byte; - bytesNeededUUID: Cardinal; - bytesWrittenUUID: Cardinal; - bufferUUID: array of Char; + HData: TLib3MFHandle; begin - ResultHasUUID := 0; - bytesNeededUUID:= 0; - bytesWrittenUUID:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_GetUUIDFunc(FHandle, ResultHasUUID, 0, bytesNeededUUID, nil)); - SetLength(bufferUUID, bytesNeededUUID); - FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_GetUUIDFunc(FHandle, ResultHasUUID, bytesNeededUUID, bytesWrittenUUID, @bufferUUID[0])); - AHasUUID := ResultHasUUID <> 0; - Result := StrPas(@bufferUUID[0]); + Result := nil; + HData := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerData_AddCustomDataFunc(FHandle, PAnsiChar(ANameSpace), PAnsiChar(ADataName), HData)); + if Assigned(HData) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HData); + end; + + procedure TLib3MFToolpathLayerData.Finish(); + begin + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathLayerData_FinishFunc(FHandle)); end; - procedure TLib3MFBuildItem.SetUUID(const AUUID: String); +(************************************************************************************************************************* + Class implementation for Toolpath +**************************************************************************************************************************) + + constructor TLib3MFToolpath.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_SetUUIDFunc(FHandle, PAnsiChar(AUUID))); + inherited Create(AWrapper, AHandle); end; - function TLib3MFBuildItem.GetObjectResourceID(): Cardinal; + destructor TLib3MFToolpath.Destroy; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_GetObjectResourceIDFunc(FHandle, Result)); + inherited; end; - function TLib3MFBuildItem.HasObjectTransform(): Boolean; - var - ResultHasTransform: Byte; + function TLib3MFToolpath.GetUnits(): Double; begin - ResultHasTransform := 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_HasObjectTransformFunc(FHandle, ResultHasTransform)); - Result := (ResultHasTransform <> 0); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpath_GetUnitsFunc(FHandle, Result)); end; - function TLib3MFBuildItem.GetObjectTransform(): TLib3MFTransform; + function TLib3MFToolpath.GetLayerCount(): Cardinal; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_GetObjectTransformFunc(FHandle, @Result)); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpath_GetLayerCountFunc(FHandle, Result)); end; - procedure TLib3MFBuildItem.SetObjectTransform(const ATransform: TLib3MFTransform); + function TLib3MFToolpath.GetProfileCount(): Cardinal; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_SetObjectTransformFunc(FHandle, @ATransform)); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpath_GetProfileCountFunc(FHandle, Result)); end; - function TLib3MFBuildItem.GetPartNumber(): String; + function TLib3MFToolpath.AddLayer(const AZMax: Cardinal; const APath: String; const AModelWriter: TLib3MFWriter): TLib3MFToolpathLayerData; var - bytesNeededPartNumber: Cardinal; - bytesWrittenPartNumber: Cardinal; - bufferPartNumber: array of Char; + AModelWriterHandle: TLib3MFHandle; + HLayerData: TLib3MFHandle; begin - bytesNeededPartNumber:= 0; - bytesWrittenPartNumber:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_GetPartNumberFunc(FHandle, 0, bytesNeededPartNumber, nil)); - SetLength(bufferPartNumber, bytesNeededPartNumber); - FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_GetPartNumberFunc(FHandle, bytesNeededPartNumber, bytesWrittenPartNumber, @bufferPartNumber[0])); - Result := StrPas(@bufferPartNumber[0]); + if Assigned(AModelWriter) then + AModelWriterHandle := AModelWriter.TheHandle + else + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'AModelWriter is a nil value.'); + Result := nil; + HLayerData := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpath_AddLayerFunc(FHandle, AZMax, PAnsiChar(APath), AModelWriterHandle, HLayerData)); + if Assigned(HLayerData) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HLayerData); end; - procedure TLib3MFBuildItem.SetPartNumber(const ASetPartnumber: String); + function TLib3MFToolpath.GetLayerAttachment(const AIndex: Cardinal): TLib3MFAttachment; + var + HAttachment: TLib3MFHandle; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_SetPartNumberFunc(FHandle, PAnsiChar(ASetPartnumber))); + Result := nil; + HAttachment := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpath_GetLayerAttachmentFunc(FHandle, AIndex, HAttachment)); + if Assigned(HAttachment) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HAttachment); end; - function TLib3MFBuildItem.GetMetaDataGroup(): TLib3MFMetaDataGroup; + function TLib3MFToolpath.ReadLayerData(const AIndex: Cardinal): TLib3MFToolpathLayerReader; var - HMetaDataGroup: TLib3MFHandle; + HToolpathReader: TLib3MFHandle; begin Result := nil; - HMetaDataGroup := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_GetMetaDataGroupFunc(FHandle, HMetaDataGroup)); - if Assigned(HMetaDataGroup) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HMetaDataGroup); + HToolpathReader := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpath_ReadLayerDataFunc(FHandle, AIndex, HToolpathReader)); + if Assigned(HToolpathReader) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HToolpathReader); end; - function TLib3MFBuildItem.GetOutbox(): TLib3MFBox; + function TLib3MFToolpath.GetLayerPath(const AIndex: Cardinal): String; + var + bytesNeededPath: Cardinal; + bytesWrittenPath: Cardinal; + bufferPath: array of Char; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItem_GetOutboxFunc(FHandle, @Result)); + bytesNeededPath:= 0; + bytesWrittenPath:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpath_GetLayerPathFunc(FHandle, AIndex, 0, bytesNeededPath, nil)); + SetLength(bufferPath, bytesNeededPath); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpath_GetLayerPathFunc(FHandle, AIndex, bytesNeededPath, bytesWrittenPath, @bufferPath[0])); + Result := StrPas(@bufferPath[0]); end; -(************************************************************************************************************************* - Class implementation for BuildItemIterator -**************************************************************************************************************************) - - constructor TLib3MFBuildItemIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + function TLib3MFToolpath.GetLayerZMax(const AIndex: Cardinal): Cardinal; begin - inherited Create(AWrapper, AHandle); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpath_GetLayerZMaxFunc(FHandle, AIndex, Result)); end; - destructor TLib3MFBuildItemIterator.Destroy; + function TLib3MFToolpath.GetLayerZ(const ALayerIndex: Cardinal): Cardinal; begin - inherited; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpath_GetLayerZFunc(FHandle, ALayerIndex, Result)); end; - function TLib3MFBuildItemIterator.MoveNext(): Boolean; + function TLib3MFToolpath.AddProfile(const AName: String): TLib3MFToolpathProfile; var - ResultHasNext: Byte; + HProfile: TLib3MFHandle; begin - ResultHasNext := 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItemIterator_MoveNextFunc(FHandle, ResultHasNext)); - Result := (ResultHasNext <> 0); + Result := nil; + HProfile := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpath_AddProfileFunc(FHandle, PAnsiChar(AName), HProfile)); + if Assigned(HProfile) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HProfile); end; - function TLib3MFBuildItemIterator.MovePrevious(): Boolean; + function TLib3MFToolpath.GetProfile(const AProfileIndex: Cardinal): TLib3MFToolpathProfile; var - ResultHasPrevious: Byte; + HProfile: TLib3MFHandle; begin - ResultHasPrevious := 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItemIterator_MovePreviousFunc(FHandle, ResultHasPrevious)); - Result := (ResultHasPrevious <> 0); + Result := nil; + HProfile := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpath_GetProfileFunc(FHandle, AProfileIndex, HProfile)); + if Assigned(HProfile) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HProfile); end; - function TLib3MFBuildItemIterator.GetCurrent(): TLib3MFBuildItem; + function TLib3MFToolpath.GetProfileUUID(const AProfileUUID: String): TLib3MFToolpathProfile; var - HBuildItem: TLib3MFHandle; + HProfile: TLib3MFHandle; begin Result := nil; - HBuildItem := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItemIterator_GetCurrentFunc(FHandle, HBuildItem)); - if Assigned(HBuildItem) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HBuildItem); + HProfile := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpath_GetProfileUUIDFunc(FHandle, PAnsiChar(AProfileUUID), HProfile)); + if Assigned(HProfile) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HProfile); end; - function TLib3MFBuildItemIterator.Clone(): TLib3MFBuildItemIterator; - var - HOutBuildItemIterator: TLib3MFHandle; + function TLib3MFToolpath.GetCustomDataCount(): Cardinal; begin - Result := nil; - HOutBuildItemIterator := nil; - FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItemIterator_CloneFunc(FHandle, HOutBuildItemIterator)); - if Assigned(HOutBuildItemIterator) then - Result := TLib3MFPolymorphicFactory.Make(FWrapper, HOutBuildItemIterator); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpath_GetCustomDataCountFunc(FHandle, Result)); end; - function TLib3MFBuildItemIterator.Count(): QWord; + function TLib3MFToolpath.GetCustomData(const AIndex: Cardinal): TLib3MFCustomDOMTree; + var + HData: TLib3MFHandle; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFBuildItemIterator_CountFunc(FHandle, Result)); + Result := nil; + HData := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpath_GetCustomDataFunc(FHandle, AIndex, HData)); + if Assigned(HData) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HData); end; -(************************************************************************************************************************* - Class implementation for Slice -**************************************************************************************************************************) - - constructor TLib3MFSlice.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); + procedure TLib3MFToolpath.GetCustomDataName(const AIndex: Cardinal; out ANameSpace: String; out ADataName: String); + var + bytesNeededNameSpace: Cardinal; + bytesWrittenNameSpace: Cardinal; + bufferNameSpace: array of Char; + bytesNeededDataName: Cardinal; + bytesWrittenDataName: Cardinal; + bufferDataName: array of Char; begin - inherited Create(AWrapper, AHandle); + bytesNeededNameSpace:= 0; + bytesWrittenNameSpace:= 0; + bytesNeededDataName:= 0; + bytesWrittenDataName:= 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpath_GetCustomDataNameFunc(FHandle, AIndex, 0, bytesNeededNameSpace, nil, 0, bytesNeededDataName, nil)); + SetLength(bufferNameSpace, bytesNeededNameSpace); + SetLength(bufferDataName, bytesNeededDataName); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpath_GetCustomDataNameFunc(FHandle, AIndex, bytesNeededNameSpace, bytesWrittenNameSpace, @bufferNameSpace[0], bytesNeededDataName, bytesWrittenDataName, @bufferDataName[0])); + ANameSpace := StrPas(@bufferNameSpace[0]); + ADataName := StrPas(@bufferDataName[0]); end; - destructor TLib3MFSlice.Destroy; + function TLib3MFToolpath.HasUniqueCustomData(const ANameSpace: String; const ADataName: String): Boolean; + var + ResultCustomDataExists: Byte; begin - inherited; + ResultCustomDataExists := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpath_HasUniqueCustomDataFunc(FHandle, PAnsiChar(ANameSpace), PAnsiChar(ADataName), ResultCustomDataExists)); + Result := (ResultCustomDataExists <> 0); end; - procedure TLib3MFSlice.SetVertices(const AVertices: ArrayOfLib3MFPosition2D); + function TLib3MFToolpath.FindUniqueCustomData(const ANameSpace: String; const ADataName: String): TLib3MFCustomDOMTree; var - PtrVertices: PLib3MFPosition2D; - LenVertices: QWord; + HData: TLib3MFHandle; begin - LenVertices := Length(AVertices); - if LenVertices > $FFFFFFFF then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); - if LenVertices > 0 then - PtrVertices := @AVertices[0] - else - PtrVertices := nil; - - FWrapper.CheckError(Self, FWrapper.Lib3MFSlice_SetVerticesFunc(FHandle, QWord(LenVertices), PtrVertices)); + Result := nil; + HData := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpath_FindUniqueCustomDataFunc(FHandle, PAnsiChar(ANameSpace), PAnsiChar(ADataName), HData)); + if Assigned(HData) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HData); end; - procedure TLib3MFSlice.GetVertices(out AVertices: ArrayOfLib3MFPosition2D); + function TLib3MFToolpath.AddCustomData(const ANameSpace: String; const ADataName: String): TLib3MFCustomDOMTree; var - countNeededVertices: QWord; - countWrittenVertices: QWord; + HData: TLib3MFHandle; begin - countNeededVertices:= 0; - countWrittenVertices:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFSlice_GetVerticesFunc(FHandle, 0, countNeededVertices, nil)); - SetLength(AVertices, countNeededVertices); - FWrapper.CheckError(Self, FWrapper.Lib3MFSlice_GetVerticesFunc(FHandle, countNeededVertices, countWrittenVertices, @AVertices[0])); + Result := nil; + HData := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpath_AddCustomDataFunc(FHandle, PAnsiChar(ANameSpace), PAnsiChar(ADataName), HData)); + if Assigned(HData) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HData); end; - function TLib3MFSlice.GetVertexCount(): QWord; + function TLib3MFToolpath.ClearCustomData(): Cardinal; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFSlice_GetVertexCountFunc(FHandle, Result)); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpath_ClearCustomDataFunc(FHandle, Result)); end; - function TLib3MFSlice.AddPolygon(const AIndices: TCardinalDynArray): QWord; + function TLib3MFToolpath.DeleteCustomData(const AData: TLib3MFCustomDOMTree): Boolean; var - PtrIndices: PCardinal; - LenIndices: QWord; + ADataHandle: TLib3MFHandle; + ResultSuccess: Byte; begin - LenIndices := Length(AIndices); - if LenIndices > $FFFFFFFF then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); - if LenIndices > 0 then - PtrIndices := @AIndices[0] + if Assigned(AData) then + ADataHandle := AData.TheHandle else - PtrIndices := nil; - - FWrapper.CheckError(Self, FWrapper.Lib3MFSlice_AddPolygonFunc(FHandle, QWord(LenIndices), PtrIndices, Result)); + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'AData is a nil value.'); + ResultSuccess := 0; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpath_DeleteCustomDataFunc(FHandle, ADataHandle, ResultSuccess)); + Result := (ResultSuccess <> 0); end; - function TLib3MFSlice.GetPolygonCount(): QWord; + procedure TLib3MFToolpath.RegisterCustomIntegerAttribute(const ANameSpace: String; const AAttributeName: String); begin - FWrapper.CheckError(Self, FWrapper.Lib3MFSlice_GetPolygonCountFunc(FHandle, Result)); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpath_RegisterCustomIntegerAttributeFunc(FHandle, PAnsiChar(ANameSpace), PAnsiChar(AAttributeName))); end; - procedure TLib3MFSlice.SetPolygonIndices(const AIndex: QWord; const AIndices: TCardinalDynArray); - var - PtrIndices: PCardinal; - LenIndices: QWord; + procedure TLib3MFToolpath.RegisterCustomDoubleAttribute(const ANameSpace: String; const AAttributeName: String); begin - LenIndices := Length(AIndices); - if LenIndices > $FFFFFFFF then - raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); - if LenIndices > 0 then - PtrIndices := @AIndices[0] - else - PtrIndices := nil; - - FWrapper.CheckError(Self, FWrapper.Lib3MFSlice_SetPolygonIndicesFunc(FHandle, AIndex, QWord(LenIndices), PtrIndices)); + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpath_RegisterCustomDoubleAttributeFunc(FHandle, PAnsiChar(ANameSpace), PAnsiChar(AAttributeName))); end; - procedure TLib3MFSlice.GetPolygonIndices(const AIndex: QWord; out AIndices: TCardinalDynArray); - var - countNeededIndices: QWord; - countWrittenIndices: QWord; +(************************************************************************************************************************* + Class implementation for ToolpathIterator +**************************************************************************************************************************) + + constructor TLib3MFToolpathIterator.Create(AWrapper: TLib3MFWrapper; AHandle: TLib3MFHandle); begin - countNeededIndices:= 0; - countWrittenIndices:= 0; - FWrapper.CheckError(Self, FWrapper.Lib3MFSlice_GetPolygonIndicesFunc(FHandle, AIndex, 0, countNeededIndices, nil)); - SetLength(AIndices, countNeededIndices); - FWrapper.CheckError(Self, FWrapper.Lib3MFSlice_GetPolygonIndicesFunc(FHandle, AIndex, countNeededIndices, countWrittenIndices, @AIndices[0])); + inherited Create(AWrapper, AHandle); end; - function TLib3MFSlice.GetPolygonIndexCount(const AIndex: QWord): QWord; + destructor TLib3MFToolpathIterator.Destroy; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFSlice_GetPolygonIndexCountFunc(FHandle, AIndex, Result)); + inherited; end; - function TLib3MFSlice.GetZTop(): Double; + function TLib3MFToolpathIterator.GetCurrentToolpath(): TLib3MFToolpath; + var + HResource: TLib3MFHandle; begin - FWrapper.CheckError(Self, FWrapper.Lib3MFSlice_GetZTopFunc(FHandle, Result)); + Result := nil; + HResource := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFToolpathIterator_GetCurrentToolpathFunc(FHandle, HResource)); + if Assigned(HResource) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResource); end; (************************************************************************************************************************* @@ -10010,6 +13591,17 @@ implementation Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResourceIterator); end; + function TLib3MFModel.GetToolpaths(): TLib3MFToolpathIterator; + var + HResourceIterator: TLib3MFHandle; + begin + Result := nil; + HResourceIterator := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFModel_GetToolpathsFunc(FHandle, HResourceIterator)); + if Assigned(HResourceIterator) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HResourceIterator); + end; + function TLib3MFModel.GetSliceStacks(): TLib3MFSliceStackIterator; var HResourceIterator: TLib3MFHandle; @@ -10173,6 +13765,17 @@ implementation FWrapper.CheckError(Self, FWrapper.Lib3MFModel_RemoveBuildItemFunc(FHandle, ABuildItemInstanceHandle)); end; + function TLib3MFModel.AddToolpath(const AUnitFactor: Double): TLib3MFToolpath; + var + HToolpathInstance: TLib3MFHandle; + begin + Result := nil; + HToolpathInstance := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFModel_AddToolpathFunc(FHandle, AUnitFactor, HToolpathInstance)); + if Assigned(HToolpathInstance) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HToolpathInstance); + end; + function TLib3MFModel.GetMetaDataGroup(): TLib3MFMetaDataGroup; var HTheMetaDataGroup: TLib3MFHandle; @@ -10297,6 +13900,53 @@ implementation Result := TLib3MFPolymorphicFactory.Make(FWrapper, HKeyStore); end; + function TLib3MFModel.CreatePersistentSourceFromFile(const AFilename: String): TLib3MFPersistentReaderSource; + var + HInstance: TLib3MFHandle; + begin + Result := nil; + HInstance := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFModel_CreatePersistentSourceFromFileFunc(FHandle, PAnsiChar(AFilename), HInstance)); + if Assigned(HInstance) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HInstance); + end; + + function TLib3MFModel.CreatePersistentSourceFromBuffer(const ABuffer: TByteDynArray): TLib3MFPersistentReaderSource; + var + PtrBuffer: PByte; + LenBuffer: QWord; + HInstance: TLib3MFHandle; + begin + LenBuffer := Length(ABuffer); + if LenBuffer > $FFFFFFFF then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'array has too many entries.'); + if LenBuffer > 0 then + PtrBuffer := @ABuffer[0] + else + PtrBuffer := nil; + + Result := nil; + HInstance := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFModel_CreatePersistentSourceFromBufferFunc(FHandle, QWord(LenBuffer), PtrBuffer, HInstance)); + if Assigned(HInstance) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HInstance); + end; + + function TLib3MFModel.CreatePersistentSourceFromCallback(const ATheReadCallback: PLib3MF_ReadCallback; const AStreamSize: QWord; const ATheSeekCallback: PLib3MF_SeekCallback; const AUserData: Pointer): TLib3MFPersistentReaderSource; + var + HInstance: TLib3MFHandle; + begin + if not Assigned(ATheReadCallback) then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ATheReadCallback is a nil value.'); + if not Assigned(ATheSeekCallback) then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_INVALIDPARAM, 'ATheSeekCallback is a nil value.'); + Result := nil; + HInstance := nil; + FWrapper.CheckError(Self, FWrapper.Lib3MFModel_CreatePersistentSourceFromCallbackFunc(FHandle, ATheReadCallback, AStreamSize, ATheSeekCallback, AUserData, HInstance)); + if Assigned(HInstance) then + Result := TLib3MFPolymorphicFactory.Make(FWrapper, HInstance); + end; + (************************************************************************************************************************* Wrapper class implementation **************************************************************************************************************************) @@ -10320,6 +13970,13 @@ implementation raise ELib3MFException.Create(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); FLib3MFBase_ClassTypeIdFunc := LoadFunction('lib3mf_base_classtypeid'); + FLib3MFBinaryStream_GetBinaryPathFunc := LoadFunction('lib3mf_binarystream_getbinarypath'); + FLib3MFBinaryStream_GetIndexPathFunc := LoadFunction('lib3mf_binarystream_getindexpath'); + FLib3MFBinaryStream_GetUUIDFunc := LoadFunction('lib3mf_binarystream_getuuid'); + FLib3MFBinaryStream_DisableDiscretizedArrayCompressionFunc := LoadFunction('lib3mf_binarystream_disablediscretizedarraycompression'); + FLib3MFBinaryStream_EnableDiscretizedArrayCompressionFunc := LoadFunction('lib3mf_binarystream_enablediscretizedarraycompression'); + FLib3MFBinaryStream_EnableLZMAFunc := LoadFunction('lib3mf_binarystream_enablelzma'); + FLib3MFBinaryStream_DisableLZMAFunc := LoadFunction('lib3mf_binarystream_disablelzma'); FLib3MFWriter_WriteToFileFunc := LoadFunction('lib3mf_writer_writetofile'); FLib3MFWriter_GetStreamSizeFunc := LoadFunction('lib3mf_writer_getstreamsize'); FLib3MFWriter_WriteToBufferFunc := LoadFunction('lib3mf_writer_writetobuffer'); @@ -10333,6 +13990,13 @@ implementation FLib3MFWriter_GetWarningCountFunc := LoadFunction('lib3mf_writer_getwarningcount'); FLib3MFWriter_AddKeyWrappingCallbackFunc := LoadFunction('lib3mf_writer_addkeywrappingcallback'); FLib3MFWriter_SetContentEncryptionCallbackFunc := LoadFunction('lib3mf_writer_setcontentencryptioncallback'); + FLib3MFWriter_CreateBinaryStreamFunc := LoadFunction('lib3mf_writer_createbinarystream'); + FLib3MFWriter_AssignBinaryStreamFunc := LoadFunction('lib3mf_writer_assignbinarystream'); + FLib3MFWriter_RegisterCustomNamespaceFunc := LoadFunction('lib3mf_writer_registercustomnamespace'); + FLib3MFPersistentReaderSource_GetSourceTypeFunc := LoadFunction('lib3mf_persistentreadersource_getsourcetype'); + FLib3MFPersistentReaderSource_InvalidateSourceDataFunc := LoadFunction('lib3mf_persistentreadersource_invalidatesourcedata'); + FLib3MFPersistentReaderSource_SourceDataIsValidFunc := LoadFunction('lib3mf_persistentreadersource_sourcedataisvalid'); + FLib3MFReader_ReadFromPersistentSourceFunc := LoadFunction('lib3mf_reader_readfrompersistentsource'); FLib3MFReader_ReadFromFileFunc := LoadFunction('lib3mf_reader_readfromfile'); FLib3MFReader_ReadFromBufferFunc := LoadFunction('lib3mf_reader_readfrombuffer'); FLib3MFReader_ReadFromCallbackFunc := LoadFunction('lib3mf_reader_readfromcallback'); @@ -10357,6 +14021,51 @@ implementation FLib3MFResourceIterator_GetCurrentFunc := LoadFunction('lib3mf_resourceiterator_getcurrent'); FLib3MFResourceIterator_CloneFunc := LoadFunction('lib3mf_resourceiterator_clone'); FLib3MFResourceIterator_CountFunc := LoadFunction('lib3mf_resourceiterator_count'); + FLib3MFCustomXMLAttribute_GetNameFunc := LoadFunction('lib3mf_customxmlattribute_getname'); + FLib3MFCustomXMLAttribute_GetValueFunc := LoadFunction('lib3mf_customxmlattribute_getvalue'); + FLib3MFCustomXMLAttribute_IsValidIntegerFunc := LoadFunction('lib3mf_customxmlattribute_isvalidinteger'); + FLib3MFCustomXMLAttribute_GetIntegerValueFunc := LoadFunction('lib3mf_customxmlattribute_getintegervalue'); + FLib3MFCustomXMLAttribute_IsValidDoubleFunc := LoadFunction('lib3mf_customxmlattribute_isvaliddouble'); + FLib3MFCustomXMLAttribute_GetDoubleValueFunc := LoadFunction('lib3mf_customxmlattribute_getdoublevalue'); + FLib3MFCustomXMLAttribute_IsValidBoolFunc := LoadFunction('lib3mf_customxmlattribute_isvalidbool'); + FLib3MFCustomXMLAttribute_GetBoolValueFunc := LoadFunction('lib3mf_customxmlattribute_getboolvalue'); + FLib3MFCustomXMLAttribute_SetValueFunc := LoadFunction('lib3mf_customxmlattribute_setvalue'); + FLib3MFCustomXMLAttribute_SetIntegerValueFunc := LoadFunction('lib3mf_customxmlattribute_setintegervalue'); + FLib3MFCustomXMLAttribute_SetDoubleValueFunc := LoadFunction('lib3mf_customxmlattribute_setdoublevalue'); + FLib3MFCustomXMLAttribute_SetBoolValueFunc := LoadFunction('lib3mf_customxmlattribute_setboolvalue'); + FLib3MFCustomXMLAttribute_RemoveFunc := LoadFunction('lib3mf_customxmlattribute_remove'); + FLib3MFCustomXMLNode_GetNameFunc := LoadFunction('lib3mf_customxmlnode_getname'); + FLib3MFCustomXMLNode_GetNameSpaceFunc := LoadFunction('lib3mf_customxmlnode_getnamespace'); + FLib3MFCustomXMLNode_GetAttributeCountFunc := LoadFunction('lib3mf_customxmlnode_getattributecount'); + FLib3MFCustomXMLNode_GetAttributeFunc := LoadFunction('lib3mf_customxmlnode_getattribute'); + FLib3MFCustomXMLNode_HasAttributeFunc := LoadFunction('lib3mf_customxmlnode_hasattribute'); + FLib3MFCustomXMLNode_FindAttributeFunc := LoadFunction('lib3mf_customxmlnode_findattribute'); + FLib3MFCustomXMLNode_RemoveAttributeFunc := LoadFunction('lib3mf_customxmlnode_removeattribute'); + FLib3MFCustomXMLNode_RemoveAttributeByIndexFunc := LoadFunction('lib3mf_customxmlnode_removeattributebyindex'); + FLib3MFCustomXMLNode_AddAttributeFunc := LoadFunction('lib3mf_customxmlnode_addattribute'); + FLib3MFCustomXMLNode_AddIntegerAttributeFunc := LoadFunction('lib3mf_customxmlnode_addintegerattribute'); + FLib3MFCustomXMLNode_AddDoubleAttributeFunc := LoadFunction('lib3mf_customxmlnode_adddoubleattribute'); + FLib3MFCustomXMLNode_AddBoolAttributeFunc := LoadFunction('lib3mf_customxmlnode_addboolattribute'); + FLib3MFCustomXMLNode_GetChildrenFunc := LoadFunction('lib3mf_customxmlnode_getchildren'); + FLib3MFCustomXMLNode_CountChildrenByNameFunc := LoadFunction('lib3mf_customxmlnode_countchildrenbyname'); + FLib3MFCustomXMLNode_GetChildrenByNameFunc := LoadFunction('lib3mf_customxmlnode_getchildrenbyname'); + FLib3MFCustomXMLNode_HasChildFunc := LoadFunction('lib3mf_customxmlnode_haschild'); + FLib3MFCustomXMLNode_HasUniqueChildFunc := LoadFunction('lib3mf_customxmlnode_hasuniquechild'); + FLib3MFCustomXMLNode_FindChildFunc := LoadFunction('lib3mf_customxmlnode_findchild'); + FLib3MFCustomXMLNode_AddChildFunc := LoadFunction('lib3mf_customxmlnode_addchild'); + FLib3MFCustomXMLNode_RemoveChildFunc := LoadFunction('lib3mf_customxmlnode_removechild'); + FLib3MFCustomXMLNode_RemoveChildrenWithNameFunc := LoadFunction('lib3mf_customxmlnode_removechildrenwithname'); + FLib3MFCustomXMLNode_RemoveFunc := LoadFunction('lib3mf_customxmlnode_remove'); + FLib3MFCustomXMLNodes_GetNodeCountFunc := LoadFunction('lib3mf_customxmlnodes_getnodecount'); + FLib3MFCustomXMLNodes_GetNodeFunc := LoadFunction('lib3mf_customxmlnodes_getnode'); + FLib3MFCustomXMLNodes_CountNodesByNameFunc := LoadFunction('lib3mf_customxmlnodes_countnodesbyname'); + FLib3MFCustomXMLNodes_GetNodesByNameFunc := LoadFunction('lib3mf_customxmlnodes_getnodesbyname'); + FLib3MFCustomXMLNodes_HasNodeFunc := LoadFunction('lib3mf_customxmlnodes_hasnode'); + FLib3MFCustomXMLNodes_HasUniqueNodeFunc := LoadFunction('lib3mf_customxmlnodes_hasuniquenode'); + FLib3MFCustomXMLNodes_FindNodeFunc := LoadFunction('lib3mf_customxmlnodes_findnode'); + FLib3MFCustomDOMTree_GetNameSpaceFunc := LoadFunction('lib3mf_customdomtree_getnamespace'); + FLib3MFCustomDOMTree_GetRootNodeFunc := LoadFunction('lib3mf_customdomtree_getrootnode'); + FLib3MFCustomDOMTree_SaveToStringFunc := LoadFunction('lib3mf_customdomtree_savetostring'); FLib3MFSliceStackIterator_GetCurrentSliceStackFunc := LoadFunction('lib3mf_slicestackiterator_getcurrentslicestack'); FLib3MFObjectIterator_GetCurrentObjectFunc := LoadFunction('lib3mf_objectiterator_getcurrentobject'); FLib3MFMeshObjectIterator_GetCurrentMeshObjectFunc := LoadFunction('lib3mf_meshobjectiterator_getcurrentmeshobject'); @@ -10549,6 +14258,78 @@ implementation FLib3MFSlice_GetPolygonIndicesFunc := LoadFunction('lib3mf_slice_getpolygonindices'); FLib3MFSlice_GetPolygonIndexCountFunc := LoadFunction('lib3mf_slice_getpolygonindexcount'); FLib3MFSlice_GetZTopFunc := LoadFunction('lib3mf_slice_getztop'); + FLib3MFToolpathProfile_GetUUIDFunc := LoadFunction('lib3mf_toolpathprofile_getuuid'); + FLib3MFToolpathProfile_GetNameFunc := LoadFunction('lib3mf_toolpathprofile_getname'); + FLib3MFToolpathProfile_GetParameterCountFunc := LoadFunction('lib3mf_toolpathprofile_getparametercount'); + FLib3MFToolpathProfile_GetParameterNameFunc := LoadFunction('lib3mf_toolpathprofile_getparametername'); + FLib3MFToolpathProfile_GetParameterNameSpaceFunc := LoadFunction('lib3mf_toolpathprofile_getparameternamespace'); + FLib3MFToolpathProfile_HasParameterValueFunc := LoadFunction('lib3mf_toolpathprofile_hasparametervalue'); + FLib3MFToolpathProfile_GetParameterValueFunc := LoadFunction('lib3mf_toolpathprofile_getparametervalue'); + FLib3MFToolpathProfile_GetParameterValueDefFunc := LoadFunction('lib3mf_toolpathprofile_getparametervaluedef'); + FLib3MFToolpathProfile_GetParameterDoubleValueFunc := LoadFunction('lib3mf_toolpathprofile_getparameterdoublevalue'); + FLib3MFToolpathProfile_GetParameterDoubleValueDefFunc := LoadFunction('lib3mf_toolpathprofile_getparameterdoublevaluedef'); + FLib3MFToolpathProfile_GetParameterIntegerValueFunc := LoadFunction('lib3mf_toolpathprofile_getparameterintegervalue'); + FLib3MFToolpathProfile_GetParameterIntegerValueDefFunc := LoadFunction('lib3mf_toolpathprofile_getparameterintegervaluedef'); + FLib3MFToolpathProfile_GetParameterBoolValueFunc := LoadFunction('lib3mf_toolpathprofile_getparameterboolvalue'); + FLib3MFToolpathProfile_GetParameterBoolValueDefFunc := LoadFunction('lib3mf_toolpathprofile_getparameterboolvaluedef'); + FLib3MFToolpathProfile_SetNameFunc := LoadFunction('lib3mf_toolpathprofile_setname'); + FLib3MFToolpathProfile_SetParameterValueFunc := LoadFunction('lib3mf_toolpathprofile_setparametervalue'); + FLib3MFToolpathProfile_SetParameterDoubleValueFunc := LoadFunction('lib3mf_toolpathprofile_setparameterdoublevalue'); + FLib3MFToolpathProfile_SetParameterIntegerValueFunc := LoadFunction('lib3mf_toolpathprofile_setparameterintegervalue'); + FLib3MFToolpathProfile_SetParameterBoolValueFunc := LoadFunction('lib3mf_toolpathprofile_setparameterboolvalue'); + FLib3MFToolpathLayerReader_GetLayerDataUUIDFunc := LoadFunction('lib3mf_toolpathlayerreader_getlayerdatauuid'); + FLib3MFToolpathLayerReader_GetSegmentCountFunc := LoadFunction('lib3mf_toolpathlayerreader_getsegmentcount'); + FLib3MFToolpathLayerReader_GetSegmentInfoFunc := LoadFunction('lib3mf_toolpathlayerreader_getsegmentinfo'); + FLib3MFToolpathLayerReader_GetSegmentProfileFunc := LoadFunction('lib3mf_toolpathlayerreader_getsegmentprofile'); + FLib3MFToolpathLayerReader_GetSegmentProfileUUIDFunc := LoadFunction('lib3mf_toolpathlayerreader_getsegmentprofileuuid'); + FLib3MFToolpathLayerReader_GetSegmentPartFunc := LoadFunction('lib3mf_toolpathlayerreader_getsegmentpart'); + FLib3MFToolpathLayerReader_GetSegmentPartUUIDFunc := LoadFunction('lib3mf_toolpathlayerreader_getsegmentpartuuid'); + FLib3MFToolpathLayerReader_GetSegmentLocalPartIDFunc := LoadFunction('lib3mf_toolpathlayerreader_getsegmentlocalpartid'); + FLib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDFunc := LoadFunction('lib3mf_toolpathlayerreader_getpartuuidbylocalpartid'); + FLib3MFToolpathLayerReader_GetSegmentPointDataFunc := LoadFunction('lib3mf_toolpathlayerreader_getsegmentpointdata'); + FLib3MFToolpathLayerReader_FindAttributeInfoByNameFunc := LoadFunction('lib3mf_toolpathlayerreader_findattributeinfobyname'); + FLib3MFToolpathLayerReader_FindAttributeIDByNameFunc := LoadFunction('lib3mf_toolpathlayerreader_findattributeidbyname'); + FLib3MFToolpathLayerReader_FindAttributeValueByNameFunc := LoadFunction('lib3mf_toolpathlayerreader_findattributevaluebyname'); + FLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByIDFunc := LoadFunction('lib3mf_toolpathlayerreader_getsegmentintegerattributebyid'); + FLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByNameFunc := LoadFunction('lib3mf_toolpathlayerreader_getsegmentintegerattributebyname'); + FLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByIDFunc := LoadFunction('lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid'); + FLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByNameFunc := LoadFunction('lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname'); + FLib3MFToolpathLayerReader_GetCustomDataCountFunc := LoadFunction('lib3mf_toolpathlayerreader_getcustomdatacount'); + FLib3MFToolpathLayerReader_GetCustomDataFunc := LoadFunction('lib3mf_toolpathlayerreader_getcustomdata'); + FLib3MFToolpathLayerReader_GetCustomDataNameFunc := LoadFunction('lib3mf_toolpathlayerreader_getcustomdataname'); + FLib3MFToolpathLayerData_GetLayerDataUUIDFunc := LoadFunction('lib3mf_toolpathlayerdata_getlayerdatauuid'); + FLib3MFToolpathLayerData_RegisterProfileFunc := LoadFunction('lib3mf_toolpathlayerdata_registerprofile'); + FLib3MFToolpathLayerData_RegisterBuildItemFunc := LoadFunction('lib3mf_toolpathlayerdata_registerbuilditem'); + FLib3MFToolpathLayerData_SetSegmentAttributeFunc := LoadFunction('lib3mf_toolpathlayerdata_setsegmentattribute'); + FLib3MFToolpathLayerData_ClearSegmentAttributesFunc := LoadFunction('lib3mf_toolpathlayerdata_clearsegmentattributes'); + FLib3MFToolpathLayerData_WriteHatchDataFunc := LoadFunction('lib3mf_toolpathlayerdata_writehatchdata'); + FLib3MFToolpathLayerData_WriteLoopFunc := LoadFunction('lib3mf_toolpathlayerdata_writeloop'); + FLib3MFToolpathLayerData_WritePolylineFunc := LoadFunction('lib3mf_toolpathlayerdata_writepolyline'); + FLib3MFToolpathLayerData_AddCustomDataFunc := LoadFunction('lib3mf_toolpathlayerdata_addcustomdata'); + FLib3MFToolpathLayerData_FinishFunc := LoadFunction('lib3mf_toolpathlayerdata_finish'); + FLib3MFToolpath_GetUnitsFunc := LoadFunction('lib3mf_toolpath_getunits'); + FLib3MFToolpath_GetLayerCountFunc := LoadFunction('lib3mf_toolpath_getlayercount'); + FLib3MFToolpath_GetProfileCountFunc := LoadFunction('lib3mf_toolpath_getprofilecount'); + FLib3MFToolpath_AddLayerFunc := LoadFunction('lib3mf_toolpath_addlayer'); + FLib3MFToolpath_GetLayerAttachmentFunc := LoadFunction('lib3mf_toolpath_getlayerattachment'); + FLib3MFToolpath_ReadLayerDataFunc := LoadFunction('lib3mf_toolpath_readlayerdata'); + FLib3MFToolpath_GetLayerPathFunc := LoadFunction('lib3mf_toolpath_getlayerpath'); + FLib3MFToolpath_GetLayerZMaxFunc := LoadFunction('lib3mf_toolpath_getlayerzmax'); + FLib3MFToolpath_GetLayerZFunc := LoadFunction('lib3mf_toolpath_getlayerz'); + FLib3MFToolpath_AddProfileFunc := LoadFunction('lib3mf_toolpath_addprofile'); + FLib3MFToolpath_GetProfileFunc := LoadFunction('lib3mf_toolpath_getprofile'); + FLib3MFToolpath_GetProfileUUIDFunc := LoadFunction('lib3mf_toolpath_getprofileuuid'); + FLib3MFToolpath_GetCustomDataCountFunc := LoadFunction('lib3mf_toolpath_getcustomdatacount'); + FLib3MFToolpath_GetCustomDataFunc := LoadFunction('lib3mf_toolpath_getcustomdata'); + FLib3MFToolpath_GetCustomDataNameFunc := LoadFunction('lib3mf_toolpath_getcustomdataname'); + FLib3MFToolpath_HasUniqueCustomDataFunc := LoadFunction('lib3mf_toolpath_hasuniquecustomdata'); + FLib3MFToolpath_FindUniqueCustomDataFunc := LoadFunction('lib3mf_toolpath_finduniquecustomdata'); + FLib3MFToolpath_AddCustomDataFunc := LoadFunction('lib3mf_toolpath_addcustomdata'); + FLib3MFToolpath_ClearCustomDataFunc := LoadFunction('lib3mf_toolpath_clearcustomdata'); + FLib3MFToolpath_DeleteCustomDataFunc := LoadFunction('lib3mf_toolpath_deletecustomdata'); + FLib3MFToolpath_RegisterCustomIntegerAttributeFunc := LoadFunction('lib3mf_toolpath_registercustomintegerattribute'); + FLib3MFToolpath_RegisterCustomDoubleAttributeFunc := LoadFunction('lib3mf_toolpath_registercustomdoubleattribute'); + FLib3MFToolpathIterator_GetCurrentToolpathFunc := LoadFunction('lib3mf_toolpathiterator_getcurrenttoolpath'); FLib3MFSliceStack_GetBottomZFunc := LoadFunction('lib3mf_slicestack_getbottomz'); FLib3MFSliceStack_GetSliceCountFunc := LoadFunction('lib3mf_slicestack_getslicecount'); FLib3MFSliceStack_GetSliceFunc := LoadFunction('lib3mf_slicestack_getslice'); @@ -10632,6 +14413,7 @@ implementation FLib3MFModel_GetTexture2DGroupsFunc := LoadFunction('lib3mf_model_gettexture2dgroups'); FLib3MFModel_GetCompositeMaterialsFunc := LoadFunction('lib3mf_model_getcompositematerials'); FLib3MFModel_GetMultiPropertyGroupsFunc := LoadFunction('lib3mf_model_getmultipropertygroups'); + FLib3MFModel_GetToolpathsFunc := LoadFunction('lib3mf_model_gettoolpaths'); FLib3MFModel_GetSliceStacksFunc := LoadFunction('lib3mf_model_getslicestacks'); FLib3MFModel_MergeToModelFunc := LoadFunction('lib3mf_model_mergetomodel'); FLib3MFModel_AddMeshObjectFunc := LoadFunction('lib3mf_model_addmeshobject'); @@ -10645,6 +14427,7 @@ implementation FLib3MFModel_AddMultiPropertyGroupFunc := LoadFunction('lib3mf_model_addmultipropertygroup'); FLib3MFModel_AddBuildItemFunc := LoadFunction('lib3mf_model_addbuilditem'); FLib3MFModel_RemoveBuildItemFunc := LoadFunction('lib3mf_model_removebuilditem'); + FLib3MFModel_AddToolpathFunc := LoadFunction('lib3mf_model_addtoolpath'); FLib3MFModel_GetMetaDataGroupFunc := LoadFunction('lib3mf_model_getmetadatagroup'); FLib3MFModel_AddAttachmentFunc := LoadFunction('lib3mf_model_addattachment'); FLib3MFModel_RemoveAttachmentFunc := LoadFunction('lib3mf_model_removeattachment'); @@ -10659,6 +14442,9 @@ implementation FLib3MFModel_RemoveCustomContentTypeFunc := LoadFunction('lib3mf_model_removecustomcontenttype'); FLib3MFModel_SetRandomNumberCallbackFunc := LoadFunction('lib3mf_model_setrandomnumbercallback'); FLib3MFModel_GetKeyStoreFunc := LoadFunction('lib3mf_model_getkeystore'); + FLib3MFModel_CreatePersistentSourceFromFileFunc := LoadFunction('lib3mf_model_createpersistentsourcefromfile'); + FLib3MFModel_CreatePersistentSourceFromBufferFunc := LoadFunction('lib3mf_model_createpersistentsourcefrombuffer'); + FLib3MFModel_CreatePersistentSourceFromCallbackFunc := LoadFunction('lib3mf_model_createpersistentsourcefromcallback'); FLib3MFGetLibraryVersionFunc := LoadFunction('lib3mf_getlibraryversion'); FLib3MFGetPrereleaseInformationFunc := LoadFunction('lib3mf_getprereleaseinformation'); FLib3MFGetBuildInformationFunc := LoadFunction('lib3mf_getbuildinformation'); @@ -10690,6 +14476,27 @@ implementation AResult := ALookupMethod(PAnsiChar('lib3mf_base_classtypeid'), @FLib3MFBase_ClassTypeIdFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_binarystream_getbinarypath'), @FLib3MFBinaryStream_GetBinaryPathFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_binarystream_getindexpath'), @FLib3MFBinaryStream_GetIndexPathFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_binarystream_getuuid'), @FLib3MFBinaryStream_GetUUIDFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_binarystream_disablediscretizedarraycompression'), @FLib3MFBinaryStream_DisableDiscretizedArrayCompressionFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_binarystream_enablediscretizedarraycompression'), @FLib3MFBinaryStream_EnableDiscretizedArrayCompressionFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_binarystream_enablelzma'), @FLib3MFBinaryStream_EnableLZMAFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_binarystream_disablelzma'), @FLib3MFBinaryStream_DisableLZMAFunc); if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_writer_writetofile'), @FLib3MFWriter_WriteToFileFunc); @@ -10704,31 +14511,52 @@ implementation AResult := ALookupMethod(PAnsiChar('lib3mf_writer_writetocallback'), @FLib3MFWriter_WriteToCallbackFunc); if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); - AResult := ALookupMethod(PAnsiChar('lib3mf_writer_setprogresscallback'), @FLib3MFWriter_SetProgressCallbackFunc); + AResult := ALookupMethod(PAnsiChar('lib3mf_writer_setprogresscallback'), @FLib3MFWriter_SetProgressCallbackFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_writer_getdecimalprecision'), @FLib3MFWriter_GetDecimalPrecisionFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_writer_setdecimalprecision'), @FLib3MFWriter_SetDecimalPrecisionFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_writer_setstrictmodeactive'), @FLib3MFWriter_SetStrictModeActiveFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_writer_getstrictmodeactive'), @FLib3MFWriter_GetStrictModeActiveFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_writer_getwarning'), @FLib3MFWriter_GetWarningFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_writer_getwarningcount'), @FLib3MFWriter_GetWarningCountFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_writer_addkeywrappingcallback'), @FLib3MFWriter_AddKeyWrappingCallbackFunc); if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); - AResult := ALookupMethod(PAnsiChar('lib3mf_writer_getdecimalprecision'), @FLib3MFWriter_GetDecimalPrecisionFunc); + AResult := ALookupMethod(PAnsiChar('lib3mf_writer_setcontentencryptioncallback'), @FLib3MFWriter_SetContentEncryptionCallbackFunc); if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); - AResult := ALookupMethod(PAnsiChar('lib3mf_writer_setdecimalprecision'), @FLib3MFWriter_SetDecimalPrecisionFunc); + AResult := ALookupMethod(PAnsiChar('lib3mf_writer_createbinarystream'), @FLib3MFWriter_CreateBinaryStreamFunc); if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); - AResult := ALookupMethod(PAnsiChar('lib3mf_writer_setstrictmodeactive'), @FLib3MFWriter_SetStrictModeActiveFunc); + AResult := ALookupMethod(PAnsiChar('lib3mf_writer_assignbinarystream'), @FLib3MFWriter_AssignBinaryStreamFunc); if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); - AResult := ALookupMethod(PAnsiChar('lib3mf_writer_getstrictmodeactive'), @FLib3MFWriter_GetStrictModeActiveFunc); + AResult := ALookupMethod(PAnsiChar('lib3mf_writer_registercustomnamespace'), @FLib3MFWriter_RegisterCustomNamespaceFunc); if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); - AResult := ALookupMethod(PAnsiChar('lib3mf_writer_getwarning'), @FLib3MFWriter_GetWarningFunc); + AResult := ALookupMethod(PAnsiChar('lib3mf_persistentreadersource_getsourcetype'), @FLib3MFPersistentReaderSource_GetSourceTypeFunc); if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); - AResult := ALookupMethod(PAnsiChar('lib3mf_writer_getwarningcount'), @FLib3MFWriter_GetWarningCountFunc); + AResult := ALookupMethod(PAnsiChar('lib3mf_persistentreadersource_invalidatesourcedata'), @FLib3MFPersistentReaderSource_InvalidateSourceDataFunc); if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); - AResult := ALookupMethod(PAnsiChar('lib3mf_writer_addkeywrappingcallback'), @FLib3MFWriter_AddKeyWrappingCallbackFunc); + AResult := ALookupMethod(PAnsiChar('lib3mf_persistentreadersource_sourcedataisvalid'), @FLib3MFPersistentReaderSource_SourceDataIsValidFunc); if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); - AResult := ALookupMethod(PAnsiChar('lib3mf_writer_setcontentencryptioncallback'), @FLib3MFWriter_SetContentEncryptionCallbackFunc); + AResult := ALookupMethod(PAnsiChar('lib3mf_reader_readfrompersistentsource'), @FLib3MFReader_ReadFromPersistentSourceFunc); if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_reader_readfromfile'), @FLib3MFReader_ReadFromFileFunc); @@ -10801,6 +14629,141 @@ implementation if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_resourceiterator_count'), @FLib3MFResourceIterator_CountFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlattribute_getname'), @FLib3MFCustomXMLAttribute_GetNameFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlattribute_getvalue'), @FLib3MFCustomXMLAttribute_GetValueFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlattribute_isvalidinteger'), @FLib3MFCustomXMLAttribute_IsValidIntegerFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlattribute_getintegervalue'), @FLib3MFCustomXMLAttribute_GetIntegerValueFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlattribute_isvaliddouble'), @FLib3MFCustomXMLAttribute_IsValidDoubleFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlattribute_getdoublevalue'), @FLib3MFCustomXMLAttribute_GetDoubleValueFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlattribute_isvalidbool'), @FLib3MFCustomXMLAttribute_IsValidBoolFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlattribute_getboolvalue'), @FLib3MFCustomXMLAttribute_GetBoolValueFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlattribute_setvalue'), @FLib3MFCustomXMLAttribute_SetValueFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlattribute_setintegervalue'), @FLib3MFCustomXMLAttribute_SetIntegerValueFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlattribute_setdoublevalue'), @FLib3MFCustomXMLAttribute_SetDoubleValueFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlattribute_setboolvalue'), @FLib3MFCustomXMLAttribute_SetBoolValueFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlattribute_remove'), @FLib3MFCustomXMLAttribute_RemoveFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnode_getname'), @FLib3MFCustomXMLNode_GetNameFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnode_getnamespace'), @FLib3MFCustomXMLNode_GetNameSpaceFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnode_getattributecount'), @FLib3MFCustomXMLNode_GetAttributeCountFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnode_getattribute'), @FLib3MFCustomXMLNode_GetAttributeFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnode_hasattribute'), @FLib3MFCustomXMLNode_HasAttributeFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnode_findattribute'), @FLib3MFCustomXMLNode_FindAttributeFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnode_removeattribute'), @FLib3MFCustomXMLNode_RemoveAttributeFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnode_removeattributebyindex'), @FLib3MFCustomXMLNode_RemoveAttributeByIndexFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnode_addattribute'), @FLib3MFCustomXMLNode_AddAttributeFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnode_addintegerattribute'), @FLib3MFCustomXMLNode_AddIntegerAttributeFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnode_adddoubleattribute'), @FLib3MFCustomXMLNode_AddDoubleAttributeFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnode_addboolattribute'), @FLib3MFCustomXMLNode_AddBoolAttributeFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnode_getchildren'), @FLib3MFCustomXMLNode_GetChildrenFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnode_countchildrenbyname'), @FLib3MFCustomXMLNode_CountChildrenByNameFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnode_getchildrenbyname'), @FLib3MFCustomXMLNode_GetChildrenByNameFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnode_haschild'), @FLib3MFCustomXMLNode_HasChildFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnode_hasuniquechild'), @FLib3MFCustomXMLNode_HasUniqueChildFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnode_findchild'), @FLib3MFCustomXMLNode_FindChildFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnode_addchild'), @FLib3MFCustomXMLNode_AddChildFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnode_removechild'), @FLib3MFCustomXMLNode_RemoveChildFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnode_removechildrenwithname'), @FLib3MFCustomXMLNode_RemoveChildrenWithNameFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnode_remove'), @FLib3MFCustomXMLNode_RemoveFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnodes_getnodecount'), @FLib3MFCustomXMLNodes_GetNodeCountFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnodes_getnode'), @FLib3MFCustomXMLNodes_GetNodeFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnodes_countnodesbyname'), @FLib3MFCustomXMLNodes_CountNodesByNameFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnodes_getnodesbyname'), @FLib3MFCustomXMLNodes_GetNodesByNameFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnodes_hasnode'), @FLib3MFCustomXMLNodes_HasNodeFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnodes_hasuniquenode'), @FLib3MFCustomXMLNodes_HasUniqueNodeFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customxmlnodes_findnode'), @FLib3MFCustomXMLNodes_FindNodeFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customdomtree_getnamespace'), @FLib3MFCustomDOMTree_GetNameSpaceFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customdomtree_getrootnode'), @FLib3MFCustomDOMTree_GetRootNodeFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_customdomtree_savetostring'), @FLib3MFCustomDOMTree_SaveToStringFunc); if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_slicestackiterator_getcurrentslicestack'), @FLib3MFSliceStackIterator_GetCurrentSliceStackFunc); @@ -11377,6 +15340,222 @@ implementation if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_slice_getztop'), @FLib3MFSlice_GetZTopFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathprofile_getuuid'), @FLib3MFToolpathProfile_GetUUIDFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathprofile_getname'), @FLib3MFToolpathProfile_GetNameFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathprofile_getparametercount'), @FLib3MFToolpathProfile_GetParameterCountFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathprofile_getparametername'), @FLib3MFToolpathProfile_GetParameterNameFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathprofile_getparameternamespace'), @FLib3MFToolpathProfile_GetParameterNameSpaceFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathprofile_hasparametervalue'), @FLib3MFToolpathProfile_HasParameterValueFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathprofile_getparametervalue'), @FLib3MFToolpathProfile_GetParameterValueFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathprofile_getparametervaluedef'), @FLib3MFToolpathProfile_GetParameterValueDefFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathprofile_getparameterdoublevalue'), @FLib3MFToolpathProfile_GetParameterDoubleValueFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathprofile_getparameterdoublevaluedef'), @FLib3MFToolpathProfile_GetParameterDoubleValueDefFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathprofile_getparameterintegervalue'), @FLib3MFToolpathProfile_GetParameterIntegerValueFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathprofile_getparameterintegervaluedef'), @FLib3MFToolpathProfile_GetParameterIntegerValueDefFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathprofile_getparameterboolvalue'), @FLib3MFToolpathProfile_GetParameterBoolValueFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathprofile_getparameterboolvaluedef'), @FLib3MFToolpathProfile_GetParameterBoolValueDefFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathprofile_setname'), @FLib3MFToolpathProfile_SetNameFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathprofile_setparametervalue'), @FLib3MFToolpathProfile_SetParameterValueFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathprofile_setparameterdoublevalue'), @FLib3MFToolpathProfile_SetParameterDoubleValueFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathprofile_setparameterintegervalue'), @FLib3MFToolpathProfile_SetParameterIntegerValueFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathprofile_setparameterboolvalue'), @FLib3MFToolpathProfile_SetParameterBoolValueFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerreader_getlayerdatauuid'), @FLib3MFToolpathLayerReader_GetLayerDataUUIDFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerreader_getsegmentcount'), @FLib3MFToolpathLayerReader_GetSegmentCountFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerreader_getsegmentinfo'), @FLib3MFToolpathLayerReader_GetSegmentInfoFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerreader_getsegmentprofile'), @FLib3MFToolpathLayerReader_GetSegmentProfileFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerreader_getsegmentprofileuuid'), @FLib3MFToolpathLayerReader_GetSegmentProfileUUIDFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerreader_getsegmentpart'), @FLib3MFToolpathLayerReader_GetSegmentPartFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerreader_getsegmentpartuuid'), @FLib3MFToolpathLayerReader_GetSegmentPartUUIDFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerreader_getsegmentlocalpartid'), @FLib3MFToolpathLayerReader_GetSegmentLocalPartIDFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerreader_getpartuuidbylocalpartid'), @FLib3MFToolpathLayerReader_GetPartUUIDByLocalPartIDFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerreader_getsegmentpointdata'), @FLib3MFToolpathLayerReader_GetSegmentPointDataFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerreader_findattributeinfobyname'), @FLib3MFToolpathLayerReader_FindAttributeInfoByNameFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerreader_findattributeidbyname'), @FLib3MFToolpathLayerReader_FindAttributeIDByNameFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerreader_findattributevaluebyname'), @FLib3MFToolpathLayerReader_FindAttributeValueByNameFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerreader_getsegmentintegerattributebyid'), @FLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByIDFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerreader_getsegmentintegerattributebyname'), @FLib3MFToolpathLayerReader_GetSegmentIntegerAttributeByNameFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid'), @FLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByIDFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname'), @FLib3MFToolpathLayerReader_GetSegmentDoubleAttributeByNameFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerreader_getcustomdatacount'), @FLib3MFToolpathLayerReader_GetCustomDataCountFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerreader_getcustomdata'), @FLib3MFToolpathLayerReader_GetCustomDataFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerreader_getcustomdataname'), @FLib3MFToolpathLayerReader_GetCustomDataNameFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerdata_getlayerdatauuid'), @FLib3MFToolpathLayerData_GetLayerDataUUIDFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerdata_registerprofile'), @FLib3MFToolpathLayerData_RegisterProfileFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerdata_registerbuilditem'), @FLib3MFToolpathLayerData_RegisterBuildItemFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerdata_setsegmentattribute'), @FLib3MFToolpathLayerData_SetSegmentAttributeFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerdata_clearsegmentattributes'), @FLib3MFToolpathLayerData_ClearSegmentAttributesFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerdata_writehatchdata'), @FLib3MFToolpathLayerData_WriteHatchDataFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerdata_writeloop'), @FLib3MFToolpathLayerData_WriteLoopFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerdata_writepolyline'), @FLib3MFToolpathLayerData_WritePolylineFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerdata_addcustomdata'), @FLib3MFToolpathLayerData_AddCustomDataFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathlayerdata_finish'), @FLib3MFToolpathLayerData_FinishFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpath_getunits'), @FLib3MFToolpath_GetUnitsFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpath_getlayercount'), @FLib3MFToolpath_GetLayerCountFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpath_getprofilecount'), @FLib3MFToolpath_GetProfileCountFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpath_addlayer'), @FLib3MFToolpath_AddLayerFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpath_getlayerattachment'), @FLib3MFToolpath_GetLayerAttachmentFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpath_readlayerdata'), @FLib3MFToolpath_ReadLayerDataFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpath_getlayerpath'), @FLib3MFToolpath_GetLayerPathFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpath_getlayerzmax'), @FLib3MFToolpath_GetLayerZMaxFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpath_getlayerz'), @FLib3MFToolpath_GetLayerZFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpath_addprofile'), @FLib3MFToolpath_AddProfileFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpath_getprofile'), @FLib3MFToolpath_GetProfileFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpath_getprofileuuid'), @FLib3MFToolpath_GetProfileUUIDFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpath_getcustomdatacount'), @FLib3MFToolpath_GetCustomDataCountFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpath_getcustomdata'), @FLib3MFToolpath_GetCustomDataFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpath_getcustomdataname'), @FLib3MFToolpath_GetCustomDataNameFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpath_hasuniquecustomdata'), @FLib3MFToolpath_HasUniqueCustomDataFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpath_finduniquecustomdata'), @FLib3MFToolpath_FindUniqueCustomDataFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpath_addcustomdata'), @FLib3MFToolpath_AddCustomDataFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpath_clearcustomdata'), @FLib3MFToolpath_ClearCustomDataFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpath_deletecustomdata'), @FLib3MFToolpath_DeleteCustomDataFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpath_registercustomintegerattribute'), @FLib3MFToolpath_RegisterCustomIntegerAttributeFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpath_registercustomdoubleattribute'), @FLib3MFToolpath_RegisterCustomDoubleAttributeFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_toolpathiterator_getcurrenttoolpath'), @FLib3MFToolpathIterator_GetCurrentToolpathFunc); if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_slicestack_getbottomz'), @FLib3MFSliceStack_GetBottomZFunc); @@ -11626,6 +15805,9 @@ implementation if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_model_getmultipropertygroups'), @FLib3MFModel_GetMultiPropertyGroupsFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_model_gettoolpaths'), @FLib3MFModel_GetToolpathsFunc); if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_model_getslicestacks'), @FLib3MFModel_GetSliceStacksFunc); @@ -11665,6 +15847,9 @@ implementation if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_model_removebuilditem'), @FLib3MFModel_RemoveBuildItemFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_model_addtoolpath'), @FLib3MFModel_AddToolpathFunc); if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_model_getmetadatagroup'), @FLib3MFModel_GetMetaDataGroupFunc); @@ -11707,6 +15892,15 @@ implementation if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_model_getkeystore'), @FLib3MFModel_GetKeyStoreFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_model_createpersistentsourcefromfile'), @FLib3MFModel_CreatePersistentSourceFromFileFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_model_createpersistentsourcefrombuffer'), @FLib3MFModel_CreatePersistentSourceFromBufferFunc); + if AResult <> LIB3MF_SUCCESS then + raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); + AResult := ALookupMethod(PAnsiChar('lib3mf_model_createpersistentsourcefromcallback'), @FLib3MFModel_CreatePersistentSourceFromCallbackFunc); if AResult <> LIB3MF_SUCCESS then raise ELib3MFException.CreateCustomMessage(LIB3MF_ERROR_COULDNOTLOADLIBRARY, ''); AResult := ALookupMethod(PAnsiChar('lib3mf_getlibraryversion'), @FLib3MFGetLibraryVersionFunc); diff --git a/Autogenerated/Bindings/Python/Lib3MF.py b/Autogenerated/Bindings/Python/Lib3MF.py index 1b5e6d2fd..870a17a6b 100644 --- a/Autogenerated/Bindings/Python/Lib3MF.py +++ b/Autogenerated/Bindings/Python/Lib3MF.py @@ -100,6 +100,10 @@ class ErrorCodes(enum.IntEnum): UNKOWNPROGRESSIDENTIFIER = 140 ELEMENTCOUNTEXCEEDSLIMIT = 141 INVALIDRESOURCE = 142 + INVALIDNODEINDEX = 143 + INVALIDATTRIBUTEINDEX = 144 + DUPLICATECUSTOMDATA = 145 + CUSTOMDATANOTFOUND = 146 BEAMLATTICE_INVALID_OBJECTTYPE = 2000 INVALIDKEYSTORE = 3000 INVALIDKEYSTORECONSUMER = 3001 @@ -107,6 +111,16 @@ class ErrorCodes(enum.IntEnum): KEYSTORERESOURCEDATANOTFOUND = 3003 SECURECONTEXTNOTREGISTERED = 3004 INVALIDKEYSIZE = 3005 + TOOLPATH_NOTWRITINGHEADER = 4000 + TOOLPATH_NOTWRITINGDATA = 4001 + TOOLPATH_DATAHASBEENWRITTEN = 4002 + TOOLPATH_INVALIDPOINTCOUNT = 4003 + TOOLPATH_ATTRIBUTEALREADYDEFINED = 4004 + TOOLPATH_INVALIDATTRIBUTETYPE = 4005 + EMPTYNAMESPACEPREFIX = 4006 + EMPTYNAMESPACE = 4007 + INVALIDNAMESPACEPREFIX = 4008 + WRITERDOESNOTSUPPORTNAMESPACES = 4009 '''Definition of Function Table ''' @@ -131,6 +145,13 @@ class FunctionTable: lib3mf_getscaletransform = None lib3mf_gettranslationtransform = None lib3mf_base_classtypeid = None + lib3mf_binarystream_getbinarypath = None + lib3mf_binarystream_getindexpath = None + lib3mf_binarystream_getuuid = None + lib3mf_binarystream_disablediscretizedarraycompression = None + lib3mf_binarystream_enablediscretizedarraycompression = None + lib3mf_binarystream_enablelzma = None + lib3mf_binarystream_disablelzma = None lib3mf_writer_writetofile = None lib3mf_writer_getstreamsize = None lib3mf_writer_writetobuffer = None @@ -144,6 +165,13 @@ class FunctionTable: lib3mf_writer_getwarningcount = None lib3mf_writer_addkeywrappingcallback = None lib3mf_writer_setcontentencryptioncallback = None + lib3mf_writer_createbinarystream = None + lib3mf_writer_assignbinarystream = None + lib3mf_writer_registercustomnamespace = None + lib3mf_persistentreadersource_getsourcetype = None + lib3mf_persistentreadersource_invalidatesourcedata = None + lib3mf_persistentreadersource_sourcedataisvalid = None + lib3mf_reader_readfrompersistentsource = None lib3mf_reader_readfromfile = None lib3mf_reader_readfrombuffer = None lib3mf_reader_readfromcallback = None @@ -168,6 +196,51 @@ class FunctionTable: lib3mf_resourceiterator_getcurrent = None lib3mf_resourceiterator_clone = None lib3mf_resourceiterator_count = None + lib3mf_customxmlattribute_getname = None + lib3mf_customxmlattribute_getvalue = None + lib3mf_customxmlattribute_isvalidinteger = None + lib3mf_customxmlattribute_getintegervalue = None + lib3mf_customxmlattribute_isvaliddouble = None + lib3mf_customxmlattribute_getdoublevalue = None + lib3mf_customxmlattribute_isvalidbool = None + lib3mf_customxmlattribute_getboolvalue = None + lib3mf_customxmlattribute_setvalue = None + lib3mf_customxmlattribute_setintegervalue = None + lib3mf_customxmlattribute_setdoublevalue = None + lib3mf_customxmlattribute_setboolvalue = None + lib3mf_customxmlattribute_remove = None + lib3mf_customxmlnode_getname = None + lib3mf_customxmlnode_getnamespace = None + lib3mf_customxmlnode_getattributecount = None + lib3mf_customxmlnode_getattribute = None + lib3mf_customxmlnode_hasattribute = None + lib3mf_customxmlnode_findattribute = None + lib3mf_customxmlnode_removeattribute = None + lib3mf_customxmlnode_removeattributebyindex = None + lib3mf_customxmlnode_addattribute = None + lib3mf_customxmlnode_addintegerattribute = None + lib3mf_customxmlnode_adddoubleattribute = None + lib3mf_customxmlnode_addboolattribute = None + lib3mf_customxmlnode_getchildren = None + lib3mf_customxmlnode_countchildrenbyname = None + lib3mf_customxmlnode_getchildrenbyname = None + lib3mf_customxmlnode_haschild = None + lib3mf_customxmlnode_hasuniquechild = None + lib3mf_customxmlnode_findchild = None + lib3mf_customxmlnode_addchild = None + lib3mf_customxmlnode_removechild = None + lib3mf_customxmlnode_removechildrenwithname = None + lib3mf_customxmlnode_remove = None + lib3mf_customxmlnodes_getnodecount = None + lib3mf_customxmlnodes_getnode = None + lib3mf_customxmlnodes_countnodesbyname = None + lib3mf_customxmlnodes_getnodesbyname = None + lib3mf_customxmlnodes_hasnode = None + lib3mf_customxmlnodes_hasuniquenode = None + lib3mf_customxmlnodes_findnode = None + lib3mf_customdomtree_getnamespace = None + lib3mf_customdomtree_getrootnode = None + lib3mf_customdomtree_savetostring = None lib3mf_slicestackiterator_getcurrentslicestack = None lib3mf_objectiterator_getcurrentobject = None lib3mf_meshobjectiterator_getcurrentmeshobject = None @@ -360,6 +433,78 @@ class FunctionTable: lib3mf_slice_getpolygonindices = None lib3mf_slice_getpolygonindexcount = None lib3mf_slice_getztop = None + lib3mf_toolpathprofile_getuuid = None + lib3mf_toolpathprofile_getname = None + lib3mf_toolpathprofile_getparametercount = None + lib3mf_toolpathprofile_getparametername = None + lib3mf_toolpathprofile_getparameternamespace = None + lib3mf_toolpathprofile_hasparametervalue = None + lib3mf_toolpathprofile_getparametervalue = None + lib3mf_toolpathprofile_getparametervaluedef = None + lib3mf_toolpathprofile_getparameterdoublevalue = None + lib3mf_toolpathprofile_getparameterdoublevaluedef = None + lib3mf_toolpathprofile_getparameterintegervalue = None + lib3mf_toolpathprofile_getparameterintegervaluedef = None + lib3mf_toolpathprofile_getparameterboolvalue = None + lib3mf_toolpathprofile_getparameterboolvaluedef = None + lib3mf_toolpathprofile_setname = None + lib3mf_toolpathprofile_setparametervalue = None + lib3mf_toolpathprofile_setparameterdoublevalue = None + lib3mf_toolpathprofile_setparameterintegervalue = None + lib3mf_toolpathprofile_setparameterboolvalue = None + lib3mf_toolpathlayerreader_getlayerdatauuid = None + lib3mf_toolpathlayerreader_getsegmentcount = None + lib3mf_toolpathlayerreader_getsegmentinfo = None + lib3mf_toolpathlayerreader_getsegmentprofile = None + lib3mf_toolpathlayerreader_getsegmentprofileuuid = None + lib3mf_toolpathlayerreader_getsegmentpart = None + lib3mf_toolpathlayerreader_getsegmentpartuuid = None + lib3mf_toolpathlayerreader_getsegmentlocalpartid = None + lib3mf_toolpathlayerreader_getpartuuidbylocalpartid = None + lib3mf_toolpathlayerreader_getsegmentpointdata = None + lib3mf_toolpathlayerreader_findattributeinfobyname = None + lib3mf_toolpathlayerreader_findattributeidbyname = None + lib3mf_toolpathlayerreader_findattributevaluebyname = None + lib3mf_toolpathlayerreader_getsegmentintegerattributebyid = None + lib3mf_toolpathlayerreader_getsegmentintegerattributebyname = None + lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid = None + lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname = None + lib3mf_toolpathlayerreader_getcustomdatacount = None + lib3mf_toolpathlayerreader_getcustomdata = None + lib3mf_toolpathlayerreader_getcustomdataname = None + lib3mf_toolpathlayerdata_getlayerdatauuid = None + lib3mf_toolpathlayerdata_registerprofile = None + lib3mf_toolpathlayerdata_registerbuilditem = None + lib3mf_toolpathlayerdata_setsegmentattribute = None + lib3mf_toolpathlayerdata_clearsegmentattributes = None + lib3mf_toolpathlayerdata_writehatchdata = None + lib3mf_toolpathlayerdata_writeloop = None + lib3mf_toolpathlayerdata_writepolyline = None + lib3mf_toolpathlayerdata_addcustomdata = None + lib3mf_toolpathlayerdata_finish = None + lib3mf_toolpath_getunits = None + lib3mf_toolpath_getlayercount = None + lib3mf_toolpath_getprofilecount = None + lib3mf_toolpath_addlayer = None + lib3mf_toolpath_getlayerattachment = None + lib3mf_toolpath_readlayerdata = None + lib3mf_toolpath_getlayerpath = None + lib3mf_toolpath_getlayerzmax = None + lib3mf_toolpath_getlayerz = None + lib3mf_toolpath_addprofile = None + lib3mf_toolpath_getprofile = None + lib3mf_toolpath_getprofileuuid = None + lib3mf_toolpath_getcustomdatacount = None + lib3mf_toolpath_getcustomdata = None + lib3mf_toolpath_getcustomdataname = None + lib3mf_toolpath_hasuniquecustomdata = None + lib3mf_toolpath_finduniquecustomdata = None + lib3mf_toolpath_addcustomdata = None + lib3mf_toolpath_clearcustomdata = None + lib3mf_toolpath_deletecustomdata = None + lib3mf_toolpath_registercustomintegerattribute = None + lib3mf_toolpath_registercustomdoubleattribute = None + lib3mf_toolpathiterator_getcurrenttoolpath = None lib3mf_slicestack_getbottomz = None lib3mf_slicestack_getslicecount = None lib3mf_slicestack_getslice = None @@ -443,6 +588,7 @@ class FunctionTable: lib3mf_model_gettexture2dgroups = None lib3mf_model_getcompositematerials = None lib3mf_model_getmultipropertygroups = None + lib3mf_model_gettoolpaths = None lib3mf_model_getslicestacks = None lib3mf_model_mergetomodel = None lib3mf_model_addmeshobject = None @@ -456,6 +602,7 @@ class FunctionTable: lib3mf_model_addmultipropertygroup = None lib3mf_model_addbuilditem = None lib3mf_model_removebuilditem = None + lib3mf_model_addtoolpath = None lib3mf_model_getmetadatagroup = None lib3mf_model_addattachment = None lib3mf_model_removeattachment = None @@ -470,6 +617,9 @@ class FunctionTable: lib3mf_model_removecustomcontenttype = None lib3mf_model_setrandomnumbercallback = None lib3mf_model_getkeystore = None + lib3mf_model_createpersistentsourcefromfile = None + lib3mf_model_createpersistentsourcefrombuffer = None + lib3mf_model_createpersistentsourcefromcallback = None '''Definition of Enumerations ''' @@ -494,6 +644,13 @@ class PropertyType(CTypesEnum): class SlicesMeshResolution(CTypesEnum): Fullres = 0 Lowres = 1 +'''Definition of PersistentReaderSourceType +''' +class PersistentReaderSourceType(CTypesEnum): + Unknown = 0 + FileOnDisk = 1 + MemoryBuffer = 2 + Callback = 3 '''Definition of ModelUnit ''' class ModelUnit(CTypesEnum): @@ -547,6 +704,11 @@ class BeamLatticeBallMode(CTypesEnum): BeamLatticeBallModeNone = 0 Mixed = 1 All = 2 +'''Definition of BinaryStreamPredictionType +''' +class BinaryStreamPredictionType(CTypesEnum): + NoPrediction = 0 + DeltaPrediction = 1 '''Definition of ProgressIdentifier ''' class ProgressIdentifier(CTypesEnum): @@ -580,6 +742,19 @@ class BlendMethod(CTypesEnum): NoBlendMethod = 0 Mix = 1 Multiply = 2 +'''Definition of ToolpathSegmentType +''' +class ToolpathSegmentType(CTypesEnum): + Unknown = 0 + Hatch = 1 + Loop = 2 + Polyline = 3 +'''Definition of ToolpathAttributeType +''' +class ToolpathAttributeType(CTypesEnum): + Unknown = 0 + Integer = 1 + Double = 2 '''Definition of EncryptionAlgorithm ''' class EncryptionAlgorithm(CTypesEnum): @@ -898,6 +1073,48 @@ def _loadFunctionTableFromMethod(self, symbolLookupMethodAddress): methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)) self.lib.lib3mf_base_classtypeid = methodType(int(methodAddress.value)) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_binarystream_getbinarypath")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_binarystream_getbinarypath = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_binarystream_getindexpath")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_binarystream_getindexpath = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_binarystream_getuuid")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_binarystream_getuuid = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_binarystream_disablediscretizedarraycompression")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p) + self.lib.lib3mf_binarystream_disablediscretizedarraycompression = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_binarystream_enablediscretizedarraycompression")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_double, BinaryStreamPredictionType) + self.lib.lib3mf_binarystream_enablediscretizedarraycompression = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_binarystream_enablelzma")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32) + self.lib.lib3mf_binarystream_enablelzma = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_binarystream_disablelzma")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p) + self.lib.lib3mf_binarystream_disablelzma = methodType(int(methodAddress.value)) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_writer_writetofile")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) @@ -976,6 +1193,48 @@ def _loadFunctionTableFromMethod(self, symbolLookupMethodAddress): methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ContentEncryptionCallback, ctypes.c_void_p) self.lib.lib3mf_writer_setcontentencryptioncallback = methodType(int(methodAddress.value)) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_writer_createbinarystream")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_writer_createbinarystream = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_writer_assignbinarystream")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p) + self.lib.lib3mf_writer_assignbinarystream = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_writer_registercustomnamespace")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p) + self.lib.lib3mf_writer_registercustomnamespace = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_persistentreadersource_getsourcetype")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)) + self.lib.lib3mf_persistentreadersource_getsourcetype = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_persistentreadersource_invalidatesourcedata")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p) + self.lib.lib3mf_persistentreadersource_invalidatesourcedata = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_persistentreadersource_sourcedataisvalid")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)) + self.lib.lib3mf_persistentreadersource_sourcedataisvalid = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_reader_readfrompersistentsource")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p) + self.lib.lib3mf_reader_readfrompersistentsource = methodType(int(methodAddress.value)) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_reader_readfromfile")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) @@ -1120,6 +1379,276 @@ def _loadFunctionTableFromMethod(self, symbolLookupMethodAddress): methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)) self.lib.lib3mf_resourceiterator_count = methodType(int(methodAddress.value)) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlattribute_getname")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_customxmlattribute_getname = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlattribute_getvalue")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_customxmlattribute_getvalue = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlattribute_isvalidinteger")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_int64, ctypes.c_int64, ctypes.POINTER(ctypes.c_bool)) + self.lib.lib3mf_customxmlattribute_isvalidinteger = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlattribute_getintegervalue")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_int64, ctypes.c_int64, ctypes.POINTER(ctypes.c_int64)) + self.lib.lib3mf_customxmlattribute_getintegervalue = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlattribute_isvaliddouble")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_double, ctypes.c_double, ctypes.POINTER(ctypes.c_bool)) + self.lib.lib3mf_customxmlattribute_isvaliddouble = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlattribute_getdoublevalue")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_double, ctypes.c_double, ctypes.POINTER(ctypes.c_double)) + self.lib.lib3mf_customxmlattribute_getdoublevalue = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlattribute_isvalidbool")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)) + self.lib.lib3mf_customxmlattribute_isvalidbool = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlattribute_getboolvalue")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_double, ctypes.c_double, ctypes.POINTER(ctypes.c_bool)) + self.lib.lib3mf_customxmlattribute_getboolvalue = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlattribute_setvalue")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p) + self.lib.lib3mf_customxmlattribute_setvalue = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlattribute_setintegervalue")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_int64) + self.lib.lib3mf_customxmlattribute_setintegervalue = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlattribute_setdoublevalue")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_double) + self.lib.lib3mf_customxmlattribute_setdoublevalue = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlattribute_setboolvalue")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_bool) + self.lib.lib3mf_customxmlattribute_setboolvalue = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlattribute_remove")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p) + self.lib.lib3mf_customxmlattribute_remove = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnode_getname")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_customxmlnode_getname = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnode_getnamespace")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_customxmlnode_getnamespace = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnode_getattributecount")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)) + self.lib.lib3mf_customxmlnode_getattributecount = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnode_getattribute")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_customxmlnode_getattribute = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnode_hasattribute")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_bool)) + self.lib.lib3mf_customxmlnode_hasattribute = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnode_findattribute")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_bool, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_customxmlnode_findattribute = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnode_removeattribute")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_bool)) + self.lib.lib3mf_customxmlnode_removeattribute = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnode_removeattributebyindex")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_bool)) + self.lib.lib3mf_customxmlnode_removeattributebyindex = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnode_addattribute")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p) + self.lib.lib3mf_customxmlnode_addattribute = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnode_addintegerattribute")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_int64) + self.lib.lib3mf_customxmlnode_addintegerattribute = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnode_adddoubleattribute")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_double) + self.lib.lib3mf_customxmlnode_adddoubleattribute = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnode_addboolattribute")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_bool) + self.lib.lib3mf_customxmlnode_addboolattribute = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnode_getchildren")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_customxmlnode_getchildren = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnode_countchildrenbyname")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_uint64)) + self.lib.lib3mf_customxmlnode_countchildrenbyname = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnode_getchildrenbyname")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_customxmlnode_getchildrenbyname = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnode_haschild")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_bool)) + self.lib.lib3mf_customxmlnode_haschild = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnode_hasuniquechild")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_bool)) + self.lib.lib3mf_customxmlnode_hasuniquechild = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnode_findchild")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_bool, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_customxmlnode_findchild = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnode_addchild")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_customxmlnode_addchild = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnode_removechild")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p) + self.lib.lib3mf_customxmlnode_removechild = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnode_removechildrenwithname")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_uint64)) + self.lib.lib3mf_customxmlnode_removechildrenwithname = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnode_remove")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p) + self.lib.lib3mf_customxmlnode_remove = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnodes_getnodecount")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)) + self.lib.lib3mf_customxmlnodes_getnodecount = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnodes_getnode")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_customxmlnodes_getnode = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnodes_countnodesbyname")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_uint64)) + self.lib.lib3mf_customxmlnodes_countnodesbyname = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnodes_getnodesbyname")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_customxmlnodes_getnodesbyname = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnodes_hasnode")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_bool)) + self.lib.lib3mf_customxmlnodes_hasnode = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnodes_hasuniquenode")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_bool)) + self.lib.lib3mf_customxmlnodes_hasuniquenode = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customxmlnodes_findnode")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_bool, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_customxmlnodes_findnode = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customdomtree_getnamespace")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_customdomtree_getnamespace = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customdomtree_getrootnode")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_customdomtree_getrootnode = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_customdomtree_savetostring")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_customdomtree_savetostring = methodType(int(methodAddress.value)) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_slicestackiterator_getcurrentslicestack")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) @@ -2272,3160 +2801,5197 @@ def _loadFunctionTableFromMethod(self, symbolLookupMethodAddress): methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_double)) self.lib.lib3mf_slice_getztop = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_slicestack_getbottomz")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathprofile_getuuid")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_double)) - self.lib.lib3mf_slicestack_getbottomz = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_toolpathprofile_getuuid = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_slicestack_getslicecount")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathprofile_getname")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)) - self.lib.lib3mf_slicestack_getslicecount = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_toolpathprofile_getname = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_slicestack_getslice")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathprofile_getparametercount")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_slicestack_getslice = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)) + self.lib.lib3mf_toolpathprofile_getparametercount = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_slicestack_addslice")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathprofile_getparametername")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_double, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_slicestack_addslice = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_toolpathprofile_getparametername = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_slicestack_getslicerefcount")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathprofile_getparameternamespace")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)) - self.lib.lib3mf_slicestack_getslicerefcount = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_toolpathprofile_getparameternamespace = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_slicestack_addslicestackreference")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathprofile_hasparametervalue")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p) - self.lib.lib3mf_slicestack_addslicestackreference = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_bool)) + self.lib.lib3mf_toolpathprofile_hasparametervalue = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_slicestack_getslicestackreference")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathprofile_getparametervalue")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_slicestack_getslicestackreference = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_toolpathprofile_getparametervalue = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_slicestack_collapseslicereferences")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathprofile_getparametervaluedef")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p) - self.lib.lib3mf_slicestack_collapseslicereferences = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_toolpathprofile_getparametervaluedef = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_slicestack_setownpath")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathprofile_getparameterdoublevalue")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p) - self.lib.lib3mf_slicestack_setownpath = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_double)) + self.lib.lib3mf_toolpathprofile_getparameterdoublevalue = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_slicestack_getownpath")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathprofile_getparameterdoublevaluedef")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) - self.lib.lib3mf_slicestack_getownpath = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_double, ctypes.POINTER(ctypes.c_double)) + self.lib.lib3mf_toolpathprofile_getparameterdoublevaluedef = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_consumer_getconsumerid")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathprofile_getparameterintegervalue")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) - self.lib.lib3mf_consumer_getconsumerid = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_int64)) + self.lib.lib3mf_toolpathprofile_getparameterintegervalue = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_consumer_getkeyid")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathprofile_getparameterintegervaluedef")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) - self.lib.lib3mf_consumer_getkeyid = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_int64, ctypes.POINTER(ctypes.c_int64)) + self.lib.lib3mf_toolpathprofile_getparameterintegervaluedef = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_consumer_getkeyvalue")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathprofile_getparameterboolvalue")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) - self.lib.lib3mf_consumer_getkeyvalue = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_bool)) + self.lib.lib3mf_toolpathprofile_getparameterboolvalue = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_accessright_getconsumer")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathprofile_getparameterboolvaluedef")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_accessright_getconsumer = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_bool, ctypes.POINTER(ctypes.c_bool)) + self.lib.lib3mf_toolpathprofile_getparameterboolvaluedef = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_accessright_getwrappingalgorithm")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathprofile_setname")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)) - self.lib.lib3mf_accessright_getwrappingalgorithm = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p) + self.lib.lib3mf_toolpathprofile_setname = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_accessright_getmgfalgorithm")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathprofile_setparametervalue")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)) - self.lib.lib3mf_accessright_getmgfalgorithm = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p) + self.lib.lib3mf_toolpathprofile_setparametervalue = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_accessright_getdigestmethod")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathprofile_setparameterdoublevalue")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)) - self.lib.lib3mf_accessright_getdigestmethod = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_double) + self.lib.lib3mf_toolpathprofile_setparameterdoublevalue = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_contentencryptionparams_getencryptionalgorithm")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathprofile_setparameterintegervalue")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)) - self.lib.lib3mf_contentencryptionparams_getencryptionalgorithm = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_int64) + self.lib.lib3mf_toolpathprofile_setparameterintegervalue = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_contentencryptionparams_getkey")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathprofile_setparameterboolvalue")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint8)) - self.lib.lib3mf_contentencryptionparams_getkey = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_bool) + self.lib.lib3mf_toolpathprofile_setparameterboolvalue = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_contentencryptionparams_getinitializationvector")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerreader_getlayerdatauuid")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint8)) - self.lib.lib3mf_contentencryptionparams_getinitializationvector = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_toolpathlayerreader_getlayerdatauuid = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_contentencryptionparams_getauthenticationtag")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerreader_getsegmentcount")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint8)) - self.lib.lib3mf_contentencryptionparams_getauthenticationtag = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)) + self.lib.lib3mf_toolpathlayerreader_getsegmentcount = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_contentencryptionparams_setauthenticationtag")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerreader_getsegmentinfo")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint8)) - self.lib.lib3mf_contentencryptionparams_setauthenticationtag = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_uint32)) + self.lib.lib3mf_toolpathlayerreader_getsegmentinfo = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_contentencryptionparams_getadditionalauthenticationdata")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerreader_getsegmentprofile")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint8)) - self.lib.lib3mf_contentencryptionparams_getadditionalauthenticationdata = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_toolpathlayerreader_getsegmentprofile = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_contentencryptionparams_getdescriptor")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerreader_getsegmentprofileuuid")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)) - self.lib.lib3mf_contentencryptionparams_getdescriptor = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_toolpathlayerreader_getsegmentprofileuuid = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_contentencryptionparams_getkeyuuid")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerreader_getsegmentpart")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) - self.lib.lib3mf_contentencryptionparams_getkeyuuid = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_toolpathlayerreader_getsegmentpart = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_resourcedata_getpath")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerreader_getsegmentpartuuid")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_resourcedata_getpath = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_toolpathlayerreader_getsegmentpartuuid = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_resourcedata_getencryptionalgorithm")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerreader_getsegmentlocalpartid")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)) - self.lib.lib3mf_resourcedata_getencryptionalgorithm = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_uint32)) + self.lib.lib3mf_toolpathlayerreader_getsegmentlocalpartid = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_resourcedata_getcompression")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerreader_getpartuuidbylocalpartid")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)) - self.lib.lib3mf_resourcedata_getcompression = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_toolpathlayerreader_getpartuuidbylocalpartid = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_resourcedata_getadditionalauthenticationdata")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerreader_getsegmentpointdata")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint8)) - self.lib.lib3mf_resourcedata_getadditionalauthenticationdata = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(Position2D)) + self.lib.lib3mf_toolpathlayerreader_getsegmentpointdata = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_resourcedatagroup_getkeyuuid")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerreader_findattributeinfobyname")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) - self.lib.lib3mf_resourcedatagroup_getkeyuuid = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_int32)) + self.lib.lib3mf_toolpathlayerreader_findattributeinfobyname = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_resourcedatagroup_addaccessright")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerreader_findattributeidbyname")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p, WrappingAlgorithm, MgfAlgorithm, DigestMethod, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_resourcedatagroup_addaccessright = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_uint32)) + self.lib.lib3mf_toolpathlayerreader_findattributeidbyname = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_resourcedatagroup_findaccessrightbyconsumer")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerreader_findattributevaluebyname")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_resourcedatagroup_findaccessrightbyconsumer = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_int32)) + self.lib.lib3mf_toolpathlayerreader_findattributevaluebyname = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_resourcedatagroup_removeaccessright")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerreader_getsegmentintegerattributebyid")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p) - self.lib.lib3mf_resourcedatagroup_removeaccessright = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint32, ctypes.POINTER(ctypes.c_int64)) + self.lib.lib3mf_toolpathlayerreader_getsegmentintegerattributebyid = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_addconsumer")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerreader_getsegmentintegerattributebyname")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_keystore_addconsumer = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_int64)) + self.lib.lib3mf_toolpathlayerreader_getsegmentintegerattributebyname = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_getconsumercount")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)) - self.lib.lib3mf_keystore_getconsumercount = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint32, ctypes.POINTER(ctypes.c_double)) + self.lib.lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_getconsumer")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_keystore_getconsumer = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_double)) + self.lib.lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_removeconsumer")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerreader_getcustomdatacount")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p) - self.lib.lib3mf_keystore_removeconsumer = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)) + self.lib.lib3mf_toolpathlayerreader_getcustomdatacount = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_findconsumer")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerreader_getcustomdata")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_keystore_findconsumer = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_toolpathlayerreader_getcustomdata = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_getresourcedatagroupcount")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerreader_getcustomdataname")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)) - self.lib.lib3mf_keystore_getresourcedatagroupcount = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_toolpathlayerreader_getcustomdataname = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_addresourcedatagroup")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerdata_getlayerdatauuid")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_keystore_addresourcedatagroup = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_toolpathlayerdata_getlayerdatauuid = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_getresourcedatagroup")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerdata_registerprofile")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_keystore_getresourcedatagroup = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)) + self.lib.lib3mf_toolpathlayerdata_registerprofile = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_removeresourcedatagroup")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerdata_registerbuilditem")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p) - self.lib.lib3mf_keystore_removeresourcedatagroup = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)) + self.lib.lib3mf_toolpathlayerdata_registerbuilditem = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_findresourcedatagroup")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerdata_setsegmentattribute")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_keystore_findresourcedatagroup = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p) + self.lib.lib3mf_toolpathlayerdata_setsegmentattribute = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_addresourcedata")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerdata_clearsegmentattributes")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p, EncryptionAlgorithm, Compression, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint8), ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_keystore_addresourcedata = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p) + self.lib.lib3mf_toolpathlayerdata_clearsegmentattributes = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_removeresourcedata")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerdata_writehatchdata")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p) - self.lib.lib3mf_keystore_removeresourcedata = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(Position2D)) + self.lib.lib3mf_toolpathlayerdata_writehatchdata = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_findresourcedata")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerdata_writeloop")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_keystore_findresourcedata = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(Position2D)) + self.lib.lib3mf_toolpathlayerdata_writeloop = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_getresourcedatacount")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerdata_writepolyline")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)) - self.lib.lib3mf_keystore_getresourcedatacount = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(Position2D)) + self.lib.lib3mf_toolpathlayerdata_writepolyline = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_getresourcedata")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerdata_addcustomdata")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_keystore_getresourcedata = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_toolpathlayerdata_addcustomdata = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_getuuid")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathlayerdata_finish")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool), ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) - self.lib.lib3mf_keystore_getuuid = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p) + self.lib.lib3mf_toolpathlayerdata_finish = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_setuuid")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpath_getunits")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p) - self.lib.lib3mf_keystore_setuuid = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_double)) + self.lib.lib3mf_toolpath_getunits = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_rootmodelpart")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpath_getlayercount")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_rootmodelpart = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)) + self.lib.lib3mf_toolpath_getlayercount = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_findorcreatepackagepart")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpath_getprofilecount")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_findorcreatepackagepart = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)) + self.lib.lib3mf_toolpath_getprofilecount = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_setunit")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpath_addlayer")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ModelUnit) - self.lib.lib3mf_model_setunit = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.c_char_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_toolpath_addlayer = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getunit")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpath_getlayerattachment")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)) - self.lib.lib3mf_model_getunit = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_toolpath_getlayerattachment = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getlanguage")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpath_readlayerdata")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) - self.lib.lib3mf_model_getlanguage = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_toolpath_readlayerdata = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_setlanguage")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpath_getlayerpath")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p) - self.lib.lib3mf_model_setlanguage = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_toolpath_getlayerpath = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_querywriter")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpath_getlayerzmax")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_querywriter = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_uint32)) + self.lib.lib3mf_toolpath_getlayerzmax = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_queryreader")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpath_getlayerz")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_queryreader = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_uint32)) + self.lib.lib3mf_toolpath_getlayerz = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getresourcebyid")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpath_addprofile")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_getresourcebyid = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_toolpath_addprofile = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_gettexture2dbyid")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpath_getprofile")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_gettexture2dbyid = methodType(int(methodAddress.value)) + self.lib.lib3mf_toolpath_getprofile = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getpropertytypebyid")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpath_getprofileuuid")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_int32)) - self.lib.lib3mf_model_getpropertytypebyid = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_toolpath_getprofileuuid = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getbasematerialgroupbyid")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpath_getcustomdatacount")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_getbasematerialgroupbyid = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)) + self.lib.lib3mf_toolpath_getcustomdatacount = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_gettexture2dgroupbyid")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpath_getcustomdata")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_gettexture2dgroupbyid = methodType(int(methodAddress.value)) + self.lib.lib3mf_toolpath_getcustomdata = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getcompositematerialsbyid")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpath_getcustomdataname")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_getcompositematerialsbyid = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_toolpath_getcustomdataname = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getmultipropertygroupbyid")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpath_hasuniquecustomdata")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_getmultipropertygroupbyid = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_bool)) + self.lib.lib3mf_toolpath_hasuniquecustomdata = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getmeshobjectbyid")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpath_finduniquecustomdata")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_getmeshobjectbyid = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_toolpath_finduniquecustomdata = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getcomponentsobjectbyid")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpath_addcustomdata")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_getcomponentsobjectbyid = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_toolpath_addcustomdata = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getcolorgroupbyid")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpath_clearcustomdata")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_getcolorgroupbyid = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)) + self.lib.lib3mf_toolpath_clearcustomdata = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getslicestackbyid")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpath_deletecustomdata")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_getslicestackbyid = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)) + self.lib.lib3mf_toolpath_deletecustomdata = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getbuilduuid")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpath_registercustomintegerattribute")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool), ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) - self.lib.lib3mf_model_getbuilduuid = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p) + self.lib.lib3mf_toolpath_registercustomintegerattribute = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_setbuilduuid")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpath_registercustomdoubleattribute")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p) - self.lib.lib3mf_model_setbuilduuid = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p) + self.lib.lib3mf_toolpath_registercustomdoubleattribute = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getbuilditems")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_toolpathiterator_getcurrenttoolpath")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_getbuilditems = methodType(int(methodAddress.value)) + self.lib.lib3mf_toolpathiterator_getcurrenttoolpath = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getoutbox")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_slicestack_getbottomz")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(Box)) - self.lib.lib3mf_model_getoutbox = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_double)) + self.lib.lib3mf_slicestack_getbottomz = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getresources")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_slicestack_getslicecount")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_getresources = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)) + self.lib.lib3mf_slicestack_getslicecount = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getobjects")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_slicestack_getslice")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_getobjects = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_slicestack_getslice = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getmeshobjects")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_slicestack_addslice")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_getmeshobjects = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_double, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_slicestack_addslice = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getcomponentsobjects")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_slicestack_getslicerefcount")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_getcomponentsobjects = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)) + self.lib.lib3mf_slicestack_getslicerefcount = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_gettexture2ds")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_slicestack_addslicestackreference")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_gettexture2ds = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p) + self.lib.lib3mf_slicestack_addslicestackreference = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getbasematerialgroups")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_slicestack_getslicestackreference")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_getbasematerialgroups = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_slicestack_getslicestackreference = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getcolorgroups")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_slicestack_collapseslicereferences")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_getcolorgroups = methodType(int(methodAddress.value)) - - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_gettexture2dgroups")), methodAddress) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p) + self.lib.lib3mf_slicestack_collapseslicereferences = methodType(int(methodAddress.value)) + + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_slicestack_setownpath")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_gettexture2dgroups = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p) + self.lib.lib3mf_slicestack_setownpath = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getcompositematerials")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_slicestack_getownpath")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_getcompositematerials = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_slicestack_getownpath = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getmultipropertygroups")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_consumer_getconsumerid")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_getmultipropertygroups = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_consumer_getconsumerid = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getslicestacks")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_consumer_getkeyid")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_getslicestacks = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_consumer_getkeyid = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_mergetomodel")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_consumer_getkeyvalue")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_mergetomodel = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_consumer_getkeyvalue = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addmeshobject")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_accessright_getconsumer")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_addmeshobject = methodType(int(methodAddress.value)) + self.lib.lib3mf_accessright_getconsumer = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addcomponentsobject")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_accessright_getwrappingalgorithm")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_addcomponentsobject = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)) + self.lib.lib3mf_accessright_getwrappingalgorithm = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addslicestack")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_accessright_getmgfalgorithm")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_double, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_addslicestack = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)) + self.lib.lib3mf_accessright_getmgfalgorithm = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addtexture2dfromattachment")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_accessright_getdigestmethod")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_addtexture2dfromattachment = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)) + self.lib.lib3mf_accessright_getdigestmethod = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addbasematerialgroup")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_contentencryptionparams_getencryptionalgorithm")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_addbasematerialgroup = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)) + self.lib.lib3mf_contentencryptionparams_getencryptionalgorithm = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addcolorgroup")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_contentencryptionparams_getkey")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_addcolorgroup = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint8)) + self.lib.lib3mf_contentencryptionparams_getkey = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addtexture2dgroup")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_contentencryptionparams_getinitializationvector")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_addtexture2dgroup = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint8)) + self.lib.lib3mf_contentencryptionparams_getinitializationvector = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addcompositematerials")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_contentencryptionparams_getauthenticationtag")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_addcompositematerials = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint8)) + self.lib.lib3mf_contentencryptionparams_getauthenticationtag = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addmultipropertygroup")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_contentencryptionparams_setauthenticationtag")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_addmultipropertygroup = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint8)) + self.lib.lib3mf_contentencryptionparams_setauthenticationtag = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addbuilditem")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_contentencryptionparams_getadditionalauthenticationdata")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(Transform), ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_addbuilditem = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint8)) + self.lib.lib3mf_contentencryptionparams_getadditionalauthenticationdata = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_removebuilditem")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_contentencryptionparams_getdescriptor")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p) - self.lib.lib3mf_model_removebuilditem = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)) + self.lib.lib3mf_contentencryptionparams_getdescriptor = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getmetadatagroup")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_contentencryptionparams_getkeyuuid")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_getmetadatagroup = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_contentencryptionparams_getkeyuuid = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addattachment")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_resourcedata_getpath")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_addattachment = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_resourcedata_getpath = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_removeattachment")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_resourcedata_getencryptionalgorithm")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p) - self.lib.lib3mf_model_removeattachment = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)) + self.lib.lib3mf_resourcedata_getencryptionalgorithm = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getattachment")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_resourcedata_getcompression")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_getattachment = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)) + self.lib.lib3mf_resourcedata_getcompression = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_findattachment")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_resourcedata_getadditionalauthenticationdata")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_findattachment = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint8)) + self.lib.lib3mf_resourcedata_getadditionalauthenticationdata = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getattachmentcount")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_resourcedatagroup_getkeyuuid")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)) - self.lib.lib3mf_model_getattachmentcount = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_resourcedatagroup_getkeyuuid = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_haspackagethumbnailattachment")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_resourcedatagroup_addaccessright")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)) - self.lib.lib3mf_model_haspackagethumbnailattachment = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p, WrappingAlgorithm, MgfAlgorithm, DigestMethod, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_resourcedatagroup_addaccessright = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_createpackagethumbnailattachment")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_resourcedatagroup_findaccessrightbyconsumer")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_createpackagethumbnailattachment = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_resourcedatagroup_findaccessrightbyconsumer = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getpackagethumbnailattachment")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_resourcedatagroup_removeaccessright")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_getpackagethumbnailattachment = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p) + self.lib.lib3mf_resourcedatagroup_removeaccessright = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_removepackagethumbnailattachment")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_addconsumer")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p) - self.lib.lib3mf_model_removepackagethumbnailattachment = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_keystore_addconsumer = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addcustomcontenttype")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_getconsumercount")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p) - self.lib.lib3mf_model_addcustomcontenttype = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)) + self.lib.lib3mf_keystore_getconsumercount = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_removecustomcontenttype")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_getconsumer")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p) - self.lib.lib3mf_model_removecustomcontenttype = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_keystore_getconsumer = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_setrandomnumbercallback")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_removeconsumer")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, RandomNumberCallback, ctypes.c_void_p) - self.lib.lib3mf_model_setrandomnumbercallback = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p) + self.lib.lib3mf_keystore_removeconsumer = methodType(int(methodAddress.value)) - err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getkeystore")), methodAddress) + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_findconsumer")), methodAddress) if err != 0: raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) - methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) - self.lib.lib3mf_model_getkeystore = methodType(int(methodAddress.value)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_keystore_findconsumer = methodType(int(methodAddress.value)) - except AttributeError as ae: - raise ELib3MFException(ErrorCodes.COULDNOTFINDLIBRARYEXPORT, ae.args[0]) - - def _loadFunctionTable(self): - try: - self.lib.lib3mf_getlibraryversion.restype = ctypes.c_int32 - self.lib.lib3mf_getlibraryversion.argtypes = [ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_getresourcedatagroupcount")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)) + self.lib.lib3mf_keystore_getresourcedatagroupcount = methodType(int(methodAddress.value)) - self.lib.lib3mf_getprereleaseinformation.restype = ctypes.c_int32 - self.lib.lib3mf_getprereleaseinformation.argtypes = [ctypes.POINTER(ctypes.c_bool), ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_addresourcedatagroup")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_keystore_addresourcedatagroup = methodType(int(methodAddress.value)) - self.lib.lib3mf_getbuildinformation.restype = ctypes.c_int32 - self.lib.lib3mf_getbuildinformation.argtypes = [ctypes.POINTER(ctypes.c_bool), ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_getresourcedatagroup")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_keystore_getresourcedatagroup = methodType(int(methodAddress.value)) - self.lib.lib3mf_getspecificationversion.restype = ctypes.c_int32 - self.lib.lib3mf_getspecificationversion.argtypes = [ctypes.c_char_p, ctypes.POINTER(ctypes.c_bool), ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_removeresourcedatagroup")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p) + self.lib.lib3mf_keystore_removeresourcedatagroup = methodType(int(methodAddress.value)) - self.lib.lib3mf_createmodel.restype = ctypes.c_int32 - self.lib.lib3mf_createmodel.argtypes = [ctypes.POINTER(ctypes.c_void_p)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_findresourcedatagroup")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_keystore_findresourcedatagroup = methodType(int(methodAddress.value)) - self.lib.lib3mf_release.restype = ctypes.c_int32 - self.lib.lib3mf_release.argtypes = [ctypes.c_void_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_addresourcedata")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p, EncryptionAlgorithm, Compression, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint8), ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_keystore_addresourcedata = methodType(int(methodAddress.value)) - self.lib.lib3mf_acquire.restype = ctypes.c_int32 - self.lib.lib3mf_acquire.argtypes = [ctypes.c_void_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_removeresourcedata")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p) + self.lib.lib3mf_keystore_removeresourcedata = methodType(int(methodAddress.value)) - self.lib.lib3mf_setjournal.restype = ctypes.c_int32 - self.lib.lib3mf_setjournal.argtypes = [ctypes.c_char_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_findresourcedata")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_keystore_findresourcedata = methodType(int(methodAddress.value)) - self.lib.lib3mf_getlasterror.restype = ctypes.c_int32 - self.lib.lib3mf_getlasterror.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p, ctypes.POINTER(ctypes.c_bool)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_getresourcedatacount")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)) + self.lib.lib3mf_keystore_getresourcedatacount = methodType(int(methodAddress.value)) - self.lib.lib3mf_getsymbollookupmethod.restype = ctypes.c_int32 - self.lib.lib3mf_getsymbollookupmethod.argtypes = [ctypes.POINTER(ctypes.c_void_p)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_getresourcedata")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_keystore_getresourcedata = methodType(int(methodAddress.value)) - self.lib.lib3mf_retrieveprogressmessage.restype = ctypes.c_int32 - self.lib.lib3mf_retrieveprogressmessage.argtypes = [ProgressIdentifier, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - - self.lib.lib3mf_rgbatocolor.restype = ctypes.c_int32 - self.lib.lib3mf_rgbatocolor.argtypes = [ctypes.c_uint8, ctypes.c_uint8, ctypes.c_uint8, ctypes.c_uint8, ctypes.POINTER(Color)] - - self.lib.lib3mf_floatrgbatocolor.restype = ctypes.c_int32 - self.lib.lib3mf_floatrgbatocolor.argtypes = [ctypes.c_float, ctypes.c_float, ctypes.c_float, ctypes.c_float, ctypes.POINTER(Color)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_getuuid")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool), ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_keystore_getuuid = methodType(int(methodAddress.value)) - self.lib.lib3mf_colortorgba.restype = ctypes.c_int32 - self.lib.lib3mf_colortorgba.argtypes = [ctypes.POINTER(Color), ctypes.POINTER(ctypes.c_uint8), ctypes.POINTER(ctypes.c_uint8), ctypes.POINTER(ctypes.c_uint8), ctypes.POINTER(ctypes.c_uint8)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_keystore_setuuid")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p) + self.lib.lib3mf_keystore_setuuid = methodType(int(methodAddress.value)) - self.lib.lib3mf_colortofloatrgba.restype = ctypes.c_int32 - self.lib.lib3mf_colortofloatrgba.argtypes = [ctypes.POINTER(Color), ctypes.POINTER(ctypes.c_float), ctypes.POINTER(ctypes.c_float), ctypes.POINTER(ctypes.c_float), ctypes.POINTER(ctypes.c_float)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_rootmodelpart")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_rootmodelpart = methodType(int(methodAddress.value)) - self.lib.lib3mf_getidentitytransform.restype = ctypes.c_int32 - self.lib.lib3mf_getidentitytransform.argtypes = [ctypes.POINTER(Transform)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_findorcreatepackagepart")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_findorcreatepackagepart = methodType(int(methodAddress.value)) - self.lib.lib3mf_getuniformscaletransform.restype = ctypes.c_int32 - self.lib.lib3mf_getuniformscaletransform.argtypes = [ctypes.c_float, ctypes.POINTER(Transform)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_setunit")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ModelUnit) + self.lib.lib3mf_model_setunit = methodType(int(methodAddress.value)) - self.lib.lib3mf_getscaletransform.restype = ctypes.c_int32 - self.lib.lib3mf_getscaletransform.argtypes = [ctypes.c_float, ctypes.c_float, ctypes.c_float, ctypes.POINTER(Transform)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getunit")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)) + self.lib.lib3mf_model_getunit = methodType(int(methodAddress.value)) - self.lib.lib3mf_gettranslationtransform.restype = ctypes.c_int32 - self.lib.lib3mf_gettranslationtransform.argtypes = [ctypes.c_float, ctypes.c_float, ctypes.c_float, ctypes.POINTER(Transform)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getlanguage")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_model_getlanguage = methodType(int(methodAddress.value)) - self.lib.lib3mf_base_classtypeid.restype = ctypes.c_int32 - self.lib.lib3mf_base_classtypeid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_setlanguage")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p) + self.lib.lib3mf_model_setlanguage = methodType(int(methodAddress.value)) - self.lib.lib3mf_writer_writetofile.restype = ctypes.c_int32 - self.lib.lib3mf_writer_writetofile.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_querywriter")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_querywriter = methodType(int(methodAddress.value)) - self.lib.lib3mf_writer_getstreamsize.restype = ctypes.c_int32 - self.lib.lib3mf_writer_getstreamsize.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_queryreader")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_queryreader = methodType(int(methodAddress.value)) - self.lib.lib3mf_writer_writetobuffer.restype = ctypes.c_int32 - self.lib.lib3mf_writer_writetobuffer.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint8)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getresourcebyid")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_getresourcebyid = methodType(int(methodAddress.value)) - self.lib.lib3mf_writer_writetocallback.restype = ctypes.c_int32 - self.lib.lib3mf_writer_writetocallback.argtypes = [ctypes.c_void_p, WriteCallback, SeekCallback, ctypes.c_void_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_gettexture2dbyid")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_gettexture2dbyid = methodType(int(methodAddress.value)) - self.lib.lib3mf_writer_setprogresscallback.restype = ctypes.c_int32 - self.lib.lib3mf_writer_setprogresscallback.argtypes = [ctypes.c_void_p, ProgressCallback, ctypes.c_void_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getpropertytypebyid")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_int32)) + self.lib.lib3mf_model_getpropertytypebyid = methodType(int(methodAddress.value)) - self.lib.lib3mf_writer_getdecimalprecision.restype = ctypes.c_int32 - self.lib.lib3mf_writer_getdecimalprecision.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getbasematerialgroupbyid")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_getbasematerialgroupbyid = methodType(int(methodAddress.value)) - self.lib.lib3mf_writer_setdecimalprecision.restype = ctypes.c_int32 - self.lib.lib3mf_writer_setdecimalprecision.argtypes = [ctypes.c_void_p, ctypes.c_uint32] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_gettexture2dgroupbyid")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_gettexture2dgroupbyid = methodType(int(methodAddress.value)) - self.lib.lib3mf_writer_setstrictmodeactive.restype = ctypes.c_int32 - self.lib.lib3mf_writer_setstrictmodeactive.argtypes = [ctypes.c_void_p, ctypes.c_bool] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getcompositematerialsbyid")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_getcompositematerialsbyid = methodType(int(methodAddress.value)) - self.lib.lib3mf_writer_getstrictmodeactive.restype = ctypes.c_int32 - self.lib.lib3mf_writer_getstrictmodeactive.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getmultipropertygroupbyid")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_getmultipropertygroupbyid = methodType(int(methodAddress.value)) - self.lib.lib3mf_writer_getwarning.restype = ctypes.c_int32 - self.lib.lib3mf_writer_getwarning.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_uint32), ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getmeshobjectbyid")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_getmeshobjectbyid = methodType(int(methodAddress.value)) - self.lib.lib3mf_writer_getwarningcount.restype = ctypes.c_int32 - self.lib.lib3mf_writer_getwarningcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getcomponentsobjectbyid")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_getcomponentsobjectbyid = methodType(int(methodAddress.value)) - self.lib.lib3mf_writer_addkeywrappingcallback.restype = ctypes.c_int32 - self.lib.lib3mf_writer_addkeywrappingcallback.argtypes = [ctypes.c_void_p, ctypes.c_char_p, KeyWrappingCallback, ctypes.c_void_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getcolorgroupbyid")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_getcolorgroupbyid = methodType(int(methodAddress.value)) - self.lib.lib3mf_writer_setcontentencryptioncallback.restype = ctypes.c_int32 - self.lib.lib3mf_writer_setcontentencryptioncallback.argtypes = [ctypes.c_void_p, ContentEncryptionCallback, ctypes.c_void_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getslicestackbyid")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_getslicestackbyid = methodType(int(methodAddress.value)) - self.lib.lib3mf_reader_readfromfile.restype = ctypes.c_int32 - self.lib.lib3mf_reader_readfromfile.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getbuilduuid")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool), ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p) + self.lib.lib3mf_model_getbuilduuid = methodType(int(methodAddress.value)) - self.lib.lib3mf_reader_readfrombuffer.restype = ctypes.c_int32 - self.lib.lib3mf_reader_readfrombuffer.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint8)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_setbuilduuid")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p) + self.lib.lib3mf_model_setbuilduuid = methodType(int(methodAddress.value)) - self.lib.lib3mf_reader_readfromcallback.restype = ctypes.c_int32 - self.lib.lib3mf_reader_readfromcallback.argtypes = [ctypes.c_void_p, ReadCallback, ctypes.c_uint64, SeekCallback, ctypes.c_void_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getbuilditems")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_getbuilditems = methodType(int(methodAddress.value)) - self.lib.lib3mf_reader_setprogresscallback.restype = ctypes.c_int32 - self.lib.lib3mf_reader_setprogresscallback.argtypes = [ctypes.c_void_p, ProgressCallback, ctypes.c_void_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getoutbox")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(Box)) + self.lib.lib3mf_model_getoutbox = methodType(int(methodAddress.value)) - self.lib.lib3mf_reader_addrelationtoread.restype = ctypes.c_int32 - self.lib.lib3mf_reader_addrelationtoread.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getresources")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_getresources = methodType(int(methodAddress.value)) - self.lib.lib3mf_reader_removerelationtoread.restype = ctypes.c_int32 - self.lib.lib3mf_reader_removerelationtoread.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getobjects")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_getobjects = methodType(int(methodAddress.value)) - self.lib.lib3mf_reader_setstrictmodeactive.restype = ctypes.c_int32 - self.lib.lib3mf_reader_setstrictmodeactive.argtypes = [ctypes.c_void_p, ctypes.c_bool] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getmeshobjects")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_getmeshobjects = methodType(int(methodAddress.value)) - self.lib.lib3mf_reader_getstrictmodeactive.restype = ctypes.c_int32 - self.lib.lib3mf_reader_getstrictmodeactive.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getcomponentsobjects")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_getcomponentsobjects = methodType(int(methodAddress.value)) - self.lib.lib3mf_reader_getwarning.restype = ctypes.c_int32 - self.lib.lib3mf_reader_getwarning.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_uint32), ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_gettexture2ds")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_gettexture2ds = methodType(int(methodAddress.value)) - self.lib.lib3mf_reader_getwarningcount.restype = ctypes.c_int32 - self.lib.lib3mf_reader_getwarningcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getbasematerialgroups")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_getbasematerialgroups = methodType(int(methodAddress.value)) - self.lib.lib3mf_reader_addkeywrappingcallback.restype = ctypes.c_int32 - self.lib.lib3mf_reader_addkeywrappingcallback.argtypes = [ctypes.c_void_p, ctypes.c_char_p, KeyWrappingCallback, ctypes.c_void_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getcolorgroups")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_getcolorgroups = methodType(int(methodAddress.value)) - self.lib.lib3mf_reader_setcontentencryptioncallback.restype = ctypes.c_int32 - self.lib.lib3mf_reader_setcontentencryptioncallback.argtypes = [ctypes.c_void_p, ContentEncryptionCallback, ctypes.c_void_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_gettexture2dgroups")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_gettexture2dgroups = methodType(int(methodAddress.value)) - self.lib.lib3mf_packagepart_getpath.restype = ctypes.c_int32 - self.lib.lib3mf_packagepart_getpath.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getcompositematerials")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_getcompositematerials = methodType(int(methodAddress.value)) - self.lib.lib3mf_packagepart_setpath.restype = ctypes.c_int32 - self.lib.lib3mf_packagepart_setpath.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getmultipropertygroups")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_getmultipropertygroups = methodType(int(methodAddress.value)) - self.lib.lib3mf_resource_getresourceid.restype = ctypes.c_int32 - self.lib.lib3mf_resource_getresourceid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_gettoolpaths")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_gettoolpaths = methodType(int(methodAddress.value)) - self.lib.lib3mf_resource_getuniqueresourceid.restype = ctypes.c_int32 - self.lib.lib3mf_resource_getuniqueresourceid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getslicestacks")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_getslicestacks = methodType(int(methodAddress.value)) - self.lib.lib3mf_resource_packagepart.restype = ctypes.c_int32 - self.lib.lib3mf_resource_packagepart.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_mergetomodel")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_mergetomodel = methodType(int(methodAddress.value)) - self.lib.lib3mf_resource_setpackagepart.restype = ctypes.c_int32 - self.lib.lib3mf_resource_setpackagepart.argtypes = [ctypes.c_void_p, ctypes.c_void_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addmeshobject")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_addmeshobject = methodType(int(methodAddress.value)) - self.lib.lib3mf_resource_getmodelresourceid.restype = ctypes.c_int32 - self.lib.lib3mf_resource_getmodelresourceid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addcomponentsobject")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_addcomponentsobject = methodType(int(methodAddress.value)) - self.lib.lib3mf_resourceiterator_movenext.restype = ctypes.c_int32 - self.lib.lib3mf_resourceiterator_movenext.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addslicestack")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_double, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_addslicestack = methodType(int(methodAddress.value)) - self.lib.lib3mf_resourceiterator_moveprevious.restype = ctypes.c_int32 - self.lib.lib3mf_resourceiterator_moveprevious.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addtexture2dfromattachment")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_addtexture2dfromattachment = methodType(int(methodAddress.value)) - self.lib.lib3mf_resourceiterator_getcurrent.restype = ctypes.c_int32 - self.lib.lib3mf_resourceiterator_getcurrent.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addbasematerialgroup")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_addbasematerialgroup = methodType(int(methodAddress.value)) - self.lib.lib3mf_resourceiterator_clone.restype = ctypes.c_int32 - self.lib.lib3mf_resourceiterator_clone.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addcolorgroup")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_addcolorgroup = methodType(int(methodAddress.value)) - self.lib.lib3mf_resourceiterator_count.restype = ctypes.c_int32 - self.lib.lib3mf_resourceiterator_count.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addtexture2dgroup")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_addtexture2dgroup = methodType(int(methodAddress.value)) - self.lib.lib3mf_slicestackiterator_getcurrentslicestack.restype = ctypes.c_int32 - self.lib.lib3mf_slicestackiterator_getcurrentslicestack.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addcompositematerials")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_addcompositematerials = methodType(int(methodAddress.value)) - self.lib.lib3mf_objectiterator_getcurrentobject.restype = ctypes.c_int32 - self.lib.lib3mf_objectiterator_getcurrentobject.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addmultipropertygroup")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_addmultipropertygroup = methodType(int(methodAddress.value)) - self.lib.lib3mf_meshobjectiterator_getcurrentmeshobject.restype = ctypes.c_int32 - self.lib.lib3mf_meshobjectiterator_getcurrentmeshobject.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addbuilditem")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(Transform), ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_addbuilditem = methodType(int(methodAddress.value)) - self.lib.lib3mf_componentsobjectiterator_getcurrentcomponentsobject.restype = ctypes.c_int32 - self.lib.lib3mf_componentsobjectiterator_getcurrentcomponentsobject.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_removebuilditem")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p) + self.lib.lib3mf_model_removebuilditem = methodType(int(methodAddress.value)) - self.lib.lib3mf_texture2diterator_getcurrenttexture2d.restype = ctypes.c_int32 - self.lib.lib3mf_texture2diterator_getcurrenttexture2d.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addtoolpath")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_double, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_addtoolpath = methodType(int(methodAddress.value)) - self.lib.lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup.restype = ctypes.c_int32 - self.lib.lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getmetadatagroup")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_getmetadatagroup = methodType(int(methodAddress.value)) - self.lib.lib3mf_colorgroupiterator_getcurrentcolorgroup.restype = ctypes.c_int32 - self.lib.lib3mf_colorgroupiterator_getcurrentcolorgroup.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addattachment")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_addattachment = methodType(int(methodAddress.value)) - self.lib.lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup.restype = ctypes.c_int32 - self.lib.lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_removeattachment")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_void_p) + self.lib.lib3mf_model_removeattachment = methodType(int(methodAddress.value)) - self.lib.lib3mf_compositematerialsiterator_getcurrentcompositematerials.restype = ctypes.c_int32 - self.lib.lib3mf_compositematerialsiterator_getcurrentcompositematerials.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getattachment")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_getattachment = methodType(int(methodAddress.value)) - self.lib.lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup.restype = ctypes.c_int32 - self.lib.lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_findattachment")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_findattachment = methodType(int(methodAddress.value)) - self.lib.lib3mf_metadata_getnamespace.restype = ctypes.c_int32 - self.lib.lib3mf_metadata_getnamespace.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getattachmentcount")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)) + self.lib.lib3mf_model_getattachmentcount = methodType(int(methodAddress.value)) - self.lib.lib3mf_metadata_setnamespace.restype = ctypes.c_int32 - self.lib.lib3mf_metadata_setnamespace.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_haspackagethumbnailattachment")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)) + self.lib.lib3mf_model_haspackagethumbnailattachment = methodType(int(methodAddress.value)) - self.lib.lib3mf_metadata_getname.restype = ctypes.c_int32 - self.lib.lib3mf_metadata_getname.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_createpackagethumbnailattachment")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_createpackagethumbnailattachment = methodType(int(methodAddress.value)) - self.lib.lib3mf_metadata_setname.restype = ctypes.c_int32 - self.lib.lib3mf_metadata_setname.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getpackagethumbnailattachment")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_getpackagethumbnailattachment = methodType(int(methodAddress.value)) - self.lib.lib3mf_metadata_getkey.restype = ctypes.c_int32 - self.lib.lib3mf_metadata_getkey.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_removepackagethumbnailattachment")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p) + self.lib.lib3mf_model_removepackagethumbnailattachment = methodType(int(methodAddress.value)) - self.lib.lib3mf_metadata_getmustpreserve.restype = ctypes.c_int32 - self.lib.lib3mf_metadata_getmustpreserve.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_addcustomcontenttype")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p) + self.lib.lib3mf_model_addcustomcontenttype = methodType(int(methodAddress.value)) - self.lib.lib3mf_metadata_setmustpreserve.restype = ctypes.c_int32 - self.lib.lib3mf_metadata_setmustpreserve.argtypes = [ctypes.c_void_p, ctypes.c_bool] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_removecustomcontenttype")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p) + self.lib.lib3mf_model_removecustomcontenttype = methodType(int(methodAddress.value)) - self.lib.lib3mf_metadata_gettype.restype = ctypes.c_int32 - self.lib.lib3mf_metadata_gettype.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_setrandomnumbercallback")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, RandomNumberCallback, ctypes.c_void_p) + self.lib.lib3mf_model_setrandomnumbercallback = methodType(int(methodAddress.value)) - self.lib.lib3mf_metadata_settype.restype = ctypes.c_int32 - self.lib.lib3mf_metadata_settype.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_getkeystore")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_getkeystore = methodType(int(methodAddress.value)) - self.lib.lib3mf_metadata_getvalue.restype = ctypes.c_int32 - self.lib.lib3mf_metadata_getvalue.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_createpersistentsourcefromfile")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_createpersistentsourcefromfile = methodType(int(methodAddress.value)) - self.lib.lib3mf_metadata_setvalue.restype = ctypes.c_int32 - self.lib.lib3mf_metadata_setvalue.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_createpersistentsourcefrombuffer")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint8), ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_createpersistentsourcefrombuffer = methodType(int(methodAddress.value)) - self.lib.lib3mf_metadatagroup_getmetadatacount.restype = ctypes.c_int32 - self.lib.lib3mf_metadatagroup_getmetadatacount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + err = symbolLookupMethod(ctypes.c_char_p(str.encode("lib3mf_model_createpersistentsourcefromcallback")), methodAddress) + if err != 0: + raise ELib3MFException(ErrorCodes.COULDNOTLOADLIBRARY, str(err)) + methodType = ctypes.CFUNCTYPE(ctypes.c_int32, ctypes.c_void_p, ReadCallback, ctypes.c_uint64, SeekCallback, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)) + self.lib.lib3mf_model_createpersistentsourcefromcallback = methodType(int(methodAddress.value)) - self.lib.lib3mf_metadatagroup_getmetadata.restype = ctypes.c_int32 - self.lib.lib3mf_metadatagroup_getmetadata.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + except AttributeError as ae: + raise ELib3MFException(ErrorCodes.COULDNOTFINDLIBRARYEXPORT, ae.args[0]) + + def _loadFunctionTable(self): + try: + self.lib.lib3mf_getlibraryversion.restype = ctypes.c_int32 + self.lib.lib3mf_getlibraryversion.argtypes = [ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_metadatagroup_getmetadatabykey.restype = ctypes.c_int32 - self.lib.lib3mf_metadatagroup_getmetadatabykey.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_getprereleaseinformation.restype = ctypes.c_int32 + self.lib.lib3mf_getprereleaseinformation.argtypes = [ctypes.POINTER(ctypes.c_bool), ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_metadatagroup_removemetadatabyindex.restype = ctypes.c_int32 - self.lib.lib3mf_metadatagroup_removemetadatabyindex.argtypes = [ctypes.c_void_p, ctypes.c_uint32] + self.lib.lib3mf_getbuildinformation.restype = ctypes.c_int32 + self.lib.lib3mf_getbuildinformation.argtypes = [ctypes.POINTER(ctypes.c_bool), ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_metadatagroup_removemetadata.restype = ctypes.c_int32 - self.lib.lib3mf_metadatagroup_removemetadata.argtypes = [ctypes.c_void_p, ctypes.c_void_p] + self.lib.lib3mf_getspecificationversion.restype = ctypes.c_int32 + self.lib.lib3mf_getspecificationversion.argtypes = [ctypes.c_char_p, ctypes.POINTER(ctypes.c_bool), ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_metadatagroup_addmetadata.restype = ctypes.c_int32 - self.lib.lib3mf_metadatagroup_addmetadata.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_bool, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_createmodel.restype = ctypes.c_int32 + self.lib.lib3mf_createmodel.argtypes = [ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_object_gettype.restype = ctypes.c_int32 - self.lib.lib3mf_object_gettype.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)] + self.lib.lib3mf_release.restype = ctypes.c_int32 + self.lib.lib3mf_release.argtypes = [ctypes.c_void_p] - self.lib.lib3mf_object_settype.restype = ctypes.c_int32 - self.lib.lib3mf_object_settype.argtypes = [ctypes.c_void_p, ObjectType] + self.lib.lib3mf_acquire.restype = ctypes.c_int32 + self.lib.lib3mf_acquire.argtypes = [ctypes.c_void_p] - self.lib.lib3mf_object_getname.restype = ctypes.c_int32 - self.lib.lib3mf_object_getname.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + self.lib.lib3mf_setjournal.restype = ctypes.c_int32 + self.lib.lib3mf_setjournal.argtypes = [ctypes.c_char_p] - self.lib.lib3mf_object_setname.restype = ctypes.c_int32 - self.lib.lib3mf_object_setname.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + self.lib.lib3mf_getlasterror.restype = ctypes.c_int32 + self.lib.lib3mf_getlasterror.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p, ctypes.POINTER(ctypes.c_bool)] - self.lib.lib3mf_object_getpartnumber.restype = ctypes.c_int32 - self.lib.lib3mf_object_getpartnumber.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + self.lib.lib3mf_getsymbollookupmethod.restype = ctypes.c_int32 + self.lib.lib3mf_getsymbollookupmethod.argtypes = [ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_object_setpartnumber.restype = ctypes.c_int32 - self.lib.lib3mf_object_setpartnumber.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + self.lib.lib3mf_retrieveprogressmessage.restype = ctypes.c_int32 + self.lib.lib3mf_retrieveprogressmessage.argtypes = [ProgressIdentifier, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_object_ismeshobject.restype = ctypes.c_int32 - self.lib.lib3mf_object_ismeshobject.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] + self.lib.lib3mf_rgbatocolor.restype = ctypes.c_int32 + self.lib.lib3mf_rgbatocolor.argtypes = [ctypes.c_uint8, ctypes.c_uint8, ctypes.c_uint8, ctypes.c_uint8, ctypes.POINTER(Color)] - self.lib.lib3mf_object_iscomponentsobject.restype = ctypes.c_int32 - self.lib.lib3mf_object_iscomponentsobject.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] + self.lib.lib3mf_floatrgbatocolor.restype = ctypes.c_int32 + self.lib.lib3mf_floatrgbatocolor.argtypes = [ctypes.c_float, ctypes.c_float, ctypes.c_float, ctypes.c_float, ctypes.POINTER(Color)] - self.lib.lib3mf_object_isvalid.restype = ctypes.c_int32 - self.lib.lib3mf_object_isvalid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] + self.lib.lib3mf_colortorgba.restype = ctypes.c_int32 + self.lib.lib3mf_colortorgba.argtypes = [ctypes.POINTER(Color), ctypes.POINTER(ctypes.c_uint8), ctypes.POINTER(ctypes.c_uint8), ctypes.POINTER(ctypes.c_uint8), ctypes.POINTER(ctypes.c_uint8)] - self.lib.lib3mf_object_setattachmentasthumbnail.restype = ctypes.c_int32 - self.lib.lib3mf_object_setattachmentasthumbnail.argtypes = [ctypes.c_void_p, ctypes.c_void_p] + self.lib.lib3mf_colortofloatrgba.restype = ctypes.c_int32 + self.lib.lib3mf_colortofloatrgba.argtypes = [ctypes.POINTER(Color), ctypes.POINTER(ctypes.c_float), ctypes.POINTER(ctypes.c_float), ctypes.POINTER(ctypes.c_float), ctypes.POINTER(ctypes.c_float)] - self.lib.lib3mf_object_getthumbnailattachment.restype = ctypes.c_int32 - self.lib.lib3mf_object_getthumbnailattachment.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_getidentitytransform.restype = ctypes.c_int32 + self.lib.lib3mf_getidentitytransform.argtypes = [ctypes.POINTER(Transform)] - self.lib.lib3mf_object_clearthumbnailattachment.restype = ctypes.c_int32 - self.lib.lib3mf_object_clearthumbnailattachment.argtypes = [ctypes.c_void_p] + self.lib.lib3mf_getuniformscaletransform.restype = ctypes.c_int32 + self.lib.lib3mf_getuniformscaletransform.argtypes = [ctypes.c_float, ctypes.POINTER(Transform)] - self.lib.lib3mf_object_getoutbox.restype = ctypes.c_int32 - self.lib.lib3mf_object_getoutbox.argtypes = [ctypes.c_void_p, ctypes.POINTER(Box)] + self.lib.lib3mf_getscaletransform.restype = ctypes.c_int32 + self.lib.lib3mf_getscaletransform.argtypes = [ctypes.c_float, ctypes.c_float, ctypes.c_float, ctypes.POINTER(Transform)] - self.lib.lib3mf_object_getuuid.restype = ctypes.c_int32 - self.lib.lib3mf_object_getuuid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool), ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + self.lib.lib3mf_gettranslationtransform.restype = ctypes.c_int32 + self.lib.lib3mf_gettranslationtransform.argtypes = [ctypes.c_float, ctypes.c_float, ctypes.c_float, ctypes.POINTER(Transform)] - self.lib.lib3mf_object_setuuid.restype = ctypes.c_int32 - self.lib.lib3mf_object_setuuid.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + self.lib.lib3mf_base_classtypeid.restype = ctypes.c_int32 + self.lib.lib3mf_base_classtypeid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] - self.lib.lib3mf_object_getmetadatagroup.restype = ctypes.c_int32 - self.lib.lib3mf_object_getmetadatagroup.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_binarystream_getbinarypath.restype = ctypes.c_int32 + self.lib.lib3mf_binarystream_getbinarypath.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_object_setslicesmeshresolution.restype = ctypes.c_int32 - self.lib.lib3mf_object_setslicesmeshresolution.argtypes = [ctypes.c_void_p, SlicesMeshResolution] + self.lib.lib3mf_binarystream_getindexpath.restype = ctypes.c_int32 + self.lib.lib3mf_binarystream_getindexpath.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_object_getslicesmeshresolution.restype = ctypes.c_int32 - self.lib.lib3mf_object_getslicesmeshresolution.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)] + self.lib.lib3mf_binarystream_getuuid.restype = ctypes.c_int32 + self.lib.lib3mf_binarystream_getuuid.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_object_hasslices.restype = ctypes.c_int32 - self.lib.lib3mf_object_hasslices.argtypes = [ctypes.c_void_p, ctypes.c_bool, ctypes.POINTER(ctypes.c_bool)] + self.lib.lib3mf_binarystream_disablediscretizedarraycompression.restype = ctypes.c_int32 + self.lib.lib3mf_binarystream_disablediscretizedarraycompression.argtypes = [ctypes.c_void_p] - self.lib.lib3mf_object_clearslicestack.restype = ctypes.c_int32 - self.lib.lib3mf_object_clearslicestack.argtypes = [ctypes.c_void_p] + self.lib.lib3mf_binarystream_enablediscretizedarraycompression.restype = ctypes.c_int32 + self.lib.lib3mf_binarystream_enablediscretizedarraycompression.argtypes = [ctypes.c_void_p, ctypes.c_double, BinaryStreamPredictionType] - self.lib.lib3mf_object_getslicestack.restype = ctypes.c_int32 - self.lib.lib3mf_object_getslicestack.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_binarystream_enablelzma.restype = ctypes.c_int32 + self.lib.lib3mf_binarystream_enablelzma.argtypes = [ctypes.c_void_p, ctypes.c_uint32] - self.lib.lib3mf_object_assignslicestack.restype = ctypes.c_int32 - self.lib.lib3mf_object_assignslicestack.argtypes = [ctypes.c_void_p, ctypes.c_void_p] + self.lib.lib3mf_binarystream_disablelzma.restype = ctypes.c_int32 + self.lib.lib3mf_binarystream_disablelzma.argtypes = [ctypes.c_void_p] - self.lib.lib3mf_meshobject_getvertexcount.restype = ctypes.c_int32 - self.lib.lib3mf_meshobject_getvertexcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_writer_writetofile.restype = ctypes.c_int32 + self.lib.lib3mf_writer_writetofile.argtypes = [ctypes.c_void_p, ctypes.c_char_p] - self.lib.lib3mf_meshobject_gettrianglecount.restype = ctypes.c_int32 - self.lib.lib3mf_meshobject_gettrianglecount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_writer_getstreamsize.restype = ctypes.c_int32 + self.lib.lib3mf_writer_getstreamsize.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] - self.lib.lib3mf_meshobject_getvertex.restype = ctypes.c_int32 - self.lib.lib3mf_meshobject_getvertex.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Position)] + self.lib.lib3mf_writer_writetobuffer.restype = ctypes.c_int32 + self.lib.lib3mf_writer_writetobuffer.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint8)] - self.lib.lib3mf_meshobject_setvertex.restype = ctypes.c_int32 - self.lib.lib3mf_meshobject_setvertex.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Position)] + self.lib.lib3mf_writer_writetocallback.restype = ctypes.c_int32 + self.lib.lib3mf_writer_writetocallback.argtypes = [ctypes.c_void_p, WriteCallback, SeekCallback, ctypes.c_void_p] - self.lib.lib3mf_meshobject_addvertex.restype = ctypes.c_int32 - self.lib.lib3mf_meshobject_addvertex.argtypes = [ctypes.c_void_p, ctypes.POINTER(Position), ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_writer_setprogresscallback.restype = ctypes.c_int32 + self.lib.lib3mf_writer_setprogresscallback.argtypes = [ctypes.c_void_p, ProgressCallback, ctypes.c_void_p] - self.lib.lib3mf_meshobject_getvertices.restype = ctypes.c_int32 - self.lib.lib3mf_meshobject_getvertices.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(Position)] + self.lib.lib3mf_writer_getdecimalprecision.restype = ctypes.c_int32 + self.lib.lib3mf_writer_getdecimalprecision.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_meshobject_gettriangle.restype = ctypes.c_int32 - self.lib.lib3mf_meshobject_gettriangle.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Triangle)] + self.lib.lib3mf_writer_setdecimalprecision.restype = ctypes.c_int32 + self.lib.lib3mf_writer_setdecimalprecision.argtypes = [ctypes.c_void_p, ctypes.c_uint32] - self.lib.lib3mf_meshobject_settriangle.restype = ctypes.c_int32 - self.lib.lib3mf_meshobject_settriangle.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Triangle)] + self.lib.lib3mf_writer_setstrictmodeactive.restype = ctypes.c_int32 + self.lib.lib3mf_writer_setstrictmodeactive.argtypes = [ctypes.c_void_p, ctypes.c_bool] - self.lib.lib3mf_meshobject_addtriangle.restype = ctypes.c_int32 - self.lib.lib3mf_meshobject_addtriangle.argtypes = [ctypes.c_void_p, ctypes.POINTER(Triangle), ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_writer_getstrictmodeactive.restype = ctypes.c_int32 + self.lib.lib3mf_writer_getstrictmodeactive.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] - self.lib.lib3mf_meshobject_gettriangleindices.restype = ctypes.c_int32 - self.lib.lib3mf_meshobject_gettriangleindices.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(Triangle)] + self.lib.lib3mf_writer_getwarning.restype = ctypes.c_int32 + self.lib.lib3mf_writer_getwarning.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_uint32), ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_meshobject_setobjectlevelproperty.restype = ctypes.c_int32 - self.lib.lib3mf_meshobject_setobjectlevelproperty.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint32] + self.lib.lib3mf_writer_getwarningcount.restype = ctypes.c_int32 + self.lib.lib3mf_writer_getwarningcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_meshobject_getobjectlevelproperty.restype = ctypes.c_int32 - self.lib.lib3mf_meshobject_getobjectlevelproperty.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_bool)] + self.lib.lib3mf_writer_addkeywrappingcallback.restype = ctypes.c_int32 + self.lib.lib3mf_writer_addkeywrappingcallback.argtypes = [ctypes.c_void_p, ctypes.c_char_p, KeyWrappingCallback, ctypes.c_void_p] - self.lib.lib3mf_meshobject_settriangleproperties.restype = ctypes.c_int32 - self.lib.lib3mf_meshobject_settriangleproperties.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(TriangleProperties)] + self.lib.lib3mf_writer_setcontentencryptioncallback.restype = ctypes.c_int32 + self.lib.lib3mf_writer_setcontentencryptioncallback.argtypes = [ctypes.c_void_p, ContentEncryptionCallback, ctypes.c_void_p] - self.lib.lib3mf_meshobject_gettriangleproperties.restype = ctypes.c_int32 - self.lib.lib3mf_meshobject_gettriangleproperties.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(TriangleProperties)] + self.lib.lib3mf_writer_createbinarystream.restype = ctypes.c_int32 + self.lib.lib3mf_writer_createbinarystream.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_meshobject_setalltriangleproperties.restype = ctypes.c_int32 - self.lib.lib3mf_meshobject_setalltriangleproperties.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(TriangleProperties)] + self.lib.lib3mf_writer_assignbinarystream.restype = ctypes.c_int32 + self.lib.lib3mf_writer_assignbinarystream.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p] - self.lib.lib3mf_meshobject_getalltriangleproperties.restype = ctypes.c_int32 - self.lib.lib3mf_meshobject_getalltriangleproperties.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(TriangleProperties)] + self.lib.lib3mf_writer_registercustomnamespace.restype = ctypes.c_int32 + self.lib.lib3mf_writer_registercustomnamespace.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p] - self.lib.lib3mf_meshobject_clearallproperties.restype = ctypes.c_int32 - self.lib.lib3mf_meshobject_clearallproperties.argtypes = [ctypes.c_void_p] + self.lib.lib3mf_persistentreadersource_getsourcetype.restype = ctypes.c_int32 + self.lib.lib3mf_persistentreadersource_getsourcetype.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)] - self.lib.lib3mf_meshobject_setgeometry.restype = ctypes.c_int32 - self.lib.lib3mf_meshobject_setgeometry.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(Position), ctypes.c_uint64, ctypes.POINTER(Triangle)] + self.lib.lib3mf_persistentreadersource_invalidatesourcedata.restype = ctypes.c_int32 + self.lib.lib3mf_persistentreadersource_invalidatesourcedata.argtypes = [ctypes.c_void_p] - self.lib.lib3mf_meshobject_ismanifoldandoriented.restype = ctypes.c_int32 - self.lib.lib3mf_meshobject_ismanifoldandoriented.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] + self.lib.lib3mf_persistentreadersource_sourcedataisvalid.restype = ctypes.c_int32 + self.lib.lib3mf_persistentreadersource_sourcedataisvalid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] - self.lib.lib3mf_meshobject_beamlattice.restype = ctypes.c_int32 - self.lib.lib3mf_meshobject_beamlattice.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_reader_readfrompersistentsource.restype = ctypes.c_int32 + self.lib.lib3mf_reader_readfrompersistentsource.argtypes = [ctypes.c_void_p, ctypes.c_void_p] - self.lib.lib3mf_beamlattice_getminlength.restype = ctypes.c_int32 - self.lib.lib3mf_beamlattice_getminlength.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_double)] + self.lib.lib3mf_reader_readfromfile.restype = ctypes.c_int32 + self.lib.lib3mf_reader_readfromfile.argtypes = [ctypes.c_void_p, ctypes.c_char_p] - self.lib.lib3mf_beamlattice_setminlength.restype = ctypes.c_int32 - self.lib.lib3mf_beamlattice_setminlength.argtypes = [ctypes.c_void_p, ctypes.c_double] + self.lib.lib3mf_reader_readfrombuffer.restype = ctypes.c_int32 + self.lib.lib3mf_reader_readfrombuffer.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint8)] - self.lib.lib3mf_beamlattice_getclipping.restype = ctypes.c_int32 - self.lib.lib3mf_beamlattice_getclipping.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_reader_readfromcallback.restype = ctypes.c_int32 + self.lib.lib3mf_reader_readfromcallback.argtypes = [ctypes.c_void_p, ReadCallback, ctypes.c_uint64, SeekCallback, ctypes.c_void_p] - self.lib.lib3mf_beamlattice_setclipping.restype = ctypes.c_int32 - self.lib.lib3mf_beamlattice_setclipping.argtypes = [ctypes.c_void_p, BeamLatticeClipMode, ctypes.c_uint32] + self.lib.lib3mf_reader_setprogresscallback.restype = ctypes.c_int32 + self.lib.lib3mf_reader_setprogresscallback.argtypes = [ctypes.c_void_p, ProgressCallback, ctypes.c_void_p] - self.lib.lib3mf_beamlattice_getrepresentation.restype = ctypes.c_int32 - self.lib.lib3mf_beamlattice_getrepresentation.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool), ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_reader_addrelationtoread.restype = ctypes.c_int32 + self.lib.lib3mf_reader_addrelationtoread.argtypes = [ctypes.c_void_p, ctypes.c_char_p] - self.lib.lib3mf_beamlattice_setrepresentation.restype = ctypes.c_int32 - self.lib.lib3mf_beamlattice_setrepresentation.argtypes = [ctypes.c_void_p, ctypes.c_uint32] + self.lib.lib3mf_reader_removerelationtoread.restype = ctypes.c_int32 + self.lib.lib3mf_reader_removerelationtoread.argtypes = [ctypes.c_void_p, ctypes.c_char_p] - self.lib.lib3mf_beamlattice_getballoptions.restype = ctypes.c_int32 - self.lib.lib3mf_beamlattice_getballoptions.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_double)] + self.lib.lib3mf_reader_setstrictmodeactive.restype = ctypes.c_int32 + self.lib.lib3mf_reader_setstrictmodeactive.argtypes = [ctypes.c_void_p, ctypes.c_bool] - self.lib.lib3mf_beamlattice_setballoptions.restype = ctypes.c_int32 - self.lib.lib3mf_beamlattice_setballoptions.argtypes = [ctypes.c_void_p, BeamLatticeBallMode, ctypes.c_double] + self.lib.lib3mf_reader_getstrictmodeactive.restype = ctypes.c_int32 + self.lib.lib3mf_reader_getstrictmodeactive.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] - self.lib.lib3mf_beamlattice_getbeamcount.restype = ctypes.c_int32 - self.lib.lib3mf_beamlattice_getbeamcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_reader_getwarning.restype = ctypes.c_int32 + self.lib.lib3mf_reader_getwarning.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_uint32), ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_beamlattice_getbeam.restype = ctypes.c_int32 - self.lib.lib3mf_beamlattice_getbeam.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Beam)] + self.lib.lib3mf_reader_getwarningcount.restype = ctypes.c_int32 + self.lib.lib3mf_reader_getwarningcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_beamlattice_addbeam.restype = ctypes.c_int32 - self.lib.lib3mf_beamlattice_addbeam.argtypes = [ctypes.c_void_p, ctypes.POINTER(Beam), ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_reader_addkeywrappingcallback.restype = ctypes.c_int32 + self.lib.lib3mf_reader_addkeywrappingcallback.argtypes = [ctypes.c_void_p, ctypes.c_char_p, KeyWrappingCallback, ctypes.c_void_p] - self.lib.lib3mf_beamlattice_setbeam.restype = ctypes.c_int32 - self.lib.lib3mf_beamlattice_setbeam.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Beam)] + self.lib.lib3mf_reader_setcontentencryptioncallback.restype = ctypes.c_int32 + self.lib.lib3mf_reader_setcontentencryptioncallback.argtypes = [ctypes.c_void_p, ContentEncryptionCallback, ctypes.c_void_p] - self.lib.lib3mf_beamlattice_setbeams.restype = ctypes.c_int32 - self.lib.lib3mf_beamlattice_setbeams.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(Beam)] + self.lib.lib3mf_packagepart_getpath.restype = ctypes.c_int32 + self.lib.lib3mf_packagepart_getpath.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_beamlattice_getbeams.restype = ctypes.c_int32 - self.lib.lib3mf_beamlattice_getbeams.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(Beam)] + self.lib.lib3mf_packagepart_setpath.restype = ctypes.c_int32 + self.lib.lib3mf_packagepart_setpath.argtypes = [ctypes.c_void_p, ctypes.c_char_p] - self.lib.lib3mf_beamlattice_getballcount.restype = ctypes.c_int32 - self.lib.lib3mf_beamlattice_getballcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_resource_getresourceid.restype = ctypes.c_int32 + self.lib.lib3mf_resource_getresourceid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_beamlattice_getball.restype = ctypes.c_int32 - self.lib.lib3mf_beamlattice_getball.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Ball)] + self.lib.lib3mf_resource_getuniqueresourceid.restype = ctypes.c_int32 + self.lib.lib3mf_resource_getuniqueresourceid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_beamlattice_addball.restype = ctypes.c_int32 - self.lib.lib3mf_beamlattice_addball.argtypes = [ctypes.c_void_p, ctypes.POINTER(Ball), ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_resource_packagepart.restype = ctypes.c_int32 + self.lib.lib3mf_resource_packagepart.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_beamlattice_setball.restype = ctypes.c_int32 - self.lib.lib3mf_beamlattice_setball.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Ball)] + self.lib.lib3mf_resource_setpackagepart.restype = ctypes.c_int32 + self.lib.lib3mf_resource_setpackagepart.argtypes = [ctypes.c_void_p, ctypes.c_void_p] - self.lib.lib3mf_beamlattice_setballs.restype = ctypes.c_int32 - self.lib.lib3mf_beamlattice_setballs.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(Ball)] + self.lib.lib3mf_resource_getmodelresourceid.restype = ctypes.c_int32 + self.lib.lib3mf_resource_getmodelresourceid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_beamlattice_getballs.restype = ctypes.c_int32 - self.lib.lib3mf_beamlattice_getballs.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(Ball)] + self.lib.lib3mf_resourceiterator_movenext.restype = ctypes.c_int32 + self.lib.lib3mf_resourceiterator_movenext.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] - self.lib.lib3mf_beamlattice_getbeamsetcount.restype = ctypes.c_int32 - self.lib.lib3mf_beamlattice_getbeamsetcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_resourceiterator_moveprevious.restype = ctypes.c_int32 + self.lib.lib3mf_resourceiterator_moveprevious.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] - self.lib.lib3mf_beamlattice_addbeamset.restype = ctypes.c_int32 - self.lib.lib3mf_beamlattice_addbeamset.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_resourceiterator_getcurrent.restype = ctypes.c_int32 + self.lib.lib3mf_resourceiterator_getcurrent.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_beamlattice_getbeamset.restype = ctypes.c_int32 - self.lib.lib3mf_beamlattice_getbeamset.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_resourceiterator_clone.restype = ctypes.c_int32 + self.lib.lib3mf_resourceiterator_clone.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_component_getobjectresource.restype = ctypes.c_int32 - self.lib.lib3mf_component_getobjectresource.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_resourceiterator_count.restype = ctypes.c_int32 + self.lib.lib3mf_resourceiterator_count.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] - self.lib.lib3mf_component_getobjectresourceid.restype = ctypes.c_int32 - self.lib.lib3mf_component_getobjectresourceid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_customxmlattribute_getname.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlattribute_getname.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_component_getuuid.restype = ctypes.c_int32 - self.lib.lib3mf_component_getuuid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool), ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + self.lib.lib3mf_customxmlattribute_getvalue.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlattribute_getvalue.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_component_setuuid.restype = ctypes.c_int32 - self.lib.lib3mf_component_setuuid.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + self.lib.lib3mf_customxmlattribute_isvalidinteger.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlattribute_isvalidinteger.argtypes = [ctypes.c_void_p, ctypes.c_int64, ctypes.c_int64, ctypes.POINTER(ctypes.c_bool)] - self.lib.lib3mf_component_hastransform.restype = ctypes.c_int32 - self.lib.lib3mf_component_hastransform.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] + self.lib.lib3mf_customxmlattribute_getintegervalue.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlattribute_getintegervalue.argtypes = [ctypes.c_void_p, ctypes.c_int64, ctypes.c_int64, ctypes.POINTER(ctypes.c_int64)] - self.lib.lib3mf_component_gettransform.restype = ctypes.c_int32 - self.lib.lib3mf_component_gettransform.argtypes = [ctypes.c_void_p, ctypes.POINTER(Transform)] + self.lib.lib3mf_customxmlattribute_isvaliddouble.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlattribute_isvaliddouble.argtypes = [ctypes.c_void_p, ctypes.c_double, ctypes.c_double, ctypes.POINTER(ctypes.c_bool)] - self.lib.lib3mf_component_settransform.restype = ctypes.c_int32 - self.lib.lib3mf_component_settransform.argtypes = [ctypes.c_void_p, ctypes.POINTER(Transform)] + self.lib.lib3mf_customxmlattribute_getdoublevalue.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlattribute_getdoublevalue.argtypes = [ctypes.c_void_p, ctypes.c_double, ctypes.c_double, ctypes.POINTER(ctypes.c_double)] - self.lib.lib3mf_componentsobject_addcomponent.restype = ctypes.c_int32 - self.lib.lib3mf_componentsobject_addcomponent.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(Transform), ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_customxmlattribute_isvalidbool.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlattribute_isvalidbool.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] - self.lib.lib3mf_componentsobject_getcomponent.restype = ctypes.c_int32 - self.lib.lib3mf_componentsobject_getcomponent.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_customxmlattribute_getboolvalue.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlattribute_getboolvalue.argtypes = [ctypes.c_void_p, ctypes.c_double, ctypes.c_double, ctypes.POINTER(ctypes.c_bool)] - self.lib.lib3mf_componentsobject_getcomponentcount.restype = ctypes.c_int32 - self.lib.lib3mf_componentsobject_getcomponentcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_customxmlattribute_setvalue.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlattribute_setvalue.argtypes = [ctypes.c_void_p, ctypes.c_char_p] - self.lib.lib3mf_beamset_setname.restype = ctypes.c_int32 - self.lib.lib3mf_beamset_setname.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + self.lib.lib3mf_customxmlattribute_setintegervalue.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlattribute_setintegervalue.argtypes = [ctypes.c_void_p, ctypes.c_int64] - self.lib.lib3mf_beamset_getname.restype = ctypes.c_int32 - self.lib.lib3mf_beamset_getname.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + self.lib.lib3mf_customxmlattribute_setdoublevalue.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlattribute_setdoublevalue.argtypes = [ctypes.c_void_p, ctypes.c_double] - self.lib.lib3mf_beamset_setidentifier.restype = ctypes.c_int32 - self.lib.lib3mf_beamset_setidentifier.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + self.lib.lib3mf_customxmlattribute_setboolvalue.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlattribute_setboolvalue.argtypes = [ctypes.c_void_p, ctypes.c_bool] - self.lib.lib3mf_beamset_getidentifier.restype = ctypes.c_int32 - self.lib.lib3mf_beamset_getidentifier.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + self.lib.lib3mf_customxmlattribute_remove.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlattribute_remove.argtypes = [ctypes.c_void_p] - self.lib.lib3mf_beamset_getreferencecount.restype = ctypes.c_int32 - self.lib.lib3mf_beamset_getreferencecount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_customxmlnode_getname.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnode_getname.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_beamset_setreferences.restype = ctypes.c_int32 - self.lib.lib3mf_beamset_setreferences.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_customxmlnode_getnamespace.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnode_getnamespace.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_beamset_getreferences.restype = ctypes.c_int32 - self.lib.lib3mf_beamset_getreferences.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_customxmlnode_getattributecount.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnode_getattributecount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] - self.lib.lib3mf_beamset_getballreferencecount.restype = ctypes.c_int32 - self.lib.lib3mf_beamset_getballreferencecount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_customxmlnode_getattribute.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnode_getattribute.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_beamset_setballreferences.restype = ctypes.c_int32 - self.lib.lib3mf_beamset_setballreferences.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_customxmlnode_hasattribute.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnode_hasattribute.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_bool)] - self.lib.lib3mf_beamset_getballreferences.restype = ctypes.c_int32 - self.lib.lib3mf_beamset_getballreferences.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_customxmlnode_findattribute.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnode_findattribute.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_bool, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_basematerialgroup_getcount.restype = ctypes.c_int32 - self.lib.lib3mf_basematerialgroup_getcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_customxmlnode_removeattribute.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnode_removeattribute.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_bool)] - self.lib.lib3mf_basematerialgroup_getallpropertyids.restype = ctypes.c_int32 - self.lib.lib3mf_basematerialgroup_getallpropertyids.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_customxmlnode_removeattributebyindex.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnode_removeattributebyindex.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_bool)] - self.lib.lib3mf_basematerialgroup_addmaterial.restype = ctypes.c_int32 - self.lib.lib3mf_basematerialgroup_addmaterial.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(Color), ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_customxmlnode_addattribute.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnode_addattribute.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p] - self.lib.lib3mf_basematerialgroup_removematerial.restype = ctypes.c_int32 - self.lib.lib3mf_basematerialgroup_removematerial.argtypes = [ctypes.c_void_p, ctypes.c_uint32] + self.lib.lib3mf_customxmlnode_addintegerattribute.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnode_addintegerattribute.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_int64] - self.lib.lib3mf_basematerialgroup_getname.restype = ctypes.c_int32 - self.lib.lib3mf_basematerialgroup_getname.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + self.lib.lib3mf_customxmlnode_adddoubleattribute.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnode_adddoubleattribute.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_double] - self.lib.lib3mf_basematerialgroup_setname.restype = ctypes.c_int32 - self.lib.lib3mf_basematerialgroup_setname.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_char_p] + self.lib.lib3mf_customxmlnode_addboolattribute.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnode_addboolattribute.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_bool] - self.lib.lib3mf_basematerialgroup_setdisplaycolor.restype = ctypes.c_int32 - self.lib.lib3mf_basematerialgroup_setdisplaycolor.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Color)] + self.lib.lib3mf_customxmlnode_getchildren.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnode_getchildren.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_basematerialgroup_getdisplaycolor.restype = ctypes.c_int32 - self.lib.lib3mf_basematerialgroup_getdisplaycolor.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Color)] + self.lib.lib3mf_customxmlnode_countchildrenbyname.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnode_countchildrenbyname.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_uint64)] - self.lib.lib3mf_colorgroup_getcount.restype = ctypes.c_int32 - self.lib.lib3mf_colorgroup_getcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_customxmlnode_getchildrenbyname.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnode_getchildrenbyname.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_colorgroup_getallpropertyids.restype = ctypes.c_int32 - self.lib.lib3mf_colorgroup_getallpropertyids.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_customxmlnode_haschild.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnode_haschild.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_bool)] - self.lib.lib3mf_colorgroup_addcolor.restype = ctypes.c_int32 - self.lib.lib3mf_colorgroup_addcolor.argtypes = [ctypes.c_void_p, ctypes.POINTER(Color), ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_customxmlnode_hasuniquechild.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnode_hasuniquechild.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_bool)] - self.lib.lib3mf_colorgroup_removecolor.restype = ctypes.c_int32 - self.lib.lib3mf_colorgroup_removecolor.argtypes = [ctypes.c_void_p, ctypes.c_uint32] + self.lib.lib3mf_customxmlnode_findchild.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnode_findchild.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_bool, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_colorgroup_setcolor.restype = ctypes.c_int32 - self.lib.lib3mf_colorgroup_setcolor.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Color)] + self.lib.lib3mf_customxmlnode_addchild.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnode_addchild.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_colorgroup_getcolor.restype = ctypes.c_int32 - self.lib.lib3mf_colorgroup_getcolor.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Color)] + self.lib.lib3mf_customxmlnode_removechild.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnode_removechild.argtypes = [ctypes.c_void_p, ctypes.c_void_p] - self.lib.lib3mf_texture2dgroup_getcount.restype = ctypes.c_int32 - self.lib.lib3mf_texture2dgroup_getcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_customxmlnode_removechildrenwithname.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnode_removechildrenwithname.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_uint64)] - self.lib.lib3mf_texture2dgroup_getallpropertyids.restype = ctypes.c_int32 - self.lib.lib3mf_texture2dgroup_getallpropertyids.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_customxmlnode_remove.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnode_remove.argtypes = [ctypes.c_void_p] - self.lib.lib3mf_texture2dgroup_addtex2coord.restype = ctypes.c_int32 - self.lib.lib3mf_texture2dgroup_addtex2coord.argtypes = [ctypes.c_void_p, ctypes.POINTER(Tex2Coord), ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_customxmlnodes_getnodecount.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnodes_getnodecount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] - self.lib.lib3mf_texture2dgroup_gettex2coord.restype = ctypes.c_int32 - self.lib.lib3mf_texture2dgroup_gettex2coord.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Tex2Coord)] + self.lib.lib3mf_customxmlnodes_getnode.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnodes_getnode.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_texture2dgroup_removetex2coord.restype = ctypes.c_int32 - self.lib.lib3mf_texture2dgroup_removetex2coord.argtypes = [ctypes.c_void_p, ctypes.c_uint32] + self.lib.lib3mf_customxmlnodes_countnodesbyname.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnodes_countnodesbyname.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_uint64)] - self.lib.lib3mf_texture2dgroup_gettexture2d.restype = ctypes.c_int32 - self.lib.lib3mf_texture2dgroup_gettexture2d.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_customxmlnodes_getnodesbyname.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnodes_getnodesbyname.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_compositematerials_getcount.restype = ctypes.c_int32 - self.lib.lib3mf_compositematerials_getcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_customxmlnodes_hasnode.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnodes_hasnode.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_bool)] - self.lib.lib3mf_compositematerials_getallpropertyids.restype = ctypes.c_int32 - self.lib.lib3mf_compositematerials_getallpropertyids.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_customxmlnodes_hasuniquenode.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnodes_hasuniquenode.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_bool)] - self.lib.lib3mf_compositematerials_getbasematerialgroup.restype = ctypes.c_int32 - self.lib.lib3mf_compositematerials_getbasematerialgroup.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_customxmlnodes_findnode.restype = ctypes.c_int32 + self.lib.lib3mf_customxmlnodes_findnode.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_bool, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_compositematerials_addcomposite.restype = ctypes.c_int32 - self.lib.lib3mf_compositematerials_addcomposite.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(CompositeConstituent), ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_customdomtree_getnamespace.restype = ctypes.c_int32 + self.lib.lib3mf_customdomtree_getnamespace.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_compositematerials_removecomposite.restype = ctypes.c_int32 - self.lib.lib3mf_compositematerials_removecomposite.argtypes = [ctypes.c_void_p, ctypes.c_uint32] + self.lib.lib3mf_customdomtree_getrootnode.restype = ctypes.c_int32 + self.lib.lib3mf_customdomtree_getrootnode.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_compositematerials_getcomposite.restype = ctypes.c_int32 - self.lib.lib3mf_compositematerials_getcomposite.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(CompositeConstituent)] + self.lib.lib3mf_customdomtree_savetostring.restype = ctypes.c_int32 + self.lib.lib3mf_customdomtree_savetostring.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_multipropertygroup_getcount.restype = ctypes.c_int32 - self.lib.lib3mf_multipropertygroup_getcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_slicestackiterator_getcurrentslicestack.restype = ctypes.c_int32 + self.lib.lib3mf_slicestackiterator_getcurrentslicestack.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_multipropertygroup_getallpropertyids.restype = ctypes.c_int32 - self.lib.lib3mf_multipropertygroup_getallpropertyids.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_objectiterator_getcurrentobject.restype = ctypes.c_int32 + self.lib.lib3mf_objectiterator_getcurrentobject.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_multipropertygroup_addmultiproperty.restype = ctypes.c_int32 - self.lib.lib3mf_multipropertygroup_addmultiproperty.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_meshobjectiterator_getcurrentmeshobject.restype = ctypes.c_int32 + self.lib.lib3mf_meshobjectiterator_getcurrentmeshobject.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_multipropertygroup_setmultiproperty.restype = ctypes.c_int32 - self.lib.lib3mf_multipropertygroup_setmultiproperty.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_componentsobjectiterator_getcurrentcomponentsobject.restype = ctypes.c_int32 + self.lib.lib3mf_componentsobjectiterator_getcurrentcomponentsobject.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_multipropertygroup_getmultiproperty.restype = ctypes.c_int32 - self.lib.lib3mf_multipropertygroup_getmultiproperty.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_texture2diterator_getcurrenttexture2d.restype = ctypes.c_int32 + self.lib.lib3mf_texture2diterator_getcurrenttexture2d.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_multipropertygroup_removemultiproperty.restype = ctypes.c_int32 - self.lib.lib3mf_multipropertygroup_removemultiproperty.argtypes = [ctypes.c_void_p, ctypes.c_uint32] + self.lib.lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup.restype = ctypes.c_int32 + self.lib.lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_multipropertygroup_getlayercount.restype = ctypes.c_int32 - self.lib.lib3mf_multipropertygroup_getlayercount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_colorgroupiterator_getcurrentcolorgroup.restype = ctypes.c_int32 + self.lib.lib3mf_colorgroupiterator_getcurrentcolorgroup.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_multipropertygroup_addlayer.restype = ctypes.c_int32 - self.lib.lib3mf_multipropertygroup_addlayer.argtypes = [ctypes.c_void_p, ctypes.POINTER(MultiPropertyLayer), ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup.restype = ctypes.c_int32 + self.lib.lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_multipropertygroup_getlayer.restype = ctypes.c_int32 - self.lib.lib3mf_multipropertygroup_getlayer.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(MultiPropertyLayer)] + self.lib.lib3mf_compositematerialsiterator_getcurrentcompositematerials.restype = ctypes.c_int32 + self.lib.lib3mf_compositematerialsiterator_getcurrentcompositematerials.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_multipropertygroup_removelayer.restype = ctypes.c_int32 - self.lib.lib3mf_multipropertygroup_removelayer.argtypes = [ctypes.c_void_p, ctypes.c_uint32] + self.lib.lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup.restype = ctypes.c_int32 + self.lib.lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_attachment_getpath.restype = ctypes.c_int32 - self.lib.lib3mf_attachment_getpath.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + self.lib.lib3mf_metadata_getnamespace.restype = ctypes.c_int32 + self.lib.lib3mf_metadata_getnamespace.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_attachment_setpath.restype = ctypes.c_int32 - self.lib.lib3mf_attachment_setpath.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + self.lib.lib3mf_metadata_setnamespace.restype = ctypes.c_int32 + self.lib.lib3mf_metadata_setnamespace.argtypes = [ctypes.c_void_p, ctypes.c_char_p] - self.lib.lib3mf_attachment_packagepart.restype = ctypes.c_int32 - self.lib.lib3mf_attachment_packagepart.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_metadata_getname.restype = ctypes.c_int32 + self.lib.lib3mf_metadata_getname.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_attachment_getrelationshiptype.restype = ctypes.c_int32 - self.lib.lib3mf_attachment_getrelationshiptype.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + self.lib.lib3mf_metadata_setname.restype = ctypes.c_int32 + self.lib.lib3mf_metadata_setname.argtypes = [ctypes.c_void_p, ctypes.c_char_p] - self.lib.lib3mf_attachment_setrelationshiptype.restype = ctypes.c_int32 - self.lib.lib3mf_attachment_setrelationshiptype.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + self.lib.lib3mf_metadata_getkey.restype = ctypes.c_int32 + self.lib.lib3mf_metadata_getkey.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_attachment_writetofile.restype = ctypes.c_int32 - self.lib.lib3mf_attachment_writetofile.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + self.lib.lib3mf_metadata_getmustpreserve.restype = ctypes.c_int32 + self.lib.lib3mf_metadata_getmustpreserve.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] - self.lib.lib3mf_attachment_readfromfile.restype = ctypes.c_int32 - self.lib.lib3mf_attachment_readfromfile.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + self.lib.lib3mf_metadata_setmustpreserve.restype = ctypes.c_int32 + self.lib.lib3mf_metadata_setmustpreserve.argtypes = [ctypes.c_void_p, ctypes.c_bool] - self.lib.lib3mf_attachment_readfromcallback.restype = ctypes.c_int32 - self.lib.lib3mf_attachment_readfromcallback.argtypes = [ctypes.c_void_p, ReadCallback, ctypes.c_uint64, SeekCallback, ctypes.c_void_p] + self.lib.lib3mf_metadata_gettype.restype = ctypes.c_int32 + self.lib.lib3mf_metadata_gettype.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_attachment_getstreamsize.restype = ctypes.c_int32 - self.lib.lib3mf_attachment_getstreamsize.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] + self.lib.lib3mf_metadata_settype.restype = ctypes.c_int32 + self.lib.lib3mf_metadata_settype.argtypes = [ctypes.c_void_p, ctypes.c_char_p] - self.lib.lib3mf_attachment_writetobuffer.restype = ctypes.c_int32 - self.lib.lib3mf_attachment_writetobuffer.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint8)] + self.lib.lib3mf_metadata_getvalue.restype = ctypes.c_int32 + self.lib.lib3mf_metadata_getvalue.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_attachment_readfrombuffer.restype = ctypes.c_int32 - self.lib.lib3mf_attachment_readfrombuffer.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint8)] + self.lib.lib3mf_metadata_setvalue.restype = ctypes.c_int32 + self.lib.lib3mf_metadata_setvalue.argtypes = [ctypes.c_void_p, ctypes.c_char_p] - self.lib.lib3mf_texture2d_getattachment.restype = ctypes.c_int32 - self.lib.lib3mf_texture2d_getattachment.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_metadatagroup_getmetadatacount.restype = ctypes.c_int32 + self.lib.lib3mf_metadatagroup_getmetadatacount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_texture2d_setattachment.restype = ctypes.c_int32 - self.lib.lib3mf_texture2d_setattachment.argtypes = [ctypes.c_void_p, ctypes.c_void_p] + self.lib.lib3mf_metadatagroup_getmetadata.restype = ctypes.c_int32 + self.lib.lib3mf_metadatagroup_getmetadata.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_texture2d_getcontenttype.restype = ctypes.c_int32 - self.lib.lib3mf_texture2d_getcontenttype.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)] + self.lib.lib3mf_metadatagroup_getmetadatabykey.restype = ctypes.c_int32 + self.lib.lib3mf_metadatagroup_getmetadatabykey.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_texture2d_setcontenttype.restype = ctypes.c_int32 - self.lib.lib3mf_texture2d_setcontenttype.argtypes = [ctypes.c_void_p, TextureType] + self.lib.lib3mf_metadatagroup_removemetadatabyindex.restype = ctypes.c_int32 + self.lib.lib3mf_metadatagroup_removemetadatabyindex.argtypes = [ctypes.c_void_p, ctypes.c_uint32] - self.lib.lib3mf_texture2d_gettilestyleuv.restype = ctypes.c_int32 - self.lib.lib3mf_texture2d_gettilestyleuv.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_int32)] + self.lib.lib3mf_metadatagroup_removemetadata.restype = ctypes.c_int32 + self.lib.lib3mf_metadatagroup_removemetadata.argtypes = [ctypes.c_void_p, ctypes.c_void_p] - self.lib.lib3mf_texture2d_settilestyleuv.restype = ctypes.c_int32 - self.lib.lib3mf_texture2d_settilestyleuv.argtypes = [ctypes.c_void_p, TextureTileStyle, TextureTileStyle] + self.lib.lib3mf_metadatagroup_addmetadata.restype = ctypes.c_int32 + self.lib.lib3mf_metadatagroup_addmetadata.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_bool, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_texture2d_getfilter.restype = ctypes.c_int32 - self.lib.lib3mf_texture2d_getfilter.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)] + self.lib.lib3mf_object_gettype.restype = ctypes.c_int32 + self.lib.lib3mf_object_gettype.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)] - self.lib.lib3mf_texture2d_setfilter.restype = ctypes.c_int32 - self.lib.lib3mf_texture2d_setfilter.argtypes = [ctypes.c_void_p, TextureFilter] + self.lib.lib3mf_object_settype.restype = ctypes.c_int32 + self.lib.lib3mf_object_settype.argtypes = [ctypes.c_void_p, ObjectType] - self.lib.lib3mf_builditem_getobjectresource.restype = ctypes.c_int32 - self.lib.lib3mf_builditem_getobjectresource.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_object_getname.restype = ctypes.c_int32 + self.lib.lib3mf_object_getname.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_builditem_getuuid.restype = ctypes.c_int32 - self.lib.lib3mf_builditem_getuuid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool), ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + self.lib.lib3mf_object_setname.restype = ctypes.c_int32 + self.lib.lib3mf_object_setname.argtypes = [ctypes.c_void_p, ctypes.c_char_p] - self.lib.lib3mf_builditem_setuuid.restype = ctypes.c_int32 - self.lib.lib3mf_builditem_setuuid.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + self.lib.lib3mf_object_getpartnumber.restype = ctypes.c_int32 + self.lib.lib3mf_object_getpartnumber.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_builditem_getobjectresourceid.restype = ctypes.c_int32 - self.lib.lib3mf_builditem_getobjectresourceid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_object_setpartnumber.restype = ctypes.c_int32 + self.lib.lib3mf_object_setpartnumber.argtypes = [ctypes.c_void_p, ctypes.c_char_p] - self.lib.lib3mf_builditem_hasobjecttransform.restype = ctypes.c_int32 - self.lib.lib3mf_builditem_hasobjecttransform.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] + self.lib.lib3mf_object_ismeshobject.restype = ctypes.c_int32 + self.lib.lib3mf_object_ismeshobject.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] - self.lib.lib3mf_builditem_getobjecttransform.restype = ctypes.c_int32 - self.lib.lib3mf_builditem_getobjecttransform.argtypes = [ctypes.c_void_p, ctypes.POINTER(Transform)] + self.lib.lib3mf_object_iscomponentsobject.restype = ctypes.c_int32 + self.lib.lib3mf_object_iscomponentsobject.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] - self.lib.lib3mf_builditem_setobjecttransform.restype = ctypes.c_int32 - self.lib.lib3mf_builditem_setobjecttransform.argtypes = [ctypes.c_void_p, ctypes.POINTER(Transform)] + self.lib.lib3mf_object_isvalid.restype = ctypes.c_int32 + self.lib.lib3mf_object_isvalid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] - self.lib.lib3mf_builditem_getpartnumber.restype = ctypes.c_int32 - self.lib.lib3mf_builditem_getpartnumber.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + self.lib.lib3mf_object_setattachmentasthumbnail.restype = ctypes.c_int32 + self.lib.lib3mf_object_setattachmentasthumbnail.argtypes = [ctypes.c_void_p, ctypes.c_void_p] - self.lib.lib3mf_builditem_setpartnumber.restype = ctypes.c_int32 - self.lib.lib3mf_builditem_setpartnumber.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + self.lib.lib3mf_object_getthumbnailattachment.restype = ctypes.c_int32 + self.lib.lib3mf_object_getthumbnailattachment.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_builditem_getmetadatagroup.restype = ctypes.c_int32 - self.lib.lib3mf_builditem_getmetadatagroup.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_object_clearthumbnailattachment.restype = ctypes.c_int32 + self.lib.lib3mf_object_clearthumbnailattachment.argtypes = [ctypes.c_void_p] - self.lib.lib3mf_builditem_getoutbox.restype = ctypes.c_int32 - self.lib.lib3mf_builditem_getoutbox.argtypes = [ctypes.c_void_p, ctypes.POINTER(Box)] + self.lib.lib3mf_object_getoutbox.restype = ctypes.c_int32 + self.lib.lib3mf_object_getoutbox.argtypes = [ctypes.c_void_p, ctypes.POINTER(Box)] - self.lib.lib3mf_builditemiterator_movenext.restype = ctypes.c_int32 - self.lib.lib3mf_builditemiterator_movenext.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] + self.lib.lib3mf_object_getuuid.restype = ctypes.c_int32 + self.lib.lib3mf_object_getuuid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool), ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_builditemiterator_moveprevious.restype = ctypes.c_int32 - self.lib.lib3mf_builditemiterator_moveprevious.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] + self.lib.lib3mf_object_setuuid.restype = ctypes.c_int32 + self.lib.lib3mf_object_setuuid.argtypes = [ctypes.c_void_p, ctypes.c_char_p] - self.lib.lib3mf_builditemiterator_getcurrent.restype = ctypes.c_int32 - self.lib.lib3mf_builditemiterator_getcurrent.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_object_getmetadatagroup.restype = ctypes.c_int32 + self.lib.lib3mf_object_getmetadatagroup.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_builditemiterator_clone.restype = ctypes.c_int32 - self.lib.lib3mf_builditemiterator_clone.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_object_setslicesmeshresolution.restype = ctypes.c_int32 + self.lib.lib3mf_object_setslicesmeshresolution.argtypes = [ctypes.c_void_p, SlicesMeshResolution] - self.lib.lib3mf_builditemiterator_count.restype = ctypes.c_int32 - self.lib.lib3mf_builditemiterator_count.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] + self.lib.lib3mf_object_getslicesmeshresolution.restype = ctypes.c_int32 + self.lib.lib3mf_object_getslicesmeshresolution.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)] - self.lib.lib3mf_slice_setvertices.restype = ctypes.c_int32 - self.lib.lib3mf_slice_setvertices.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(Position2D)] + self.lib.lib3mf_object_hasslices.restype = ctypes.c_int32 + self.lib.lib3mf_object_hasslices.argtypes = [ctypes.c_void_p, ctypes.c_bool, ctypes.POINTER(ctypes.c_bool)] - self.lib.lib3mf_slice_getvertices.restype = ctypes.c_int32 - self.lib.lib3mf_slice_getvertices.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(Position2D)] + self.lib.lib3mf_object_clearslicestack.restype = ctypes.c_int32 + self.lib.lib3mf_object_clearslicestack.argtypes = [ctypes.c_void_p] - self.lib.lib3mf_slice_getvertexcount.restype = ctypes.c_int32 - self.lib.lib3mf_slice_getvertexcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] + self.lib.lib3mf_object_getslicestack.restype = ctypes.c_int32 + self.lib.lib3mf_object_getslicestack.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_slice_addpolygon.restype = ctypes.c_int32 - self.lib.lib3mf_slice_addpolygon.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint64)] + self.lib.lib3mf_object_assignslicestack.restype = ctypes.c_int32 + self.lib.lib3mf_object_assignslicestack.argtypes = [ctypes.c_void_p, ctypes.c_void_p] - self.lib.lib3mf_slice_getpolygoncount.restype = ctypes.c_int32 - self.lib.lib3mf_slice_getpolygoncount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] + self.lib.lib3mf_meshobject_getvertexcount.restype = ctypes.c_int32 + self.lib.lib3mf_meshobject_getvertexcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_slice_setpolygonindices.restype = ctypes.c_int32 - self.lib.lib3mf_slice_setpolygonindices.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_meshobject_gettrianglecount.restype = ctypes.c_int32 + self.lib.lib3mf_meshobject_gettrianglecount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_slice_getpolygonindices.restype = ctypes.c_int32 - self.lib.lib3mf_slice_getpolygonindices.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_meshobject_getvertex.restype = ctypes.c_int32 + self.lib.lib3mf_meshobject_getvertex.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Position)] - self.lib.lib3mf_slice_getpolygonindexcount.restype = ctypes.c_int32 - self.lib.lib3mf_slice_getpolygonindexcount.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64)] + self.lib.lib3mf_meshobject_setvertex.restype = ctypes.c_int32 + self.lib.lib3mf_meshobject_setvertex.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Position)] - self.lib.lib3mf_slice_getztop.restype = ctypes.c_int32 - self.lib.lib3mf_slice_getztop.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_double)] + self.lib.lib3mf_meshobject_addvertex.restype = ctypes.c_int32 + self.lib.lib3mf_meshobject_addvertex.argtypes = [ctypes.c_void_p, ctypes.POINTER(Position), ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_slicestack_getbottomz.restype = ctypes.c_int32 - self.lib.lib3mf_slicestack_getbottomz.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_double)] + self.lib.lib3mf_meshobject_getvertices.restype = ctypes.c_int32 + self.lib.lib3mf_meshobject_getvertices.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(Position)] - self.lib.lib3mf_slicestack_getslicecount.restype = ctypes.c_int32 - self.lib.lib3mf_slicestack_getslicecount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] + self.lib.lib3mf_meshobject_gettriangle.restype = ctypes.c_int32 + self.lib.lib3mf_meshobject_gettriangle.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Triangle)] - self.lib.lib3mf_slicestack_getslice.restype = ctypes.c_int32 - self.lib.lib3mf_slicestack_getslice.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_meshobject_settriangle.restype = ctypes.c_int32 + self.lib.lib3mf_meshobject_settriangle.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Triangle)] - self.lib.lib3mf_slicestack_addslice.restype = ctypes.c_int32 - self.lib.lib3mf_slicestack_addslice.argtypes = [ctypes.c_void_p, ctypes.c_double, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_meshobject_addtriangle.restype = ctypes.c_int32 + self.lib.lib3mf_meshobject_addtriangle.argtypes = [ctypes.c_void_p, ctypes.POINTER(Triangle), ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_slicestack_getslicerefcount.restype = ctypes.c_int32 - self.lib.lib3mf_slicestack_getslicerefcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] + self.lib.lib3mf_meshobject_gettriangleindices.restype = ctypes.c_int32 + self.lib.lib3mf_meshobject_gettriangleindices.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(Triangle)] - self.lib.lib3mf_slicestack_addslicestackreference.restype = ctypes.c_int32 - self.lib.lib3mf_slicestack_addslicestackreference.argtypes = [ctypes.c_void_p, ctypes.c_void_p] + self.lib.lib3mf_meshobject_setobjectlevelproperty.restype = ctypes.c_int32 + self.lib.lib3mf_meshobject_setobjectlevelproperty.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint32] - self.lib.lib3mf_slicestack_getslicestackreference.restype = ctypes.c_int32 - self.lib.lib3mf_slicestack_getslicestackreference.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_meshobject_getobjectlevelproperty.restype = ctypes.c_int32 + self.lib.lib3mf_meshobject_getobjectlevelproperty.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_bool)] - self.lib.lib3mf_slicestack_collapseslicereferences.restype = ctypes.c_int32 - self.lib.lib3mf_slicestack_collapseslicereferences.argtypes = [ctypes.c_void_p] + self.lib.lib3mf_meshobject_settriangleproperties.restype = ctypes.c_int32 + self.lib.lib3mf_meshobject_settriangleproperties.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(TriangleProperties)] - self.lib.lib3mf_slicestack_setownpath.restype = ctypes.c_int32 - self.lib.lib3mf_slicestack_setownpath.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + self.lib.lib3mf_meshobject_gettriangleproperties.restype = ctypes.c_int32 + self.lib.lib3mf_meshobject_gettriangleproperties.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(TriangleProperties)] - self.lib.lib3mf_slicestack_getownpath.restype = ctypes.c_int32 - self.lib.lib3mf_slicestack_getownpath.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + self.lib.lib3mf_meshobject_setalltriangleproperties.restype = ctypes.c_int32 + self.lib.lib3mf_meshobject_setalltriangleproperties.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(TriangleProperties)] - self.lib.lib3mf_consumer_getconsumerid.restype = ctypes.c_int32 - self.lib.lib3mf_consumer_getconsumerid.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + self.lib.lib3mf_meshobject_getalltriangleproperties.restype = ctypes.c_int32 + self.lib.lib3mf_meshobject_getalltriangleproperties.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(TriangleProperties)] - self.lib.lib3mf_consumer_getkeyid.restype = ctypes.c_int32 - self.lib.lib3mf_consumer_getkeyid.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + self.lib.lib3mf_meshobject_clearallproperties.restype = ctypes.c_int32 + self.lib.lib3mf_meshobject_clearallproperties.argtypes = [ctypes.c_void_p] - self.lib.lib3mf_consumer_getkeyvalue.restype = ctypes.c_int32 - self.lib.lib3mf_consumer_getkeyvalue.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + self.lib.lib3mf_meshobject_setgeometry.restype = ctypes.c_int32 + self.lib.lib3mf_meshobject_setgeometry.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(Position), ctypes.c_uint64, ctypes.POINTER(Triangle)] - self.lib.lib3mf_accessright_getconsumer.restype = ctypes.c_int32 - self.lib.lib3mf_accessright_getconsumer.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_meshobject_ismanifoldandoriented.restype = ctypes.c_int32 + self.lib.lib3mf_meshobject_ismanifoldandoriented.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] - self.lib.lib3mf_accessright_getwrappingalgorithm.restype = ctypes.c_int32 - self.lib.lib3mf_accessright_getwrappingalgorithm.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)] + self.lib.lib3mf_meshobject_beamlattice.restype = ctypes.c_int32 + self.lib.lib3mf_meshobject_beamlattice.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_accessright_getmgfalgorithm.restype = ctypes.c_int32 - self.lib.lib3mf_accessright_getmgfalgorithm.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)] + self.lib.lib3mf_beamlattice_getminlength.restype = ctypes.c_int32 + self.lib.lib3mf_beamlattice_getminlength.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_double)] - self.lib.lib3mf_accessright_getdigestmethod.restype = ctypes.c_int32 - self.lib.lib3mf_accessright_getdigestmethod.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)] + self.lib.lib3mf_beamlattice_setminlength.restype = ctypes.c_int32 + self.lib.lib3mf_beamlattice_setminlength.argtypes = [ctypes.c_void_p, ctypes.c_double] - self.lib.lib3mf_contentencryptionparams_getencryptionalgorithm.restype = ctypes.c_int32 - self.lib.lib3mf_contentencryptionparams_getencryptionalgorithm.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)] + self.lib.lib3mf_beamlattice_getclipping.restype = ctypes.c_int32 + self.lib.lib3mf_beamlattice_getclipping.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_contentencryptionparams_getkey.restype = ctypes.c_int32 - self.lib.lib3mf_contentencryptionparams_getkey.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint8)] + self.lib.lib3mf_beamlattice_setclipping.restype = ctypes.c_int32 + self.lib.lib3mf_beamlattice_setclipping.argtypes = [ctypes.c_void_p, BeamLatticeClipMode, ctypes.c_uint32] - self.lib.lib3mf_contentencryptionparams_getinitializationvector.restype = ctypes.c_int32 - self.lib.lib3mf_contentencryptionparams_getinitializationvector.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint8)] + self.lib.lib3mf_beamlattice_getrepresentation.restype = ctypes.c_int32 + self.lib.lib3mf_beamlattice_getrepresentation.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool), ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_contentencryptionparams_getauthenticationtag.restype = ctypes.c_int32 - self.lib.lib3mf_contentencryptionparams_getauthenticationtag.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint8)] + self.lib.lib3mf_beamlattice_setrepresentation.restype = ctypes.c_int32 + self.lib.lib3mf_beamlattice_setrepresentation.argtypes = [ctypes.c_void_p, ctypes.c_uint32] - self.lib.lib3mf_contentencryptionparams_setauthenticationtag.restype = ctypes.c_int32 - self.lib.lib3mf_contentencryptionparams_setauthenticationtag.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint8)] + self.lib.lib3mf_beamlattice_getballoptions.restype = ctypes.c_int32 + self.lib.lib3mf_beamlattice_getballoptions.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_double)] - self.lib.lib3mf_contentencryptionparams_getadditionalauthenticationdata.restype = ctypes.c_int32 - self.lib.lib3mf_contentencryptionparams_getadditionalauthenticationdata.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint8)] + self.lib.lib3mf_beamlattice_setballoptions.restype = ctypes.c_int32 + self.lib.lib3mf_beamlattice_setballoptions.argtypes = [ctypes.c_void_p, BeamLatticeBallMode, ctypes.c_double] - self.lib.lib3mf_contentencryptionparams_getdescriptor.restype = ctypes.c_int32 - self.lib.lib3mf_contentencryptionparams_getdescriptor.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] + self.lib.lib3mf_beamlattice_getbeamcount.restype = ctypes.c_int32 + self.lib.lib3mf_beamlattice_getbeamcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_contentencryptionparams_getkeyuuid.restype = ctypes.c_int32 - self.lib.lib3mf_contentencryptionparams_getkeyuuid.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + self.lib.lib3mf_beamlattice_getbeam.restype = ctypes.c_int32 + self.lib.lib3mf_beamlattice_getbeam.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Beam)] - self.lib.lib3mf_resourcedata_getpath.restype = ctypes.c_int32 - self.lib.lib3mf_resourcedata_getpath.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_beamlattice_addbeam.restype = ctypes.c_int32 + self.lib.lib3mf_beamlattice_addbeam.argtypes = [ctypes.c_void_p, ctypes.POINTER(Beam), ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_resourcedata_getencryptionalgorithm.restype = ctypes.c_int32 - self.lib.lib3mf_resourcedata_getencryptionalgorithm.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)] + self.lib.lib3mf_beamlattice_setbeam.restype = ctypes.c_int32 + self.lib.lib3mf_beamlattice_setbeam.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Beam)] - self.lib.lib3mf_resourcedata_getcompression.restype = ctypes.c_int32 - self.lib.lib3mf_resourcedata_getcompression.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)] + self.lib.lib3mf_beamlattice_setbeams.restype = ctypes.c_int32 + self.lib.lib3mf_beamlattice_setbeams.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(Beam)] - self.lib.lib3mf_resourcedata_getadditionalauthenticationdata.restype = ctypes.c_int32 - self.lib.lib3mf_resourcedata_getadditionalauthenticationdata.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint8)] + self.lib.lib3mf_beamlattice_getbeams.restype = ctypes.c_int32 + self.lib.lib3mf_beamlattice_getbeams.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(Beam)] - self.lib.lib3mf_resourcedatagroup_getkeyuuid.restype = ctypes.c_int32 - self.lib.lib3mf_resourcedatagroup_getkeyuuid.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + self.lib.lib3mf_beamlattice_getballcount.restype = ctypes.c_int32 + self.lib.lib3mf_beamlattice_getballcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_resourcedatagroup_addaccessright.restype = ctypes.c_int32 - self.lib.lib3mf_resourcedatagroup_addaccessright.argtypes = [ctypes.c_void_p, ctypes.c_void_p, WrappingAlgorithm, MgfAlgorithm, DigestMethod, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_beamlattice_getball.restype = ctypes.c_int32 + self.lib.lib3mf_beamlattice_getball.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Ball)] - self.lib.lib3mf_resourcedatagroup_findaccessrightbyconsumer.restype = ctypes.c_int32 - self.lib.lib3mf_resourcedatagroup_findaccessrightbyconsumer.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_beamlattice_addball.restype = ctypes.c_int32 + self.lib.lib3mf_beamlattice_addball.argtypes = [ctypes.c_void_p, ctypes.POINTER(Ball), ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_resourcedatagroup_removeaccessright.restype = ctypes.c_int32 - self.lib.lib3mf_resourcedatagroup_removeaccessright.argtypes = [ctypes.c_void_p, ctypes.c_void_p] + self.lib.lib3mf_beamlattice_setball.restype = ctypes.c_int32 + self.lib.lib3mf_beamlattice_setball.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Ball)] - self.lib.lib3mf_keystore_addconsumer.restype = ctypes.c_int32 - self.lib.lib3mf_keystore_addconsumer.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_beamlattice_setballs.restype = ctypes.c_int32 + self.lib.lib3mf_beamlattice_setballs.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(Ball)] - self.lib.lib3mf_keystore_getconsumercount.restype = ctypes.c_int32 - self.lib.lib3mf_keystore_getconsumercount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] + self.lib.lib3mf_beamlattice_getballs.restype = ctypes.c_int32 + self.lib.lib3mf_beamlattice_getballs.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(Ball)] - self.lib.lib3mf_keystore_getconsumer.restype = ctypes.c_int32 - self.lib.lib3mf_keystore_getconsumer.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_beamlattice_getbeamsetcount.restype = ctypes.c_int32 + self.lib.lib3mf_beamlattice_getbeamsetcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_keystore_removeconsumer.restype = ctypes.c_int32 - self.lib.lib3mf_keystore_removeconsumer.argtypes = [ctypes.c_void_p, ctypes.c_void_p] + self.lib.lib3mf_beamlattice_addbeamset.restype = ctypes.c_int32 + self.lib.lib3mf_beamlattice_addbeamset.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_keystore_findconsumer.restype = ctypes.c_int32 - self.lib.lib3mf_keystore_findconsumer.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_beamlattice_getbeamset.restype = ctypes.c_int32 + self.lib.lib3mf_beamlattice_getbeamset.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_keystore_getresourcedatagroupcount.restype = ctypes.c_int32 - self.lib.lib3mf_keystore_getresourcedatagroupcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] + self.lib.lib3mf_component_getobjectresource.restype = ctypes.c_int32 + self.lib.lib3mf_component_getobjectresource.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_keystore_addresourcedatagroup.restype = ctypes.c_int32 - self.lib.lib3mf_keystore_addresourcedatagroup.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_component_getobjectresourceid.restype = ctypes.c_int32 + self.lib.lib3mf_component_getobjectresourceid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_keystore_getresourcedatagroup.restype = ctypes.c_int32 - self.lib.lib3mf_keystore_getresourcedatagroup.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_component_getuuid.restype = ctypes.c_int32 + self.lib.lib3mf_component_getuuid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool), ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_keystore_removeresourcedatagroup.restype = ctypes.c_int32 - self.lib.lib3mf_keystore_removeresourcedatagroup.argtypes = [ctypes.c_void_p, ctypes.c_void_p] + self.lib.lib3mf_component_setuuid.restype = ctypes.c_int32 + self.lib.lib3mf_component_setuuid.argtypes = [ctypes.c_void_p, ctypes.c_char_p] - self.lib.lib3mf_keystore_findresourcedatagroup.restype = ctypes.c_int32 - self.lib.lib3mf_keystore_findresourcedatagroup.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_component_hastransform.restype = ctypes.c_int32 + self.lib.lib3mf_component_hastransform.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] - self.lib.lib3mf_keystore_addresourcedata.restype = ctypes.c_int32 - self.lib.lib3mf_keystore_addresourcedata.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p, EncryptionAlgorithm, Compression, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint8), ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_component_gettransform.restype = ctypes.c_int32 + self.lib.lib3mf_component_gettransform.argtypes = [ctypes.c_void_p, ctypes.POINTER(Transform)] - self.lib.lib3mf_keystore_removeresourcedata.restype = ctypes.c_int32 - self.lib.lib3mf_keystore_removeresourcedata.argtypes = [ctypes.c_void_p, ctypes.c_void_p] + self.lib.lib3mf_component_settransform.restype = ctypes.c_int32 + self.lib.lib3mf_component_settransform.argtypes = [ctypes.c_void_p, ctypes.POINTER(Transform)] - self.lib.lib3mf_keystore_findresourcedata.restype = ctypes.c_int32 - self.lib.lib3mf_keystore_findresourcedata.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_componentsobject_addcomponent.restype = ctypes.c_int32 + self.lib.lib3mf_componentsobject_addcomponent.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(Transform), ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_keystore_getresourcedatacount.restype = ctypes.c_int32 - self.lib.lib3mf_keystore_getresourcedatacount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] + self.lib.lib3mf_componentsobject_getcomponent.restype = ctypes.c_int32 + self.lib.lib3mf_componentsobject_getcomponent.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_keystore_getresourcedata.restype = ctypes.c_int32 - self.lib.lib3mf_keystore_getresourcedata.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_componentsobject_getcomponentcount.restype = ctypes.c_int32 + self.lib.lib3mf_componentsobject_getcomponentcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_keystore_getuuid.restype = ctypes.c_int32 - self.lib.lib3mf_keystore_getuuid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool), ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + self.lib.lib3mf_beamset_setname.restype = ctypes.c_int32 + self.lib.lib3mf_beamset_setname.argtypes = [ctypes.c_void_p, ctypes.c_char_p] - self.lib.lib3mf_keystore_setuuid.restype = ctypes.c_int32 - self.lib.lib3mf_keystore_setuuid.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + self.lib.lib3mf_beamset_getname.restype = ctypes.c_int32 + self.lib.lib3mf_beamset_getname.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_model_rootmodelpart.restype = ctypes.c_int32 - self.lib.lib3mf_model_rootmodelpart.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_beamset_setidentifier.restype = ctypes.c_int32 + self.lib.lib3mf_beamset_setidentifier.argtypes = [ctypes.c_void_p, ctypes.c_char_p] - self.lib.lib3mf_model_findorcreatepackagepart.restype = ctypes.c_int32 - self.lib.lib3mf_model_findorcreatepackagepart.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_beamset_getidentifier.restype = ctypes.c_int32 + self.lib.lib3mf_beamset_getidentifier.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_model_setunit.restype = ctypes.c_int32 - self.lib.lib3mf_model_setunit.argtypes = [ctypes.c_void_p, ModelUnit] + self.lib.lib3mf_beamset_getreferencecount.restype = ctypes.c_int32 + self.lib.lib3mf_beamset_getreferencecount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_model_getunit.restype = ctypes.c_int32 - self.lib.lib3mf_model_getunit.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)] + self.lib.lib3mf_beamset_setreferences.restype = ctypes.c_int32 + self.lib.lib3mf_beamset_setreferences.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_model_getlanguage.restype = ctypes.c_int32 - self.lib.lib3mf_model_getlanguage.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + self.lib.lib3mf_beamset_getreferences.restype = ctypes.c_int32 + self.lib.lib3mf_beamset_getreferences.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_model_setlanguage.restype = ctypes.c_int32 - self.lib.lib3mf_model_setlanguage.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + self.lib.lib3mf_beamset_getballreferencecount.restype = ctypes.c_int32 + self.lib.lib3mf_beamset_getballreferencecount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_model_querywriter.restype = ctypes.c_int32 - self.lib.lib3mf_model_querywriter.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_beamset_setballreferences.restype = ctypes.c_int32 + self.lib.lib3mf_beamset_setballreferences.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_model_queryreader.restype = ctypes.c_int32 - self.lib.lib3mf_model_queryreader.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_beamset_getballreferences.restype = ctypes.c_int32 + self.lib.lib3mf_beamset_getballreferences.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_model_getresourcebyid.restype = ctypes.c_int32 - self.lib.lib3mf_model_getresourcebyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_basematerialgroup_getcount.restype = ctypes.c_int32 + self.lib.lib3mf_basematerialgroup_getcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_model_gettexture2dbyid.restype = ctypes.c_int32 - self.lib.lib3mf_model_gettexture2dbyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_basematerialgroup_getallpropertyids.restype = ctypes.c_int32 + self.lib.lib3mf_basematerialgroup_getallpropertyids.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_model_getpropertytypebyid.restype = ctypes.c_int32 - self.lib.lib3mf_model_getpropertytypebyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_int32)] + self.lib.lib3mf_basematerialgroup_addmaterial.restype = ctypes.c_int32 + self.lib.lib3mf_basematerialgroup_addmaterial.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(Color), ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_model_getbasematerialgroupbyid.restype = ctypes.c_int32 - self.lib.lib3mf_model_getbasematerialgroupbyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_basematerialgroup_removematerial.restype = ctypes.c_int32 + self.lib.lib3mf_basematerialgroup_removematerial.argtypes = [ctypes.c_void_p, ctypes.c_uint32] - self.lib.lib3mf_model_gettexture2dgroupbyid.restype = ctypes.c_int32 - self.lib.lib3mf_model_gettexture2dgroupbyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_basematerialgroup_getname.restype = ctypes.c_int32 + self.lib.lib3mf_basematerialgroup_getname.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_model_getcompositematerialsbyid.restype = ctypes.c_int32 - self.lib.lib3mf_model_getcompositematerialsbyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_basematerialgroup_setname.restype = ctypes.c_int32 + self.lib.lib3mf_basematerialgroup_setname.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_char_p] - self.lib.lib3mf_model_getmultipropertygroupbyid.restype = ctypes.c_int32 - self.lib.lib3mf_model_getmultipropertygroupbyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_basematerialgroup_setdisplaycolor.restype = ctypes.c_int32 + self.lib.lib3mf_basematerialgroup_setdisplaycolor.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Color)] - self.lib.lib3mf_model_getmeshobjectbyid.restype = ctypes.c_int32 - self.lib.lib3mf_model_getmeshobjectbyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_basematerialgroup_getdisplaycolor.restype = ctypes.c_int32 + self.lib.lib3mf_basematerialgroup_getdisplaycolor.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Color)] - self.lib.lib3mf_model_getcomponentsobjectbyid.restype = ctypes.c_int32 - self.lib.lib3mf_model_getcomponentsobjectbyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_colorgroup_getcount.restype = ctypes.c_int32 + self.lib.lib3mf_colorgroup_getcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_model_getcolorgroupbyid.restype = ctypes.c_int32 - self.lib.lib3mf_model_getcolorgroupbyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_colorgroup_getallpropertyids.restype = ctypes.c_int32 + self.lib.lib3mf_colorgroup_getallpropertyids.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_model_getslicestackbyid.restype = ctypes.c_int32 - self.lib.lib3mf_model_getslicestackbyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_colorgroup_addcolor.restype = ctypes.c_int32 + self.lib.lib3mf_colorgroup_addcolor.argtypes = [ctypes.c_void_p, ctypes.POINTER(Color), ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_model_getbuilduuid.restype = ctypes.c_int32 - self.lib.lib3mf_model_getbuilduuid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool), ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + self.lib.lib3mf_colorgroup_removecolor.restype = ctypes.c_int32 + self.lib.lib3mf_colorgroup_removecolor.argtypes = [ctypes.c_void_p, ctypes.c_uint32] - self.lib.lib3mf_model_setbuilduuid.restype = ctypes.c_int32 - self.lib.lib3mf_model_setbuilduuid.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + self.lib.lib3mf_colorgroup_setcolor.restype = ctypes.c_int32 + self.lib.lib3mf_colorgroup_setcolor.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Color)] - self.lib.lib3mf_model_getbuilditems.restype = ctypes.c_int32 - self.lib.lib3mf_model_getbuilditems.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_colorgroup_getcolor.restype = ctypes.c_int32 + self.lib.lib3mf_colorgroup_getcolor.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Color)] - self.lib.lib3mf_model_getoutbox.restype = ctypes.c_int32 - self.lib.lib3mf_model_getoutbox.argtypes = [ctypes.c_void_p, ctypes.POINTER(Box)] + self.lib.lib3mf_texture2dgroup_getcount.restype = ctypes.c_int32 + self.lib.lib3mf_texture2dgroup_getcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_model_getresources.restype = ctypes.c_int32 - self.lib.lib3mf_model_getresources.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_texture2dgroup_getallpropertyids.restype = ctypes.c_int32 + self.lib.lib3mf_texture2dgroup_getallpropertyids.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_model_getobjects.restype = ctypes.c_int32 - self.lib.lib3mf_model_getobjects.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_texture2dgroup_addtex2coord.restype = ctypes.c_int32 + self.lib.lib3mf_texture2dgroup_addtex2coord.argtypes = [ctypes.c_void_p, ctypes.POINTER(Tex2Coord), ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_model_getmeshobjects.restype = ctypes.c_int32 - self.lib.lib3mf_model_getmeshobjects.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_texture2dgroup_gettex2coord.restype = ctypes.c_int32 + self.lib.lib3mf_texture2dgroup_gettex2coord.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(Tex2Coord)] - self.lib.lib3mf_model_getcomponentsobjects.restype = ctypes.c_int32 - self.lib.lib3mf_model_getcomponentsobjects.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_texture2dgroup_removetex2coord.restype = ctypes.c_int32 + self.lib.lib3mf_texture2dgroup_removetex2coord.argtypes = [ctypes.c_void_p, ctypes.c_uint32] - self.lib.lib3mf_model_gettexture2ds.restype = ctypes.c_int32 - self.lib.lib3mf_model_gettexture2ds.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_texture2dgroup_gettexture2d.restype = ctypes.c_int32 + self.lib.lib3mf_texture2dgroup_gettexture2d.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_model_getbasematerialgroups.restype = ctypes.c_int32 - self.lib.lib3mf_model_getbasematerialgroups.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_compositematerials_getcount.restype = ctypes.c_int32 + self.lib.lib3mf_compositematerials_getcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_model_getcolorgroups.restype = ctypes.c_int32 - self.lib.lib3mf_model_getcolorgroups.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_compositematerials_getallpropertyids.restype = ctypes.c_int32 + self.lib.lib3mf_compositematerials_getallpropertyids.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_model_gettexture2dgroups.restype = ctypes.c_int32 - self.lib.lib3mf_model_gettexture2dgroups.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_compositematerials_getbasematerialgroup.restype = ctypes.c_int32 + self.lib.lib3mf_compositematerials_getbasematerialgroup.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_model_getcompositematerials.restype = ctypes.c_int32 - self.lib.lib3mf_model_getcompositematerials.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_compositematerials_addcomposite.restype = ctypes.c_int32 + self.lib.lib3mf_compositematerials_addcomposite.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(CompositeConstituent), ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_model_getmultipropertygroups.restype = ctypes.c_int32 - self.lib.lib3mf_model_getmultipropertygroups.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_compositematerials_removecomposite.restype = ctypes.c_int32 + self.lib.lib3mf_compositematerials_removecomposite.argtypes = [ctypes.c_void_p, ctypes.c_uint32] - self.lib.lib3mf_model_getslicestacks.restype = ctypes.c_int32 - self.lib.lib3mf_model_getslicestacks.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_compositematerials_getcomposite.restype = ctypes.c_int32 + self.lib.lib3mf_compositematerials_getcomposite.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(CompositeConstituent)] - self.lib.lib3mf_model_mergetomodel.restype = ctypes.c_int32 - self.lib.lib3mf_model_mergetomodel.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_multipropertygroup_getcount.restype = ctypes.c_int32 + self.lib.lib3mf_multipropertygroup_getcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_model_addmeshobject.restype = ctypes.c_int32 - self.lib.lib3mf_model_addmeshobject.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_multipropertygroup_getallpropertyids.restype = ctypes.c_int32 + self.lib.lib3mf_multipropertygroup_getallpropertyids.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_model_addcomponentsobject.restype = ctypes.c_int32 - self.lib.lib3mf_model_addcomponentsobject.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_multipropertygroup_addmultiproperty.restype = ctypes.c_int32 + self.lib.lib3mf_multipropertygroup_addmultiproperty.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_model_addslicestack.restype = ctypes.c_int32 - self.lib.lib3mf_model_addslicestack.argtypes = [ctypes.c_void_p, ctypes.c_double, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_multipropertygroup_setmultiproperty.restype = ctypes.c_int32 + self.lib.lib3mf_multipropertygroup_setmultiproperty.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_model_addtexture2dfromattachment.restype = ctypes.c_int32 - self.lib.lib3mf_model_addtexture2dfromattachment.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_multipropertygroup_getmultiproperty.restype = ctypes.c_int32 + self.lib.lib3mf_multipropertygroup_getmultiproperty.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_model_addbasematerialgroup.restype = ctypes.c_int32 - self.lib.lib3mf_model_addbasematerialgroup.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_multipropertygroup_removemultiproperty.restype = ctypes.c_int32 + self.lib.lib3mf_multipropertygroup_removemultiproperty.argtypes = [ctypes.c_void_p, ctypes.c_uint32] - self.lib.lib3mf_model_addcolorgroup.restype = ctypes.c_int32 - self.lib.lib3mf_model_addcolorgroup.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_multipropertygroup_getlayercount.restype = ctypes.c_int32 + self.lib.lib3mf_multipropertygroup_getlayercount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_model_addtexture2dgroup.restype = ctypes.c_int32 - self.lib.lib3mf_model_addtexture2dgroup.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_multipropertygroup_addlayer.restype = ctypes.c_int32 + self.lib.lib3mf_multipropertygroup_addlayer.argtypes = [ctypes.c_void_p, ctypes.POINTER(MultiPropertyLayer), ctypes.POINTER(ctypes.c_uint32)] - self.lib.lib3mf_model_addcompositematerials.restype = ctypes.c_int32 - self.lib.lib3mf_model_addcompositematerials.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_multipropertygroup_getlayer.restype = ctypes.c_int32 + self.lib.lib3mf_multipropertygroup_getlayer.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(MultiPropertyLayer)] - self.lib.lib3mf_model_addmultipropertygroup.restype = ctypes.c_int32 - self.lib.lib3mf_model_addmultipropertygroup.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_multipropertygroup_removelayer.restype = ctypes.c_int32 + self.lib.lib3mf_multipropertygroup_removelayer.argtypes = [ctypes.c_void_p, ctypes.c_uint32] - self.lib.lib3mf_model_addbuilditem.restype = ctypes.c_int32 - self.lib.lib3mf_model_addbuilditem.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(Transform), ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_attachment_getpath.restype = ctypes.c_int32 + self.lib.lib3mf_attachment_getpath.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_model_removebuilditem.restype = ctypes.c_int32 - self.lib.lib3mf_model_removebuilditem.argtypes = [ctypes.c_void_p, ctypes.c_void_p] + self.lib.lib3mf_attachment_setpath.restype = ctypes.c_int32 + self.lib.lib3mf_attachment_setpath.argtypes = [ctypes.c_void_p, ctypes.c_char_p] - self.lib.lib3mf_model_getmetadatagroup.restype = ctypes.c_int32 - self.lib.lib3mf_model_getmetadatagroup.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_attachment_packagepart.restype = ctypes.c_int32 + self.lib.lib3mf_attachment_packagepart.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_model_addattachment.restype = ctypes.c_int32 - self.lib.lib3mf_model_addattachment.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_attachment_getrelationshiptype.restype = ctypes.c_int32 + self.lib.lib3mf_attachment_getrelationshiptype.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] - self.lib.lib3mf_model_removeattachment.restype = ctypes.c_int32 - self.lib.lib3mf_model_removeattachment.argtypes = [ctypes.c_void_p, ctypes.c_void_p] + self.lib.lib3mf_attachment_setrelationshiptype.restype = ctypes.c_int32 + self.lib.lib3mf_attachment_setrelationshiptype.argtypes = [ctypes.c_void_p, ctypes.c_char_p] - self.lib.lib3mf_model_getattachment.restype = ctypes.c_int32 - self.lib.lib3mf_model_getattachment.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_attachment_writetofile.restype = ctypes.c_int32 + self.lib.lib3mf_attachment_writetofile.argtypes = [ctypes.c_void_p, ctypes.c_char_p] - self.lib.lib3mf_model_findattachment.restype = ctypes.c_int32 - self.lib.lib3mf_model_findattachment.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_attachment_readfromfile.restype = ctypes.c_int32 + self.lib.lib3mf_attachment_readfromfile.argtypes = [ctypes.c_void_p, ctypes.c_char_p] - self.lib.lib3mf_model_getattachmentcount.restype = ctypes.c_int32 - self.lib.lib3mf_model_getattachmentcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + self.lib.lib3mf_attachment_readfromcallback.restype = ctypes.c_int32 + self.lib.lib3mf_attachment_readfromcallback.argtypes = [ctypes.c_void_p, ReadCallback, ctypes.c_uint64, SeekCallback, ctypes.c_void_p] - self.lib.lib3mf_model_haspackagethumbnailattachment.restype = ctypes.c_int32 - self.lib.lib3mf_model_haspackagethumbnailattachment.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] + self.lib.lib3mf_attachment_getstreamsize.restype = ctypes.c_int32 + self.lib.lib3mf_attachment_getstreamsize.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] - self.lib.lib3mf_model_createpackagethumbnailattachment.restype = ctypes.c_int32 - self.lib.lib3mf_model_createpackagethumbnailattachment.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_attachment_writetobuffer.restype = ctypes.c_int32 + self.lib.lib3mf_attachment_writetobuffer.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint8)] - self.lib.lib3mf_model_getpackagethumbnailattachment.restype = ctypes.c_int32 - self.lib.lib3mf_model_getpackagethumbnailattachment.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_attachment_readfrombuffer.restype = ctypes.c_int32 + self.lib.lib3mf_attachment_readfrombuffer.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint8)] - self.lib.lib3mf_model_removepackagethumbnailattachment.restype = ctypes.c_int32 - self.lib.lib3mf_model_removepackagethumbnailattachment.argtypes = [ctypes.c_void_p] + self.lib.lib3mf_texture2d_getattachment.restype = ctypes.c_int32 + self.lib.lib3mf_texture2d_getattachment.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] - self.lib.lib3mf_model_addcustomcontenttype.restype = ctypes.c_int32 - self.lib.lib3mf_model_addcustomcontenttype.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p] + self.lib.lib3mf_texture2d_setattachment.restype = ctypes.c_int32 + self.lib.lib3mf_texture2d_setattachment.argtypes = [ctypes.c_void_p, ctypes.c_void_p] - self.lib.lib3mf_model_removecustomcontenttype.restype = ctypes.c_int32 - self.lib.lib3mf_model_removecustomcontenttype.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + self.lib.lib3mf_texture2d_getcontenttype.restype = ctypes.c_int32 + self.lib.lib3mf_texture2d_getcontenttype.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)] - self.lib.lib3mf_model_setrandomnumbercallback.restype = ctypes.c_int32 - self.lib.lib3mf_model_setrandomnumbercallback.argtypes = [ctypes.c_void_p, RandomNumberCallback, ctypes.c_void_p] + self.lib.lib3mf_texture2d_setcontenttype.restype = ctypes.c_int32 + self.lib.lib3mf_texture2d_setcontenttype.argtypes = [ctypes.c_void_p, TextureType] - self.lib.lib3mf_model_getkeystore.restype = ctypes.c_int32 - self.lib.lib3mf_model_getkeystore.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + self.lib.lib3mf_texture2d_gettilestyleuv.restype = ctypes.c_int32 + self.lib.lib3mf_texture2d_gettilestyleuv.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_int32)] - except AttributeError as ae: - raise ELib3MFException(ErrorCodes.COULDNOTFINDLIBRARYEXPORT, ae.args[0]) - - def _checkBinaryVersion(self): - nMajor, nMinor, _ = self.GetLibraryVersion() - if (nMajor != BindingVersion.MAJOR) or (nMinor < BindingVersion.MINOR): - raise ELib3MFException(ErrorCodes.INCOMPATIBLEBINARYVERSION) - - def checkError(self, instance, errorCode): - if errorCode != ErrorCodes.SUCCESS.value: - if instance: - if instance._wrapper != self: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'invalid wrapper call') - message,_ = self.GetLastError(instance) - raise ELib3MFException(errorCode, message) - - def GetLibraryVersion(self): - pMajor = ctypes.c_uint32() - pMinor = ctypes.c_uint32() - pMicro = ctypes.c_uint32() - self.checkError(None, self.lib.lib3mf_getlibraryversion(pMajor, pMinor, pMicro)) - - return pMajor.value, pMinor.value, pMicro.value - - def GetPrereleaseInformation(self): - pHasPrereleaseInfo = ctypes.c_bool() - nPrereleaseInfoBufferSize = ctypes.c_uint64(0) - nPrereleaseInfoNeededChars = ctypes.c_uint64(0) - pPrereleaseInfoBuffer = ctypes.c_char_p(None) - self.checkError(None, self.lib.lib3mf_getprereleaseinformation(pHasPrereleaseInfo, nPrereleaseInfoBufferSize, nPrereleaseInfoNeededChars, pPrereleaseInfoBuffer)) - nPrereleaseInfoBufferSize = ctypes.c_uint64(nPrereleaseInfoNeededChars.value) - pPrereleaseInfoBuffer = (ctypes.c_char * (nPrereleaseInfoNeededChars.value))() - self.checkError(None, self.lib.lib3mf_getprereleaseinformation(pHasPrereleaseInfo, nPrereleaseInfoBufferSize, nPrereleaseInfoNeededChars, pPrereleaseInfoBuffer)) - - return pHasPrereleaseInfo.value, pPrereleaseInfoBuffer.value.decode() - - def GetBuildInformation(self): - pHasBuildInfo = ctypes.c_bool() - nBuildInformationBufferSize = ctypes.c_uint64(0) - nBuildInformationNeededChars = ctypes.c_uint64(0) - pBuildInformationBuffer = ctypes.c_char_p(None) - self.checkError(None, self.lib.lib3mf_getbuildinformation(pHasBuildInfo, nBuildInformationBufferSize, nBuildInformationNeededChars, pBuildInformationBuffer)) - nBuildInformationBufferSize = ctypes.c_uint64(nBuildInformationNeededChars.value) - pBuildInformationBuffer = (ctypes.c_char * (nBuildInformationNeededChars.value))() - self.checkError(None, self.lib.lib3mf_getbuildinformation(pHasBuildInfo, nBuildInformationBufferSize, nBuildInformationNeededChars, pBuildInformationBuffer)) - - return pHasBuildInfo.value, pBuildInformationBuffer.value.decode() - - def GetSpecificationVersion(self, SpecificationURL): - pSpecificationURL = ctypes.c_char_p(str.encode(SpecificationURL)) - pIsSupported = ctypes.c_bool() - pMajor = ctypes.c_uint32() - pMinor = ctypes.c_uint32() - pMicro = ctypes.c_uint32() - self.checkError(None, self.lib.lib3mf_getspecificationversion(pSpecificationURL, pIsSupported, pMajor, pMinor, pMicro)) - - return pIsSupported.value, pMajor.value, pMinor.value, pMicro.value - - def CreateModel(self): - ModelHandle = ctypes.c_void_p() - self.checkError(None, self.lib.lib3mf_createmodel(ModelHandle)) - if ModelHandle: - ModelObject = self._polymorphicFactory(ModelHandle) - else: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') - + self.lib.lib3mf_texture2d_settilestyleuv.restype = ctypes.c_int32 + self.lib.lib3mf_texture2d_settilestyleuv.argtypes = [ctypes.c_void_p, TextureTileStyle, TextureTileStyle] + + self.lib.lib3mf_texture2d_getfilter.restype = ctypes.c_int32 + self.lib.lib3mf_texture2d_getfilter.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)] + + self.lib.lib3mf_texture2d_setfilter.restype = ctypes.c_int32 + self.lib.lib3mf_texture2d_setfilter.argtypes = [ctypes.c_void_p, TextureFilter] + + self.lib.lib3mf_builditem_getobjectresource.restype = ctypes.c_int32 + self.lib.lib3mf_builditem_getobjectresource.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_builditem_getuuid.restype = ctypes.c_int32 + self.lib.lib3mf_builditem_getuuid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool), ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_builditem_setuuid.restype = ctypes.c_int32 + self.lib.lib3mf_builditem_setuuid.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + + self.lib.lib3mf_builditem_getobjectresourceid.restype = ctypes.c_int32 + self.lib.lib3mf_builditem_getobjectresourceid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + + self.lib.lib3mf_builditem_hasobjecttransform.restype = ctypes.c_int32 + self.lib.lib3mf_builditem_hasobjecttransform.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] + + self.lib.lib3mf_builditem_getobjecttransform.restype = ctypes.c_int32 + self.lib.lib3mf_builditem_getobjecttransform.argtypes = [ctypes.c_void_p, ctypes.POINTER(Transform)] + + self.lib.lib3mf_builditem_setobjecttransform.restype = ctypes.c_int32 + self.lib.lib3mf_builditem_setobjecttransform.argtypes = [ctypes.c_void_p, ctypes.POINTER(Transform)] + + self.lib.lib3mf_builditem_getpartnumber.restype = ctypes.c_int32 + self.lib.lib3mf_builditem_getpartnumber.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_builditem_setpartnumber.restype = ctypes.c_int32 + self.lib.lib3mf_builditem_setpartnumber.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + + self.lib.lib3mf_builditem_getmetadatagroup.restype = ctypes.c_int32 + self.lib.lib3mf_builditem_getmetadatagroup.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_builditem_getoutbox.restype = ctypes.c_int32 + self.lib.lib3mf_builditem_getoutbox.argtypes = [ctypes.c_void_p, ctypes.POINTER(Box)] + + self.lib.lib3mf_builditemiterator_movenext.restype = ctypes.c_int32 + self.lib.lib3mf_builditemiterator_movenext.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] + + self.lib.lib3mf_builditemiterator_moveprevious.restype = ctypes.c_int32 + self.lib.lib3mf_builditemiterator_moveprevious.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] + + self.lib.lib3mf_builditemiterator_getcurrent.restype = ctypes.c_int32 + self.lib.lib3mf_builditemiterator_getcurrent.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_builditemiterator_clone.restype = ctypes.c_int32 + self.lib.lib3mf_builditemiterator_clone.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_builditemiterator_count.restype = ctypes.c_int32 + self.lib.lib3mf_builditemiterator_count.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] + + self.lib.lib3mf_slice_setvertices.restype = ctypes.c_int32 + self.lib.lib3mf_slice_setvertices.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(Position2D)] + + self.lib.lib3mf_slice_getvertices.restype = ctypes.c_int32 + self.lib.lib3mf_slice_getvertices.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(Position2D)] + + self.lib.lib3mf_slice_getvertexcount.restype = ctypes.c_int32 + self.lib.lib3mf_slice_getvertexcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] + + self.lib.lib3mf_slice_addpolygon.restype = ctypes.c_int32 + self.lib.lib3mf_slice_addpolygon.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint64)] + + self.lib.lib3mf_slice_getpolygoncount.restype = ctypes.c_int32 + self.lib.lib3mf_slice_getpolygoncount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] + + self.lib.lib3mf_slice_setpolygonindices.restype = ctypes.c_int32 + self.lib.lib3mf_slice_setpolygonindices.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint32)] + + self.lib.lib3mf_slice_getpolygonindices.restype = ctypes.c_int32 + self.lib.lib3mf_slice_getpolygonindices.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint32)] + + self.lib.lib3mf_slice_getpolygonindexcount.restype = ctypes.c_int32 + self.lib.lib3mf_slice_getpolygonindexcount.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64)] + + self.lib.lib3mf_slice_getztop.restype = ctypes.c_int32 + self.lib.lib3mf_slice_getztop.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_double)] + + self.lib.lib3mf_toolpathprofile_getuuid.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathprofile_getuuid.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_toolpathprofile_getname.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathprofile_getname.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_toolpathprofile_getparametercount.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathprofile_getparametercount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + + self.lib.lib3mf_toolpathprofile_getparametername.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathprofile_getparametername.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_toolpathprofile_getparameternamespace.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathprofile_getparameternamespace.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_toolpathprofile_hasparametervalue.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathprofile_hasparametervalue.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_bool)] + + self.lib.lib3mf_toolpathprofile_getparametervalue.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathprofile_getparametervalue.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_toolpathprofile_getparametervaluedef.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathprofile_getparametervaluedef.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_toolpathprofile_getparameterdoublevalue.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathprofile_getparameterdoublevalue.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_double)] + + self.lib.lib3mf_toolpathprofile_getparameterdoublevaluedef.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathprofile_getparameterdoublevaluedef.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_double, ctypes.POINTER(ctypes.c_double)] + + self.lib.lib3mf_toolpathprofile_getparameterintegervalue.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathprofile_getparameterintegervalue.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_int64)] + + self.lib.lib3mf_toolpathprofile_getparameterintegervaluedef.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathprofile_getparameterintegervaluedef.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_int64, ctypes.POINTER(ctypes.c_int64)] + + self.lib.lib3mf_toolpathprofile_getparameterboolvalue.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathprofile_getparameterboolvalue.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_bool)] + + self.lib.lib3mf_toolpathprofile_getparameterboolvaluedef.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathprofile_getparameterboolvaluedef.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_bool, ctypes.POINTER(ctypes.c_bool)] + + self.lib.lib3mf_toolpathprofile_setname.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathprofile_setname.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + + self.lib.lib3mf_toolpathprofile_setparametervalue.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathprofile_setparametervalue.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p] + + self.lib.lib3mf_toolpathprofile_setparameterdoublevalue.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathprofile_setparameterdoublevalue.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_double] + + self.lib.lib3mf_toolpathprofile_setparameterintegervalue.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathprofile_setparameterintegervalue.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_int64] + + self.lib.lib3mf_toolpathprofile_setparameterboolvalue.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathprofile_setparameterboolvalue.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_bool] + + self.lib.lib3mf_toolpathlayerreader_getlayerdatauuid.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerreader_getlayerdatauuid.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_toolpathlayerreader_getsegmentcount.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerreader_getsegmentcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + + self.lib.lib3mf_toolpathlayerreader_getsegmentinfo.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerreader_getsegmentinfo.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_uint32)] + + self.lib.lib3mf_toolpathlayerreader_getsegmentprofile.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerreader_getsegmentprofile.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_toolpathlayerreader_getsegmentprofileuuid.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerreader_getsegmentprofileuuid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_toolpathlayerreader_getsegmentpart.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerreader_getsegmentpart.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_toolpathlayerreader_getsegmentpartuuid.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerreader_getsegmentpartuuid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_toolpathlayerreader_getsegmentlocalpartid.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerreader_getsegmentlocalpartid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_uint32)] + + self.lib.lib3mf_toolpathlayerreader_getpartuuidbylocalpartid.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerreader_getpartuuidbylocalpartid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_toolpathlayerreader_getsegmentpointdata.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerreader_getsegmentpointdata.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(Position2D)] + + self.lib.lib3mf_toolpathlayerreader_findattributeinfobyname.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerreader_findattributeinfobyname.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_int32)] + + self.lib.lib3mf_toolpathlayerreader_findattributeidbyname.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerreader_findattributeidbyname.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_uint32)] + + self.lib.lib3mf_toolpathlayerreader_findattributevaluebyname.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerreader_findattributevaluebyname.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_int32)] + + self.lib.lib3mf_toolpathlayerreader_getsegmentintegerattributebyid.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerreader_getsegmentintegerattributebyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint32, ctypes.POINTER(ctypes.c_int64)] + + self.lib.lib3mf_toolpathlayerreader_getsegmentintegerattributebyname.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerreader_getsegmentintegerattributebyname.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_int64)] + + self.lib.lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint32, ctypes.POINTER(ctypes.c_double)] + + self.lib.lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_double)] + + self.lib.lib3mf_toolpathlayerreader_getcustomdatacount.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerreader_getcustomdatacount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + + self.lib.lib3mf_toolpathlayerreader_getcustomdata.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerreader_getcustomdata.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_toolpathlayerreader_getcustomdataname.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerreader_getcustomdataname.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_toolpathlayerdata_getlayerdatauuid.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerdata_getlayerdatauuid.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_toolpathlayerdata_registerprofile.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerdata_registerprofile.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + + self.lib.lib3mf_toolpathlayerdata_registerbuilditem.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerdata_registerbuilditem.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + + self.lib.lib3mf_toolpathlayerdata_setsegmentattribute.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerdata_setsegmentattribute.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p] + + self.lib.lib3mf_toolpathlayerdata_clearsegmentattributes.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerdata_clearsegmentattributes.argtypes = [ctypes.c_void_p] + + self.lib.lib3mf_toolpathlayerdata_writehatchdata.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerdata_writehatchdata.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(Position2D)] + + self.lib.lib3mf_toolpathlayerdata_writeloop.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerdata_writeloop.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(Position2D)] + + self.lib.lib3mf_toolpathlayerdata_writepolyline.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerdata_writepolyline.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(Position2D)] + + self.lib.lib3mf_toolpathlayerdata_addcustomdata.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerdata_addcustomdata.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_toolpathlayerdata_finish.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathlayerdata_finish.argtypes = [ctypes.c_void_p] + + self.lib.lib3mf_toolpath_getunits.restype = ctypes.c_int32 + self.lib.lib3mf_toolpath_getunits.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_double)] + + self.lib.lib3mf_toolpath_getlayercount.restype = ctypes.c_int32 + self.lib.lib3mf_toolpath_getlayercount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + + self.lib.lib3mf_toolpath_getprofilecount.restype = ctypes.c_int32 + self.lib.lib3mf_toolpath_getprofilecount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + + self.lib.lib3mf_toolpath_addlayer.restype = ctypes.c_int32 + self.lib.lib3mf_toolpath_addlayer.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_char_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_toolpath_getlayerattachment.restype = ctypes.c_int32 + self.lib.lib3mf_toolpath_getlayerattachment.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_toolpath_readlayerdata.restype = ctypes.c_int32 + self.lib.lib3mf_toolpath_readlayerdata.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_toolpath_getlayerpath.restype = ctypes.c_int32 + self.lib.lib3mf_toolpath_getlayerpath.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_toolpath_getlayerzmax.restype = ctypes.c_int32 + self.lib.lib3mf_toolpath_getlayerzmax.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_uint32)] + + self.lib.lib3mf_toolpath_getlayerz.restype = ctypes.c_int32 + self.lib.lib3mf_toolpath_getlayerz.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_uint32)] + + self.lib.lib3mf_toolpath_addprofile.restype = ctypes.c_int32 + self.lib.lib3mf_toolpath_addprofile.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_toolpath_getprofile.restype = ctypes.c_int32 + self.lib.lib3mf_toolpath_getprofile.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_toolpath_getprofileuuid.restype = ctypes.c_int32 + self.lib.lib3mf_toolpath_getprofileuuid.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_toolpath_getcustomdatacount.restype = ctypes.c_int32 + self.lib.lib3mf_toolpath_getcustomdatacount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + + self.lib.lib3mf_toolpath_getcustomdata.restype = ctypes.c_int32 + self.lib.lib3mf_toolpath_getcustomdata.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_toolpath_getcustomdataname.restype = ctypes.c_int32 + self.lib.lib3mf_toolpath_getcustomdataname.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_toolpath_hasuniquecustomdata.restype = ctypes.c_int32 + self.lib.lib3mf_toolpath_hasuniquecustomdata.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_bool)] + + self.lib.lib3mf_toolpath_finduniquecustomdata.restype = ctypes.c_int32 + self.lib.lib3mf_toolpath_finduniquecustomdata.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_toolpath_addcustomdata.restype = ctypes.c_int32 + self.lib.lib3mf_toolpath_addcustomdata.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_toolpath_clearcustomdata.restype = ctypes.c_int32 + self.lib.lib3mf_toolpath_clearcustomdata.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + + self.lib.lib3mf_toolpath_deletecustomdata.restype = ctypes.c_int32 + self.lib.lib3mf_toolpath_deletecustomdata.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] + + self.lib.lib3mf_toolpath_registercustomintegerattribute.restype = ctypes.c_int32 + self.lib.lib3mf_toolpath_registercustomintegerattribute.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p] + + self.lib.lib3mf_toolpath_registercustomdoubleattribute.restype = ctypes.c_int32 + self.lib.lib3mf_toolpath_registercustomdoubleattribute.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p] + + self.lib.lib3mf_toolpathiterator_getcurrenttoolpath.restype = ctypes.c_int32 + self.lib.lib3mf_toolpathiterator_getcurrenttoolpath.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_slicestack_getbottomz.restype = ctypes.c_int32 + self.lib.lib3mf_slicestack_getbottomz.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_double)] + + self.lib.lib3mf_slicestack_getslicecount.restype = ctypes.c_int32 + self.lib.lib3mf_slicestack_getslicecount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] + + self.lib.lib3mf_slicestack_getslice.restype = ctypes.c_int32 + self.lib.lib3mf_slicestack_getslice.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_slicestack_addslice.restype = ctypes.c_int32 + self.lib.lib3mf_slicestack_addslice.argtypes = [ctypes.c_void_p, ctypes.c_double, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_slicestack_getslicerefcount.restype = ctypes.c_int32 + self.lib.lib3mf_slicestack_getslicerefcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] + + self.lib.lib3mf_slicestack_addslicestackreference.restype = ctypes.c_int32 + self.lib.lib3mf_slicestack_addslicestackreference.argtypes = [ctypes.c_void_p, ctypes.c_void_p] + + self.lib.lib3mf_slicestack_getslicestackreference.restype = ctypes.c_int32 + self.lib.lib3mf_slicestack_getslicestackreference.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_slicestack_collapseslicereferences.restype = ctypes.c_int32 + self.lib.lib3mf_slicestack_collapseslicereferences.argtypes = [ctypes.c_void_p] + + self.lib.lib3mf_slicestack_setownpath.restype = ctypes.c_int32 + self.lib.lib3mf_slicestack_setownpath.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + + self.lib.lib3mf_slicestack_getownpath.restype = ctypes.c_int32 + self.lib.lib3mf_slicestack_getownpath.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_consumer_getconsumerid.restype = ctypes.c_int32 + self.lib.lib3mf_consumer_getconsumerid.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_consumer_getkeyid.restype = ctypes.c_int32 + self.lib.lib3mf_consumer_getkeyid.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_consumer_getkeyvalue.restype = ctypes.c_int32 + self.lib.lib3mf_consumer_getkeyvalue.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_accessright_getconsumer.restype = ctypes.c_int32 + self.lib.lib3mf_accessright_getconsumer.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_accessright_getwrappingalgorithm.restype = ctypes.c_int32 + self.lib.lib3mf_accessright_getwrappingalgorithm.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)] + + self.lib.lib3mf_accessright_getmgfalgorithm.restype = ctypes.c_int32 + self.lib.lib3mf_accessright_getmgfalgorithm.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)] + + self.lib.lib3mf_accessright_getdigestmethod.restype = ctypes.c_int32 + self.lib.lib3mf_accessright_getdigestmethod.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)] + + self.lib.lib3mf_contentencryptionparams_getencryptionalgorithm.restype = ctypes.c_int32 + self.lib.lib3mf_contentencryptionparams_getencryptionalgorithm.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)] + + self.lib.lib3mf_contentencryptionparams_getkey.restype = ctypes.c_int32 + self.lib.lib3mf_contentencryptionparams_getkey.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint8)] + + self.lib.lib3mf_contentencryptionparams_getinitializationvector.restype = ctypes.c_int32 + self.lib.lib3mf_contentencryptionparams_getinitializationvector.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint8)] + + self.lib.lib3mf_contentencryptionparams_getauthenticationtag.restype = ctypes.c_int32 + self.lib.lib3mf_contentencryptionparams_getauthenticationtag.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint8)] + + self.lib.lib3mf_contentencryptionparams_setauthenticationtag.restype = ctypes.c_int32 + self.lib.lib3mf_contentencryptionparams_setauthenticationtag.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint8)] + + self.lib.lib3mf_contentencryptionparams_getadditionalauthenticationdata.restype = ctypes.c_int32 + self.lib.lib3mf_contentencryptionparams_getadditionalauthenticationdata.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint8)] + + self.lib.lib3mf_contentencryptionparams_getdescriptor.restype = ctypes.c_int32 + self.lib.lib3mf_contentencryptionparams_getdescriptor.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] + + self.lib.lib3mf_contentencryptionparams_getkeyuuid.restype = ctypes.c_int32 + self.lib.lib3mf_contentencryptionparams_getkeyuuid.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_resourcedata_getpath.restype = ctypes.c_int32 + self.lib.lib3mf_resourcedata_getpath.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_resourcedata_getencryptionalgorithm.restype = ctypes.c_int32 + self.lib.lib3mf_resourcedata_getencryptionalgorithm.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)] + + self.lib.lib3mf_resourcedata_getcompression.restype = ctypes.c_int32 + self.lib.lib3mf_resourcedata_getcompression.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)] + + self.lib.lib3mf_resourcedata_getadditionalauthenticationdata.restype = ctypes.c_int32 + self.lib.lib3mf_resourcedata_getadditionalauthenticationdata.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint8)] + + self.lib.lib3mf_resourcedatagroup_getkeyuuid.restype = ctypes.c_int32 + self.lib.lib3mf_resourcedatagroup_getkeyuuid.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_resourcedatagroup_addaccessright.restype = ctypes.c_int32 + self.lib.lib3mf_resourcedatagroup_addaccessright.argtypes = [ctypes.c_void_p, ctypes.c_void_p, WrappingAlgorithm, MgfAlgorithm, DigestMethod, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_resourcedatagroup_findaccessrightbyconsumer.restype = ctypes.c_int32 + self.lib.lib3mf_resourcedatagroup_findaccessrightbyconsumer.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_resourcedatagroup_removeaccessright.restype = ctypes.c_int32 + self.lib.lib3mf_resourcedatagroup_removeaccessright.argtypes = [ctypes.c_void_p, ctypes.c_void_p] + + self.lib.lib3mf_keystore_addconsumer.restype = ctypes.c_int32 + self.lib.lib3mf_keystore_addconsumer.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_keystore_getconsumercount.restype = ctypes.c_int32 + self.lib.lib3mf_keystore_getconsumercount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] + + self.lib.lib3mf_keystore_getconsumer.restype = ctypes.c_int32 + self.lib.lib3mf_keystore_getconsumer.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_keystore_removeconsumer.restype = ctypes.c_int32 + self.lib.lib3mf_keystore_removeconsumer.argtypes = [ctypes.c_void_p, ctypes.c_void_p] + + self.lib.lib3mf_keystore_findconsumer.restype = ctypes.c_int32 + self.lib.lib3mf_keystore_findconsumer.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_keystore_getresourcedatagroupcount.restype = ctypes.c_int32 + self.lib.lib3mf_keystore_getresourcedatagroupcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] + + self.lib.lib3mf_keystore_addresourcedatagroup.restype = ctypes.c_int32 + self.lib.lib3mf_keystore_addresourcedatagroup.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_keystore_getresourcedatagroup.restype = ctypes.c_int32 + self.lib.lib3mf_keystore_getresourcedatagroup.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_keystore_removeresourcedatagroup.restype = ctypes.c_int32 + self.lib.lib3mf_keystore_removeresourcedatagroup.argtypes = [ctypes.c_void_p, ctypes.c_void_p] + + self.lib.lib3mf_keystore_findresourcedatagroup.restype = ctypes.c_int32 + self.lib.lib3mf_keystore_findresourcedatagroup.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_keystore_addresourcedata.restype = ctypes.c_int32 + self.lib.lib3mf_keystore_addresourcedata.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p, EncryptionAlgorithm, Compression, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint8), ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_keystore_removeresourcedata.restype = ctypes.c_int32 + self.lib.lib3mf_keystore_removeresourcedata.argtypes = [ctypes.c_void_p, ctypes.c_void_p] + + self.lib.lib3mf_keystore_findresourcedata.restype = ctypes.c_int32 + self.lib.lib3mf_keystore_findresourcedata.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_keystore_getresourcedatacount.restype = ctypes.c_int32 + self.lib.lib3mf_keystore_getresourcedatacount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint64)] + + self.lib.lib3mf_keystore_getresourcedata.restype = ctypes.c_int32 + self.lib.lib3mf_keystore_getresourcedata.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_keystore_getuuid.restype = ctypes.c_int32 + self.lib.lib3mf_keystore_getuuid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool), ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_keystore_setuuid.restype = ctypes.c_int32 + self.lib.lib3mf_keystore_setuuid.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + + self.lib.lib3mf_model_rootmodelpart.restype = ctypes.c_int32 + self.lib.lib3mf_model_rootmodelpart.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_findorcreatepackagepart.restype = ctypes.c_int32 + self.lib.lib3mf_model_findorcreatepackagepart.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_setunit.restype = ctypes.c_int32 + self.lib.lib3mf_model_setunit.argtypes = [ctypes.c_void_p, ModelUnit] + + self.lib.lib3mf_model_getunit.restype = ctypes.c_int32 + self.lib.lib3mf_model_getunit.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32)] + + self.lib.lib3mf_model_getlanguage.restype = ctypes.c_int32 + self.lib.lib3mf_model_getlanguage.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_model_setlanguage.restype = ctypes.c_int32 + self.lib.lib3mf_model_setlanguage.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + + self.lib.lib3mf_model_querywriter.restype = ctypes.c_int32 + self.lib.lib3mf_model_querywriter.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_queryreader.restype = ctypes.c_int32 + self.lib.lib3mf_model_queryreader.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_getresourcebyid.restype = ctypes.c_int32 + self.lib.lib3mf_model_getresourcebyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_gettexture2dbyid.restype = ctypes.c_int32 + self.lib.lib3mf_model_gettexture2dbyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_getpropertytypebyid.restype = ctypes.c_int32 + self.lib.lib3mf_model_getpropertytypebyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_int32)] + + self.lib.lib3mf_model_getbasematerialgroupbyid.restype = ctypes.c_int32 + self.lib.lib3mf_model_getbasematerialgroupbyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_gettexture2dgroupbyid.restype = ctypes.c_int32 + self.lib.lib3mf_model_gettexture2dgroupbyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_getcompositematerialsbyid.restype = ctypes.c_int32 + self.lib.lib3mf_model_getcompositematerialsbyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_getmultipropertygroupbyid.restype = ctypes.c_int32 + self.lib.lib3mf_model_getmultipropertygroupbyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_getmeshobjectbyid.restype = ctypes.c_int32 + self.lib.lib3mf_model_getmeshobjectbyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_getcomponentsobjectbyid.restype = ctypes.c_int32 + self.lib.lib3mf_model_getcomponentsobjectbyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_getcolorgroupbyid.restype = ctypes.c_int32 + self.lib.lib3mf_model_getcolorgroupbyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_getslicestackbyid.restype = ctypes.c_int32 + self.lib.lib3mf_model_getslicestackbyid.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_getbuilduuid.restype = ctypes.c_int32 + self.lib.lib3mf_model_getbuilduuid.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool), ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint64), ctypes.c_char_p] + + self.lib.lib3mf_model_setbuilduuid.restype = ctypes.c_int32 + self.lib.lib3mf_model_setbuilduuid.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + + self.lib.lib3mf_model_getbuilditems.restype = ctypes.c_int32 + self.lib.lib3mf_model_getbuilditems.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_getoutbox.restype = ctypes.c_int32 + self.lib.lib3mf_model_getoutbox.argtypes = [ctypes.c_void_p, ctypes.POINTER(Box)] + + self.lib.lib3mf_model_getresources.restype = ctypes.c_int32 + self.lib.lib3mf_model_getresources.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_getobjects.restype = ctypes.c_int32 + self.lib.lib3mf_model_getobjects.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_getmeshobjects.restype = ctypes.c_int32 + self.lib.lib3mf_model_getmeshobjects.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_getcomponentsobjects.restype = ctypes.c_int32 + self.lib.lib3mf_model_getcomponentsobjects.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_gettexture2ds.restype = ctypes.c_int32 + self.lib.lib3mf_model_gettexture2ds.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_getbasematerialgroups.restype = ctypes.c_int32 + self.lib.lib3mf_model_getbasematerialgroups.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_getcolorgroups.restype = ctypes.c_int32 + self.lib.lib3mf_model_getcolorgroups.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_gettexture2dgroups.restype = ctypes.c_int32 + self.lib.lib3mf_model_gettexture2dgroups.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_getcompositematerials.restype = ctypes.c_int32 + self.lib.lib3mf_model_getcompositematerials.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_getmultipropertygroups.restype = ctypes.c_int32 + self.lib.lib3mf_model_getmultipropertygroups.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_gettoolpaths.restype = ctypes.c_int32 + self.lib.lib3mf_model_gettoolpaths.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_getslicestacks.restype = ctypes.c_int32 + self.lib.lib3mf_model_getslicestacks.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_mergetomodel.restype = ctypes.c_int32 + self.lib.lib3mf_model_mergetomodel.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_addmeshobject.restype = ctypes.c_int32 + self.lib.lib3mf_model_addmeshobject.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_addcomponentsobject.restype = ctypes.c_int32 + self.lib.lib3mf_model_addcomponentsobject.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_addslicestack.restype = ctypes.c_int32 + self.lib.lib3mf_model_addslicestack.argtypes = [ctypes.c_void_p, ctypes.c_double, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_addtexture2dfromattachment.restype = ctypes.c_int32 + self.lib.lib3mf_model_addtexture2dfromattachment.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_addbasematerialgroup.restype = ctypes.c_int32 + self.lib.lib3mf_model_addbasematerialgroup.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_addcolorgroup.restype = ctypes.c_int32 + self.lib.lib3mf_model_addcolorgroup.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_addtexture2dgroup.restype = ctypes.c_int32 + self.lib.lib3mf_model_addtexture2dgroup.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_addcompositematerials.restype = ctypes.c_int32 + self.lib.lib3mf_model_addcompositematerials.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_addmultipropertygroup.restype = ctypes.c_int32 + self.lib.lib3mf_model_addmultipropertygroup.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_addbuilditem.restype = ctypes.c_int32 + self.lib.lib3mf_model_addbuilditem.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(Transform), ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_removebuilditem.restype = ctypes.c_int32 + self.lib.lib3mf_model_removebuilditem.argtypes = [ctypes.c_void_p, ctypes.c_void_p] + + self.lib.lib3mf_model_addtoolpath.restype = ctypes.c_int32 + self.lib.lib3mf_model_addtoolpath.argtypes = [ctypes.c_void_p, ctypes.c_double, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_getmetadatagroup.restype = ctypes.c_int32 + self.lib.lib3mf_model_getmetadatagroup.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_addattachment.restype = ctypes.c_int32 + self.lib.lib3mf_model_addattachment.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_removeattachment.restype = ctypes.c_int32 + self.lib.lib3mf_model_removeattachment.argtypes = [ctypes.c_void_p, ctypes.c_void_p] + + self.lib.lib3mf_model_getattachment.restype = ctypes.c_int32 + self.lib.lib3mf_model_getattachment.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_findattachment.restype = ctypes.c_int32 + self.lib.lib3mf_model_findattachment.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_getattachmentcount.restype = ctypes.c_int32 + self.lib.lib3mf_model_getattachmentcount.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_uint32)] + + self.lib.lib3mf_model_haspackagethumbnailattachment.restype = ctypes.c_int32 + self.lib.lib3mf_model_haspackagethumbnailattachment.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_bool)] + + self.lib.lib3mf_model_createpackagethumbnailattachment.restype = ctypes.c_int32 + self.lib.lib3mf_model_createpackagethumbnailattachment.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_getpackagethumbnailattachment.restype = ctypes.c_int32 + self.lib.lib3mf_model_getpackagethumbnailattachment.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_removepackagethumbnailattachment.restype = ctypes.c_int32 + self.lib.lib3mf_model_removepackagethumbnailattachment.argtypes = [ctypes.c_void_p] + + self.lib.lib3mf_model_addcustomcontenttype.restype = ctypes.c_int32 + self.lib.lib3mf_model_addcustomcontenttype.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p] + + self.lib.lib3mf_model_removecustomcontenttype.restype = ctypes.c_int32 + self.lib.lib3mf_model_removecustomcontenttype.argtypes = [ctypes.c_void_p, ctypes.c_char_p] + + self.lib.lib3mf_model_setrandomnumbercallback.restype = ctypes.c_int32 + self.lib.lib3mf_model_setrandomnumbercallback.argtypes = [ctypes.c_void_p, RandomNumberCallback, ctypes.c_void_p] + + self.lib.lib3mf_model_getkeystore.restype = ctypes.c_int32 + self.lib.lib3mf_model_getkeystore.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_createpersistentsourcefromfile.restype = ctypes.c_int32 + self.lib.lib3mf_model_createpersistentsourcefromfile.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_createpersistentsourcefrombuffer.restype = ctypes.c_int32 + self.lib.lib3mf_model_createpersistentsourcefrombuffer.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.POINTER(ctypes.c_uint8), ctypes.POINTER(ctypes.c_void_p)] + + self.lib.lib3mf_model_createpersistentsourcefromcallback.restype = ctypes.c_int32 + self.lib.lib3mf_model_createpersistentsourcefromcallback.argtypes = [ctypes.c_void_p, ReadCallback, ctypes.c_uint64, SeekCallback, ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p)] + + except AttributeError as ae: + raise ELib3MFException(ErrorCodes.COULDNOTFINDLIBRARYEXPORT, ae.args[0]) + + def _checkBinaryVersion(self): + nMajor, nMinor, _ = self.GetLibraryVersion() + if (nMajor != BindingVersion.MAJOR) or (nMinor < BindingVersion.MINOR): + raise ELib3MFException(ErrorCodes.INCOMPATIBLEBINARYVERSION) + + def checkError(self, instance, errorCode): + if errorCode != ErrorCodes.SUCCESS.value: + if instance: + if instance._wrapper != self: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'invalid wrapper call') + message,_ = self.GetLastError(instance) + raise ELib3MFException(errorCode, message) + + def GetLibraryVersion(self): + pMajor = ctypes.c_uint32() + pMinor = ctypes.c_uint32() + pMicro = ctypes.c_uint32() + self.checkError(None, self.lib.lib3mf_getlibraryversion(pMajor, pMinor, pMicro)) + + return pMajor.value, pMinor.value, pMicro.value + + def GetPrereleaseInformation(self): + pHasPrereleaseInfo = ctypes.c_bool() + nPrereleaseInfoBufferSize = ctypes.c_uint64(0) + nPrereleaseInfoNeededChars = ctypes.c_uint64(0) + pPrereleaseInfoBuffer = ctypes.c_char_p(None) + self.checkError(None, self.lib.lib3mf_getprereleaseinformation(pHasPrereleaseInfo, nPrereleaseInfoBufferSize, nPrereleaseInfoNeededChars, pPrereleaseInfoBuffer)) + nPrereleaseInfoBufferSize = ctypes.c_uint64(nPrereleaseInfoNeededChars.value) + pPrereleaseInfoBuffer = (ctypes.c_char * (nPrereleaseInfoNeededChars.value))() + self.checkError(None, self.lib.lib3mf_getprereleaseinformation(pHasPrereleaseInfo, nPrereleaseInfoBufferSize, nPrereleaseInfoNeededChars, pPrereleaseInfoBuffer)) + + return pHasPrereleaseInfo.value, pPrereleaseInfoBuffer.value.decode() + + def GetBuildInformation(self): + pHasBuildInfo = ctypes.c_bool() + nBuildInformationBufferSize = ctypes.c_uint64(0) + nBuildInformationNeededChars = ctypes.c_uint64(0) + pBuildInformationBuffer = ctypes.c_char_p(None) + self.checkError(None, self.lib.lib3mf_getbuildinformation(pHasBuildInfo, nBuildInformationBufferSize, nBuildInformationNeededChars, pBuildInformationBuffer)) + nBuildInformationBufferSize = ctypes.c_uint64(nBuildInformationNeededChars.value) + pBuildInformationBuffer = (ctypes.c_char * (nBuildInformationNeededChars.value))() + self.checkError(None, self.lib.lib3mf_getbuildinformation(pHasBuildInfo, nBuildInformationBufferSize, nBuildInformationNeededChars, pBuildInformationBuffer)) + + return pHasBuildInfo.value, pBuildInformationBuffer.value.decode() + + def GetSpecificationVersion(self, SpecificationURL): + pSpecificationURL = ctypes.c_char_p(str.encode(SpecificationURL)) + pIsSupported = ctypes.c_bool() + pMajor = ctypes.c_uint32() + pMinor = ctypes.c_uint32() + pMicro = ctypes.c_uint32() + self.checkError(None, self.lib.lib3mf_getspecificationversion(pSpecificationURL, pIsSupported, pMajor, pMinor, pMicro)) + + return pIsSupported.value, pMajor.value, pMinor.value, pMicro.value + + def CreateModel(self): + ModelHandle = ctypes.c_void_p() + self.checkError(None, self.lib.lib3mf_createmodel(ModelHandle)) + if ModelHandle: + ModelObject = self._polymorphicFactory(ModelHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + return ModelObject - def Release(self, InstanceObject): - InstanceHandle = None - if InstanceObject: - InstanceHandle = InstanceObject._handle + def Release(self, InstanceObject): + InstanceHandle = None + if InstanceObject: + InstanceHandle = InstanceObject._handle + else: + raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') + self.checkError(None, self.lib.lib3mf_release(InstanceHandle)) + + + def Acquire(self, InstanceObject): + InstanceHandle = None + if InstanceObject: + InstanceHandle = InstanceObject._handle + else: + raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') + self.checkError(None, self.lib.lib3mf_acquire(InstanceHandle)) + + + def SetJournal(self, JournalPath): + pJournalPath = ctypes.c_char_p(str.encode(JournalPath)) + self.checkError(None, self.lib.lib3mf_setjournal(pJournalPath)) + + + def GetLastError(self, InstanceObject): + InstanceHandle = None + if InstanceObject: + InstanceHandle = InstanceObject._handle + else: + raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') + nLastErrorStringBufferSize = ctypes.c_uint64(0) + nLastErrorStringNeededChars = ctypes.c_uint64(0) + pLastErrorStringBuffer = ctypes.c_char_p(None) + pHasLastError = ctypes.c_bool() + self.checkError(None, self.lib.lib3mf_getlasterror(InstanceHandle, nLastErrorStringBufferSize, nLastErrorStringNeededChars, pLastErrorStringBuffer, pHasLastError)) + nLastErrorStringBufferSize = ctypes.c_uint64(nLastErrorStringNeededChars.value) + pLastErrorStringBuffer = (ctypes.c_char * (nLastErrorStringNeededChars.value))() + self.checkError(None, self.lib.lib3mf_getlasterror(InstanceHandle, nLastErrorStringBufferSize, nLastErrorStringNeededChars, pLastErrorStringBuffer, pHasLastError)) + + return pLastErrorStringBuffer.value.decode(), pHasLastError.value + + def GetSymbolLookupMethod(self): + pSymbolLookupMethod = ctypes.c_void_p() + self.checkError(None, self.lib.lib3mf_getsymbollookupmethod(pSymbolLookupMethod)) + + return pSymbolLookupMethod.value + + def RetrieveProgressMessage(self, TheProgressIdentifier): + nProgressMessageBufferSize = ctypes.c_uint64(0) + nProgressMessageNeededChars = ctypes.c_uint64(0) + pProgressMessageBuffer = ctypes.c_char_p(None) + self.checkError(None, self.lib.lib3mf_retrieveprogressmessage(TheProgressIdentifier, nProgressMessageBufferSize, nProgressMessageNeededChars, pProgressMessageBuffer)) + nProgressMessageBufferSize = ctypes.c_uint64(nProgressMessageNeededChars.value) + pProgressMessageBuffer = (ctypes.c_char * (nProgressMessageNeededChars.value))() + self.checkError(None, self.lib.lib3mf_retrieveprogressmessage(TheProgressIdentifier, nProgressMessageBufferSize, nProgressMessageNeededChars, pProgressMessageBuffer)) + + return pProgressMessageBuffer.value.decode() + + def RGBAToColor(self, Red, Green, Blue, Alpha): + nRed = ctypes.c_uint8(Red) + nGreen = ctypes.c_uint8(Green) + nBlue = ctypes.c_uint8(Blue) + nAlpha = ctypes.c_uint8(Alpha) + pTheColor = Color() + self.checkError(None, self.lib.lib3mf_rgbatocolor(nRed, nGreen, nBlue, nAlpha, pTheColor)) + + return pTheColor + + def FloatRGBAToColor(self, Red, Green, Blue, Alpha): + fRed = ctypes.c_float(Red) + fGreen = ctypes.c_float(Green) + fBlue = ctypes.c_float(Blue) + fAlpha = ctypes.c_float(Alpha) + pTheColor = Color() + self.checkError(None, self.lib.lib3mf_floatrgbatocolor(fRed, fGreen, fBlue, fAlpha, pTheColor)) + + return pTheColor + + def ColorToRGBA(self, TheColor): + pRed = ctypes.c_uint8() + pGreen = ctypes.c_uint8() + pBlue = ctypes.c_uint8() + pAlpha = ctypes.c_uint8() + self.checkError(None, self.lib.lib3mf_colortorgba(TheColor, pRed, pGreen, pBlue, pAlpha)) + + return pRed.value, pGreen.value, pBlue.value, pAlpha.value + + def ColorToFloatRGBA(self, TheColor): + pRed = ctypes.c_float() + pGreen = ctypes.c_float() + pBlue = ctypes.c_float() + pAlpha = ctypes.c_float() + self.checkError(None, self.lib.lib3mf_colortofloatrgba(TheColor, pRed, pGreen, pBlue, pAlpha)) + + return pRed.value, pGreen.value, pBlue.value, pAlpha.value + + def GetIdentityTransform(self): + pTransform = Transform() + self.checkError(None, self.lib.lib3mf_getidentitytransform(pTransform)) + + return pTransform + + def GetUniformScaleTransform(self, Factor): + fFactor = ctypes.c_float(Factor) + pTransform = Transform() + self.checkError(None, self.lib.lib3mf_getuniformscaletransform(fFactor, pTransform)) + + return pTransform + + def GetScaleTransform(self, FactorX, FactorY, FactorZ): + fFactorX = ctypes.c_float(FactorX) + fFactorY = ctypes.c_float(FactorY) + fFactorZ = ctypes.c_float(FactorZ) + pTransform = Transform() + self.checkError(None, self.lib.lib3mf_getscaletransform(fFactorX, fFactorY, fFactorZ, pTransform)) + + return pTransform + + def GetTranslationTransform(self, VectorX, VectorY, VectorZ): + fVectorX = ctypes.c_float(VectorX) + fVectorY = ctypes.c_float(VectorY) + fVectorZ = ctypes.c_float(VectorZ) + pTransform = Transform() + self.checkError(None, self.lib.lib3mf_gettranslationtransform(fVectorX, fVectorY, fVectorZ, pTransform)) + + return pTransform + + '''IMPORTANT: PolymorphicFactory method should not be used by application directly. + It's designed to be used on Lib3MFHandle object only once. + If it's used on any existing object as a form of dynamic cast then + Wrapper.AcquireInstance(object) must be called after instantiating new object. + This is important to keep reference count matching between application and library sides. + ''' + def _polymorphicFactory(self, handle): + class PolymorphicFactory(): + def getObjectById(self, classtypeid, handle, wrapper): + methodName = 'getObjectById_' + format(classtypeid.value, '016X') + method = getattr(self, methodName, lambda: 'Invalid class type id') + return method(handle, wrapper) + def getObjectById_856632D0BAF1D8B7(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Base" + return Base(handle, wrapper) + def getObjectById_A0EB26254C981E1A(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::BinaryStream" + return BinaryStream(handle, wrapper) + def getObjectById_E76F642F363FD7E9(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Writer" + return Writer(handle, wrapper) + def getObjectById_BE46884397CE1319(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::PersistentReaderSource" + return PersistentReaderSource(handle, wrapper) + def getObjectById_2D86831DA59FBE72(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Reader" + return Reader(handle, wrapper) + def getObjectById_0E55A826D377483E(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::PackagePart" + return PackagePart(handle, wrapper) + def getObjectById_DFE3889D1B269CBB(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Resource" + return Resource(handle, wrapper) + def getObjectById_460F3515E2621DBE(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::ResourceIterator" + return ResourceIterator(handle, wrapper) + def getObjectById_EA18C54DBD42B5F6(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::CustomXMLAttribute" + return CustomXMLAttribute(handle, wrapper) + def getObjectById_26B5AD02041EDF96(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::CustomXMLNode" + return CustomXMLNode(handle, wrapper) + def getObjectById_8C4B47C97D310E89(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::CustomXMLNodes" + return CustomXMLNodes(handle, wrapper) + def getObjectById_5E0CF70A6DB6256A(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::CustomDOMTree" + return CustomDOMTree(handle, wrapper) + def getObjectById_69684DB99FA813F6(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::SliceStackIterator" + return SliceStackIterator(handle, wrapper) + def getObjectById_DE92510BD2112288(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::ObjectIterator" + return ObjectIterator(handle, wrapper) + def getObjectById_F4196034E2B9FDE6(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::MeshObjectIterator" + return MeshObjectIterator(handle, wrapper) + def getObjectById_564DE4217ED7614A(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::ComponentsObjectIterator" + return ComponentsObjectIterator(handle, wrapper) + def getObjectById_4BD32B4870FFC03B(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Texture2DIterator" + return Texture2DIterator(handle, wrapper) + def getObjectById_65E6EDD9362C79CB(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::BaseMaterialGroupIterator" + return BaseMaterialGroupIterator(handle, wrapper) + def getObjectById_10274A1757C729C0(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::ColorGroupIterator" + return ColorGroupIterator(handle, wrapper) + def getObjectById_30D55F4DB88FE0CA(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Texture2DGroupIterator" + return Texture2DGroupIterator(handle, wrapper) + def getObjectById_A99CC6C3F70FB6F9(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::CompositeMaterialsIterator" + return CompositeMaterialsIterator(handle, wrapper) + def getObjectById_C2BDF5D8CBBDB1F0(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::MultiPropertyGroupIterator" + return MultiPropertyGroupIterator(handle, wrapper) + def getObjectById_D17716D063DE2C22(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::MetaData" + return MetaData(handle, wrapper) + def getObjectById_0C3B85369E9B25D3(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::MetaDataGroup" + return MetaDataGroup(handle, wrapper) + def getObjectById_2DA2136F577A779C(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Object" + return Object(handle, wrapper) + def getObjectById_3B3A6DC6EC610497(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::MeshObject" + return MeshObject(handle, wrapper) + def getObjectById_63B3B461B30B4BA5(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::BeamLattice" + return BeamLattice(handle, wrapper) + def getObjectById_4ECDB6A6F69F2BEB(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Component" + return Component(handle, wrapper) + def getObjectById_6522CF04EB283FED(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::ComponentsObject" + return ComponentsObject(handle, wrapper) + def getObjectById_30CCDBE90E00B55B(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::BeamSet" + return BeamSet(handle, wrapper) + def getObjectById_B27D4656E16609FA(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::BaseMaterialGroup" + return BaseMaterialGroup(handle, wrapper) + def getObjectById_D085FB2E49CDB5B1(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::ColorGroup" + return ColorGroup(handle, wrapper) + def getObjectById_BC1208397E37055D(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Texture2DGroup" + return Texture2DGroup(handle, wrapper) + def getObjectById_CE16224D688B86F2(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::CompositeMaterials" + return CompositeMaterials(handle, wrapper) + def getObjectById_B989E02E43158FE6(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::MultiPropertyGroup" + return MultiPropertyGroup(handle, wrapper) + def getObjectById_8CE7A1191A63A35D(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Attachment" + return Attachment(handle, wrapper) + def getObjectById_E0441CF976B36319(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Texture2D" + return Texture2D(handle, wrapper) + def getObjectById_68FB2D5FFC4BA12A(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::BuildItem" + return BuildItem(handle, wrapper) + def getObjectById_A7D21BD364910860(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::BuildItemIterator" + return BuildItemIterator(handle, wrapper) + def getObjectById_2198BCF4D8DF9C40(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Slice" + return Slice(handle, wrapper) + def getObjectById_C869620B90242CA7(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::ToolpathProfile" + return ToolpathProfile(handle, wrapper) + def getObjectById_28DD7D3718F0616E(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::ToolpathLayerReader" + return ToolpathLayerReader(handle, wrapper) + def getObjectById_28C0E70CC44F931A(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::ToolpathLayerData" + return ToolpathLayerData(handle, wrapper) + def getObjectById_F0AAB2C814D9FFB1(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Toolpath" + return Toolpath(handle, wrapper) + def getObjectById_D0F24425A07F2A81(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::ToolpathIterator" + return ToolpathIterator(handle, wrapper) + def getObjectById_6594B031B6096238(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::SliceStack" + return SliceStack(handle, wrapper) + def getObjectById_D9E46D5E6D8118EE(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Consumer" + return Consumer(handle, wrapper) + def getObjectById_385C42FC5609498A(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::AccessRight" + return AccessRight(handle, wrapper) + def getObjectById_7FB36B91D4CE4671(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::ContentEncryptionParams" + return ContentEncryptionParams(handle, wrapper) + def getObjectById_1A47A5E258E22EF9(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::ResourceData" + return ResourceData(handle, wrapper) + def getObjectById_D59067227E428AA4(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::ResourceDataGroup" + return ResourceDataGroup(handle, wrapper) + def getObjectById_1CC9E0CC082253C6(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::KeyStore" + return KeyStore(handle, wrapper) + def getObjectById_5A8164ECEDB03F09(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Model" + return Model(handle, wrapper) + + if not handle: + return None + pClassTypeId = ctypes.c_uint64() + self.checkError(None, self.lib.lib3mf_base_classtypeid(handle, pClassTypeId)) + factory = PolymorphicFactory() + return factory.getObjectById(pClassTypeId, handle, self) + + + +''' Class Implementation for Base +''' +class Base: + def __init__(self, handle, wrapper): + if not handle or not wrapper: + raise ELib3MFException(ErrorCodes.INVALIDPARAM) + self._handle = handle + self._wrapper = wrapper + + def __del__(self): + self._wrapper.Release(self) + def ClassTypeId(self): + pClassTypeId = ctypes.c_uint64() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_base_classtypeid(self._handle, pClassTypeId)) + + return pClassTypeId.value + + + +''' Class Implementation for BinaryStream +''' +class BinaryStream(Base): + def __init__(self, handle, wrapper): + Base.__init__(self, handle, wrapper) + def GetBinaryPath(self): + nPathBufferSize = ctypes.c_uint64(0) + nPathNeededChars = ctypes.c_uint64(0) + pPathBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_binarystream_getbinarypath(self._handle, nPathBufferSize, nPathNeededChars, pPathBuffer)) + nPathBufferSize = ctypes.c_uint64(nPathNeededChars.value) + pPathBuffer = (ctypes.c_char * (nPathNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_binarystream_getbinarypath(self._handle, nPathBufferSize, nPathNeededChars, pPathBuffer)) + + return pPathBuffer.value.decode() + + def GetIndexPath(self): + nPathBufferSize = ctypes.c_uint64(0) + nPathNeededChars = ctypes.c_uint64(0) + pPathBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_binarystream_getindexpath(self._handle, nPathBufferSize, nPathNeededChars, pPathBuffer)) + nPathBufferSize = ctypes.c_uint64(nPathNeededChars.value) + pPathBuffer = (ctypes.c_char * (nPathNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_binarystream_getindexpath(self._handle, nPathBufferSize, nPathNeededChars, pPathBuffer)) + + return pPathBuffer.value.decode() + + def GetUUID(self): + nUUIDBufferSize = ctypes.c_uint64(0) + nUUIDNeededChars = ctypes.c_uint64(0) + pUUIDBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_binarystream_getuuid(self._handle, nUUIDBufferSize, nUUIDNeededChars, pUUIDBuffer)) + nUUIDBufferSize = ctypes.c_uint64(nUUIDNeededChars.value) + pUUIDBuffer = (ctypes.c_char * (nUUIDNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_binarystream_getuuid(self._handle, nUUIDBufferSize, nUUIDNeededChars, pUUIDBuffer)) + + return pUUIDBuffer.value.decode() + + def DisableDiscretizedArrayCompression(self): + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_binarystream_disablediscretizedarraycompression(self._handle)) + + + def EnableDiscretizedArrayCompression(self, Units, PredictionType): + dUnits = ctypes.c_double(Units) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_binarystream_enablediscretizedarraycompression(self._handle, dUnits, PredictionType)) + + + def EnableLZMA(self, LZMALevel): + nLZMALevel = ctypes.c_uint32(LZMALevel) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_binarystream_enablelzma(self._handle, nLZMALevel)) + + + def DisableLZMA(self): + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_binarystream_disablelzma(self._handle)) + + + + +''' Class Implementation for Writer +''' +class Writer(Base): + def __init__(self, handle, wrapper): + Base.__init__(self, handle, wrapper) + def WriteToFile(self, Filename): + pFilename = ctypes.c_char_p(str.encode(Filename)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_writetofile(self._handle, pFilename)) + + + def GetStreamSize(self): + pStreamSize = ctypes.c_uint64() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_getstreamsize(self._handle, pStreamSize)) + + return pStreamSize.value + + def WriteToBuffer(self): + nBufferCount = ctypes.c_uint64(0) + nBufferNeededCount = ctypes.c_uint64(0) + pBufferBuffer = (ctypes.c_uint8*0)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_writetobuffer(self._handle, nBufferCount, nBufferNeededCount, pBufferBuffer)) + nBufferCount = ctypes.c_uint64(nBufferNeededCount.value) + pBufferBuffer = (ctypes.c_uint8 * nBufferNeededCount.value)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_writetobuffer(self._handle, nBufferCount, nBufferNeededCount, pBufferBuffer)) + + return [pBufferBuffer[i] for i in range(nBufferNeededCount.value)] + + def WriteToCallback(self, TheWriteCallbackFunc, TheSeekCallbackFunc, UserData): + pUserData = ctypes.c_void_p(UserData) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_writetocallback(self._handle, TheWriteCallbackFunc, TheSeekCallbackFunc, pUserData)) + + + def SetProgressCallback(self, ProgressCallbackFunc, UserData): + pUserData = ctypes.c_void_p(UserData) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_setprogresscallback(self._handle, ProgressCallbackFunc, pUserData)) + + + def GetDecimalPrecision(self): + pDecimalPrecision = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_getdecimalprecision(self._handle, pDecimalPrecision)) + + return pDecimalPrecision.value + + def SetDecimalPrecision(self, DecimalPrecision): + nDecimalPrecision = ctypes.c_uint32(DecimalPrecision) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_setdecimalprecision(self._handle, nDecimalPrecision)) + + + def SetStrictModeActive(self, StrictModeActive): + bStrictModeActive = ctypes.c_bool(StrictModeActive) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_setstrictmodeactive(self._handle, bStrictModeActive)) + + + def GetStrictModeActive(self): + pStrictModeActive = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_getstrictmodeactive(self._handle, pStrictModeActive)) + + return pStrictModeActive.value + + def GetWarning(self, Index): + nIndex = ctypes.c_uint32(Index) + pErrorCode = ctypes.c_uint32() + nWarningBufferSize = ctypes.c_uint64(0) + nWarningNeededChars = ctypes.c_uint64(0) + pWarningBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_getwarning(self._handle, nIndex, pErrorCode, nWarningBufferSize, nWarningNeededChars, pWarningBuffer)) + nWarningBufferSize = ctypes.c_uint64(nWarningNeededChars.value) + pWarningBuffer = (ctypes.c_char * (nWarningNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_getwarning(self._handle, nIndex, pErrorCode, nWarningBufferSize, nWarningNeededChars, pWarningBuffer)) + + return pErrorCode.value, pWarningBuffer.value.decode() + + def GetWarningCount(self): + pCount = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_getwarningcount(self._handle, pCount)) + + return pCount.value + + def AddKeyWrappingCallback(self, ConsumerID, TheCallbackFunc, UserData): + pConsumerID = ctypes.c_char_p(str.encode(ConsumerID)) + pUserData = ctypes.c_void_p(UserData) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_addkeywrappingcallback(self._handle, pConsumerID, TheCallbackFunc, pUserData)) + + + def SetContentEncryptionCallback(self, TheCallbackFunc, UserData): + pUserData = ctypes.c_void_p(UserData) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_setcontentencryptioncallback(self._handle, TheCallbackFunc, pUserData)) + + + def CreateBinaryStream(self, IndexPath, BinaryPath): + pIndexPath = ctypes.c_char_p(str.encode(IndexPath)) + pBinaryPath = ctypes.c_char_p(str.encode(BinaryPath)) + BinaryStreamHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_createbinarystream(self._handle, pIndexPath, pBinaryPath, BinaryStreamHandle)) + if BinaryStreamHandle: + BinaryStreamObject = self._wrapper._polymorphicFactory(BinaryStreamHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return BinaryStreamObject + + def AssignBinaryStream(self, InstanceObject, BinaryStreamObject): + InstanceHandle = None + if InstanceObject: + InstanceHandle = InstanceObject._handle + else: + raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') + BinaryStreamHandle = None + if BinaryStreamObject: + BinaryStreamHandle = BinaryStreamObject._handle + else: + raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_assignbinarystream(self._handle, InstanceHandle, BinaryStreamHandle)) + + + def RegisterCustomNamespace(self, Prefix, NameSpace): + pPrefix = ctypes.c_char_p(str.encode(Prefix)) + pNameSpace = ctypes.c_char_p(str.encode(NameSpace)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_registercustomnamespace(self._handle, pPrefix, pNameSpace)) + + + + +''' Class Implementation for PersistentReaderSource +''' +class PersistentReaderSource(Base): + def __init__(self, handle, wrapper): + Base.__init__(self, handle, wrapper) + def GetSourceType(self): + pSourceType = ctypes.c_int32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_persistentreadersource_getsourcetype(self._handle, pSourceType)) + + return PersistentReaderSourceType(pSourceType.value) + + def InvalidateSourceData(self): + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_persistentreadersource_invalidatesourcedata(self._handle)) + + + def SourceDataIsValid(self): + pDataIsValid = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_persistentreadersource_sourcedataisvalid(self._handle, pDataIsValid)) + + return pDataIsValid.value + + + +''' Class Implementation for Reader +''' +class Reader(Base): + def __init__(self, handle, wrapper): + Base.__init__(self, handle, wrapper) + def ReadFromPersistentSource(self, SourceObject): + SourceHandle = None + if SourceObject: + SourceHandle = SourceObject._handle + else: + raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_readfrompersistentsource(self._handle, SourceHandle)) + + + def ReadFromFile(self, Filename): + pFilename = ctypes.c_char_p(str.encode(Filename)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_readfromfile(self._handle, pFilename)) + + + def ReadFromBuffer(self, Buffer): + nBufferCount = ctypes.c_uint64(len(Buffer)) + pBufferBuffer = (ctypes.c_uint8*len(Buffer))(*Buffer) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_readfrombuffer(self._handle, nBufferCount, pBufferBuffer)) + + + def ReadFromCallback(self, TheReadCallbackFunc, StreamSize, TheSeekCallbackFunc, UserData): + nStreamSize = ctypes.c_uint64(StreamSize) + pUserData = ctypes.c_void_p(UserData) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_readfromcallback(self._handle, TheReadCallbackFunc, nStreamSize, TheSeekCallbackFunc, pUserData)) + + + def SetProgressCallback(self, ProgressCallbackFunc, UserData): + pUserData = ctypes.c_void_p(UserData) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_setprogresscallback(self._handle, ProgressCallbackFunc, pUserData)) + + + def AddRelationToRead(self, RelationShipType): + pRelationShipType = ctypes.c_char_p(str.encode(RelationShipType)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_addrelationtoread(self._handle, pRelationShipType)) + + + def RemoveRelationToRead(self, RelationShipType): + pRelationShipType = ctypes.c_char_p(str.encode(RelationShipType)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_removerelationtoread(self._handle, pRelationShipType)) + + + def SetStrictModeActive(self, StrictModeActive): + bStrictModeActive = ctypes.c_bool(StrictModeActive) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_setstrictmodeactive(self._handle, bStrictModeActive)) + + + def GetStrictModeActive(self): + pStrictModeActive = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_getstrictmodeactive(self._handle, pStrictModeActive)) + + return pStrictModeActive.value + + def GetWarning(self, Index): + nIndex = ctypes.c_uint32(Index) + pErrorCode = ctypes.c_uint32() + nWarningBufferSize = ctypes.c_uint64(0) + nWarningNeededChars = ctypes.c_uint64(0) + pWarningBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_getwarning(self._handle, nIndex, pErrorCode, nWarningBufferSize, nWarningNeededChars, pWarningBuffer)) + nWarningBufferSize = ctypes.c_uint64(nWarningNeededChars.value) + pWarningBuffer = (ctypes.c_char * (nWarningNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_getwarning(self._handle, nIndex, pErrorCode, nWarningBufferSize, nWarningNeededChars, pWarningBuffer)) + + return pErrorCode.value, pWarningBuffer.value.decode() + + def GetWarningCount(self): + pCount = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_getwarningcount(self._handle, pCount)) + + return pCount.value + + def AddKeyWrappingCallback(self, ConsumerID, TheCallbackFunc, UserData): + pConsumerID = ctypes.c_char_p(str.encode(ConsumerID)) + pUserData = ctypes.c_void_p(UserData) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_addkeywrappingcallback(self._handle, pConsumerID, TheCallbackFunc, pUserData)) + + + def SetContentEncryptionCallback(self, TheCallbackFunc, UserData): + pUserData = ctypes.c_void_p(UserData) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_setcontentencryptioncallback(self._handle, TheCallbackFunc, pUserData)) + + + + +''' Class Implementation for PackagePart +''' +class PackagePart(Base): + def __init__(self, handle, wrapper): + Base.__init__(self, handle, wrapper) + def GetPath(self): + nPathBufferSize = ctypes.c_uint64(0) + nPathNeededChars = ctypes.c_uint64(0) + pPathBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_packagepart_getpath(self._handle, nPathBufferSize, nPathNeededChars, pPathBuffer)) + nPathBufferSize = ctypes.c_uint64(nPathNeededChars.value) + pPathBuffer = (ctypes.c_char * (nPathNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_packagepart_getpath(self._handle, nPathBufferSize, nPathNeededChars, pPathBuffer)) + + return pPathBuffer.value.decode() + + def SetPath(self, Path): + pPath = ctypes.c_char_p(str.encode(Path)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_packagepart_setpath(self._handle, pPath)) + + + + +''' Class Implementation for Resource +''' +class Resource(Base): + def __init__(self, handle, wrapper): + Base.__init__(self, handle, wrapper) + def GetResourceID(self): + pUniqueResourceID = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_resource_getresourceid(self._handle, pUniqueResourceID)) + + return pUniqueResourceID.value + + def GetUniqueResourceID(self): + pUniqueResourceID = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_resource_getuniqueresourceid(self._handle, pUniqueResourceID)) + + return pUniqueResourceID.value + + def PackagePart(self): + PackagePartHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_resource_packagepart(self._handle, PackagePartHandle)) + if PackagePartHandle: + PackagePartObject = self._wrapper._polymorphicFactory(PackagePartHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return PackagePartObject + + def SetPackagePart(self, PackagePartObject): + PackagePartHandle = None + if PackagePartObject: + PackagePartHandle = PackagePartObject._handle + else: + raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_resource_setpackagepart(self._handle, PackagePartHandle)) + + + def GetModelResourceID(self): + pModelResourceId = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_resource_getmodelresourceid(self._handle, pModelResourceId)) + + return pModelResourceId.value + + + +''' Class Implementation for ResourceIterator +''' +class ResourceIterator(Base): + def __init__(self, handle, wrapper): + Base.__init__(self, handle, wrapper) + def MoveNext(self): + pHasNext = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_resourceiterator_movenext(self._handle, pHasNext)) + + return pHasNext.value + + def MovePrevious(self): + pHasPrevious = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_resourceiterator_moveprevious(self._handle, pHasPrevious)) + + return pHasPrevious.value + + def GetCurrent(self): + ResourceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_resourceiterator_getcurrent(self._handle, ResourceHandle)) + if ResourceHandle: + ResourceObject = self._wrapper._polymorphicFactory(ResourceHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return ResourceObject + + def Clone(self): + OutResourceIteratorHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_resourceiterator_clone(self._handle, OutResourceIteratorHandle)) + if OutResourceIteratorHandle: + OutResourceIteratorObject = self._wrapper._polymorphicFactory(OutResourceIteratorHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return OutResourceIteratorObject + + def Count(self): + pCount = ctypes.c_uint64() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_resourceiterator_count(self._handle, pCount)) + + return pCount.value + + + +''' Class Implementation for CustomXMLAttribute +''' +class CustomXMLAttribute(Base): + def __init__(self, handle, wrapper): + Base.__init__(self, handle, wrapper) + def GetName(self): + nNameBufferSize = ctypes.c_uint64(0) + nNameNeededChars = ctypes.c_uint64(0) + pNameBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlattribute_getname(self._handle, nNameBufferSize, nNameNeededChars, pNameBuffer)) + nNameBufferSize = ctypes.c_uint64(nNameNeededChars.value) + pNameBuffer = (ctypes.c_char * (nNameNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlattribute_getname(self._handle, nNameBufferSize, nNameNeededChars, pNameBuffer)) + + return pNameBuffer.value.decode() + + def GetValue(self): + nValueBufferSize = ctypes.c_uint64(0) + nValueNeededChars = ctypes.c_uint64(0) + pValueBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlattribute_getvalue(self._handle, nValueBufferSize, nValueNeededChars, pValueBuffer)) + nValueBufferSize = ctypes.c_uint64(nValueNeededChars.value) + pValueBuffer = (ctypes.c_char * (nValueNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlattribute_getvalue(self._handle, nValueBufferSize, nValueNeededChars, pValueBuffer)) + + return pValueBuffer.value.decode() + + def IsValidInteger(self, MinValue, MaxValue): + nMinValue = ctypes.c_int64(MinValue) + nMaxValue = ctypes.c_int64(MaxValue) + pIsValid = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlattribute_isvalidinteger(self._handle, nMinValue, nMaxValue, pIsValid)) + + return pIsValid.value + + def GetIntegerValue(self, MinValue, MaxValue): + nMinValue = ctypes.c_int64(MinValue) + nMaxValue = ctypes.c_int64(MaxValue) + pValue = ctypes.c_int64() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlattribute_getintegervalue(self._handle, nMinValue, nMaxValue, pValue)) + + return pValue.value + + def IsValidDouble(self, MinValue, MaxValue): + dMinValue = ctypes.c_double(MinValue) + dMaxValue = ctypes.c_double(MaxValue) + pIsValid = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlattribute_isvaliddouble(self._handle, dMinValue, dMaxValue, pIsValid)) + + return pIsValid.value + + def GetDoubleValue(self, MinValue, MaxValue): + dMinValue = ctypes.c_double(MinValue) + dMaxValue = ctypes.c_double(MaxValue) + pValue = ctypes.c_double() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlattribute_getdoublevalue(self._handle, dMinValue, dMaxValue, pValue)) + + return pValue.value + + def IsValidBool(self): + pIsValid = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlattribute_isvalidbool(self._handle, pIsValid)) + + return pIsValid.value + + def GetBoolValue(self, MinValue, MaxValue): + dMinValue = ctypes.c_double(MinValue) + dMaxValue = ctypes.c_double(MaxValue) + pValue = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlattribute_getboolvalue(self._handle, dMinValue, dMaxValue, pValue)) + + return pValue.value + + def SetValue(self, Value): + pValue = ctypes.c_char_p(str.encode(Value)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlattribute_setvalue(self._handle, pValue)) + + + def SetIntegerValue(self, Value): + nValue = ctypes.c_int64(Value) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlattribute_setintegervalue(self._handle, nValue)) + + + def SetDoubleValue(self, Value): + dValue = ctypes.c_double(Value) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlattribute_setdoublevalue(self._handle, dValue)) + + + def SetBoolValue(self, Value): + bValue = ctypes.c_bool(Value) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlattribute_setboolvalue(self._handle, bValue)) + + + def Remove(self): + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlattribute_remove(self._handle)) + + + + +''' Class Implementation for CustomXMLNode +''' +class CustomXMLNode(Base): + def __init__(self, handle, wrapper): + Base.__init__(self, handle, wrapper) + def GetName(self): + nNameBufferSize = ctypes.c_uint64(0) + nNameNeededChars = ctypes.c_uint64(0) + pNameBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnode_getname(self._handle, nNameBufferSize, nNameNeededChars, pNameBuffer)) + nNameBufferSize = ctypes.c_uint64(nNameNeededChars.value) + pNameBuffer = (ctypes.c_char * (nNameNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnode_getname(self._handle, nNameBufferSize, nNameNeededChars, pNameBuffer)) + + return pNameBuffer.value.decode() + + def GetNameSpace(self): + nNameSpaceBufferSize = ctypes.c_uint64(0) + nNameSpaceNeededChars = ctypes.c_uint64(0) + pNameSpaceBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnode_getnamespace(self._handle, nNameSpaceBufferSize, nNameSpaceNeededChars, pNameSpaceBuffer)) + nNameSpaceBufferSize = ctypes.c_uint64(nNameSpaceNeededChars.value) + pNameSpaceBuffer = (ctypes.c_char * (nNameSpaceNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnode_getnamespace(self._handle, nNameSpaceBufferSize, nNameSpaceNeededChars, pNameSpaceBuffer)) + + return pNameSpaceBuffer.value.decode() + + def GetAttributeCount(self): + pCount = ctypes.c_uint64() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnode_getattributecount(self._handle, pCount)) + + return pCount.value + + def GetAttribute(self, Index): + nIndex = ctypes.c_uint64(Index) + AttributeInstanceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnode_getattribute(self._handle, nIndex, AttributeInstanceHandle)) + if AttributeInstanceHandle: + AttributeInstanceObject = self._wrapper._polymorphicFactory(AttributeInstanceHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return AttributeInstanceObject + + def HasAttribute(self, Name): + pName = ctypes.c_char_p(str.encode(Name)) + pAttributeExists = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnode_hasattribute(self._handle, pName, pAttributeExists)) + + return pAttributeExists.value + + def FindAttribute(self, Name, MustExist): + pName = ctypes.c_char_p(str.encode(Name)) + bMustExist = ctypes.c_bool(MustExist) + AttributeInstanceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnode_findattribute(self._handle, pName, bMustExist, AttributeInstanceHandle)) + if AttributeInstanceHandle: + AttributeInstanceObject = self._wrapper._polymorphicFactory(AttributeInstanceHandle) + else: + AttributeInstanceObject = None + + return AttributeInstanceObject + + def RemoveAttribute(self, Name): + pName = ctypes.c_char_p(str.encode(Name)) + pAttributeRemoved = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnode_removeattribute(self._handle, pName, pAttributeRemoved)) + + return pAttributeRemoved.value + + def RemoveAttributeByIndex(self, Index): + nIndex = ctypes.c_uint64(Index) + pAttributeRemoved = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnode_removeattributebyindex(self._handle, nIndex, pAttributeRemoved)) + + return pAttributeRemoved.value + + def AddAttribute(self, Name, Value): + pName = ctypes.c_char_p(str.encode(Name)) + pValue = ctypes.c_char_p(str.encode(Value)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnode_addattribute(self._handle, pName, pValue)) + + + def AddIntegerAttribute(self, Name, Value): + pName = ctypes.c_char_p(str.encode(Name)) + nValue = ctypes.c_int64(Value) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnode_addintegerattribute(self._handle, pName, nValue)) + + + def AddDoubleAttribute(self, Name, Value): + pName = ctypes.c_char_p(str.encode(Name)) + dValue = ctypes.c_double(Value) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnode_adddoubleattribute(self._handle, pName, dValue)) + + + def AddBoolAttribute(self, Name, Value): + pName = ctypes.c_char_p(str.encode(Name)) + bValue = ctypes.c_bool(Value) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnode_addboolattribute(self._handle, pName, bValue)) + + + def GetChildren(self): + ChildNodesHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnode_getchildren(self._handle, ChildNodesHandle)) + if ChildNodesHandle: + ChildNodesObject = self._wrapper._polymorphicFactory(ChildNodesHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return ChildNodesObject + + def CountChildrenByName(self, Name): + pName = ctypes.c_char_p(str.encode(Name)) + pCount = ctypes.c_uint64() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnode_countchildrenbyname(self._handle, pName, pCount)) + + return pCount.value + + def GetChildrenByName(self, Name): + pName = ctypes.c_char_p(str.encode(Name)) + ChildNodesHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnode_getchildrenbyname(self._handle, pName, ChildNodesHandle)) + if ChildNodesHandle: + ChildNodesObject = self._wrapper._polymorphicFactory(ChildNodesHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return ChildNodesObject + + def HasChild(self, Name): + pName = ctypes.c_char_p(str.encode(Name)) + pChildExists = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnode_haschild(self._handle, pName, pChildExists)) + + return pChildExists.value + + def HasUniqueChild(self, Name): + pName = ctypes.c_char_p(str.encode(Name)) + pChildExists = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnode_hasuniquechild(self._handle, pName, pChildExists)) + + return pChildExists.value + + def FindChild(self, Name, MustExist): + pName = ctypes.c_char_p(str.encode(Name)) + bMustExist = ctypes.c_bool(MustExist) + ChildInstanceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnode_findchild(self._handle, pName, bMustExist, ChildInstanceHandle)) + if ChildInstanceHandle: + ChildInstanceObject = self._wrapper._polymorphicFactory(ChildInstanceHandle) + else: + ChildInstanceObject = None + + return ChildInstanceObject + + def AddChild(self, Name): + pName = ctypes.c_char_p(str.encode(Name)) + ChildInstanceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnode_addchild(self._handle, pName, ChildInstanceHandle)) + if ChildInstanceHandle: + ChildInstanceObject = self._wrapper._polymorphicFactory(ChildInstanceHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return ChildInstanceObject + + def RemoveChild(self, ChildInstanceObject): + ChildInstanceHandle = None + if ChildInstanceObject: + ChildInstanceHandle = ChildInstanceObject._handle + else: + raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnode_removechild(self._handle, ChildInstanceHandle)) + + + def RemoveChildrenWithName(self, Name): + pName = ctypes.c_char_p(str.encode(Name)) + pNumberOfDeletedChildren = ctypes.c_uint64() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnode_removechildrenwithname(self._handle, pName, pNumberOfDeletedChildren)) + + return pNumberOfDeletedChildren.value + + def Remove(self): + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnode_remove(self._handle)) + + + + +''' Class Implementation for CustomXMLNodes +''' +class CustomXMLNodes(Base): + def __init__(self, handle, wrapper): + Base.__init__(self, handle, wrapper) + def GetNodeCount(self): + pCount = ctypes.c_uint64() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnodes_getnodecount(self._handle, pCount)) + + return pCount.value + + def GetNode(self, Index): + nIndex = ctypes.c_uint64(Index) + NodeInstanceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnodes_getnode(self._handle, nIndex, NodeInstanceHandle)) + if NodeInstanceHandle: + NodeInstanceObject = self._wrapper._polymorphicFactory(NodeInstanceHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return NodeInstanceObject + + def CountNodesByName(self, Name): + pName = ctypes.c_char_p(str.encode(Name)) + pCount = ctypes.c_uint64() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnodes_countnodesbyname(self._handle, pName, pCount)) + + return pCount.value + + def GetNodesByName(self, Name): + pName = ctypes.c_char_p(str.encode(Name)) + NodesHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnodes_getnodesbyname(self._handle, pName, NodesHandle)) + if NodesHandle: + NodesObject = self._wrapper._polymorphicFactory(NodesHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return NodesObject + + def HasNode(self, Name): + pName = ctypes.c_char_p(str.encode(Name)) + pNodeExists = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnodes_hasnode(self._handle, pName, pNodeExists)) + + return pNodeExists.value + + def HasUniqueNode(self, Name): + pName = ctypes.c_char_p(str.encode(Name)) + pNodeExists = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnodes_hasuniquenode(self._handle, pName, pNodeExists)) + + return pNodeExists.value + + def FindNode(self, Name, MustExist): + pName = ctypes.c_char_p(str.encode(Name)) + bMustExist = ctypes.c_bool(MustExist) + NodeInstanceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customxmlnodes_findnode(self._handle, pName, bMustExist, NodeInstanceHandle)) + if NodeInstanceHandle: + NodeInstanceObject = self._wrapper._polymorphicFactory(NodeInstanceHandle) + else: + NodeInstanceObject = None + + return NodeInstanceObject + + + +''' Class Implementation for CustomDOMTree +''' +class CustomDOMTree(Base): + def __init__(self, handle, wrapper): + Base.__init__(self, handle, wrapper) + def GetNameSpace(self): + nNameSpaceBufferSize = ctypes.c_uint64(0) + nNameSpaceNeededChars = ctypes.c_uint64(0) + pNameSpaceBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customdomtree_getnamespace(self._handle, nNameSpaceBufferSize, nNameSpaceNeededChars, pNameSpaceBuffer)) + nNameSpaceBufferSize = ctypes.c_uint64(nNameSpaceNeededChars.value) + pNameSpaceBuffer = (ctypes.c_char * (nNameSpaceNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customdomtree_getnamespace(self._handle, nNameSpaceBufferSize, nNameSpaceNeededChars, pNameSpaceBuffer)) + + return pNameSpaceBuffer.value.decode() + + def GetRootNode(self): + RootNodeHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customdomtree_getrootnode(self._handle, RootNodeHandle)) + if RootNodeHandle: + RootNodeObject = self._wrapper._polymorphicFactory(RootNodeHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return RootNodeObject + + def SaveToString(self): + nXMLStringBufferSize = ctypes.c_uint64(0) + nXMLStringNeededChars = ctypes.c_uint64(0) + pXMLStringBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customdomtree_savetostring(self._handle, nXMLStringBufferSize, nXMLStringNeededChars, pXMLStringBuffer)) + nXMLStringBufferSize = ctypes.c_uint64(nXMLStringNeededChars.value) + pXMLStringBuffer = (ctypes.c_char * (nXMLStringNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_customdomtree_savetostring(self._handle, nXMLStringBufferSize, nXMLStringNeededChars, pXMLStringBuffer)) + + return pXMLStringBuffer.value.decode() + + + +''' Class Implementation for SliceStackIterator +''' +class SliceStackIterator(ResourceIterator): + def __init__(self, handle, wrapper): + ResourceIterator.__init__(self, handle, wrapper) + def GetCurrentSliceStack(self): + ResourceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slicestackiterator_getcurrentslicestack(self._handle, ResourceHandle)) + if ResourceHandle: + ResourceObject = self._wrapper._polymorphicFactory(ResourceHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return ResourceObject + + + +''' Class Implementation for ObjectIterator +''' +class ObjectIterator(ResourceIterator): + def __init__(self, handle, wrapper): + ResourceIterator.__init__(self, handle, wrapper) + def GetCurrentObject(self): + ResourceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_objectiterator_getcurrentobject(self._handle, ResourceHandle)) + if ResourceHandle: + ResourceObject = self._wrapper._polymorphicFactory(ResourceHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return ResourceObject + + + +''' Class Implementation for MeshObjectIterator +''' +class MeshObjectIterator(ResourceIterator): + def __init__(self, handle, wrapper): + ResourceIterator.__init__(self, handle, wrapper) + def GetCurrentMeshObject(self): + ResourceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobjectiterator_getcurrentmeshobject(self._handle, ResourceHandle)) + if ResourceHandle: + ResourceObject = self._wrapper._polymorphicFactory(ResourceHandle) else: - raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') - self.checkError(None, self.lib.lib3mf_release(InstanceHandle)) + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + return ResourceObject - def Acquire(self, InstanceObject): - InstanceHandle = None - if InstanceObject: - InstanceHandle = InstanceObject._handle + + +''' Class Implementation for ComponentsObjectIterator +''' +class ComponentsObjectIterator(ResourceIterator): + def __init__(self, handle, wrapper): + ResourceIterator.__init__(self, handle, wrapper) + def GetCurrentComponentsObject(self): + ResourceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_componentsobjectiterator_getcurrentcomponentsobject(self._handle, ResourceHandle)) + if ResourceHandle: + ResourceObject = self._wrapper._polymorphicFactory(ResourceHandle) else: - raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') - self.checkError(None, self.lib.lib3mf_acquire(InstanceHandle)) + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + return ResourceObject - def SetJournal(self, JournalPath): - pJournalPath = ctypes.c_char_p(str.encode(JournalPath)) - self.checkError(None, self.lib.lib3mf_setjournal(pJournalPath)) + + +''' Class Implementation for Texture2DIterator +''' +class Texture2DIterator(ResourceIterator): + def __init__(self, handle, wrapper): + ResourceIterator.__init__(self, handle, wrapper) + def GetCurrentTexture2D(self): + ResourceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2diterator_getcurrenttexture2d(self._handle, ResourceHandle)) + if ResourceHandle: + ResourceObject = self._wrapper._polymorphicFactory(ResourceHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return ResourceObject + + + +''' Class Implementation for BaseMaterialGroupIterator +''' +class BaseMaterialGroupIterator(ResourceIterator): + def __init__(self, handle, wrapper): + ResourceIterator.__init__(self, handle, wrapper) + def GetCurrentBaseMaterialGroup(self): + ResourceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup(self._handle, ResourceHandle)) + if ResourceHandle: + ResourceObject = self._wrapper._polymorphicFactory(ResourceHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return ResourceObject + + + +''' Class Implementation for ColorGroupIterator +''' +class ColorGroupIterator(ResourceIterator): + def __init__(self, handle, wrapper): + ResourceIterator.__init__(self, handle, wrapper) + def GetCurrentColorGroup(self): + ResourceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_colorgroupiterator_getcurrentcolorgroup(self._handle, ResourceHandle)) + if ResourceHandle: + ResourceObject = self._wrapper._polymorphicFactory(ResourceHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return ResourceObject + + + +''' Class Implementation for Texture2DGroupIterator +''' +class Texture2DGroupIterator(ResourceIterator): + def __init__(self, handle, wrapper): + ResourceIterator.__init__(self, handle, wrapper) + def GetCurrentTexture2DGroup(self): + ResourceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup(self._handle, ResourceHandle)) + if ResourceHandle: + ResourceObject = self._wrapper._polymorphicFactory(ResourceHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return ResourceObject + + + +''' Class Implementation for CompositeMaterialsIterator +''' +class CompositeMaterialsIterator(ResourceIterator): + def __init__(self, handle, wrapper): + ResourceIterator.__init__(self, handle, wrapper) + def GetCurrentCompositeMaterials(self): + ResourceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_compositematerialsiterator_getcurrentcompositematerials(self._handle, ResourceHandle)) + if ResourceHandle: + ResourceObject = self._wrapper._polymorphicFactory(ResourceHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return ResourceObject + + + +''' Class Implementation for MultiPropertyGroupIterator +''' +class MultiPropertyGroupIterator(ResourceIterator): + def __init__(self, handle, wrapper): + ResourceIterator.__init__(self, handle, wrapper) + def GetCurrentMultiPropertyGroup(self): + ResourceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup(self._handle, ResourceHandle)) + if ResourceHandle: + ResourceObject = self._wrapper._polymorphicFactory(ResourceHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return ResourceObject + + + +''' Class Implementation for MetaData +''' +class MetaData(Base): + def __init__(self, handle, wrapper): + Base.__init__(self, handle, wrapper) + def GetNameSpace(self): + nNameSpaceBufferSize = ctypes.c_uint64(0) + nNameSpaceNeededChars = ctypes.c_uint64(0) + pNameSpaceBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_getnamespace(self._handle, nNameSpaceBufferSize, nNameSpaceNeededChars, pNameSpaceBuffer)) + nNameSpaceBufferSize = ctypes.c_uint64(nNameSpaceNeededChars.value) + pNameSpaceBuffer = (ctypes.c_char * (nNameSpaceNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_getnamespace(self._handle, nNameSpaceBufferSize, nNameSpaceNeededChars, pNameSpaceBuffer)) + + return pNameSpaceBuffer.value.decode() + + def SetNameSpace(self, NameSpace): + pNameSpace = ctypes.c_char_p(str.encode(NameSpace)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_setnamespace(self._handle, pNameSpace)) + + + def GetName(self): + nNameBufferSize = ctypes.c_uint64(0) + nNameNeededChars = ctypes.c_uint64(0) + pNameBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_getname(self._handle, nNameBufferSize, nNameNeededChars, pNameBuffer)) + nNameBufferSize = ctypes.c_uint64(nNameNeededChars.value) + pNameBuffer = (ctypes.c_char * (nNameNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_getname(self._handle, nNameBufferSize, nNameNeededChars, pNameBuffer)) + + return pNameBuffer.value.decode() + + def SetName(self, Name): + pName = ctypes.c_char_p(str.encode(Name)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_setname(self._handle, pName)) + + + def GetKey(self): + nKeyBufferSize = ctypes.c_uint64(0) + nKeyNeededChars = ctypes.c_uint64(0) + pKeyBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_getkey(self._handle, nKeyBufferSize, nKeyNeededChars, pKeyBuffer)) + nKeyBufferSize = ctypes.c_uint64(nKeyNeededChars.value) + pKeyBuffer = (ctypes.c_char * (nKeyNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_getkey(self._handle, nKeyBufferSize, nKeyNeededChars, pKeyBuffer)) + + return pKeyBuffer.value.decode() + + def GetMustPreserve(self): + pMustPreserve = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_getmustpreserve(self._handle, pMustPreserve)) + + return pMustPreserve.value + + def SetMustPreserve(self, MustPreserve): + bMustPreserve = ctypes.c_bool(MustPreserve) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_setmustpreserve(self._handle, bMustPreserve)) + + + def GetType(self): + nTypeBufferSize = ctypes.c_uint64(0) + nTypeNeededChars = ctypes.c_uint64(0) + pTypeBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_gettype(self._handle, nTypeBufferSize, nTypeNeededChars, pTypeBuffer)) + nTypeBufferSize = ctypes.c_uint64(nTypeNeededChars.value) + pTypeBuffer = (ctypes.c_char * (nTypeNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_gettype(self._handle, nTypeBufferSize, nTypeNeededChars, pTypeBuffer)) + + return pTypeBuffer.value.decode() + + def SetType(self, Type): + pType = ctypes.c_char_p(str.encode(Type)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_settype(self._handle, pType)) + + + def GetValue(self): + nValueBufferSize = ctypes.c_uint64(0) + nValueNeededChars = ctypes.c_uint64(0) + pValueBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_getvalue(self._handle, nValueBufferSize, nValueNeededChars, pValueBuffer)) + nValueBufferSize = ctypes.c_uint64(nValueNeededChars.value) + pValueBuffer = (ctypes.c_char * (nValueNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_getvalue(self._handle, nValueBufferSize, nValueNeededChars, pValueBuffer)) + + return pValueBuffer.value.decode() + + def SetValue(self, Value): + pValue = ctypes.c_char_p(str.encode(Value)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_setvalue(self._handle, pValue)) + + + + +''' Class Implementation for MetaDataGroup +''' +class MetaDataGroup(Base): + def __init__(self, handle, wrapper): + Base.__init__(self, handle, wrapper) + def GetMetaDataCount(self): + pCount = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadatagroup_getmetadatacount(self._handle, pCount)) + return pCount.value - def GetLastError(self, InstanceObject): - InstanceHandle = None - if InstanceObject: - InstanceHandle = InstanceObject._handle + def GetMetaData(self, Index): + nIndex = ctypes.c_uint32(Index) + MetaDataHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadatagroup_getmetadata(self._handle, nIndex, MetaDataHandle)) + if MetaDataHandle: + MetaDataObject = self._wrapper._polymorphicFactory(MetaDataHandle) else: - raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') - nLastErrorStringBufferSize = ctypes.c_uint64(0) - nLastErrorStringNeededChars = ctypes.c_uint64(0) - pLastErrorStringBuffer = ctypes.c_char_p(None) - pHasLastError = ctypes.c_bool() - self.checkError(None, self.lib.lib3mf_getlasterror(InstanceHandle, nLastErrorStringBufferSize, nLastErrorStringNeededChars, pLastErrorStringBuffer, pHasLastError)) - nLastErrorStringBufferSize = ctypes.c_uint64(nLastErrorStringNeededChars.value) - pLastErrorStringBuffer = (ctypes.c_char * (nLastErrorStringNeededChars.value))() - self.checkError(None, self.lib.lib3mf_getlasterror(InstanceHandle, nLastErrorStringBufferSize, nLastErrorStringNeededChars, pLastErrorStringBuffer, pHasLastError)) - - return pLastErrorStringBuffer.value.decode(), pHasLastError.value - - def GetSymbolLookupMethod(self): - pSymbolLookupMethod = ctypes.c_void_p() - self.checkError(None, self.lib.lib3mf_getsymbollookupmethod(pSymbolLookupMethod)) + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') - return pSymbolLookupMethod.value + return MetaDataObject - def RetrieveProgressMessage(self, TheProgressIdentifier): - nProgressMessageBufferSize = ctypes.c_uint64(0) - nProgressMessageNeededChars = ctypes.c_uint64(0) - pProgressMessageBuffer = ctypes.c_char_p(None) - self.checkError(None, self.lib.lib3mf_retrieveprogressmessage(TheProgressIdentifier, nProgressMessageBufferSize, nProgressMessageNeededChars, pProgressMessageBuffer)) - nProgressMessageBufferSize = ctypes.c_uint64(nProgressMessageNeededChars.value) - pProgressMessageBuffer = (ctypes.c_char * (nProgressMessageNeededChars.value))() - self.checkError(None, self.lib.lib3mf_retrieveprogressmessage(TheProgressIdentifier, nProgressMessageBufferSize, nProgressMessageNeededChars, pProgressMessageBuffer)) + def GetMetaDataByKey(self, NameSpace, Name): + pNameSpace = ctypes.c_char_p(str.encode(NameSpace)) + pName = ctypes.c_char_p(str.encode(Name)) + MetaDataHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadatagroup_getmetadatabykey(self._handle, pNameSpace, pName, MetaDataHandle)) + if MetaDataHandle: + MetaDataObject = self._wrapper._polymorphicFactory(MetaDataHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') - return pProgressMessageBuffer.value.decode() + return MetaDataObject - def RGBAToColor(self, Red, Green, Blue, Alpha): - nRed = ctypes.c_uint8(Red) - nGreen = ctypes.c_uint8(Green) - nBlue = ctypes.c_uint8(Blue) - nAlpha = ctypes.c_uint8(Alpha) - pTheColor = Color() - self.checkError(None, self.lib.lib3mf_rgbatocolor(nRed, nGreen, nBlue, nAlpha, pTheColor)) + def RemoveMetaDataByIndex(self, Index): + nIndex = ctypes.c_uint32(Index) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadatagroup_removemetadatabyindex(self._handle, nIndex)) - return pTheColor - def FloatRGBAToColor(self, Red, Green, Blue, Alpha): - fRed = ctypes.c_float(Red) - fGreen = ctypes.c_float(Green) - fBlue = ctypes.c_float(Blue) - fAlpha = ctypes.c_float(Alpha) - pTheColor = Color() - self.checkError(None, self.lib.lib3mf_floatrgbatocolor(fRed, fGreen, fBlue, fAlpha, pTheColor)) + def RemoveMetaData(self, TheMetaDataObject): + TheMetaDataHandle = None + if TheMetaDataObject: + TheMetaDataHandle = TheMetaDataObject._handle + else: + raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadatagroup_removemetadata(self._handle, TheMetaDataHandle)) - return pTheColor - def ColorToRGBA(self, TheColor): - pRed = ctypes.c_uint8() - pGreen = ctypes.c_uint8() - pBlue = ctypes.c_uint8() - pAlpha = ctypes.c_uint8() - self.checkError(None, self.lib.lib3mf_colortorgba(TheColor, pRed, pGreen, pBlue, pAlpha)) + def AddMetaData(self, NameSpace, Name, Value, Type, MustPreserve): + pNameSpace = ctypes.c_char_p(str.encode(NameSpace)) + pName = ctypes.c_char_p(str.encode(Name)) + pValue = ctypes.c_char_p(str.encode(Value)) + pType = ctypes.c_char_p(str.encode(Type)) + bMustPreserve = ctypes.c_bool(MustPreserve) + MetaDataHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadatagroup_addmetadata(self._handle, pNameSpace, pName, pValue, pType, bMustPreserve, MetaDataHandle)) + if MetaDataHandle: + MetaDataObject = self._wrapper._polymorphicFactory(MetaDataHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') - return pRed.value, pGreen.value, pBlue.value, pAlpha.value + return MetaDataObject - def ColorToFloatRGBA(self, TheColor): - pRed = ctypes.c_float() - pGreen = ctypes.c_float() - pBlue = ctypes.c_float() - pAlpha = ctypes.c_float() - self.checkError(None, self.lib.lib3mf_colortofloatrgba(TheColor, pRed, pGreen, pBlue, pAlpha)) + + +''' Class Implementation for Object +''' +class Object(Resource): + def __init__(self, handle, wrapper): + Resource.__init__(self, handle, wrapper) + def GetType(self): + pObjectType = ctypes.c_int32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_gettype(self._handle, pObjectType)) - return pRed.value, pGreen.value, pBlue.value, pAlpha.value + return ObjectType(pObjectType.value) - def GetIdentityTransform(self): - pTransform = Transform() - self.checkError(None, self.lib.lib3mf_getidentitytransform(pTransform)) + def SetType(self, ObjectType): + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_settype(self._handle, ObjectType)) - return pTransform - def GetUniformScaleTransform(self, Factor): - fFactor = ctypes.c_float(Factor) - pTransform = Transform() - self.checkError(None, self.lib.lib3mf_getuniformscaletransform(fFactor, pTransform)) + def GetName(self): + nNameBufferSize = ctypes.c_uint64(0) + nNameNeededChars = ctypes.c_uint64(0) + pNameBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_getname(self._handle, nNameBufferSize, nNameNeededChars, pNameBuffer)) + nNameBufferSize = ctypes.c_uint64(nNameNeededChars.value) + pNameBuffer = (ctypes.c_char * (nNameNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_getname(self._handle, nNameBufferSize, nNameNeededChars, pNameBuffer)) - return pTransform + return pNameBuffer.value.decode() - def GetScaleTransform(self, FactorX, FactorY, FactorZ): - fFactorX = ctypes.c_float(FactorX) - fFactorY = ctypes.c_float(FactorY) - fFactorZ = ctypes.c_float(FactorZ) - pTransform = Transform() - self.checkError(None, self.lib.lib3mf_getscaletransform(fFactorX, fFactorY, fFactorZ, pTransform)) + def SetName(self, Name): + pName = ctypes.c_char_p(str.encode(Name)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_setname(self._handle, pName)) - return pTransform - def GetTranslationTransform(self, VectorX, VectorY, VectorZ): - fVectorX = ctypes.c_float(VectorX) - fVectorY = ctypes.c_float(VectorY) - fVectorZ = ctypes.c_float(VectorZ) - pTransform = Transform() - self.checkError(None, self.lib.lib3mf_gettranslationtransform(fVectorX, fVectorY, fVectorZ, pTransform)) + def GetPartNumber(self): + nPartNumberBufferSize = ctypes.c_uint64(0) + nPartNumberNeededChars = ctypes.c_uint64(0) + pPartNumberBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_getpartnumber(self._handle, nPartNumberBufferSize, nPartNumberNeededChars, pPartNumberBuffer)) + nPartNumberBufferSize = ctypes.c_uint64(nPartNumberNeededChars.value) + pPartNumberBuffer = (ctypes.c_char * (nPartNumberNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_getpartnumber(self._handle, nPartNumberBufferSize, nPartNumberNeededChars, pPartNumberBuffer)) - return pTransform + return pPartNumberBuffer.value.decode() - '''IMPORTANT: PolymorphicFactory method should not be used by application directly. - It's designed to be used on Lib3MFHandle object only once. - If it's used on any existing object as a form of dynamic cast then - Wrapper.AcquireInstance(object) must be called after instantiating new object. - This is important to keep reference count matching between application and library sides. - ''' - def _polymorphicFactory(self, handle): - class PolymorphicFactory(): - def getObjectById(self, classtypeid, handle, wrapper): - methodName = 'getObjectById_' + format(classtypeid.value, '016X') - method = getattr(self, methodName, lambda: 'Invalid class type id') - return method(handle, wrapper) - def getObjectById_856632D0BAF1D8B7(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Base" - return Base(handle, wrapper) - def getObjectById_E76F642F363FD7E9(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Writer" - return Writer(handle, wrapper) - def getObjectById_2D86831DA59FBE72(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Reader" - return Reader(handle, wrapper) - def getObjectById_0E55A826D377483E(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::PackagePart" - return PackagePart(handle, wrapper) - def getObjectById_DFE3889D1B269CBB(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Resource" - return Resource(handle, wrapper) - def getObjectById_460F3515E2621DBE(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::ResourceIterator" - return ResourceIterator(handle, wrapper) - def getObjectById_69684DB99FA813F6(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::SliceStackIterator" - return SliceStackIterator(handle, wrapper) - def getObjectById_DE92510BD2112288(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::ObjectIterator" - return ObjectIterator(handle, wrapper) - def getObjectById_F4196034E2B9FDE6(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::MeshObjectIterator" - return MeshObjectIterator(handle, wrapper) - def getObjectById_564DE4217ED7614A(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::ComponentsObjectIterator" - return ComponentsObjectIterator(handle, wrapper) - def getObjectById_4BD32B4870FFC03B(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Texture2DIterator" - return Texture2DIterator(handle, wrapper) - def getObjectById_65E6EDD9362C79CB(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::BaseMaterialGroupIterator" - return BaseMaterialGroupIterator(handle, wrapper) - def getObjectById_10274A1757C729C0(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::ColorGroupIterator" - return ColorGroupIterator(handle, wrapper) - def getObjectById_30D55F4DB88FE0CA(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Texture2DGroupIterator" - return Texture2DGroupIterator(handle, wrapper) - def getObjectById_A99CC6C3F70FB6F9(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::CompositeMaterialsIterator" - return CompositeMaterialsIterator(handle, wrapper) - def getObjectById_C2BDF5D8CBBDB1F0(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::MultiPropertyGroupIterator" - return MultiPropertyGroupIterator(handle, wrapper) - def getObjectById_D17716D063DE2C22(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::MetaData" - return MetaData(handle, wrapper) - def getObjectById_0C3B85369E9B25D3(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::MetaDataGroup" - return MetaDataGroup(handle, wrapper) - def getObjectById_2DA2136F577A779C(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Object" - return Object(handle, wrapper) - def getObjectById_3B3A6DC6EC610497(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::MeshObject" - return MeshObject(handle, wrapper) - def getObjectById_63B3B461B30B4BA5(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::BeamLattice" - return BeamLattice(handle, wrapper) - def getObjectById_4ECDB6A6F69F2BEB(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Component" - return Component(handle, wrapper) - def getObjectById_6522CF04EB283FED(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::ComponentsObject" - return ComponentsObject(handle, wrapper) - def getObjectById_30CCDBE90E00B55B(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::BeamSet" - return BeamSet(handle, wrapper) - def getObjectById_B27D4656E16609FA(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::BaseMaterialGroup" - return BaseMaterialGroup(handle, wrapper) - def getObjectById_D085FB2E49CDB5B1(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::ColorGroup" - return ColorGroup(handle, wrapper) - def getObjectById_BC1208397E37055D(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Texture2DGroup" - return Texture2DGroup(handle, wrapper) - def getObjectById_CE16224D688B86F2(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::CompositeMaterials" - return CompositeMaterials(handle, wrapper) - def getObjectById_B989E02E43158FE6(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::MultiPropertyGroup" - return MultiPropertyGroup(handle, wrapper) - def getObjectById_8CE7A1191A63A35D(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Attachment" - return Attachment(handle, wrapper) - def getObjectById_E0441CF976B36319(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Texture2D" - return Texture2D(handle, wrapper) - def getObjectById_68FB2D5FFC4BA12A(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::BuildItem" - return BuildItem(handle, wrapper) - def getObjectById_A7D21BD364910860(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::BuildItemIterator" - return BuildItemIterator(handle, wrapper) - def getObjectById_2198BCF4D8DF9C40(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Slice" - return Slice(handle, wrapper) - def getObjectById_6594B031B6096238(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::SliceStack" - return SliceStack(handle, wrapper) - def getObjectById_D9E46D5E6D8118EE(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Consumer" - return Consumer(handle, wrapper) - def getObjectById_385C42FC5609498A(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::AccessRight" - return AccessRight(handle, wrapper) - def getObjectById_7FB36B91D4CE4671(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::ContentEncryptionParams" - return ContentEncryptionParams(handle, wrapper) - def getObjectById_1A47A5E258E22EF9(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::ResourceData" - return ResourceData(handle, wrapper) - def getObjectById_D59067227E428AA4(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::ResourceDataGroup" - return ResourceDataGroup(handle, wrapper) - def getObjectById_1CC9E0CC082253C6(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::KeyStore" - return KeyStore(handle, wrapper) - def getObjectById_5A8164ECEDB03F09(self, handle, wrapper): # First 64 bits of SHA1 of a string: "Lib3MF::Model" - return Model(handle, wrapper) + def SetPartNumber(self, PartNumber): + pPartNumber = ctypes.c_char_p(str.encode(PartNumber)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_setpartnumber(self._handle, pPartNumber)) - if not handle: - return None - pClassTypeId = ctypes.c_uint64() - self.checkError(None, self.lib.lib3mf_base_classtypeid(handle, pClassTypeId)) - factory = PolymorphicFactory() - return factory.getObjectById(pClassTypeId, handle, self) - - -''' Class Implementation for Base -''' -class Base: - def __init__(self, handle, wrapper): - if not handle or not wrapper: - raise ELib3MFException(ErrorCodes.INVALIDPARAM) - self._handle = handle - self._wrapper = wrapper + def IsMeshObject(self): + pIsMeshObject = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_ismeshobject(self._handle, pIsMeshObject)) + + return pIsMeshObject.value - def __del__(self): - self._wrapper.Release(self) - def ClassTypeId(self): - pClassTypeId = ctypes.c_uint64() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_base_classtypeid(self._handle, pClassTypeId)) + def IsComponentsObject(self): + pIsComponentsObject = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_iscomponentsobject(self._handle, pIsComponentsObject)) - return pClassTypeId.value + return pIsComponentsObject.value - - -''' Class Implementation for Writer -''' -class Writer(Base): - def __init__(self, handle, wrapper): - Base.__init__(self, handle, wrapper) - def WriteToFile(self, Filename): - pFilename = ctypes.c_char_p(str.encode(Filename)) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_writetofile(self._handle, pFilename)) + def IsValid(self): + pIsValid = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_isvalid(self._handle, pIsValid)) + return pIsValid.value - def GetStreamSize(self): - pStreamSize = ctypes.c_uint64() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_getstreamsize(self._handle, pStreamSize)) + def SetAttachmentAsThumbnail(self, AttachmentObject): + AttachmentHandle = None + if AttachmentObject: + AttachmentHandle = AttachmentObject._handle + else: + raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_setattachmentasthumbnail(self._handle, AttachmentHandle)) - return pStreamSize.value - def WriteToBuffer(self): - nBufferCount = ctypes.c_uint64(0) - nBufferNeededCount = ctypes.c_uint64(0) - pBufferBuffer = (ctypes.c_uint8*0)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_writetobuffer(self._handle, nBufferCount, nBufferNeededCount, pBufferBuffer)) - nBufferCount = ctypes.c_uint64(nBufferNeededCount.value) - pBufferBuffer = (ctypes.c_uint8 * nBufferNeededCount.value)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_writetobuffer(self._handle, nBufferCount, nBufferNeededCount, pBufferBuffer)) + def GetThumbnailAttachment(self): + AttachmentHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_getthumbnailattachment(self._handle, AttachmentHandle)) + if AttachmentHandle: + AttachmentObject = self._wrapper._polymorphicFactory(AttachmentHandle) + else: + AttachmentObject = None - return [pBufferBuffer[i] for i in range(nBufferNeededCount.value)] + return AttachmentObject - def WriteToCallback(self, TheWriteCallbackFunc, TheSeekCallbackFunc, UserData): - pUserData = ctypes.c_void_p(UserData) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_writetocallback(self._handle, TheWriteCallbackFunc, TheSeekCallbackFunc, pUserData)) + def ClearThumbnailAttachment(self): + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_clearthumbnailattachment(self._handle)) - def SetProgressCallback(self, ProgressCallbackFunc, UserData): - pUserData = ctypes.c_void_p(UserData) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_setprogresscallback(self._handle, ProgressCallbackFunc, pUserData)) + def GetOutbox(self): + pOutbox = Box() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_getoutbox(self._handle, pOutbox)) + return pOutbox - def GetDecimalPrecision(self): - pDecimalPrecision = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_getdecimalprecision(self._handle, pDecimalPrecision)) + def GetUUID(self): + pHasUUID = ctypes.c_bool() + nUUIDBufferSize = ctypes.c_uint64(0) + nUUIDNeededChars = ctypes.c_uint64(0) + pUUIDBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_getuuid(self._handle, pHasUUID, nUUIDBufferSize, nUUIDNeededChars, pUUIDBuffer)) + nUUIDBufferSize = ctypes.c_uint64(nUUIDNeededChars.value) + pUUIDBuffer = (ctypes.c_char * (nUUIDNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_getuuid(self._handle, pHasUUID, nUUIDBufferSize, nUUIDNeededChars, pUUIDBuffer)) - return pDecimalPrecision.value + return pHasUUID.value, pUUIDBuffer.value.decode() - def SetDecimalPrecision(self, DecimalPrecision): - nDecimalPrecision = ctypes.c_uint32(DecimalPrecision) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_setdecimalprecision(self._handle, nDecimalPrecision)) + def SetUUID(self, UUID): + pUUID = ctypes.c_char_p(str.encode(UUID)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_setuuid(self._handle, pUUID)) - def SetStrictModeActive(self, StrictModeActive): - bStrictModeActive = ctypes.c_bool(StrictModeActive) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_setstrictmodeactive(self._handle, bStrictModeActive)) + def GetMetaDataGroup(self): + MetaDataGroupHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_getmetadatagroup(self._handle, MetaDataGroupHandle)) + if MetaDataGroupHandle: + MetaDataGroupObject = self._wrapper._polymorphicFactory(MetaDataGroupHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + return MetaDataGroupObject - def GetStrictModeActive(self): - pStrictModeActive = ctypes.c_bool() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_getstrictmodeactive(self._handle, pStrictModeActive)) + def SetSlicesMeshResolution(self, MeshResolution): + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_setslicesmeshresolution(self._handle, MeshResolution)) - return pStrictModeActive.value - def GetWarning(self, Index): - nIndex = ctypes.c_uint32(Index) - pErrorCode = ctypes.c_uint32() - nWarningBufferSize = ctypes.c_uint64(0) - nWarningNeededChars = ctypes.c_uint64(0) - pWarningBuffer = ctypes.c_char_p(None) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_getwarning(self._handle, nIndex, pErrorCode, nWarningBufferSize, nWarningNeededChars, pWarningBuffer)) - nWarningBufferSize = ctypes.c_uint64(nWarningNeededChars.value) - pWarningBuffer = (ctypes.c_char * (nWarningNeededChars.value))() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_getwarning(self._handle, nIndex, pErrorCode, nWarningBufferSize, nWarningNeededChars, pWarningBuffer)) + def GetSlicesMeshResolution(self): + pMeshResolution = ctypes.c_int32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_getslicesmeshresolution(self._handle, pMeshResolution)) - return pErrorCode.value, pWarningBuffer.value.decode() + return SlicesMeshResolution(pMeshResolution.value) - def GetWarningCount(self): - pCount = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_getwarningcount(self._handle, pCount)) + def HasSlices(self, Recursive): + bRecursive = ctypes.c_bool(Recursive) + pHasSlices = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_hasslices(self._handle, bRecursive, pHasSlices)) - return pCount.value + return pHasSlices.value - def AddKeyWrappingCallback(self, ConsumerID, TheCallbackFunc, UserData): - pConsumerID = ctypes.c_char_p(str.encode(ConsumerID)) - pUserData = ctypes.c_void_p(UserData) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_addkeywrappingcallback(self._handle, pConsumerID, TheCallbackFunc, pUserData)) + def ClearSliceStack(self): + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_clearslicestack(self._handle)) - def SetContentEncryptionCallback(self, TheCallbackFunc, UserData): - pUserData = ctypes.c_void_p(UserData) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_writer_setcontentencryptioncallback(self._handle, TheCallbackFunc, pUserData)) + def GetSliceStack(self): + SliceStackInstanceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_getslicestack(self._handle, SliceStackInstanceHandle)) + if SliceStackInstanceHandle: + SliceStackInstanceObject = self._wrapper._polymorphicFactory(SliceStackInstanceHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return SliceStackInstanceObject + + def AssignSliceStack(self, SliceStackInstanceObject): + SliceStackInstanceHandle = None + if SliceStackInstanceObject: + SliceStackInstanceHandle = SliceStackInstanceObject._handle + else: + raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_assignslicestack(self._handle, SliceStackInstanceHandle)) -''' Class Implementation for Reader +''' Class Implementation for MeshObject ''' -class Reader(Base): +class MeshObject(Object): def __init__(self, handle, wrapper): - Base.__init__(self, handle, wrapper) - def ReadFromFile(self, Filename): - pFilename = ctypes.c_char_p(str.encode(Filename)) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_readfromfile(self._handle, pFilename)) + Object.__init__(self, handle, wrapper) + def GetVertexCount(self): + pVertexCount = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_getvertexcount(self._handle, pVertexCount)) + return pVertexCount.value - def ReadFromBuffer(self, Buffer): - nBufferCount = ctypes.c_uint64(len(Buffer)) - pBufferBuffer = (ctypes.c_uint8*len(Buffer))(*Buffer) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_readfrombuffer(self._handle, nBufferCount, pBufferBuffer)) + def GetTriangleCount(self): + pVertexCount = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_gettrianglecount(self._handle, pVertexCount)) + return pVertexCount.value - def ReadFromCallback(self, TheReadCallbackFunc, StreamSize, TheSeekCallbackFunc, UserData): - nStreamSize = ctypes.c_uint64(StreamSize) - pUserData = ctypes.c_void_p(UserData) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_readfromcallback(self._handle, TheReadCallbackFunc, nStreamSize, TheSeekCallbackFunc, pUserData)) + def GetVertex(self, Index): + nIndex = ctypes.c_uint32(Index) + pCoordinates = Position() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_getvertex(self._handle, nIndex, pCoordinates)) + + return pCoordinates + + def SetVertex(self, Index, Coordinates): + nIndex = ctypes.c_uint32(Index) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_setvertex(self._handle, nIndex, Coordinates)) + + + def AddVertex(self, Coordinates): + pNewIndex = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_addvertex(self._handle, Coordinates, pNewIndex)) + + return pNewIndex.value + + def GetVertices(self): + nVerticesCount = ctypes.c_uint64(0) + nVerticesNeededCount = ctypes.c_uint64(0) + pVerticesBuffer = (Position*0)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_getvertices(self._handle, nVerticesCount, nVerticesNeededCount, pVerticesBuffer)) + nVerticesCount = ctypes.c_uint64(nVerticesNeededCount.value) + pVerticesBuffer = (Position * nVerticesNeededCount.value)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_getvertices(self._handle, nVerticesCount, nVerticesNeededCount, pVerticesBuffer)) + + return [pVerticesBuffer[i] for i in range(nVerticesNeededCount.value)] + + def GetTriangle(self, Index): + nIndex = ctypes.c_uint32(Index) + pIndices = Triangle() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_gettriangle(self._handle, nIndex, pIndices)) + + return pIndices + + def SetTriangle(self, Index, Indices): + nIndex = ctypes.c_uint32(Index) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_settriangle(self._handle, nIndex, Indices)) + + + def AddTriangle(self, Indices): + pNewIndex = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_addtriangle(self._handle, Indices, pNewIndex)) + + return pNewIndex.value + + def GetTriangleIndices(self): + nIndicesCount = ctypes.c_uint64(0) + nIndicesNeededCount = ctypes.c_uint64(0) + pIndicesBuffer = (Triangle*0)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_gettriangleindices(self._handle, nIndicesCount, nIndicesNeededCount, pIndicesBuffer)) + nIndicesCount = ctypes.c_uint64(nIndicesNeededCount.value) + pIndicesBuffer = (Triangle * nIndicesNeededCount.value)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_gettriangleindices(self._handle, nIndicesCount, nIndicesNeededCount, pIndicesBuffer)) + + return [pIndicesBuffer[i] for i in range(nIndicesNeededCount.value)] + + def SetObjectLevelProperty(self, UniqueResourceID, PropertyID): + nUniqueResourceID = ctypes.c_uint32(UniqueResourceID) + nPropertyID = ctypes.c_uint32(PropertyID) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_setobjectlevelproperty(self._handle, nUniqueResourceID, nPropertyID)) - def SetProgressCallback(self, ProgressCallbackFunc, UserData): - pUserData = ctypes.c_void_p(UserData) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_setprogresscallback(self._handle, ProgressCallbackFunc, pUserData)) + def GetObjectLevelProperty(self): + pUniqueResourceID = ctypes.c_uint32() + pPropertyID = ctypes.c_uint32() + pHasObjectLevelProperty = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_getobjectlevelproperty(self._handle, pUniqueResourceID, pPropertyID, pHasObjectLevelProperty)) + return pUniqueResourceID.value, pPropertyID.value, pHasObjectLevelProperty.value - def AddRelationToRead(self, RelationShipType): - pRelationShipType = ctypes.c_char_p(str.encode(RelationShipType)) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_addrelationtoread(self._handle, pRelationShipType)) + def SetTriangleProperties(self, Index, Properties): + nIndex = ctypes.c_uint32(Index) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_settriangleproperties(self._handle, nIndex, Properties)) - def RemoveRelationToRead(self, RelationShipType): - pRelationShipType = ctypes.c_char_p(str.encode(RelationShipType)) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_removerelationtoread(self._handle, pRelationShipType)) + def GetTriangleProperties(self, Index): + nIndex = ctypes.c_uint32(Index) + pProperty = TriangleProperties() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_gettriangleproperties(self._handle, nIndex, pProperty)) + return pProperty - def SetStrictModeActive(self, StrictModeActive): - bStrictModeActive = ctypes.c_bool(StrictModeActive) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_setstrictmodeactive(self._handle, bStrictModeActive)) + def SetAllTriangleProperties(self, PropertiesArray): + nPropertiesArrayCount = ctypes.c_uint64(len(PropertiesArray)) + pPropertiesArrayBuffer = (TriangleProperties*len(PropertiesArray))(*PropertiesArray) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_setalltriangleproperties(self._handle, nPropertiesArrayCount, pPropertiesArrayBuffer)) - def GetStrictModeActive(self): - pStrictModeActive = ctypes.c_bool() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_getstrictmodeactive(self._handle, pStrictModeActive)) + def GetAllTriangleProperties(self): + nPropertiesArrayCount = ctypes.c_uint64(0) + nPropertiesArrayNeededCount = ctypes.c_uint64(0) + pPropertiesArrayBuffer = (TriangleProperties*0)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_getalltriangleproperties(self._handle, nPropertiesArrayCount, nPropertiesArrayNeededCount, pPropertiesArrayBuffer)) + nPropertiesArrayCount = ctypes.c_uint64(nPropertiesArrayNeededCount.value) + pPropertiesArrayBuffer = (TriangleProperties * nPropertiesArrayNeededCount.value)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_getalltriangleproperties(self._handle, nPropertiesArrayCount, nPropertiesArrayNeededCount, pPropertiesArrayBuffer)) - return pStrictModeActive.value + return [pPropertiesArrayBuffer[i] for i in range(nPropertiesArrayNeededCount.value)] - def GetWarning(self, Index): - nIndex = ctypes.c_uint32(Index) - pErrorCode = ctypes.c_uint32() - nWarningBufferSize = ctypes.c_uint64(0) - nWarningNeededChars = ctypes.c_uint64(0) - pWarningBuffer = ctypes.c_char_p(None) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_getwarning(self._handle, nIndex, pErrorCode, nWarningBufferSize, nWarningNeededChars, pWarningBuffer)) - nWarningBufferSize = ctypes.c_uint64(nWarningNeededChars.value) - pWarningBuffer = (ctypes.c_char * (nWarningNeededChars.value))() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_getwarning(self._handle, nIndex, pErrorCode, nWarningBufferSize, nWarningNeededChars, pWarningBuffer)) + def ClearAllProperties(self): + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_clearallproperties(self._handle)) - return pErrorCode.value, pWarningBuffer.value.decode() - def GetWarningCount(self): - pCount = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_getwarningcount(self._handle, pCount)) + def SetGeometry(self, Vertices, Indices): + nVerticesCount = ctypes.c_uint64(len(Vertices)) + pVerticesBuffer = (Position*len(Vertices))(*Vertices) + nIndicesCount = ctypes.c_uint64(len(Indices)) + pIndicesBuffer = (Triangle*len(Indices))(*Indices) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_setgeometry(self._handle, nVerticesCount, pVerticesBuffer, nIndicesCount, pIndicesBuffer)) - return pCount.value - def AddKeyWrappingCallback(self, ConsumerID, TheCallbackFunc, UserData): - pConsumerID = ctypes.c_char_p(str.encode(ConsumerID)) - pUserData = ctypes.c_void_p(UserData) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_addkeywrappingcallback(self._handle, pConsumerID, TheCallbackFunc, pUserData)) + def IsManifoldAndOriented(self): + pIsManifoldAndOriented = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_ismanifoldandoriented(self._handle, pIsManifoldAndOriented)) + return pIsManifoldAndOriented.value - def SetContentEncryptionCallback(self, TheCallbackFunc, UserData): - pUserData = ctypes.c_void_p(UserData) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_reader_setcontentencryptioncallback(self._handle, TheCallbackFunc, pUserData)) + def BeamLattice(self): + TheBeamLatticeHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_beamlattice(self._handle, TheBeamLatticeHandle)) + if TheBeamLatticeHandle: + TheBeamLatticeObject = self._wrapper._polymorphicFactory(TheBeamLatticeHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + return TheBeamLatticeObject -''' Class Implementation for PackagePart +''' Class Implementation for BeamLattice ''' -class PackagePart(Base): +class BeamLattice(Base): def __init__(self, handle, wrapper): Base.__init__(self, handle, wrapper) - def GetPath(self): - nPathBufferSize = ctypes.c_uint64(0) - nPathNeededChars = ctypes.c_uint64(0) - pPathBuffer = ctypes.c_char_p(None) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_packagepart_getpath(self._handle, nPathBufferSize, nPathNeededChars, pPathBuffer)) - nPathBufferSize = ctypes.c_uint64(nPathNeededChars.value) - pPathBuffer = (ctypes.c_char * (nPathNeededChars.value))() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_packagepart_getpath(self._handle, nPathBufferSize, nPathNeededChars, pPathBuffer)) + def GetMinLength(self): + pMinLength = ctypes.c_double() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getminlength(self._handle, pMinLength)) - return pPathBuffer.value.decode() + return pMinLength.value - def SetPath(self, Path): - pPath = ctypes.c_char_p(str.encode(Path)) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_packagepart_setpath(self._handle, pPath)) + def SetMinLength(self, MinLength): + dMinLength = ctypes.c_double(MinLength) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_setminlength(self._handle, dMinLength)) - - -''' Class Implementation for Resource -''' -class Resource(Base): - def __init__(self, handle, wrapper): - Base.__init__(self, handle, wrapper) - def GetResourceID(self): + def GetClipping(self): + pClipMode = ctypes.c_int32() pUniqueResourceID = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_resource_getresourceid(self._handle, pUniqueResourceID)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getclipping(self._handle, pClipMode, pUniqueResourceID)) - return pUniqueResourceID.value + return BeamLatticeClipMode(pClipMode.value), pUniqueResourceID.value - def GetUniqueResourceID(self): - pUniqueResourceID = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_resource_getuniqueresourceid(self._handle, pUniqueResourceID)) + def SetClipping(self, ClipMode, UniqueResourceID): + nUniqueResourceID = ctypes.c_uint32(UniqueResourceID) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_setclipping(self._handle, ClipMode, nUniqueResourceID)) - return pUniqueResourceID.value - def PackagePart(self): - PackagePartHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_resource_packagepart(self._handle, PackagePartHandle)) - if PackagePartHandle: - PackagePartObject = self._wrapper._polymorphicFactory(PackagePartHandle) - else: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + def GetRepresentation(self): + pHasRepresentation = ctypes.c_bool() + pUniqueResourceID = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getrepresentation(self._handle, pHasRepresentation, pUniqueResourceID)) - return PackagePartObject + return pHasRepresentation.value, pUniqueResourceID.value - def SetPackagePart(self, PackagePartObject): - PackagePartHandle = None - if PackagePartObject: - PackagePartHandle = PackagePartObject._handle - else: - raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_resource_setpackagepart(self._handle, PackagePartHandle)) + def SetRepresentation(self, UniqueResourceID): + nUniqueResourceID = ctypes.c_uint32(UniqueResourceID) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_setrepresentation(self._handle, nUniqueResourceID)) - def GetModelResourceID(self): - pModelResourceId = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_resource_getmodelresourceid(self._handle, pModelResourceId)) + def GetBallOptions(self): + pBallMode = ctypes.c_int32() + pBallRadius = ctypes.c_double() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getballoptions(self._handle, pBallMode, pBallRadius)) - return pModelResourceId.value + return BeamLatticeBallMode(pBallMode.value), pBallRadius.value - - -''' Class Implementation for ResourceIterator -''' -class ResourceIterator(Base): - def __init__(self, handle, wrapper): - Base.__init__(self, handle, wrapper) - def MoveNext(self): - pHasNext = ctypes.c_bool() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_resourceiterator_movenext(self._handle, pHasNext)) + def SetBallOptions(self, BallMode, BallRadius): + dBallRadius = ctypes.c_double(BallRadius) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_setballoptions(self._handle, BallMode, dBallRadius)) - return pHasNext.value - def MovePrevious(self): - pHasPrevious = ctypes.c_bool() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_resourceiterator_moveprevious(self._handle, pHasPrevious)) + def GetBeamCount(self): + pCount = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getbeamcount(self._handle, pCount)) - return pHasPrevious.value + return pCount.value - def GetCurrent(self): - ResourceHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_resourceiterator_getcurrent(self._handle, ResourceHandle)) - if ResourceHandle: - ResourceObject = self._wrapper._polymorphicFactory(ResourceHandle) - else: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + def GetBeam(self, Index): + nIndex = ctypes.c_uint32(Index) + pBeamInfo = Beam() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getbeam(self._handle, nIndex, pBeamInfo)) - return ResourceObject + return pBeamInfo - def Clone(self): - OutResourceIteratorHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_resourceiterator_clone(self._handle, OutResourceIteratorHandle)) - if OutResourceIteratorHandle: - OutResourceIteratorObject = self._wrapper._polymorphicFactory(OutResourceIteratorHandle) - else: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + def AddBeam(self, BeamInfo): + pIndex = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_addbeam(self._handle, BeamInfo, pIndex)) - return OutResourceIteratorObject + return pIndex.value - def Count(self): - pCount = ctypes.c_uint64() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_resourceiterator_count(self._handle, pCount)) + def SetBeam(self, Index, BeamInfo): + nIndex = ctypes.c_uint32(Index) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_setbeam(self._handle, nIndex, BeamInfo)) - return pCount.value - - -''' Class Implementation for SliceStackIterator -''' -class SliceStackIterator(ResourceIterator): - def __init__(self, handle, wrapper): - ResourceIterator.__init__(self, handle, wrapper) - def GetCurrentSliceStack(self): - ResourceHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slicestackiterator_getcurrentslicestack(self._handle, ResourceHandle)) - if ResourceHandle: - ResourceObject = self._wrapper._polymorphicFactory(ResourceHandle) - else: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + def SetBeams(self, BeamInfo): + nBeamInfoCount = ctypes.c_uint64(len(BeamInfo)) + pBeamInfoBuffer = (Beam*len(BeamInfo))(*BeamInfo) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_setbeams(self._handle, nBeamInfoCount, pBeamInfoBuffer)) - return ResourceObject - - -''' Class Implementation for ObjectIterator -''' -class ObjectIterator(ResourceIterator): - def __init__(self, handle, wrapper): - ResourceIterator.__init__(self, handle, wrapper) - def GetCurrentObject(self): - ResourceHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_objectiterator_getcurrentobject(self._handle, ResourceHandle)) - if ResourceHandle: - ResourceObject = self._wrapper._polymorphicFactory(ResourceHandle) - else: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + def GetBeams(self): + nBeamInfoCount = ctypes.c_uint64(0) + nBeamInfoNeededCount = ctypes.c_uint64(0) + pBeamInfoBuffer = (Beam*0)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getbeams(self._handle, nBeamInfoCount, nBeamInfoNeededCount, pBeamInfoBuffer)) + nBeamInfoCount = ctypes.c_uint64(nBeamInfoNeededCount.value) + pBeamInfoBuffer = (Beam * nBeamInfoNeededCount.value)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getbeams(self._handle, nBeamInfoCount, nBeamInfoNeededCount, pBeamInfoBuffer)) - return ResourceObject + return [pBeamInfoBuffer[i] for i in range(nBeamInfoNeededCount.value)] - - -''' Class Implementation for MeshObjectIterator -''' -class MeshObjectIterator(ResourceIterator): - def __init__(self, handle, wrapper): - ResourceIterator.__init__(self, handle, wrapper) - def GetCurrentMeshObject(self): - ResourceHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobjectiterator_getcurrentmeshobject(self._handle, ResourceHandle)) - if ResourceHandle: - ResourceObject = self._wrapper._polymorphicFactory(ResourceHandle) - else: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + def GetBallCount(self): + pCount = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getballcount(self._handle, pCount)) - return ResourceObject + return pCount.value - - -''' Class Implementation for ComponentsObjectIterator -''' -class ComponentsObjectIterator(ResourceIterator): - def __init__(self, handle, wrapper): - ResourceIterator.__init__(self, handle, wrapper) - def GetCurrentComponentsObject(self): - ResourceHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_componentsobjectiterator_getcurrentcomponentsobject(self._handle, ResourceHandle)) - if ResourceHandle: - ResourceObject = self._wrapper._polymorphicFactory(ResourceHandle) - else: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + def GetBall(self, Index): + nIndex = ctypes.c_uint32(Index) + pBallInfo = Ball() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getball(self._handle, nIndex, pBallInfo)) - return ResourceObject + return pBallInfo - - -''' Class Implementation for Texture2DIterator -''' -class Texture2DIterator(ResourceIterator): - def __init__(self, handle, wrapper): - ResourceIterator.__init__(self, handle, wrapper) - def GetCurrentTexture2D(self): - ResourceHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2diterator_getcurrenttexture2d(self._handle, ResourceHandle)) - if ResourceHandle: - ResourceObject = self._wrapper._polymorphicFactory(ResourceHandle) - else: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + def AddBall(self, BallInfo): + pIndex = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_addball(self._handle, BallInfo, pIndex)) - return ResourceObject + return pIndex.value - - -''' Class Implementation for BaseMaterialGroupIterator -''' -class BaseMaterialGroupIterator(ResourceIterator): - def __init__(self, handle, wrapper): - ResourceIterator.__init__(self, handle, wrapper) - def GetCurrentBaseMaterialGroup(self): - ResourceHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup(self._handle, ResourceHandle)) - if ResourceHandle: - ResourceObject = self._wrapper._polymorphicFactory(ResourceHandle) - else: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + def SetBall(self, Index, BallInfo): + nIndex = ctypes.c_uint32(Index) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_setball(self._handle, nIndex, BallInfo)) - return ResourceObject - - -''' Class Implementation for ColorGroupIterator -''' -class ColorGroupIterator(ResourceIterator): - def __init__(self, handle, wrapper): - ResourceIterator.__init__(self, handle, wrapper) - def GetCurrentColorGroup(self): - ResourceHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_colorgroupiterator_getcurrentcolorgroup(self._handle, ResourceHandle)) - if ResourceHandle: - ResourceObject = self._wrapper._polymorphicFactory(ResourceHandle) - else: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + def SetBalls(self, BallInfo): + nBallInfoCount = ctypes.c_uint64(len(BallInfo)) + pBallInfoBuffer = (Ball*len(BallInfo))(*BallInfo) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_setballs(self._handle, nBallInfoCount, pBallInfoBuffer)) - return ResourceObject - - -''' Class Implementation for Texture2DGroupIterator -''' -class Texture2DGroupIterator(ResourceIterator): - def __init__(self, handle, wrapper): - ResourceIterator.__init__(self, handle, wrapper) - def GetCurrentTexture2DGroup(self): - ResourceHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup(self._handle, ResourceHandle)) - if ResourceHandle: - ResourceObject = self._wrapper._polymorphicFactory(ResourceHandle) - else: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + def GetBalls(self): + nBallInfoCount = ctypes.c_uint64(0) + nBallInfoNeededCount = ctypes.c_uint64(0) + pBallInfoBuffer = (Ball*0)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getballs(self._handle, nBallInfoCount, nBallInfoNeededCount, pBallInfoBuffer)) + nBallInfoCount = ctypes.c_uint64(nBallInfoNeededCount.value) + pBallInfoBuffer = (Ball * nBallInfoNeededCount.value)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getballs(self._handle, nBallInfoCount, nBallInfoNeededCount, pBallInfoBuffer)) - return ResourceObject + return [pBallInfoBuffer[i] for i in range(nBallInfoNeededCount.value)] - - -''' Class Implementation for CompositeMaterialsIterator -''' -class CompositeMaterialsIterator(ResourceIterator): - def __init__(self, handle, wrapper): - ResourceIterator.__init__(self, handle, wrapper) - def GetCurrentCompositeMaterials(self): - ResourceHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_compositematerialsiterator_getcurrentcompositematerials(self._handle, ResourceHandle)) - if ResourceHandle: - ResourceObject = self._wrapper._polymorphicFactory(ResourceHandle) + def GetBeamSetCount(self): + pCount = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getbeamsetcount(self._handle, pCount)) + + return pCount.value + + def AddBeamSet(self): + BeamSetHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_addbeamset(self._handle, BeamSetHandle)) + if BeamSetHandle: + BeamSetObject = self._wrapper._polymorphicFactory(BeamSetHandle) else: raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') - return ResourceObject + return BeamSetObject - - -''' Class Implementation for MultiPropertyGroupIterator -''' -class MultiPropertyGroupIterator(ResourceIterator): - def __init__(self, handle, wrapper): - ResourceIterator.__init__(self, handle, wrapper) - def GetCurrentMultiPropertyGroup(self): - ResourceHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup(self._handle, ResourceHandle)) - if ResourceHandle: - ResourceObject = self._wrapper._polymorphicFactory(ResourceHandle) + def GetBeamSet(self, Index): + nIndex = ctypes.c_uint32(Index) + BeamSetHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getbeamset(self._handle, nIndex, BeamSetHandle)) + if BeamSetHandle: + BeamSetObject = self._wrapper._polymorphicFactory(BeamSetHandle) else: raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') - return ResourceObject + return BeamSetObject -''' Class Implementation for MetaData +''' Class Implementation for Component ''' -class MetaData(Base): +class Component(Base): def __init__(self, handle, wrapper): Base.__init__(self, handle, wrapper) - def GetNameSpace(self): - nNameSpaceBufferSize = ctypes.c_uint64(0) - nNameSpaceNeededChars = ctypes.c_uint64(0) - pNameSpaceBuffer = ctypes.c_char_p(None) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_getnamespace(self._handle, nNameSpaceBufferSize, nNameSpaceNeededChars, pNameSpaceBuffer)) - nNameSpaceBufferSize = ctypes.c_uint64(nNameSpaceNeededChars.value) - pNameSpaceBuffer = (ctypes.c_char * (nNameSpaceNeededChars.value))() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_getnamespace(self._handle, nNameSpaceBufferSize, nNameSpaceNeededChars, pNameSpaceBuffer)) - - return pNameSpaceBuffer.value.decode() - - def SetNameSpace(self, NameSpace): - pNameSpace = ctypes.c_char_p(str.encode(NameSpace)) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_setnamespace(self._handle, pNameSpace)) - - - def GetName(self): - nNameBufferSize = ctypes.c_uint64(0) - nNameNeededChars = ctypes.c_uint64(0) - pNameBuffer = ctypes.c_char_p(None) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_getname(self._handle, nNameBufferSize, nNameNeededChars, pNameBuffer)) - nNameBufferSize = ctypes.c_uint64(nNameNeededChars.value) - pNameBuffer = (ctypes.c_char * (nNameNeededChars.value))() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_getname(self._handle, nNameBufferSize, nNameNeededChars, pNameBuffer)) - - return pNameBuffer.value.decode() - - def SetName(self, Name): - pName = ctypes.c_char_p(str.encode(Name)) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_setname(self._handle, pName)) - - - def GetKey(self): - nKeyBufferSize = ctypes.c_uint64(0) - nKeyNeededChars = ctypes.c_uint64(0) - pKeyBuffer = ctypes.c_char_p(None) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_getkey(self._handle, nKeyBufferSize, nKeyNeededChars, pKeyBuffer)) - nKeyBufferSize = ctypes.c_uint64(nKeyNeededChars.value) - pKeyBuffer = (ctypes.c_char * (nKeyNeededChars.value))() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_getkey(self._handle, nKeyBufferSize, nKeyNeededChars, pKeyBuffer)) + def GetObjectResource(self): + ObjectResourceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_component_getobjectresource(self._handle, ObjectResourceHandle)) + if ObjectResourceHandle: + ObjectResourceObject = self._wrapper._polymorphicFactory(ObjectResourceHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') - return pKeyBuffer.value.decode() + return ObjectResourceObject - def GetMustPreserve(self): - pMustPreserve = ctypes.c_bool() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_getmustpreserve(self._handle, pMustPreserve)) + def GetObjectResourceID(self): + pUniqueResourceID = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_component_getobjectresourceid(self._handle, pUniqueResourceID)) - return pMustPreserve.value + return pUniqueResourceID.value - def SetMustPreserve(self, MustPreserve): - bMustPreserve = ctypes.c_bool(MustPreserve) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_setmustpreserve(self._handle, bMustPreserve)) + def GetUUID(self): + pHasUUID = ctypes.c_bool() + nUUIDBufferSize = ctypes.c_uint64(0) + nUUIDNeededChars = ctypes.c_uint64(0) + pUUIDBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_component_getuuid(self._handle, pHasUUID, nUUIDBufferSize, nUUIDNeededChars, pUUIDBuffer)) + nUUIDBufferSize = ctypes.c_uint64(nUUIDNeededChars.value) + pUUIDBuffer = (ctypes.c_char * (nUUIDNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_component_getuuid(self._handle, pHasUUID, nUUIDBufferSize, nUUIDNeededChars, pUUIDBuffer)) + return pHasUUID.value, pUUIDBuffer.value.decode() - def GetType(self): - nTypeBufferSize = ctypes.c_uint64(0) - nTypeNeededChars = ctypes.c_uint64(0) - pTypeBuffer = ctypes.c_char_p(None) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_gettype(self._handle, nTypeBufferSize, nTypeNeededChars, pTypeBuffer)) - nTypeBufferSize = ctypes.c_uint64(nTypeNeededChars.value) - pTypeBuffer = (ctypes.c_char * (nTypeNeededChars.value))() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_gettype(self._handle, nTypeBufferSize, nTypeNeededChars, pTypeBuffer)) + def SetUUID(self, UUID): + pUUID = ctypes.c_char_p(str.encode(UUID)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_component_setuuid(self._handle, pUUID)) - return pTypeBuffer.value.decode() - def SetType(self, Type): - pType = ctypes.c_char_p(str.encode(Type)) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_settype(self._handle, pType)) + def HasTransform(self): + pHasTransform = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_component_hastransform(self._handle, pHasTransform)) + return pHasTransform.value - def GetValue(self): - nValueBufferSize = ctypes.c_uint64(0) - nValueNeededChars = ctypes.c_uint64(0) - pValueBuffer = ctypes.c_char_p(None) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_getvalue(self._handle, nValueBufferSize, nValueNeededChars, pValueBuffer)) - nValueBufferSize = ctypes.c_uint64(nValueNeededChars.value) - pValueBuffer = (ctypes.c_char * (nValueNeededChars.value))() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_getvalue(self._handle, nValueBufferSize, nValueNeededChars, pValueBuffer)) + def GetTransform(self): + pTransform = Transform() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_component_gettransform(self._handle, pTransform)) - return pValueBuffer.value.decode() + return pTransform - def SetValue(self, Value): - pValue = ctypes.c_char_p(str.encode(Value)) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadata_setvalue(self._handle, pValue)) + def SetTransform(self, Transform): + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_component_settransform(self._handle, Transform)) -''' Class Implementation for MetaDataGroup +''' Class Implementation for ComponentsObject ''' -class MetaDataGroup(Base): +class ComponentsObject(Object): def __init__(self, handle, wrapper): - Base.__init__(self, handle, wrapper) - def GetMetaDataCount(self): - pCount = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadatagroup_getmetadatacount(self._handle, pCount)) - - return pCount.value - - def GetMetaData(self, Index): - nIndex = ctypes.c_uint32(Index) - MetaDataHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadatagroup_getmetadata(self._handle, nIndex, MetaDataHandle)) - if MetaDataHandle: - MetaDataObject = self._wrapper._polymorphicFactory(MetaDataHandle) + Object.__init__(self, handle, wrapper) + def AddComponent(self, ObjectResourceObject, Transform): + ObjectResourceHandle = None + if ObjectResourceObject: + ObjectResourceHandle = ObjectResourceObject._handle else: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') - - return MetaDataObject - - def GetMetaDataByKey(self, NameSpace, Name): - pNameSpace = ctypes.c_char_p(str.encode(NameSpace)) - pName = ctypes.c_char_p(str.encode(Name)) - MetaDataHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadatagroup_getmetadatabykey(self._handle, pNameSpace, pName, MetaDataHandle)) - if MetaDataHandle: - MetaDataObject = self._wrapper._polymorphicFactory(MetaDataHandle) + raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') + ComponentInstanceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_componentsobject_addcomponent(self._handle, ObjectResourceHandle, Transform, ComponentInstanceHandle)) + if ComponentInstanceHandle: + ComponentInstanceObject = self._wrapper._polymorphicFactory(ComponentInstanceHandle) else: raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') - return MetaDataObject + return ComponentInstanceObject - def RemoveMetaDataByIndex(self, Index): + def GetComponent(self, Index): nIndex = ctypes.c_uint32(Index) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadatagroup_removemetadatabyindex(self._handle, nIndex)) - - - def RemoveMetaData(self, TheMetaDataObject): - TheMetaDataHandle = None - if TheMetaDataObject: - TheMetaDataHandle = TheMetaDataObject._handle + ComponentInstanceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_componentsobject_getcomponent(self._handle, nIndex, ComponentInstanceHandle)) + if ComponentInstanceHandle: + ComponentInstanceObject = self._wrapper._polymorphicFactory(ComponentInstanceHandle) else: - raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadatagroup_removemetadata(self._handle, TheMetaDataHandle)) + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + return ComponentInstanceObject - def AddMetaData(self, NameSpace, Name, Value, Type, MustPreserve): - pNameSpace = ctypes.c_char_p(str.encode(NameSpace)) - pName = ctypes.c_char_p(str.encode(Name)) - pValue = ctypes.c_char_p(str.encode(Value)) - pType = ctypes.c_char_p(str.encode(Type)) - bMustPreserve = ctypes.c_bool(MustPreserve) - MetaDataHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_metadatagroup_addmetadata(self._handle, pNameSpace, pName, pValue, pType, bMustPreserve, MetaDataHandle)) - if MetaDataHandle: - MetaDataObject = self._wrapper._polymorphicFactory(MetaDataHandle) - else: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + def GetComponentCount(self): + pCount = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_componentsobject_getcomponentcount(self._handle, pCount)) - return MetaDataObject + return pCount.value -''' Class Implementation for Object +''' Class Implementation for BeamSet ''' -class Object(Resource): +class BeamSet(Base): def __init__(self, handle, wrapper): - Resource.__init__(self, handle, wrapper) - def GetType(self): - pObjectType = ctypes.c_int32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_gettype(self._handle, pObjectType)) - - return ObjectType(pObjectType.value) - - def SetType(self, ObjectType): - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_settype(self._handle, ObjectType)) + Base.__init__(self, handle, wrapper) + def SetName(self, Name): + pName = ctypes.c_char_p(str.encode(Name)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_setname(self._handle, pName)) def GetName(self): nNameBufferSize = ctypes.c_uint64(0) nNameNeededChars = ctypes.c_uint64(0) pNameBuffer = ctypes.c_char_p(None) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_getname(self._handle, nNameBufferSize, nNameNeededChars, pNameBuffer)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_getname(self._handle, nNameBufferSize, nNameNeededChars, pNameBuffer)) nNameBufferSize = ctypes.c_uint64(nNameNeededChars.value) pNameBuffer = (ctypes.c_char * (nNameNeededChars.value))() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_getname(self._handle, nNameBufferSize, nNameNeededChars, pNameBuffer)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_getname(self._handle, nNameBufferSize, nNameNeededChars, pNameBuffer)) return pNameBuffer.value.decode() - def SetName(self, Name): - pName = ctypes.c_char_p(str.encode(Name)) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_setname(self._handle, pName)) + def SetIdentifier(self, Identifier): + pIdentifier = ctypes.c_char_p(str.encode(Identifier)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_setidentifier(self._handle, pIdentifier)) - def GetPartNumber(self): - nPartNumberBufferSize = ctypes.c_uint64(0) - nPartNumberNeededChars = ctypes.c_uint64(0) - pPartNumberBuffer = ctypes.c_char_p(None) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_getpartnumber(self._handle, nPartNumberBufferSize, nPartNumberNeededChars, pPartNumberBuffer)) - nPartNumberBufferSize = ctypes.c_uint64(nPartNumberNeededChars.value) - pPartNumberBuffer = (ctypes.c_char * (nPartNumberNeededChars.value))() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_getpartnumber(self._handle, nPartNumberBufferSize, nPartNumberNeededChars, pPartNumberBuffer)) + def GetIdentifier(self): + nIdentifierBufferSize = ctypes.c_uint64(0) + nIdentifierNeededChars = ctypes.c_uint64(0) + pIdentifierBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_getidentifier(self._handle, nIdentifierBufferSize, nIdentifierNeededChars, pIdentifierBuffer)) + nIdentifierBufferSize = ctypes.c_uint64(nIdentifierNeededChars.value) + pIdentifierBuffer = (ctypes.c_char * (nIdentifierNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_getidentifier(self._handle, nIdentifierBufferSize, nIdentifierNeededChars, pIdentifierBuffer)) - return pPartNumberBuffer.value.decode() + return pIdentifierBuffer.value.decode() - def SetPartNumber(self, PartNumber): - pPartNumber = ctypes.c_char_p(str.encode(PartNumber)) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_setpartnumber(self._handle, pPartNumber)) + def GetReferenceCount(self): + pCount = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_getreferencecount(self._handle, pCount)) + return pCount.value - def IsMeshObject(self): - pIsMeshObject = ctypes.c_bool() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_ismeshobject(self._handle, pIsMeshObject)) + def SetReferences(self, References): + nReferencesCount = ctypes.c_uint64(len(References)) + pReferencesBuffer = (ctypes.c_uint32*len(References))(*References) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_setreferences(self._handle, nReferencesCount, pReferencesBuffer)) - return pIsMeshObject.value - def IsComponentsObject(self): - pIsComponentsObject = ctypes.c_bool() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_iscomponentsobject(self._handle, pIsComponentsObject)) + def GetReferences(self): + nReferencesCount = ctypes.c_uint64(0) + nReferencesNeededCount = ctypes.c_uint64(0) + pReferencesBuffer = (ctypes.c_uint32*0)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_getreferences(self._handle, nReferencesCount, nReferencesNeededCount, pReferencesBuffer)) + nReferencesCount = ctypes.c_uint64(nReferencesNeededCount.value) + pReferencesBuffer = (ctypes.c_uint32 * nReferencesNeededCount.value)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_getreferences(self._handle, nReferencesCount, nReferencesNeededCount, pReferencesBuffer)) - return pIsComponentsObject.value + return [pReferencesBuffer[i] for i in range(nReferencesNeededCount.value)] - def IsValid(self): - pIsValid = ctypes.c_bool() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_isvalid(self._handle, pIsValid)) + def GetBallReferenceCount(self): + pCount = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_getballreferencecount(self._handle, pCount)) - return pIsValid.value + return pCount.value - def SetAttachmentAsThumbnail(self, AttachmentObject): - AttachmentHandle = None - if AttachmentObject: - AttachmentHandle = AttachmentObject._handle - else: - raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_setattachmentasthumbnail(self._handle, AttachmentHandle)) + def SetBallReferences(self, BallReferences): + nBallReferencesCount = ctypes.c_uint64(len(BallReferences)) + pBallReferencesBuffer = (ctypes.c_uint32*len(BallReferences))(*BallReferences) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_setballreferences(self._handle, nBallReferencesCount, pBallReferencesBuffer)) - def GetThumbnailAttachment(self): - AttachmentHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_getthumbnailattachment(self._handle, AttachmentHandle)) - if AttachmentHandle: - AttachmentObject = self._wrapper._polymorphicFactory(AttachmentHandle) - else: - AttachmentObject = None + def GetBallReferences(self): + nBallReferencesCount = ctypes.c_uint64(0) + nBallReferencesNeededCount = ctypes.c_uint64(0) + pBallReferencesBuffer = (ctypes.c_uint32*0)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_getballreferences(self._handle, nBallReferencesCount, nBallReferencesNeededCount, pBallReferencesBuffer)) + nBallReferencesCount = ctypes.c_uint64(nBallReferencesNeededCount.value) + pBallReferencesBuffer = (ctypes.c_uint32 * nBallReferencesNeededCount.value)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_getballreferences(self._handle, nBallReferencesCount, nBallReferencesNeededCount, pBallReferencesBuffer)) - return AttachmentObject + return [pBallReferencesBuffer[i] for i in range(nBallReferencesNeededCount.value)] - def ClearThumbnailAttachment(self): - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_clearthumbnailattachment(self._handle)) + + +''' Class Implementation for BaseMaterialGroup +''' +class BaseMaterialGroup(Resource): + def __init__(self, handle, wrapper): + Resource.__init__(self, handle, wrapper) + def GetCount(self): + pCount = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_basematerialgroup_getcount(self._handle, pCount)) + return pCount.value - def GetOutbox(self): - pOutbox = Box() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_getoutbox(self._handle, pOutbox)) + def GetAllPropertyIDs(self): + nPropertyIDsCount = ctypes.c_uint64(0) + nPropertyIDsNeededCount = ctypes.c_uint64(0) + pPropertyIDsBuffer = (ctypes.c_uint32*0)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_basematerialgroup_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) + nPropertyIDsCount = ctypes.c_uint64(nPropertyIDsNeededCount.value) + pPropertyIDsBuffer = (ctypes.c_uint32 * nPropertyIDsNeededCount.value)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_basematerialgroup_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) + + return [pPropertyIDsBuffer[i] for i in range(nPropertyIDsNeededCount.value)] + + def AddMaterial(self, Name, DisplayColor): + pName = ctypes.c_char_p(str.encode(Name)) + pPropertyID = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_basematerialgroup_addmaterial(self._handle, pName, DisplayColor, pPropertyID)) + + return pPropertyID.value + + def RemoveMaterial(self, PropertyID): + nPropertyID = ctypes.c_uint32(PropertyID) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_basematerialgroup_removematerial(self._handle, nPropertyID)) + + + def GetName(self, PropertyID): + nPropertyID = ctypes.c_uint32(PropertyID) + nNameBufferSize = ctypes.c_uint64(0) + nNameNeededChars = ctypes.c_uint64(0) + pNameBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_basematerialgroup_getname(self._handle, nPropertyID, nNameBufferSize, nNameNeededChars, pNameBuffer)) + nNameBufferSize = ctypes.c_uint64(nNameNeededChars.value) + pNameBuffer = (ctypes.c_char * (nNameNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_basematerialgroup_getname(self._handle, nPropertyID, nNameBufferSize, nNameNeededChars, pNameBuffer)) - return pOutbox + return pNameBuffer.value.decode() - def GetUUID(self): - pHasUUID = ctypes.c_bool() - nUUIDBufferSize = ctypes.c_uint64(0) - nUUIDNeededChars = ctypes.c_uint64(0) - pUUIDBuffer = ctypes.c_char_p(None) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_getuuid(self._handle, pHasUUID, nUUIDBufferSize, nUUIDNeededChars, pUUIDBuffer)) - nUUIDBufferSize = ctypes.c_uint64(nUUIDNeededChars.value) - pUUIDBuffer = (ctypes.c_char * (nUUIDNeededChars.value))() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_getuuid(self._handle, pHasUUID, nUUIDBufferSize, nUUIDNeededChars, pUUIDBuffer)) + def SetName(self, PropertyID, Name): + nPropertyID = ctypes.c_uint32(PropertyID) + pName = ctypes.c_char_p(str.encode(Name)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_basematerialgroup_setname(self._handle, nPropertyID, pName)) - return pHasUUID.value, pUUIDBuffer.value.decode() - def SetUUID(self, UUID): - pUUID = ctypes.c_char_p(str.encode(UUID)) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_setuuid(self._handle, pUUID)) + def SetDisplayColor(self, PropertyID, TheColor): + nPropertyID = ctypes.c_uint32(PropertyID) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_basematerialgroup_setdisplaycolor(self._handle, nPropertyID, TheColor)) - def GetMetaDataGroup(self): - MetaDataGroupHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_getmetadatagroup(self._handle, MetaDataGroupHandle)) - if MetaDataGroupHandle: - MetaDataGroupObject = self._wrapper._polymorphicFactory(MetaDataGroupHandle) - else: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + def GetDisplayColor(self, PropertyID): + nPropertyID = ctypes.c_uint32(PropertyID) + pTheColor = Color() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_basematerialgroup_getdisplaycolor(self._handle, nPropertyID, pTheColor)) - return MetaDataGroupObject + return pTheColor - def SetSlicesMeshResolution(self, MeshResolution): - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_setslicesmeshresolution(self._handle, MeshResolution)) + + +''' Class Implementation for ColorGroup +''' +class ColorGroup(Resource): + def __init__(self, handle, wrapper): + Resource.__init__(self, handle, wrapper) + def GetCount(self): + pCount = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_colorgroup_getcount(self._handle, pCount)) + return pCount.value - def GetSlicesMeshResolution(self): - pMeshResolution = ctypes.c_int32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_getslicesmeshresolution(self._handle, pMeshResolution)) + def GetAllPropertyIDs(self): + nPropertyIDsCount = ctypes.c_uint64(0) + nPropertyIDsNeededCount = ctypes.c_uint64(0) + pPropertyIDsBuffer = (ctypes.c_uint32*0)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_colorgroup_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) + nPropertyIDsCount = ctypes.c_uint64(nPropertyIDsNeededCount.value) + pPropertyIDsBuffer = (ctypes.c_uint32 * nPropertyIDsNeededCount.value)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_colorgroup_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) - return SlicesMeshResolution(pMeshResolution.value) + return [pPropertyIDsBuffer[i] for i in range(nPropertyIDsNeededCount.value)] - def HasSlices(self, Recursive): - bRecursive = ctypes.c_bool(Recursive) - pHasSlices = ctypes.c_bool() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_hasslices(self._handle, bRecursive, pHasSlices)) + def AddColor(self, TheColor): + pPropertyID = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_colorgroup_addcolor(self._handle, TheColor, pPropertyID)) - return pHasSlices.value + return pPropertyID.value - def ClearSliceStack(self): - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_clearslicestack(self._handle)) + def RemoveColor(self, PropertyID): + nPropertyID = ctypes.c_uint32(PropertyID) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_colorgroup_removecolor(self._handle, nPropertyID)) - def GetSliceStack(self): - SliceStackInstanceHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_getslicestack(self._handle, SliceStackInstanceHandle)) - if SliceStackInstanceHandle: - SliceStackInstanceObject = self._wrapper._polymorphicFactory(SliceStackInstanceHandle) - else: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + def SetColor(self, PropertyID, TheColor): + nPropertyID = ctypes.c_uint32(PropertyID) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_colorgroup_setcolor(self._handle, nPropertyID, TheColor)) - return SliceStackInstanceObject - def AssignSliceStack(self, SliceStackInstanceObject): - SliceStackInstanceHandle = None - if SliceStackInstanceObject: - SliceStackInstanceHandle = SliceStackInstanceObject._handle - else: - raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_object_assignslicestack(self._handle, SliceStackInstanceHandle)) + def GetColor(self, PropertyID): + nPropertyID = ctypes.c_uint32(PropertyID) + pTheColor = Color() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_colorgroup_getcolor(self._handle, nPropertyID, pTheColor)) + return pTheColor -''' Class Implementation for MeshObject +''' Class Implementation for Texture2DGroup ''' -class MeshObject(Object): +class Texture2DGroup(Resource): def __init__(self, handle, wrapper): - Object.__init__(self, handle, wrapper) - def GetVertexCount(self): - pVertexCount = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_getvertexcount(self._handle, pVertexCount)) + Resource.__init__(self, handle, wrapper) + def GetCount(self): + pCount = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2dgroup_getcount(self._handle, pCount)) - return pVertexCount.value + return pCount.value - def GetTriangleCount(self): - pVertexCount = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_gettrianglecount(self._handle, pVertexCount)) + def GetAllPropertyIDs(self): + nPropertyIDsCount = ctypes.c_uint64(0) + nPropertyIDsNeededCount = ctypes.c_uint64(0) + pPropertyIDsBuffer = (ctypes.c_uint32*0)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2dgroup_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) + nPropertyIDsCount = ctypes.c_uint64(nPropertyIDsNeededCount.value) + pPropertyIDsBuffer = (ctypes.c_uint32 * nPropertyIDsNeededCount.value)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2dgroup_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) - return pVertexCount.value + return [pPropertyIDsBuffer[i] for i in range(nPropertyIDsNeededCount.value)] - def GetVertex(self, Index): - nIndex = ctypes.c_uint32(Index) - pCoordinates = Position() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_getvertex(self._handle, nIndex, pCoordinates)) + def AddTex2Coord(self, UVCoordinate): + pPropertyID = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2dgroup_addtex2coord(self._handle, UVCoordinate, pPropertyID)) - return pCoordinates + return pPropertyID.value - def SetVertex(self, Index, Coordinates): - nIndex = ctypes.c_uint32(Index) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_setvertex(self._handle, nIndex, Coordinates)) + def GetTex2Coord(self, PropertyID): + nPropertyID = ctypes.c_uint32(PropertyID) + pUVCoordinate = Tex2Coord() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2dgroup_gettex2coord(self._handle, nPropertyID, pUVCoordinate)) + return pUVCoordinate - def AddVertex(self, Coordinates): - pNewIndex = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_addvertex(self._handle, Coordinates, pNewIndex)) + def RemoveTex2Coord(self, PropertyID): + nPropertyID = ctypes.c_uint32(PropertyID) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2dgroup_removetex2coord(self._handle, nPropertyID)) - return pNewIndex.value - def GetVertices(self): - nVerticesCount = ctypes.c_uint64(0) - nVerticesNeededCount = ctypes.c_uint64(0) - pVerticesBuffer = (Position*0)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_getvertices(self._handle, nVerticesCount, nVerticesNeededCount, pVerticesBuffer)) - nVerticesCount = ctypes.c_uint64(nVerticesNeededCount.value) - pVerticesBuffer = (Position * nVerticesNeededCount.value)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_getvertices(self._handle, nVerticesCount, nVerticesNeededCount, pVerticesBuffer)) + def GetTexture2D(self): + Texture2DInstanceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2dgroup_gettexture2d(self._handle, Texture2DInstanceHandle)) + if Texture2DInstanceHandle: + Texture2DInstanceObject = self._wrapper._polymorphicFactory(Texture2DInstanceHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') - return [pVerticesBuffer[i] for i in range(nVerticesNeededCount.value)] + return Texture2DInstanceObject - def GetTriangle(self, Index): - nIndex = ctypes.c_uint32(Index) - pIndices = Triangle() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_gettriangle(self._handle, nIndex, pIndices)) + + +''' Class Implementation for CompositeMaterials +''' +class CompositeMaterials(Resource): + def __init__(self, handle, wrapper): + Resource.__init__(self, handle, wrapper) + def GetCount(self): + pCount = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_compositematerials_getcount(self._handle, pCount)) - return pIndices + return pCount.value - def SetTriangle(self, Index, Indices): - nIndex = ctypes.c_uint32(Index) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_settriangle(self._handle, nIndex, Indices)) + def GetAllPropertyIDs(self): + nPropertyIDsCount = ctypes.c_uint64(0) + nPropertyIDsNeededCount = ctypes.c_uint64(0) + pPropertyIDsBuffer = (ctypes.c_uint32*0)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_compositematerials_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) + nPropertyIDsCount = ctypes.c_uint64(nPropertyIDsNeededCount.value) + pPropertyIDsBuffer = (ctypes.c_uint32 * nPropertyIDsNeededCount.value)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_compositematerials_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) + return [pPropertyIDsBuffer[i] for i in range(nPropertyIDsNeededCount.value)] - def AddTriangle(self, Indices): - pNewIndex = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_addtriangle(self._handle, Indices, pNewIndex)) + def GetBaseMaterialGroup(self): + BaseMaterialGroupInstanceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_compositematerials_getbasematerialgroup(self._handle, BaseMaterialGroupInstanceHandle)) + if BaseMaterialGroupInstanceHandle: + BaseMaterialGroupInstanceObject = self._wrapper._polymorphicFactory(BaseMaterialGroupInstanceHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') - return pNewIndex.value + return BaseMaterialGroupInstanceObject - def GetTriangleIndices(self): - nIndicesCount = ctypes.c_uint64(0) - nIndicesNeededCount = ctypes.c_uint64(0) - pIndicesBuffer = (Triangle*0)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_gettriangleindices(self._handle, nIndicesCount, nIndicesNeededCount, pIndicesBuffer)) - nIndicesCount = ctypes.c_uint64(nIndicesNeededCount.value) - pIndicesBuffer = (Triangle * nIndicesNeededCount.value)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_gettriangleindices(self._handle, nIndicesCount, nIndicesNeededCount, pIndicesBuffer)) + def AddComposite(self, Composite): + nCompositeCount = ctypes.c_uint64(len(Composite)) + pCompositeBuffer = (CompositeConstituent*len(Composite))(*Composite) + pPropertyID = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_compositematerials_addcomposite(self._handle, nCompositeCount, pCompositeBuffer, pPropertyID)) - return [pIndicesBuffer[i] for i in range(nIndicesNeededCount.value)] + return pPropertyID.value - def SetObjectLevelProperty(self, UniqueResourceID, PropertyID): - nUniqueResourceID = ctypes.c_uint32(UniqueResourceID) + def RemoveComposite(self, PropertyID): nPropertyID = ctypes.c_uint32(PropertyID) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_setobjectlevelproperty(self._handle, nUniqueResourceID, nPropertyID)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_compositematerials_removecomposite(self._handle, nPropertyID)) + + + def GetComposite(self, PropertyID): + nPropertyID = ctypes.c_uint32(PropertyID) + nCompositeCount = ctypes.c_uint64(0) + nCompositeNeededCount = ctypes.c_uint64(0) + pCompositeBuffer = (CompositeConstituent*0)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_compositematerials_getcomposite(self._handle, nPropertyID, nCompositeCount, nCompositeNeededCount, pCompositeBuffer)) + nCompositeCount = ctypes.c_uint64(nCompositeNeededCount.value) + pCompositeBuffer = (CompositeConstituent * nCompositeNeededCount.value)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_compositematerials_getcomposite(self._handle, nPropertyID, nCompositeCount, nCompositeNeededCount, pCompositeBuffer)) + + return [pCompositeBuffer[i] for i in range(nCompositeNeededCount.value)] + + + +''' Class Implementation for MultiPropertyGroup +''' +class MultiPropertyGroup(Resource): + def __init__(self, handle, wrapper): + Resource.__init__(self, handle, wrapper) + def GetCount(self): + pCount = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_getcount(self._handle, pCount)) + + return pCount.value + + def GetAllPropertyIDs(self): + nPropertyIDsCount = ctypes.c_uint64(0) + nPropertyIDsNeededCount = ctypes.c_uint64(0) + pPropertyIDsBuffer = (ctypes.c_uint32*0)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) + nPropertyIDsCount = ctypes.c_uint64(nPropertyIDsNeededCount.value) + pPropertyIDsBuffer = (ctypes.c_uint32 * nPropertyIDsNeededCount.value)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) + return [pPropertyIDsBuffer[i] for i in range(nPropertyIDsNeededCount.value)] - def GetObjectLevelProperty(self): - pUniqueResourceID = ctypes.c_uint32() + def AddMultiProperty(self, PropertyIDs): + nPropertyIDsCount = ctypes.c_uint64(len(PropertyIDs)) + pPropertyIDsBuffer = (ctypes.c_uint32*len(PropertyIDs))(*PropertyIDs) pPropertyID = ctypes.c_uint32() - pHasObjectLevelProperty = ctypes.c_bool() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_getobjectlevelproperty(self._handle, pUniqueResourceID, pPropertyID, pHasObjectLevelProperty)) - - return pUniqueResourceID.value, pPropertyID.value, pHasObjectLevelProperty.value - - def SetTriangleProperties(self, Index, Properties): - nIndex = ctypes.c_uint32(Index) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_settriangleproperties(self._handle, nIndex, Properties)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_addmultiproperty(self._handle, nPropertyIDsCount, pPropertyIDsBuffer, pPropertyID)) + return pPropertyID.value - def GetTriangleProperties(self, Index): - nIndex = ctypes.c_uint32(Index) - pProperty = TriangleProperties() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_gettriangleproperties(self._handle, nIndex, pProperty)) + def SetMultiProperty(self, PropertyID, PropertyIDs): + nPropertyID = ctypes.c_uint32(PropertyID) + nPropertyIDsCount = ctypes.c_uint64(len(PropertyIDs)) + pPropertyIDsBuffer = (ctypes.c_uint32*len(PropertyIDs))(*PropertyIDs) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_setmultiproperty(self._handle, nPropertyID, nPropertyIDsCount, pPropertyIDsBuffer)) - return pProperty - def SetAllTriangleProperties(self, PropertiesArray): - nPropertiesArrayCount = ctypes.c_uint64(len(PropertiesArray)) - pPropertiesArrayBuffer = (TriangleProperties*len(PropertiesArray))(*PropertiesArray) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_setalltriangleproperties(self._handle, nPropertiesArrayCount, pPropertiesArrayBuffer)) + def GetMultiProperty(self, PropertyID): + nPropertyID = ctypes.c_uint32(PropertyID) + nPropertyIDsCount = ctypes.c_uint64(0) + nPropertyIDsNeededCount = ctypes.c_uint64(0) + pPropertyIDsBuffer = (ctypes.c_uint32*0)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_getmultiproperty(self._handle, nPropertyID, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) + nPropertyIDsCount = ctypes.c_uint64(nPropertyIDsNeededCount.value) + pPropertyIDsBuffer = (ctypes.c_uint32 * nPropertyIDsNeededCount.value)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_getmultiproperty(self._handle, nPropertyID, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) + return [pPropertyIDsBuffer[i] for i in range(nPropertyIDsNeededCount.value)] - def GetAllTriangleProperties(self): - nPropertiesArrayCount = ctypes.c_uint64(0) - nPropertiesArrayNeededCount = ctypes.c_uint64(0) - pPropertiesArrayBuffer = (TriangleProperties*0)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_getalltriangleproperties(self._handle, nPropertiesArrayCount, nPropertiesArrayNeededCount, pPropertiesArrayBuffer)) - nPropertiesArrayCount = ctypes.c_uint64(nPropertiesArrayNeededCount.value) - pPropertiesArrayBuffer = (TriangleProperties * nPropertiesArrayNeededCount.value)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_getalltriangleproperties(self._handle, nPropertiesArrayCount, nPropertiesArrayNeededCount, pPropertiesArrayBuffer)) + def RemoveMultiProperty(self, PropertyID): + nPropertyID = ctypes.c_uint32(PropertyID) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_removemultiproperty(self._handle, nPropertyID)) - return [pPropertiesArrayBuffer[i] for i in range(nPropertiesArrayNeededCount.value)] - def ClearAllProperties(self): - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_clearallproperties(self._handle)) + def GetLayerCount(self): + pCount = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_getlayercount(self._handle, pCount)) + return pCount.value - def SetGeometry(self, Vertices, Indices): - nVerticesCount = ctypes.c_uint64(len(Vertices)) - pVerticesBuffer = (Position*len(Vertices))(*Vertices) - nIndicesCount = ctypes.c_uint64(len(Indices)) - pIndicesBuffer = (Triangle*len(Indices))(*Indices) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_setgeometry(self._handle, nVerticesCount, pVerticesBuffer, nIndicesCount, pIndicesBuffer)) + def AddLayer(self, TheLayer): + pLayerIndex = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_addlayer(self._handle, TheLayer, pLayerIndex)) + return pLayerIndex.value - def IsManifoldAndOriented(self): - pIsManifoldAndOriented = ctypes.c_bool() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_ismanifoldandoriented(self._handle, pIsManifoldAndOriented)) + def GetLayer(self, LayerIndex): + nLayerIndex = ctypes.c_uint32(LayerIndex) + pTheLayer = MultiPropertyLayer() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_getlayer(self._handle, nLayerIndex, pTheLayer)) - return pIsManifoldAndOriented.value + return pTheLayer - def BeamLattice(self): - TheBeamLatticeHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_meshobject_beamlattice(self._handle, TheBeamLatticeHandle)) - if TheBeamLatticeHandle: - TheBeamLatticeObject = self._wrapper._polymorphicFactory(TheBeamLatticeHandle) - else: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + def RemoveLayer(self, LayerIndex): + nLayerIndex = ctypes.c_uint32(LayerIndex) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_removelayer(self._handle, nLayerIndex)) - return TheBeamLatticeObject -''' Class Implementation for BeamLattice +''' Class Implementation for Attachment ''' -class BeamLattice(Base): +class Attachment(Base): def __init__(self, handle, wrapper): Base.__init__(self, handle, wrapper) - def GetMinLength(self): - pMinLength = ctypes.c_double() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getminlength(self._handle, pMinLength)) - - return pMinLength.value - - def SetMinLength(self, MinLength): - dMinLength = ctypes.c_double(MinLength) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_setminlength(self._handle, dMinLength)) - - - def GetClipping(self): - pClipMode = ctypes.c_int32() - pUniqueResourceID = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getclipping(self._handle, pClipMode, pUniqueResourceID)) - - return BeamLatticeClipMode(pClipMode.value), pUniqueResourceID.value - - def SetClipping(self, ClipMode, UniqueResourceID): - nUniqueResourceID = ctypes.c_uint32(UniqueResourceID) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_setclipping(self._handle, ClipMode, nUniqueResourceID)) - - - def GetRepresentation(self): - pHasRepresentation = ctypes.c_bool() - pUniqueResourceID = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getrepresentation(self._handle, pHasRepresentation, pUniqueResourceID)) + def GetPath(self): + nPathBufferSize = ctypes.c_uint64(0) + nPathNeededChars = ctypes.c_uint64(0) + pPathBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_getpath(self._handle, nPathBufferSize, nPathNeededChars, pPathBuffer)) + nPathBufferSize = ctypes.c_uint64(nPathNeededChars.value) + pPathBuffer = (ctypes.c_char * (nPathNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_getpath(self._handle, nPathBufferSize, nPathNeededChars, pPathBuffer)) - return pHasRepresentation.value, pUniqueResourceID.value + return pPathBuffer.value.decode() - def SetRepresentation(self, UniqueResourceID): - nUniqueResourceID = ctypes.c_uint32(UniqueResourceID) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_setrepresentation(self._handle, nUniqueResourceID)) + def SetPath(self, Path): + pPath = ctypes.c_char_p(str.encode(Path)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_setpath(self._handle, pPath)) - def GetBallOptions(self): - pBallMode = ctypes.c_int32() - pBallRadius = ctypes.c_double() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getballoptions(self._handle, pBallMode, pBallRadius)) + def PackagePart(self): + PackagePartHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_packagepart(self._handle, PackagePartHandle)) + if PackagePartHandle: + PackagePartObject = self._wrapper._polymorphicFactory(PackagePartHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') - return BeamLatticeBallMode(pBallMode.value), pBallRadius.value + return PackagePartObject - def SetBallOptions(self, BallMode, BallRadius): - dBallRadius = ctypes.c_double(BallRadius) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_setballoptions(self._handle, BallMode, dBallRadius)) + def GetRelationShipType(self): + nPathBufferSize = ctypes.c_uint64(0) + nPathNeededChars = ctypes.c_uint64(0) + pPathBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_getrelationshiptype(self._handle, nPathBufferSize, nPathNeededChars, pPathBuffer)) + nPathBufferSize = ctypes.c_uint64(nPathNeededChars.value) + pPathBuffer = (ctypes.c_char * (nPathNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_getrelationshiptype(self._handle, nPathBufferSize, nPathNeededChars, pPathBuffer)) + return pPathBuffer.value.decode() - def GetBeamCount(self): - pCount = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getbeamcount(self._handle, pCount)) + def SetRelationShipType(self, Path): + pPath = ctypes.c_char_p(str.encode(Path)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_setrelationshiptype(self._handle, pPath)) - return pCount.value - def GetBeam(self, Index): - nIndex = ctypes.c_uint32(Index) - pBeamInfo = Beam() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getbeam(self._handle, nIndex, pBeamInfo)) + def WriteToFile(self, FileName): + pFileName = ctypes.c_char_p(str.encode(FileName)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_writetofile(self._handle, pFileName)) - return pBeamInfo - def AddBeam(self, BeamInfo): - pIndex = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_addbeam(self._handle, BeamInfo, pIndex)) + def ReadFromFile(self, FileName): + pFileName = ctypes.c_char_p(str.encode(FileName)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_readfromfile(self._handle, pFileName)) - return pIndex.value - def SetBeam(self, Index, BeamInfo): - nIndex = ctypes.c_uint32(Index) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_setbeam(self._handle, nIndex, BeamInfo)) + def ReadFromCallback(self, TheReadCallbackFunc, StreamSize, TheSeekCallbackFunc, UserData): + nStreamSize = ctypes.c_uint64(StreamSize) + pUserData = ctypes.c_void_p(UserData) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_readfromcallback(self._handle, TheReadCallbackFunc, nStreamSize, TheSeekCallbackFunc, pUserData)) - def SetBeams(self, BeamInfo): - nBeamInfoCount = ctypes.c_uint64(len(BeamInfo)) - pBeamInfoBuffer = (Beam*len(BeamInfo))(*BeamInfo) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_setbeams(self._handle, nBeamInfoCount, pBeamInfoBuffer)) + def GetStreamSize(self): + pStreamSize = ctypes.c_uint64() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_getstreamsize(self._handle, pStreamSize)) + return pStreamSize.value - def GetBeams(self): - nBeamInfoCount = ctypes.c_uint64(0) - nBeamInfoNeededCount = ctypes.c_uint64(0) - pBeamInfoBuffer = (Beam*0)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getbeams(self._handle, nBeamInfoCount, nBeamInfoNeededCount, pBeamInfoBuffer)) - nBeamInfoCount = ctypes.c_uint64(nBeamInfoNeededCount.value) - pBeamInfoBuffer = (Beam * nBeamInfoNeededCount.value)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getbeams(self._handle, nBeamInfoCount, nBeamInfoNeededCount, pBeamInfoBuffer)) + def WriteToBuffer(self): + nBufferCount = ctypes.c_uint64(0) + nBufferNeededCount = ctypes.c_uint64(0) + pBufferBuffer = (ctypes.c_uint8*0)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_writetobuffer(self._handle, nBufferCount, nBufferNeededCount, pBufferBuffer)) + nBufferCount = ctypes.c_uint64(nBufferNeededCount.value) + pBufferBuffer = (ctypes.c_uint8 * nBufferNeededCount.value)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_writetobuffer(self._handle, nBufferCount, nBufferNeededCount, pBufferBuffer)) - return [pBeamInfoBuffer[i] for i in range(nBeamInfoNeededCount.value)] + return [pBufferBuffer[i] for i in range(nBufferNeededCount.value)] - def GetBallCount(self): - pCount = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getballcount(self._handle, pCount)) + def ReadFromBuffer(self, Buffer): + nBufferCount = ctypes.c_uint64(len(Buffer)) + pBufferBuffer = (ctypes.c_uint8*len(Buffer))(*Buffer) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_readfrombuffer(self._handle, nBufferCount, pBufferBuffer)) - return pCount.value - def GetBall(self, Index): - nIndex = ctypes.c_uint32(Index) - pBallInfo = Ball() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getball(self._handle, nIndex, pBallInfo)) + + +''' Class Implementation for Texture2D +''' +class Texture2D(Resource): + def __init__(self, handle, wrapper): + Resource.__init__(self, handle, wrapper) + def GetAttachment(self): + AttachmentHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2d_getattachment(self._handle, AttachmentHandle)) + if AttachmentHandle: + AttachmentObject = self._wrapper._polymorphicFactory(AttachmentHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') - return pBallInfo + return AttachmentObject - def AddBall(self, BallInfo): - pIndex = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_addball(self._handle, BallInfo, pIndex)) + def SetAttachment(self, AttachmentObject): + AttachmentHandle = None + if AttachmentObject: + AttachmentHandle = AttachmentObject._handle + else: + raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2d_setattachment(self._handle, AttachmentHandle)) - return pIndex.value - def SetBall(self, Index, BallInfo): - nIndex = ctypes.c_uint32(Index) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_setball(self._handle, nIndex, BallInfo)) + def GetContentType(self): + pContentType = ctypes.c_int32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2d_getcontenttype(self._handle, pContentType)) + return TextureType(pContentType.value) - def SetBalls(self, BallInfo): - nBallInfoCount = ctypes.c_uint64(len(BallInfo)) - pBallInfoBuffer = (Ball*len(BallInfo))(*BallInfo) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_setballs(self._handle, nBallInfoCount, pBallInfoBuffer)) + def SetContentType(self, ContentType): + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2d_setcontenttype(self._handle, ContentType)) - def GetBalls(self): - nBallInfoCount = ctypes.c_uint64(0) - nBallInfoNeededCount = ctypes.c_uint64(0) - pBallInfoBuffer = (Ball*0)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getballs(self._handle, nBallInfoCount, nBallInfoNeededCount, pBallInfoBuffer)) - nBallInfoCount = ctypes.c_uint64(nBallInfoNeededCount.value) - pBallInfoBuffer = (Ball * nBallInfoNeededCount.value)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getballs(self._handle, nBallInfoCount, nBallInfoNeededCount, pBallInfoBuffer)) + def GetTileStyleUV(self): + pTileStyleU = ctypes.c_int32() + pTileStyleV = ctypes.c_int32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2d_gettilestyleuv(self._handle, pTileStyleU, pTileStyleV)) - return [pBallInfoBuffer[i] for i in range(nBallInfoNeededCount.value)] + return TextureTileStyle(pTileStyleU.value), TextureTileStyle(pTileStyleV.value) - def GetBeamSetCount(self): - pCount = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getbeamsetcount(self._handle, pCount)) + def SetTileStyleUV(self, TileStyleU, TileStyleV): + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2d_settilestyleuv(self._handle, TileStyleU, TileStyleV)) - return pCount.value - def AddBeamSet(self): - BeamSetHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_addbeamset(self._handle, BeamSetHandle)) - if BeamSetHandle: - BeamSetObject = self._wrapper._polymorphicFactory(BeamSetHandle) - else: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + def GetFilter(self): + pFilter = ctypes.c_int32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2d_getfilter(self._handle, pFilter)) - return BeamSetObject + return TextureFilter(pFilter.value) - def GetBeamSet(self, Index): - nIndex = ctypes.c_uint32(Index) - BeamSetHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamlattice_getbeamset(self._handle, nIndex, BeamSetHandle)) - if BeamSetHandle: - BeamSetObject = self._wrapper._polymorphicFactory(BeamSetHandle) - else: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + def SetFilter(self, Filter): + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2d_setfilter(self._handle, Filter)) - return BeamSetObject -''' Class Implementation for Component +''' Class Implementation for BuildItem ''' -class Component(Base): +class BuildItem(Base): def __init__(self, handle, wrapper): Base.__init__(self, handle, wrapper) def GetObjectResource(self): ObjectResourceHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_component_getobjectresource(self._handle, ObjectResourceHandle)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_getobjectresource(self._handle, ObjectResourceHandle)) if ObjectResourceHandle: ObjectResourceObject = self._wrapper._polymorphicFactory(ObjectResourceHandle) else: @@ -5433,826 +7999,903 @@ def GetObjectResource(self): return ObjectResourceObject - def GetObjectResourceID(self): - pUniqueResourceID = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_component_getobjectresourceid(self._handle, pUniqueResourceID)) - - return pUniqueResourceID.value - def GetUUID(self): pHasUUID = ctypes.c_bool() nUUIDBufferSize = ctypes.c_uint64(0) nUUIDNeededChars = ctypes.c_uint64(0) pUUIDBuffer = ctypes.c_char_p(None) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_component_getuuid(self._handle, pHasUUID, nUUIDBufferSize, nUUIDNeededChars, pUUIDBuffer)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_getuuid(self._handle, pHasUUID, nUUIDBufferSize, nUUIDNeededChars, pUUIDBuffer)) nUUIDBufferSize = ctypes.c_uint64(nUUIDNeededChars.value) pUUIDBuffer = (ctypes.c_char * (nUUIDNeededChars.value))() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_component_getuuid(self._handle, pHasUUID, nUUIDBufferSize, nUUIDNeededChars, pUUIDBuffer)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_getuuid(self._handle, pHasUUID, nUUIDBufferSize, nUUIDNeededChars, pUUIDBuffer)) return pHasUUID.value, pUUIDBuffer.value.decode() def SetUUID(self, UUID): pUUID = ctypes.c_char_p(str.encode(UUID)) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_component_setuuid(self._handle, pUUID)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_setuuid(self._handle, pUUID)) - def HasTransform(self): + def GetObjectResourceID(self): + pUniqueResourceID = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_getobjectresourceid(self._handle, pUniqueResourceID)) + + return pUniqueResourceID.value + + def HasObjectTransform(self): pHasTransform = ctypes.c_bool() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_component_hastransform(self._handle, pHasTransform)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_hasobjecttransform(self._handle, pHasTransform)) return pHasTransform.value - def GetTransform(self): + def GetObjectTransform(self): pTransform = Transform() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_component_gettransform(self._handle, pTransform)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_getobjecttransform(self._handle, pTransform)) return pTransform - def SetTransform(self, Transform): - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_component_settransform(self._handle, Transform)) - - - - -''' Class Implementation for ComponentsObject -''' -class ComponentsObject(Object): - def __init__(self, handle, wrapper): - Object.__init__(self, handle, wrapper) - def AddComponent(self, ObjectResourceObject, Transform): - ObjectResourceHandle = None - if ObjectResourceObject: - ObjectResourceHandle = ObjectResourceObject._handle - else: - raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') - ComponentInstanceHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_componentsobject_addcomponent(self._handle, ObjectResourceHandle, Transform, ComponentInstanceHandle)) - if ComponentInstanceHandle: - ComponentInstanceObject = self._wrapper._polymorphicFactory(ComponentInstanceHandle) - else: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') - - return ComponentInstanceObject - - def GetComponent(self, Index): - nIndex = ctypes.c_uint32(Index) - ComponentInstanceHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_componentsobject_getcomponent(self._handle, nIndex, ComponentInstanceHandle)) - if ComponentInstanceHandle: - ComponentInstanceObject = self._wrapper._polymorphicFactory(ComponentInstanceHandle) - else: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') - - return ComponentInstanceObject - - def GetComponentCount(self): - pCount = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_componentsobject_getcomponentcount(self._handle, pCount)) - - return pCount.value - - - -''' Class Implementation for BeamSet -''' -class BeamSet(Base): - def __init__(self, handle, wrapper): - Base.__init__(self, handle, wrapper) - def SetName(self, Name): - pName = ctypes.c_char_p(str.encode(Name)) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_setname(self._handle, pName)) - - - def GetName(self): - nNameBufferSize = ctypes.c_uint64(0) - nNameNeededChars = ctypes.c_uint64(0) - pNameBuffer = ctypes.c_char_p(None) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_getname(self._handle, nNameBufferSize, nNameNeededChars, pNameBuffer)) - nNameBufferSize = ctypes.c_uint64(nNameNeededChars.value) - pNameBuffer = (ctypes.c_char * (nNameNeededChars.value))() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_getname(self._handle, nNameBufferSize, nNameNeededChars, pNameBuffer)) - - return pNameBuffer.value.decode() - - def SetIdentifier(self, Identifier): - pIdentifier = ctypes.c_char_p(str.encode(Identifier)) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_setidentifier(self._handle, pIdentifier)) - - - def GetIdentifier(self): - nIdentifierBufferSize = ctypes.c_uint64(0) - nIdentifierNeededChars = ctypes.c_uint64(0) - pIdentifierBuffer = ctypes.c_char_p(None) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_getidentifier(self._handle, nIdentifierBufferSize, nIdentifierNeededChars, pIdentifierBuffer)) - nIdentifierBufferSize = ctypes.c_uint64(nIdentifierNeededChars.value) - pIdentifierBuffer = (ctypes.c_char * (nIdentifierNeededChars.value))() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_getidentifier(self._handle, nIdentifierBufferSize, nIdentifierNeededChars, pIdentifierBuffer)) - - return pIdentifierBuffer.value.decode() - - def GetReferenceCount(self): - pCount = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_getreferencecount(self._handle, pCount)) - - return pCount.value - - def SetReferences(self, References): - nReferencesCount = ctypes.c_uint64(len(References)) - pReferencesBuffer = (ctypes.c_uint32*len(References))(*References) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_setreferences(self._handle, nReferencesCount, pReferencesBuffer)) - - - def GetReferences(self): - nReferencesCount = ctypes.c_uint64(0) - nReferencesNeededCount = ctypes.c_uint64(0) - pReferencesBuffer = (ctypes.c_uint32*0)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_getreferences(self._handle, nReferencesCount, nReferencesNeededCount, pReferencesBuffer)) - nReferencesCount = ctypes.c_uint64(nReferencesNeededCount.value) - pReferencesBuffer = (ctypes.c_uint32 * nReferencesNeededCount.value)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_getreferences(self._handle, nReferencesCount, nReferencesNeededCount, pReferencesBuffer)) - - return [pReferencesBuffer[i] for i in range(nReferencesNeededCount.value)] - - def GetBallReferenceCount(self): - pCount = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_getballreferencecount(self._handle, pCount)) - - return pCount.value - - def SetBallReferences(self, BallReferences): - nBallReferencesCount = ctypes.c_uint64(len(BallReferences)) - pBallReferencesBuffer = (ctypes.c_uint32*len(BallReferences))(*BallReferences) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_setballreferences(self._handle, nBallReferencesCount, pBallReferencesBuffer)) - - - def GetBallReferences(self): - nBallReferencesCount = ctypes.c_uint64(0) - nBallReferencesNeededCount = ctypes.c_uint64(0) - pBallReferencesBuffer = (ctypes.c_uint32*0)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_getballreferences(self._handle, nBallReferencesCount, nBallReferencesNeededCount, pBallReferencesBuffer)) - nBallReferencesCount = ctypes.c_uint64(nBallReferencesNeededCount.value) - pBallReferencesBuffer = (ctypes.c_uint32 * nBallReferencesNeededCount.value)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_beamset_getballreferences(self._handle, nBallReferencesCount, nBallReferencesNeededCount, pBallReferencesBuffer)) - - return [pBallReferencesBuffer[i] for i in range(nBallReferencesNeededCount.value)] - - - -''' Class Implementation for BaseMaterialGroup -''' -class BaseMaterialGroup(Resource): - def __init__(self, handle, wrapper): - Resource.__init__(self, handle, wrapper) - def GetCount(self): - pCount = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_basematerialgroup_getcount(self._handle, pCount)) - - return pCount.value - - def GetAllPropertyIDs(self): - nPropertyIDsCount = ctypes.c_uint64(0) - nPropertyIDsNeededCount = ctypes.c_uint64(0) - pPropertyIDsBuffer = (ctypes.c_uint32*0)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_basematerialgroup_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) - nPropertyIDsCount = ctypes.c_uint64(nPropertyIDsNeededCount.value) - pPropertyIDsBuffer = (ctypes.c_uint32 * nPropertyIDsNeededCount.value)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_basematerialgroup_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) - - return [pPropertyIDsBuffer[i] for i in range(nPropertyIDsNeededCount.value)] - - def AddMaterial(self, Name, DisplayColor): - pName = ctypes.c_char_p(str.encode(Name)) - pPropertyID = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_basematerialgroup_addmaterial(self._handle, pName, DisplayColor, pPropertyID)) - - return pPropertyID.value - - def RemoveMaterial(self, PropertyID): - nPropertyID = ctypes.c_uint32(PropertyID) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_basematerialgroup_removematerial(self._handle, nPropertyID)) + def SetObjectTransform(self, Transform): + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_setobjecttransform(self._handle, Transform)) - def GetName(self, PropertyID): - nPropertyID = ctypes.c_uint32(PropertyID) - nNameBufferSize = ctypes.c_uint64(0) - nNameNeededChars = ctypes.c_uint64(0) - pNameBuffer = ctypes.c_char_p(None) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_basematerialgroup_getname(self._handle, nPropertyID, nNameBufferSize, nNameNeededChars, pNameBuffer)) - nNameBufferSize = ctypes.c_uint64(nNameNeededChars.value) - pNameBuffer = (ctypes.c_char * (nNameNeededChars.value))() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_basematerialgroup_getname(self._handle, nPropertyID, nNameBufferSize, nNameNeededChars, pNameBuffer)) + def GetPartNumber(self): + nPartNumberBufferSize = ctypes.c_uint64(0) + nPartNumberNeededChars = ctypes.c_uint64(0) + pPartNumberBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_getpartnumber(self._handle, nPartNumberBufferSize, nPartNumberNeededChars, pPartNumberBuffer)) + nPartNumberBufferSize = ctypes.c_uint64(nPartNumberNeededChars.value) + pPartNumberBuffer = (ctypes.c_char * (nPartNumberNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_getpartnumber(self._handle, nPartNumberBufferSize, nPartNumberNeededChars, pPartNumberBuffer)) - return pNameBuffer.value.decode() + return pPartNumberBuffer.value.decode() - def SetName(self, PropertyID, Name): - nPropertyID = ctypes.c_uint32(PropertyID) - pName = ctypes.c_char_p(str.encode(Name)) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_basematerialgroup_setname(self._handle, nPropertyID, pName)) + def SetPartNumber(self, SetPartnumber): + pSetPartnumber = ctypes.c_char_p(str.encode(SetPartnumber)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_setpartnumber(self._handle, pSetPartnumber)) - def SetDisplayColor(self, PropertyID, TheColor): - nPropertyID = ctypes.c_uint32(PropertyID) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_basematerialgroup_setdisplaycolor(self._handle, nPropertyID, TheColor)) + def GetMetaDataGroup(self): + MetaDataGroupHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_getmetadatagroup(self._handle, MetaDataGroupHandle)) + if MetaDataGroupHandle: + MetaDataGroupObject = self._wrapper._polymorphicFactory(MetaDataGroupHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + return MetaDataGroupObject - def GetDisplayColor(self, PropertyID): - nPropertyID = ctypes.c_uint32(PropertyID) - pTheColor = Color() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_basematerialgroup_getdisplaycolor(self._handle, nPropertyID, pTheColor)) + def GetOutbox(self): + pOutbox = Box() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_getoutbox(self._handle, pOutbox)) - return pTheColor + return pOutbox -''' Class Implementation for ColorGroup +''' Class Implementation for BuildItemIterator ''' -class ColorGroup(Resource): +class BuildItemIterator(Base): def __init__(self, handle, wrapper): - Resource.__init__(self, handle, wrapper) - def GetCount(self): - pCount = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_colorgroup_getcount(self._handle, pCount)) - - return pCount.value - - def GetAllPropertyIDs(self): - nPropertyIDsCount = ctypes.c_uint64(0) - nPropertyIDsNeededCount = ctypes.c_uint64(0) - pPropertyIDsBuffer = (ctypes.c_uint32*0)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_colorgroup_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) - nPropertyIDsCount = ctypes.c_uint64(nPropertyIDsNeededCount.value) - pPropertyIDsBuffer = (ctypes.c_uint32 * nPropertyIDsNeededCount.value)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_colorgroup_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) + Base.__init__(self, handle, wrapper) + def MoveNext(self): + pHasNext = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditemiterator_movenext(self._handle, pHasNext)) - return [pPropertyIDsBuffer[i] for i in range(nPropertyIDsNeededCount.value)] + return pHasNext.value - def AddColor(self, TheColor): - pPropertyID = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_colorgroup_addcolor(self._handle, TheColor, pPropertyID)) + def MovePrevious(self): + pHasPrevious = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditemiterator_moveprevious(self._handle, pHasPrevious)) - return pPropertyID.value + return pHasPrevious.value - def RemoveColor(self, PropertyID): - nPropertyID = ctypes.c_uint32(PropertyID) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_colorgroup_removecolor(self._handle, nPropertyID)) + def GetCurrent(self): + BuildItemHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditemiterator_getcurrent(self._handle, BuildItemHandle)) + if BuildItemHandle: + BuildItemObject = self._wrapper._polymorphicFactory(BuildItemHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + return BuildItemObject - def SetColor(self, PropertyID, TheColor): - nPropertyID = ctypes.c_uint32(PropertyID) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_colorgroup_setcolor(self._handle, nPropertyID, TheColor)) + def Clone(self): + OutBuildItemIteratorHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditemiterator_clone(self._handle, OutBuildItemIteratorHandle)) + if OutBuildItemIteratorHandle: + OutBuildItemIteratorObject = self._wrapper._polymorphicFactory(OutBuildItemIteratorHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + return OutBuildItemIteratorObject - def GetColor(self, PropertyID): - nPropertyID = ctypes.c_uint32(PropertyID) - pTheColor = Color() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_colorgroup_getcolor(self._handle, nPropertyID, pTheColor)) + def Count(self): + pCount = ctypes.c_uint64() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditemiterator_count(self._handle, pCount)) - return pTheColor + return pCount.value -''' Class Implementation for Texture2DGroup +''' Class Implementation for Slice ''' -class Texture2DGroup(Resource): +class Slice(Base): def __init__(self, handle, wrapper): - Resource.__init__(self, handle, wrapper) - def GetCount(self): - pCount = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2dgroup_getcount(self._handle, pCount)) + Base.__init__(self, handle, wrapper) + def SetVertices(self, Vertices): + nVerticesCount = ctypes.c_uint64(len(Vertices)) + pVerticesBuffer = (Position2D*len(Vertices))(*Vertices) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_setvertices(self._handle, nVerticesCount, pVerticesBuffer)) + + + def GetVertices(self): + nVerticesCount = ctypes.c_uint64(0) + nVerticesNeededCount = ctypes.c_uint64(0) + pVerticesBuffer = (Position2D*0)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_getvertices(self._handle, nVerticesCount, nVerticesNeededCount, pVerticesBuffer)) + nVerticesCount = ctypes.c_uint64(nVerticesNeededCount.value) + pVerticesBuffer = (Position2D * nVerticesNeededCount.value)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_getvertices(self._handle, nVerticesCount, nVerticesNeededCount, pVerticesBuffer)) + + return [pVerticesBuffer[i] for i in range(nVerticesNeededCount.value)] + + def GetVertexCount(self): + pCount = ctypes.c_uint64() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_getvertexcount(self._handle, pCount)) return pCount.value - def GetAllPropertyIDs(self): - nPropertyIDsCount = ctypes.c_uint64(0) - nPropertyIDsNeededCount = ctypes.c_uint64(0) - pPropertyIDsBuffer = (ctypes.c_uint32*0)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2dgroup_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) - nPropertyIDsCount = ctypes.c_uint64(nPropertyIDsNeededCount.value) - pPropertyIDsBuffer = (ctypes.c_uint32 * nPropertyIDsNeededCount.value)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2dgroup_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) + def AddPolygon(self, Indices): + nIndicesCount = ctypes.c_uint64(len(Indices)) + pIndicesBuffer = (ctypes.c_uint32*len(Indices))(*Indices) + pIndex = ctypes.c_uint64() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_addpolygon(self._handle, nIndicesCount, pIndicesBuffer, pIndex)) - return [pPropertyIDsBuffer[i] for i in range(nPropertyIDsNeededCount.value)] + return pIndex.value - def AddTex2Coord(self, UVCoordinate): - pPropertyID = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2dgroup_addtex2coord(self._handle, UVCoordinate, pPropertyID)) + def GetPolygonCount(self): + pCount = ctypes.c_uint64() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_getpolygoncount(self._handle, pCount)) - return pPropertyID.value + return pCount.value - def GetTex2Coord(self, PropertyID): - nPropertyID = ctypes.c_uint32(PropertyID) - pUVCoordinate = Tex2Coord() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2dgroup_gettex2coord(self._handle, nPropertyID, pUVCoordinate)) + def SetPolygonIndices(self, Index, Indices): + nIndex = ctypes.c_uint64(Index) + nIndicesCount = ctypes.c_uint64(len(Indices)) + pIndicesBuffer = (ctypes.c_uint32*len(Indices))(*Indices) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_setpolygonindices(self._handle, nIndex, nIndicesCount, pIndicesBuffer)) - return pUVCoordinate - def RemoveTex2Coord(self, PropertyID): - nPropertyID = ctypes.c_uint32(PropertyID) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2dgroup_removetex2coord(self._handle, nPropertyID)) + def GetPolygonIndices(self, Index): + nIndex = ctypes.c_uint64(Index) + nIndicesCount = ctypes.c_uint64(0) + nIndicesNeededCount = ctypes.c_uint64(0) + pIndicesBuffer = (ctypes.c_uint32*0)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_getpolygonindices(self._handle, nIndex, nIndicesCount, nIndicesNeededCount, pIndicesBuffer)) + nIndicesCount = ctypes.c_uint64(nIndicesNeededCount.value) + pIndicesBuffer = (ctypes.c_uint32 * nIndicesNeededCount.value)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_getpolygonindices(self._handle, nIndex, nIndicesCount, nIndicesNeededCount, pIndicesBuffer)) + return [pIndicesBuffer[i] for i in range(nIndicesNeededCount.value)] - def GetTexture2D(self): - Texture2DInstanceHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2dgroup_gettexture2d(self._handle, Texture2DInstanceHandle)) - if Texture2DInstanceHandle: - Texture2DInstanceObject = self._wrapper._polymorphicFactory(Texture2DInstanceHandle) - else: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + def GetPolygonIndexCount(self, Index): + nIndex = ctypes.c_uint64(Index) + pCount = ctypes.c_uint64() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_getpolygonindexcount(self._handle, nIndex, pCount)) - return Texture2DInstanceObject + return pCount.value + + def GetZTop(self): + pZTop = ctypes.c_double() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_getztop(self._handle, pZTop)) + + return pZTop.value -''' Class Implementation for CompositeMaterials +''' Class Implementation for ToolpathProfile ''' -class CompositeMaterials(Resource): +class ToolpathProfile(Base): def __init__(self, handle, wrapper): - Resource.__init__(self, handle, wrapper) - def GetCount(self): + Base.__init__(self, handle, wrapper) + def GetUUID(self): + nUUIDBufferSize = ctypes.c_uint64(0) + nUUIDNeededChars = ctypes.c_uint64(0) + pUUIDBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathprofile_getuuid(self._handle, nUUIDBufferSize, nUUIDNeededChars, pUUIDBuffer)) + nUUIDBufferSize = ctypes.c_uint64(nUUIDNeededChars.value) + pUUIDBuffer = (ctypes.c_char * (nUUIDNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathprofile_getuuid(self._handle, nUUIDBufferSize, nUUIDNeededChars, pUUIDBuffer)) + + return pUUIDBuffer.value.decode() + + def GetName(self): + nNameBufferSize = ctypes.c_uint64(0) + nNameNeededChars = ctypes.c_uint64(0) + pNameBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathprofile_getname(self._handle, nNameBufferSize, nNameNeededChars, pNameBuffer)) + nNameBufferSize = ctypes.c_uint64(nNameNeededChars.value) + pNameBuffer = (ctypes.c_char * (nNameNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathprofile_getname(self._handle, nNameBufferSize, nNameNeededChars, pNameBuffer)) + + return pNameBuffer.value.decode() + + def GetParameterCount(self): pCount = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_compositematerials_getcount(self._handle, pCount)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathprofile_getparametercount(self._handle, pCount)) return pCount.value - def GetAllPropertyIDs(self): - nPropertyIDsCount = ctypes.c_uint64(0) - nPropertyIDsNeededCount = ctypes.c_uint64(0) - pPropertyIDsBuffer = (ctypes.c_uint32*0)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_compositematerials_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) - nPropertyIDsCount = ctypes.c_uint64(nPropertyIDsNeededCount.value) - pPropertyIDsBuffer = (ctypes.c_uint32 * nPropertyIDsNeededCount.value)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_compositematerials_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) + def GetParameterName(self, Index): + nIndex = ctypes.c_uint32(Index) + nNameBufferSize = ctypes.c_uint64(0) + nNameNeededChars = ctypes.c_uint64(0) + pNameBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathprofile_getparametername(self._handle, nIndex, nNameBufferSize, nNameNeededChars, pNameBuffer)) + nNameBufferSize = ctypes.c_uint64(nNameNeededChars.value) + pNameBuffer = (ctypes.c_char * (nNameNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathprofile_getparametername(self._handle, nIndex, nNameBufferSize, nNameNeededChars, pNameBuffer)) - return [pPropertyIDsBuffer[i] for i in range(nPropertyIDsNeededCount.value)] + return pNameBuffer.value.decode() - def GetBaseMaterialGroup(self): - BaseMaterialGroupInstanceHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_compositematerials_getbasematerialgroup(self._handle, BaseMaterialGroupInstanceHandle)) - if BaseMaterialGroupInstanceHandle: - BaseMaterialGroupInstanceObject = self._wrapper._polymorphicFactory(BaseMaterialGroupInstanceHandle) - else: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + def GetParameterNameSpace(self, Index): + nIndex = ctypes.c_uint32(Index) + nNameSpaceBufferSize = ctypes.c_uint64(0) + nNameSpaceNeededChars = ctypes.c_uint64(0) + pNameSpaceBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathprofile_getparameternamespace(self._handle, nIndex, nNameSpaceBufferSize, nNameSpaceNeededChars, pNameSpaceBuffer)) + nNameSpaceBufferSize = ctypes.c_uint64(nNameSpaceNeededChars.value) + pNameSpaceBuffer = (ctypes.c_char * (nNameSpaceNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathprofile_getparameternamespace(self._handle, nIndex, nNameSpaceBufferSize, nNameSpaceNeededChars, pNameSpaceBuffer)) - return BaseMaterialGroupInstanceObject + return pNameSpaceBuffer.value.decode() - def AddComposite(self, Composite): - nCompositeCount = ctypes.c_uint64(len(Composite)) - pCompositeBuffer = (CompositeConstituent*len(Composite))(*Composite) - pPropertyID = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_compositematerials_addcomposite(self._handle, nCompositeCount, pCompositeBuffer, pPropertyID)) + def HasParameterValue(self, NameSpaceName, ValueName): + pNameSpaceName = ctypes.c_char_p(str.encode(NameSpaceName)) + pValueName = ctypes.c_char_p(str.encode(ValueName)) + pValueExists = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathprofile_hasparametervalue(self._handle, pNameSpaceName, pValueName, pValueExists)) - return pPropertyID.value + return pValueExists.value - def RemoveComposite(self, PropertyID): - nPropertyID = ctypes.c_uint32(PropertyID) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_compositematerials_removecomposite(self._handle, nPropertyID)) + def GetParameterValue(self, NameSpaceName, ValueName): + pNameSpaceName = ctypes.c_char_p(str.encode(NameSpaceName)) + pValueName = ctypes.c_char_p(str.encode(ValueName)) + nValueBufferSize = ctypes.c_uint64(0) + nValueNeededChars = ctypes.c_uint64(0) + pValueBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathprofile_getparametervalue(self._handle, pNameSpaceName, pValueName, nValueBufferSize, nValueNeededChars, pValueBuffer)) + nValueBufferSize = ctypes.c_uint64(nValueNeededChars.value) + pValueBuffer = (ctypes.c_char * (nValueNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathprofile_getparametervalue(self._handle, pNameSpaceName, pValueName, nValueBufferSize, nValueNeededChars, pValueBuffer)) + return pValueBuffer.value.decode() - def GetComposite(self, PropertyID): - nPropertyID = ctypes.c_uint32(PropertyID) - nCompositeCount = ctypes.c_uint64(0) - nCompositeNeededCount = ctypes.c_uint64(0) - pCompositeBuffer = (CompositeConstituent*0)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_compositematerials_getcomposite(self._handle, nPropertyID, nCompositeCount, nCompositeNeededCount, pCompositeBuffer)) - nCompositeCount = ctypes.c_uint64(nCompositeNeededCount.value) - pCompositeBuffer = (CompositeConstituent * nCompositeNeededCount.value)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_compositematerials_getcomposite(self._handle, nPropertyID, nCompositeCount, nCompositeNeededCount, pCompositeBuffer)) + def GetParameterValueDef(self, NameSpaceName, ValueName, DefaultValue): + pNameSpaceName = ctypes.c_char_p(str.encode(NameSpaceName)) + pValueName = ctypes.c_char_p(str.encode(ValueName)) + pDefaultValue = ctypes.c_char_p(str.encode(DefaultValue)) + nValueBufferSize = ctypes.c_uint64(0) + nValueNeededChars = ctypes.c_uint64(0) + pValueBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathprofile_getparametervaluedef(self._handle, pNameSpaceName, pValueName, pDefaultValue, nValueBufferSize, nValueNeededChars, pValueBuffer)) + nValueBufferSize = ctypes.c_uint64(nValueNeededChars.value) + pValueBuffer = (ctypes.c_char * (nValueNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathprofile_getparametervaluedef(self._handle, pNameSpaceName, pValueName, pDefaultValue, nValueBufferSize, nValueNeededChars, pValueBuffer)) - return [pCompositeBuffer[i] for i in range(nCompositeNeededCount.value)] + return pValueBuffer.value.decode() - - -''' Class Implementation for MultiPropertyGroup -''' -class MultiPropertyGroup(Resource): - def __init__(self, handle, wrapper): - Resource.__init__(self, handle, wrapper) - def GetCount(self): - pCount = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_getcount(self._handle, pCount)) + def GetParameterDoubleValue(self, NameSpaceName, ValueName): + pNameSpaceName = ctypes.c_char_p(str.encode(NameSpaceName)) + pValueName = ctypes.c_char_p(str.encode(ValueName)) + pValue = ctypes.c_double() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathprofile_getparameterdoublevalue(self._handle, pNameSpaceName, pValueName, pValue)) - return pCount.value + return pValue.value - def GetAllPropertyIDs(self): - nPropertyIDsCount = ctypes.c_uint64(0) - nPropertyIDsNeededCount = ctypes.c_uint64(0) - pPropertyIDsBuffer = (ctypes.c_uint32*0)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) - nPropertyIDsCount = ctypes.c_uint64(nPropertyIDsNeededCount.value) - pPropertyIDsBuffer = (ctypes.c_uint32 * nPropertyIDsNeededCount.value)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_getallpropertyids(self._handle, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) + def GetParameterDoubleValueDef(self, NameSpaceName, ValueName, DefaultValue): + pNameSpaceName = ctypes.c_char_p(str.encode(NameSpaceName)) + pValueName = ctypes.c_char_p(str.encode(ValueName)) + dDefaultValue = ctypes.c_double(DefaultValue) + pValue = ctypes.c_double() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathprofile_getparameterdoublevaluedef(self._handle, pNameSpaceName, pValueName, dDefaultValue, pValue)) - return [pPropertyIDsBuffer[i] for i in range(nPropertyIDsNeededCount.value)] + return pValue.value - def AddMultiProperty(self, PropertyIDs): - nPropertyIDsCount = ctypes.c_uint64(len(PropertyIDs)) - pPropertyIDsBuffer = (ctypes.c_uint32*len(PropertyIDs))(*PropertyIDs) - pPropertyID = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_addmultiproperty(self._handle, nPropertyIDsCount, pPropertyIDsBuffer, pPropertyID)) + def GetParameterIntegerValue(self, NameSpaceName, ValueName): + pNameSpaceName = ctypes.c_char_p(str.encode(NameSpaceName)) + pValueName = ctypes.c_char_p(str.encode(ValueName)) + pValue = ctypes.c_int64() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathprofile_getparameterintegervalue(self._handle, pNameSpaceName, pValueName, pValue)) - return pPropertyID.value + return pValue.value - def SetMultiProperty(self, PropertyID, PropertyIDs): - nPropertyID = ctypes.c_uint32(PropertyID) - nPropertyIDsCount = ctypes.c_uint64(len(PropertyIDs)) - pPropertyIDsBuffer = (ctypes.c_uint32*len(PropertyIDs))(*PropertyIDs) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_setmultiproperty(self._handle, nPropertyID, nPropertyIDsCount, pPropertyIDsBuffer)) + def GetParameterIntegerValueDef(self, NameSpaceName, ValueName, DefaultValue): + pNameSpaceName = ctypes.c_char_p(str.encode(NameSpaceName)) + pValueName = ctypes.c_char_p(str.encode(ValueName)) + nDefaultValue = ctypes.c_int64(DefaultValue) + pValue = ctypes.c_int64() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathprofile_getparameterintegervaluedef(self._handle, pNameSpaceName, pValueName, nDefaultValue, pValue)) + return pValue.value - def GetMultiProperty(self, PropertyID): - nPropertyID = ctypes.c_uint32(PropertyID) - nPropertyIDsCount = ctypes.c_uint64(0) - nPropertyIDsNeededCount = ctypes.c_uint64(0) - pPropertyIDsBuffer = (ctypes.c_uint32*0)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_getmultiproperty(self._handle, nPropertyID, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) - nPropertyIDsCount = ctypes.c_uint64(nPropertyIDsNeededCount.value) - pPropertyIDsBuffer = (ctypes.c_uint32 * nPropertyIDsNeededCount.value)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_getmultiproperty(self._handle, nPropertyID, nPropertyIDsCount, nPropertyIDsNeededCount, pPropertyIDsBuffer)) + def GetParameterBoolValue(self, NameSpaceName, ValueName): + pNameSpaceName = ctypes.c_char_p(str.encode(NameSpaceName)) + pValueName = ctypes.c_char_p(str.encode(ValueName)) + pValue = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathprofile_getparameterboolvalue(self._handle, pNameSpaceName, pValueName, pValue)) - return [pPropertyIDsBuffer[i] for i in range(nPropertyIDsNeededCount.value)] + return pValue.value - def RemoveMultiProperty(self, PropertyID): - nPropertyID = ctypes.c_uint32(PropertyID) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_removemultiproperty(self._handle, nPropertyID)) + def GetParameterBoolValueDef(self, NameSpaceName, ValueName, DefaultValue): + pNameSpaceName = ctypes.c_char_p(str.encode(NameSpaceName)) + pValueName = ctypes.c_char_p(str.encode(ValueName)) + bDefaultValue = ctypes.c_bool(DefaultValue) + pValue = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathprofile_getparameterboolvaluedef(self._handle, pNameSpaceName, pValueName, bDefaultValue, pValue)) + return pValue.value - def GetLayerCount(self): - pCount = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_getlayercount(self._handle, pCount)) + def SetName(self, Name): + pName = ctypes.c_char_p(str.encode(Name)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathprofile_setname(self._handle, pName)) - return pCount.value - def AddLayer(self, TheLayer): - pLayerIndex = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_addlayer(self._handle, TheLayer, pLayerIndex)) + def SetParameterValue(self, NameSpaceName, ValueName, Value): + pNameSpaceName = ctypes.c_char_p(str.encode(NameSpaceName)) + pValueName = ctypes.c_char_p(str.encode(ValueName)) + pValue = ctypes.c_char_p(str.encode(Value)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathprofile_setparametervalue(self._handle, pNameSpaceName, pValueName, pValue)) - return pLayerIndex.value - def GetLayer(self, LayerIndex): - nLayerIndex = ctypes.c_uint32(LayerIndex) - pTheLayer = MultiPropertyLayer() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_getlayer(self._handle, nLayerIndex, pTheLayer)) + def SetParameterDoubleValue(self, NameSpaceName, ValueName, Value): + pNameSpaceName = ctypes.c_char_p(str.encode(NameSpaceName)) + pValueName = ctypes.c_char_p(str.encode(ValueName)) + dValue = ctypes.c_double(Value) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathprofile_setparameterdoublevalue(self._handle, pNameSpaceName, pValueName, dValue)) - return pTheLayer - def RemoveLayer(self, LayerIndex): - nLayerIndex = ctypes.c_uint32(LayerIndex) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_multipropertygroup_removelayer(self._handle, nLayerIndex)) + def SetParameterIntegerValue(self, NameSpaceName, ValueName, Value): + pNameSpaceName = ctypes.c_char_p(str.encode(NameSpaceName)) + pValueName = ctypes.c_char_p(str.encode(ValueName)) + nValue = ctypes.c_int64(Value) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathprofile_setparameterintegervalue(self._handle, pNameSpaceName, pValueName, nValue)) + + + def SetParameterBoolValue(self, NameSpaceName, ValueName, Value): + pNameSpaceName = ctypes.c_char_p(str.encode(NameSpaceName)) + pValueName = ctypes.c_char_p(str.encode(ValueName)) + bValue = ctypes.c_bool(Value) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathprofile_setparameterboolvalue(self._handle, pNameSpaceName, pValueName, bValue)) -''' Class Implementation for Attachment +''' Class Implementation for ToolpathLayerReader ''' -class Attachment(Base): +class ToolpathLayerReader(Base): def __init__(self, handle, wrapper): Base.__init__(self, handle, wrapper) - def GetPath(self): - nPathBufferSize = ctypes.c_uint64(0) - nPathNeededChars = ctypes.c_uint64(0) - pPathBuffer = ctypes.c_char_p(None) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_getpath(self._handle, nPathBufferSize, nPathNeededChars, pPathBuffer)) - nPathBufferSize = ctypes.c_uint64(nPathNeededChars.value) - pPathBuffer = (ctypes.c_char * (nPathNeededChars.value))() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_getpath(self._handle, nPathBufferSize, nPathNeededChars, pPathBuffer)) - - return pPathBuffer.value.decode() - - def SetPath(self, Path): - pPath = ctypes.c_char_p(str.encode(Path)) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_setpath(self._handle, pPath)) + def GetLayerDataUUID(self): + nUUIDBufferSize = ctypes.c_uint64(0) + nUUIDNeededChars = ctypes.c_uint64(0) + pUUIDBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_getlayerdatauuid(self._handle, nUUIDBufferSize, nUUIDNeededChars, pUUIDBuffer)) + nUUIDBufferSize = ctypes.c_uint64(nUUIDNeededChars.value) + pUUIDBuffer = (ctypes.c_char * (nUUIDNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_getlayerdatauuid(self._handle, nUUIDBufferSize, nUUIDNeededChars, pUUIDBuffer)) + return pUUIDBuffer.value.decode() - def PackagePart(self): - PackagePartHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_packagepart(self._handle, PackagePartHandle)) - if PackagePartHandle: - PackagePartObject = self._wrapper._polymorphicFactory(PackagePartHandle) - else: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + def GetSegmentCount(self): + pCount = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_getsegmentcount(self._handle, pCount)) - return PackagePartObject + return pCount.value - def GetRelationShipType(self): - nPathBufferSize = ctypes.c_uint64(0) - nPathNeededChars = ctypes.c_uint64(0) - pPathBuffer = ctypes.c_char_p(None) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_getrelationshiptype(self._handle, nPathBufferSize, nPathNeededChars, pPathBuffer)) - nPathBufferSize = ctypes.c_uint64(nPathNeededChars.value) - pPathBuffer = (ctypes.c_char * (nPathNeededChars.value))() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_getrelationshiptype(self._handle, nPathBufferSize, nPathNeededChars, pPathBuffer)) + def GetSegmentInfo(self, Index): + nIndex = ctypes.c_uint32(Index) + pType = ctypes.c_int32() + pPointCount = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_getsegmentinfo(self._handle, nIndex, pType, pPointCount)) - return pPathBuffer.value.decode() + return ToolpathSegmentType(pType.value), pPointCount.value - def SetRelationShipType(self, Path): - pPath = ctypes.c_char_p(str.encode(Path)) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_setrelationshiptype(self._handle, pPath)) + def GetSegmentProfile(self, Index): + nIndex = ctypes.c_uint32(Index) + ProfileHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_getsegmentprofile(self._handle, nIndex, ProfileHandle)) + if ProfileHandle: + ProfileObject = self._wrapper._polymorphicFactory(ProfileHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + return ProfileObject - def WriteToFile(self, FileName): - pFileName = ctypes.c_char_p(str.encode(FileName)) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_writetofile(self._handle, pFileName)) + def GetSegmentProfileUUID(self, Index): + nIndex = ctypes.c_uint32(Index) + nProfileUUIDBufferSize = ctypes.c_uint64(0) + nProfileUUIDNeededChars = ctypes.c_uint64(0) + pProfileUUIDBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_getsegmentprofileuuid(self._handle, nIndex, nProfileUUIDBufferSize, nProfileUUIDNeededChars, pProfileUUIDBuffer)) + nProfileUUIDBufferSize = ctypes.c_uint64(nProfileUUIDNeededChars.value) + pProfileUUIDBuffer = (ctypes.c_char * (nProfileUUIDNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_getsegmentprofileuuid(self._handle, nIndex, nProfileUUIDBufferSize, nProfileUUIDNeededChars, pProfileUUIDBuffer)) + return pProfileUUIDBuffer.value.decode() - def ReadFromFile(self, FileName): - pFileName = ctypes.c_char_p(str.encode(FileName)) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_readfromfile(self._handle, pFileName)) + def GetSegmentPart(self, Index): + nIndex = ctypes.c_uint32(Index) + BuildItemHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_getsegmentpart(self._handle, nIndex, BuildItemHandle)) + if BuildItemHandle: + BuildItemObject = self._wrapper._polymorphicFactory(BuildItemHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + return BuildItemObject - def ReadFromCallback(self, TheReadCallbackFunc, StreamSize, TheSeekCallbackFunc, UserData): - nStreamSize = ctypes.c_uint64(StreamSize) - pUserData = ctypes.c_void_p(UserData) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_readfromcallback(self._handle, TheReadCallbackFunc, nStreamSize, TheSeekCallbackFunc, pUserData)) + def GetSegmentPartUUID(self, Index): + nIndex = ctypes.c_uint32(Index) + nPartUUIDBufferSize = ctypes.c_uint64(0) + nPartUUIDNeededChars = ctypes.c_uint64(0) + pPartUUIDBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_getsegmentpartuuid(self._handle, nIndex, nPartUUIDBufferSize, nPartUUIDNeededChars, pPartUUIDBuffer)) + nPartUUIDBufferSize = ctypes.c_uint64(nPartUUIDNeededChars.value) + pPartUUIDBuffer = (ctypes.c_char * (nPartUUIDNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_getsegmentpartuuid(self._handle, nIndex, nPartUUIDBufferSize, nPartUUIDNeededChars, pPartUUIDBuffer)) + return pPartUUIDBuffer.value.decode() - def GetStreamSize(self): - pStreamSize = ctypes.c_uint64() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_getstreamsize(self._handle, pStreamSize)) + def GetSegmentLocalPartID(self, Index): + nIndex = ctypes.c_uint32(Index) + pLocalPartID = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_getsegmentlocalpartid(self._handle, nIndex, pLocalPartID)) - return pStreamSize.value + return pLocalPartID.value - def WriteToBuffer(self): - nBufferCount = ctypes.c_uint64(0) - nBufferNeededCount = ctypes.c_uint64(0) - pBufferBuffer = (ctypes.c_uint8*0)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_writetobuffer(self._handle, nBufferCount, nBufferNeededCount, pBufferBuffer)) - nBufferCount = ctypes.c_uint64(nBufferNeededCount.value) - pBufferBuffer = (ctypes.c_uint8 * nBufferNeededCount.value)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_writetobuffer(self._handle, nBufferCount, nBufferNeededCount, pBufferBuffer)) + def GetPartUUIDByLocalPartID(self, LocalPartID): + nLocalPartID = ctypes.c_uint32(LocalPartID) + nPartUUIDBufferSize = ctypes.c_uint64(0) + nPartUUIDNeededChars = ctypes.c_uint64(0) + pPartUUIDBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_getpartuuidbylocalpartid(self._handle, nLocalPartID, nPartUUIDBufferSize, nPartUUIDNeededChars, pPartUUIDBuffer)) + nPartUUIDBufferSize = ctypes.c_uint64(nPartUUIDNeededChars.value) + pPartUUIDBuffer = (ctypes.c_char * (nPartUUIDNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_getpartuuidbylocalpartid(self._handle, nLocalPartID, nPartUUIDBufferSize, nPartUUIDNeededChars, pPartUUIDBuffer)) - return [pBufferBuffer[i] for i in range(nBufferNeededCount.value)] + return pPartUUIDBuffer.value.decode() - def ReadFromBuffer(self, Buffer): - nBufferCount = ctypes.c_uint64(len(Buffer)) - pBufferBuffer = (ctypes.c_uint8*len(Buffer))(*Buffer) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_attachment_readfrombuffer(self._handle, nBufferCount, pBufferBuffer)) + def GetSegmentPointData(self, Index): + nIndex = ctypes.c_uint32(Index) + nPointDataCount = ctypes.c_uint64(0) + nPointDataNeededCount = ctypes.c_uint64(0) + pPointDataBuffer = (Position2D*0)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_getsegmentpointdata(self._handle, nIndex, nPointDataCount, nPointDataNeededCount, pPointDataBuffer)) + nPointDataCount = ctypes.c_uint64(nPointDataNeededCount.value) + pPointDataBuffer = (Position2D * nPointDataNeededCount.value)() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_getsegmentpointdata(self._handle, nIndex, nPointDataCount, nPointDataNeededCount, pPointDataBuffer)) + return [pPointDataBuffer[i] for i in range(nPointDataNeededCount.value)] - - -''' Class Implementation for Texture2D -''' -class Texture2D(Resource): - def __init__(self, handle, wrapper): - Resource.__init__(self, handle, wrapper) - def GetAttachment(self): - AttachmentHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2d_getattachment(self._handle, AttachmentHandle)) - if AttachmentHandle: - AttachmentObject = self._wrapper._polymorphicFactory(AttachmentHandle) - else: - raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + def FindAttributeInfoByName(self, NameSpace, AttributeName): + pNameSpace = ctypes.c_char_p(str.encode(NameSpace)) + pAttributeName = ctypes.c_char_p(str.encode(AttributeName)) + pID = ctypes.c_uint32() + pAttributeType = ctypes.c_int32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_findattributeinfobyname(self._handle, pNameSpace, pAttributeName, pID, pAttributeType)) - return AttachmentObject + return pID.value, ToolpathAttributeType(pAttributeType.value) - def SetAttachment(self, AttachmentObject): - AttachmentHandle = None - if AttachmentObject: - AttachmentHandle = AttachmentObject._handle - else: - raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2d_setattachment(self._handle, AttachmentHandle)) + def FindAttributeIDByName(self, NameSpace, AttributeName): + pNameSpace = ctypes.c_char_p(str.encode(NameSpace)) + pAttributeName = ctypes.c_char_p(str.encode(AttributeName)) + pID = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_findattributeidbyname(self._handle, pNameSpace, pAttributeName, pID)) + return pID.value - def GetContentType(self): - pContentType = ctypes.c_int32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2d_getcontenttype(self._handle, pContentType)) + def FindAttributeValueByName(self, NameSpace, AttributeName): + pNameSpace = ctypes.c_char_p(str.encode(NameSpace)) + pAttributeName = ctypes.c_char_p(str.encode(AttributeName)) + pAttributeType = ctypes.c_int32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_findattributevaluebyname(self._handle, pNameSpace, pAttributeName, pAttributeType)) - return TextureType(pContentType.value) + return ToolpathAttributeType(pAttributeType.value) - def SetContentType(self, ContentType): - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2d_setcontenttype(self._handle, ContentType)) + def GetSegmentIntegerAttributeByID(self, Index, ID): + nIndex = ctypes.c_uint32(Index) + nID = ctypes.c_uint32(ID) + pValue = ctypes.c_int64() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_getsegmentintegerattributebyid(self._handle, nIndex, nID, pValue)) + return pValue.value - def GetTileStyleUV(self): - pTileStyleU = ctypes.c_int32() - pTileStyleV = ctypes.c_int32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2d_gettilestyleuv(self._handle, pTileStyleU, pTileStyleV)) + def GetSegmentIntegerAttributeByName(self, Index, NameSpace, AttributeName): + nIndex = ctypes.c_uint32(Index) + pNameSpace = ctypes.c_char_p(str.encode(NameSpace)) + pAttributeName = ctypes.c_char_p(str.encode(AttributeName)) + pValue = ctypes.c_int64() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_getsegmentintegerattributebyname(self._handle, nIndex, pNameSpace, pAttributeName, pValue)) - return TextureTileStyle(pTileStyleU.value), TextureTileStyle(pTileStyleV.value) + return pValue.value - def SetTileStyleUV(self, TileStyleU, TileStyleV): - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2d_settilestyleuv(self._handle, TileStyleU, TileStyleV)) + def GetSegmentDoubleAttributeByID(self, Index, ID): + nIndex = ctypes.c_uint32(Index) + nID = ctypes.c_uint32(ID) + pValue = ctypes.c_double() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid(self._handle, nIndex, nID, pValue)) + return pValue.value - def GetFilter(self): - pFilter = ctypes.c_int32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2d_getfilter(self._handle, pFilter)) + def GetSegmentDoubleAttributeByName(self, Index, NameSpace, AttributeName): + nIndex = ctypes.c_uint32(Index) + pNameSpace = ctypes.c_char_p(str.encode(NameSpace)) + pAttributeName = ctypes.c_char_p(str.encode(AttributeName)) + pValue = ctypes.c_double() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname(self._handle, nIndex, pNameSpace, pAttributeName, pValue)) - return TextureFilter(pFilter.value) + return pValue.value - def SetFilter(self, Filter): - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_texture2d_setfilter(self._handle, Filter)) + def GetCustomDataCount(self): + pCount = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_getcustomdatacount(self._handle, pCount)) + return pCount.value - - -''' Class Implementation for BuildItem -''' -class BuildItem(Base): - def __init__(self, handle, wrapper): - Base.__init__(self, handle, wrapper) - def GetObjectResource(self): - ObjectResourceHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_getobjectresource(self._handle, ObjectResourceHandle)) - if ObjectResourceHandle: - ObjectResourceObject = self._wrapper._polymorphicFactory(ObjectResourceHandle) + def GetCustomData(self, Index): + nIndex = ctypes.c_uint32(Index) + DataHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_getcustomdata(self._handle, nIndex, DataHandle)) + if DataHandle: + DataObject = self._wrapper._polymorphicFactory(DataHandle) else: raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') - return ObjectResourceObject + return DataObject + + def GetCustomDataName(self, Index): + nIndex = ctypes.c_uint32(Index) + nNameSpaceBufferSize = ctypes.c_uint64(0) + nNameSpaceNeededChars = ctypes.c_uint64(0) + pNameSpaceBuffer = ctypes.c_char_p(None) + nDataNameBufferSize = ctypes.c_uint64(0) + nDataNameNeededChars = ctypes.c_uint64(0) + pDataNameBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_getcustomdataname(self._handle, nIndex, nNameSpaceBufferSize, nNameSpaceNeededChars, pNameSpaceBuffer, nDataNameBufferSize, nDataNameNeededChars, pDataNameBuffer)) + nNameSpaceBufferSize = ctypes.c_uint64(nNameSpaceNeededChars.value) + pNameSpaceBuffer = (ctypes.c_char * (nNameSpaceNeededChars.value))() + nDataNameBufferSize = ctypes.c_uint64(nDataNameNeededChars.value) + pDataNameBuffer = (ctypes.c_char * (nDataNameNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerreader_getcustomdataname(self._handle, nIndex, nNameSpaceBufferSize, nNameSpaceNeededChars, pNameSpaceBuffer, nDataNameBufferSize, nDataNameNeededChars, pDataNameBuffer)) + + return pNameSpaceBuffer.value.decode(), pDataNameBuffer.value.decode() - def GetUUID(self): - pHasUUID = ctypes.c_bool() + + +''' Class Implementation for ToolpathLayerData +''' +class ToolpathLayerData(Base): + def __init__(self, handle, wrapper): + Base.__init__(self, handle, wrapper) + def GetLayerDataUUID(self): nUUIDBufferSize = ctypes.c_uint64(0) nUUIDNeededChars = ctypes.c_uint64(0) pUUIDBuffer = ctypes.c_char_p(None) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_getuuid(self._handle, pHasUUID, nUUIDBufferSize, nUUIDNeededChars, pUUIDBuffer)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerdata_getlayerdatauuid(self._handle, nUUIDBufferSize, nUUIDNeededChars, pUUIDBuffer)) nUUIDBufferSize = ctypes.c_uint64(nUUIDNeededChars.value) pUUIDBuffer = (ctypes.c_char * (nUUIDNeededChars.value))() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_getuuid(self._handle, pHasUUID, nUUIDBufferSize, nUUIDNeededChars, pUUIDBuffer)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerdata_getlayerdatauuid(self._handle, nUUIDBufferSize, nUUIDNeededChars, pUUIDBuffer)) - return pHasUUID.value, pUUIDBuffer.value.decode() + return pUUIDBuffer.value.decode() - def SetUUID(self, UUID): - pUUID = ctypes.c_char_p(str.encode(UUID)) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_setuuid(self._handle, pUUID)) + def RegisterProfile(self, ProfileObject): + ProfileHandle = None + if ProfileObject: + ProfileHandle = ProfileObject._handle + else: + raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') + pProfileID = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerdata_registerprofile(self._handle, ProfileHandle, pProfileID)) + return pProfileID.value - def GetObjectResourceID(self): - pUniqueResourceID = ctypes.c_uint32() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_getobjectresourceid(self._handle, pUniqueResourceID)) + def RegisterBuildItem(self, BuildItemObject): + BuildItemHandle = None + if BuildItemObject: + BuildItemHandle = BuildItemObject._handle + else: + raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') + pPartID = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerdata_registerbuilditem(self._handle, BuildItemHandle, pPartID)) - return pUniqueResourceID.value + return pPartID.value - def HasObjectTransform(self): - pHasTransform = ctypes.c_bool() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_hasobjecttransform(self._handle, pHasTransform)) + def SetSegmentAttribute(self, NameSpace, AttributeName, Value): + pNameSpace = ctypes.c_char_p(str.encode(NameSpace)) + pAttributeName = ctypes.c_char_p(str.encode(AttributeName)) + pValue = ctypes.c_char_p(str.encode(Value)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerdata_setsegmentattribute(self._handle, pNameSpace, pAttributeName, pValue)) - return pHasTransform.value - def GetObjectTransform(self): - pTransform = Transform() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_getobjecttransform(self._handle, pTransform)) + def ClearSegmentAttributes(self): + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerdata_clearsegmentattributes(self._handle)) - return pTransform - def SetObjectTransform(self, Transform): - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_setobjecttransform(self._handle, Transform)) + def WriteHatchData(self, ProfileID, PartID, PointData): + nProfileID = ctypes.c_uint32(ProfileID) + nPartID = ctypes.c_uint32(PartID) + nPointDataCount = ctypes.c_uint64(len(PointData)) + pPointDataBuffer = (Position2D*len(PointData))(*PointData) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerdata_writehatchdata(self._handle, nProfileID, nPartID, nPointDataCount, pPointDataBuffer)) - def GetPartNumber(self): - nPartNumberBufferSize = ctypes.c_uint64(0) - nPartNumberNeededChars = ctypes.c_uint64(0) - pPartNumberBuffer = ctypes.c_char_p(None) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_getpartnumber(self._handle, nPartNumberBufferSize, nPartNumberNeededChars, pPartNumberBuffer)) - nPartNumberBufferSize = ctypes.c_uint64(nPartNumberNeededChars.value) - pPartNumberBuffer = (ctypes.c_char * (nPartNumberNeededChars.value))() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_getpartnumber(self._handle, nPartNumberBufferSize, nPartNumberNeededChars, pPartNumberBuffer)) + def WriteLoop(self, ProfileID, PartID, PointData): + nProfileID = ctypes.c_uint32(ProfileID) + nPartID = ctypes.c_uint32(PartID) + nPointDataCount = ctypes.c_uint64(len(PointData)) + pPointDataBuffer = (Position2D*len(PointData))(*PointData) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerdata_writeloop(self._handle, nProfileID, nPartID, nPointDataCount, pPointDataBuffer)) - return pPartNumberBuffer.value.decode() - def SetPartNumber(self, SetPartnumber): - pSetPartnumber = ctypes.c_char_p(str.encode(SetPartnumber)) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_setpartnumber(self._handle, pSetPartnumber)) + def WritePolyline(self, ProfileID, PartID, PointData): + nProfileID = ctypes.c_uint32(ProfileID) + nPartID = ctypes.c_uint32(PartID) + nPointDataCount = ctypes.c_uint64(len(PointData)) + pPointDataBuffer = (Position2D*len(PointData))(*PointData) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerdata_writepolyline(self._handle, nProfileID, nPartID, nPointDataCount, pPointDataBuffer)) - def GetMetaDataGroup(self): - MetaDataGroupHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_getmetadatagroup(self._handle, MetaDataGroupHandle)) - if MetaDataGroupHandle: - MetaDataGroupObject = self._wrapper._polymorphicFactory(MetaDataGroupHandle) + def AddCustomData(self, NameSpace, DataName): + pNameSpace = ctypes.c_char_p(str.encode(NameSpace)) + pDataName = ctypes.c_char_p(str.encode(DataName)) + DataHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerdata_addcustomdata(self._handle, pNameSpace, pDataName, DataHandle)) + if DataHandle: + DataObject = self._wrapper._polymorphicFactory(DataHandle) else: raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') - return MetaDataGroupObject + return DataObject - def GetOutbox(self): - pOutbox = Box() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditem_getoutbox(self._handle, pOutbox)) + def Finish(self): + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathlayerdata_finish(self._handle)) - return pOutbox -''' Class Implementation for BuildItemIterator +''' Class Implementation for Toolpath ''' -class BuildItemIterator(Base): +class Toolpath(Resource): def __init__(self, handle, wrapper): - Base.__init__(self, handle, wrapper) - def MoveNext(self): - pHasNext = ctypes.c_bool() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditemiterator_movenext(self._handle, pHasNext)) + Resource.__init__(self, handle, wrapper) + def GetUnits(self): + pUnits = ctypes.c_double() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpath_getunits(self._handle, pUnits)) - return pHasNext.value + return pUnits.value - def MovePrevious(self): - pHasPrevious = ctypes.c_bool() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditemiterator_moveprevious(self._handle, pHasPrevious)) + def GetLayerCount(self): + pCount = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpath_getlayercount(self._handle, pCount)) - return pHasPrevious.value + return pCount.value - def GetCurrent(self): - BuildItemHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditemiterator_getcurrent(self._handle, BuildItemHandle)) - if BuildItemHandle: - BuildItemObject = self._wrapper._polymorphicFactory(BuildItemHandle) + def GetProfileCount(self): + pCount = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpath_getprofilecount(self._handle, pCount)) + + return pCount.value + + def AddLayer(self, ZMax, Path, ModelWriterObject): + nZMax = ctypes.c_uint32(ZMax) + pPath = ctypes.c_char_p(str.encode(Path)) + ModelWriterHandle = None + if ModelWriterObject: + ModelWriterHandle = ModelWriterObject._handle + else: + raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') + LayerDataHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpath_addlayer(self._handle, nZMax, pPath, ModelWriterHandle, LayerDataHandle)) + if LayerDataHandle: + LayerDataObject = self._wrapper._polymorphicFactory(LayerDataHandle) else: raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') - return BuildItemObject + return LayerDataObject - def Clone(self): - OutBuildItemIteratorHandle = ctypes.c_void_p() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditemiterator_clone(self._handle, OutBuildItemIteratorHandle)) - if OutBuildItemIteratorHandle: - OutBuildItemIteratorObject = self._wrapper._polymorphicFactory(OutBuildItemIteratorHandle) + def GetLayerAttachment(self, Index): + nIndex = ctypes.c_uint32(Index) + AttachmentHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpath_getlayerattachment(self._handle, nIndex, AttachmentHandle)) + if AttachmentHandle: + AttachmentObject = self._wrapper._polymorphicFactory(AttachmentHandle) else: raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') - return OutBuildItemIteratorObject + return AttachmentObject - def Count(self): - pCount = ctypes.c_uint64() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_builditemiterator_count(self._handle, pCount)) + def ReadLayerData(self, Index): + nIndex = ctypes.c_uint32(Index) + ToolpathReaderHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpath_readlayerdata(self._handle, nIndex, ToolpathReaderHandle)) + if ToolpathReaderHandle: + ToolpathReaderObject = self._wrapper._polymorphicFactory(ToolpathReaderHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') - return pCount.value + return ToolpathReaderObject - - -''' Class Implementation for Slice -''' -class Slice(Base): - def __init__(self, handle, wrapper): - Base.__init__(self, handle, wrapper) - def SetVertices(self, Vertices): - nVerticesCount = ctypes.c_uint64(len(Vertices)) - pVerticesBuffer = (Position2D*len(Vertices))(*Vertices) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_setvertices(self._handle, nVerticesCount, pVerticesBuffer)) + def GetLayerPath(self, Index): + nIndex = ctypes.c_uint32(Index) + nPathBufferSize = ctypes.c_uint64(0) + nPathNeededChars = ctypes.c_uint64(0) + pPathBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpath_getlayerpath(self._handle, nIndex, nPathBufferSize, nPathNeededChars, pPathBuffer)) + nPathBufferSize = ctypes.c_uint64(nPathNeededChars.value) + pPathBuffer = (ctypes.c_char * (nPathNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpath_getlayerpath(self._handle, nIndex, nPathBufferSize, nPathNeededChars, pPathBuffer)) + return pPathBuffer.value.decode() - def GetVertices(self): - nVerticesCount = ctypes.c_uint64(0) - nVerticesNeededCount = ctypes.c_uint64(0) - pVerticesBuffer = (Position2D*0)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_getvertices(self._handle, nVerticesCount, nVerticesNeededCount, pVerticesBuffer)) - nVerticesCount = ctypes.c_uint64(nVerticesNeededCount.value) - pVerticesBuffer = (Position2D * nVerticesNeededCount.value)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_getvertices(self._handle, nVerticesCount, nVerticesNeededCount, pVerticesBuffer)) + def GetLayerZMax(self, Index): + nIndex = ctypes.c_uint32(Index) + pZMax = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpath_getlayerzmax(self._handle, nIndex, pZMax)) - return [pVerticesBuffer[i] for i in range(nVerticesNeededCount.value)] + return pZMax.value - def GetVertexCount(self): - pCount = ctypes.c_uint64() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_getvertexcount(self._handle, pCount)) + def GetLayerZ(self, LayerIndex): + nLayerIndex = ctypes.c_uint32(LayerIndex) + pZValue = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpath_getlayerz(self._handle, nLayerIndex, pZValue)) - return pCount.value + return pZValue.value - def AddPolygon(self, Indices): - nIndicesCount = ctypes.c_uint64(len(Indices)) - pIndicesBuffer = (ctypes.c_uint32*len(Indices))(*Indices) - pIndex = ctypes.c_uint64() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_addpolygon(self._handle, nIndicesCount, pIndicesBuffer, pIndex)) + def AddProfile(self, Name): + pName = ctypes.c_char_p(str.encode(Name)) + ProfileHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpath_addprofile(self._handle, pName, ProfileHandle)) + if ProfileHandle: + ProfileObject = self._wrapper._polymorphicFactory(ProfileHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') - return pIndex.value + return ProfileObject - def GetPolygonCount(self): - pCount = ctypes.c_uint64() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_getpolygoncount(self._handle, pCount)) + def GetProfile(self, ProfileIndex): + nProfileIndex = ctypes.c_uint32(ProfileIndex) + ProfileHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpath_getprofile(self._handle, nProfileIndex, ProfileHandle)) + if ProfileHandle: + ProfileObject = self._wrapper._polymorphicFactory(ProfileHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return ProfileObject + + def GetProfileUUID(self, ProfileUUID): + pProfileUUID = ctypes.c_char_p(str.encode(ProfileUUID)) + ProfileHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpath_getprofileuuid(self._handle, pProfileUUID, ProfileHandle)) + if ProfileHandle: + ProfileObject = self._wrapper._polymorphicFactory(ProfileHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return ProfileObject + + def GetCustomDataCount(self): + pCount = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpath_getcustomdatacount(self._handle, pCount)) return pCount.value - def SetPolygonIndices(self, Index, Indices): - nIndex = ctypes.c_uint64(Index) - nIndicesCount = ctypes.c_uint64(len(Indices)) - pIndicesBuffer = (ctypes.c_uint32*len(Indices))(*Indices) - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_setpolygonindices(self._handle, nIndex, nIndicesCount, pIndicesBuffer)) + def GetCustomData(self, Index): + nIndex = ctypes.c_uint32(Index) + DataHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpath_getcustomdata(self._handle, nIndex, DataHandle)) + if DataHandle: + DataObject = self._wrapper._polymorphicFactory(DataHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + return DataObject - def GetPolygonIndices(self, Index): - nIndex = ctypes.c_uint64(Index) - nIndicesCount = ctypes.c_uint64(0) - nIndicesNeededCount = ctypes.c_uint64(0) - pIndicesBuffer = (ctypes.c_uint32*0)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_getpolygonindices(self._handle, nIndex, nIndicesCount, nIndicesNeededCount, pIndicesBuffer)) - nIndicesCount = ctypes.c_uint64(nIndicesNeededCount.value) - pIndicesBuffer = (ctypes.c_uint32 * nIndicesNeededCount.value)() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_getpolygonindices(self._handle, nIndex, nIndicesCount, nIndicesNeededCount, pIndicesBuffer)) + def GetCustomDataName(self, Index): + nIndex = ctypes.c_uint32(Index) + nNameSpaceBufferSize = ctypes.c_uint64(0) + nNameSpaceNeededChars = ctypes.c_uint64(0) + pNameSpaceBuffer = ctypes.c_char_p(None) + nDataNameBufferSize = ctypes.c_uint64(0) + nDataNameNeededChars = ctypes.c_uint64(0) + pDataNameBuffer = ctypes.c_char_p(None) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpath_getcustomdataname(self._handle, nIndex, nNameSpaceBufferSize, nNameSpaceNeededChars, pNameSpaceBuffer, nDataNameBufferSize, nDataNameNeededChars, pDataNameBuffer)) + nNameSpaceBufferSize = ctypes.c_uint64(nNameSpaceNeededChars.value) + pNameSpaceBuffer = (ctypes.c_char * (nNameSpaceNeededChars.value))() + nDataNameBufferSize = ctypes.c_uint64(nDataNameNeededChars.value) + pDataNameBuffer = (ctypes.c_char * (nDataNameNeededChars.value))() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpath_getcustomdataname(self._handle, nIndex, nNameSpaceBufferSize, nNameSpaceNeededChars, pNameSpaceBuffer, nDataNameBufferSize, nDataNameNeededChars, pDataNameBuffer)) - return [pIndicesBuffer[i] for i in range(nIndicesNeededCount.value)] + return pNameSpaceBuffer.value.decode(), pDataNameBuffer.value.decode() - def GetPolygonIndexCount(self, Index): - nIndex = ctypes.c_uint64(Index) - pCount = ctypes.c_uint64() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_getpolygonindexcount(self._handle, nIndex, pCount)) + def HasUniqueCustomData(self, NameSpace, DataName): + pNameSpace = ctypes.c_char_p(str.encode(NameSpace)) + pDataName = ctypes.c_char_p(str.encode(DataName)) + pCustomDataExists = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpath_hasuniquecustomdata(self._handle, pNameSpace, pDataName, pCustomDataExists)) - return pCount.value + return pCustomDataExists.value - def GetZTop(self): - pZTop = ctypes.c_double() - self._wrapper.checkError(self, self._wrapper.lib.lib3mf_slice_getztop(self._handle, pZTop)) + def FindUniqueCustomData(self, NameSpace, DataName): + pNameSpace = ctypes.c_char_p(str.encode(NameSpace)) + pDataName = ctypes.c_char_p(str.encode(DataName)) + DataHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpath_finduniquecustomdata(self._handle, pNameSpace, pDataName, DataHandle)) + if DataHandle: + DataObject = self._wrapper._polymorphicFactory(DataHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') - return pZTop.value + return DataObject + + def AddCustomData(self, NameSpace, DataName): + pNameSpace = ctypes.c_char_p(str.encode(NameSpace)) + pDataName = ctypes.c_char_p(str.encode(DataName)) + DataHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpath_addcustomdata(self._handle, pNameSpace, pDataName, DataHandle)) + if DataHandle: + DataObject = self._wrapper._polymorphicFactory(DataHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return DataObject + + def ClearCustomData(self): + pNumberOfDeletedItems = ctypes.c_uint32() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpath_clearcustomdata(self._handle, pNumberOfDeletedItems)) + + return pNumberOfDeletedItems.value + + def DeleteCustomData(self, DataObject): + DataHandle = None + if DataObject: + DataHandle = DataObject._handle + else: + raise ELib3MFException(ErrorCodes.INVALIDPARAM, 'Invalid return/output value') + pSuccess = ctypes.c_bool() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpath_deletecustomdata(self._handle, DataHandle, pSuccess)) + + return pSuccess.value + + def RegisterCustomIntegerAttribute(self, NameSpace, AttributeName): + pNameSpace = ctypes.c_char_p(str.encode(NameSpace)) + pAttributeName = ctypes.c_char_p(str.encode(AttributeName)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpath_registercustomintegerattribute(self._handle, pNameSpace, pAttributeName)) + + + def RegisterCustomDoubleAttribute(self, NameSpace, AttributeName): + pNameSpace = ctypes.c_char_p(str.encode(NameSpace)) + pAttributeName = ctypes.c_char_p(str.encode(AttributeName)) + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpath_registercustomdoubleattribute(self._handle, pNameSpace, pAttributeName)) + + + + +''' Class Implementation for ToolpathIterator +''' +class ToolpathIterator(ResourceIterator): + def __init__(self, handle, wrapper): + ResourceIterator.__init__(self, handle, wrapper) + def GetCurrentToolpath(self): + ResourceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_toolpathiterator_getcurrenttoolpath(self._handle, ResourceHandle)) + if ResourceHandle: + ResourceObject = self._wrapper._polymorphicFactory(ResourceHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return ResourceObject @@ -7107,6 +9750,16 @@ def GetMultiPropertyGroups(self): return ResourceIteratorObject + def GetToolpaths(self): + ResourceIteratorHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_model_gettoolpaths(self._handle, ResourceIteratorHandle)) + if ResourceIteratorHandle: + ResourceIteratorObject = self._wrapper._polymorphicFactory(ResourceIteratorHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return ResourceIteratorObject + def GetSliceStacks(self): ResourceIteratorHandle = ctypes.c_void_p() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_model_getslicestacks(self._handle, ResourceIteratorHandle)) @@ -7257,6 +9910,17 @@ def RemoveBuildItem(self, BuildItemInstanceObject): self._wrapper.checkError(self, self._wrapper.lib.lib3mf_model_removebuilditem(self._handle, BuildItemInstanceHandle)) + def AddToolpath(self, UnitFactor): + dUnitFactor = ctypes.c_double(UnitFactor) + ToolpathInstanceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_model_addtoolpath(self._handle, dUnitFactor, ToolpathInstanceHandle)) + if ToolpathInstanceHandle: + ToolpathInstanceObject = self._wrapper._polymorphicFactory(ToolpathInstanceHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return ToolpathInstanceObject + def GetMetaDataGroup(self): TheMetaDataGroupHandle = ctypes.c_void_p() self._wrapper.checkError(self, self._wrapper.lib.lib3mf_model_getmetadatagroup(self._handle, TheMetaDataGroupHandle)) @@ -7372,4 +10036,39 @@ def GetKeyStore(self): return KeyStoreObject + def CreatePersistentSourceFromFile(self, Filename): + pFilename = ctypes.c_char_p(str.encode(Filename)) + InstanceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_model_createpersistentsourcefromfile(self._handle, pFilename, InstanceHandle)) + if InstanceHandle: + InstanceObject = self._wrapper._polymorphicFactory(InstanceHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return InstanceObject + + def CreatePersistentSourceFromBuffer(self, Buffer): + nBufferCount = ctypes.c_uint64(len(Buffer)) + pBufferBuffer = (ctypes.c_uint8*len(Buffer))(*Buffer) + InstanceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_model_createpersistentsourcefrombuffer(self._handle, nBufferCount, pBufferBuffer, InstanceHandle)) + if InstanceHandle: + InstanceObject = self._wrapper._polymorphicFactory(InstanceHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return InstanceObject + + def CreatePersistentSourceFromCallback(self, TheReadCallbackFunc, StreamSize, TheSeekCallbackFunc, UserData): + nStreamSize = ctypes.c_uint64(StreamSize) + pUserData = ctypes.c_void_p(UserData) + InstanceHandle = ctypes.c_void_p() + self._wrapper.checkError(self, self._wrapper.lib.lib3mf_model_createpersistentsourcefromcallback(self._handle, TheReadCallbackFunc, nStreamSize, TheSeekCallbackFunc, pUserData, InstanceHandle)) + if InstanceHandle: + InstanceObject = self._wrapper._polymorphicFactory(InstanceHandle) + else: + raise ELib3MFException(ErrorCodes.INVALIDCAST, 'Invalid return/output value') + + return InstanceObject + diff --git a/Autogenerated/Source/lib3mf_abi.hpp b/Autogenerated/Source/lib3mf_abi.hpp index 44b8273b8..f1341db56 100644 --- a/Autogenerated/Source/lib3mf_abi.hpp +++ b/Autogenerated/Source/lib3mf_abi.hpp @@ -66,6 +66,78 @@ extern "C" { */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_base_classtypeid(Lib3MF_Base pBase, Lib3MF_uint64 * pClassTypeId); +/************************************************************************************************************************* + Class definition for BinaryStream +**************************************************************************************************************************/ + +/** +* Retrieves an binary streams package path for the binary data. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of binary streams package binary path., may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_binarystream_getbinarypath(Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Retrieves an binary streams package path for the index data. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of binary streams package index path., may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_binarystream_getindexpath(Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Retrieves an binary streams uuid. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of binary streams uuid, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_binarystream_getuuid(Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); + +/** +* Sets the float compression mode to raw. All subsequent writes will adhere to this mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_binarystream_disablediscretizedarraycompression(Lib3MF_BinaryStream pBinaryStream); + +/** +* Sets the compression mode to a quantized array. All subsequent writes will adhere to this mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] dUnits - Unit factor to use for quantization. +* @param[in] ePredictionType - Prediction type to use for arrays. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_binarystream_enablediscretizedarraycompression(Lib3MF_BinaryStream pBinaryStream, Lib3MF_double dUnits, Lib3MF::eBinaryStreamPredictionType ePredictionType); + +/** +* Enables LZMA mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @param[in] nLZMALevel - LZMA Level (0-9) +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_binarystream_enablelzma(Lib3MF_BinaryStream pBinaryStream, Lib3MF_uint32 nLZMALevel); + +/** +* Disables LZMA mode. +* +* @param[in] pBinaryStream - BinaryStream instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_binarystream_disablelzma(Lib3MF_BinaryStream pBinaryStream); + /************************************************************************************************************************* Class definition for Writer **************************************************************************************************************************/ @@ -199,10 +271,80 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_writer_addkeywrappingcallback(Lib3MF_Writer */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_writer_setcontentencryptioncallback(Lib3MF_Writer pWriter, Lib3MF::ContentEncryptionCallback pTheCallback, Lib3MF_pvoid pUserData); +/** +* Creates a binary stream object. Only applicable for 3MF Writers. +* +* @param[in] pWriter - Writer instance. +* @param[in] pIndexPath - Package path to write the index into +* @param[in] pBinaryPath - Package path to write raw binary data into +* @param[out] pBinaryStream - Returns a package path. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_writer_createbinarystream(Lib3MF_Writer pWriter, const char * pIndexPath, const char * pBinaryPath, Lib3MF_BinaryStream * pBinaryStream); + +/** +* Sets a binary stream for an object. Currently supported objects are Meshes and Toolpath layers. +* +* @param[in] pWriter - Writer instance. +* @param[in] pInstance - Object instance to assign Binary stream to. +* @param[in] pBinaryStream - Binary stream object to use for this layer. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_writer_assignbinarystream(Lib3MF_Writer pWriter, Lib3MF_Base pInstance, Lib3MF_BinaryStream pBinaryStream); + +/** +* Registers a custom 3MF Namespace. Fails if Prefix is already registered. +* +* @param[in] pWriter - Writer instance. +* @param[in] pPrefix - Prefix to be used. MUST NOT be empty. MUST be alphanumeric, not starting with a number +* @param[in] pNameSpace - Namespace to be used. MUST NOT be empty. MUST be alphanumeric, not starting with a number +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_writer_registercustomnamespace(Lib3MF_Writer pWriter, const char * pPrefix, const char * pNameSpace); + +/************************************************************************************************************************* + Class definition for PersistentReaderSource +**************************************************************************************************************************/ + +/** +* Retrieves the type of source data. +* +* @param[in] pPersistentReaderSource - PersistentReaderSource instance. +* @param[out] pSourceType - Reader Source Type +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_persistentreadersource_getsourcetype(Lib3MF_PersistentReaderSource pPersistentReaderSource, Lib3MF::ePersistentReaderSourceType * pSourceType); + +/** +* Invalidates the reader source. Every subsequent read on this data will fail. +* +* @param[in] pPersistentReaderSource - PersistentReaderSource instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_persistentreadersource_invalidatesourcedata(Lib3MF_PersistentReaderSource pPersistentReaderSource); + +/** +* Checks if the source data is valid. Any read on an invalid source object will fail. +* +* @param[in] pPersistentReaderSource - PersistentReaderSource instance. +* @param[out] pDataIsValid - The source data is valid. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_persistentreadersource_sourcedataisvalid(Lib3MF_PersistentReaderSource pPersistentReaderSource, bool * pDataIsValid); + /************************************************************************************************************************* Class definition for Reader **************************************************************************************************************************/ +/** +* Reads a model from a persistent source object. The object will be referenced until the Model is destroyed or cleared. +* +* @param[in] pReader - Reader instance. +* @param[in] pSource - Source object to read from +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_reader_readfrompersistentsource(Lib3MF_Reader pReader, Lib3MF_PersistentReaderSource pSource); + /** * Reads a model from a file. The file type is specified by the Model Reader class * @@ -446,1987 +588,3252 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_resourceiterator_clone(Lib3MF_ResourceIterat LIB3MF_DECLSPEC Lib3MFResult lib3mf_resourceiterator_count(Lib3MF_ResourceIterator pResourceIterator, Lib3MF_uint64 * pCount); /************************************************************************************************************************* - Class definition for SliceStackIterator + Class definition for CustomXMLAttribute **************************************************************************************************************************/ /** -* Returns the SliceStack the iterator points at. +* Retrieves name of the attribute. * -* @param[in] pSliceStackIterator - SliceStackIterator instance. -* @param[out] pResource - returns the SliceStack instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the attribute., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slicestackiterator_getcurrentslicestack(Lib3MF_SliceStackIterator pSliceStackIterator, Lib3MF_SliceStack * pResource); - -/************************************************************************************************************************* - Class definition for ObjectIterator -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_getname(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Returns the Object the iterator points at. +* Retrieves value of the attribute as string. * -* @param[in] pObjectIterator - ObjectIterator instance. -* @param[out] pResource - returns the Object instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of returns the value of the attribute., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_objectiterator_getcurrentobject(Lib3MF_ObjectIterator pObjectIterator, Lib3MF_Object * pResource); - -/************************************************************************************************************************* - Class definition for MeshObjectIterator -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_getvalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* Returns the MeshObject the iterator points at. +* Checks if the value is a valid integer in the given range. * -* @param[in] pMeshObjectIterator - MeshObjectIterator instance. -* @param[out] pResource - returns the MeshObject instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nMinValue - Minimum allowed value +* @param[in] nMaxValue - Maximum allowed value +* @param[out] pIsValid - returns if the value is a valid integer. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobjectiterator_getcurrentmeshobject(Lib3MF_MeshObjectIterator pMeshObjectIterator, Lib3MF_MeshObject * pResource); - -/************************************************************************************************************************* - Class definition for ComponentsObjectIterator -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_isvalidinteger(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nMinValue, Lib3MF_int64 nMaxValue, bool * pIsValid); /** -* Returns the ComponentsObject the iterator points at. +* Returns the value as integer. Fails if the value is not a valid integer in the given range. * -* @param[in] pComponentsObjectIterator - ComponentsObjectIterator instance. -* @param[out] pResource - returns the ComponentsObject instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nMinValue - Minimum allowed value +* @param[in] nMaxValue - Maximum allowed value +* @param[out] pValue - returns the value. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobjectiterator_getcurrentcomponentsobject(Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource); - -/************************************************************************************************************************* - Class definition for Texture2DIterator -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_getintegervalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nMinValue, Lib3MF_int64 nMaxValue, Lib3MF_int64 * pValue); /** -* Returns the Texture2D the iterator points at. +* Checks if the value is a valid double in the given range. * -* @param[in] pTexture2DIterator - Texture2DIterator instance. -* @param[out] pResource - returns the Texture2D instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dMinValue - Minimum allowed value +* @param[in] dMaxValue - Maximum allowed value +* @param[out] pIsValid - returns if the value is a valid double. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2diterator_getcurrenttexture2d(Lib3MF_Texture2DIterator pTexture2DIterator, Lib3MF_Texture2D * pResource); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_isvaliddouble(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, bool * pIsValid); -/************************************************************************************************************************* - Class definition for BaseMaterialGroupIterator -**************************************************************************************************************************/ +/** +* Returns the value as double. Fails if the value is not a valid double in the given range. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dMinValue - Minimum allowed value +* @param[in] dMaxValue - Maximum allowed value +* @param[out] pValue - returns the value . +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_getdoublevalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, Lib3MF_double * pValue); /** -* Returns the MaterialGroup the iterator points at. +* Checks if the value is a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. * -* @param[in] pBaseMaterialGroupIterator - BaseMaterialGroupIterator instance. -* @param[out] pResource - returns the BaseMaterialGroup instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[out] pIsValid - returns if the value is a valid bool. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup(Lib3MF_BaseMaterialGroupIterator pBaseMaterialGroupIterator, Lib3MF_BaseMaterialGroup * pResource); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_isvalidbool(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, bool * pIsValid); -/************************************************************************************************************************* - Class definition for ColorGroupIterator -**************************************************************************************************************************/ +/** +* Returns the value as bool. Fails if the value is not a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dMinValue - Minimum allowed value +* @param[in] dMaxValue - Maximum allowed value +* @param[out] pValue - returns the value . +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_getboolvalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, bool * pValue); /** -* Returns the ColorGroup the iterator points at. +* Sets the value of the attribute as string. * -* @param[in] pColorGroupIterator - ColorGroupIterator instance. -* @param[out] pResource - returns the ColorGroup instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] pValue - new value of the attribute. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroupiterator_getcurrentcolorgroup(Lib3MF_ColorGroupIterator pColorGroupIterator, Lib3MF_ColorGroup * pResource); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_setvalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const char * pValue); -/************************************************************************************************************************* - Class definition for Texture2DGroupIterator -**************************************************************************************************************************/ +/** +* Sets the value of the attribute as integer. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] nValue - new value of the attribute. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_setintegervalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nValue); /** -* Returns the Texture2DGroup the iterator points at. +* Sets the value of the attribute as double. * -* @param[in] pTexture2DGroupIterator - Texture2DGroupIterator instance. -* @param[out] pResource - returns the Texture2DGroup instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] dValue - new value of the attribute. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup(Lib3MF_Texture2DGroupIterator pTexture2DGroupIterator, Lib3MF_Texture2DGroup * pResource); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_setdoublevalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dValue); -/************************************************************************************************************************* - Class definition for CompositeMaterialsIterator -**************************************************************************************************************************/ +/** +* Sets the value of the attribute as bool. +* +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. +* @param[in] bValue - new value of the attribute. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_setboolvalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, bool bValue); /** -* Returns the CompositeMaterials the iterator points at. +* Removes the attribute from its parent node. All subsequent calls to the class will fail. * -* @param[in] pCompositeMaterialsIterator - CompositeMaterialsIterator instance. -* @param[out] pResource - returns the CompositeMaterials instance. +* @param[in] pCustomXMLAttribute - CustomXMLAttribute instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerialsiterator_getcurrentcompositematerials(Lib3MF_CompositeMaterialsIterator pCompositeMaterialsIterator, Lib3MF_CompositeMaterials * pResource); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlattribute_remove(Lib3MF_CustomXMLAttribute pCustomXMLAttribute); /************************************************************************************************************************* - Class definition for MultiPropertyGroupIterator + Class definition for CustomXMLNode **************************************************************************************************************************/ /** -* Returns the MultiPropertyGroup the iterator points at. +* Retrieves name of the node. * -* @param[in] pMultiPropertyGroupIterator - MultiPropertyGroupIterator instance. -* @param[out] pResource - returns the MultiPropertyGroup instance. +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the node., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup(Lib3MF_MultiPropertyGroupIterator pMultiPropertyGroupIterator, Lib3MF_MultiPropertyGroup * pResource); - -/************************************************************************************************************************* - Class definition for MetaData -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_getname(Lib3MF_CustomXMLNode pCustomXMLNode, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* returns the namespace URL of the metadata +* Retrieves namespace of the node. * -* @param[in] pMetaData - MetaData instance. +* @param[in] pCustomXMLNode - CustomXMLNode instance. * @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) * @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameSpaceBuffer - buffer of the namespace URL of the metadata, may be NULL +* @param[out] pNameSpaceBuffer - buffer of returns the namespace of the node., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getnamespace(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_getnamespace(Lib3MF_CustomXMLNode pCustomXMLNode, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* sets a new namespace URL of the metadata +* Returns number of attributes. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pNameSpace - the new namespace URL of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[out] pCount - returns the number of attributes. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_setnamespace(Lib3MF_MetaData pMetaData, const char * pNameSpace); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_getattributecount(Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 * pCount); /** -* returns the name of a metadata +* Returns attribute instance. Fails if Index is out of range. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of the name of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] nIndex - Index of the attribute to return (0-based). +* @param[out] pAttributeInstance - XML Document attribute. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getname(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_getattribute(Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 nIndex, Lib3MF_CustomXMLAttribute * pAttributeInstance); /** -* sets a new name of a metadata +* Returns if attribute of a specific name exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pName - the new name of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[out] pAttributeExists - Returns if the attribute exists. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_setname(Lib3MF_MetaData pMetaData, const char * pName); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_hasattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pAttributeExists); /** -* returns the (namespace+name) of a metadata +* Returns attribute instance of a specific name. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nKeyBufferSize - size of the buffer (including trailing 0) -* @param[out] pKeyNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pKeyBuffer - buffer of the key (namespace+name) of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] bMustExist - If true, the call fails if attribute does not exist. If falls, the call will return null if the attribute does not exist. +* @param[out] pAttributeInstance - XML Document attribute. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getkey(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nKeyBufferSize, Lib3MF_uint32* pKeyNeededChars, char * pKeyBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_findattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bMustExist, Lib3MF_CustomXMLAttribute * pAttributeInstance); /** -* returns, whether a metadata must be preserved +* Removes the attribute with a specific name. Does nothing if attribute does not exist. * -* @param[in] pMetaData - MetaData instance. -* @param[out] pMustPreserve - returns, whether a metadata must be preserved +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[out] pAttributeRemoved - Returns true if an attribute was removed. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getmustpreserve(Lib3MF_MetaData pMetaData, bool * pMustPreserve); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_removeattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pAttributeRemoved); /** -* sets whether a metadata must be preserved +* Removes the attribute with a specific index. Fails if index is invalid * -* @param[in] pMetaData - MetaData instance. -* @param[in] bMustPreserve - a new value whether a metadata must be preserved +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] nIndex - Index of the attribute to remove (0-based). +* @param[out] pAttributeRemoved - Returns true if an attribute was removed. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_setmustpreserve(Lib3MF_MetaData pMetaData, bool bMustPreserve); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_removeattributebyindex(Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 nIndex, bool * pAttributeRemoved); /** -* returns the type of a metadata +* Adds an attribute with a specific name and string value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nTypeBufferSize - size of the buffer (including trailing 0) -* @param[out] pTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pTypeBuffer - buffer of the type of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] pValue - Value of the attribute. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_gettype(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nTypeBufferSize, Lib3MF_uint32* pTypeNeededChars, char * pTypeBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_addattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, const char * pValue); /** -* sets a new type of a metadata. This must be a simple XML type +* Adds an attribute with a specific name and integer value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pType - a new type of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] nValue - Value of the attribute. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_settype(Lib3MF_MetaData pMetaData, const char * pType); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_addintegerattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_int64 nValue); /** -* returns the value of the metadata +* Adds an attribute with a specific name and double value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] nValueBufferSize - size of the buffer (including trailing 0) -* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pValueBuffer - buffer of the value of the metadata, may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] dValue - Value of the attribute. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getvalue(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_adddoubleattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_double dValue); /** -* sets a new value of the metadata +* Adds an attribute with a specific name and bool value. Fails if attribute already exists. * -* @param[in] pMetaData - MetaData instance. -* @param[in] pValue - a new value of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the attribute. +* @param[in] bValue - Value of the attribute. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_setvalue(Lib3MF_MetaData pMetaData, const char * pValue); - -/************************************************************************************************************************* - Class definition for MetaDataGroup -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_addboolattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bValue); /** -* returns the number of metadata in this metadatagroup +* Returns all the child nodes of the XML Node. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[out] pCount - returns the number metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[out] pChildNodes - returns the list of child nodes. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_getmetadatacount(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_getchildren(Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_CustomXMLNodes * pChildNodes); /** -* returns a metadata value within this metadatagroup +* Returns how many children of the XML Node have a specific name. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] nIndex - Index of the Metadata. -* @param[out] pMetaData - an instance of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the node. +* @param[out] pCount - returns the number children with the specified name. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_getmetadata(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex, Lib3MF_MetaData * pMetaData); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_countchildrenbyname(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_uint64 * pCount); /** -* returns a metadata value within this metadatagroup +* Returns all the child nodes of the XML Node with a specific name. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] pNameSpace - the namespace of the metadata -* @param[in] pName - the name of the Metadata -* @param[out] pMetaData - an instance of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildNodes - returns the list of child nodes. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_getmetadatabykey(Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, Lib3MF_MetaData * pMetaData); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_getchildrenbyname(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_CustomXMLNodes * pChildNodes); /** -* removes metadata by index from the model. +* Returns if a child with a specific name exist. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] nIndex - Index of the metadata to remove +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildExists - returns if a child with a specific name exists. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_removemetadatabyindex(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_haschild(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pChildExists); /** -* removes metadata from the model. +* Returns if a child with a specific name exist once and only once. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] pTheMetaData - The metadata to remove +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildExists - returns if a child with a specific name exists once and only once. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_removemetadata(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_MetaData pTheMetaData); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_hasuniquechild(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pChildExists); /** -* adds a new metadata to this metadatagroup +* Returns child with a specific name. Throws an error if name does not exist once and only once. * -* @param[in] pMetaDataGroup - MetaDataGroup instance. -* @param[in] pNameSpace - the namespace of the metadata -* @param[in] pName - the name of the metadata -* @param[in] pValue - the value of the metadata -* @param[in] pType - the type of the metadata -* @param[in] bMustPreserve - shuold the metadata be preserved -* @param[out] pMetaData - a new instance of the metadata +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[in] bMustExist - If true, the call fails if child does not exist. If falls, the call will return null if the child does not exist. +* @param[out] pChildInstance - returns child instance or null. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_addmetadata(Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, const char * pValue, const char * pType, bool bMustPreserve, Lib3MF_MetaData * pMetaData); - -/************************************************************************************************************************* - Class definition for Object -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_findchild(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bMustExist, Lib3MF_CustomXMLNode * pChildInstance); /** -* Retrieves an object's type +* Adds a new child with a specific name. * -* @param[in] pObject - Object instance. -* @param[out] pObjectType - returns object type enum. +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the child. +* @param[out] pChildInstance - returns child instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_gettype(Lib3MF_Object pObject, Lib3MF::eObjectType * pObjectType); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_addchild(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_CustomXMLNode * pChildInstance); /** -* Sets an object's type +* Removes a specific child. All subsequent calls to the child will fail after the call. * -* @param[in] pObject - Object instance. -* @param[in] eObjectType - object type enum. +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pChildInstance - child instance to remove. Fails if given instance is not a child of the node. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_settype(Lib3MF_Object pObject, Lib3MF::eObjectType eObjectType); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_removechild(Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_CustomXMLNode pChildInstance); /** -* Retrieves an object's name +* Removes all children with a specific name. Does nothing if no child with the name exists. All subsequent calls to the deleted children will fail after the call. * -* @param[in] pObject - Object instance. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of returns object name., may be NULL +* @param[in] pCustomXMLNode - CustomXMLNode instance. +* @param[in] pName - Name of the children. +* @param[out] pNumberOfDeletedChildren - Returns how many children have been deleted. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getname(Lib3MF_Object pObject, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_removechildrenwithname(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_uint64 * pNumberOfDeletedChildren); /** -* Sets an object's name string +* Removes the node from its parent. The root node of the document can not be removed. Any subsequent call to the node fails after this. * -* @param[in] pObject - Object instance. -* @param[in] pName - new object name. +* @param[in] pCustomXMLNode - CustomXMLNode instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setname(Lib3MF_Object pObject, const char * pName); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnode_remove(Lib3MF_CustomXMLNode pCustomXMLNode); + +/************************************************************************************************************************* + Class definition for CustomXMLNodes +**************************************************************************************************************************/ /** -* Retrieves an object's part number +* Returns number of nodes. * -* @param[in] pObject - Object instance. -* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) -* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPartNumberBuffer - buffer of returns object part number., may be NULL +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[out] pCount - returns the number of nodes in the list. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getpartnumber(Lib3MF_Object pObject, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnodes_getnodecount(Lib3MF_CustomXMLNodes pCustomXMLNodes, Lib3MF_uint64 * pCount); /** -* Sets an objects partnumber string +* Returns node instance. Fails if Index is out of range. * -* @param[in] pObject - Object instance. -* @param[in] pPartNumber - new object part number. +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] nIndex - Index of the node to return (0-based). +* @param[out] pNodeInstance - XML Node node. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setpartnumber(Lib3MF_Object pObject, const char * pPartNumber); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnodes_getnode(Lib3MF_CustomXMLNodes pCustomXMLNodes, Lib3MF_uint64 nIndex, Lib3MF_CustomXMLNode * pNodeInstance); /** -* Retrieves, if an object is a mesh object +* Returns how many nodes of the XML Node have a specific name. * -* @param[in] pObject - Object instance. -* @param[out] pIsMeshObject - returns, whether the object is a mesh object +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pCount - returns the number of nodes with the specified name. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_ismeshobject(Lib3MF_Object pObject, bool * pIsMeshObject); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnodes_countnodesbyname(Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, Lib3MF_uint64 * pCount); /** -* Retrieves, if an object is a components object +* Returns all the nodes nodes of the XML Node with a specific name. * -* @param[in] pObject - Object instance. -* @param[out] pIsComponentsObject - returns, whether the object is a components object +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pNodes - returns the list of node nodes. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_iscomponentsobject(Lib3MF_Object pObject, bool * pIsComponentsObject); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnodes_getnodesbyname(Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, Lib3MF_CustomXMLNodes * pNodes); /** -* Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. +* Returns if a node with a specific name exist. * -* @param[in] pObject - Object instance. -* @param[out] pIsValid - returns whether the object is a valid object description +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pNodeExists - returns if a node with a specific name exists. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_isvalid(Lib3MF_Object pObject, bool * pIsValid); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnodes_hasnode(Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool * pNodeExists); /** -* Use an existing attachment as thumbnail for this object +* Returns if a node with a specific name exist once and only once. * -* @param[in] pObject - Object instance. -* @param[in] pAttachment - Instance of a new or the existing thumbnailattachment object. +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[out] pNodeExists - returns if a node with a specific name exists once and only once. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setattachmentasthumbnail(Lib3MF_Object pObject, Lib3MF_Attachment pAttachment); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnodes_hasuniquenode(Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool * pNodeExists); /** -* Get the attachment containing the object thumbnail. +* Returns node with a specific name. Throws an error if name does not exist once and only once. * -* @param[in] pObject - Object instance. -* @param[out] pAttachment - Instance of the thumbnailattachment object or NULL. +* @param[in] pCustomXMLNodes - CustomXMLNodes instance. +* @param[in] pName - Name of the node. +* @param[in] bMustExist - If true, the call fails if node does not exist. If falls, the call will return null if the node does not exist. +* @param[out] pNodeInstance - returns node instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getthumbnailattachment(Lib3MF_Object pObject, Lib3MF_Attachment * pAttachment); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customxmlnodes_findnode(Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool bMustExist, Lib3MF_CustomXMLNode * pNodeInstance); + +/************************************************************************************************************************* + Class definition for CustomDOMTree +**************************************************************************************************************************/ /** -* Clears the attachment. The attachment instance is not removed from the package. +* Returns the namespace identifier for the DOM Tree. * -* @param[in] pObject - Object instance. +* @param[in] pCustomDOMTree - CustomDOMTree instance. +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of returns the namespace of the DOM Tree., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_clearthumbnailattachment(Lib3MF_Object pObject); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customdomtree_getnamespace(Lib3MF_CustomDOMTree pCustomDOMTree, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* Returns the outbox of a build item +* Returns root node of the tree. * -* @param[in] pObject - Object instance. -* @param[out] pOutbox - Outbox of this build item +* @param[in] pCustomDOMTree - CustomDOMTree instance. +* @param[out] pRootNode - Root node of the document. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getoutbox(Lib3MF_Object pObject, Lib3MF::sBox * pOutbox); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customdomtree_getrootnode(Lib3MF_CustomDOMTree pCustomDOMTree, Lib3MF_CustomXMLNode * pRootNode); /** -* Retrieves an object's uuid string (see production extension specification) +* Saves the XML tree into a string. * -* @param[in] pObject - Object instance. -* @param[out] pHasUUID - flag whether the build item has a UUID -* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pUUIDBuffer - buffer of returns object uuid., may be NULL +* @param[in] pCustomDOMTree - CustomDOMTree instance. +* @param[in] nXMLStringBufferSize - size of the buffer (including trailing 0) +* @param[out] pXMLStringNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pXMLStringBuffer - buffer of String with the XML Content., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getuuid(Lib3MF_Object pObject, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_customdomtree_savetostring(Lib3MF_CustomDOMTree pCustomDOMTree, const Lib3MF_uint32 nXMLStringBufferSize, Lib3MF_uint32* pXMLStringNeededChars, char * pXMLStringBuffer); + +/************************************************************************************************************************* + Class definition for SliceStackIterator +**************************************************************************************************************************/ /** -* Sets a build object's uuid string (see production extension specification) +* Returns the SliceStack the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] pUUID - new object uuid string. +* @param[in] pSliceStackIterator - SliceStackIterator instance. +* @param[out] pResource - returns the SliceStack instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setuuid(Lib3MF_Object pObject, const char * pUUID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slicestackiterator_getcurrentslicestack(Lib3MF_SliceStackIterator pSliceStackIterator, Lib3MF_SliceStack * pResource); + +/************************************************************************************************************************* + Class definition for ObjectIterator +**************************************************************************************************************************/ /** -* Returns the metadatagroup of this object +* Returns the Object the iterator points at. * -* @param[in] pObject - Object instance. -* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this object +* @param[in] pObjectIterator - ObjectIterator instance. +* @param[out] pResource - returns the Object instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getmetadatagroup(Lib3MF_Object pObject, Lib3MF_MetaDataGroup * pMetaDataGroup); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_objectiterator_getcurrentobject(Lib3MF_ObjectIterator pObjectIterator, Lib3MF_Object * pResource); + +/************************************************************************************************************************* + Class definition for MeshObjectIterator +**************************************************************************************************************************/ /** -* set the meshresolution of the mesh object +* Returns the MeshObject the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] eMeshResolution - meshresolution of this object +* @param[in] pMeshObjectIterator - MeshObjectIterator instance. +* @param[out] pResource - returns the MeshObject instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setslicesmeshresolution(Lib3MF_Object pObject, Lib3MF::eSlicesMeshResolution eMeshResolution); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobjectiterator_getcurrentmeshobject(Lib3MF_MeshObjectIterator pMeshObjectIterator, Lib3MF_MeshObject * pResource); + +/************************************************************************************************************************* + Class definition for ComponentsObjectIterator +**************************************************************************************************************************/ /** -* get the meshresolution of the mesh object +* Returns the ComponentsObject the iterator points at. * -* @param[in] pObject - Object instance. -* @param[out] pMeshResolution - meshresolution of this object +* @param[in] pComponentsObjectIterator - ComponentsObjectIterator instance. +* @param[out] pResource - returns the ComponentsObject instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getslicesmeshresolution(Lib3MF_Object pObject, Lib3MF::eSlicesMeshResolution * pMeshResolution); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobjectiterator_getcurrentcomponentsobject(Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource); + +/************************************************************************************************************************* + Class definition for Texture2DIterator +**************************************************************************************************************************/ /** -* returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack +* Returns the Texture2D the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] bRecursive - check also all referenced objects? -* @param[out] pHasSlices - does the object have a slice stack? +* @param[in] pTexture2DIterator - Texture2DIterator instance. +* @param[out] pResource - returns the Texture2D instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_hasslices(Lib3MF_Object pObject, bool bRecursive, bool * pHasSlices); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2diterator_getcurrenttexture2d(Lib3MF_Texture2DIterator pTexture2DIterator, Lib3MF_Texture2D * pResource); + +/************************************************************************************************************************* + Class definition for BaseMaterialGroupIterator +**************************************************************************************************************************/ /** -* unlinks the attached slicestack from this object. If no slice stack is attached, do noting. +* Returns the MaterialGroup the iterator points at. * -* @param[in] pObject - Object instance. +* @param[in] pBaseMaterialGroupIterator - BaseMaterialGroupIterator instance. +* @param[out] pResource - returns the BaseMaterialGroup instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_clearslicestack(Lib3MF_Object pObject); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup(Lib3MF_BaseMaterialGroupIterator pBaseMaterialGroupIterator, Lib3MF_BaseMaterialGroup * pResource); + +/************************************************************************************************************************* + Class definition for ColorGroupIterator +**************************************************************************************************************************/ /** -* get the Slicestack attached to the object +* Returns the ColorGroup the iterator points at. * -* @param[in] pObject - Object instance. -* @param[out] pSliceStackInstance - returns the slicestack instance +* @param[in] pColorGroupIterator - ColorGroupIterator instance. +* @param[out] pResource - returns the ColorGroup instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getslicestack(Lib3MF_Object pObject, Lib3MF_SliceStack * pSliceStackInstance); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroupiterator_getcurrentcolorgroup(Lib3MF_ColorGroupIterator pColorGroupIterator, Lib3MF_ColorGroup * pResource); + +/************************************************************************************************************************* + Class definition for Texture2DGroupIterator +**************************************************************************************************************************/ /** -* assigns a slicestack to the object +* Returns the Texture2DGroup the iterator points at. * -* @param[in] pObject - Object instance. -* @param[in] pSliceStackInstance - the new slice stack of this Object +* @param[in] pTexture2DGroupIterator - Texture2DGroupIterator instance. +* @param[out] pResource - returns the Texture2DGroup instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_assignslicestack(Lib3MF_Object pObject, Lib3MF_SliceStack pSliceStackInstance); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup(Lib3MF_Texture2DGroupIterator pTexture2DGroupIterator, Lib3MF_Texture2DGroup * pResource); /************************************************************************************************************************* - Class definition for MeshObject + Class definition for CompositeMaterialsIterator **************************************************************************************************************************/ /** -* Returns the vertex count of a mesh object. +* Returns the CompositeMaterials the iterator points at. * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pVertexCount - filled with the vertex count. +* @param[in] pCompositeMaterialsIterator - CompositeMaterialsIterator instance. +* @param[out] pResource - returns the CompositeMaterials instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getvertexcount(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerialsiterator_getcurrentcompositematerials(Lib3MF_CompositeMaterialsIterator pCompositeMaterialsIterator, Lib3MF_CompositeMaterials * pResource); + +/************************************************************************************************************************* + Class definition for MultiPropertyGroupIterator +**************************************************************************************************************************/ /** -* Returns the triangle count of a mesh object. +* Returns the MultiPropertyGroup the iterator points at. * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pVertexCount - filled with the triangle count. +* @param[in] pMultiPropertyGroupIterator - MultiPropertyGroupIterator instance. +* @param[out] pResource - returns the MultiPropertyGroup instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettrianglecount(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup(Lib3MF_MultiPropertyGroupIterator pMultiPropertyGroupIterator, Lib3MF_MultiPropertyGroup * pResource); + +/************************************************************************************************************************* + Class definition for MetaData +**************************************************************************************************************************/ /** -* Returns the vertex count of a mesh object. +* returns the namespace URL of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) -* @param[out] pCoordinates - filled with the vertex coordinates. +* @param[in] pMetaData - MetaData instance. +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of the namespace URL of the metadata, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getvertex(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, Lib3MF::sPosition * pCoordinates); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getnamespace(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* Sets the coordinates of a single vertex of a mesh object +* sets a new namespace URL of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) -* @param[in] pCoordinates - contains the vertex coordinates. +* @param[in] pMetaData - MetaData instance. +* @param[in] pNameSpace - the new namespace URL of the metadata * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_setvertex(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const Lib3MF::sPosition * pCoordinates); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_setnamespace(Lib3MF_MetaData pMetaData, const char * pNameSpace); /** -* Adds a single vertex to a mesh object +* returns the name of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] pCoordinates - contains the vertex coordinates. -* @param[out] pNewIndex - Index of the new vertex +* @param[in] pMetaData - MetaData instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of the name of the metadata, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_addvertex(Lib3MF_MeshObject pMeshObject, const Lib3MF::sPosition * pCoordinates, Lib3MF_uint32 * pNewIndex); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getname(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Obtains all vertex positions of a mesh object +* sets a new name of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pVerticesBuffer - Position buffer of contains the vertex coordinates. +* @param[in] pMetaData - MetaData instance. +* @param[in] pName - the new name of the metadata * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getvertices(Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, Lib3MF::sPosition * pVerticesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_setname(Lib3MF_MetaData pMetaData, const char * pName); /** -* Returns indices of a single triangle of a mesh object. +* returns the (namespace+name) of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[out] pIndices - filled with the triangle indices. +* @param[in] pMetaData - MetaData instance. +* @param[in] nKeyBufferSize - size of the buffer (including trailing 0) +* @param[out] pKeyNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pKeyBuffer - buffer of the key (namespace+name) of the metadata, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettriangle(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, Lib3MF::sTriangle * pIndices); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getkey(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nKeyBufferSize, Lib3MF_uint32* pKeyNeededChars, char * pKeyBuffer); /** -* Sets the indices of a single triangle of a mesh object. +* returns, whether a metadata must be preserved * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[in] pIndices - contains the triangle indices. +* @param[in] pMetaData - MetaData instance. +* @param[out] pMustPreserve - returns, whether a metadata must be preserved * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_settriangle(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const Lib3MF::sTriangle * pIndices); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getmustpreserve(Lib3MF_MetaData pMetaData, bool * pMustPreserve); /** -* Adds a single triangle to a mesh object +* sets whether a metadata must be preserved * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] pIndices - contains the triangle indices. -* @param[out] pNewIndex - Index of the new triangle +* @param[in] pMetaData - MetaData instance. +* @param[in] bMustPreserve - a new value whether a metadata must be preserved * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_addtriangle(Lib3MF_MeshObject pMeshObject, const Lib3MF::sTriangle * pIndices, Lib3MF_uint32 * pNewIndex); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_setmustpreserve(Lib3MF_MetaData pMetaData, bool bMustPreserve); /** -* Get all triangles of a mesh object +* returns the type of a metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @param[in] pMetaData - MetaData instance. +* @param[in] nTypeBufferSize - size of the buffer (including trailing 0) +* @param[out] pTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pTypeBuffer - buffer of the type of the metadata, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettriangleindices(Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF::sTriangle * pIndicesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_gettype(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nTypeBufferSize, Lib3MF_uint32* pTypeNeededChars, char * pTypeBuffer); /** -* Sets the property at the object-level of the mesh object. +* sets a new type of a metadata. This must be a simple XML type * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nUniqueResourceID - the object-level Property UniqueResourceID. -* @param[in] nPropertyID - the object-level PropertyID. +* @param[in] pMetaData - MetaData instance. +* @param[in] pType - a new type of the metadata * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_setobjectlevelproperty(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nUniqueResourceID, Lib3MF_uint32 nPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_settype(Lib3MF_MetaData pMetaData, const char * pType); /** -* Gets the property at the object-level of the mesh object. +* returns the value of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pUniqueResourceID - the object-level Property UniqueResourceID. -* @param[out] pPropertyID - the object-level PropertyID. -* @param[out] pHasObjectLevelProperty - Has an object-level property been specified? +* @param[in] pMetaData - MetaData instance. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of the value of the metadata, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getobjectlevelproperty(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pUniqueResourceID, Lib3MF_uint32 * pPropertyID, bool * pHasObjectLevelProperty); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_getvalue(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* Sets the properties of a single triangle of a mesh object. +* sets a new value of the metadata * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[in] pProperties - contains the triangle properties. +* @param[in] pMetaData - MetaData instance. +* @param[in] pValue - a new value of the metadata * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_settriangleproperties(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const Lib3MF::sTriangleProperties * pProperties); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadata_setvalue(Lib3MF_MetaData pMetaData, const char * pValue); -/** -* Gets the properties of a single triangle of a mesh object. -* -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) -* @param[out] pProperty - returns the triangle properties. -* @return error code or 0 (success) -*/ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettriangleproperties(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, Lib3MF::sTriangleProperties * pProperty); +/************************************************************************************************************************* + Class definition for MetaDataGroup +**************************************************************************************************************************/ /** -* Sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. +* returns the number of metadata in this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer -* @param[in] pPropertiesArrayBuffer - TriangleProperties buffer of contains the triangle properties array. Must have trianglecount elements. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[out] pCount - returns the number metadata * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_setalltriangleproperties(Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nPropertiesArrayBufferSize, const Lib3MF::sTriangleProperties * pPropertiesArrayBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_getmetadatacount(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 * pCount); /** -* Gets the properties of all triangles of a mesh object. +* returns a metadata value within this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer -* @param[out] pPropertiesArrayNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertiesArrayBuffer - TriangleProperties buffer of returns the triangle properties array. Must have trianglecount elements. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] nIndex - Index of the Metadata. +* @param[out] pMetaData - an instance of the metadata * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getalltriangleproperties(Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nPropertiesArrayBufferSize, Lib3MF_uint64* pPropertiesArrayNeededCount, Lib3MF::sTriangleProperties * pPropertiesArrayBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_getmetadata(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex, Lib3MF_MetaData * pMetaData); /** -* Clears all properties of this mesh object (triangle and object-level). +* returns a metadata value within this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] pNameSpace - the namespace of the metadata +* @param[in] pName - the name of the Metadata +* @param[out] pMetaData - an instance of the metadata * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_clearallproperties(Lib3MF_MeshObject pMeshObject); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_getmetadatabykey(Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, Lib3MF_MetaData * pMetaData); /** -* Set all triangles of a mesh object +* removes metadata by index from the model. * -* @param[in] pMeshObject - MeshObject instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[in] pVerticesBuffer - Position buffer of contains the positions. -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[in] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] nIndex - Index of the metadata to remove * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_setgeometry(Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nVerticesBufferSize, const Lib3MF::sPosition * pVerticesBuffer, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF::sTriangle * pIndicesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_removemetadatabyindex(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex); /** -* Retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. +* removes metadata from the model. * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pIsManifoldAndOriented - returns, if the object is oriented and manifold. +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] pTheMetaData - The metadata to remove * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_ismanifoldandoriented(Lib3MF_MeshObject pMeshObject, bool * pIsManifoldAndOriented); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_removemetadata(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_MetaData pTheMetaData); /** -* Retrieves the BeamLattice within this MeshObject. +* adds a new metadata to this metadatagroup * -* @param[in] pMeshObject - MeshObject instance. -* @param[out] pTheBeamLattice - the BeamLattice within this MeshObject +* @param[in] pMetaDataGroup - MetaDataGroup instance. +* @param[in] pNameSpace - the namespace of the metadata +* @param[in] pName - the name of the metadata +* @param[in] pValue - the value of the metadata +* @param[in] pType - the type of the metadata +* @param[in] bMustPreserve - shuold the metadata be preserved +* @param[out] pMetaData - a new instance of the metadata * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_beamlattice(Lib3MF_MeshObject pMeshObject, Lib3MF_BeamLattice * pTheBeamLattice); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_metadatagroup_addmetadata(Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, const char * pValue, const char * pType, bool bMustPreserve, Lib3MF_MetaData * pMetaData); /************************************************************************************************************************* - Class definition for BeamLattice + Class definition for Object **************************************************************************************************************************/ /** -* Returns the minimal length of beams for the beamlattice. +* Retrieves an object's type * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pMinLength - minimal length of beams for the beamlattice +* @param[in] pObject - Object instance. +* @param[out] pObjectType - returns object type enum. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getminlength(Lib3MF_BeamLattice pBeamLattice, Lib3MF_double * pMinLength); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_gettype(Lib3MF_Object pObject, Lib3MF::eObjectType * pObjectType); /** -* Sets the minimal length of beams for the beamlattice. +* Sets an object's type * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] dMinLength - minimal length of beams for the beamlattice +* @param[in] pObject - Object instance. +* @param[in] eObjectType - object type enum. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setminlength(Lib3MF_BeamLattice pBeamLattice, Lib3MF_double dMinLength); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_settype(Lib3MF_Object pObject, Lib3MF::eObjectType eObjectType); /** -* Returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* Retrieves an object's name * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pClipMode - contains the clip mode of this mesh -* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object or an undefined value if pClipMode is MODELBEAMLATTICECLIPMODE_NONE +* @param[in] pObject - Object instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns object name., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getclipping(Lib3MF_BeamLattice pBeamLattice, Lib3MF::eBeamLatticeClipMode * pClipMode, Lib3MF_uint32 * pUniqueResourceID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getname(Lib3MF_Object pObject, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* Sets an object's name string * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] eClipMode - contains the clip mode of this mesh -* @param[in] nUniqueResourceID - the UniqueResourceID of the clipping mesh-object. This mesh-object has to be defined before setting the Clipping. +* @param[in] pObject - Object instance. +* @param[in] pName - new object name. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setclipping(Lib3MF_BeamLattice pBeamLattice, Lib3MF::eBeamLatticeClipMode eClipMode, Lib3MF_uint32 nUniqueResourceID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setname(Lib3MF_Object pObject, const char * pName); /** -* Returns the representation-mesh for the beamlattice of this mesh. +* Retrieves an object's part number * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pHasRepresentation - flag whether the beamlattice has a representation mesh. -* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object. +* @param[in] pObject - Object instance. +* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartNumberBuffer - buffer of returns object part number., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getrepresentation(Lib3MF_BeamLattice pBeamLattice, bool * pHasRepresentation, Lib3MF_uint32 * pUniqueResourceID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getpartnumber(Lib3MF_Object pObject, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); /** -* Sets the representation-mesh for the beamlattice of this mesh. +* Sets an objects partnumber string * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nUniqueResourceID - the UniqueResourceID of the representation mesh-object. This mesh-object has to be defined before setting the representation. +* @param[in] pObject - Object instance. +* @param[in] pPartNumber - new object part number. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setrepresentation(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nUniqueResourceID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setpartnumber(Lib3MF_Object pObject, const char * pPartNumber); /** -* Returns the ball mode and the default ball radius for the beamlattice of this mesh. +* Retrieves, if an object is a mesh object * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pBallMode - contains the ball mode of this mesh -* @param[out] pBallRadius - default ball radius of balls for the beamlattice +* @param[in] pObject - Object instance. +* @param[out] pIsMeshObject - returns, whether the object is a mesh object * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getballoptions(Lib3MF_BeamLattice pBeamLattice, Lib3MF::eBeamLatticeBallMode * pBallMode, Lib3MF_double * pBallRadius); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_ismeshobject(Lib3MF_Object pObject, bool * pIsMeshObject); /** -* Sets the ball mode and thedefault ball radius for the beamlattice. +* Retrieves, if an object is a components object * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] eBallMode - contains the ball mode of this mesh -* @param[in] dBallRadius - default ball radius of balls for the beamlattice +* @param[in] pObject - Object instance. +* @param[out] pIsComponentsObject - returns, whether the object is a components object * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setballoptions(Lib3MF_BeamLattice pBeamLattice, Lib3MF::eBeamLatticeBallMode eBallMode, Lib3MF_double dBallRadius); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_iscomponentsobject(Lib3MF_Object pObject, bool * pIsComponentsObject); /** -* Returns the beam count of a mesh object. +* Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pCount - filled with the beam count. +* @param[in] pObject - Object instance. +* @param[out] pIsValid - returns whether the object is a valid object description * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeamcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_isvalid(Lib3MF_Object pObject, bool * pIsValid); /** -* Returns indices, radii and capmodes of a single beam of a mesh object. +* Use an existing attachment as thumbnail for this object * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the beam (0 to beamcount - 1). -* @param[out] pBeamInfo - filled with the beam indices, radii and capmodes. +* @param[in] pObject - Object instance. +* @param[in] pAttachment - Instance of a new or the existing thumbnailattachment object. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeam(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF::sBeam * pBeamInfo); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setattachmentasthumbnail(Lib3MF_Object pObject, Lib3MF_Attachment pAttachment); /** -* Adds a single beam to a mesh object. +* Get the attachment containing the object thumbnail. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] pBeamInfo - contains the node indices, radii and capmodes. -* @param[out] pIndex - filled with the new Index of the beam. +* @param[in] pObject - Object instance. +* @param[out] pAttachment - Instance of the thumbnailattachment object or NULL. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_addbeam(Lib3MF_BeamLattice pBeamLattice, const Lib3MF::sBeam * pBeamInfo, Lib3MF_uint32 * pIndex); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getthumbnailattachment(Lib3MF_Object pObject, Lib3MF_Attachment * pAttachment); /** -* Sets the indices, radii and capmodes of a single beam of a mesh object. +* Clears the attachment. The attachment instance is not removed from the package. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the beam (0 to beamcount - 1). -* @param[in] pBeamInfo - filled with the beam indices, radii and capmodes. +* @param[in] pObject - Object instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setbeam(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const Lib3MF::sBeam * pBeamInfo); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_clearthumbnailattachment(Lib3MF_Object pObject); /** -* Sets all beam indices, radii and capmodes of a mesh object. +* Returns the outbox of a build item * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBeamInfoBufferSize - Number of elements in buffer -* @param[in] pBeamInfoBuffer - Beam buffer of contains information of a number of beams +* @param[in] pObject - Object instance. +* @param[out] pOutbox - Outbox of this build item * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setbeams(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBeamInfoBufferSize, const Lib3MF::sBeam * pBeamInfoBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getoutbox(Lib3MF_Object pObject, Lib3MF::sBox * pOutbox); + +/** +* Retrieves an object's uuid string (see production extension specification) +* +* @param[in] pObject - Object instance. +* @param[out] pHasUUID - flag whether the build item has a UUID +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of returns object uuid., may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getuuid(Lib3MF_Object pObject, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); + +/** +* Sets a build object's uuid string (see production extension specification) +* +* @param[in] pObject - Object instance. +* @param[in] pUUID - new object uuid string. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setuuid(Lib3MF_Object pObject, const char * pUUID); + +/** +* Returns the metadatagroup of this object +* +* @param[in] pObject - Object instance. +* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getmetadatagroup(Lib3MF_Object pObject, Lib3MF_MetaDataGroup * pMetaDataGroup); + +/** +* set the meshresolution of the mesh object +* +* @param[in] pObject - Object instance. +* @param[in] eMeshResolution - meshresolution of this object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_setslicesmeshresolution(Lib3MF_Object pObject, Lib3MF::eSlicesMeshResolution eMeshResolution); + +/** +* get the meshresolution of the mesh object +* +* @param[in] pObject - Object instance. +* @param[out] pMeshResolution - meshresolution of this object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getslicesmeshresolution(Lib3MF_Object pObject, Lib3MF::eSlicesMeshResolution * pMeshResolution); + +/** +* returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack +* +* @param[in] pObject - Object instance. +* @param[in] bRecursive - check also all referenced objects? +* @param[out] pHasSlices - does the object have a slice stack? +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_hasslices(Lib3MF_Object pObject, bool bRecursive, bool * pHasSlices); + +/** +* unlinks the attached slicestack from this object. If no slice stack is attached, do noting. +* +* @param[in] pObject - Object instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_clearslicestack(Lib3MF_Object pObject); + +/** +* get the Slicestack attached to the object +* +* @param[in] pObject - Object instance. +* @param[out] pSliceStackInstance - returns the slicestack instance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_getslicestack(Lib3MF_Object pObject, Lib3MF_SliceStack * pSliceStackInstance); + +/** +* assigns a slicestack to the object +* +* @param[in] pObject - Object instance. +* @param[in] pSliceStackInstance - the new slice stack of this Object +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_object_assignslicestack(Lib3MF_Object pObject, Lib3MF_SliceStack pSliceStackInstance); + +/************************************************************************************************************************* + Class definition for MeshObject +**************************************************************************************************************************/ + +/** +* Returns the vertex count of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pVertexCount - filled with the vertex count. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getvertexcount(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); + +/** +* Returns the triangle count of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pVertexCount - filled with the triangle count. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettrianglecount(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount); + +/** +* Returns the vertex count of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) +* @param[out] pCoordinates - filled with the vertex coordinates. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getvertex(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, Lib3MF::sPosition * pCoordinates); + +/** +* Sets the coordinates of a single vertex of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) +* @param[in] pCoordinates - contains the vertex coordinates. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_setvertex(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const Lib3MF::sPosition * pCoordinates); + +/** +* Adds a single vertex to a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] pCoordinates - contains the vertex coordinates. +* @param[out] pNewIndex - Index of the new vertex +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_addvertex(Lib3MF_MeshObject pMeshObject, const Lib3MF::sPosition * pCoordinates, Lib3MF_uint32 * pNewIndex); + +/** +* Obtains all vertex positions of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pVerticesBuffer - Position buffer of contains the vertex coordinates. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getvertices(Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, Lib3MF::sPosition * pVerticesBuffer); + +/** +* Returns indices of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[out] pIndices - filled with the triangle indices. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettriangle(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, Lib3MF::sTriangle * pIndices); + +/** +* Sets the indices of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[in] pIndices - contains the triangle indices. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_settriangle(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const Lib3MF::sTriangle * pIndices); + +/** +* Adds a single triangle to a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] pIndices - contains the triangle indices. +* @param[out] pNewIndex - Index of the new triangle +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_addtriangle(Lib3MF_MeshObject pMeshObject, const Lib3MF::sTriangle * pIndices, Lib3MF_uint32 * pNewIndex); + +/** +* Get all triangles of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettriangleindices(Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF::sTriangle * pIndicesBuffer); + +/** +* Sets the property at the object-level of the mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nUniqueResourceID - the object-level Property UniqueResourceID. +* @param[in] nPropertyID - the object-level PropertyID. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_setobjectlevelproperty(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nUniqueResourceID, Lib3MF_uint32 nPropertyID); + +/** +* Gets the property at the object-level of the mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pUniqueResourceID - the object-level Property UniqueResourceID. +* @param[out] pPropertyID - the object-level PropertyID. +* @param[out] pHasObjectLevelProperty - Has an object-level property been specified? +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getobjectlevelproperty(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pUniqueResourceID, Lib3MF_uint32 * pPropertyID, bool * pHasObjectLevelProperty); + +/** +* Sets the properties of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[in] pProperties - contains the triangle properties. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_settriangleproperties(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const Lib3MF::sTriangleProperties * pProperties); + +/** +* Gets the properties of a single triangle of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) +* @param[out] pProperty - returns the triangle properties. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_gettriangleproperties(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, Lib3MF::sTriangleProperties * pProperty); + +/** +* Sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer +* @param[in] pPropertiesArrayBuffer - TriangleProperties buffer of contains the triangle properties array. Must have trianglecount elements. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_setalltriangleproperties(Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nPropertiesArrayBufferSize, const Lib3MF::sTriangleProperties * pPropertiesArrayBuffer); + +/** +* Gets the properties of all triangles of a mesh object. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nPropertiesArrayBufferSize - Number of elements in buffer +* @param[out] pPropertiesArrayNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertiesArrayBuffer - TriangleProperties buffer of returns the triangle properties array. Must have trianglecount elements. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_getalltriangleproperties(Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nPropertiesArrayBufferSize, Lib3MF_uint64* pPropertiesArrayNeededCount, Lib3MF::sTriangleProperties * pPropertiesArrayBuffer); + +/** +* Clears all properties of this mesh object (triangle and object-level). +* +* @param[in] pMeshObject - MeshObject instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_clearallproperties(Lib3MF_MeshObject pMeshObject); + +/** +* Set all triangles of a mesh object +* +* @param[in] pMeshObject - MeshObject instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[in] pVerticesBuffer - Position buffer of contains the positions. +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[in] pIndicesBuffer - Triangle buffer of contains the triangle indices. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_setgeometry(Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nVerticesBufferSize, const Lib3MF::sPosition * pVerticesBuffer, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF::sTriangle * pIndicesBuffer); + +/** +* Retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pIsManifoldAndOriented - returns, if the object is oriented and manifold. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_ismanifoldandoriented(Lib3MF_MeshObject pMeshObject, bool * pIsManifoldAndOriented); + +/** +* Retrieves the BeamLattice within this MeshObject. +* +* @param[in] pMeshObject - MeshObject instance. +* @param[out] pTheBeamLattice - the BeamLattice within this MeshObject +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_meshobject_beamlattice(Lib3MF_MeshObject pMeshObject, Lib3MF_BeamLattice * pTheBeamLattice); + +/************************************************************************************************************************* + Class definition for BeamLattice +**************************************************************************************************************************/ + +/** +* Returns the minimal length of beams for the beamlattice. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pMinLength - minimal length of beams for the beamlattice +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getminlength(Lib3MF_BeamLattice pBeamLattice, Lib3MF_double * pMinLength); + +/** +* Sets the minimal length of beams for the beamlattice. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] dMinLength - minimal length of beams for the beamlattice +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setminlength(Lib3MF_BeamLattice pBeamLattice, Lib3MF_double dMinLength); + +/** +* Returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pClipMode - contains the clip mode of this mesh +* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object or an undefined value if pClipMode is MODELBEAMLATTICECLIPMODE_NONE +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getclipping(Lib3MF_BeamLattice pBeamLattice, Lib3MF::eBeamLatticeClipMode * pClipMode, Lib3MF_uint32 * pUniqueResourceID); + +/** +* Sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] eClipMode - contains the clip mode of this mesh +* @param[in] nUniqueResourceID - the UniqueResourceID of the clipping mesh-object. This mesh-object has to be defined before setting the Clipping. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setclipping(Lib3MF_BeamLattice pBeamLattice, Lib3MF::eBeamLatticeClipMode eClipMode, Lib3MF_uint32 nUniqueResourceID); + +/** +* Returns the representation-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pHasRepresentation - flag whether the beamlattice has a representation mesh. +* @param[out] pUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getrepresentation(Lib3MF_BeamLattice pBeamLattice, bool * pHasRepresentation, Lib3MF_uint32 * pUniqueResourceID); + +/** +* Sets the representation-mesh for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nUniqueResourceID - the UniqueResourceID of the representation mesh-object. This mesh-object has to be defined before setting the representation. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setrepresentation(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nUniqueResourceID); + +/** +* Returns the ball mode and the default ball radius for the beamlattice of this mesh. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pBallMode - contains the ball mode of this mesh +* @param[out] pBallRadius - default ball radius of balls for the beamlattice +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getballoptions(Lib3MF_BeamLattice pBeamLattice, Lib3MF::eBeamLatticeBallMode * pBallMode, Lib3MF_double * pBallRadius); + +/** +* Sets the ball mode and thedefault ball radius for the beamlattice. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] eBallMode - contains the ball mode of this mesh +* @param[in] dBallRadius - default ball radius of balls for the beamlattice +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setballoptions(Lib3MF_BeamLattice pBeamLattice, Lib3MF::eBeamLatticeBallMode eBallMode, Lib3MF_double dBallRadius); + +/** +* Returns the beam count of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pCount - filled with the beam count. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeamcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); + +/** +* Returns indices, radii and capmodes of a single beam of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the beam (0 to beamcount - 1). +* @param[out] pBeamInfo - filled with the beam indices, radii and capmodes. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeam(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF::sBeam * pBeamInfo); + +/** +* Adds a single beam to a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] pBeamInfo - contains the node indices, radii and capmodes. +* @param[out] pIndex - filled with the new Index of the beam. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_addbeam(Lib3MF_BeamLattice pBeamLattice, const Lib3MF::sBeam * pBeamInfo, Lib3MF_uint32 * pIndex); + +/** +* Sets the indices, radii and capmodes of a single beam of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the beam (0 to beamcount - 1). +* @param[in] pBeamInfo - filled with the beam indices, radii and capmodes. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setbeam(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const Lib3MF::sBeam * pBeamInfo); + +/** +* Sets all beam indices, radii and capmodes of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBeamInfoBufferSize - Number of elements in buffer +* @param[in] pBeamInfoBuffer - Beam buffer of contains information of a number of beams +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setbeams(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBeamInfoBufferSize, const Lib3MF::sBeam * pBeamInfoBuffer); + +/** +* obtains all beam indices, radii and capmodes of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBeamInfoBufferSize - Number of elements in buffer +* @param[out] pBeamInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBeamInfoBuffer - Beam buffer of contains information of all beams +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeams(Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBeamInfoBufferSize, Lib3MF_uint64* pBeamInfoNeededCount, Lib3MF::sBeam * pBeamInfoBuffer); + +/** +* Returns the ball count of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pCount - filled with the ball count. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getballcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); + +/** +* Returns index and radius of a single ball of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the ball (0 to ballcount - 1). +* @param[out] pBallInfo - filled with the ball node index and radius. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getball(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF::sBall * pBallInfo); + +/** +* Adds a single ball to a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] pBallInfo - contains the node index and radius. +* @param[out] pIndex - filled with the new Index of the ball. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_addball(Lib3MF_BeamLattice pBeamLattice, const Lib3MF::sBall * pBallInfo, Lib3MF_uint32 * pIndex); + +/** +* Sets the index and radius of a single ball of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - Index of the ball (0 to ballcount - 1). +* @param[in] pBallInfo - filled with the ball node index and radius. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setball(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const Lib3MF::sBall * pBallInfo); + +/** +* Sets all ball indices and radii of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBallInfoBufferSize - Number of elements in buffer +* @param[in] pBallInfoBuffer - Ball buffer of contains information of a number of balls +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setballs(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBallInfoBufferSize, const Lib3MF::sBall * pBallInfoBuffer); + +/** +* obtains all ball indices and radii of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nBallInfoBufferSize - Number of elements in buffer +* @param[out] pBallInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBallInfoBuffer - Ball buffer of contains information of all balls +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getballs(Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBallInfoBufferSize, Lib3MF_uint64* pBallInfoNeededCount, Lib3MF::sBall * pBallInfoBuffer); + +/** +* Returns the number of beamsets of a mesh object. +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pCount - filled with the beamset count. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeamsetcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); + +/** +* Adds an empty beamset to a mesh object +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[out] pBeamSet - the new beamset +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_addbeamset(Lib3MF_BeamLattice pBeamLattice, Lib3MF_BeamSet * pBeamSet); + +/** +* Returns a beamset of a mesh object +* +* @param[in] pBeamLattice - BeamLattice instance. +* @param[in] nIndex - index of the requested beamset (0 ... beamsetcount-1). +* @param[out] pBeamSet - the requested beamset +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeamset(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF_BeamSet * pBeamSet); + +/************************************************************************************************************************* + Class definition for Component +**************************************************************************************************************************/ + +/** +* Returns the Resource Instance of the component. +* +* @param[in] pComponent - Component instance. +* @param[out] pObjectResource - filled with the Resource Instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_getobjectresource(Lib3MF_Component pComponent, Lib3MF_Object * pObjectResource); + +/** +* Returns the UniqueResourceID of the component. +* +* @param[in] pComponent - Component instance. +* @param[out] pUniqueResourceID - returns the UniqueResourceID. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_getobjectresourceid(Lib3MF_Component pComponent, Lib3MF_uint32 * pUniqueResourceID); + +/** +* returns, whether a component has a UUID and, if true, the component's UUID +* +* @param[in] pComponent - Component instance. +* @param[out] pHasUUID - flag whether the component has a UUID +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_getuuid(Lib3MF_Component pComponent, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); + +/** +* sets the component's UUID +* +* @param[in] pComponent - Component instance. +* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_setuuid(Lib3MF_Component pComponent, const char * pUUID); + +/** +* Returns, if the component has a different transformation than the identity matrix +* +* @param[in] pComponent - Component instance. +* @param[out] pHasTransform - if true is returned, the transformation is not equal than the identity +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_hastransform(Lib3MF_Component pComponent, bool * pHasTransform); + +/** +* Returns the transformation matrix of the component. +* +* @param[in] pComponent - Component instance. +* @param[out] pTransform - filled with the component transformation matrix +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_gettransform(Lib3MF_Component pComponent, Lib3MF::sTransform * pTransform); + +/** +* Sets the transformation matrix of the component. +* +* @param[in] pComponent - Component instance. +* @param[in] pTransform - new transformation matrix +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_settransform(Lib3MF_Component pComponent, const Lib3MF::sTransform * pTransform); + +/************************************************************************************************************************* + Class definition for ComponentsObject +**************************************************************************************************************************/ + +/** +* Adds a new component to a components object. +* +* @param[in] pComponentsObject - ComponentsObject instance. +* @param[in] pObjectResource - object to add as component. Must not lead to circular references! +* @param[in] pTransform - optional transform matrix for the component. +* @param[out] pComponentInstance - new component instance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobject_addcomponent(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_Object pObjectResource, const Lib3MF::sTransform * pTransform, Lib3MF_Component * pComponentInstance); + +/** +* Retrieves a component from a component object. +* +* @param[in] pComponentsObject - ComponentsObject instance. +* @param[in] nIndex - index of the component to retrieve (0 to componentcount - 1) +* @param[out] pComponentInstance - component instance +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobject_getcomponent(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 nIndex, Lib3MF_Component * pComponentInstance); + +/** +* Retrieves a component count of a component object. +* +* @param[in] pComponentsObject - ComponentsObject instance. +* @param[out] pCount - returns the component count +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobject_getcomponentcount(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 * pCount); + +/************************************************************************************************************************* + Class definition for BeamSet +**************************************************************************************************************************/ + +/** +* Sets a beamset's name string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] pName - new name of the beamset. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_setname(Lib3MF_BeamSet pBeamSet, const char * pName); + +/** +* Retrieves a beamset's name string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the beamset., may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getname(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); + +/** +* Sets a beamset's identifier string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] pIdentifier - new name of the beamset. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_setidentifier(Lib3MF_BeamSet pBeamSet, const char * pIdentifier); + +/** +* Retrieves a beamset's identifier string +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nIdentifierBufferSize - size of the buffer (including trailing 0) +* @param[out] pIdentifierNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pIdentifierBuffer - buffer of returns the identifier of the beamset., may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getidentifier(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer); + +/** +* Retrieves the reference count of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[out] pCount - returns the reference count +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getreferencecount(Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); + +/** +* Sets the references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nReferencesBufferSize - Number of elements in buffer +* @param[in] pReferencesBuffer - uint32 buffer of the new indices of all beams in this beamset +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_setreferences(Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nReferencesBufferSize, const Lib3MF_uint32 * pReferencesBuffer); + +/** +* Retrieves the references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nReferencesBufferSize - Number of elements in buffer +* @param[out] pReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pReferencesBuffer - uint32 buffer of retrieves the indices of all beams in this beamset +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getreferences(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nReferencesBufferSize, Lib3MF_uint64* pReferencesNeededCount, Lib3MF_uint32 * pReferencesBuffer); + +/** +* Retrieves the ball reference count of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[out] pCount - returns the ball reference count +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getballreferencecount(Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); + +/** +* Sets the ball references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nBallReferencesBufferSize - Number of elements in buffer +* @param[in] pBallReferencesBuffer - uint32 buffer of the new indices of all balls in this beamset +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_setballreferences(Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nBallReferencesBufferSize, const Lib3MF_uint32 * pBallReferencesBuffer); + +/** +* Retrieves the ball references of a beamset +* +* @param[in] pBeamSet - BeamSet instance. +* @param[in] nBallReferencesBufferSize - Number of elements in buffer +* @param[out] pBallReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBallReferencesBuffer - uint32 buffer of retrieves the indices of all balls in this beamset +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getballreferences(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nBallReferencesBufferSize, Lib3MF_uint64* pBallReferencesNeededCount, Lib3MF_uint32 * pBallReferencesBuffer); + +/************************************************************************************************************************* + Class definition for BaseMaterialGroup +**************************************************************************************************************************/ + +/** +* Retrieves the count of base materials in the material group. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[out] pCount - returns the count of base materials. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_getcount(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all materials in this group +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the material in the material group. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_getallpropertyids(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Adds a new material to the material group +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] pName - new name of the base material. +* @param[in] pDisplayColor - Display color of the material +* @param[out] pPropertyID - returns new PropertyID of the new material in the material group. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_addmaterial(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const char * pName, const Lib3MF::sColor * pDisplayColor, Lib3MF_uint32 * pPropertyID); + +/** +* Removes a material from the material group. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_removematerial(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID); + +/** +* Returns the base material's name +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of returns the name of the base material., may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_getname(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); + +/** +* Sets a base material's name +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] pName - new name of the base material. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_setname(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const char * pName); + +/** +* Sets a base material's display color. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] pTheColor - The base material's display color +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_setdisplaycolor(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF::sColor * pTheColor); + +/** +* Returns a base material's display color. +* +* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. +* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[out] pTheColor - The base material's display color +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_getdisplaycolor(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, Lib3MF::sColor * pTheColor); + +/************************************************************************************************************************* + Class definition for ColorGroup +**************************************************************************************************************************/ + +/** +* Retrieves the count of base materials in this Color Group. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[out] pCount - returns the count of colors within this color group. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_getcount(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all colors within this group +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the color in the color group. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_getallpropertyids(Lib3MF_ColorGroup pColorGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Adds a new value. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] pTheColor - The new color +* @param[out] pPropertyID - PropertyID of the new color within this color group. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_addcolor(Lib3MF_ColorGroup pColorGroup, const Lib3MF::sColor * pTheColor, Lib3MF_uint32 * pPropertyID); + +/** +* Removes a color from the color group. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyID - PropertyID of the color to be removed from the color group. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_removecolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID); + +/** +* Sets a color value. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyID - PropertyID of a color within this color group. +* @param[in] pTheColor - The color +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_setcolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, const Lib3MF::sColor * pTheColor); + +/** +* Sets a color value. +* +* @param[in] pColorGroup - ColorGroup instance. +* @param[in] nPropertyID - PropertyID of a color within this color group. +* @param[out] pTheColor - The color +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_getcolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, Lib3MF::sColor * pTheColor); + +/************************************************************************************************************************* + Class definition for Texture2DGroup +**************************************************************************************************************************/ + +/** +* Retrieves the count of tex2coords in the Texture2DGroup. +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[out] pCount - returns the count of tex2coords. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_getcount(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all tex2coords in this Texture2DGroup +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the tex2coords in the Texture2DGroup. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_getallpropertyids(Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Adds a new tex2coord to the Texture2DGroup +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. +* @param[out] pPropertyID - returns new PropertyID of the new tex2coord in the Texture2DGroup. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_addtex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF::sTex2Coord * pUVCoordinate, Lib3MF_uint32 * pPropertyID); + +/** +* Obtains a tex2coord to the Texture2DGroup +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] nPropertyID - the PropertyID of the tex2coord in the Texture2DGroup. +* @param[out] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_gettex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID, Lib3MF::sTex2Coord * pUVCoordinate); + +/** +* Removes a tex2coords from the Texture2DGroup. +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[in] nPropertyID - PropertyID of the tex2coords in the Texture2DGroup. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_removetex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID); + +/** +* Obtains the texture2D instance of this group. +* +* @param[in] pTexture2DGroup - Texture2DGroup instance. +* @param[out] pTexture2DInstance - the texture2D instance of this group. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_gettexture2d(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_Texture2D * pTexture2DInstance); + +/************************************************************************************************************************* + Class definition for CompositeMaterials +**************************************************************************************************************************/ + +/** +* Retrieves the count of Composite-s in the CompositeMaterials. +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[out] pCount - returns the count of Composite-s +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_getcount(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 * pCount); + +/** +* returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the Composite-Mixing Values in the CompositeMaterials. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_getallpropertyids(Lib3MF_CompositeMaterials pCompositeMaterials, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Obtains the BaseMaterialGroup instance of this CompositeMaterials. +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[out] pBaseMaterialGroupInstance - returns the BaseMaterialGroup instance of this CompositeMaterials +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_getbasematerialgroup(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance); + +/** +* Adds a new Composite-Mixing Values to the CompositeMaterials. +* +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nCompositeBufferSize - Number of elements in buffer +* @param[in] pCompositeBuffer - CompositeConstituent buffer of The Composite Constituents to be added as composite +* @param[out] pPropertyID - returns new PropertyID of the new Composite in the CompositeMaterials. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_addcomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint64 nCompositeBufferSize, const Lib3MF::sCompositeConstituent * pCompositeBuffer, Lib3MF_uint32 * pPropertyID); /** -* obtains all beam indices, radii and capmodes of a mesh object. +* Removes a Composite-Maxing Ratio from the CompositeMaterials. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBeamInfoBufferSize - Number of elements in buffer -* @param[out] pBeamInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBeamInfoBuffer - Beam buffer of contains information of all beams +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nPropertyID - PropertyID of the Composite-Mixing Values in the CompositeMaterials to be removed. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeams(Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBeamInfoBufferSize, Lib3MF_uint64* pBeamInfoNeededCount, Lib3MF::sBeam * pBeamInfoBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_removecomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID); /** -* Returns the ball count of a mesh object. +* Obtains a Composite-Maxing Ratio of this CompositeMaterials. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pCount - filled with the ball count. +* @param[in] pCompositeMaterials - CompositeMaterials instance. +* @param[in] nPropertyID - the PropertyID of the Composite-Maxing Ratio in the CompositeMaterials. +* @param[in] nCompositeBufferSize - Number of elements in buffer +* @param[out] pCompositeNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pCompositeBuffer - CompositeConstituent buffer of The Composite-Mixing Values with the given PropertyID * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getballcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_getcomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nCompositeBufferSize, Lib3MF_uint64* pCompositeNeededCount, Lib3MF::sCompositeConstituent * pCompositeBuffer); + +/************************************************************************************************************************* + Class definition for MultiPropertyGroup +**************************************************************************************************************************/ /** -* Returns index and radius of a single ball of a mesh object. +* Retrieves the count of MultiProperty-s in the MultiPropertyGroup. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the ball (0 to ballcount - 1). -* @param[out] pBallInfo - filled with the ball node index and radius. +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[out] pCount - returns the count of MultiProperty-s * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getball(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF::sBall * pBallInfo); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getcount(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); /** -* Adds a single ball to a mesh object. +* returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] pBallInfo - contains the node index and radius. -* @param[out] pIndex - filled with the new Index of the ball. +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the MultiProperty-s in the MultiPropertyGroup. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_addball(Lib3MF_BeamLattice pBeamLattice, const Lib3MF::sBall * pBallInfo, Lib3MF_uint32 * pIndex); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getallpropertyids(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); /** -* Sets the index and radius of a single ball of a mesh object. +* Adds a new MultiProperty to the MultiPropertyGroup. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - Index of the ball (0 to ballcount - 1). -* @param[in] pBallInfo - filled with the ball node index and radius. +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[in] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the new MultiProperty. +* @param[out] pPropertyID - returns the PropertyID of the new MultiProperty in the MultiPropertyGroup. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setball(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const Lib3MF::sBall * pBallInfo); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_addmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer, Lib3MF_uint32 * pPropertyID); /** -* Sets all ball indices and radii of a mesh object. +* Sets the PropertyIDs of a MultiProperty. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBallInfoBufferSize - Number of elements in buffer -* @param[in] pBallInfoBuffer - Ball buffer of contains information of a number of balls +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyID - the PropertyID of the MultiProperty to be changed. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[in] pPropertyIDsBuffer - uint32 buffer of The new PropertyIDs of the MultiProperty * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_setballs(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBallInfoBufferSize, const Lib3MF::sBall * pBallInfoBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_setmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer); /** -* obtains all ball indices and radii of a mesh object. +* Obtains the PropertyIDs of a MultiProperty. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nBallInfoBufferSize - Number of elements in buffer -* @param[out] pBallInfoNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBallInfoBuffer - Ball buffer of contains information of all balls +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyID - the PropertyID of the MultiProperty to be queried. +* @param[in] nPropertyIDsBufferSize - Number of elements in buffer +* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the MultiProperty +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); + +/** +* Removes a MultiProperty from this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nPropertyID - the PropertyID of the MultiProperty to be removed. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_removemultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID); + +/** +* Retrieves the number of layers of this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[out] pCount - returns the number of layers +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getlayercount(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); + +/** +* Adds a MultiPropertyLayer to this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] pTheLayer - The MultiPropertyLayer to add to this MultiPropertyGroup +* @param[out] pLayerIndex - returns the index of this MultiPropertyLayer +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_addlayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF::sMultiPropertyLayer * pTheLayer, Lib3MF_uint32 * pLayerIndex); + +/** +* Obtains a MultiPropertyLayer of this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nLayerIndex - The Index of the MultiPropertyLayer queried +* @param[out] pTheLayer - The MultiPropertyLayer with index LayerIndex within MultiPropertyGroup +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getlayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex, Lib3MF::sMultiPropertyLayer * pTheLayer); + +/** +* Removes a MultiPropertyLayer from this MultiPropertyGroup. +* +* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. +* @param[in] nLayerIndex - The Index of the MultiPropertyLayer to be removed +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_removelayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex); + +/************************************************************************************************************************* + Class definition for Attachment +**************************************************************************************************************************/ + +/** +* Retrieves an attachment's package path. This function will be removed in a later release. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of returns the attachment's package path string, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_getpath(Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Sets an attachment's package path. This function will be removed in a later release. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pPath - new path of the attachment. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_setpath(Lib3MF_Attachment pAttachment, const char * pPath); + +/** +* Returns the PackagePart that is this attachment. +* +* @param[in] pAttachment - Attachment instance. +* @param[out] pPackagePart - The PackagePart of this attachment. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_packagepart(Lib3MF_Attachment pAttachment, Lib3MF_PackagePart * pPackagePart); + +/** +* Retrieves an attachment's relationship type +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of returns the attachment's package relationship type string, may be NULL +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_getrelationshiptype(Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); + +/** +* Sets an attachment's relationship type. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pPath - new relationship type string. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_setrelationshiptype(Lib3MF_Attachment pAttachment, const char * pPath); + +/** +* Writes out the attachment as file. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pFileName - file to write into. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_writetofile(Lib3MF_Attachment pAttachment, const char * pFileName); + +/** +* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pFileName - file to read from. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_readfromfile(Lib3MF_Attachment pAttachment, const char * pFileName); + +/** +* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* +* @param[in] pAttachment - Attachment instance. +* @param[in] pTheReadCallback - Callback to call for reading a data chunk +* @param[in] nStreamSize - number of bytes the callback returns +* @param[in] pTheSeekCallback - Callback to call for seeking in the stream. +* @param[in] pUserData - Userdata that is passed to the callback function +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_readfromcallback(Lib3MF_Attachment pAttachment, Lib3MF::ReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MF::SeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData); + +/** +* Retrieves the size of the attachment stream +* +* @param[in] pAttachment - Attachment instance. +* @param[out] pStreamSize - the stream size +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_getstreamsize(Lib3MF_Attachment pAttachment, Lib3MF_uint64 * pStreamSize); + +/** +* Writes out the attachment into a buffer +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nBufferBufferSize - Number of elements in buffer +* @param[out] pBufferNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pBufferBuffer - uint8 buffer of Buffer to write into +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_writetobuffer(Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer); + +/** +* Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). +* +* @param[in] pAttachment - Attachment instance. +* @param[in] nBufferBufferSize - Number of elements in buffer +* @param[in] pBufferBuffer - uint8 buffer of Buffer to read from +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_readfrombuffer(Lib3MF_Attachment pAttachment, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer); + +/************************************************************************************************************************* + Class definition for Texture2D +**************************************************************************************************************************/ + +/** +* Retrieves the attachment located at the path of the texture. +* +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pAttachment - attachment that holds the texture's image information. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getballs(Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBallInfoBufferSize, Lib3MF_uint64* pBallInfoNeededCount, Lib3MF::sBall * pBallInfoBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_getattachment(Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment * pAttachment); /** -* Returns the number of beamsets of a mesh object. +* Sets the texture's package path to the path of the attachment. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pCount - filled with the beamset count. +* @param[in] pTexture2D - Texture2D instance. +* @param[in] pAttachment - attachment that holds the texture's image information. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeamsetcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_setattachment(Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment pAttachment); /** -* Adds an empty beamset to a mesh object +* Retrieves a texture's content type. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[out] pBeamSet - the new beamset +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pContentType - returns content type enum. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_addbeamset(Lib3MF_BeamLattice pBeamLattice, Lib3MF_BeamSet * pBeamSet); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_getcontenttype(Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureType * pContentType); /** -* Returns a beamset of a mesh object +* Retrieves a texture's content type. * -* @param[in] pBeamLattice - BeamLattice instance. -* @param[in] nIndex - index of the requested beamset (0 ... beamsetcount-1). -* @param[out] pBeamSet - the requested beamset +* @param[in] pTexture2D - Texture2D instance. +* @param[in] eContentType - new Content Type * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamlattice_getbeamset(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF_BeamSet * pBeamSet); - -/************************************************************************************************************************* - Class definition for Component -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_setcontenttype(Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureType eContentType); /** -* Returns the Resource Instance of the component. +* Retrieves a texture's tilestyle type. * -* @param[in] pComponent - Component instance. -* @param[out] pObjectResource - filled with the Resource Instance. +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pTileStyleU - returns tilestyle type enum. +* @param[out] pTileStyleV - returns tilestyle type enum. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_getobjectresource(Lib3MF_Component pComponent, Lib3MF_Object * pObjectResource); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_gettilestyleuv(Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureTileStyle * pTileStyleU, Lib3MF::eTextureTileStyle * pTileStyleV); /** -* Returns the UniqueResourceID of the component. +* Sets a texture's tilestyle type. * -* @param[in] pComponent - Component instance. -* @param[out] pUniqueResourceID - returns the UniqueResourceID. +* @param[in] pTexture2D - Texture2D instance. +* @param[in] eTileStyleU - new tilestyle type enum. +* @param[in] eTileStyleV - new tilestyle type enum. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_getobjectresourceid(Lib3MF_Component pComponent, Lib3MF_uint32 * pUniqueResourceID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_settilestyleuv(Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureTileStyle eTileStyleU, Lib3MF::eTextureTileStyle eTileStyleV); /** -* returns, whether a component has a UUID and, if true, the component's UUID +* Retrieves a texture's filter type. * -* @param[in] pComponent - Component instance. -* @param[out] pHasUUID - flag whether the component has a UUID -* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL +* @param[in] pTexture2D - Texture2D instance. +* @param[out] pFilter - returns filter type enum. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_getuuid(Lib3MF_Component pComponent, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_getfilter(Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureFilter * pFilter); /** -* sets the component's UUID +* Sets a texture's filter type. * -* @param[in] pComponent - Component instance. -* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' +* @param[in] pTexture2D - Texture2D instance. +* @param[in] eFilter - sets new filter type enum. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_setuuid(Lib3MF_Component pComponent, const char * pUUID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_setfilter(Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureFilter eFilter); + +/************************************************************************************************************************* + Class definition for BuildItem +**************************************************************************************************************************/ /** -* Returns, if the component has a different transformation than the identity matrix +* Retrieves the object resource associated to a build item * -* @param[in] pComponent - Component instance. -* @param[out] pHasTransform - if true is returned, the transformation is not equal than the identity +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pObjectResource - returns the associated resource instance * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_hastransform(Lib3MF_Component pComponent, bool * pHasTransform); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getobjectresource(Lib3MF_BuildItem pBuildItem, Lib3MF_Object * pObjectResource); /** -* Returns the transformation matrix of the component. +* returns, whether a build item has a UUID and, if true, the build item's UUID * -* @param[in] pComponent - Component instance. -* @param[out] pTransform - filled with the component transformation matrix +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pHasUUID - flag whether the build item has a UUID +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_gettransform(Lib3MF_Component pComponent, Lib3MF::sTransform * pTransform); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getuuid(Lib3MF_BuildItem pBuildItem, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* Sets the transformation matrix of the component. +* sets the build item's UUID * -* @param[in] pComponent - Component instance. -* @param[in] pTransform - new transformation matrix +* @param[in] pBuildItem - BuildItem instance. +* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_component_settransform(Lib3MF_Component pComponent, const Lib3MF::sTransform * pTransform); - -/************************************************************************************************************************* - Class definition for ComponentsObject -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_setuuid(Lib3MF_BuildItem pBuildItem, const char * pUUID); /** -* Adds a new component to a components object. +* Retrieves the object UniqueResourceID associated to a build item * -* @param[in] pComponentsObject - ComponentsObject instance. -* @param[in] pObjectResource - object to add as component. Must not lead to circular references! -* @param[in] pTransform - optional transform matrix for the component. -* @param[out] pComponentInstance - new component instance +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pUniqueResourceID - returns the UniqueResourceID of the object * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobject_addcomponent(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_Object pObjectResource, const Lib3MF::sTransform * pTransform, Lib3MF_Component * pComponentInstance); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getobjectresourceid(Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pUniqueResourceID); /** -* Retrieves a component from a component object. +* Checks, if a build item has a non-identity transformation matrix * -* @param[in] pComponentsObject - ComponentsObject instance. -* @param[in] nIndex - index of the component to retrieve (0 to componentcount - 1) -* @param[out] pComponentInstance - component instance +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pHasTransform - returns true, if the transformation matrix is not the identity * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobject_getcomponent(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 nIndex, Lib3MF_Component * pComponentInstance); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_hasobjecttransform(Lib3MF_BuildItem pBuildItem, bool * pHasTransform); /** -* Retrieves a component count of a component object. +* Retrieves a build item's transformation matrix. * -* @param[in] pComponentsObject - ComponentsObject instance. -* @param[out] pCount - returns the component count +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pTransform - returns the transformation matrix * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_componentsobject_getcomponentcount(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 * pCount); - -/************************************************************************************************************************* - Class definition for BeamSet -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getobjecttransform(Lib3MF_BuildItem pBuildItem, Lib3MF::sTransform * pTransform); /** -* Sets a beamset's name string +* Sets a build item's transformation matrix. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] pName - new name of the beamset. +* @param[in] pBuildItem - BuildItem instance. +* @param[in] pTransform - new transformation matrix * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_setname(Lib3MF_BeamSet pBeamSet, const char * pName); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_setobjecttransform(Lib3MF_BuildItem pBuildItem, const Lib3MF::sTransform * pTransform); /** -* Retrieves a beamset's name string +* Retrieves a build item's part number string * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of returns the name of the beamset., may be NULL +* @param[in] pBuildItem - BuildItem instance. +* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartNumberBuffer - buffer of Returns a build item's part number string, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getname(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getpartnumber(Lib3MF_BuildItem pBuildItem, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); /** -* Sets a beamset's identifier string +* Sets a build item's part number string * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] pIdentifier - new name of the beamset. +* @param[in] pBuildItem - BuildItem instance. +* @param[in] pSetPartnumber - new part number string for referencing parts from the outside world * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_setidentifier(Lib3MF_BeamSet pBeamSet, const char * pIdentifier); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_setpartnumber(Lib3MF_BuildItem pBuildItem, const char * pSetPartnumber); /** -* Retrieves a beamset's identifier string +* Returns the metadatagroup of this build item * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nIdentifierBufferSize - size of the buffer (including trailing 0) -* @param[out] pIdentifierNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pIdentifierBuffer - buffer of returns the identifier of the beamset., may be NULL +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this build item * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getidentifier(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getmetadatagroup(Lib3MF_BuildItem pBuildItem, Lib3MF_MetaDataGroup * pMetaDataGroup); /** -* Retrieves the reference count of a beamset +* Returns the outbox of a build item * -* @param[in] pBeamSet - BeamSet instance. -* @param[out] pCount - returns the reference count +* @param[in] pBuildItem - BuildItem instance. +* @param[out] pOutbox - Outbox of this build item * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getreferencecount(Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getoutbox(Lib3MF_BuildItem pBuildItem, Lib3MF::sBox * pOutbox); + +/************************************************************************************************************************* + Class definition for BuildItemIterator +**************************************************************************************************************************/ /** -* Sets the references of a beamset +* Iterates to the next build item in the list. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nReferencesBufferSize - Number of elements in buffer -* @param[in] pReferencesBuffer - uint32 buffer of the new indices of all beams in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pHasNext - Iterates to the next build item in the list. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_setreferences(Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nReferencesBufferSize, const Lib3MF_uint32 * pReferencesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_movenext(Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasNext); /** -* Retrieves the references of a beamset +* Iterates to the previous build item in the list. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nReferencesBufferSize - Number of elements in buffer -* @param[out] pReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pReferencesBuffer - uint32 buffer of retrieves the indices of all beams in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pHasPrevious - Iterates to the previous build item in the list. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getreferences(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nReferencesBufferSize, Lib3MF_uint64* pReferencesNeededCount, Lib3MF_uint32 * pReferencesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_moveprevious(Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasPrevious); /** -* Retrieves the ball reference count of a beamset +* Returns the build item the iterator points at. * -* @param[in] pBeamSet - BeamSet instance. -* @param[out] pCount - returns the ball reference count +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pBuildItem - returns the build item instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getballreferencecount(Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_getcurrent(Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItem * pBuildItem); /** -* Sets the ball references of a beamset +* Creates a new build item iterator with the same build item list. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nBallReferencesBufferSize - Number of elements in buffer -* @param[in] pBallReferencesBuffer - uint32 buffer of the new indices of all balls in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pOutBuildItemIterator - returns the cloned Iterator instance * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_setballreferences(Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nBallReferencesBufferSize, const Lib3MF_uint32 * pBallReferencesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_clone(Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItemIterator * pOutBuildItemIterator); /** -* Retrieves the ball references of a beamset +* Returns the number of build items the iterator captures. * -* @param[in] pBeamSet - BeamSet instance. -* @param[in] nBallReferencesBufferSize - Number of elements in buffer -* @param[out] pBallReferencesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBallReferencesBuffer - uint32 buffer of retrieves the indices of all balls in this beamset +* @param[in] pBuildItemIterator - BuildItemIterator instance. +* @param[out] pCount - returns the number of build items the iterator captures. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_beamset_getballreferences(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nBallReferencesBufferSize, Lib3MF_uint64* pBallReferencesNeededCount, Lib3MF_uint32 * pBallReferencesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_count(Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_uint64 * pCount); /************************************************************************************************************************* - Class definition for BaseMaterialGroup + Class definition for Slice **************************************************************************************************************************/ /** -* Retrieves the count of base materials in the material group. +* Set all vertices of a slice. All polygons will be cleared. * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[out] pCount - returns the count of base materials. +* @param[in] pSlice - Slice instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[in] pVerticesBuffer - Position2D buffer of contains the positions. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_getcount(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_setvertices(Lib3MF_Slice pSlice, Lib3MF_uint64 nVerticesBufferSize, const Lib3MF::sPosition2D * pVerticesBuffer); /** -* returns all the PropertyIDs of all materials in this group +* Get all vertices of a slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the material in the material group. +* @param[in] pSlice - Slice instance. +* @param[in] nVerticesBufferSize - Number of elements in buffer +* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pVerticesBuffer - Position2D buffer of contains the positions. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getvertices(Lib3MF_Slice pSlice, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, Lib3MF::sPosition2D * pVerticesBuffer); + +/** +* Get the number of vertices in a slice +* +* @param[in] pSlice - Slice instance. +* @param[out] pCount - the number of vertices in the slice * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_getallpropertyids(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getvertexcount(Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); /** -* Adds a new material to the material group +* Add a new polygon to this slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] pName - new name of the base material. -* @param[in] pDisplayColor - Display color of the material -* @param[out] pPropertyID - returns new PropertyID of the new material in the material group. +* @param[in] pSlice - Slice instance. +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the new polygon +* @param[out] pIndex - the index of the new polygon * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_addmaterial(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const char * pName, const Lib3MF::sColor * pDisplayColor, Lib3MF_uint32 * pPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_addpolygon(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer, Lib3MF_uint64 * pIndex); /** -* Removes a material from the material group. +* Get the number of polygons in the slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. +* @param[in] pSlice - Slice instance. +* @param[out] pCount - the number of polygons in the slice * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_removematerial(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getpolygoncount(Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); /** -* Returns the base material's name +* Set all indices of a polygon * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of returns the name of the base material., may be NULL +* @param[in] pSlice - Slice instance. +* @param[in] nIndex - the index of the polygon to manipulate +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the index-th polygon * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_getname(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_setpolygonindices(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer); /** -* Sets a base material's name +* Get all vertices of a slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[in] pName - new name of the base material. +* @param[in] pSlice - Slice instance. +* @param[in] nIndex - the index of the polygon to manipulate +* @param[in] nIndicesBufferSize - Number of elements in buffer +* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pIndicesBuffer - uint32 buffer of the indices of the index-th polygon * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_setname(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const char * pName); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getpolygonindices(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF_uint32 * pIndicesBuffer); /** -* Sets a base material's display color. +* Get the number of vertices in a slice * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[in] pTheColor - The base material's display color +* @param[in] pSlice - Slice instance. +* @param[in] nIndex - the index of the polygon to manipulate +* @param[out] pCount - the number of indices of the index-th polygon * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_setdisplaycolor(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF::sColor * pTheColor); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getpolygonindexcount(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 * pCount); /** -* Returns a base material's display color. +* Get the upper Z-Coordinate of this slice. * -* @param[in] pBaseMaterialGroup - BaseMaterialGroup instance. -* @param[in] nPropertyID - PropertyID of the material in the material group. -* @param[out] pTheColor - The base material's display color +* @param[in] pSlice - Slice instance. +* @param[out] pZTop - the upper Z-Coordinate of this slice * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_basematerialgroup_getdisplaycolor(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, Lib3MF::sColor * pTheColor); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getztop(Lib3MF_Slice pSlice, Lib3MF_double * pZTop); /************************************************************************************************************************* - Class definition for ColorGroup + Class definition for ToolpathProfile **************************************************************************************************************************/ /** -* Retrieves the count of base materials in this Color Group. +* Retrieves the profile's uuid * -* @param[in] pColorGroup - ColorGroup instance. -* @param[out] pCount - returns the count of colors within this color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_getcount(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getuuid(Lib3MF_ToolpathProfile pToolpathProfile, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* returns all the PropertyIDs of all colors within this group +* Retrieves the profile's name * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the color in the color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of Returns the name., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_getallpropertyids(Lib3MF_ColorGroup pColorGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getname(Lib3MF_ToolpathProfile pToolpathProfile, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Adds a new value. +* Returns the number of parameters. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] pTheColor - The new color -* @param[out] pPropertyID - PropertyID of the new color within this color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[out] pCount - Returns the number of parameters. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_addcolor(Lib3MF_ColorGroup pColorGroup, const Lib3MF::sColor * pTheColor, Lib3MF_uint32 * pPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparametercount(Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 * pCount); /** -* Removes a color from the color group. +* Returns the Name of a parameter. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyID - PropertyID of the color to be removed from the color group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nIndex - Index of Parameter (0-based). Call will fail if an invalid index is given. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of Returns the name of the parameter., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_removecolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparametername(Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer); /** -* Sets a color value. +* Returns the NameSpace of a parameter. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyID - PropertyID of a color within this color group. -* @param[in] pTheColor - The color +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] nIndex - Index of Parameter (0-based). Call will fail if an invalid index is given. +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of Returns the namespace of the parameter., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_setcolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, const Lib3MF::sColor * pTheColor); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparameternamespace(Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer); /** -* Sets a color value. +* Checks if a parameter value exists. * -* @param[in] pColorGroup - ColorGroup instance. -* @param[in] nPropertyID - PropertyID of a color within this color group. -* @param[out] pTheColor - The color +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValueExists - Returns if a value exists. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_colorgroup_getcolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, Lib3MF::sColor * pTheColor); - -/************************************************************************************************************************* - Class definition for Texture2DGroup -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_hasparametervalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool * pValueExists); /** -* Retrieves the count of tex2coords in the Texture2DGroup. +* Retrieves a profile's parameter value. Fails if value does not exist. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[out] pCount - returns the count of tex2coords. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of Returns the value of the field., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_getcount(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparametervalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* returns all the PropertyIDs of all tex2coords in this Texture2DGroup +* Retrieves a profile's parameter value * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the tex2coords in the Texture2DGroup. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] pDefaultValue - Default value if value does not exist. +* @param[in] nValueBufferSize - size of the buffer (including trailing 0) +* @param[out] pValueNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pValueBuffer - buffer of Returns the value of the field., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_getallpropertyids(Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparametervaluedef(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const char * pDefaultValue, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer); /** -* Adds a new tex2coord to the Texture2DGroup +* Retrieves a profile's parameter value as double. Fails if value does not exist or is not a double value. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. -* @param[out] pPropertyID - returns new PropertyID of the new tex2coord in the Texture2DGroup. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_addtex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF::sTex2Coord * pUVCoordinate, Lib3MF_uint32 * pPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparameterdoublevalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double * pValue); /** -* Obtains a tex2coord to the Texture2DGroup +* Retrieves a profile's parameter value as double. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] nPropertyID - the PropertyID of the tex2coord in the Texture2DGroup. -* @param[out] pUVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] dDefaultValue - Default value if value does not exist or is not a double value. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_gettex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID, Lib3MF::sTex2Coord * pUVCoordinate); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparameterdoublevaluedef(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double dDefaultValue, Lib3MF_double * pValue); /** -* Removes a tex2coords from the Texture2DGroup. +* Retrieves a profile's parameter value as integer. Fails if value does not exist or is not a integer value. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[in] nPropertyID - PropertyID of the tex2coords in the Texture2DGroup. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_removetex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparameterintegervalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 * pValue); /** -* Obtains the texture2D instance of this group. +* Retrieves a profile's parameter value as integer. * -* @param[in] pTexture2DGroup - Texture2DGroup instance. -* @param[out] pTexture2DInstance - the texture2D instance of this group. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] nDefaultValue - Default value if value does not exist or is not a integer value. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2dgroup_gettexture2d(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_Texture2D * pTexture2DInstance); - -/************************************************************************************************************************* - Class definition for CompositeMaterials -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparameterintegervaluedef(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 nDefaultValue, Lib3MF_int64 * pValue); /** -* Retrieves the count of Composite-s in the CompositeMaterials. +* Retrieves a profile's parameter value as boolean. Fails if value does not exist or is not a boolean value. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[out] pCount - returns the count of Composite-s +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_getcount(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparameterboolvalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool * pValue); /** -* returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials +* Retrieves a profile's parameter value as boolean. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the Composite-Mixing Values in the CompositeMaterials. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] bDefaultValue - Default value if value does not exist or is not a boolean value. +* @param[out] pValue - Returns the value of the field. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_getallpropertyids(Lib3MF_CompositeMaterials pCompositeMaterials, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_getparameterboolvaluedef(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool bDefaultValue, bool * pValue); /** -* Obtains the BaseMaterialGroup instance of this CompositeMaterials. +* Sets the profile's name * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[out] pBaseMaterialGroupInstance - returns the BaseMaterialGroup instance of this CompositeMaterials +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pName - Returns the name. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_getbasematerialgroup(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_setname(Lib3MF_ToolpathProfile pToolpathProfile, const char * pName); /** -* Adds a new Composite-Mixing Values to the CompositeMaterials. +* Sets a profile's parameter value. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nCompositeBufferSize - Number of elements in buffer -* @param[in] pCompositeBuffer - CompositeConstituent buffer of The Composite Constituents to be added as composite -* @param[out] pPropertyID - returns new PropertyID of the new Composite in the CompositeMaterials. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] pValue - String value of the parameter. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_addcomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint64 nCompositeBufferSize, const Lib3MF::sCompositeConstituent * pCompositeBuffer, Lib3MF_uint32 * pPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_setparametervalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const char * pValue); /** -* Removes a Composite-Maxing Ratio from the CompositeMaterials. +* Sets a profile's parameter value as double. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nPropertyID - PropertyID of the Composite-Mixing Values in the CompositeMaterials to be removed. +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] dValue - Double value of the parameter. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_removecomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_setparameterdoublevalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double dValue); /** -* Obtains a Composite-Maxing Ratio of this CompositeMaterials. +* Sets a profile's parameter value as integer. * -* @param[in] pCompositeMaterials - CompositeMaterials instance. -* @param[in] nPropertyID - the PropertyID of the Composite-Maxing Ratio in the CompositeMaterials. -* @param[in] nCompositeBufferSize - Number of elements in buffer -* @param[out] pCompositeNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pCompositeBuffer - CompositeConstituent buffer of The Composite-Mixing Values with the given PropertyID +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] nValue - Integer value of the parameter. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_compositematerials_getcomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nCompositeBufferSize, Lib3MF_uint64* pCompositeNeededCount, Lib3MF::sCompositeConstituent * pCompositeBuffer); - -/************************************************************************************************************************* - Class definition for MultiPropertyGroup -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_setparameterintegervalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 nValue); /** -* Retrieves the count of MultiProperty-s in the MultiPropertyGroup. +* Sets a profile's parameter value as boolean. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[out] pCount - returns the count of MultiProperty-s +* @param[in] pToolpathProfile - ToolpathProfile instance. +* @param[in] pNameSpaceName - Name of the Parameter Namespace. +* @param[in] pValueName - Value key string. +* @param[in] bValue - Boolean value of the parameter. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getcount(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathprofile_setparameterboolvalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool bValue); + +/************************************************************************************************************************* + Class definition for ToolpathLayerReader +**************************************************************************************************************************/ /** -* returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup +* Retrieves the layerdata's uuid * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the MultiProperty-s in the MultiPropertyGroup. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getallpropertyids(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getlayerdatauuid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* Adds a new MultiProperty to the MultiPropertyGroup. +* Retrieves the count of segments. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[in] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the new MultiProperty. -* @param[out] pPropertyID - returns the PropertyID of the new MultiProperty in the MultiPropertyGroup. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[out] pCount - Count * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_addmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer, Lib3MF_uint32 * pPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentcount(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 * pCount); /** -* Sets the PropertyIDs of a MultiProperty. +* Retrieves the segment type information . * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyID - the PropertyID of the MultiProperty to be changed. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[in] pPropertyIDsBuffer - uint32 buffer of The new PropertyIDs of the MultiProperty +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pType - Segment Type +* @param[out] pPointCount - Point count of segment. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_setmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentinfo(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF::eToolpathSegmentType * pType, Lib3MF_uint32 * pPointCount); /** -* Obtains the PropertyIDs of a MultiProperty. +* Retrieves the assigned segment profile. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyID - the PropertyID of the MultiProperty to be queried. -* @param[in] nPropertyIDsBufferSize - Number of elements in buffer -* @param[out] pPropertyIDsNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the MultiProperty +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pProfile - Segment Profile * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentprofile(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_ToolpathProfile * pProfile); /** -* Removes a MultiProperty from this MultiPropertyGroup. +* Retrieves the assigned segment profile uuid. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nPropertyID - the PropertyID of the MultiProperty to be removed. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[in] nProfileUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pProfileUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pProfileUUIDBuffer - buffer of Segment Profile UUID, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_removemultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentprofileuuid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nProfileUUIDBufferSize, Lib3MF_uint32* pProfileUUIDNeededChars, char * pProfileUUIDBuffer); /** -* Retrieves the number of layers of this MultiPropertyGroup. +* Retrieves the assigned segment profile. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[out] pCount - returns the number of layers +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pBuildItem - Segment Build Item * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getlayercount(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentpart(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_BuildItem * pBuildItem); /** -* Adds a MultiPropertyLayer to this MultiPropertyGroup. +* Retrieves the assigned segment part uuid. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] pTheLayer - The MultiPropertyLayer to add to this MultiPropertyGroup -* @param[out] pLayerIndex - returns the index of this MultiPropertyLayer +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[in] nPartUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartUUIDBuffer - buffer of Segment Part UUID, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_addlayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF::sMultiPropertyLayer * pTheLayer, Lib3MF_uint32 * pLayerIndex); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentpartuuid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nPartUUIDBufferSize, Lib3MF_uint32* pPartUUIDNeededChars, char * pPartUUIDBuffer); /** -* Obtains a MultiPropertyLayer of this MultiPropertyGroup. +* Retrieves the assigned segment part id. ATTENTION: This ID is only unique within the layer and there is no guarantee to be globally unique or consistent across layers. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nLayerIndex - The Index of the MultiPropertyLayer queried -* @param[out] pTheLayer - The MultiPropertyLayer with index LayerIndex within MultiPropertyGroup +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[out] pLocalPartID - Local Segment Part ID * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_getlayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex, Lib3MF::sMultiPropertyLayer * pTheLayer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentlocalpartid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 * pLocalPartID); /** -* Removes a MultiPropertyLayer from this MultiPropertyGroup. +* Retrieves the global part UUID by the local part ID. Fails if part ID does not exist in this layer. ATTENTION: This ID is only unique within the layer and there is no guarantee to be globally unique or consistent across layers. * -* @param[in] pMultiPropertyGroup - MultiPropertyGroup instance. -* @param[in] nLayerIndex - The Index of the MultiPropertyLayer to be removed +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nLocalPartID - Local Segment Part ID +* @param[in] nPartUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pPartUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPartUUIDBuffer - buffer of Segment Part UUID, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_multipropertygroup_removelayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex); - -/************************************************************************************************************************* - Class definition for Attachment -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getpartuuidbylocalpartid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nLocalPartID, const Lib3MF_uint32 nPartUUIDBufferSize, Lib3MF_uint32* pPartUUIDNeededChars, char * pPartUUIDBuffer); /** -* Retrieves an attachment's package path. This function will be removed in a later release. +* Retrieves the assigned segment point list. For type hatch, the points are taken pairwise. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nPathBufferSize - size of the buffer (including trailing 0) -* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPathBuffer - buffer of returns the attachment's package path string, may be NULL +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index. Must be between 0 and Count - 1. +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[out] pPointDataNeededCount - will be filled with the count of the written elements, or needed buffer size. +* @param[out] pPointDataBuffer - Position2D buffer of The point data array * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_getpath(Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentpointdata(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint64 nPointDataBufferSize, Lib3MF_uint64* pPointDataNeededCount, Lib3MF::sPosition2D * pPointDataBuffer); /** -* Sets an attachment's package path. This function will be removed in a later release. +* Retrieves a segment attribute Information by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pPath - new path of the attachment. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pID - Attribute ID. +* @param[out] pAttributeType - Attribute Type. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_setpath(Lib3MF_Attachment pAttachment, const char * pPath); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_findattributeinfobyname(Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, Lib3MF_uint32 * pID, Lib3MF::eToolpathAttributeType * pAttributeType); /** -* Returns the PackagePart that is this attachment. +* Retrieves a segment attribute ID by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[out] pPackagePart - The PackagePart of this attachment. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pID - Attribute ID. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_packagepart(Lib3MF_Attachment pAttachment, Lib3MF_PackagePart * pPackagePart); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_findattributeidbyname(Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, Lib3MF_uint32 * pID); /** -* Retrieves an attachment's relationship type +* Retrieves a segment attribute Type by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nPathBufferSize - size of the buffer (including trailing 0) -* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPathBuffer - buffer of returns the attachment's package relationship type string, may be NULL +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pAttributeType - Attribute Type. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_getrelationshiptype(Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_findattributevaluebyname(Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, Lib3MF::eToolpathAttributeType * pAttributeType); /** -* Sets an attachment's relationship type. +* Retrieves a segment Uint32 attribute by Attribute ID. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pPath - new relationship type string. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] nID - Attribute ID. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_setrelationshiptype(Lib3MF_Attachment pAttachment, const char * pPath); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentintegerattributebyid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 nID, Lib3MF_int64 * pValue); /** -* Writes out the attachment as file. +* Retrieves a segment integer attribute by Attribute Name. Will fail if Attribute does not exist or is of different type. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pFileName - file to write into. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_writetofile(Lib3MF_Attachment pAttachment, const char * pFileName); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentintegerattributebyname(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const char * pNameSpace, const char * pAttributeName, Lib3MF_int64 * pValue); /** -* Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Retrieves a segment Double attribute by Attribute ID. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pFileName - file to read from. +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] nID - Attribute ID. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_readfromfile(Lib3MF_Attachment pAttachment, const char * pFileName); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 nID, Lib3MF_double * pValue); /** -* Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. +* Retrieves a segment Double attribute by Attribute Name. Will fail if Attribute does not exist. * -* @param[in] pAttachment - Attachment instance. -* @param[in] pTheReadCallback - Callback to call for reading a data chunk -* @param[in] nStreamSize - number of bytes the callback returns -* @param[in] pTheSeekCallback - Callback to call for seeking in the stream. -* @param[in] pUserData - Userdata that is passed to the callback function +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. +* @param[in] pNameSpace - Namespace of the custom attribute. +* @param[in] pAttributeName - Name of the custom attribute. +* @param[out] pValue - Attribute Value. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_readfromcallback(Lib3MF_Attachment pAttachment, Lib3MF::ReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MF::SeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const char * pNameSpace, const char * pAttributeName, Lib3MF_double * pValue); /** -* Retrieves the size of the attachment stream +* Retrieves the count of custom data elements. * -* @param[in] pAttachment - Attachment instance. -* @param[out] pStreamSize - the stream size +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[out] pCount - Count * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_getstreamsize(Lib3MF_Attachment pAttachment, Lib3MF_uint64 * pStreamSize); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getcustomdatacount(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 * pCount); /** -* Writes out the attachment into a buffer +* Retrieves the custom data. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nBufferBufferSize - Number of elements in buffer -* @param[out] pBufferNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pBufferBuffer - uint8 buffer of Buffer to write into +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_writetobuffer(Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getcustomdata(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_CustomDOMTree * pData); /** -* Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). +* Retrieves the node name of the custom data. * -* @param[in] pAttachment - Attachment instance. -* @param[in] nBufferBufferSize - Number of elements in buffer -* @param[in] pBufferBuffer - uint8 buffer of Buffer to read from +* @param[in] pToolpathLayerReader - ToolpathLayerReader instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of Namespace of the custom data tree., may be NULL +* @param[in] nDataNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pDataNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pDataNameBuffer - buffer of Root name of the data tree., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_attachment_readfrombuffer(Lib3MF_Attachment pAttachment, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerreader_getcustomdataname(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer, const Lib3MF_uint32 nDataNameBufferSize, Lib3MF_uint32* pDataNameNeededChars, char * pDataNameBuffer); /************************************************************************************************************************* - Class definition for Texture2D + Class definition for ToolpathLayerData **************************************************************************************************************************/ /** -* Retrieves the attachment located at the path of the texture. +* Retrieves the layerdata's uuid * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pAttachment - attachment that holds the texture's image information. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUUIDBuffer - buffer of Returns the uuid value., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_getattachment(Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment * pAttachment); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_getlayerdatauuid(Lib3MF_ToolpathLayerData pToolpathLayerData, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); /** -* Sets the texture's package path to the path of the attachment. +* Registers a toolpath profile * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] pAttachment - attachment that holds the texture's image information. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pProfile - The toolpath profile to register. +* @param[out] pProfileID - returns the local profile ID for the layer. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_setattachment(Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment pAttachment); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_registerprofile(Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_ToolpathProfile pProfile, Lib3MF_uint32 * pProfileID); /** -* Retrieves a texture's content type. +* Registers a Model Build Item * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pContentType - returns content type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pBuildItem - The model build item to use. +* @param[out] pPartID - returns the local part ID for the layer. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_getcontenttype(Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureType * pContentType); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_registerbuilditem(Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pPartID); /** -* Retrieves a texture's content type. +* Sets Segment Attribute for all following segments that are added. Overrides previously set attribute. * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] eContentType - new Content Type +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pNameSpace - The namespace of the attribute to register. +* @param[in] pAttributeName - The name of the attribute to register. +* @param[in] pValue - The value of the attribute to register. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_setcontenttype(Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureType eContentType); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_setsegmentattribute(Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pAttributeName, const char * pValue); /** -* Retrieves a texture's tilestyle type. +* Clears current segment attributes. * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pTileStyleU - returns tilestyle type enum. -* @param[out] pTileStyleV - returns tilestyle type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_gettilestyleuv(Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureTileStyle * pTileStyleU, Lib3MF::eTextureTileStyle * pTileStyleV); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_clearsegmentattributes(Lib3MF_ToolpathLayerData pToolpathLayerData); /** -* Sets a texture's tilestyle type. +* writes hatch data to the layer. * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] eTileStyleU - new tilestyle type enum. -* @param[in] eTileStyleV - new tilestyle type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nProfileID - The toolpath profile to use +* @param[in] nPartID - The toolpath part to use +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[in] pPointDataBuffer - Position2D buffer of The point data * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_settilestyleuv(Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureTileStyle eTileStyleU, Lib3MF::eTextureTileStyle eTileStyleV); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_writehatchdata(Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const Lib3MF::sPosition2D * pPointDataBuffer); /** -* Retrieves a texture's filter type. +* writes loop data to the layer. * -* @param[in] pTexture2D - Texture2D instance. -* @param[out] pFilter - returns filter type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nProfileID - The toolpath profile to use +* @param[in] nPartID - The toolpath part to use +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[in] pPointDataBuffer - Position2D buffer of The point data * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_getfilter(Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureFilter * pFilter); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_writeloop(Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const Lib3MF::sPosition2D * pPointDataBuffer); /** -* Sets a texture's filter type. +* writes polyline data to the layer. * -* @param[in] pTexture2D - Texture2D instance. -* @param[in] eFilter - sets new filter type enum. +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] nProfileID - The toolpath profile to use +* @param[in] nPartID - The toolpath part to use +* @param[in] nPointDataBufferSize - Number of elements in buffer +* @param[in] pPointDataBuffer - Position2D buffer of The point data * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_texture2d_setfilter(Lib3MF_Texture2D pTexture2D, Lib3MF::eTextureFilter eFilter); - -/************************************************************************************************************************* - Class definition for BuildItem -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_writepolyline(Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const Lib3MF::sPosition2D * pPointDataBuffer); /** -* Retrieves the object resource associated to a build item +* Adds a custom data DOM tree to the layer. Layer MUST not be finished when changing the DOM tree. * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pObjectResource - returns the associated resource instance +* @param[in] pToolpathLayerData - ToolpathLayerData instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pDataName - Root name of the data tree. MUST not be empty. MUST be a valid XML name string. +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getobjectresource(Lib3MF_BuildItem pBuildItem, Lib3MF_Object * pObjectResource); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_addcustomdata(Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData); /** -* returns, whether a build item has a UUID and, if true, the build item's UUID +* finishes all writing of the layer and compresses toolpath data. * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pHasUUID - flag whether the build item has a UUID -* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pUUIDBuffer - buffer of the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx', may be NULL +* @param[in] pToolpathLayerData - ToolpathLayerData instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getuuid(Lib3MF_BuildItem pBuildItem, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathlayerdata_finish(Lib3MF_ToolpathLayerData pToolpathLayerData); + +/************************************************************************************************************************* + Class definition for Toolpath +**************************************************************************************************************************/ /** -* sets the build item's UUID +* Retrieves the unit factor * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] pUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' +* @param[in] pToolpath - Toolpath instance. +* @param[out] pUnits - Returns the unit factor. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_setuuid(Lib3MF_BuildItem pBuildItem, const char * pUUID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getunits(Lib3MF_Toolpath pToolpath, Lib3MF_double * pUnits); /** -* Retrieves the object UniqueResourceID associated to a build item +* Retrieves the count of layers * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pUniqueResourceID - returns the UniqueResourceID of the object +* @param[in] pToolpath - Toolpath instance. +* @param[out] pCount - Returns the layer count * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getobjectresourceid(Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pUniqueResourceID); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getlayercount(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount); /** -* Checks, if a build item has a non-identity transformation matrix +* Retrieves the count of profiles * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pHasTransform - returns true, if the transformation matrix is not the identity +* @param[in] pToolpath - Toolpath instance. +* @param[out] pCount - Returns the profile count * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_hasobjecttransform(Lib3MF_BuildItem pBuildItem, bool * pHasTransform); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getprofilecount(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount); /** -* Retrieves a build item's transformation matrix. +* Adds a new toolpath layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pTransform - returns the transformation matrix +* @param[in] pToolpath - Toolpath instance. +* @param[in] nZMax - ZMax value +* @param[in] pPath - Package Path +* @param[in] pModelWriter - The model writer that writes out the 3MF. +* @param[out] pLayerData - Returns the layerdata object to write the layer content into. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getobjecttransform(Lib3MF_BuildItem pBuildItem, Lib3MF::sTransform * pTransform); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_addlayer(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nZMax, const char * pPath, Lib3MF_Writer pModelWriter, Lib3MF_ToolpathLayerData * pLayerData); /** -* Sets a build item's transformation matrix. +* Retrieves the Attachment of a layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] pTransform - new transformation matrix +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[out] pAttachment - Attachment * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_setobjecttransform(Lib3MF_BuildItem pBuildItem, const Lib3MF::sTransform * pTransform); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getlayerattachment(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_Attachment * pAttachment); /** -* Retrieves a build item's part number string +* Reads the toolpath of a layer. * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] nPartNumberBufferSize - size of the buffer (including trailing 0) -* @param[out] pPartNumberNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pPartNumberBuffer - buffer of Returns a build item's part number string, may be NULL +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[out] pToolpathReader - Toolpath Reader Instance * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getpartnumber(Lib3MF_BuildItem pBuildItem, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_readlayerdata(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_ToolpathLayerReader * pToolpathReader); /** -* Sets a build item's part number string +* Retrieves the Path of a layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[in] pSetPartnumber - new part number string for referencing parts from the outside world +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[in] nPathBufferSize - size of the buffer (including trailing 0) +* @param[out] pPathNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pPathBuffer - buffer of Package Path, may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_setpartnumber(Lib3MF_BuildItem pBuildItem, const char * pSetPartnumber); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getlayerpath(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer); /** -* Returns the metadatagroup of this build item +* Retrieves the ZMax of a layer * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pMetaDataGroup - returns an Instance of the metadatagroup of this build item +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Layer Index +* @param[out] pZMax - ZMax value * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getmetadatagroup(Lib3MF_BuildItem pBuildItem, Lib3MF_MetaDataGroup * pMetaDataGroup); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getlayerzmax(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_uint32 * pZMax); /** -* Returns the outbox of a build item +* Return the z value of a layer in units. * -* @param[in] pBuildItem - BuildItem instance. -* @param[out] pOutbox - Outbox of this build item +* @param[in] pToolpath - Toolpath instance. +* @param[in] nLayerIndex - Layer Index. +* @param[out] pZValue - Z Value in Units. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditem_getoutbox(Lib3MF_BuildItem pBuildItem, Lib3MF::sBox * pOutbox); - -/************************************************************************************************************************* - Class definition for BuildItemIterator -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getlayerz(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nLayerIndex, Lib3MF_uint32 * pZValue); /** -* Iterates to the next build item in the list. +* Adds a new profile to the toolpath. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pHasNext - Iterates to the next build item in the list. +* @param[in] pToolpath - Toolpath instance. +* @param[in] pName - the name. +* @param[out] pProfile - Returns the profile. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_movenext(Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasNext); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_addprofile(Lib3MF_Toolpath pToolpath, const char * pName, Lib3MF_ToolpathProfile * pProfile); /** -* Iterates to the previous build item in the list. +* Returns a profile of the toolpath. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pHasPrevious - Iterates to the previous build item in the list. +* @param[in] pToolpath - Toolpath instance. +* @param[in] nProfileIndex - Layer Index. +* @param[out] pProfile - Returns the profile. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_moveprevious(Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasPrevious); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getprofile(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nProfileIndex, Lib3MF_ToolpathProfile * pProfile); /** -* Returns the build item the iterator points at. +* Returns a profile of the toolpath by UUID. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pBuildItem - returns the build item instance. +* @param[in] pToolpath - Toolpath instance. +* @param[in] pProfileUUID - UUID string. +* @param[out] pProfile - Returns the profile. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_getcurrent(Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItem * pBuildItem); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getprofileuuid(Lib3MF_Toolpath pToolpath, const char * pProfileUUID, Lib3MF_ToolpathProfile * pProfile); /** -* Creates a new build item iterator with the same build item list. +* Retrieves the count of custom data elements. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pOutBuildItemIterator - returns the cloned Iterator instance +* @param[in] pToolpath - Toolpath instance. +* @param[out] pCount - Count * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_clone(Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItemIterator * pOutBuildItemIterator); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getcustomdatacount(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount); /** -* Returns the number of build items the iterator captures. +* Retrieves the custom data. * -* @param[in] pBuildItemIterator - BuildItemIterator instance. -* @param[out] pCount - returns the number of build items the iterator captures. +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_builditemiterator_count(Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_uint64 * pCount); - -/************************************************************************************************************************* - Class definition for Slice -**************************************************************************************************************************/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getcustomdata(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_CustomDOMTree * pData); /** -* Set all vertices of a slice. All polygons will be cleared. +* Retrieves the node name of the custom data. * -* @param[in] pSlice - Slice instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[in] pVerticesBuffer - Position2D buffer of contains the positions. +* @param[in] pToolpath - Toolpath instance. +* @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count +* @param[in] nNameSpaceBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameSpaceNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameSpaceBuffer - buffer of Namespace of the custom data tree., may be NULL +* @param[in] nDataNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pDataNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pDataNameBuffer - buffer of Root name of the data tree., may be NULL * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_setvertices(Lib3MF_Slice pSlice, Lib3MF_uint64 nVerticesBufferSize, const Lib3MF::sPosition2D * pVerticesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_getcustomdataname(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer, const Lib3MF_uint32 nDataNameBufferSize, Lib3MF_uint32* pDataNameNeededChars, char * pDataNameBuffer); /** -* Get all vertices of a slice +* Retrieves if custom data with a specific namespace and name combination exists. * -* @param[in] pSlice - Slice instance. -* @param[in] nVerticesBufferSize - Number of elements in buffer -* @param[out] pVerticesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pVerticesBuffer - Position2D buffer of contains the positions. +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. +* @param[in] pDataName - Root name of the data tree. +* @param[out] pCustomDataExists - Returns true if DOM Tree Exists. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getvertices(Lib3MF_Slice pSlice, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, Lib3MF::sPosition2D * pVerticesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_hasuniquecustomdata(Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, bool * pCustomDataExists); /** -* Get the number of vertices in a slice +* Retrieves the custom data with a specific namespace and name combination. Fails if combination is not unique. * -* @param[in] pSlice - Slice instance. -* @param[out] pCount - the number of vertices in the slice +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. +* @param[in] pDataName - Root name of the data tree. +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getvertexcount(Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_finduniquecustomdata(Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData); /** -* Add a new polygon to this slice +* Adds a custom data DOM tree to the toolpath. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the new polygon -* @param[out] pIndex - the index of the new polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pDataName - Root name of the data tree. MUST not be empty. MUST be a valid XML name string. +* @param[out] pData - DOM Tree of the data. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_addpolygon(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer, Lib3MF_uint64 * pIndex); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_addcustomdata(Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData); /** -* Get the number of polygons in the slice +* Deletes all custom data. * -* @param[in] pSlice - Slice instance. -* @param[out] pCount - the number of polygons in the slice +* @param[in] pToolpath - Toolpath instance. +* @param[out] pNumberOfDeletedItems - Returns number of deleted items. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getpolygoncount(Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_clearcustomdata(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pNumberOfDeletedItems); /** -* Set all indices of a polygon +* Deletes a custom data instance from the list. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndex - the index of the polygon to manipulate -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[in] pIndicesBuffer - uint32 buffer of the new indices of the index-th polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pData - DOM Tree of the data. +* @param[out] pSuccess - Returns if deletion was successful. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_setpolygonindices(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_deletecustomdata(Lib3MF_Toolpath pToolpath, Lib3MF_CustomDOMTree pData, bool * pSuccess); /** -* Get all vertices of a slice +* Registers an Integer Attribute that each segment holds. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndex - the index of the polygon to manipulate -* @param[in] nIndicesBufferSize - Number of elements in buffer -* @param[out] pIndicesNeededCount - will be filled with the count of the written elements, or needed buffer size. -* @param[out] pIndicesBuffer - uint32 buffer of the indices of the index-th polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pAttributeName - Attribute name. MUST not be empty. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getpolygonindices(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF_uint32 * pIndicesBuffer); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_registercustomintegerattribute(Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pAttributeName); /** -* Get the number of vertices in a slice +* Registers a Double Attribute that each segment holds. Registering only applies to reader or writer objects created after the call. * -* @param[in] pSlice - Slice instance. -* @param[in] nIndex - the index of the polygon to manipulate -* @param[out] pCount - the number of indices of the index-th polygon +* @param[in] pToolpath - Toolpath instance. +* @param[in] pNameSpace - Namespace of the custom data tree. MUST not be empty. +* @param[in] pAttributeName - Attribute name. MUST not be empty. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getpolygonindexcount(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 * pCount); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpath_registercustomdoubleattribute(Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pAttributeName); + +/************************************************************************************************************************* + Class definition for ToolpathIterator +**************************************************************************************************************************/ /** -* Get the upper Z-Coordinate of this slice. +* Returns the Toolpath the iterator points at. * -* @param[in] pSlice - Slice instance. -* @param[out] pZTop - the upper Z-Coordinate of this slice +* @param[in] pToolpathIterator - ToolpathIterator instance. +* @param[out] pResource - returns the Toolpath instance. * @return error code or 0 (success) */ -LIB3MF_DECLSPEC Lib3MFResult lib3mf_slice_getztop(Lib3MF_Slice pSlice, Lib3MF_double * pZTop); +LIB3MF_DECLSPEC Lib3MFResult lib3mf_toolpathiterator_getcurrenttoolpath(Lib3MF_ToolpathIterator pToolpathIterator, Lib3MF_Toolpath * pResource); /************************************************************************************************************************* Class definition for SliceStack @@ -3274,6 +4681,15 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getcompositematerials(Lib3MF_Model pMo */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getmultipropertygroups(Lib3MF_Model pModel, Lib3MF_MultiPropertyGroupIterator * pResourceIterator); +/** +* creates a Toolpath instance with all toolpath resources. +* +* @param[in] pModel - Model instance. +* @param[out] pResourceIterator - returns the iterator instance. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_gettoolpaths(Lib3MF_Model pModel, Lib3MF_ToolpathIterator * pResourceIterator); + /** * creates a resource iterator instance with all slice stack resources. * @@ -3397,6 +4813,16 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_addbuilditem(Lib3MF_Model pModel, Lib3 */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_removebuilditem(Lib3MF_Model pModel, Lib3MF_BuildItem pBuildItemInstance); +/** +* adds an empty Toolpath resource to the model. +* +* @param[in] pModel - Model instance. +* @param[in] dUnitFactor - The toolpath instance of the created Toolpath. +* @param[out] pToolpathInstance - The toolpath instance of the created Toolpath. +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_addtoolpath(Lib3MF_Model pModel, Lib3MF_double dUnitFactor, Lib3MF_Toolpath * pToolpathInstance); + /** * Returns the metadata of the model as MetaDataGroup * @@ -3528,6 +4954,40 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_setrandomnumbercallback(Lib3MF_Model p */ LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_getkeystore(Lib3MF_Model pModel, Lib3MF_KeyStore * pKeyStore); +/** +* Creates an OPC Reader Source from a file. +* +* @param[in] pModel - Model instance. +* @param[in] pFilename - Filename to read from +* @param[out] pInstance - The instance of the created reader source +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_createpersistentsourcefromfile(Lib3MF_Model pModel, const char * pFilename, Lib3MF_PersistentReaderSource * pInstance); + +/** +* Creates an OPC Reader Source from a memory buffer. The memory buffer MUST exist as long as the Source object exists. +* +* @param[in] pModel - Model instance. +* @param[in] nBufferBufferSize - Number of elements in buffer +* @param[in] pBufferBuffer - uint8 buffer of Buffer to read from +* @param[out] pInstance - The instance of the created reader source +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_createpersistentsourcefrombuffer(Lib3MF_Model pModel, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer, Lib3MF_PersistentReaderSource * pInstance); + +/** +* Creates an OPC Reader Source from a data provided by a callback function. The callbacks MUST exist as long as the source object exists. +* +* @param[in] pModel - Model instance. +* @param[in] pTheReadCallback - Callback to call for reading a data chunk +* @param[in] nStreamSize - number of bytes the callback returns +* @param[in] pTheSeekCallback - Callback to call for seeking in the stream. +* @param[in] pUserData - Userdata that is passed to the callback function +* @param[out] pInstance - The instance of the created reader source +* @return error code or 0 (success) +*/ +LIB3MF_DECLSPEC Lib3MFResult lib3mf_model_createpersistentsourcefromcallback(Lib3MF_Model pModel, Lib3MF::ReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MF::SeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData, Lib3MF_PersistentReaderSource * pInstance); + /************************************************************************************************************************* Global functions **************************************************************************************************************************/ diff --git a/Autogenerated/Source/lib3mf_interfaces.hpp b/Autogenerated/Source/lib3mf_interfaces.hpp index 906ffae2d..3d629356e 100644 --- a/Autogenerated/Source/lib3mf_interfaces.hpp +++ b/Autogenerated/Source/lib3mf_interfaces.hpp @@ -52,11 +52,17 @@ namespace Impl { Forward declarations of class interfaces */ class IBase; +class IBinaryStream; class IWriter; +class IPersistentReaderSource; class IReader; class IPackagePart; class IResource; class IResourceIterator; +class ICustomXMLAttribute; +class ICustomXMLNode; +class ICustomXMLNodes; +class ICustomDOMTree; class ISliceStackIterator; class IObjectIterator; class IMeshObjectIterator; @@ -85,6 +91,11 @@ class ITexture2D; class IBuildItem; class IBuildItemIterator; class ISlice; +class IToolpathProfile; +class IToolpathLayerReader; +class IToolpathLayerData; +class IToolpath; +class IToolpathIterator; class ISliceStack; class IConsumer; class IAccessRight; @@ -299,6 +310,67 @@ class IBaseSharedPtr : public std::shared_ptr typedef IBaseSharedPtr PIBase; +/************************************************************************************************************************* + Class interface for BinaryStream +**************************************************************************************************************************/ + +class IBinaryStream : public virtual IBase { +public: + /** + * IBinaryStream::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer + */ + Lib3MF_uint64 ClassTypeId() override + { + return 0xA0EB26254C981E1AUL; // First 64 bits of SHA1 of a string: "Lib3MF::BinaryStream" + } + + /** + * IBinaryStream::GetBinaryPath - Retrieves an binary streams package path for the binary data. + * @return binary streams package binary path. + */ + virtual std::string GetBinaryPath() = 0; + + /** + * IBinaryStream::GetIndexPath - Retrieves an binary streams package path for the index data. + * @return binary streams package index path. + */ + virtual std::string GetIndexPath() = 0; + + /** + * IBinaryStream::GetUUID - Retrieves an binary streams uuid. + * @return binary streams uuid + */ + virtual std::string GetUUID() = 0; + + /** + * IBinaryStream::DisableDiscretizedArrayCompression - Sets the float compression mode to raw. All subsequent writes will adhere to this mode. + */ + virtual void DisableDiscretizedArrayCompression() = 0; + + /** + * IBinaryStream::EnableDiscretizedArrayCompression - Sets the compression mode to a quantized array. All subsequent writes will adhere to this mode. + * @param[in] dUnits - Unit factor to use for quantization. + * @param[in] ePredictionType - Prediction type to use for arrays. + */ + virtual void EnableDiscretizedArrayCompression(const Lib3MF_double dUnits, const Lib3MF::eBinaryStreamPredictionType ePredictionType) = 0; + + /** + * IBinaryStream::EnableLZMA - Enables LZMA mode. + * @param[in] nLZMALevel - LZMA Level (0-9) + */ + virtual void EnableLZMA(const Lib3MF_uint32 nLZMALevel) = 0; + + /** + * IBinaryStream::DisableLZMA - Disables LZMA mode. + */ + virtual void DisableLZMA() = 0; + +}; + +typedef IBaseSharedPtr PIBinaryStream; + + /************************************************************************************************************************* Class interface for Writer **************************************************************************************************************************/ @@ -402,11 +474,70 @@ class IWriter : public virtual IBase { */ virtual void SetContentEncryptionCallback(const Lib3MF::ContentEncryptionCallback pTheCallback, const Lib3MF_pvoid pUserData) = 0; + /** + * IWriter::CreateBinaryStream - Creates a binary stream object. Only applicable for 3MF Writers. + * @param[in] sIndexPath - Package path to write the index into + * @param[in] sBinaryPath - Package path to write raw binary data into + * @return Returns a package path. + */ + virtual IBinaryStream * CreateBinaryStream(const std::string & sIndexPath, const std::string & sBinaryPath) = 0; + + /** + * IWriter::AssignBinaryStream - Sets a binary stream for an object. Currently supported objects are Meshes and Toolpath layers. + * @param[in] pInstance - Object instance to assign Binary stream to. + * @param[in] pBinaryStream - Binary stream object to use for this layer. + */ + virtual void AssignBinaryStream(IBase* pInstance, IBinaryStream* pBinaryStream) = 0; + + /** + * IWriter::RegisterCustomNamespace - Registers a custom 3MF Namespace. Fails if Prefix is already registered. + * @param[in] sPrefix - Prefix to be used. MUST NOT be empty. MUST be alphanumeric, not starting with a number + * @param[in] sNameSpace - Namespace to be used. MUST NOT be empty. MUST be alphanumeric, not starting with a number + */ + virtual void RegisterCustomNamespace(const std::string & sPrefix, const std::string & sNameSpace) = 0; + }; typedef IBaseSharedPtr PIWriter; +/************************************************************************************************************************* + Class interface for PersistentReaderSource +**************************************************************************************************************************/ + +class IPersistentReaderSource : public virtual IBase { +public: + /** + * IPersistentReaderSource::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer + */ + Lib3MF_uint64 ClassTypeId() override + { + return 0xBE46884397CE1319UL; // First 64 bits of SHA1 of a string: "Lib3MF::PersistentReaderSource" + } + + /** + * IPersistentReaderSource::GetSourceType - Retrieves the type of source data. + * @return Reader Source Type + */ + virtual Lib3MF::ePersistentReaderSourceType GetSourceType() = 0; + + /** + * IPersistentReaderSource::InvalidateSourceData - Invalidates the reader source. Every subsequent read on this data will fail. + */ + virtual void InvalidateSourceData() = 0; + + /** + * IPersistentReaderSource::SourceDataIsValid - Checks if the source data is valid. Any read on an invalid source object will fail. + * @return The source data is valid. + */ + virtual bool SourceDataIsValid() = 0; + +}; + +typedef IBaseSharedPtr PIPersistentReaderSource; + + /************************************************************************************************************************* Class interface for Reader **************************************************************************************************************************/ @@ -422,6 +553,12 @@ class IReader : public virtual IBase { return 0x2D86831DA59FBE72UL; // First 64 bits of SHA1 of a string: "Lib3MF::Reader" } + /** + * IReader::ReadFromPersistentSource - Reads a model from a persistent source object. The object will be referenced until the Model is destroyed or cleared. + * @param[in] pSource - Source object to read from + */ + virtual void ReadFromPersistentSource(IPersistentReaderSource* pSource) = 0; + /** * IReader::ReadFromFile - Reads a model from a file. The file type is specified by the Model Reader class * @param[in] sFilename - Filename to read from @@ -642,1826 +779,2840 @@ typedef IBaseSharedPtr PIResourceIterator; /************************************************************************************************************************* - Class interface for SliceStackIterator + Class interface for CustomXMLAttribute **************************************************************************************************************************/ -class ISliceStackIterator : public virtual IResourceIterator { +class ICustomXMLAttribute : public virtual IBase { public: /** - * ISliceStackIterator::ClassTypeId - Get Class Type Id + * ICustomXMLAttribute::ClassTypeId - Get Class Type Id * @return Class type as a 64 bits integer */ Lib3MF_uint64 ClassTypeId() override { - return 0x69684DB99FA813F6UL; // First 64 bits of SHA1 of a string: "Lib3MF::SliceStackIterator" + return 0xEA18C54DBD42B5F6UL; // First 64 bits of SHA1 of a string: "Lib3MF::CustomXMLAttribute" } /** - * ISliceStackIterator::GetCurrentSliceStack - Returns the SliceStack the iterator points at. - * @return returns the SliceStack instance. + * ICustomXMLAttribute::GetName - Retrieves name of the attribute. + * @return returns the name of the attribute. */ - virtual ISliceStack * GetCurrentSliceStack() = 0; + virtual std::string GetName() = 0; -}; + /** + * ICustomXMLAttribute::GetValue - Retrieves value of the attribute as string. + * @return returns the value of the attribute. + */ + virtual std::string GetValue() = 0; -typedef IBaseSharedPtr PISliceStackIterator; + /** + * ICustomXMLAttribute::IsValidInteger - Checks if the value is a valid integer in the given range. + * @param[in] nMinValue - Minimum allowed value + * @param[in] nMaxValue - Maximum allowed value + * @return returns if the value is a valid integer. + */ + virtual bool IsValidInteger(const Lib3MF_int64 nMinValue, const Lib3MF_int64 nMaxValue) = 0; + /** + * ICustomXMLAttribute::GetIntegerValue - Returns the value as integer. Fails if the value is not a valid integer in the given range. + * @param[in] nMinValue - Minimum allowed value + * @param[in] nMaxValue - Maximum allowed value + * @return returns the value. + */ + virtual Lib3MF_int64 GetIntegerValue(const Lib3MF_int64 nMinValue, const Lib3MF_int64 nMaxValue) = 0; -/************************************************************************************************************************* - Class interface for ObjectIterator -**************************************************************************************************************************/ + /** + * ICustomXMLAttribute::IsValidDouble - Checks if the value is a valid double in the given range. + * @param[in] dMinValue - Minimum allowed value + * @param[in] dMaxValue - Maximum allowed value + * @return returns if the value is a valid double. + */ + virtual bool IsValidDouble(const Lib3MF_double dMinValue, const Lib3MF_double dMaxValue) = 0; -class IObjectIterator : public virtual IResourceIterator { -public: /** - * IObjectIterator::ClassTypeId - Get Class Type Id - * @return Class type as a 64 bits integer + * ICustomXMLAttribute::GetDoubleValue - Returns the value as double. Fails if the value is not a valid double in the given range. + * @param[in] dMinValue - Minimum allowed value + * @param[in] dMaxValue - Maximum allowed value + * @return returns the value . */ - Lib3MF_uint64 ClassTypeId() override - { - return 0xDE92510BD2112288UL; // First 64 bits of SHA1 of a string: "Lib3MF::ObjectIterator" - } + virtual Lib3MF_double GetDoubleValue(const Lib3MF_double dMinValue, const Lib3MF_double dMaxValue) = 0; /** - * IObjectIterator::GetCurrentObject - Returns the Object the iterator points at. - * @return returns the Object instance. + * ICustomXMLAttribute::IsValidBool - Checks if the value is a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. + * @return returns if the value is a valid bool. */ - virtual IObject * GetCurrentObject() = 0; + virtual bool IsValidBool() = 0; -}; + /** + * ICustomXMLAttribute::GetBoolValue - Returns the value as bool. Fails if the value is not a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. + * @param[in] dMinValue - Minimum allowed value + * @param[in] dMaxValue - Maximum allowed value + * @return returns the value . + */ + virtual bool GetBoolValue(const Lib3MF_double dMinValue, const Lib3MF_double dMaxValue) = 0; -typedef IBaseSharedPtr PIObjectIterator; + /** + * ICustomXMLAttribute::SetValue - Sets the value of the attribute as string. + * @param[in] sValue - new value of the attribute. + */ + virtual void SetValue(const std::string & sValue) = 0; + /** + * ICustomXMLAttribute::SetIntegerValue - Sets the value of the attribute as integer. + * @param[in] nValue - new value of the attribute. + */ + virtual void SetIntegerValue(const Lib3MF_int64 nValue) = 0; -/************************************************************************************************************************* - Class interface for MeshObjectIterator -**************************************************************************************************************************/ + /** + * ICustomXMLAttribute::SetDoubleValue - Sets the value of the attribute as double. + * @param[in] dValue - new value of the attribute. + */ + virtual void SetDoubleValue(const Lib3MF_double dValue) = 0; -class IMeshObjectIterator : public virtual IResourceIterator { -public: /** - * IMeshObjectIterator::ClassTypeId - Get Class Type Id - * @return Class type as a 64 bits integer + * ICustomXMLAttribute::SetBoolValue - Sets the value of the attribute as bool. + * @param[in] bValue - new value of the attribute. */ - Lib3MF_uint64 ClassTypeId() override - { - return 0xF4196034E2B9FDE6UL; // First 64 bits of SHA1 of a string: "Lib3MF::MeshObjectIterator" - } + virtual void SetBoolValue(const bool bValue) = 0; /** - * IMeshObjectIterator::GetCurrentMeshObject - Returns the MeshObject the iterator points at. - * @return returns the MeshObject instance. + * ICustomXMLAttribute::Remove - Removes the attribute from its parent node. All subsequent calls to the class will fail. */ - virtual IMeshObject * GetCurrentMeshObject() = 0; + virtual void Remove() = 0; }; -typedef IBaseSharedPtr PIMeshObjectIterator; +typedef IBaseSharedPtr PICustomXMLAttribute; /************************************************************************************************************************* - Class interface for ComponentsObjectIterator + Class interface for CustomXMLNode **************************************************************************************************************************/ -class IComponentsObjectIterator : public virtual IResourceIterator { +class ICustomXMLNode : public virtual IBase { public: /** - * IComponentsObjectIterator::ClassTypeId - Get Class Type Id + * ICustomXMLNode::ClassTypeId - Get Class Type Id * @return Class type as a 64 bits integer */ Lib3MF_uint64 ClassTypeId() override { - return 0x564DE4217ED7614AUL; // First 64 bits of SHA1 of a string: "Lib3MF::ComponentsObjectIterator" + return 0x26B5AD02041EDF96UL; // First 64 bits of SHA1 of a string: "Lib3MF::CustomXMLNode" } /** - * IComponentsObjectIterator::GetCurrentComponentsObject - Returns the ComponentsObject the iterator points at. - * @return returns the ComponentsObject instance. + * ICustomXMLNode::GetName - Retrieves name of the node. + * @return returns the name of the node. */ - virtual IComponentsObject * GetCurrentComponentsObject() = 0; + virtual std::string GetName() = 0; -}; + /** + * ICustomXMLNode::GetNameSpace - Retrieves namespace of the node. + * @return returns the namespace of the node. + */ + virtual std::string GetNameSpace() = 0; -typedef IBaseSharedPtr PIComponentsObjectIterator; + /** + * ICustomXMLNode::GetAttributeCount - Returns number of attributes. + * @return returns the number of attributes. + */ + virtual Lib3MF_uint64 GetAttributeCount() = 0; + /** + * ICustomXMLNode::GetAttribute - Returns attribute instance. Fails if Index is out of range. + * @param[in] nIndex - Index of the attribute to return (0-based). + * @return XML Document attribute. + */ + virtual ICustomXMLAttribute * GetAttribute(const Lib3MF_uint64 nIndex) = 0; -/************************************************************************************************************************* - Class interface for Texture2DIterator -**************************************************************************************************************************/ + /** + * ICustomXMLNode::HasAttribute - Returns if attribute of a specific name exists. + * @param[in] sName - Name of the attribute. + * @return Returns if the attribute exists. + */ + virtual bool HasAttribute(const std::string & sName) = 0; -class ITexture2DIterator : public virtual IResourceIterator { -public: /** - * ITexture2DIterator::ClassTypeId - Get Class Type Id - * @return Class type as a 64 bits integer + * ICustomXMLNode::FindAttribute - Returns attribute instance of a specific name. + * @param[in] sName - Name of the attribute. + * @param[in] bMustExist - If true, the call fails if attribute does not exist. If falls, the call will return null if the attribute does not exist. + * @return XML Document attribute. */ - Lib3MF_uint64 ClassTypeId() override - { - return 0x4BD32B4870FFC03BUL; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2DIterator" - } + virtual ICustomXMLAttribute * FindAttribute(const std::string & sName, const bool bMustExist) = 0; /** - * ITexture2DIterator::GetCurrentTexture2D - Returns the Texture2D the iterator points at. - * @return returns the Texture2D instance. + * ICustomXMLNode::RemoveAttribute - Removes the attribute with a specific name. Does nothing if attribute does not exist. + * @param[in] sName - Name of the attribute. + * @return Returns true if an attribute was removed. */ - virtual ITexture2D * GetCurrentTexture2D() = 0; + virtual bool RemoveAttribute(const std::string & sName) = 0; -}; + /** + * ICustomXMLNode::RemoveAttributeByIndex - Removes the attribute with a specific index. Fails if index is invalid + * @param[in] nIndex - Index of the attribute to remove (0-based). + * @return Returns true if an attribute was removed. + */ + virtual bool RemoveAttributeByIndex(const Lib3MF_uint64 nIndex) = 0; -typedef IBaseSharedPtr PITexture2DIterator; + /** + * ICustomXMLNode::AddAttribute - Adds an attribute with a specific name and string value. Fails if attribute already exists. + * @param[in] sName - Name of the attribute. + * @param[in] sValue - Value of the attribute. + */ + virtual void AddAttribute(const std::string & sName, const std::string & sValue) = 0; + /** + * ICustomXMLNode::AddIntegerAttribute - Adds an attribute with a specific name and integer value. Fails if attribute already exists. + * @param[in] sName - Name of the attribute. + * @param[in] nValue - Value of the attribute. + */ + virtual void AddIntegerAttribute(const std::string & sName, const Lib3MF_int64 nValue) = 0; -/************************************************************************************************************************* - Class interface for BaseMaterialGroupIterator -**************************************************************************************************************************/ + /** + * ICustomXMLNode::AddDoubleAttribute - Adds an attribute with a specific name and double value. Fails if attribute already exists. + * @param[in] sName - Name of the attribute. + * @param[in] dValue - Value of the attribute. + */ + virtual void AddDoubleAttribute(const std::string & sName, const Lib3MF_double dValue) = 0; -class IBaseMaterialGroupIterator : public virtual IResourceIterator { -public: /** - * IBaseMaterialGroupIterator::ClassTypeId - Get Class Type Id - * @return Class type as a 64 bits integer + * ICustomXMLNode::AddBoolAttribute - Adds an attribute with a specific name and bool value. Fails if attribute already exists. + * @param[in] sName - Name of the attribute. + * @param[in] bValue - Value of the attribute. */ - Lib3MF_uint64 ClassTypeId() override - { - return 0x65E6EDD9362C79CBUL; // First 64 bits of SHA1 of a string: "Lib3MF::BaseMaterialGroupIterator" - } + virtual void AddBoolAttribute(const std::string & sName, const bool bValue) = 0; /** - * IBaseMaterialGroupIterator::GetCurrentBaseMaterialGroup - Returns the MaterialGroup the iterator points at. - * @return returns the BaseMaterialGroup instance. + * ICustomXMLNode::GetChildren - Returns all the child nodes of the XML Node. + * @return returns the list of child nodes. */ - virtual IBaseMaterialGroup * GetCurrentBaseMaterialGroup() = 0; + virtual ICustomXMLNodes * GetChildren() = 0; -}; + /** + * ICustomXMLNode::CountChildrenByName - Returns how many children of the XML Node have a specific name. + * @param[in] sName - Name of the node. + * @return returns the number children with the specified name. + */ + virtual Lib3MF_uint64 CountChildrenByName(const std::string & sName) = 0; -typedef IBaseSharedPtr PIBaseMaterialGroupIterator; + /** + * ICustomXMLNode::GetChildrenByName - Returns all the child nodes of the XML Node with a specific name. + * @param[in] sName - Name of the child. + * @return returns the list of child nodes. + */ + virtual ICustomXMLNodes * GetChildrenByName(const std::string & sName) = 0; + /** + * ICustomXMLNode::HasChild - Returns if a child with a specific name exist. + * @param[in] sName - Name of the child. + * @return returns if a child with a specific name exists. + */ + virtual bool HasChild(const std::string & sName) = 0; -/************************************************************************************************************************* - Class interface for ColorGroupIterator -**************************************************************************************************************************/ + /** + * ICustomXMLNode::HasUniqueChild - Returns if a child with a specific name exist once and only once. + * @param[in] sName - Name of the child. + * @return returns if a child with a specific name exists once and only once. + */ + virtual bool HasUniqueChild(const std::string & sName) = 0; -class IColorGroupIterator : public virtual IResourceIterator { -public: /** - * IColorGroupIterator::ClassTypeId - Get Class Type Id - * @return Class type as a 64 bits integer + * ICustomXMLNode::FindChild - Returns child with a specific name. Throws an error if name does not exist once and only once. + * @param[in] sName - Name of the child. + * @param[in] bMustExist - If true, the call fails if child does not exist. If falls, the call will return null if the child does not exist. + * @return returns child instance or null. */ - Lib3MF_uint64 ClassTypeId() override - { - return 0x10274A1757C729C0UL; // First 64 bits of SHA1 of a string: "Lib3MF::ColorGroupIterator" - } + virtual ICustomXMLNode * FindChild(const std::string & sName, const bool bMustExist) = 0; /** - * IColorGroupIterator::GetCurrentColorGroup - Returns the ColorGroup the iterator points at. - * @return returns the ColorGroup instance. + * ICustomXMLNode::AddChild - Adds a new child with a specific name. + * @param[in] sName - Name of the child. + * @return returns child instance. */ - virtual IColorGroup * GetCurrentColorGroup() = 0; + virtual ICustomXMLNode * AddChild(const std::string & sName) = 0; + + /** + * ICustomXMLNode::RemoveChild - Removes a specific child. All subsequent calls to the child will fail after the call. + * @param[in] pChildInstance - child instance to remove. Fails if given instance is not a child of the node. + */ + virtual void RemoveChild(ICustomXMLNode* pChildInstance) = 0; + + /** + * ICustomXMLNode::RemoveChildrenWithName - Removes all children with a specific name. Does nothing if no child with the name exists. All subsequent calls to the deleted children will fail after the call. + * @param[in] sName - Name of the children. + * @return Returns how many children have been deleted. + */ + virtual Lib3MF_uint64 RemoveChildrenWithName(const std::string & sName) = 0; + + /** + * ICustomXMLNode::Remove - Removes the node from its parent. The root node of the document can not be removed. Any subsequent call to the node fails after this. + */ + virtual void Remove() = 0; }; -typedef IBaseSharedPtr PIColorGroupIterator; +typedef IBaseSharedPtr PICustomXMLNode; /************************************************************************************************************************* - Class interface for Texture2DGroupIterator + Class interface for CustomXMLNodes **************************************************************************************************************************/ -class ITexture2DGroupIterator : public virtual IResourceIterator { +class ICustomXMLNodes : public virtual IBase { public: /** - * ITexture2DGroupIterator::ClassTypeId - Get Class Type Id + * ICustomXMLNodes::ClassTypeId - Get Class Type Id * @return Class type as a 64 bits integer */ Lib3MF_uint64 ClassTypeId() override { - return 0x30D55F4DB88FE0CAUL; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2DGroupIterator" + return 0x8C4B47C97D310E89UL; // First 64 bits of SHA1 of a string: "Lib3MF::CustomXMLNodes" } /** - * ITexture2DGroupIterator::GetCurrentTexture2DGroup - Returns the Texture2DGroup the iterator points at. - * @return returns the Texture2DGroup instance. + * ICustomXMLNodes::GetNodeCount - Returns number of nodes. + * @return returns the number of nodes in the list. */ - virtual ITexture2DGroup * GetCurrentTexture2DGroup() = 0; + virtual Lib3MF_uint64 GetNodeCount() = 0; -}; + /** + * ICustomXMLNodes::GetNode - Returns node instance. Fails if Index is out of range. + * @param[in] nIndex - Index of the node to return (0-based). + * @return XML Node node. + */ + virtual ICustomXMLNode * GetNode(const Lib3MF_uint64 nIndex) = 0; -typedef IBaseSharedPtr PITexture2DGroupIterator; + /** + * ICustomXMLNodes::CountNodesByName - Returns how many nodes of the XML Node have a specific name. + * @param[in] sName - Name of the node. + * @return returns the number of nodes with the specified name. + */ + virtual Lib3MF_uint64 CountNodesByName(const std::string & sName) = 0; + /** + * ICustomXMLNodes::GetNodesByName - Returns all the nodes nodes of the XML Node with a specific name. + * @param[in] sName - Name of the node. + * @return returns the list of node nodes. + */ + virtual ICustomXMLNodes * GetNodesByName(const std::string & sName) = 0; -/************************************************************************************************************************* - Class interface for CompositeMaterialsIterator -**************************************************************************************************************************/ + /** + * ICustomXMLNodes::HasNode - Returns if a node with a specific name exist. + * @param[in] sName - Name of the node. + * @return returns if a node with a specific name exists. + */ + virtual bool HasNode(const std::string & sName) = 0; -class ICompositeMaterialsIterator : public virtual IResourceIterator { -public: /** - * ICompositeMaterialsIterator::ClassTypeId - Get Class Type Id - * @return Class type as a 64 bits integer + * ICustomXMLNodes::HasUniqueNode - Returns if a node with a specific name exist once and only once. + * @param[in] sName - Name of the node. + * @return returns if a node with a specific name exists once and only once. */ - Lib3MF_uint64 ClassTypeId() override - { - return 0xA99CC6C3F70FB6F9UL; // First 64 bits of SHA1 of a string: "Lib3MF::CompositeMaterialsIterator" - } + virtual bool HasUniqueNode(const std::string & sName) = 0; /** - * ICompositeMaterialsIterator::GetCurrentCompositeMaterials - Returns the CompositeMaterials the iterator points at. - * @return returns the CompositeMaterials instance. + * ICustomXMLNodes::FindNode - Returns node with a specific name. Throws an error if name does not exist once and only once. + * @param[in] sName - Name of the node. + * @param[in] bMustExist - If true, the call fails if node does not exist. If falls, the call will return null if the node does not exist. + * @return returns node instance. */ - virtual ICompositeMaterials * GetCurrentCompositeMaterials() = 0; + virtual ICustomXMLNode * FindNode(const std::string & sName, const bool bMustExist) = 0; }; -typedef IBaseSharedPtr PICompositeMaterialsIterator; +typedef IBaseSharedPtr PICustomXMLNodes; /************************************************************************************************************************* - Class interface for MultiPropertyGroupIterator + Class interface for CustomDOMTree **************************************************************************************************************************/ -class IMultiPropertyGroupIterator : public virtual IResourceIterator { +class ICustomDOMTree : public virtual IBase { public: /** - * IMultiPropertyGroupIterator::ClassTypeId - Get Class Type Id + * ICustomDOMTree::ClassTypeId - Get Class Type Id * @return Class type as a 64 bits integer */ Lib3MF_uint64 ClassTypeId() override { - return 0xC2BDF5D8CBBDB1F0UL; // First 64 bits of SHA1 of a string: "Lib3MF::MultiPropertyGroupIterator" + return 0x5E0CF70A6DB6256AUL; // First 64 bits of SHA1 of a string: "Lib3MF::CustomDOMTree" } /** - * IMultiPropertyGroupIterator::GetCurrentMultiPropertyGroup - Returns the MultiPropertyGroup the iterator points at. - * @return returns the MultiPropertyGroup instance. + * ICustomDOMTree::GetNameSpace - Returns the namespace identifier for the DOM Tree. + * @return returns the namespace of the DOM Tree. */ - virtual IMultiPropertyGroup * GetCurrentMultiPropertyGroup() = 0; + virtual std::string GetNameSpace() = 0; + + /** + * ICustomDOMTree::GetRootNode - Returns root node of the tree. + * @return Root node of the document. + */ + virtual ICustomXMLNode * GetRootNode() = 0; + + /** + * ICustomDOMTree::SaveToString - Saves the XML tree into a string. + * @return String with the XML Content. + */ + virtual std::string SaveToString() = 0; }; -typedef IBaseSharedPtr PIMultiPropertyGroupIterator; +typedef IBaseSharedPtr PICustomDOMTree; /************************************************************************************************************************* - Class interface for MetaData + Class interface for SliceStackIterator **************************************************************************************************************************/ -class IMetaData : public virtual IBase { +class ISliceStackIterator : public virtual IResourceIterator { public: /** - * IMetaData::ClassTypeId - Get Class Type Id + * ISliceStackIterator::ClassTypeId - Get Class Type Id * @return Class type as a 64 bits integer */ Lib3MF_uint64 ClassTypeId() override { - return 0xD17716D063DE2C22UL; // First 64 bits of SHA1 of a string: "Lib3MF::MetaData" + return 0x69684DB99FA813F6UL; // First 64 bits of SHA1 of a string: "Lib3MF::SliceStackIterator" } /** - * IMetaData::GetNameSpace - returns the namespace URL of the metadata - * @return the namespace URL of the metadata + * ISliceStackIterator::GetCurrentSliceStack - Returns the SliceStack the iterator points at. + * @return returns the SliceStack instance. */ - virtual std::string GetNameSpace() = 0; + virtual ISliceStack * GetCurrentSliceStack() = 0; - /** - * IMetaData::SetNameSpace - sets a new namespace URL of the metadata - * @param[in] sNameSpace - the new namespace URL of the metadata - */ - virtual void SetNameSpace(const std::string & sNameSpace) = 0; +}; - /** - * IMetaData::GetName - returns the name of a metadata - * @return the name of the metadata - */ - virtual std::string GetName() = 0; +typedef IBaseSharedPtr PISliceStackIterator; - /** - * IMetaData::SetName - sets a new name of a metadata - * @param[in] sName - the new name of the metadata - */ - virtual void SetName(const std::string & sName) = 0; - /** - * IMetaData::GetKey - returns the (namespace+name) of a metadata - * @return the key (namespace+name) of the metadata - */ - virtual std::string GetKey() = 0; +/************************************************************************************************************************* + Class interface for ObjectIterator +**************************************************************************************************************************/ +class IObjectIterator : public virtual IResourceIterator { +public: /** - * IMetaData::GetMustPreserve - returns, whether a metadata must be preserved - * @return returns, whether a metadata must be preserved + * IObjectIterator::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer */ - virtual bool GetMustPreserve() = 0; + Lib3MF_uint64 ClassTypeId() override + { + return 0xDE92510BD2112288UL; // First 64 bits of SHA1 of a string: "Lib3MF::ObjectIterator" + } /** - * IMetaData::SetMustPreserve - sets whether a metadata must be preserved - * @param[in] bMustPreserve - a new value whether a metadata must be preserved + * IObjectIterator::GetCurrentObject - Returns the Object the iterator points at. + * @return returns the Object instance. */ - virtual void SetMustPreserve(const bool bMustPreserve) = 0; + virtual IObject * GetCurrentObject() = 0; - /** - * IMetaData::GetType - returns the type of a metadata - * @return the type of the metadata - */ - virtual std::string GetType() = 0; +}; - /** - * IMetaData::SetType - sets a new type of a metadata. This must be a simple XML type - * @param[in] sType - a new type of the metadata - */ - virtual void SetType(const std::string & sType) = 0; +typedef IBaseSharedPtr PIObjectIterator; + + +/************************************************************************************************************************* + Class interface for MeshObjectIterator +**************************************************************************************************************************/ +class IMeshObjectIterator : public virtual IResourceIterator { +public: /** - * IMetaData::GetValue - returns the value of the metadata - * @return the value of the metadata + * IMeshObjectIterator::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer */ - virtual std::string GetValue() = 0; + Lib3MF_uint64 ClassTypeId() override + { + return 0xF4196034E2B9FDE6UL; // First 64 bits of SHA1 of a string: "Lib3MF::MeshObjectIterator" + } /** - * IMetaData::SetValue - sets a new value of the metadata - * @param[in] sValue - a new value of the metadata + * IMeshObjectIterator::GetCurrentMeshObject - Returns the MeshObject the iterator points at. + * @return returns the MeshObject instance. */ - virtual void SetValue(const std::string & sValue) = 0; + virtual IMeshObject * GetCurrentMeshObject() = 0; }; -typedef IBaseSharedPtr PIMetaData; +typedef IBaseSharedPtr PIMeshObjectIterator; /************************************************************************************************************************* - Class interface for MetaDataGroup + Class interface for ComponentsObjectIterator **************************************************************************************************************************/ -class IMetaDataGroup : public virtual IBase { +class IComponentsObjectIterator : public virtual IResourceIterator { public: /** - * IMetaDataGroup::ClassTypeId - Get Class Type Id + * IComponentsObjectIterator::ClassTypeId - Get Class Type Id * @return Class type as a 64 bits integer */ Lib3MF_uint64 ClassTypeId() override { - return 0xC3B85369E9B25D3UL; // First 64 bits of SHA1 of a string: "Lib3MF::MetaDataGroup" + return 0x564DE4217ED7614AUL; // First 64 bits of SHA1 of a string: "Lib3MF::ComponentsObjectIterator" } /** - * IMetaDataGroup::GetMetaDataCount - returns the number of metadata in this metadatagroup - * @return returns the number metadata + * IComponentsObjectIterator::GetCurrentComponentsObject - Returns the ComponentsObject the iterator points at. + * @return returns the ComponentsObject instance. */ - virtual Lib3MF_uint32 GetMetaDataCount() = 0; + virtual IComponentsObject * GetCurrentComponentsObject() = 0; - /** - * IMetaDataGroup::GetMetaData - returns a metadata value within this metadatagroup - * @param[in] nIndex - Index of the Metadata. - * @return an instance of the metadata - */ - virtual IMetaData * GetMetaData(const Lib3MF_uint32 nIndex) = 0; +}; - /** - * IMetaDataGroup::GetMetaDataByKey - returns a metadata value within this metadatagroup - * @param[in] sNameSpace - the namespace of the metadata - * @param[in] sName - the name of the Metadata - * @return an instance of the metadata - */ - virtual IMetaData * GetMetaDataByKey(const std::string & sNameSpace, const std::string & sName) = 0; +typedef IBaseSharedPtr PIComponentsObjectIterator; - /** - * IMetaDataGroup::RemoveMetaDataByIndex - removes metadata by index from the model. - * @param[in] nIndex - Index of the metadata to remove - */ - virtual void RemoveMetaDataByIndex(const Lib3MF_uint32 nIndex) = 0; +/************************************************************************************************************************* + Class interface for Texture2DIterator +**************************************************************************************************************************/ + +class ITexture2DIterator : public virtual IResourceIterator { +public: /** - * IMetaDataGroup::RemoveMetaData - removes metadata from the model. - * @param[in] pTheMetaData - The metadata to remove + * ITexture2DIterator::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer */ - virtual void RemoveMetaData(IMetaData* pTheMetaData) = 0; + Lib3MF_uint64 ClassTypeId() override + { + return 0x4BD32B4870FFC03BUL; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2DIterator" + } /** - * IMetaDataGroup::AddMetaData - adds a new metadata to this metadatagroup - * @param[in] sNameSpace - the namespace of the metadata - * @param[in] sName - the name of the metadata - * @param[in] sValue - the value of the metadata - * @param[in] sType - the type of the metadata - * @param[in] bMustPreserve - shuold the metadata be preserved - * @return a new instance of the metadata + * ITexture2DIterator::GetCurrentTexture2D - Returns the Texture2D the iterator points at. + * @return returns the Texture2D instance. */ - virtual IMetaData * AddMetaData(const std::string & sNameSpace, const std::string & sName, const std::string & sValue, const std::string & sType, const bool bMustPreserve) = 0; + virtual ITexture2D * GetCurrentTexture2D() = 0; }; -typedef IBaseSharedPtr PIMetaDataGroup; +typedef IBaseSharedPtr PITexture2DIterator; /************************************************************************************************************************* - Class interface for Object + Class interface for BaseMaterialGroupIterator **************************************************************************************************************************/ -class IObject : public virtual IResource { +class IBaseMaterialGroupIterator : public virtual IResourceIterator { public: /** - * IObject::ClassTypeId - Get Class Type Id + * IBaseMaterialGroupIterator::ClassTypeId - Get Class Type Id * @return Class type as a 64 bits integer */ Lib3MF_uint64 ClassTypeId() override { - return 0x2DA2136F577A779CUL; // First 64 bits of SHA1 of a string: "Lib3MF::Object" + return 0x65E6EDD9362C79CBUL; // First 64 bits of SHA1 of a string: "Lib3MF::BaseMaterialGroupIterator" } /** - * IObject::GetType - Retrieves an object's type - * @return returns object type enum. + * IBaseMaterialGroupIterator::GetCurrentBaseMaterialGroup - Returns the MaterialGroup the iterator points at. + * @return returns the BaseMaterialGroup instance. */ - virtual Lib3MF::eObjectType GetType() = 0; + virtual IBaseMaterialGroup * GetCurrentBaseMaterialGroup() = 0; - /** - * IObject::SetType - Sets an object's type - * @param[in] eObjectType - object type enum. - */ - virtual void SetType(const Lib3MF::eObjectType eObjectType) = 0; +}; - /** - * IObject::GetName - Retrieves an object's name - * @return returns object name. - */ - virtual std::string GetName() = 0; +typedef IBaseSharedPtr PIBaseMaterialGroupIterator; - /** - * IObject::SetName - Sets an object's name string - * @param[in] sName - new object name. - */ - virtual void SetName(const std::string & sName) = 0; - /** - * IObject::GetPartNumber - Retrieves an object's part number - * @return returns object part number. - */ - virtual std::string GetPartNumber() = 0; +/************************************************************************************************************************* + Class interface for ColorGroupIterator +**************************************************************************************************************************/ +class IColorGroupIterator : public virtual IResourceIterator { +public: /** - * IObject::SetPartNumber - Sets an objects partnumber string - * @param[in] sPartNumber - new object part number. + * IColorGroupIterator::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer */ - virtual void SetPartNumber(const std::string & sPartNumber) = 0; + Lib3MF_uint64 ClassTypeId() override + { + return 0x10274A1757C729C0UL; // First 64 bits of SHA1 of a string: "Lib3MF::ColorGroupIterator" + } /** - * IObject::IsMeshObject - Retrieves, if an object is a mesh object - * @return returns, whether the object is a mesh object + * IColorGroupIterator::GetCurrentColorGroup - Returns the ColorGroup the iterator points at. + * @return returns the ColorGroup instance. */ - virtual bool IsMeshObject() = 0; + virtual IColorGroup * GetCurrentColorGroup() = 0; - /** - * IObject::IsComponentsObject - Retrieves, if an object is a components object - * @return returns, whether the object is a components object - */ - virtual bool IsComponentsObject() = 0; +}; - /** - * IObject::IsValid - Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. - * @return returns whether the object is a valid object description - */ - virtual bool IsValid() = 0; +typedef IBaseSharedPtr PIColorGroupIterator; - /** - * IObject::SetAttachmentAsThumbnail - Use an existing attachment as thumbnail for this object - * @param[in] pAttachment - Instance of a new or the existing thumbnailattachment object. - */ - virtual void SetAttachmentAsThumbnail(IAttachment* pAttachment) = 0; +/************************************************************************************************************************* + Class interface for Texture2DGroupIterator +**************************************************************************************************************************/ + +class ITexture2DGroupIterator : public virtual IResourceIterator { +public: /** - * IObject::GetThumbnailAttachment - Get the attachment containing the object thumbnail. - * @return Instance of the thumbnailattachment object or NULL. + * ITexture2DGroupIterator::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer */ - virtual IAttachment * GetThumbnailAttachment() = 0; + Lib3MF_uint64 ClassTypeId() override + { + return 0x30D55F4DB88FE0CAUL; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2DGroupIterator" + } /** - * IObject::ClearThumbnailAttachment - Clears the attachment. The attachment instance is not removed from the package. + * ITexture2DGroupIterator::GetCurrentTexture2DGroup - Returns the Texture2DGroup the iterator points at. + * @return returns the Texture2DGroup instance. */ - virtual void ClearThumbnailAttachment() = 0; + virtual ITexture2DGroup * GetCurrentTexture2DGroup() = 0; - /** - * IObject::GetOutbox - Returns the outbox of a build item - * @return Outbox of this build item - */ - virtual Lib3MF::sBox GetOutbox() = 0; +}; - /** - * IObject::GetUUID - Retrieves an object's uuid string (see production extension specification) - * @param[out] bHasUUID - flag whether the build item has a UUID - * @return returns object uuid. - */ - virtual std::string GetUUID(bool & bHasUUID) = 0; +typedef IBaseSharedPtr PITexture2DGroupIterator; - /** - * IObject::SetUUID - Sets a build object's uuid string (see production extension specification) - * @param[in] sUUID - new object uuid string. - */ - virtual void SetUUID(const std::string & sUUID) = 0; - /** - * IObject::GetMetaDataGroup - Returns the metadatagroup of this object - * @return returns an Instance of the metadatagroup of this object - */ - virtual IMetaDataGroup * GetMetaDataGroup() = 0; +/************************************************************************************************************************* + Class interface for CompositeMaterialsIterator +**************************************************************************************************************************/ +class ICompositeMaterialsIterator : public virtual IResourceIterator { +public: /** - * IObject::SetSlicesMeshResolution - set the meshresolution of the mesh object - * @param[in] eMeshResolution - meshresolution of this object + * ICompositeMaterialsIterator::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer */ - virtual void SetSlicesMeshResolution(const Lib3MF::eSlicesMeshResolution eMeshResolution) = 0; + Lib3MF_uint64 ClassTypeId() override + { + return 0xA99CC6C3F70FB6F9UL; // First 64 bits of SHA1 of a string: "Lib3MF::CompositeMaterialsIterator" + } /** - * IObject::GetSlicesMeshResolution - get the meshresolution of the mesh object - * @return meshresolution of this object + * ICompositeMaterialsIterator::GetCurrentCompositeMaterials - Returns the CompositeMaterials the iterator points at. + * @return returns the CompositeMaterials instance. */ - virtual Lib3MF::eSlicesMeshResolution GetSlicesMeshResolution() = 0; + virtual ICompositeMaterials * GetCurrentCompositeMaterials() = 0; - /** - * IObject::HasSlices - returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack - * @param[in] bRecursive - check also all referenced objects? - * @return does the object have a slice stack? - */ - virtual bool HasSlices(const bool bRecursive) = 0; +}; - /** - * IObject::ClearSliceStack - unlinks the attached slicestack from this object. If no slice stack is attached, do noting. - */ - virtual void ClearSliceStack() = 0; +typedef IBaseSharedPtr PICompositeMaterialsIterator; + + +/************************************************************************************************************************* + Class interface for MultiPropertyGroupIterator +**************************************************************************************************************************/ +class IMultiPropertyGroupIterator : public virtual IResourceIterator { +public: /** - * IObject::GetSliceStack - get the Slicestack attached to the object - * @return returns the slicestack instance + * IMultiPropertyGroupIterator::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer */ - virtual ISliceStack * GetSliceStack() = 0; + Lib3MF_uint64 ClassTypeId() override + { + return 0xC2BDF5D8CBBDB1F0UL; // First 64 bits of SHA1 of a string: "Lib3MF::MultiPropertyGroupIterator" + } /** - * IObject::AssignSliceStack - assigns a slicestack to the object - * @param[in] pSliceStackInstance - the new slice stack of this Object + * IMultiPropertyGroupIterator::GetCurrentMultiPropertyGroup - Returns the MultiPropertyGroup the iterator points at. + * @return returns the MultiPropertyGroup instance. */ - virtual void AssignSliceStack(ISliceStack* pSliceStackInstance) = 0; + virtual IMultiPropertyGroup * GetCurrentMultiPropertyGroup() = 0; }; -typedef IBaseSharedPtr PIObject; +typedef IBaseSharedPtr PIMultiPropertyGroupIterator; /************************************************************************************************************************* - Class interface for MeshObject + Class interface for MetaData **************************************************************************************************************************/ -class IMeshObject : public virtual IObject { +class IMetaData : public virtual IBase { public: /** - * IMeshObject::ClassTypeId - Get Class Type Id + * IMetaData::ClassTypeId - Get Class Type Id * @return Class type as a 64 bits integer */ Lib3MF_uint64 ClassTypeId() override { - return 0x3B3A6DC6EC610497UL; // First 64 bits of SHA1 of a string: "Lib3MF::MeshObject" + return 0xD17716D063DE2C22UL; // First 64 bits of SHA1 of a string: "Lib3MF::MetaData" } /** - * IMeshObject::GetVertexCount - Returns the vertex count of a mesh object. - * @return filled with the vertex count. + * IMetaData::GetNameSpace - returns the namespace URL of the metadata + * @return the namespace URL of the metadata */ - virtual Lib3MF_uint32 GetVertexCount() = 0; + virtual std::string GetNameSpace() = 0; /** - * IMeshObject::GetTriangleCount - Returns the triangle count of a mesh object. - * @return filled with the triangle count. + * IMetaData::SetNameSpace - sets a new namespace URL of the metadata + * @param[in] sNameSpace - the new namespace URL of the metadata */ - virtual Lib3MF_uint32 GetTriangleCount() = 0; + virtual void SetNameSpace(const std::string & sNameSpace) = 0; /** - * IMeshObject::GetVertex - Returns the vertex count of a mesh object. - * @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) - * @return filled with the vertex coordinates. + * IMetaData::GetName - returns the name of a metadata + * @return the name of the metadata */ - virtual Lib3MF::sPosition GetVertex(const Lib3MF_uint32 nIndex) = 0; + virtual std::string GetName() = 0; /** - * IMeshObject::SetVertex - Sets the coordinates of a single vertex of a mesh object - * @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) - * @param[in] Coordinates - contains the vertex coordinates. + * IMetaData::SetName - sets a new name of a metadata + * @param[in] sName - the new name of the metadata */ - virtual void SetVertex(const Lib3MF_uint32 nIndex, const Lib3MF::sPosition Coordinates) = 0; + virtual void SetName(const std::string & sName) = 0; /** - * IMeshObject::AddVertex - Adds a single vertex to a mesh object - * @param[in] Coordinates - contains the vertex coordinates. - * @return Index of the new vertex + * IMetaData::GetKey - returns the (namespace+name) of a metadata + * @return the key (namespace+name) of the metadata */ - virtual Lib3MF_uint32 AddVertex(const Lib3MF::sPosition Coordinates) = 0; + virtual std::string GetKey() = 0; /** - * IMeshObject::GetVertices - Obtains all vertex positions of a mesh object - * @param[in] nVerticesBufferSize - Number of elements in buffer - * @param[out] pVerticesNeededCount - will be filled with the count of the written structs, or needed buffer size. - * @param[out] pVerticesBuffer - Position buffer of contains the vertex coordinates. + * IMetaData::GetMustPreserve - returns, whether a metadata must be preserved + * @return returns, whether a metadata must be preserved */ - virtual void GetVertices(Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, Lib3MF::sPosition * pVerticesBuffer) = 0; + virtual bool GetMustPreserve() = 0; /** - * IMeshObject::GetTriangle - Returns indices of a single triangle of a mesh object. - * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) - * @return filled with the triangle indices. + * IMetaData::SetMustPreserve - sets whether a metadata must be preserved + * @param[in] bMustPreserve - a new value whether a metadata must be preserved */ - virtual Lib3MF::sTriangle GetTriangle(const Lib3MF_uint32 nIndex) = 0; + virtual void SetMustPreserve(const bool bMustPreserve) = 0; /** - * IMeshObject::SetTriangle - Sets the indices of a single triangle of a mesh object. - * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) - * @param[in] Indices - contains the triangle indices. + * IMetaData::GetType - returns the type of a metadata + * @return the type of the metadata */ - virtual void SetTriangle(const Lib3MF_uint32 nIndex, const Lib3MF::sTriangle Indices) = 0; + virtual std::string GetType() = 0; /** - * IMeshObject::AddTriangle - Adds a single triangle to a mesh object - * @param[in] Indices - contains the triangle indices. - * @return Index of the new triangle + * IMetaData::SetType - sets a new type of a metadata. This must be a simple XML type + * @param[in] sType - a new type of the metadata */ - virtual Lib3MF_uint32 AddTriangle(const Lib3MF::sTriangle Indices) = 0; + virtual void SetType(const std::string & sType) = 0; /** - * IMeshObject::GetTriangleIndices - Get all triangles of a mesh object - * @param[in] nIndicesBufferSize - Number of elements in buffer - * @param[out] pIndicesNeededCount - will be filled with the count of the written structs, or needed buffer size. - * @param[out] pIndicesBuffer - Triangle buffer of contains the triangle indices. + * IMetaData::GetValue - returns the value of the metadata + * @return the value of the metadata */ - virtual void GetTriangleIndices(Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF::sTriangle * pIndicesBuffer) = 0; + virtual std::string GetValue() = 0; /** - * IMeshObject::SetObjectLevelProperty - Sets the property at the object-level of the mesh object. - * @param[in] nUniqueResourceID - the object-level Property UniqueResourceID. - * @param[in] nPropertyID - the object-level PropertyID. + * IMetaData::SetValue - sets a new value of the metadata + * @param[in] sValue - a new value of the metadata */ - virtual void SetObjectLevelProperty(const Lib3MF_uint32 nUniqueResourceID, const Lib3MF_uint32 nPropertyID) = 0; + virtual void SetValue(const std::string & sValue) = 0; - /** - * IMeshObject::GetObjectLevelProperty - Gets the property at the object-level of the mesh object. - * @param[out] nUniqueResourceID - the object-level Property UniqueResourceID. - * @param[out] nPropertyID - the object-level PropertyID. - * @return Has an object-level property been specified? - */ - virtual bool GetObjectLevelProperty(Lib3MF_uint32 & nUniqueResourceID, Lib3MF_uint32 & nPropertyID) = 0; +}; + +typedef IBaseSharedPtr PIMetaData; - /** - * IMeshObject::SetTriangleProperties - Sets the properties of a single triangle of a mesh object. - * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) - * @param[in] Properties - contains the triangle properties. - */ - virtual void SetTriangleProperties(const Lib3MF_uint32 nIndex, const Lib3MF::sTriangleProperties Properties) = 0; +/************************************************************************************************************************* + Class interface for MetaDataGroup +**************************************************************************************************************************/ + +class IMetaDataGroup : public virtual IBase { +public: /** - * IMeshObject::GetTriangleProperties - Gets the properties of a single triangle of a mesh object. - * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) - * @param[out] sProperty - returns the triangle properties. + * IMetaDataGroup::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer */ - virtual void GetTriangleProperties(const Lib3MF_uint32 nIndex, Lib3MF::sTriangleProperties & sProperty) = 0; + Lib3MF_uint64 ClassTypeId() override + { + return 0xC3B85369E9B25D3UL; // First 64 bits of SHA1 of a string: "Lib3MF::MetaDataGroup" + } /** - * IMeshObject::SetAllTriangleProperties - Sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. - * @param[in] nPropertiesArrayBufferSize - Number of elements in buffer - * @param[in] pPropertiesArrayBuffer - contains the triangle properties array. Must have trianglecount elements. + * IMetaDataGroup::GetMetaDataCount - returns the number of metadata in this metadatagroup + * @return returns the number metadata */ - virtual void SetAllTriangleProperties(const Lib3MF_uint64 nPropertiesArrayBufferSize, const Lib3MF::sTriangleProperties * pPropertiesArrayBuffer) = 0; + virtual Lib3MF_uint32 GetMetaDataCount() = 0; /** - * IMeshObject::GetAllTriangleProperties - Gets the properties of all triangles of a mesh object. - * @param[in] nPropertiesArrayBufferSize - Number of elements in buffer - * @param[out] pPropertiesArrayNeededCount - will be filled with the count of the written structs, or needed buffer size. - * @param[out] pPropertiesArrayBuffer - TriangleProperties buffer of returns the triangle properties array. Must have trianglecount elements. + * IMetaDataGroup::GetMetaData - returns a metadata value within this metadatagroup + * @param[in] nIndex - Index of the Metadata. + * @return an instance of the metadata */ - virtual void GetAllTriangleProperties(Lib3MF_uint64 nPropertiesArrayBufferSize, Lib3MF_uint64* pPropertiesArrayNeededCount, Lib3MF::sTriangleProperties * pPropertiesArrayBuffer) = 0; + virtual IMetaData * GetMetaData(const Lib3MF_uint32 nIndex) = 0; /** - * IMeshObject::ClearAllProperties - Clears all properties of this mesh object (triangle and object-level). + * IMetaDataGroup::GetMetaDataByKey - returns a metadata value within this metadatagroup + * @param[in] sNameSpace - the namespace of the metadata + * @param[in] sName - the name of the Metadata + * @return an instance of the metadata */ - virtual void ClearAllProperties() = 0; + virtual IMetaData * GetMetaDataByKey(const std::string & sNameSpace, const std::string & sName) = 0; /** - * IMeshObject::SetGeometry - Set all triangles of a mesh object - * @param[in] nVerticesBufferSize - Number of elements in buffer - * @param[in] pVerticesBuffer - contains the positions. - * @param[in] nIndicesBufferSize - Number of elements in buffer - * @param[in] pIndicesBuffer - contains the triangle indices. + * IMetaDataGroup::RemoveMetaDataByIndex - removes metadata by index from the model. + * @param[in] nIndex - Index of the metadata to remove */ - virtual void SetGeometry(const Lib3MF_uint64 nVerticesBufferSize, const Lib3MF::sPosition * pVerticesBuffer, const Lib3MF_uint64 nIndicesBufferSize, const Lib3MF::sTriangle * pIndicesBuffer) = 0; + virtual void RemoveMetaDataByIndex(const Lib3MF_uint32 nIndex) = 0; /** - * IMeshObject::IsManifoldAndOriented - Retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. - * @return returns, if the object is oriented and manifold. + * IMetaDataGroup::RemoveMetaData - removes metadata from the model. + * @param[in] pTheMetaData - The metadata to remove */ - virtual bool IsManifoldAndOriented() = 0; + virtual void RemoveMetaData(IMetaData* pTheMetaData) = 0; /** - * IMeshObject::BeamLattice - Retrieves the BeamLattice within this MeshObject. - * @return the BeamLattice within this MeshObject + * IMetaDataGroup::AddMetaData - adds a new metadata to this metadatagroup + * @param[in] sNameSpace - the namespace of the metadata + * @param[in] sName - the name of the metadata + * @param[in] sValue - the value of the metadata + * @param[in] sType - the type of the metadata + * @param[in] bMustPreserve - shuold the metadata be preserved + * @return a new instance of the metadata */ - virtual IBeamLattice * BeamLattice() = 0; + virtual IMetaData * AddMetaData(const std::string & sNameSpace, const std::string & sName, const std::string & sValue, const std::string & sType, const bool bMustPreserve) = 0; }; -typedef IBaseSharedPtr PIMeshObject; +typedef IBaseSharedPtr PIMetaDataGroup; /************************************************************************************************************************* - Class interface for BeamLattice + Class interface for Object **************************************************************************************************************************/ -class IBeamLattice : public virtual IBase { +class IObject : public virtual IResource { public: /** - * IBeamLattice::ClassTypeId - Get Class Type Id + * IObject::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer + */ + Lib3MF_uint64 ClassTypeId() override + { + return 0x2DA2136F577A779CUL; // First 64 bits of SHA1 of a string: "Lib3MF::Object" + } + + /** + * IObject::GetType - Retrieves an object's type + * @return returns object type enum. + */ + virtual Lib3MF::eObjectType GetType() = 0; + + /** + * IObject::SetType - Sets an object's type + * @param[in] eObjectType - object type enum. + */ + virtual void SetType(const Lib3MF::eObjectType eObjectType) = 0; + + /** + * IObject::GetName - Retrieves an object's name + * @return returns object name. + */ + virtual std::string GetName() = 0; + + /** + * IObject::SetName - Sets an object's name string + * @param[in] sName - new object name. + */ + virtual void SetName(const std::string & sName) = 0; + + /** + * IObject::GetPartNumber - Retrieves an object's part number + * @return returns object part number. + */ + virtual std::string GetPartNumber() = 0; + + /** + * IObject::SetPartNumber - Sets an objects partnumber string + * @param[in] sPartNumber - new object part number. + */ + virtual void SetPartNumber(const std::string & sPartNumber) = 0; + + /** + * IObject::IsMeshObject - Retrieves, if an object is a mesh object + * @return returns, whether the object is a mesh object + */ + virtual bool IsMeshObject() = 0; + + /** + * IObject::IsComponentsObject - Retrieves, if an object is a components object + * @return returns, whether the object is a components object + */ + virtual bool IsComponentsObject() = 0; + + /** + * IObject::IsValid - Retrieves, if the object is valid according to the core spec. For mesh objects, we distinguish between the type attribute of the object:In case of object type other, this always means false.In case of object type model or solidsupport, this means, if the mesh suffices all requirements of the core spec chapter 4.1.In case of object type support or surface, this always means true.A component objects is valid if and only if it contains at least one component and all child components are valid objects. + * @return returns whether the object is a valid object description + */ + virtual bool IsValid() = 0; + + /** + * IObject::SetAttachmentAsThumbnail - Use an existing attachment as thumbnail for this object + * @param[in] pAttachment - Instance of a new or the existing thumbnailattachment object. + */ + virtual void SetAttachmentAsThumbnail(IAttachment* pAttachment) = 0; + + /** + * IObject::GetThumbnailAttachment - Get the attachment containing the object thumbnail. + * @return Instance of the thumbnailattachment object or NULL. + */ + virtual IAttachment * GetThumbnailAttachment() = 0; + + /** + * IObject::ClearThumbnailAttachment - Clears the attachment. The attachment instance is not removed from the package. + */ + virtual void ClearThumbnailAttachment() = 0; + + /** + * IObject::GetOutbox - Returns the outbox of a build item + * @return Outbox of this build item + */ + virtual Lib3MF::sBox GetOutbox() = 0; + + /** + * IObject::GetUUID - Retrieves an object's uuid string (see production extension specification) + * @param[out] bHasUUID - flag whether the build item has a UUID + * @return returns object uuid. + */ + virtual std::string GetUUID(bool & bHasUUID) = 0; + + /** + * IObject::SetUUID - Sets a build object's uuid string (see production extension specification) + * @param[in] sUUID - new object uuid string. + */ + virtual void SetUUID(const std::string & sUUID) = 0; + + /** + * IObject::GetMetaDataGroup - Returns the metadatagroup of this object + * @return returns an Instance of the metadatagroup of this object + */ + virtual IMetaDataGroup * GetMetaDataGroup() = 0; + + /** + * IObject::SetSlicesMeshResolution - set the meshresolution of the mesh object + * @param[in] eMeshResolution - meshresolution of this object + */ + virtual void SetSlicesMeshResolution(const Lib3MF::eSlicesMeshResolution eMeshResolution) = 0; + + /** + * IObject::GetSlicesMeshResolution - get the meshresolution of the mesh object + * @return meshresolution of this object + */ + virtual Lib3MF::eSlicesMeshResolution GetSlicesMeshResolution() = 0; + + /** + * IObject::HasSlices - returns whether the Object has a slice stack. If Recursive is true, also checks whether any references object has a slice stack + * @param[in] bRecursive - check also all referenced objects? + * @return does the object have a slice stack? + */ + virtual bool HasSlices(const bool bRecursive) = 0; + + /** + * IObject::ClearSliceStack - unlinks the attached slicestack from this object. If no slice stack is attached, do noting. + */ + virtual void ClearSliceStack() = 0; + + /** + * IObject::GetSliceStack - get the Slicestack attached to the object + * @return returns the slicestack instance + */ + virtual ISliceStack * GetSliceStack() = 0; + + /** + * IObject::AssignSliceStack - assigns a slicestack to the object + * @param[in] pSliceStackInstance - the new slice stack of this Object + */ + virtual void AssignSliceStack(ISliceStack* pSliceStackInstance) = 0; + +}; + +typedef IBaseSharedPtr PIObject; + + +/************************************************************************************************************************* + Class interface for MeshObject +**************************************************************************************************************************/ + +class IMeshObject : public virtual IObject { +public: + /** + * IMeshObject::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer + */ + Lib3MF_uint64 ClassTypeId() override + { + return 0x3B3A6DC6EC610497UL; // First 64 bits of SHA1 of a string: "Lib3MF::MeshObject" + } + + /** + * IMeshObject::GetVertexCount - Returns the vertex count of a mesh object. + * @return filled with the vertex count. + */ + virtual Lib3MF_uint32 GetVertexCount() = 0; + + /** + * IMeshObject::GetTriangleCount - Returns the triangle count of a mesh object. + * @return filled with the triangle count. + */ + virtual Lib3MF_uint32 GetTriangleCount() = 0; + + /** + * IMeshObject::GetVertex - Returns the vertex count of a mesh object. + * @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) + * @return filled with the vertex coordinates. + */ + virtual Lib3MF::sPosition GetVertex(const Lib3MF_uint32 nIndex) = 0; + + /** + * IMeshObject::SetVertex - Sets the coordinates of a single vertex of a mesh object + * @param[in] nIndex - Index of the vertex (0 to vertexcount - 1) + * @param[in] Coordinates - contains the vertex coordinates. + */ + virtual void SetVertex(const Lib3MF_uint32 nIndex, const Lib3MF::sPosition Coordinates) = 0; + + /** + * IMeshObject::AddVertex - Adds a single vertex to a mesh object + * @param[in] Coordinates - contains the vertex coordinates. + * @return Index of the new vertex + */ + virtual Lib3MF_uint32 AddVertex(const Lib3MF::sPosition Coordinates) = 0; + + /** + * IMeshObject::GetVertices - Obtains all vertex positions of a mesh object + * @param[in] nVerticesBufferSize - Number of elements in buffer + * @param[out] pVerticesNeededCount - will be filled with the count of the written structs, or needed buffer size. + * @param[out] pVerticesBuffer - Position buffer of contains the vertex coordinates. + */ + virtual void GetVertices(Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, Lib3MF::sPosition * pVerticesBuffer) = 0; + + /** + * IMeshObject::GetTriangle - Returns indices of a single triangle of a mesh object. + * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) + * @return filled with the triangle indices. + */ + virtual Lib3MF::sTriangle GetTriangle(const Lib3MF_uint32 nIndex) = 0; + + /** + * IMeshObject::SetTriangle - Sets the indices of a single triangle of a mesh object. + * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) + * @param[in] Indices - contains the triangle indices. + */ + virtual void SetTriangle(const Lib3MF_uint32 nIndex, const Lib3MF::sTriangle Indices) = 0; + + /** + * IMeshObject::AddTriangle - Adds a single triangle to a mesh object + * @param[in] Indices - contains the triangle indices. + * @return Index of the new triangle + */ + virtual Lib3MF_uint32 AddTriangle(const Lib3MF::sTriangle Indices) = 0; + + /** + * IMeshObject::GetTriangleIndices - Get all triangles of a mesh object + * @param[in] nIndicesBufferSize - Number of elements in buffer + * @param[out] pIndicesNeededCount - will be filled with the count of the written structs, or needed buffer size. + * @param[out] pIndicesBuffer - Triangle buffer of contains the triangle indices. + */ + virtual void GetTriangleIndices(Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF::sTriangle * pIndicesBuffer) = 0; + + /** + * IMeshObject::SetObjectLevelProperty - Sets the property at the object-level of the mesh object. + * @param[in] nUniqueResourceID - the object-level Property UniqueResourceID. + * @param[in] nPropertyID - the object-level PropertyID. + */ + virtual void SetObjectLevelProperty(const Lib3MF_uint32 nUniqueResourceID, const Lib3MF_uint32 nPropertyID) = 0; + + /** + * IMeshObject::GetObjectLevelProperty - Gets the property at the object-level of the mesh object. + * @param[out] nUniqueResourceID - the object-level Property UniqueResourceID. + * @param[out] nPropertyID - the object-level PropertyID. + * @return Has an object-level property been specified? + */ + virtual bool GetObjectLevelProperty(Lib3MF_uint32 & nUniqueResourceID, Lib3MF_uint32 & nPropertyID) = 0; + + /** + * IMeshObject::SetTriangleProperties - Sets the properties of a single triangle of a mesh object. + * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) + * @param[in] Properties - contains the triangle properties. + */ + virtual void SetTriangleProperties(const Lib3MF_uint32 nIndex, const Lib3MF::sTriangleProperties Properties) = 0; + + /** + * IMeshObject::GetTriangleProperties - Gets the properties of a single triangle of a mesh object. + * @param[in] nIndex - Index of the triangle (0 to trianglecount - 1) + * @param[out] sProperty - returns the triangle properties. + */ + virtual void GetTriangleProperties(const Lib3MF_uint32 nIndex, Lib3MF::sTriangleProperties & sProperty) = 0; + + /** + * IMeshObject::SetAllTriangleProperties - Sets the properties of all triangles of a mesh object. Sets the object level property to the first entry of the passed triangle properties, if not yet specified. + * @param[in] nPropertiesArrayBufferSize - Number of elements in buffer + * @param[in] pPropertiesArrayBuffer - contains the triangle properties array. Must have trianglecount elements. + */ + virtual void SetAllTriangleProperties(const Lib3MF_uint64 nPropertiesArrayBufferSize, const Lib3MF::sTriangleProperties * pPropertiesArrayBuffer) = 0; + + /** + * IMeshObject::GetAllTriangleProperties - Gets the properties of all triangles of a mesh object. + * @param[in] nPropertiesArrayBufferSize - Number of elements in buffer + * @param[out] pPropertiesArrayNeededCount - will be filled with the count of the written structs, or needed buffer size. + * @param[out] pPropertiesArrayBuffer - TriangleProperties buffer of returns the triangle properties array. Must have trianglecount elements. + */ + virtual void GetAllTriangleProperties(Lib3MF_uint64 nPropertiesArrayBufferSize, Lib3MF_uint64* pPropertiesArrayNeededCount, Lib3MF::sTriangleProperties * pPropertiesArrayBuffer) = 0; + + /** + * IMeshObject::ClearAllProperties - Clears all properties of this mesh object (triangle and object-level). + */ + virtual void ClearAllProperties() = 0; + + /** + * IMeshObject::SetGeometry - Set all triangles of a mesh object + * @param[in] nVerticesBufferSize - Number of elements in buffer + * @param[in] pVerticesBuffer - contains the positions. + * @param[in] nIndicesBufferSize - Number of elements in buffer + * @param[in] pIndicesBuffer - contains the triangle indices. + */ + virtual void SetGeometry(const Lib3MF_uint64 nVerticesBufferSize, const Lib3MF::sPosition * pVerticesBuffer, const Lib3MF_uint64 nIndicesBufferSize, const Lib3MF::sTriangle * pIndicesBuffer) = 0; + + /** + * IMeshObject::IsManifoldAndOriented - Retrieves, if an object describes a topologically oriented and manifold mesh, according to the core spec. + * @return returns, if the object is oriented and manifold. + */ + virtual bool IsManifoldAndOriented() = 0; + + /** + * IMeshObject::BeamLattice - Retrieves the BeamLattice within this MeshObject. + * @return the BeamLattice within this MeshObject + */ + virtual IBeamLattice * BeamLattice() = 0; + +}; + +typedef IBaseSharedPtr PIMeshObject; + + +/************************************************************************************************************************* + Class interface for BeamLattice +**************************************************************************************************************************/ + +class IBeamLattice : public virtual IBase { +public: + /** + * IBeamLattice::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer + */ + Lib3MF_uint64 ClassTypeId() override + { + return 0x63B3B461B30B4BA5UL; // First 64 bits of SHA1 of a string: "Lib3MF::BeamLattice" + } + + /** + * IBeamLattice::GetMinLength - Returns the minimal length of beams for the beamlattice. + * @return minimal length of beams for the beamlattice + */ + virtual Lib3MF_double GetMinLength() = 0; + + /** + * IBeamLattice::SetMinLength - Sets the minimal length of beams for the beamlattice. + * @param[in] dMinLength - minimal length of beams for the beamlattice + */ + virtual void SetMinLength(const Lib3MF_double dMinLength) = 0; + + /** + * IBeamLattice::GetClipping - Returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. + * @param[out] eClipMode - contains the clip mode of this mesh + * @param[out] nUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object or an undefined value if pClipMode is MODELBEAMLATTICECLIPMODE_NONE + */ + virtual void GetClipping(Lib3MF::eBeamLatticeClipMode & eClipMode, Lib3MF_uint32 & nUniqueResourceID) = 0; + + /** + * IBeamLattice::SetClipping - Sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. + * @param[in] eClipMode - contains the clip mode of this mesh + * @param[in] nUniqueResourceID - the UniqueResourceID of the clipping mesh-object. This mesh-object has to be defined before setting the Clipping. + */ + virtual void SetClipping(const Lib3MF::eBeamLatticeClipMode eClipMode, const Lib3MF_uint32 nUniqueResourceID) = 0; + + /** + * IBeamLattice::GetRepresentation - Returns the representation-mesh for the beamlattice of this mesh. + * @return flag whether the beamlattice has a representation mesh. + * @param[out] nUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object. + */ + virtual bool GetRepresentation(Lib3MF_uint32 & nUniqueResourceID) = 0; + + /** + * IBeamLattice::SetRepresentation - Sets the representation-mesh for the beamlattice of this mesh. + * @param[in] nUniqueResourceID - the UniqueResourceID of the representation mesh-object. This mesh-object has to be defined before setting the representation. + */ + virtual void SetRepresentation(const Lib3MF_uint32 nUniqueResourceID) = 0; + + /** + * IBeamLattice::GetBallOptions - Returns the ball mode and the default ball radius for the beamlattice of this mesh. + * @param[out] eBallMode - contains the ball mode of this mesh + * @param[out] dBallRadius - default ball radius of balls for the beamlattice + */ + virtual void GetBallOptions(Lib3MF::eBeamLatticeBallMode & eBallMode, Lib3MF_double & dBallRadius) = 0; + + /** + * IBeamLattice::SetBallOptions - Sets the ball mode and thedefault ball radius for the beamlattice. + * @param[in] eBallMode - contains the ball mode of this mesh + * @param[in] dBallRadius - default ball radius of balls for the beamlattice + */ + virtual void SetBallOptions(const Lib3MF::eBeamLatticeBallMode eBallMode, const Lib3MF_double dBallRadius) = 0; + + /** + * IBeamLattice::GetBeamCount - Returns the beam count of a mesh object. + * @return filled with the beam count. + */ + virtual Lib3MF_uint32 GetBeamCount() = 0; + + /** + * IBeamLattice::GetBeam - Returns indices, radii and capmodes of a single beam of a mesh object. + * @param[in] nIndex - Index of the beam (0 to beamcount - 1). + * @return filled with the beam indices, radii and capmodes. + */ + virtual Lib3MF::sBeam GetBeam(const Lib3MF_uint32 nIndex) = 0; + + /** + * IBeamLattice::AddBeam - Adds a single beam to a mesh object. + * @param[in] BeamInfo - contains the node indices, radii and capmodes. + * @return filled with the new Index of the beam. + */ + virtual Lib3MF_uint32 AddBeam(const Lib3MF::sBeam BeamInfo) = 0; + + /** + * IBeamLattice::SetBeam - Sets the indices, radii and capmodes of a single beam of a mesh object. + * @param[in] nIndex - Index of the beam (0 to beamcount - 1). + * @param[in] BeamInfo - filled with the beam indices, radii and capmodes. + */ + virtual void SetBeam(const Lib3MF_uint32 nIndex, const Lib3MF::sBeam BeamInfo) = 0; + + /** + * IBeamLattice::SetBeams - Sets all beam indices, radii and capmodes of a mesh object. + * @param[in] nBeamInfoBufferSize - Number of elements in buffer + * @param[in] pBeamInfoBuffer - contains information of a number of beams + */ + virtual void SetBeams(const Lib3MF_uint64 nBeamInfoBufferSize, const Lib3MF::sBeam * pBeamInfoBuffer) = 0; + + /** + * IBeamLattice::GetBeams - obtains all beam indices, radii and capmodes of a mesh object. + * @param[in] nBeamInfoBufferSize - Number of elements in buffer + * @param[out] pBeamInfoNeededCount - will be filled with the count of the written structs, or needed buffer size. + * @param[out] pBeamInfoBuffer - Beam buffer of contains information of all beams + */ + virtual void GetBeams(Lib3MF_uint64 nBeamInfoBufferSize, Lib3MF_uint64* pBeamInfoNeededCount, Lib3MF::sBeam * pBeamInfoBuffer) = 0; + + /** + * IBeamLattice::GetBallCount - Returns the ball count of a mesh object. + * @return filled with the ball count. + */ + virtual Lib3MF_uint32 GetBallCount() = 0; + + /** + * IBeamLattice::GetBall - Returns index and radius of a single ball of a mesh object. + * @param[in] nIndex - Index of the ball (0 to ballcount - 1). + * @return filled with the ball node index and radius. + */ + virtual Lib3MF::sBall GetBall(const Lib3MF_uint32 nIndex) = 0; + + /** + * IBeamLattice::AddBall - Adds a single ball to a mesh object. + * @param[in] BallInfo - contains the node index and radius. + * @return filled with the new Index of the ball. + */ + virtual Lib3MF_uint32 AddBall(const Lib3MF::sBall BallInfo) = 0; + + /** + * IBeamLattice::SetBall - Sets the index and radius of a single ball of a mesh object. + * @param[in] nIndex - Index of the ball (0 to ballcount - 1). + * @param[in] BallInfo - filled with the ball node index and radius. + */ + virtual void SetBall(const Lib3MF_uint32 nIndex, const Lib3MF::sBall BallInfo) = 0; + + /** + * IBeamLattice::SetBalls - Sets all ball indices and radii of a mesh object. + * @param[in] nBallInfoBufferSize - Number of elements in buffer + * @param[in] pBallInfoBuffer - contains information of a number of balls + */ + virtual void SetBalls(const Lib3MF_uint64 nBallInfoBufferSize, const Lib3MF::sBall * pBallInfoBuffer) = 0; + + /** + * IBeamLattice::GetBalls - obtains all ball indices and radii of a mesh object. + * @param[in] nBallInfoBufferSize - Number of elements in buffer + * @param[out] pBallInfoNeededCount - will be filled with the count of the written structs, or needed buffer size. + * @param[out] pBallInfoBuffer - Ball buffer of contains information of all balls + */ + virtual void GetBalls(Lib3MF_uint64 nBallInfoBufferSize, Lib3MF_uint64* pBallInfoNeededCount, Lib3MF::sBall * pBallInfoBuffer) = 0; + + /** + * IBeamLattice::GetBeamSetCount - Returns the number of beamsets of a mesh object. + * @return filled with the beamset count. + */ + virtual Lib3MF_uint32 GetBeamSetCount() = 0; + + /** + * IBeamLattice::AddBeamSet - Adds an empty beamset to a mesh object + * @return the new beamset + */ + virtual IBeamSet * AddBeamSet() = 0; + + /** + * IBeamLattice::GetBeamSet - Returns a beamset of a mesh object + * @param[in] nIndex - index of the requested beamset (0 ... beamsetcount-1). + * @return the requested beamset + */ + virtual IBeamSet * GetBeamSet(const Lib3MF_uint32 nIndex) = 0; + +}; + +typedef IBaseSharedPtr PIBeamLattice; + + +/************************************************************************************************************************* + Class interface for Component +**************************************************************************************************************************/ + +class IComponent : public virtual IBase { +public: + /** + * IComponent::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer + */ + Lib3MF_uint64 ClassTypeId() override + { + return 0x4ECDB6A6F69F2BEBUL; // First 64 bits of SHA1 of a string: "Lib3MF::Component" + } + + /** + * IComponent::GetObjectResource - Returns the Resource Instance of the component. + * @return filled with the Resource Instance. + */ + virtual IObject * GetObjectResource() = 0; + + /** + * IComponent::GetObjectResourceID - Returns the UniqueResourceID of the component. + * @return returns the UniqueResourceID. + */ + virtual Lib3MF_uint32 GetObjectResourceID() = 0; + + /** + * IComponent::GetUUID - returns, whether a component has a UUID and, if true, the component's UUID + * @param[out] bHasUUID - flag whether the component has a UUID + * @return the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + */ + virtual std::string GetUUID(bool & bHasUUID) = 0; + + /** + * IComponent::SetUUID - sets the component's UUID + * @param[in] sUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + */ + virtual void SetUUID(const std::string & sUUID) = 0; + + /** + * IComponent::HasTransform - Returns, if the component has a different transformation than the identity matrix + * @return if true is returned, the transformation is not equal than the identity + */ + virtual bool HasTransform() = 0; + + /** + * IComponent::GetTransform - Returns the transformation matrix of the component. + * @return filled with the component transformation matrix + */ + virtual Lib3MF::sTransform GetTransform() = 0; + + /** + * IComponent::SetTransform - Sets the transformation matrix of the component. + * @param[in] Transform - new transformation matrix + */ + virtual void SetTransform(const Lib3MF::sTransform Transform) = 0; + +}; + +typedef IBaseSharedPtr PIComponent; + + +/************************************************************************************************************************* + Class interface for ComponentsObject +**************************************************************************************************************************/ + +class IComponentsObject : public virtual IObject { +public: + /** + * IComponentsObject::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer + */ + Lib3MF_uint64 ClassTypeId() override + { + return 0x6522CF04EB283FEDUL; // First 64 bits of SHA1 of a string: "Lib3MF::ComponentsObject" + } + + /** + * IComponentsObject::AddComponent - Adds a new component to a components object. + * @param[in] pObjectResource - object to add as component. Must not lead to circular references! + * @param[in] Transform - optional transform matrix for the component. + * @return new component instance + */ + virtual IComponent * AddComponent(IObject* pObjectResource, const Lib3MF::sTransform Transform) = 0; + + /** + * IComponentsObject::GetComponent - Retrieves a component from a component object. + * @param[in] nIndex - index of the component to retrieve (0 to componentcount - 1) + * @return component instance + */ + virtual IComponent * GetComponent(const Lib3MF_uint32 nIndex) = 0; + + /** + * IComponentsObject::GetComponentCount - Retrieves a component count of a component object. + * @return returns the component count + */ + virtual Lib3MF_uint32 GetComponentCount() = 0; + +}; + +typedef IBaseSharedPtr PIComponentsObject; + + +/************************************************************************************************************************* + Class interface for BeamSet +**************************************************************************************************************************/ + +class IBeamSet : public virtual IBase { +public: + /** + * IBeamSet::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer + */ + Lib3MF_uint64 ClassTypeId() override + { + return 0x30CCDBE90E00B55BUL; // First 64 bits of SHA1 of a string: "Lib3MF::BeamSet" + } + + /** + * IBeamSet::SetName - Sets a beamset's name string + * @param[in] sName - new name of the beamset. + */ + virtual void SetName(const std::string & sName) = 0; + + /** + * IBeamSet::GetName - Retrieves a beamset's name string + * @return returns the name of the beamset. + */ + virtual std::string GetName() = 0; + + /** + * IBeamSet::SetIdentifier - Sets a beamset's identifier string + * @param[in] sIdentifier - new name of the beamset. + */ + virtual void SetIdentifier(const std::string & sIdentifier) = 0; + + /** + * IBeamSet::GetIdentifier - Retrieves a beamset's identifier string + * @return returns the identifier of the beamset. + */ + virtual std::string GetIdentifier() = 0; + + /** + * IBeamSet::GetReferenceCount - Retrieves the reference count of a beamset + * @return returns the reference count + */ + virtual Lib3MF_uint32 GetReferenceCount() = 0; + + /** + * IBeamSet::SetReferences - Sets the references of a beamset + * @param[in] nReferencesBufferSize - Number of elements in buffer + * @param[in] pReferencesBuffer - the new indices of all beams in this beamset + */ + virtual void SetReferences(const Lib3MF_uint64 nReferencesBufferSize, const Lib3MF_uint32 * pReferencesBuffer) = 0; + + /** + * IBeamSet::GetReferences - Retrieves the references of a beamset + * @param[in] nReferencesBufferSize - Number of elements in buffer + * @param[out] pReferencesNeededCount - will be filled with the count of the written structs, or needed buffer size. + * @param[out] pReferencesBuffer - uint32 buffer of retrieves the indices of all beams in this beamset + */ + virtual void GetReferences(Lib3MF_uint64 nReferencesBufferSize, Lib3MF_uint64* pReferencesNeededCount, Lib3MF_uint32 * pReferencesBuffer) = 0; + + /** + * IBeamSet::GetBallReferenceCount - Retrieves the ball reference count of a beamset + * @return returns the ball reference count + */ + virtual Lib3MF_uint32 GetBallReferenceCount() = 0; + + /** + * IBeamSet::SetBallReferences - Sets the ball references of a beamset + * @param[in] nBallReferencesBufferSize - Number of elements in buffer + * @param[in] pBallReferencesBuffer - the new indices of all balls in this beamset + */ + virtual void SetBallReferences(const Lib3MF_uint64 nBallReferencesBufferSize, const Lib3MF_uint32 * pBallReferencesBuffer) = 0; + + /** + * IBeamSet::GetBallReferences - Retrieves the ball references of a beamset + * @param[in] nBallReferencesBufferSize - Number of elements in buffer + * @param[out] pBallReferencesNeededCount - will be filled with the count of the written structs, or needed buffer size. + * @param[out] pBallReferencesBuffer - uint32 buffer of retrieves the indices of all balls in this beamset + */ + virtual void GetBallReferences(Lib3MF_uint64 nBallReferencesBufferSize, Lib3MF_uint64* pBallReferencesNeededCount, Lib3MF_uint32 * pBallReferencesBuffer) = 0; + +}; + +typedef IBaseSharedPtr PIBeamSet; + + +/************************************************************************************************************************* + Class interface for BaseMaterialGroup +**************************************************************************************************************************/ + +class IBaseMaterialGroup : public virtual IResource { +public: + /** + * IBaseMaterialGroup::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer + */ + Lib3MF_uint64 ClassTypeId() override + { + return 0xB27D4656E16609FAUL; // First 64 bits of SHA1 of a string: "Lib3MF::BaseMaterialGroup" + } + + /** + * IBaseMaterialGroup::GetCount - Retrieves the count of base materials in the material group. + * @return returns the count of base materials. + */ + virtual Lib3MF_uint32 GetCount() = 0; + + /** + * IBaseMaterialGroup::GetAllPropertyIDs - returns all the PropertyIDs of all materials in this group + * @param[in] nPropertyIDsBufferSize - Number of elements in buffer + * @param[out] pPropertyIDsNeededCount - will be filled with the count of the written structs, or needed buffer size. + * @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the material in the material group. + */ + virtual void GetAllPropertyIDs(Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) = 0; + + /** + * IBaseMaterialGroup::AddMaterial - Adds a new material to the material group + * @param[in] sName - new name of the base material. + * @param[in] DisplayColor - Display color of the material + * @return returns new PropertyID of the new material in the material group. + */ + virtual Lib3MF_uint32 AddMaterial(const std::string & sName, const Lib3MF::sColor DisplayColor) = 0; + + /** + * IBaseMaterialGroup::RemoveMaterial - Removes a material from the material group. + * @param[in] nPropertyID - PropertyID of the material in the material group. + */ + virtual void RemoveMaterial(const Lib3MF_uint32 nPropertyID) = 0; + + /** + * IBaseMaterialGroup::GetName - Returns the base material's name + * @param[in] nPropertyID - PropertyID of the material in the material group. + * @return returns the name of the base material. + */ + virtual std::string GetName(const Lib3MF_uint32 nPropertyID) = 0; + + /** + * IBaseMaterialGroup::SetName - Sets a base material's name + * @param[in] nPropertyID - PropertyID of the material in the material group. + * @param[in] sName - new name of the base material. + */ + virtual void SetName(const Lib3MF_uint32 nPropertyID, const std::string & sName) = 0; + + /** + * IBaseMaterialGroup::SetDisplayColor - Sets a base material's display color. + * @param[in] nPropertyID - PropertyID of the material in the material group. + * @param[in] TheColor - The base material's display color + */ + virtual void SetDisplayColor(const Lib3MF_uint32 nPropertyID, const Lib3MF::sColor TheColor) = 0; + + /** + * IBaseMaterialGroup::GetDisplayColor - Returns a base material's display color. + * @param[in] nPropertyID - PropertyID of the material in the material group. + * @return The base material's display color + */ + virtual Lib3MF::sColor GetDisplayColor(const Lib3MF_uint32 nPropertyID) = 0; + +}; + +typedef IBaseSharedPtr PIBaseMaterialGroup; + + +/************************************************************************************************************************* + Class interface for ColorGroup +**************************************************************************************************************************/ + +class IColorGroup : public virtual IResource { +public: + /** + * IColorGroup::ClassTypeId - Get Class Type Id * @return Class type as a 64 bits integer */ Lib3MF_uint64 ClassTypeId() override { - return 0x63B3B461B30B4BA5UL; // First 64 bits of SHA1 of a string: "Lib3MF::BeamLattice" + return 0xD085FB2E49CDB5B1UL; // First 64 bits of SHA1 of a string: "Lib3MF::ColorGroup" } /** - * IBeamLattice::GetMinLength - Returns the minimal length of beams for the beamlattice. - * @return minimal length of beams for the beamlattice + * IColorGroup::GetCount - Retrieves the count of base materials in this Color Group. + * @return returns the count of colors within this color group. */ - virtual Lib3MF_double GetMinLength() = 0; + virtual Lib3MF_uint32 GetCount() = 0; /** - * IBeamLattice::SetMinLength - Sets the minimal length of beams for the beamlattice. - * @param[in] dMinLength - minimal length of beams for the beamlattice + * IColorGroup::GetAllPropertyIDs - returns all the PropertyIDs of all colors within this group + * @param[in] nPropertyIDsBufferSize - Number of elements in buffer + * @param[out] pPropertyIDsNeededCount - will be filled with the count of the written structs, or needed buffer size. + * @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the color in the color group. */ - virtual void SetMinLength(const Lib3MF_double dMinLength) = 0; + virtual void GetAllPropertyIDs(Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) = 0; /** - * IBeamLattice::GetClipping - Returns the clipping mode and the clipping-mesh for the beamlattice of this mesh. - * @param[out] eClipMode - contains the clip mode of this mesh - * @param[out] nUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object or an undefined value if pClipMode is MODELBEAMLATTICECLIPMODE_NONE + * IColorGroup::AddColor - Adds a new value. + * @param[in] TheColor - The new color + * @return PropertyID of the new color within this color group. */ - virtual void GetClipping(Lib3MF::eBeamLatticeClipMode & eClipMode, Lib3MF_uint32 & nUniqueResourceID) = 0; + virtual Lib3MF_uint32 AddColor(const Lib3MF::sColor TheColor) = 0; /** - * IBeamLattice::SetClipping - Sets the clipping mode and the clipping-mesh for the beamlattice of this mesh. - * @param[in] eClipMode - contains the clip mode of this mesh - * @param[in] nUniqueResourceID - the UniqueResourceID of the clipping mesh-object. This mesh-object has to be defined before setting the Clipping. + * IColorGroup::RemoveColor - Removes a color from the color group. + * @param[in] nPropertyID - PropertyID of the color to be removed from the color group. */ - virtual void SetClipping(const Lib3MF::eBeamLatticeClipMode eClipMode, const Lib3MF_uint32 nUniqueResourceID) = 0; + virtual void RemoveColor(const Lib3MF_uint32 nPropertyID) = 0; /** - * IBeamLattice::GetRepresentation - Returns the representation-mesh for the beamlattice of this mesh. - * @return flag whether the beamlattice has a representation mesh. - * @param[out] nUniqueResourceID - filled with the UniqueResourceID of the clipping mesh-object. + * IColorGroup::SetColor - Sets a color value. + * @param[in] nPropertyID - PropertyID of a color within this color group. + * @param[in] TheColor - The color */ - virtual bool GetRepresentation(Lib3MF_uint32 & nUniqueResourceID) = 0; + virtual void SetColor(const Lib3MF_uint32 nPropertyID, const Lib3MF::sColor TheColor) = 0; /** - * IBeamLattice::SetRepresentation - Sets the representation-mesh for the beamlattice of this mesh. - * @param[in] nUniqueResourceID - the UniqueResourceID of the representation mesh-object. This mesh-object has to be defined before setting the representation. + * IColorGroup::GetColor - Sets a color value. + * @param[in] nPropertyID - PropertyID of a color within this color group. + * @return The color */ - virtual void SetRepresentation(const Lib3MF_uint32 nUniqueResourceID) = 0; + virtual Lib3MF::sColor GetColor(const Lib3MF_uint32 nPropertyID) = 0; + +}; + +typedef IBaseSharedPtr PIColorGroup; + + +/************************************************************************************************************************* + Class interface for Texture2DGroup +**************************************************************************************************************************/ +class ITexture2DGroup : public virtual IResource { +public: /** - * IBeamLattice::GetBallOptions - Returns the ball mode and the default ball radius for the beamlattice of this mesh. - * @param[out] eBallMode - contains the ball mode of this mesh - * @param[out] dBallRadius - default ball radius of balls for the beamlattice + * ITexture2DGroup::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer */ - virtual void GetBallOptions(Lib3MF::eBeamLatticeBallMode & eBallMode, Lib3MF_double & dBallRadius) = 0; + Lib3MF_uint64 ClassTypeId() override + { + return 0xBC1208397E37055DUL; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2DGroup" + } /** - * IBeamLattice::SetBallOptions - Sets the ball mode and thedefault ball radius for the beamlattice. - * @param[in] eBallMode - contains the ball mode of this mesh - * @param[in] dBallRadius - default ball radius of balls for the beamlattice + * ITexture2DGroup::GetCount - Retrieves the count of tex2coords in the Texture2DGroup. + * @return returns the count of tex2coords. */ - virtual void SetBallOptions(const Lib3MF::eBeamLatticeBallMode eBallMode, const Lib3MF_double dBallRadius) = 0; + virtual Lib3MF_uint32 GetCount() = 0; /** - * IBeamLattice::GetBeamCount - Returns the beam count of a mesh object. - * @return filled with the beam count. + * ITexture2DGroup::GetAllPropertyIDs - returns all the PropertyIDs of all tex2coords in this Texture2DGroup + * @param[in] nPropertyIDsBufferSize - Number of elements in buffer + * @param[out] pPropertyIDsNeededCount - will be filled with the count of the written structs, or needed buffer size. + * @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the tex2coords in the Texture2DGroup. */ - virtual Lib3MF_uint32 GetBeamCount() = 0; + virtual void GetAllPropertyIDs(Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) = 0; /** - * IBeamLattice::GetBeam - Returns indices, radii and capmodes of a single beam of a mesh object. - * @param[in] nIndex - Index of the beam (0 to beamcount - 1). - * @return filled with the beam indices, radii and capmodes. + * ITexture2DGroup::AddTex2Coord - Adds a new tex2coord to the Texture2DGroup + * @param[in] UVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. + * @return returns new PropertyID of the new tex2coord in the Texture2DGroup. */ - virtual Lib3MF::sBeam GetBeam(const Lib3MF_uint32 nIndex) = 0; + virtual Lib3MF_uint32 AddTex2Coord(const Lib3MF::sTex2Coord UVCoordinate) = 0; /** - * IBeamLattice::AddBeam - Adds a single beam to a mesh object. - * @param[in] BeamInfo - contains the node indices, radii and capmodes. - * @return filled with the new Index of the beam. + * ITexture2DGroup::GetTex2Coord - Obtains a tex2coord to the Texture2DGroup + * @param[in] nPropertyID - the PropertyID of the tex2coord in the Texture2DGroup. + * @return The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. */ - virtual Lib3MF_uint32 AddBeam(const Lib3MF::sBeam BeamInfo) = 0; + virtual Lib3MF::sTex2Coord GetTex2Coord(const Lib3MF_uint32 nPropertyID) = 0; /** - * IBeamLattice::SetBeam - Sets the indices, radii and capmodes of a single beam of a mesh object. - * @param[in] nIndex - Index of the beam (0 to beamcount - 1). - * @param[in] BeamInfo - filled with the beam indices, radii and capmodes. + * ITexture2DGroup::RemoveTex2Coord - Removes a tex2coords from the Texture2DGroup. + * @param[in] nPropertyID - PropertyID of the tex2coords in the Texture2DGroup. */ - virtual void SetBeam(const Lib3MF_uint32 nIndex, const Lib3MF::sBeam BeamInfo) = 0; + virtual void RemoveTex2Coord(const Lib3MF_uint32 nPropertyID) = 0; /** - * IBeamLattice::SetBeams - Sets all beam indices, radii and capmodes of a mesh object. - * @param[in] nBeamInfoBufferSize - Number of elements in buffer - * @param[in] pBeamInfoBuffer - contains information of a number of beams + * ITexture2DGroup::GetTexture2D - Obtains the texture2D instance of this group. + * @return the texture2D instance of this group. */ - virtual void SetBeams(const Lib3MF_uint64 nBeamInfoBufferSize, const Lib3MF::sBeam * pBeamInfoBuffer) = 0; + virtual ITexture2D * GetTexture2D() = 0; + +}; + +typedef IBaseSharedPtr PITexture2DGroup; + +/************************************************************************************************************************* + Class interface for CompositeMaterials +**************************************************************************************************************************/ + +class ICompositeMaterials : public virtual IResource { +public: /** - * IBeamLattice::GetBeams - obtains all beam indices, radii and capmodes of a mesh object. - * @param[in] nBeamInfoBufferSize - Number of elements in buffer - * @param[out] pBeamInfoNeededCount - will be filled with the count of the written structs, or needed buffer size. - * @param[out] pBeamInfoBuffer - Beam buffer of contains information of all beams + * ICompositeMaterials::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer */ - virtual void GetBeams(Lib3MF_uint64 nBeamInfoBufferSize, Lib3MF_uint64* pBeamInfoNeededCount, Lib3MF::sBeam * pBeamInfoBuffer) = 0; + Lib3MF_uint64 ClassTypeId() override + { + return 0xCE16224D688B86F2UL; // First 64 bits of SHA1 of a string: "Lib3MF::CompositeMaterials" + } /** - * IBeamLattice::GetBallCount - Returns the ball count of a mesh object. - * @return filled with the ball count. + * ICompositeMaterials::GetCount - Retrieves the count of Composite-s in the CompositeMaterials. + * @return returns the count of Composite-s */ - virtual Lib3MF_uint32 GetBallCount() = 0; + virtual Lib3MF_uint32 GetCount() = 0; /** - * IBeamLattice::GetBall - Returns index and radius of a single ball of a mesh object. - * @param[in] nIndex - Index of the ball (0 to ballcount - 1). - * @return filled with the ball node index and radius. + * ICompositeMaterials::GetAllPropertyIDs - returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials + * @param[in] nPropertyIDsBufferSize - Number of elements in buffer + * @param[out] pPropertyIDsNeededCount - will be filled with the count of the written structs, or needed buffer size. + * @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the Composite-Mixing Values in the CompositeMaterials. */ - virtual Lib3MF::sBall GetBall(const Lib3MF_uint32 nIndex) = 0; + virtual void GetAllPropertyIDs(Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) = 0; /** - * IBeamLattice::AddBall - Adds a single ball to a mesh object. - * @param[in] BallInfo - contains the node index and radius. - * @return filled with the new Index of the ball. + * ICompositeMaterials::GetBaseMaterialGroup - Obtains the BaseMaterialGroup instance of this CompositeMaterials. + * @return returns the BaseMaterialGroup instance of this CompositeMaterials */ - virtual Lib3MF_uint32 AddBall(const Lib3MF::sBall BallInfo) = 0; + virtual IBaseMaterialGroup * GetBaseMaterialGroup() = 0; /** - * IBeamLattice::SetBall - Sets the index and radius of a single ball of a mesh object. - * @param[in] nIndex - Index of the ball (0 to ballcount - 1). - * @param[in] BallInfo - filled with the ball node index and radius. + * ICompositeMaterials::AddComposite - Adds a new Composite-Mixing Values to the CompositeMaterials. + * @param[in] nCompositeBufferSize - Number of elements in buffer + * @param[in] pCompositeBuffer - The Composite Constituents to be added as composite + * @return returns new PropertyID of the new Composite in the CompositeMaterials. */ - virtual void SetBall(const Lib3MF_uint32 nIndex, const Lib3MF::sBall BallInfo) = 0; + virtual Lib3MF_uint32 AddComposite(const Lib3MF_uint64 nCompositeBufferSize, const Lib3MF::sCompositeConstituent * pCompositeBuffer) = 0; /** - * IBeamLattice::SetBalls - Sets all ball indices and radii of a mesh object. - * @param[in] nBallInfoBufferSize - Number of elements in buffer - * @param[in] pBallInfoBuffer - contains information of a number of balls + * ICompositeMaterials::RemoveComposite - Removes a Composite-Maxing Ratio from the CompositeMaterials. + * @param[in] nPropertyID - PropertyID of the Composite-Mixing Values in the CompositeMaterials to be removed. */ - virtual void SetBalls(const Lib3MF_uint64 nBallInfoBufferSize, const Lib3MF::sBall * pBallInfoBuffer) = 0; + virtual void RemoveComposite(const Lib3MF_uint32 nPropertyID) = 0; /** - * IBeamLattice::GetBalls - obtains all ball indices and radii of a mesh object. - * @param[in] nBallInfoBufferSize - Number of elements in buffer - * @param[out] pBallInfoNeededCount - will be filled with the count of the written structs, or needed buffer size. - * @param[out] pBallInfoBuffer - Ball buffer of contains information of all balls + * ICompositeMaterials::GetComposite - Obtains a Composite-Maxing Ratio of this CompositeMaterials. + * @param[in] nPropertyID - the PropertyID of the Composite-Maxing Ratio in the CompositeMaterials. + * @param[in] nCompositeBufferSize - Number of elements in buffer + * @param[out] pCompositeNeededCount - will be filled with the count of the written structs, or needed buffer size. + * @param[out] pCompositeBuffer - CompositeConstituent buffer of The Composite-Mixing Values with the given PropertyID */ - virtual void GetBalls(Lib3MF_uint64 nBallInfoBufferSize, Lib3MF_uint64* pBallInfoNeededCount, Lib3MF::sBall * pBallInfoBuffer) = 0; + virtual void GetComposite(const Lib3MF_uint32 nPropertyID, Lib3MF_uint64 nCompositeBufferSize, Lib3MF_uint64* pCompositeNeededCount, Lib3MF::sCompositeConstituent * pCompositeBuffer) = 0; + +}; + +typedef IBaseSharedPtr PICompositeMaterials; + + +/************************************************************************************************************************* + Class interface for MultiPropertyGroup +**************************************************************************************************************************/ + +class IMultiPropertyGroup : public virtual IResource { +public: + /** + * IMultiPropertyGroup::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer + */ + Lib3MF_uint64 ClassTypeId() override + { + return 0xB989E02E43158FE6UL; // First 64 bits of SHA1 of a string: "Lib3MF::MultiPropertyGroup" + } + + /** + * IMultiPropertyGroup::GetCount - Retrieves the count of MultiProperty-s in the MultiPropertyGroup. + * @return returns the count of MultiProperty-s + */ + virtual Lib3MF_uint32 GetCount() = 0; + + /** + * IMultiPropertyGroup::GetAllPropertyIDs - returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup + * @param[in] nPropertyIDsBufferSize - Number of elements in buffer + * @param[out] pPropertyIDsNeededCount - will be filled with the count of the written structs, or needed buffer size. + * @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the MultiProperty-s in the MultiPropertyGroup. + */ + virtual void GetAllPropertyIDs(Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) = 0; + + /** + * IMultiPropertyGroup::AddMultiProperty - Adds a new MultiProperty to the MultiPropertyGroup. + * @param[in] nPropertyIDsBufferSize - Number of elements in buffer + * @param[in] pPropertyIDsBuffer - The PropertyIDs of the new MultiProperty. + * @return returns the PropertyID of the new MultiProperty in the MultiPropertyGroup. + */ + virtual Lib3MF_uint32 AddMultiProperty(const Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer) = 0; + + /** + * IMultiPropertyGroup::SetMultiProperty - Sets the PropertyIDs of a MultiProperty. + * @param[in] nPropertyID - the PropertyID of the MultiProperty to be changed. + * @param[in] nPropertyIDsBufferSize - Number of elements in buffer + * @param[in] pPropertyIDsBuffer - The new PropertyIDs of the MultiProperty + */ + virtual void SetMultiProperty(const Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer) = 0; + + /** + * IMultiPropertyGroup::GetMultiProperty - Obtains the PropertyIDs of a MultiProperty. + * @param[in] nPropertyID - the PropertyID of the MultiProperty to be queried. + * @param[in] nPropertyIDsBufferSize - Number of elements in buffer + * @param[out] pPropertyIDsNeededCount - will be filled with the count of the written structs, or needed buffer size. + * @param[out] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the MultiProperty + */ + virtual void GetMultiProperty(const Lib3MF_uint32 nPropertyID, Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) = 0; + + /** + * IMultiPropertyGroup::RemoveMultiProperty - Removes a MultiProperty from this MultiPropertyGroup. + * @param[in] nPropertyID - the PropertyID of the MultiProperty to be removed. + */ + virtual void RemoveMultiProperty(const Lib3MF_uint32 nPropertyID) = 0; + + /** + * IMultiPropertyGroup::GetLayerCount - Retrieves the number of layers of this MultiPropertyGroup. + * @return returns the number of layers + */ + virtual Lib3MF_uint32 GetLayerCount() = 0; /** - * IBeamLattice::GetBeamSetCount - Returns the number of beamsets of a mesh object. - * @return filled with the beamset count. + * IMultiPropertyGroup::AddLayer - Adds a MultiPropertyLayer to this MultiPropertyGroup. + * @param[in] TheLayer - The MultiPropertyLayer to add to this MultiPropertyGroup + * @return returns the index of this MultiPropertyLayer */ - virtual Lib3MF_uint32 GetBeamSetCount() = 0; + virtual Lib3MF_uint32 AddLayer(const Lib3MF::sMultiPropertyLayer TheLayer) = 0; /** - * IBeamLattice::AddBeamSet - Adds an empty beamset to a mesh object - * @return the new beamset + * IMultiPropertyGroup::GetLayer - Obtains a MultiPropertyLayer of this MultiPropertyGroup. + * @param[in] nLayerIndex - The Index of the MultiPropertyLayer queried + * @return The MultiPropertyLayer with index LayerIndex within MultiPropertyGroup */ - virtual IBeamSet * AddBeamSet() = 0; + virtual Lib3MF::sMultiPropertyLayer GetLayer(const Lib3MF_uint32 nLayerIndex) = 0; /** - * IBeamLattice::GetBeamSet - Returns a beamset of a mesh object - * @param[in] nIndex - index of the requested beamset (0 ... beamsetcount-1). - * @return the requested beamset + * IMultiPropertyGroup::RemoveLayer - Removes a MultiPropertyLayer from this MultiPropertyGroup. + * @param[in] nLayerIndex - The Index of the MultiPropertyLayer to be removed */ - virtual IBeamSet * GetBeamSet(const Lib3MF_uint32 nIndex) = 0; + virtual void RemoveLayer(const Lib3MF_uint32 nLayerIndex) = 0; }; -typedef IBaseSharedPtr PIBeamLattice; +typedef IBaseSharedPtr PIMultiPropertyGroup; /************************************************************************************************************************* - Class interface for Component + Class interface for Attachment **************************************************************************************************************************/ -class IComponent : public virtual IBase { +class IAttachment : public virtual IBase { public: /** - * IComponent::ClassTypeId - Get Class Type Id + * IAttachment::ClassTypeId - Get Class Type Id * @return Class type as a 64 bits integer */ Lib3MF_uint64 ClassTypeId() override { - return 0x4ECDB6A6F69F2BEBUL; // First 64 bits of SHA1 of a string: "Lib3MF::Component" + return 0x8CE7A1191A63A35DUL; // First 64 bits of SHA1 of a string: "Lib3MF::Attachment" } /** - * IComponent::GetObjectResource - Returns the Resource Instance of the component. - * @return filled with the Resource Instance. + * IAttachment::GetPath - Retrieves an attachment's package path. This function will be removed in a later release. + * @return returns the attachment's package path string */ - virtual IObject * GetObjectResource() = 0; + virtual std::string GetPath() = 0; /** - * IComponent::GetObjectResourceID - Returns the UniqueResourceID of the component. - * @return returns the UniqueResourceID. + * IAttachment::SetPath - Sets an attachment's package path. This function will be removed in a later release. + * @param[in] sPath - new path of the attachment. */ - virtual Lib3MF_uint32 GetObjectResourceID() = 0; + virtual void SetPath(const std::string & sPath) = 0; /** - * IComponent::GetUUID - returns, whether a component has a UUID and, if true, the component's UUID - * @param[out] bHasUUID - flag whether the component has a UUID - * @return the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + * IAttachment::PackagePart - Returns the PackagePart that is this attachment. + * @return The PackagePart of this attachment. */ - virtual std::string GetUUID(bool & bHasUUID) = 0; + virtual IPackagePart * PackagePart() = 0; /** - * IComponent::SetUUID - sets the component's UUID - * @param[in] sUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + * IAttachment::GetRelationShipType - Retrieves an attachment's relationship type + * @return returns the attachment's package relationship type string */ - virtual void SetUUID(const std::string & sUUID) = 0; + virtual std::string GetRelationShipType() = 0; /** - * IComponent::HasTransform - Returns, if the component has a different transformation than the identity matrix - * @return if true is returned, the transformation is not equal than the identity + * IAttachment::SetRelationShipType - Sets an attachment's relationship type. + * @param[in] sPath - new relationship type string. */ - virtual bool HasTransform() = 0; + virtual void SetRelationShipType(const std::string & sPath) = 0; /** - * IComponent::GetTransform - Returns the transformation matrix of the component. - * @return filled with the component transformation matrix + * IAttachment::WriteToFile - Writes out the attachment as file. + * @param[in] sFileName - file to write into. */ - virtual Lib3MF::sTransform GetTransform() = 0; + virtual void WriteToFile(const std::string & sFileName) = 0; /** - * IComponent::SetTransform - Sets the transformation matrix of the component. - * @param[in] Transform - new transformation matrix + * IAttachment::ReadFromFile - Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. + * @param[in] sFileName - file to read from. */ - virtual void SetTransform(const Lib3MF::sTransform Transform) = 0; - -}; - -typedef IBaseSharedPtr PIComponent; - - -/************************************************************************************************************************* - Class interface for ComponentsObject -**************************************************************************************************************************/ + virtual void ReadFromFile(const std::string & sFileName) = 0; -class IComponentsObject : public virtual IObject { -public: /** - * IComponentsObject::ClassTypeId - Get Class Type Id - * @return Class type as a 64 bits integer + * IAttachment::ReadFromCallback - Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. + * @param[in] pTheReadCallback - callback function + * @param[in] nStreamSize - number of bytes the callback returns + * @param[in] pTheSeekCallback - callback function + * @param[in] nUserData - Userdata that is passed to the callback function */ - Lib3MF_uint64 ClassTypeId() override - { - return 0x6522CF04EB283FEDUL; // First 64 bits of SHA1 of a string: "Lib3MF::ComponentsObject" - } + virtual void ReadFromCallback(const Lib3MF::ReadCallback pTheReadCallback, const Lib3MF_uint64 nStreamSize, const Lib3MF::SeekCallback pTheSeekCallback, const Lib3MF_pvoid pUserData) = 0; /** - * IComponentsObject::AddComponent - Adds a new component to a components object. - * @param[in] pObjectResource - object to add as component. Must not lead to circular references! - * @param[in] Transform - optional transform matrix for the component. - * @return new component instance + * IAttachment::GetStreamSize - Retrieves the size of the attachment stream + * @return the stream size */ - virtual IComponent * AddComponent(IObject* pObjectResource, const Lib3MF::sTransform Transform) = 0; + virtual Lib3MF_uint64 GetStreamSize() = 0; /** - * IComponentsObject::GetComponent - Retrieves a component from a component object. - * @param[in] nIndex - index of the component to retrieve (0 to componentcount - 1) - * @return component instance + * IAttachment::WriteToBuffer - Writes out the attachment into a buffer + * @param[in] nBufferBufferSize - Number of elements in buffer + * @param[out] pBufferNeededCount - will be filled with the count of the written structs, or needed buffer size. + * @param[out] pBufferBuffer - uint8 buffer of Buffer to write into */ - virtual IComponent * GetComponent(const Lib3MF_uint32 nIndex) = 0; + virtual void WriteToBuffer(Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer) = 0; /** - * IComponentsObject::GetComponentCount - Retrieves a component count of a component object. - * @return returns the component count + * IAttachment::ReadFromBuffer - Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). + * @param[in] nBufferBufferSize - Number of elements in buffer + * @param[in] pBufferBuffer - Buffer to read from */ - virtual Lib3MF_uint32 GetComponentCount() = 0; + virtual void ReadFromBuffer(const Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer) = 0; }; -typedef IBaseSharedPtr PIComponentsObject; +typedef IBaseSharedPtr PIAttachment; /************************************************************************************************************************* - Class interface for BeamSet + Class interface for Texture2D **************************************************************************************************************************/ -class IBeamSet : public virtual IBase { +class ITexture2D : public virtual IResource { public: /** - * IBeamSet::ClassTypeId - Get Class Type Id + * ITexture2D::ClassTypeId - Get Class Type Id * @return Class type as a 64 bits integer */ Lib3MF_uint64 ClassTypeId() override { - return 0x30CCDBE90E00B55BUL; // First 64 bits of SHA1 of a string: "Lib3MF::BeamSet" + return 0xE0441CF976B36319UL; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2D" } /** - * IBeamSet::SetName - Sets a beamset's name string - * @param[in] sName - new name of the beamset. - */ - virtual void SetName(const std::string & sName) = 0; - - /** - * IBeamSet::GetName - Retrieves a beamset's name string - * @return returns the name of the beamset. - */ - virtual std::string GetName() = 0; - - /** - * IBeamSet::SetIdentifier - Sets a beamset's identifier string - * @param[in] sIdentifier - new name of the beamset. + * ITexture2D::GetAttachment - Retrieves the attachment located at the path of the texture. + * @return attachment that holds the texture's image information. */ - virtual void SetIdentifier(const std::string & sIdentifier) = 0; + virtual IAttachment * GetAttachment() = 0; /** - * IBeamSet::GetIdentifier - Retrieves a beamset's identifier string - * @return returns the identifier of the beamset. + * ITexture2D::SetAttachment - Sets the texture's package path to the path of the attachment. + * @param[in] pAttachment - attachment that holds the texture's image information. */ - virtual std::string GetIdentifier() = 0; + virtual void SetAttachment(IAttachment* pAttachment) = 0; /** - * IBeamSet::GetReferenceCount - Retrieves the reference count of a beamset - * @return returns the reference count + * ITexture2D::GetContentType - Retrieves a texture's content type. + * @return returns content type enum. */ - virtual Lib3MF_uint32 GetReferenceCount() = 0; + virtual Lib3MF::eTextureType GetContentType() = 0; /** - * IBeamSet::SetReferences - Sets the references of a beamset - * @param[in] nReferencesBufferSize - Number of elements in buffer - * @param[in] pReferencesBuffer - the new indices of all beams in this beamset + * ITexture2D::SetContentType - Retrieves a texture's content type. + * @param[in] eContentType - new Content Type */ - virtual void SetReferences(const Lib3MF_uint64 nReferencesBufferSize, const Lib3MF_uint32 * pReferencesBuffer) = 0; + virtual void SetContentType(const Lib3MF::eTextureType eContentType) = 0; /** - * IBeamSet::GetReferences - Retrieves the references of a beamset - * @param[in] nReferencesBufferSize - Number of elements in buffer - * @param[out] pReferencesNeededCount - will be filled with the count of the written structs, or needed buffer size. - * @param[out] pReferencesBuffer - uint32 buffer of retrieves the indices of all beams in this beamset + * ITexture2D::GetTileStyleUV - Retrieves a texture's tilestyle type. + * @param[out] eTileStyleU - returns tilestyle type enum. + * @param[out] eTileStyleV - returns tilestyle type enum. */ - virtual void GetReferences(Lib3MF_uint64 nReferencesBufferSize, Lib3MF_uint64* pReferencesNeededCount, Lib3MF_uint32 * pReferencesBuffer) = 0; + virtual void GetTileStyleUV(Lib3MF::eTextureTileStyle & eTileStyleU, Lib3MF::eTextureTileStyle & eTileStyleV) = 0; /** - * IBeamSet::GetBallReferenceCount - Retrieves the ball reference count of a beamset - * @return returns the ball reference count + * ITexture2D::SetTileStyleUV - Sets a texture's tilestyle type. + * @param[in] eTileStyleU - new tilestyle type enum. + * @param[in] eTileStyleV - new tilestyle type enum. */ - virtual Lib3MF_uint32 GetBallReferenceCount() = 0; + virtual void SetTileStyleUV(const Lib3MF::eTextureTileStyle eTileStyleU, const Lib3MF::eTextureTileStyle eTileStyleV) = 0; /** - * IBeamSet::SetBallReferences - Sets the ball references of a beamset - * @param[in] nBallReferencesBufferSize - Number of elements in buffer - * @param[in] pBallReferencesBuffer - the new indices of all balls in this beamset + * ITexture2D::GetFilter - Retrieves a texture's filter type. + * @return returns filter type enum. */ - virtual void SetBallReferences(const Lib3MF_uint64 nBallReferencesBufferSize, const Lib3MF_uint32 * pBallReferencesBuffer) = 0; + virtual Lib3MF::eTextureFilter GetFilter() = 0; /** - * IBeamSet::GetBallReferences - Retrieves the ball references of a beamset - * @param[in] nBallReferencesBufferSize - Number of elements in buffer - * @param[out] pBallReferencesNeededCount - will be filled with the count of the written structs, or needed buffer size. - * @param[out] pBallReferencesBuffer - uint32 buffer of retrieves the indices of all balls in this beamset + * ITexture2D::SetFilter - Sets a texture's filter type. + * @param[in] eFilter - sets new filter type enum. */ - virtual void GetBallReferences(Lib3MF_uint64 nBallReferencesBufferSize, Lib3MF_uint64* pBallReferencesNeededCount, Lib3MF_uint32 * pBallReferencesBuffer) = 0; + virtual void SetFilter(const Lib3MF::eTextureFilter eFilter) = 0; }; -typedef IBaseSharedPtr PIBeamSet; +typedef IBaseSharedPtr PITexture2D; /************************************************************************************************************************* - Class interface for BaseMaterialGroup + Class interface for BuildItem **************************************************************************************************************************/ -class IBaseMaterialGroup : public virtual IResource { +class IBuildItem : public virtual IBase { public: /** - * IBaseMaterialGroup::ClassTypeId - Get Class Type Id + * IBuildItem::ClassTypeId - Get Class Type Id * @return Class type as a 64 bits integer */ Lib3MF_uint64 ClassTypeId() override { - return 0xB27D4656E16609FAUL; // First 64 bits of SHA1 of a string: "Lib3MF::BaseMaterialGroup" + return 0x68FB2D5FFC4BA12AUL; // First 64 bits of SHA1 of a string: "Lib3MF::BuildItem" } /** - * IBaseMaterialGroup::GetCount - Retrieves the count of base materials in the material group. - * @return returns the count of base materials. + * IBuildItem::GetObjectResource - Retrieves the object resource associated to a build item + * @return returns the associated resource instance */ - virtual Lib3MF_uint32 GetCount() = 0; + virtual IObject * GetObjectResource() = 0; /** - * IBaseMaterialGroup::GetAllPropertyIDs - returns all the PropertyIDs of all materials in this group - * @param[in] nPropertyIDsBufferSize - Number of elements in buffer - * @param[out] pPropertyIDsNeededCount - will be filled with the count of the written structs, or needed buffer size. - * @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the material in the material group. + * IBuildItem::GetUUID - returns, whether a build item has a UUID and, if true, the build item's UUID + * @param[out] bHasUUID - flag whether the build item has a UUID + * @return the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' */ - virtual void GetAllPropertyIDs(Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) = 0; + virtual std::string GetUUID(bool & bHasUUID) = 0; /** - * IBaseMaterialGroup::AddMaterial - Adds a new material to the material group - * @param[in] sName - new name of the base material. - * @param[in] DisplayColor - Display color of the material - * @return returns new PropertyID of the new material in the material group. + * IBuildItem::SetUUID - sets the build item's UUID + * @param[in] sUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' */ - virtual Lib3MF_uint32 AddMaterial(const std::string & sName, const Lib3MF::sColor DisplayColor) = 0; + virtual void SetUUID(const std::string & sUUID) = 0; /** - * IBaseMaterialGroup::RemoveMaterial - Removes a material from the material group. - * @param[in] nPropertyID - PropertyID of the material in the material group. + * IBuildItem::GetObjectResourceID - Retrieves the object UniqueResourceID associated to a build item + * @return returns the UniqueResourceID of the object */ - virtual void RemoveMaterial(const Lib3MF_uint32 nPropertyID) = 0; + virtual Lib3MF_uint32 GetObjectResourceID() = 0; + + /** + * IBuildItem::HasObjectTransform - Checks, if a build item has a non-identity transformation matrix + * @return returns true, if the transformation matrix is not the identity + */ + virtual bool HasObjectTransform() = 0; + + /** + * IBuildItem::GetObjectTransform - Retrieves a build item's transformation matrix. + * @return returns the transformation matrix + */ + virtual Lib3MF::sTransform GetObjectTransform() = 0; + + /** + * IBuildItem::SetObjectTransform - Sets a build item's transformation matrix. + * @param[in] Transform - new transformation matrix + */ + virtual void SetObjectTransform(const Lib3MF::sTransform Transform) = 0; /** - * IBaseMaterialGroup::GetName - Returns the base material's name - * @param[in] nPropertyID - PropertyID of the material in the material group. - * @return returns the name of the base material. + * IBuildItem::GetPartNumber - Retrieves a build item's part number string + * @return Returns a build item's part number string */ - virtual std::string GetName(const Lib3MF_uint32 nPropertyID) = 0; + virtual std::string GetPartNumber() = 0; /** - * IBaseMaterialGroup::SetName - Sets a base material's name - * @param[in] nPropertyID - PropertyID of the material in the material group. - * @param[in] sName - new name of the base material. + * IBuildItem::SetPartNumber - Sets a build item's part number string + * @param[in] sSetPartnumber - new part number string for referencing parts from the outside world */ - virtual void SetName(const Lib3MF_uint32 nPropertyID, const std::string & sName) = 0; + virtual void SetPartNumber(const std::string & sSetPartnumber) = 0; /** - * IBaseMaterialGroup::SetDisplayColor - Sets a base material's display color. - * @param[in] nPropertyID - PropertyID of the material in the material group. - * @param[in] TheColor - The base material's display color + * IBuildItem::GetMetaDataGroup - Returns the metadatagroup of this build item + * @return returns an Instance of the metadatagroup of this build item */ - virtual void SetDisplayColor(const Lib3MF_uint32 nPropertyID, const Lib3MF::sColor TheColor) = 0; + virtual IMetaDataGroup * GetMetaDataGroup() = 0; /** - * IBaseMaterialGroup::GetDisplayColor - Returns a base material's display color. - * @param[in] nPropertyID - PropertyID of the material in the material group. - * @return The base material's display color + * IBuildItem::GetOutbox - Returns the outbox of a build item + * @return Outbox of this build item */ - virtual Lib3MF::sColor GetDisplayColor(const Lib3MF_uint32 nPropertyID) = 0; + virtual Lib3MF::sBox GetOutbox() = 0; }; -typedef IBaseSharedPtr PIBaseMaterialGroup; +typedef IBaseSharedPtr PIBuildItem; /************************************************************************************************************************* - Class interface for ColorGroup + Class interface for BuildItemIterator **************************************************************************************************************************/ -class IColorGroup : public virtual IResource { +class IBuildItemIterator : public virtual IBase { public: /** - * IColorGroup::ClassTypeId - Get Class Type Id + * IBuildItemIterator::ClassTypeId - Get Class Type Id * @return Class type as a 64 bits integer */ Lib3MF_uint64 ClassTypeId() override { - return 0xD085FB2E49CDB5B1UL; // First 64 bits of SHA1 of a string: "Lib3MF::ColorGroup" + return 0xA7D21BD364910860UL; // First 64 bits of SHA1 of a string: "Lib3MF::BuildItemIterator" } /** - * IColorGroup::GetCount - Retrieves the count of base materials in this Color Group. - * @return returns the count of colors within this color group. - */ - virtual Lib3MF_uint32 GetCount() = 0; - - /** - * IColorGroup::GetAllPropertyIDs - returns all the PropertyIDs of all colors within this group - * @param[in] nPropertyIDsBufferSize - Number of elements in buffer - * @param[out] pPropertyIDsNeededCount - will be filled with the count of the written structs, or needed buffer size. - * @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the color in the color group. + * IBuildItemIterator::MoveNext - Iterates to the next build item in the list. + * @return Iterates to the next build item in the list. */ - virtual void GetAllPropertyIDs(Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) = 0; + virtual bool MoveNext() = 0; /** - * IColorGroup::AddColor - Adds a new value. - * @param[in] TheColor - The new color - * @return PropertyID of the new color within this color group. + * IBuildItemIterator::MovePrevious - Iterates to the previous build item in the list. + * @return Iterates to the previous build item in the list. */ - virtual Lib3MF_uint32 AddColor(const Lib3MF::sColor TheColor) = 0; + virtual bool MovePrevious() = 0; /** - * IColorGroup::RemoveColor - Removes a color from the color group. - * @param[in] nPropertyID - PropertyID of the color to be removed from the color group. + * IBuildItemIterator::GetCurrent - Returns the build item the iterator points at. + * @return returns the build item instance. */ - virtual void RemoveColor(const Lib3MF_uint32 nPropertyID) = 0; + virtual IBuildItem * GetCurrent() = 0; /** - * IColorGroup::SetColor - Sets a color value. - * @param[in] nPropertyID - PropertyID of a color within this color group. - * @param[in] TheColor - The color + * IBuildItemIterator::Clone - Creates a new build item iterator with the same build item list. + * @return returns the cloned Iterator instance */ - virtual void SetColor(const Lib3MF_uint32 nPropertyID, const Lib3MF::sColor TheColor) = 0; + virtual IBuildItemIterator * Clone() = 0; /** - * IColorGroup::GetColor - Sets a color value. - * @param[in] nPropertyID - PropertyID of a color within this color group. - * @return The color + * IBuildItemIterator::Count - Returns the number of build items the iterator captures. + * @return returns the number of build items the iterator captures. */ - virtual Lib3MF::sColor GetColor(const Lib3MF_uint32 nPropertyID) = 0; + virtual Lib3MF_uint64 Count() = 0; }; -typedef IBaseSharedPtr PIColorGroup; +typedef IBaseSharedPtr PIBuildItemIterator; /************************************************************************************************************************* - Class interface for Texture2DGroup + Class interface for Slice **************************************************************************************************************************/ -class ITexture2DGroup : public virtual IResource { +class ISlice : public virtual IBase { public: /** - * ITexture2DGroup::ClassTypeId - Get Class Type Id + * ISlice::ClassTypeId - Get Class Type Id * @return Class type as a 64 bits integer */ Lib3MF_uint64 ClassTypeId() override { - return 0xBC1208397E37055DUL; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2DGroup" + return 0x2198BCF4D8DF9C40UL; // First 64 bits of SHA1 of a string: "Lib3MF::Slice" } /** - * ITexture2DGroup::GetCount - Retrieves the count of tex2coords in the Texture2DGroup. - * @return returns the count of tex2coords. + * ISlice::SetVertices - Set all vertices of a slice. All polygons will be cleared. + * @param[in] nVerticesBufferSize - Number of elements in buffer + * @param[in] pVerticesBuffer - contains the positions. */ - virtual Lib3MF_uint32 GetCount() = 0; + virtual void SetVertices(const Lib3MF_uint64 nVerticesBufferSize, const Lib3MF::sPosition2D * pVerticesBuffer) = 0; /** - * ITexture2DGroup::GetAllPropertyIDs - returns all the PropertyIDs of all tex2coords in this Texture2DGroup - * @param[in] nPropertyIDsBufferSize - Number of elements in buffer - * @param[out] pPropertyIDsNeededCount - will be filled with the count of the written structs, or needed buffer size. - * @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the tex2coords in the Texture2DGroup. + * ISlice::GetVertices - Get all vertices of a slice + * @param[in] nVerticesBufferSize - Number of elements in buffer + * @param[out] pVerticesNeededCount - will be filled with the count of the written structs, or needed buffer size. + * @param[out] pVerticesBuffer - Position2D buffer of contains the positions. */ - virtual void GetAllPropertyIDs(Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) = 0; + virtual void GetVertices(Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, Lib3MF::sPosition2D * pVerticesBuffer) = 0; /** - * ITexture2DGroup::AddTex2Coord - Adds a new tex2coord to the Texture2DGroup - * @param[in] UVCoordinate - The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. - * @return returns new PropertyID of the new tex2coord in the Texture2DGroup. + * ISlice::GetVertexCount - Get the number of vertices in a slice + * @return the number of vertices in the slice */ - virtual Lib3MF_uint32 AddTex2Coord(const Lib3MF::sTex2Coord UVCoordinate) = 0; + virtual Lib3MF_uint64 GetVertexCount() = 0; /** - * ITexture2DGroup::GetTex2Coord - Obtains a tex2coord to the Texture2DGroup - * @param[in] nPropertyID - the PropertyID of the tex2coord in the Texture2DGroup. - * @return The u/v-coordinate within the texture, horizontally right/vertically up from the origin in the lower left of the texture. + * ISlice::AddPolygon - Add a new polygon to this slice + * @param[in] nIndicesBufferSize - Number of elements in buffer + * @param[in] pIndicesBuffer - the new indices of the new polygon + * @return the index of the new polygon */ - virtual Lib3MF::sTex2Coord GetTex2Coord(const Lib3MF_uint32 nPropertyID) = 0; + virtual Lib3MF_uint64 AddPolygon(const Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer) = 0; /** - * ITexture2DGroup::RemoveTex2Coord - Removes a tex2coords from the Texture2DGroup. - * @param[in] nPropertyID - PropertyID of the tex2coords in the Texture2DGroup. + * ISlice::GetPolygonCount - Get the number of polygons in the slice + * @return the number of polygons in the slice */ - virtual void RemoveTex2Coord(const Lib3MF_uint32 nPropertyID) = 0; + virtual Lib3MF_uint64 GetPolygonCount() = 0; /** - * ITexture2DGroup::GetTexture2D - Obtains the texture2D instance of this group. - * @return the texture2D instance of this group. + * ISlice::SetPolygonIndices - Set all indices of a polygon + * @param[in] nIndex - the index of the polygon to manipulate + * @param[in] nIndicesBufferSize - Number of elements in buffer + * @param[in] pIndicesBuffer - the new indices of the index-th polygon */ - virtual ITexture2D * GetTexture2D() = 0; + virtual void SetPolygonIndices(const Lib3MF_uint64 nIndex, const Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer) = 0; + + /** + * ISlice::GetPolygonIndices - Get all vertices of a slice + * @param[in] nIndex - the index of the polygon to manipulate + * @param[in] nIndicesBufferSize - Number of elements in buffer + * @param[out] pIndicesNeededCount - will be filled with the count of the written structs, or needed buffer size. + * @param[out] pIndicesBuffer - uint32 buffer of the indices of the index-th polygon + */ + virtual void GetPolygonIndices(const Lib3MF_uint64 nIndex, Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF_uint32 * pIndicesBuffer) = 0; + + /** + * ISlice::GetPolygonIndexCount - Get the number of vertices in a slice + * @param[in] nIndex - the index of the polygon to manipulate + * @return the number of indices of the index-th polygon + */ + virtual Lib3MF_uint64 GetPolygonIndexCount(const Lib3MF_uint64 nIndex) = 0; + + /** + * ISlice::GetZTop - Get the upper Z-Coordinate of this slice. + * @return the upper Z-Coordinate of this slice + */ + virtual Lib3MF_double GetZTop() = 0; }; -typedef IBaseSharedPtr PITexture2DGroup; +typedef IBaseSharedPtr PISlice; /************************************************************************************************************************* - Class interface for CompositeMaterials + Class interface for ToolpathProfile **************************************************************************************************************************/ -class ICompositeMaterials : public virtual IResource { +class IToolpathProfile : public virtual IBase { public: /** - * ICompositeMaterials::ClassTypeId - Get Class Type Id + * IToolpathProfile::ClassTypeId - Get Class Type Id * @return Class type as a 64 bits integer */ Lib3MF_uint64 ClassTypeId() override { - return 0xCE16224D688B86F2UL; // First 64 bits of SHA1 of a string: "Lib3MF::CompositeMaterials" + return 0xC869620B90242CA7UL; // First 64 bits of SHA1 of a string: "Lib3MF::ToolpathProfile" } /** - * ICompositeMaterials::GetCount - Retrieves the count of Composite-s in the CompositeMaterials. - * @return returns the count of Composite-s + * IToolpathProfile::GetUUID - Retrieves the profile's uuid + * @return Returns the uuid value. */ - virtual Lib3MF_uint32 GetCount() = 0; + virtual std::string GetUUID() = 0; /** - * ICompositeMaterials::GetAllPropertyIDs - returns all the PropertyIDs of all Composite-Mixing Values in this CompositeMaterials - * @param[in] nPropertyIDsBufferSize - Number of elements in buffer - * @param[out] pPropertyIDsNeededCount - will be filled with the count of the written structs, or needed buffer size. - * @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the Composite-Mixing Values in the CompositeMaterials. + * IToolpathProfile::GetName - Retrieves the profile's name + * @return Returns the name. */ - virtual void GetAllPropertyIDs(Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) = 0; + virtual std::string GetName() = 0; /** - * ICompositeMaterials::GetBaseMaterialGroup - Obtains the BaseMaterialGroup instance of this CompositeMaterials. - * @return returns the BaseMaterialGroup instance of this CompositeMaterials + * IToolpathProfile::GetParameterCount - Returns the number of parameters. + * @return Returns the number of parameters. */ - virtual IBaseMaterialGroup * GetBaseMaterialGroup() = 0; + virtual Lib3MF_uint32 GetParameterCount() = 0; /** - * ICompositeMaterials::AddComposite - Adds a new Composite-Mixing Values to the CompositeMaterials. - * @param[in] nCompositeBufferSize - Number of elements in buffer - * @param[in] pCompositeBuffer - The Composite Constituents to be added as composite - * @return returns new PropertyID of the new Composite in the CompositeMaterials. + * IToolpathProfile::GetParameterName - Returns the Name of a parameter. + * @param[in] nIndex - Index of Parameter (0-based). Call will fail if an invalid index is given. + * @return Returns the name of the parameter. */ - virtual Lib3MF_uint32 AddComposite(const Lib3MF_uint64 nCompositeBufferSize, const Lib3MF::sCompositeConstituent * pCompositeBuffer) = 0; + virtual std::string GetParameterName(const Lib3MF_uint32 nIndex) = 0; /** - * ICompositeMaterials::RemoveComposite - Removes a Composite-Maxing Ratio from the CompositeMaterials. - * @param[in] nPropertyID - PropertyID of the Composite-Mixing Values in the CompositeMaterials to be removed. + * IToolpathProfile::GetParameterNameSpace - Returns the NameSpace of a parameter. + * @param[in] nIndex - Index of Parameter (0-based). Call will fail if an invalid index is given. + * @return Returns the namespace of the parameter. */ - virtual void RemoveComposite(const Lib3MF_uint32 nPropertyID) = 0; + virtual std::string GetParameterNameSpace(const Lib3MF_uint32 nIndex) = 0; /** - * ICompositeMaterials::GetComposite - Obtains a Composite-Maxing Ratio of this CompositeMaterials. - * @param[in] nPropertyID - the PropertyID of the Composite-Maxing Ratio in the CompositeMaterials. - * @param[in] nCompositeBufferSize - Number of elements in buffer - * @param[out] pCompositeNeededCount - will be filled with the count of the written structs, or needed buffer size. - * @param[out] pCompositeBuffer - CompositeConstituent buffer of The Composite-Mixing Values with the given PropertyID + * IToolpathProfile::HasParameterValue - Checks if a parameter value exists. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @return Returns if a value exists. */ - virtual void GetComposite(const Lib3MF_uint32 nPropertyID, Lib3MF_uint64 nCompositeBufferSize, Lib3MF_uint64* pCompositeNeededCount, Lib3MF::sCompositeConstituent * pCompositeBuffer) = 0; - -}; - -typedef IBaseSharedPtr PICompositeMaterials; + virtual bool HasParameterValue(const std::string & sNameSpaceName, const std::string & sValueName) = 0; + /** + * IToolpathProfile::GetParameterValue - Retrieves a profile's parameter value. Fails if value does not exist. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @return Returns the value of the field. + */ + virtual std::string GetParameterValue(const std::string & sNameSpaceName, const std::string & sValueName) = 0; -/************************************************************************************************************************* - Class interface for MultiPropertyGroup -**************************************************************************************************************************/ + /** + * IToolpathProfile::GetParameterValueDef - Retrieves a profile's parameter value + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @param[in] sDefaultValue - Default value if value does not exist. + * @return Returns the value of the field. + */ + virtual std::string GetParameterValueDef(const std::string & sNameSpaceName, const std::string & sValueName, const std::string & sDefaultValue) = 0; -class IMultiPropertyGroup : public virtual IResource { -public: /** - * IMultiPropertyGroup::ClassTypeId - Get Class Type Id - * @return Class type as a 64 bits integer + * IToolpathProfile::GetParameterDoubleValue - Retrieves a profile's parameter value as double. Fails if value does not exist or is not a double value. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @return Returns the value of the field. */ - Lib3MF_uint64 ClassTypeId() override - { - return 0xB989E02E43158FE6UL; // First 64 bits of SHA1 of a string: "Lib3MF::MultiPropertyGroup" - } + virtual Lib3MF_double GetParameterDoubleValue(const std::string & sNameSpaceName, const std::string & sValueName) = 0; /** - * IMultiPropertyGroup::GetCount - Retrieves the count of MultiProperty-s in the MultiPropertyGroup. - * @return returns the count of MultiProperty-s + * IToolpathProfile::GetParameterDoubleValueDef - Retrieves a profile's parameter value as double. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @param[in] dDefaultValue - Default value if value does not exist or is not a double value. + * @return Returns the value of the field. */ - virtual Lib3MF_uint32 GetCount() = 0; + virtual Lib3MF_double GetParameterDoubleValueDef(const std::string & sNameSpaceName, const std::string & sValueName, const Lib3MF_double dDefaultValue) = 0; /** - * IMultiPropertyGroup::GetAllPropertyIDs - returns all the PropertyIDs of all MultiProperty-s in this MultiPropertyGroup - * @param[in] nPropertyIDsBufferSize - Number of elements in buffer - * @param[out] pPropertyIDsNeededCount - will be filled with the count of the written structs, or needed buffer size. - * @param[out] pPropertyIDsBuffer - uint32 buffer of PropertyID of the MultiProperty-s in the MultiPropertyGroup. + * IToolpathProfile::GetParameterIntegerValue - Retrieves a profile's parameter value as integer. Fails if value does not exist or is not a integer value. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @return Returns the value of the field. */ - virtual void GetAllPropertyIDs(Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) = 0; + virtual Lib3MF_int64 GetParameterIntegerValue(const std::string & sNameSpaceName, const std::string & sValueName) = 0; /** - * IMultiPropertyGroup::AddMultiProperty - Adds a new MultiProperty to the MultiPropertyGroup. - * @param[in] nPropertyIDsBufferSize - Number of elements in buffer - * @param[in] pPropertyIDsBuffer - The PropertyIDs of the new MultiProperty. - * @return returns the PropertyID of the new MultiProperty in the MultiPropertyGroup. + * IToolpathProfile::GetParameterIntegerValueDef - Retrieves a profile's parameter value as integer. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @param[in] nDefaultValue - Default value if value does not exist or is not a integer value. + * @return Returns the value of the field. */ - virtual Lib3MF_uint32 AddMultiProperty(const Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer) = 0; + virtual Lib3MF_int64 GetParameterIntegerValueDef(const std::string & sNameSpaceName, const std::string & sValueName, const Lib3MF_int64 nDefaultValue) = 0; /** - * IMultiPropertyGroup::SetMultiProperty - Sets the PropertyIDs of a MultiProperty. - * @param[in] nPropertyID - the PropertyID of the MultiProperty to be changed. - * @param[in] nPropertyIDsBufferSize - Number of elements in buffer - * @param[in] pPropertyIDsBuffer - The new PropertyIDs of the MultiProperty + * IToolpathProfile::GetParameterBoolValue - Retrieves a profile's parameter value as boolean. Fails if value does not exist or is not a boolean value. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @return Returns the value of the field. */ - virtual void SetMultiProperty(const Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer) = 0; + virtual bool GetParameterBoolValue(const std::string & sNameSpaceName, const std::string & sValueName) = 0; /** - * IMultiPropertyGroup::GetMultiProperty - Obtains the PropertyIDs of a MultiProperty. - * @param[in] nPropertyID - the PropertyID of the MultiProperty to be queried. - * @param[in] nPropertyIDsBufferSize - Number of elements in buffer - * @param[out] pPropertyIDsNeededCount - will be filled with the count of the written structs, or needed buffer size. - * @param[out] pPropertyIDsBuffer - uint32 buffer of The PropertyIDs of the MultiProperty + * IToolpathProfile::GetParameterBoolValueDef - Retrieves a profile's parameter value as boolean. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @param[in] bDefaultValue - Default value if value does not exist or is not a boolean value. + * @return Returns the value of the field. */ - virtual void GetMultiProperty(const Lib3MF_uint32 nPropertyID, Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) = 0; + virtual bool GetParameterBoolValueDef(const std::string & sNameSpaceName, const std::string & sValueName, const bool bDefaultValue) = 0; /** - * IMultiPropertyGroup::RemoveMultiProperty - Removes a MultiProperty from this MultiPropertyGroup. - * @param[in] nPropertyID - the PropertyID of the MultiProperty to be removed. + * IToolpathProfile::SetName - Sets the profile's name + * @param[in] sName - Returns the name. */ - virtual void RemoveMultiProperty(const Lib3MF_uint32 nPropertyID) = 0; + virtual void SetName(const std::string & sName) = 0; /** - * IMultiPropertyGroup::GetLayerCount - Retrieves the number of layers of this MultiPropertyGroup. - * @return returns the number of layers + * IToolpathProfile::SetParameterValue - Sets a profile's parameter value. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @param[in] sValue - String value of the parameter. */ - virtual Lib3MF_uint32 GetLayerCount() = 0; + virtual void SetParameterValue(const std::string & sNameSpaceName, const std::string & sValueName, const std::string & sValue) = 0; /** - * IMultiPropertyGroup::AddLayer - Adds a MultiPropertyLayer to this MultiPropertyGroup. - * @param[in] TheLayer - The MultiPropertyLayer to add to this MultiPropertyGroup - * @return returns the index of this MultiPropertyLayer + * IToolpathProfile::SetParameterDoubleValue - Sets a profile's parameter value as double. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @param[in] dValue - Double value of the parameter. */ - virtual Lib3MF_uint32 AddLayer(const Lib3MF::sMultiPropertyLayer TheLayer) = 0; + virtual void SetParameterDoubleValue(const std::string & sNameSpaceName, const std::string & sValueName, const Lib3MF_double dValue) = 0; /** - * IMultiPropertyGroup::GetLayer - Obtains a MultiPropertyLayer of this MultiPropertyGroup. - * @param[in] nLayerIndex - The Index of the MultiPropertyLayer queried - * @return The MultiPropertyLayer with index LayerIndex within MultiPropertyGroup + * IToolpathProfile::SetParameterIntegerValue - Sets a profile's parameter value as integer. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @param[in] nValue - Integer value of the parameter. */ - virtual Lib3MF::sMultiPropertyLayer GetLayer(const Lib3MF_uint32 nLayerIndex) = 0; + virtual void SetParameterIntegerValue(const std::string & sNameSpaceName, const std::string & sValueName, const Lib3MF_int64 nValue) = 0; /** - * IMultiPropertyGroup::RemoveLayer - Removes a MultiPropertyLayer from this MultiPropertyGroup. - * @param[in] nLayerIndex - The Index of the MultiPropertyLayer to be removed + * IToolpathProfile::SetParameterBoolValue - Sets a profile's parameter value as boolean. + * @param[in] sNameSpaceName - Name of the Parameter Namespace. + * @param[in] sValueName - Value key string. + * @param[in] bValue - Boolean value of the parameter. */ - virtual void RemoveLayer(const Lib3MF_uint32 nLayerIndex) = 0; + virtual void SetParameterBoolValue(const std::string & sNameSpaceName, const std::string & sValueName, const bool bValue) = 0; }; -typedef IBaseSharedPtr PIMultiPropertyGroup; +typedef IBaseSharedPtr PIToolpathProfile; /************************************************************************************************************************* - Class interface for Attachment + Class interface for ToolpathLayerReader **************************************************************************************************************************/ -class IAttachment : public virtual IBase { +class IToolpathLayerReader : public virtual IBase { public: /** - * IAttachment::ClassTypeId - Get Class Type Id + * IToolpathLayerReader::ClassTypeId - Get Class Type Id * @return Class type as a 64 bits integer */ Lib3MF_uint64 ClassTypeId() override { - return 0x8CE7A1191A63A35DUL; // First 64 bits of SHA1 of a string: "Lib3MF::Attachment" + return 0x28DD7D3718F0616EUL; // First 64 bits of SHA1 of a string: "Lib3MF::ToolpathLayerReader" } /** - * IAttachment::GetPath - Retrieves an attachment's package path. This function will be removed in a later release. - * @return returns the attachment's package path string + * IToolpathLayerReader::GetLayerDataUUID - Retrieves the layerdata's uuid + * @return Returns the uuid value. */ - virtual std::string GetPath() = 0; + virtual std::string GetLayerDataUUID() = 0; /** - * IAttachment::SetPath - Sets an attachment's package path. This function will be removed in a later release. - * @param[in] sPath - new path of the attachment. + * IToolpathLayerReader::GetSegmentCount - Retrieves the count of segments. + * @return Count */ - virtual void SetPath(const std::string & sPath) = 0; + virtual Lib3MF_uint32 GetSegmentCount() = 0; /** - * IAttachment::PackagePart - Returns the PackagePart that is this attachment. - * @return The PackagePart of this attachment. + * IToolpathLayerReader::GetSegmentInfo - Retrieves the segment type information . + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @param[out] eType - Segment Type + * @param[out] nPointCount - Point count of segment. */ - virtual IPackagePart * PackagePart() = 0; + virtual void GetSegmentInfo(const Lib3MF_uint32 nIndex, Lib3MF::eToolpathSegmentType & eType, Lib3MF_uint32 & nPointCount) = 0; /** - * IAttachment::GetRelationShipType - Retrieves an attachment's relationship type - * @return returns the attachment's package relationship type string + * IToolpathLayerReader::GetSegmentProfile - Retrieves the assigned segment profile. + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @return Segment Profile */ - virtual std::string GetRelationShipType() = 0; + virtual IToolpathProfile * GetSegmentProfile(const Lib3MF_uint32 nIndex) = 0; /** - * IAttachment::SetRelationShipType - Sets an attachment's relationship type. - * @param[in] sPath - new relationship type string. + * IToolpathLayerReader::GetSegmentProfileUUID - Retrieves the assigned segment profile uuid. + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @return Segment Profile UUID */ - virtual void SetRelationShipType(const std::string & sPath) = 0; + virtual std::string GetSegmentProfileUUID(const Lib3MF_uint32 nIndex) = 0; /** - * IAttachment::WriteToFile - Writes out the attachment as file. - * @param[in] sFileName - file to write into. + * IToolpathLayerReader::GetSegmentPart - Retrieves the assigned segment profile. + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @return Segment Build Item */ - virtual void WriteToFile(const std::string & sFileName) = 0; + virtual IBuildItem * GetSegmentPart(const Lib3MF_uint32 nIndex) = 0; /** - * IAttachment::ReadFromFile - Reads an attachment from a file. The path of this file is only read when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. - * @param[in] sFileName - file to read from. + * IToolpathLayerReader::GetSegmentPartUUID - Retrieves the assigned segment part uuid. + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @return Segment Part UUID */ - virtual void ReadFromFile(const std::string & sFileName) = 0; + virtual std::string GetSegmentPartUUID(const Lib3MF_uint32 nIndex) = 0; /** - * IAttachment::ReadFromCallback - Reads an attachment from the data provided by a callback function. This callback function is only invoked when this attachment is being written as part of the 3MF package, or via the WriteToFile or WriteToBuffer-methods. - * @param[in] pTheReadCallback - callback function - * @param[in] nStreamSize - number of bytes the callback returns - * @param[in] pTheSeekCallback - callback function - * @param[in] nUserData - Userdata that is passed to the callback function + * IToolpathLayerReader::GetSegmentLocalPartID - Retrieves the assigned segment part id. ATTENTION: This ID is only unique within the layer and there is no guarantee to be globally unique or consistent across layers. + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @return Local Segment Part ID */ - virtual void ReadFromCallback(const Lib3MF::ReadCallback pTheReadCallback, const Lib3MF_uint64 nStreamSize, const Lib3MF::SeekCallback pTheSeekCallback, const Lib3MF_pvoid pUserData) = 0; + virtual Lib3MF_uint32 GetSegmentLocalPartID(const Lib3MF_uint32 nIndex) = 0; /** - * IAttachment::GetStreamSize - Retrieves the size of the attachment stream - * @return the stream size + * IToolpathLayerReader::GetPartUUIDByLocalPartID - Retrieves the global part UUID by the local part ID. Fails if part ID does not exist in this layer. ATTENTION: This ID is only unique within the layer and there is no guarantee to be globally unique or consistent across layers. + * @param[in] nLocalPartID - Local Segment Part ID + * @return Segment Part UUID */ - virtual Lib3MF_uint64 GetStreamSize() = 0; + virtual std::string GetPartUUIDByLocalPartID(const Lib3MF_uint32 nLocalPartID) = 0; /** - * IAttachment::WriteToBuffer - Writes out the attachment into a buffer - * @param[in] nBufferBufferSize - Number of elements in buffer - * @param[out] pBufferNeededCount - will be filled with the count of the written structs, or needed buffer size. - * @param[out] pBufferBuffer - uint8 buffer of Buffer to write into + * IToolpathLayerReader::GetSegmentPointData - Retrieves the assigned segment point list. For type hatch, the points are taken pairwise. + * @param[in] nIndex - Index. Must be between 0 and Count - 1. + * @param[in] nPointDataBufferSize - Number of elements in buffer + * @param[out] pPointDataNeededCount - will be filled with the count of the written structs, or needed buffer size. + * @param[out] pPointDataBuffer - Position2D buffer of The point data array */ - virtual void WriteToBuffer(Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer) = 0; + virtual void GetSegmentPointData(const Lib3MF_uint32 nIndex, Lib3MF_uint64 nPointDataBufferSize, Lib3MF_uint64* pPointDataNeededCount, Lib3MF::sPosition2D * pPointDataBuffer) = 0; /** - * IAttachment::ReadFromBuffer - Reads an attachment from a memory buffer. This buffer is immediatly read (in contrast to the ReadFromCallback and ReadFromFile-methods). - * @param[in] nBufferBufferSize - Number of elements in buffer - * @param[in] pBufferBuffer - Buffer to read from + * IToolpathLayerReader::FindAttributeInfoByName - Retrieves a segment attribute Information by Attribute Name. Will fail if Attribute does not exist. + * @param[in] sNameSpace - Namespace of the custom attribute. + * @param[in] sAttributeName - Name of the custom attribute. + * @param[out] nID - Attribute ID. + * @param[out] eAttributeType - Attribute Type. */ - virtual void ReadFromBuffer(const Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer) = 0; - -}; - -typedef IBaseSharedPtr PIAttachment; - - -/************************************************************************************************************************* - Class interface for Texture2D -**************************************************************************************************************************/ + virtual void FindAttributeInfoByName(const std::string & sNameSpace, const std::string & sAttributeName, Lib3MF_uint32 & nID, Lib3MF::eToolpathAttributeType & eAttributeType) = 0; -class ITexture2D : public virtual IResource { -public: /** - * ITexture2D::ClassTypeId - Get Class Type Id - * @return Class type as a 64 bits integer + * IToolpathLayerReader::FindAttributeIDByName - Retrieves a segment attribute ID by Attribute Name. Will fail if Attribute does not exist. + * @param[in] sNameSpace - Namespace of the custom attribute. + * @param[in] sAttributeName - Name of the custom attribute. + * @return Attribute ID. */ - Lib3MF_uint64 ClassTypeId() override - { - return 0xE0441CF976B36319UL; // First 64 bits of SHA1 of a string: "Lib3MF::Texture2D" - } + virtual Lib3MF_uint32 FindAttributeIDByName(const std::string & sNameSpace, const std::string & sAttributeName) = 0; /** - * ITexture2D::GetAttachment - Retrieves the attachment located at the path of the texture. - * @return attachment that holds the texture's image information. + * IToolpathLayerReader::FindAttributeValueByName - Retrieves a segment attribute Type by Attribute Name. Will fail if Attribute does not exist. + * @param[in] sNameSpace - Namespace of the custom attribute. + * @param[in] sAttributeName - Name of the custom attribute. + * @return Attribute Type. */ - virtual IAttachment * GetAttachment() = 0; + virtual Lib3MF::eToolpathAttributeType FindAttributeValueByName(const std::string & sNameSpace, const std::string & sAttributeName) = 0; /** - * ITexture2D::SetAttachment - Sets the texture's package path to the path of the attachment. - * @param[in] pAttachment - attachment that holds the texture's image information. + * IToolpathLayerReader::GetSegmentIntegerAttributeByID - Retrieves a segment Uint32 attribute by Attribute ID. Will fail if Attribute does not exist. + * @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. + * @param[in] nID - Attribute ID. + * @return Attribute Value. */ - virtual void SetAttachment(IAttachment* pAttachment) = 0; + virtual Lib3MF_int64 GetSegmentIntegerAttributeByID(const Lib3MF_uint32 nIndex, const Lib3MF_uint32 nID) = 0; /** - * ITexture2D::GetContentType - Retrieves a texture's content type. - * @return returns content type enum. + * IToolpathLayerReader::GetSegmentIntegerAttributeByName - Retrieves a segment integer attribute by Attribute Name. Will fail if Attribute does not exist or is of different type. + * @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. + * @param[in] sNameSpace - Namespace of the custom attribute. + * @param[in] sAttributeName - Name of the custom attribute. + * @return Attribute Value. */ - virtual Lib3MF::eTextureType GetContentType() = 0; + virtual Lib3MF_int64 GetSegmentIntegerAttributeByName(const Lib3MF_uint32 nIndex, const std::string & sNameSpace, const std::string & sAttributeName) = 0; /** - * ITexture2D::SetContentType - Retrieves a texture's content type. - * @param[in] eContentType - new Content Type + * IToolpathLayerReader::GetSegmentDoubleAttributeByID - Retrieves a segment Double attribute by Attribute ID. Will fail if Attribute does not exist. + * @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. + * @param[in] nID - Attribute ID. + * @return Attribute Value. */ - virtual void SetContentType(const Lib3MF::eTextureType eContentType) = 0; + virtual Lib3MF_double GetSegmentDoubleAttributeByID(const Lib3MF_uint32 nIndex, const Lib3MF_uint32 nID) = 0; /** - * ITexture2D::GetTileStyleUV - Retrieves a texture's tilestyle type. - * @param[out] eTileStyleU - returns tilestyle type enum. - * @param[out] eTileStyleV - returns tilestyle type enum. + * IToolpathLayerReader::GetSegmentDoubleAttributeByName - Retrieves a segment Double attribute by Attribute Name. Will fail if Attribute does not exist. + * @param[in] nIndex - Segment Index. Must be between 0 and Count - 1. + * @param[in] sNameSpace - Namespace of the custom attribute. + * @param[in] sAttributeName - Name of the custom attribute. + * @return Attribute Value. */ - virtual void GetTileStyleUV(Lib3MF::eTextureTileStyle & eTileStyleU, Lib3MF::eTextureTileStyle & eTileStyleV) = 0; + virtual Lib3MF_double GetSegmentDoubleAttributeByName(const Lib3MF_uint32 nIndex, const std::string & sNameSpace, const std::string & sAttributeName) = 0; /** - * ITexture2D::SetTileStyleUV - Sets a texture's tilestyle type. - * @param[in] eTileStyleU - new tilestyle type enum. - * @param[in] eTileStyleV - new tilestyle type enum. + * IToolpathLayerReader::GetCustomDataCount - Retrieves the count of custom data elements. + * @return Count */ - virtual void SetTileStyleUV(const Lib3MF::eTextureTileStyle eTileStyleU, const Lib3MF::eTextureTileStyle eTileStyleV) = 0; + virtual Lib3MF_uint32 GetCustomDataCount() = 0; /** - * ITexture2D::GetFilter - Retrieves a texture's filter type. - * @return returns filter type enum. + * IToolpathLayerReader::GetCustomData - Retrieves the custom data. + * @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count + * @return DOM Tree of the data. */ - virtual Lib3MF::eTextureFilter GetFilter() = 0; + virtual ICustomDOMTree * GetCustomData(const Lib3MF_uint32 nIndex) = 0; /** - * ITexture2D::SetFilter - Sets a texture's filter type. - * @param[in] eFilter - sets new filter type enum. + * IToolpathLayerReader::GetCustomDataName - Retrieves the node name of the custom data. + * @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count + * @param[out] sNameSpace - Namespace of the custom data tree. + * @param[out] sDataName - Root name of the data tree. */ - virtual void SetFilter(const Lib3MF::eTextureFilter eFilter) = 0; + virtual void GetCustomDataName(const Lib3MF_uint32 nIndex, std::string & sNameSpace, std::string & sDataName) = 0; }; -typedef IBaseSharedPtr PITexture2D; +typedef IBaseSharedPtr PIToolpathLayerReader; /************************************************************************************************************************* - Class interface for BuildItem + Class interface for ToolpathLayerData **************************************************************************************************************************/ -class IBuildItem : public virtual IBase { +class IToolpathLayerData : public virtual IBase { public: /** - * IBuildItem::ClassTypeId - Get Class Type Id + * IToolpathLayerData::ClassTypeId - Get Class Type Id * @return Class type as a 64 bits integer */ Lib3MF_uint64 ClassTypeId() override { - return 0x68FB2D5FFC4BA12AUL; // First 64 bits of SHA1 of a string: "Lib3MF::BuildItem" + return 0x28C0E70CC44F931AUL; // First 64 bits of SHA1 of a string: "Lib3MF::ToolpathLayerData" } /** - * IBuildItem::GetObjectResource - Retrieves the object resource associated to a build item - * @return returns the associated resource instance - */ - virtual IObject * GetObjectResource() = 0; - - /** - * IBuildItem::GetUUID - returns, whether a build item has a UUID and, if true, the build item's UUID - * @param[out] bHasUUID - flag whether the build item has a UUID - * @return the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + * IToolpathLayerData::GetLayerDataUUID - Retrieves the layerdata's uuid + * @return Returns the uuid value. */ - virtual std::string GetUUID(bool & bHasUUID) = 0; + virtual std::string GetLayerDataUUID() = 0; /** - * IBuildItem::SetUUID - sets the build item's UUID - * @param[in] sUUID - the UUID as string of the form 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx' + * IToolpathLayerData::RegisterProfile - Registers a toolpath profile + * @param[in] pProfile - The toolpath profile to register. + * @return returns the local profile ID for the layer. */ - virtual void SetUUID(const std::string & sUUID) = 0; + virtual Lib3MF_uint32 RegisterProfile(IToolpathProfile* pProfile) = 0; /** - * IBuildItem::GetObjectResourceID - Retrieves the object UniqueResourceID associated to a build item - * @return returns the UniqueResourceID of the object + * IToolpathLayerData::RegisterBuildItem - Registers a Model Build Item + * @param[in] pBuildItem - The model build item to use. + * @return returns the local part ID for the layer. */ - virtual Lib3MF_uint32 GetObjectResourceID() = 0; + virtual Lib3MF_uint32 RegisterBuildItem(IBuildItem* pBuildItem) = 0; /** - * IBuildItem::HasObjectTransform - Checks, if a build item has a non-identity transformation matrix - * @return returns true, if the transformation matrix is not the identity + * IToolpathLayerData::SetSegmentAttribute - Sets Segment Attribute for all following segments that are added. Overrides previously set attribute. + * @param[in] sNameSpace - The namespace of the attribute to register. + * @param[in] sAttributeName - The name of the attribute to register. + * @param[in] sValue - The value of the attribute to register. */ - virtual bool HasObjectTransform() = 0; + virtual void SetSegmentAttribute(const std::string & sNameSpace, const std::string & sAttributeName, const std::string & sValue) = 0; /** - * IBuildItem::GetObjectTransform - Retrieves a build item's transformation matrix. - * @return returns the transformation matrix + * IToolpathLayerData::ClearSegmentAttributes - Clears current segment attributes. */ - virtual Lib3MF::sTransform GetObjectTransform() = 0; + virtual void ClearSegmentAttributes() = 0; /** - * IBuildItem::SetObjectTransform - Sets a build item's transformation matrix. - * @param[in] Transform - new transformation matrix + * IToolpathLayerData::WriteHatchData - writes hatch data to the layer. + * @param[in] nProfileID - The toolpath profile to use + * @param[in] nPartID - The toolpath part to use + * @param[in] nPointDataBufferSize - Number of elements in buffer + * @param[in] pPointDataBuffer - The point data */ - virtual void SetObjectTransform(const Lib3MF::sTransform Transform) = 0; + virtual void WriteHatchData(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const Lib3MF_uint64 nPointDataBufferSize, const Lib3MF::sPosition2D * pPointDataBuffer) = 0; /** - * IBuildItem::GetPartNumber - Retrieves a build item's part number string - * @return Returns a build item's part number string + * IToolpathLayerData::WriteLoop - writes loop data to the layer. + * @param[in] nProfileID - The toolpath profile to use + * @param[in] nPartID - The toolpath part to use + * @param[in] nPointDataBufferSize - Number of elements in buffer + * @param[in] pPointDataBuffer - The point data */ - virtual std::string GetPartNumber() = 0; + virtual void WriteLoop(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const Lib3MF_uint64 nPointDataBufferSize, const Lib3MF::sPosition2D * pPointDataBuffer) = 0; /** - * IBuildItem::SetPartNumber - Sets a build item's part number string - * @param[in] sSetPartnumber - new part number string for referencing parts from the outside world + * IToolpathLayerData::WritePolyline - writes polyline data to the layer. + * @param[in] nProfileID - The toolpath profile to use + * @param[in] nPartID - The toolpath part to use + * @param[in] nPointDataBufferSize - Number of elements in buffer + * @param[in] pPointDataBuffer - The point data */ - virtual void SetPartNumber(const std::string & sSetPartnumber) = 0; + virtual void WritePolyline(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const Lib3MF_uint64 nPointDataBufferSize, const Lib3MF::sPosition2D * pPointDataBuffer) = 0; /** - * IBuildItem::GetMetaDataGroup - Returns the metadatagroup of this build item - * @return returns an Instance of the metadatagroup of this build item + * IToolpathLayerData::AddCustomData - Adds a custom data DOM tree to the layer. Layer MUST not be finished when changing the DOM tree. + * @param[in] sNameSpace - Namespace of the custom data tree. MUST not be empty. + * @param[in] sDataName - Root name of the data tree. MUST not be empty. MUST be a valid XML name string. + * @return DOM Tree of the data. */ - virtual IMetaDataGroup * GetMetaDataGroup() = 0; + virtual ICustomDOMTree * AddCustomData(const std::string & sNameSpace, const std::string & sDataName) = 0; /** - * IBuildItem::GetOutbox - Returns the outbox of a build item - * @return Outbox of this build item + * IToolpathLayerData::Finish - finishes all writing of the layer and compresses toolpath data. */ - virtual Lib3MF::sBox GetOutbox() = 0; + virtual void Finish() = 0; }; -typedef IBaseSharedPtr PIBuildItem; +typedef IBaseSharedPtr PIToolpathLayerData; /************************************************************************************************************************* - Class interface for BuildItemIterator + Class interface for Toolpath **************************************************************************************************************************/ -class IBuildItemIterator : public virtual IBase { +class IToolpath : public virtual IResource { public: /** - * IBuildItemIterator::ClassTypeId - Get Class Type Id + * IToolpath::ClassTypeId - Get Class Type Id * @return Class type as a 64 bits integer */ Lib3MF_uint64 ClassTypeId() override { - return 0xA7D21BD364910860UL; // First 64 bits of SHA1 of a string: "Lib3MF::BuildItemIterator" + return 0xF0AAB2C814D9FFB1UL; // First 64 bits of SHA1 of a string: "Lib3MF::Toolpath" } /** - * IBuildItemIterator::MoveNext - Iterates to the next build item in the list. - * @return Iterates to the next build item in the list. + * IToolpath::GetUnits - Retrieves the unit factor + * @return Returns the unit factor. */ - virtual bool MoveNext() = 0; + virtual Lib3MF_double GetUnits() = 0; /** - * IBuildItemIterator::MovePrevious - Iterates to the previous build item in the list. - * @return Iterates to the previous build item in the list. + * IToolpath::GetLayerCount - Retrieves the count of layers + * @return Returns the layer count */ - virtual bool MovePrevious() = 0; + virtual Lib3MF_uint32 GetLayerCount() = 0; /** - * IBuildItemIterator::GetCurrent - Returns the build item the iterator points at. - * @return returns the build item instance. + * IToolpath::GetProfileCount - Retrieves the count of profiles + * @return Returns the profile count */ - virtual IBuildItem * GetCurrent() = 0; + virtual Lib3MF_uint32 GetProfileCount() = 0; /** - * IBuildItemIterator::Clone - Creates a new build item iterator with the same build item list. - * @return returns the cloned Iterator instance + * IToolpath::AddLayer - Adds a new toolpath layer + * @param[in] nZMax - ZMax value + * @param[in] sPath - Package Path + * @param[in] pModelWriter - The model writer that writes out the 3MF. + * @return Returns the layerdata object to write the layer content into. */ - virtual IBuildItemIterator * Clone() = 0; + virtual IToolpathLayerData * AddLayer(const Lib3MF_uint32 nZMax, const std::string & sPath, IWriter* pModelWriter) = 0; /** - * IBuildItemIterator::Count - Returns the number of build items the iterator captures. - * @return returns the number of build items the iterator captures. + * IToolpath::GetLayerAttachment - Retrieves the Attachment of a layer + * @param[in] nIndex - Layer Index + * @return Attachment */ - virtual Lib3MF_uint64 Count() = 0; + virtual IAttachment * GetLayerAttachment(const Lib3MF_uint32 nIndex) = 0; -}; + /** + * IToolpath::ReadLayerData - Reads the toolpath of a layer. + * @param[in] nIndex - Layer Index + * @return Toolpath Reader Instance + */ + virtual IToolpathLayerReader * ReadLayerData(const Lib3MF_uint32 nIndex) = 0; -typedef IBaseSharedPtr PIBuildItemIterator; + /** + * IToolpath::GetLayerPath - Retrieves the Path of a layer + * @param[in] nIndex - Layer Index + * @return Package Path + */ + virtual std::string GetLayerPath(const Lib3MF_uint32 nIndex) = 0; + /** + * IToolpath::GetLayerZMax - Retrieves the ZMax of a layer + * @param[in] nIndex - Layer Index + * @return ZMax value + */ + virtual Lib3MF_uint32 GetLayerZMax(const Lib3MF_uint32 nIndex) = 0; -/************************************************************************************************************************* - Class interface for Slice -**************************************************************************************************************************/ + /** + * IToolpath::GetLayerZ - Return the z value of a layer in units. + * @param[in] nLayerIndex - Layer Index. + * @return Z Value in Units. + */ + virtual Lib3MF_uint32 GetLayerZ(const Lib3MF_uint32 nLayerIndex) = 0; -class ISlice : public virtual IBase { -public: /** - * ISlice::ClassTypeId - Get Class Type Id - * @return Class type as a 64 bits integer + * IToolpath::AddProfile - Adds a new profile to the toolpath. + * @param[in] sName - the name. + * @return Returns the profile. */ - Lib3MF_uint64 ClassTypeId() override - { - return 0x2198BCF4D8DF9C40UL; // First 64 bits of SHA1 of a string: "Lib3MF::Slice" - } + virtual IToolpathProfile * AddProfile(const std::string & sName) = 0; /** - * ISlice::SetVertices - Set all vertices of a slice. All polygons will be cleared. - * @param[in] nVerticesBufferSize - Number of elements in buffer - * @param[in] pVerticesBuffer - contains the positions. + * IToolpath::GetProfile - Returns a profile of the toolpath. + * @param[in] nProfileIndex - Layer Index. + * @return Returns the profile. */ - virtual void SetVertices(const Lib3MF_uint64 nVerticesBufferSize, const Lib3MF::sPosition2D * pVerticesBuffer) = 0; + virtual IToolpathProfile * GetProfile(const Lib3MF_uint32 nProfileIndex) = 0; /** - * ISlice::GetVertices - Get all vertices of a slice - * @param[in] nVerticesBufferSize - Number of elements in buffer - * @param[out] pVerticesNeededCount - will be filled with the count of the written structs, or needed buffer size. - * @param[out] pVerticesBuffer - Position2D buffer of contains the positions. + * IToolpath::GetProfileUUID - Returns a profile of the toolpath by UUID. + * @param[in] sProfileUUID - UUID string. + * @return Returns the profile. */ - virtual void GetVertices(Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, Lib3MF::sPosition2D * pVerticesBuffer) = 0; + virtual IToolpathProfile * GetProfileUUID(const std::string & sProfileUUID) = 0; /** - * ISlice::GetVertexCount - Get the number of vertices in a slice - * @return the number of vertices in the slice + * IToolpath::GetCustomDataCount - Retrieves the count of custom data elements. + * @return Count */ - virtual Lib3MF_uint64 GetVertexCount() = 0; + virtual Lib3MF_uint32 GetCustomDataCount() = 0; /** - * ISlice::AddPolygon - Add a new polygon to this slice - * @param[in] nIndicesBufferSize - Number of elements in buffer - * @param[in] pIndicesBuffer - the new indices of the new polygon - * @return the index of the new polygon + * IToolpath::GetCustomData - Retrieves the custom data. + * @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count + * @return DOM Tree of the data. */ - virtual Lib3MF_uint64 AddPolygon(const Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer) = 0; + virtual ICustomDOMTree * GetCustomData(const Lib3MF_uint32 nIndex) = 0; /** - * ISlice::GetPolygonCount - Get the number of polygons in the slice - * @return the number of polygons in the slice + * IToolpath::GetCustomDataName - Retrieves the node name of the custom data. + * @param[in] nIndex - Index of the Custom Data. 0-based. MUST be smaller than Data Count + * @param[out] sNameSpace - Namespace of the custom data tree. + * @param[out] sDataName - Root name of the data tree. */ - virtual Lib3MF_uint64 GetPolygonCount() = 0; + virtual void GetCustomDataName(const Lib3MF_uint32 nIndex, std::string & sNameSpace, std::string & sDataName) = 0; /** - * ISlice::SetPolygonIndices - Set all indices of a polygon - * @param[in] nIndex - the index of the polygon to manipulate - * @param[in] nIndicesBufferSize - Number of elements in buffer - * @param[in] pIndicesBuffer - the new indices of the index-th polygon + * IToolpath::HasUniqueCustomData - Retrieves if custom data with a specific namespace and name combination exists. + * @param[in] sNameSpace - Namespace of the custom data tree. + * @param[in] sDataName - Root name of the data tree. + * @return Returns true if DOM Tree Exists. */ - virtual void SetPolygonIndices(const Lib3MF_uint64 nIndex, const Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer) = 0; + virtual bool HasUniqueCustomData(const std::string & sNameSpace, const std::string & sDataName) = 0; /** - * ISlice::GetPolygonIndices - Get all vertices of a slice - * @param[in] nIndex - the index of the polygon to manipulate - * @param[in] nIndicesBufferSize - Number of elements in buffer - * @param[out] pIndicesNeededCount - will be filled with the count of the written structs, or needed buffer size. - * @param[out] pIndicesBuffer - uint32 buffer of the indices of the index-th polygon + * IToolpath::FindUniqueCustomData - Retrieves the custom data with a specific namespace and name combination. Fails if combination is not unique. + * @param[in] sNameSpace - Namespace of the custom data tree. + * @param[in] sDataName - Root name of the data tree. + * @return DOM Tree of the data. */ - virtual void GetPolygonIndices(const Lib3MF_uint64 nIndex, Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF_uint32 * pIndicesBuffer) = 0; + virtual ICustomDOMTree * FindUniqueCustomData(const std::string & sNameSpace, const std::string & sDataName) = 0; /** - * ISlice::GetPolygonIndexCount - Get the number of vertices in a slice - * @param[in] nIndex - the index of the polygon to manipulate - * @return the number of indices of the index-th polygon + * IToolpath::AddCustomData - Adds a custom data DOM tree to the toolpath. + * @param[in] sNameSpace - Namespace of the custom data tree. MUST not be empty. + * @param[in] sDataName - Root name of the data tree. MUST not be empty. MUST be a valid XML name string. + * @return DOM Tree of the data. */ - virtual Lib3MF_uint64 GetPolygonIndexCount(const Lib3MF_uint64 nIndex) = 0; + virtual ICustomDOMTree * AddCustomData(const std::string & sNameSpace, const std::string & sDataName) = 0; /** - * ISlice::GetZTop - Get the upper Z-Coordinate of this slice. - * @return the upper Z-Coordinate of this slice + * IToolpath::ClearCustomData - Deletes all custom data. + * @return Returns number of deleted items. */ - virtual Lib3MF_double GetZTop() = 0; + virtual Lib3MF_uint32 ClearCustomData() = 0; + + /** + * IToolpath::DeleteCustomData - Deletes a custom data instance from the list. + * @param[in] pData - DOM Tree of the data. + * @return Returns if deletion was successful. + */ + virtual bool DeleteCustomData(ICustomDOMTree* pData) = 0; + + /** + * IToolpath::RegisterCustomIntegerAttribute - Registers an Integer Attribute that each segment holds. + * @param[in] sNameSpace - Namespace of the custom data tree. MUST not be empty. + * @param[in] sAttributeName - Attribute name. MUST not be empty. + */ + virtual void RegisterCustomIntegerAttribute(const std::string & sNameSpace, const std::string & sAttributeName) = 0; + + /** + * IToolpath::RegisterCustomDoubleAttribute - Registers a Double Attribute that each segment holds. Registering only applies to reader or writer objects created after the call. + * @param[in] sNameSpace - Namespace of the custom data tree. MUST not be empty. + * @param[in] sAttributeName - Attribute name. MUST not be empty. + */ + virtual void RegisterCustomDoubleAttribute(const std::string & sNameSpace, const std::string & sAttributeName) = 0; }; -typedef IBaseSharedPtr PISlice; +typedef IBaseSharedPtr PIToolpath; + + +/************************************************************************************************************************* + Class interface for ToolpathIterator +**************************************************************************************************************************/ + +class IToolpathIterator : public virtual IResourceIterator { +public: + /** + * IToolpathIterator::ClassTypeId - Get Class Type Id + * @return Class type as a 64 bits integer + */ + Lib3MF_uint64 ClassTypeId() override + { + return 0xD0F24425A07F2A81UL; // First 64 bits of SHA1 of a string: "Lib3MF::ToolpathIterator" + } + + /** + * IToolpathIterator::GetCurrentToolpath - Returns the Toolpath the iterator points at. + * @return returns the Toolpath instance. + */ + virtual IToolpath * GetCurrentToolpath() = 0; + +}; + +typedef IBaseSharedPtr PIToolpathIterator; /************************************************************************************************************************* @@ -3166,6 +4317,12 @@ class IModel : public virtual IBase { */ virtual IMultiPropertyGroupIterator * GetMultiPropertyGroups() = 0; + /** + * IModel::GetToolpaths - creates a Toolpath instance with all toolpath resources. + * @return returns the iterator instance. + */ + virtual IToolpathIterator * GetToolpaths() = 0; + /** * IModel::GetSliceStacks - creates a resource iterator instance with all slice stack resources. * @return returns the iterator instance. @@ -3250,6 +4407,13 @@ class IModel : public virtual IBase { */ virtual void RemoveBuildItem(IBuildItem* pBuildItemInstance) = 0; + /** + * IModel::AddToolpath - adds an empty Toolpath resource to the model. + * @param[in] dUnitFactor - The toolpath instance of the created Toolpath. + * @return The toolpath instance of the created Toolpath. + */ + virtual IToolpath * AddToolpath(const Lib3MF_double dUnitFactor) = 0; + /** * IModel::GetMetaDataGroup - Returns the metadata of the model as MetaDataGroup * @return returns an Instance of the metadatagroup of the model @@ -3339,6 +4503,31 @@ class IModel : public virtual IBase { */ virtual IKeyStore * GetKeyStore() = 0; + /** + * IModel::CreatePersistentSourceFromFile - Creates an OPC Reader Source from a file. + * @param[in] sFilename - Filename to read from + * @return The instance of the created reader source + */ + virtual IPersistentReaderSource * CreatePersistentSourceFromFile(const std::string & sFilename) = 0; + + /** + * IModel::CreatePersistentSourceFromBuffer - Creates an OPC Reader Source from a memory buffer. The memory buffer MUST exist as long as the Source object exists. + * @param[in] nBufferBufferSize - Number of elements in buffer + * @param[in] pBufferBuffer - Buffer to read from + * @return The instance of the created reader source + */ + virtual IPersistentReaderSource * CreatePersistentSourceFromBuffer(const Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer) = 0; + + /** + * IModel::CreatePersistentSourceFromCallback - Creates an OPC Reader Source from a data provided by a callback function. The callbacks MUST exist as long as the source object exists. + * @param[in] pTheReadCallback - callback function + * @param[in] nStreamSize - number of bytes the callback returns + * @param[in] pTheSeekCallback - callback function + * @param[in] nUserData - Userdata that is passed to the callback function + * @return The instance of the created reader source + */ + virtual IPersistentReaderSource * CreatePersistentSourceFromCallback(const Lib3MF::ReadCallback pTheReadCallback, const Lib3MF_uint64 nStreamSize, const Lib3MF::SeekCallback pTheSeekCallback, const Lib3MF_pvoid pUserData) = 0; + }; typedef IBaseSharedPtr PIModel; diff --git a/Autogenerated/Source/lib3mf_interfacewrapper.cpp b/Autogenerated/Source/lib3mf_interfacewrapper.cpp index 92633dbbd..5f409c539 100644 --- a/Autogenerated/Source/lib3mf_interfacewrapper.cpp +++ b/Autogenerated/Source/lib3mf_interfacewrapper.cpp @@ -123,6 +123,305 @@ Lib3MFResult lib3mf_base_classtypeid(Lib3MF_Base pBase, Lib3MF_uint64 * pClassTy } +/************************************************************************************************************************* + Class implementation for BinaryStream +**************************************************************************************************************************/ +Lib3MFResult lib3mf_binarystream_getbinarypath(Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer) +{ + IBase* pIBaseClass = (IBase *)pBinaryStream; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBinaryStream, "BinaryStream", "GetBinaryPath"); + } + if ( (!pPathBuffer) && !(pPathNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sPath(""); + IBinaryStream* pIBinaryStream = dynamic_cast(pIBaseClass); + if (!pIBinaryStream) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + bool isCacheCall = (pPathBuffer == nullptr); + if (isCacheCall) { + sPath = pIBinaryStream->GetBinaryPath(); + + pIBinaryStream->_setCache (new ParameterCache_1 (sPath)); + } + else { + auto cache = dynamic_cast*> (pIBinaryStream->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sPath); + pIBinaryStream->_setCache (nullptr); + } + + if (pPathNeededChars) + *pPathNeededChars = (Lib3MF_uint32) (sPath.size()+1); + if (pPathBuffer) { + if (sPath.size() >= nPathBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iPath = 0; iPath < sPath.size(); iPath++) + pPathBuffer[iPath] = sPath[iPath]; + pPathBuffer[sPath.size()] = 0; + } + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("Path", sPath.c_str()); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_binarystream_getindexpath(Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer) +{ + IBase* pIBaseClass = (IBase *)pBinaryStream; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBinaryStream, "BinaryStream", "GetIndexPath"); + } + if ( (!pPathBuffer) && !(pPathNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sPath(""); + IBinaryStream* pIBinaryStream = dynamic_cast(pIBaseClass); + if (!pIBinaryStream) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + bool isCacheCall = (pPathBuffer == nullptr); + if (isCacheCall) { + sPath = pIBinaryStream->GetIndexPath(); + + pIBinaryStream->_setCache (new ParameterCache_1 (sPath)); + } + else { + auto cache = dynamic_cast*> (pIBinaryStream->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sPath); + pIBinaryStream->_setCache (nullptr); + } + + if (pPathNeededChars) + *pPathNeededChars = (Lib3MF_uint32) (sPath.size()+1); + if (pPathBuffer) { + if (sPath.size() >= nPathBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iPath = 0; iPath < sPath.size(); iPath++) + pPathBuffer[iPath] = sPath[iPath]; + pPathBuffer[sPath.size()] = 0; + } + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("Path", sPath.c_str()); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_binarystream_getuuid(Lib3MF_BinaryStream pBinaryStream, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) +{ + IBase* pIBaseClass = (IBase *)pBinaryStream; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBinaryStream, "BinaryStream", "GetUUID"); + } + if ( (!pUUIDBuffer) && !(pUUIDNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sUUID(""); + IBinaryStream* pIBinaryStream = dynamic_cast(pIBaseClass); + if (!pIBinaryStream) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + bool isCacheCall = (pUUIDBuffer == nullptr); + if (isCacheCall) { + sUUID = pIBinaryStream->GetUUID(); + + pIBinaryStream->_setCache (new ParameterCache_1 (sUUID)); + } + else { + auto cache = dynamic_cast*> (pIBinaryStream->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sUUID); + pIBinaryStream->_setCache (nullptr); + } + + if (pUUIDNeededChars) + *pUUIDNeededChars = (Lib3MF_uint32) (sUUID.size()+1); + if (pUUIDBuffer) { + if (sUUID.size() >= nUUIDBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iUUID = 0; iUUID < sUUID.size(); iUUID++) + pUUIDBuffer[iUUID] = sUUID[iUUID]; + pUUIDBuffer[sUUID.size()] = 0; + } + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("UUID", sUUID.c_str()); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_binarystream_disablediscretizedarraycompression(Lib3MF_BinaryStream pBinaryStream) +{ + IBase* pIBaseClass = (IBase *)pBinaryStream; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBinaryStream, "BinaryStream", "DisableDiscretizedArrayCompression"); + } + IBinaryStream* pIBinaryStream = dynamic_cast(pIBaseClass); + if (!pIBinaryStream) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBinaryStream->DisableDiscretizedArrayCompression(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_binarystream_enablediscretizedarraycompression(Lib3MF_BinaryStream pBinaryStream, Lib3MF_double dUnits, eLib3MFBinaryStreamPredictionType ePredictionType) +{ + IBase* pIBaseClass = (IBase *)pBinaryStream; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBinaryStream, "BinaryStream", "EnableDiscretizedArrayCompression"); + pJournalEntry->addDoubleParameter("Units", dUnits); + pJournalEntry->addEnumParameter("PredictionType", "BinaryStreamPredictionType", (Lib3MF_int32)(ePredictionType)); + } + IBinaryStream* pIBinaryStream = dynamic_cast(pIBaseClass); + if (!pIBinaryStream) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBinaryStream->EnableDiscretizedArrayCompression(dUnits, ePredictionType); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_binarystream_enablelzma(Lib3MF_BinaryStream pBinaryStream, Lib3MF_uint32 nLZMALevel) +{ + IBase* pIBaseClass = (IBase *)pBinaryStream; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBinaryStream, "BinaryStream", "EnableLZMA"); + pJournalEntry->addUInt32Parameter("LZMALevel", nLZMALevel); + } + IBinaryStream* pIBinaryStream = dynamic_cast(pIBaseClass); + if (!pIBinaryStream) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBinaryStream->EnableLZMA(nLZMALevel); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_binarystream_disablelzma(Lib3MF_BinaryStream pBinaryStream) +{ + IBase* pIBaseClass = (IBase *)pBinaryStream; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBinaryStream, "BinaryStream", "DisableLZMA"); + } + IBinaryStream* pIBinaryStream = dynamic_cast(pIBaseClass); + if (!pIBinaryStream) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBinaryStream->DisableLZMA(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + + /************************************************************************************************************************* Class implementation for Writer **************************************************************************************************************************/ @@ -586,24 +885,290 @@ Lib3MFResult lib3mf_writer_setcontentencryptioncallback(Lib3MF_Writer pWriter, L } } - -/************************************************************************************************************************* - Class implementation for Reader -**************************************************************************************************************************/ -Lib3MFResult lib3mf_reader_readfromfile(Lib3MF_Reader pReader, const char * pFilename) +Lib3MFResult lib3mf_writer_createbinarystream(Lib3MF_Writer pWriter, const char * pIndexPath, const char * pBinaryPath, Lib3MF_BinaryStream * pBinaryStream) { - IBase* pIBaseClass = (IBase *)pReader; + IBase* pIBaseClass = (IBase *)pWriter; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pReader, "Reader", "ReadFromFile"); - pJournalEntry->addStringParameter("Filename", pFilename); + pJournalEntry = m_GlobalJournal->beginClassMethod(pWriter, "Writer", "CreateBinaryStream"); + pJournalEntry->addStringParameter("IndexPath", pIndexPath); + pJournalEntry->addStringParameter("BinaryPath", pBinaryPath); } - if (pFilename == nullptr) + if (pIndexPath == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sFilename(pFilename); - IReader* pIReader = dynamic_cast(pIBaseClass); + if (pBinaryPath == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pBinaryStream == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sIndexPath(pIndexPath); + std::string sBinaryPath(pBinaryPath); + IBase* pBaseBinaryStream(nullptr); + IWriter* pIWriter = dynamic_cast(pIBaseClass); + if (!pIWriter) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseBinaryStream = pIWriter->CreateBinaryStream(sIndexPath, sBinaryPath); + + *pBinaryStream = (IBase*)(pBaseBinaryStream); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("BinaryStream", *pBinaryStream); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_writer_assignbinarystream(Lib3MF_Writer pWriter, Lib3MF_Base pInstance, Lib3MF_BinaryStream pBinaryStream) +{ + IBase* pIBaseClass = (IBase *)pWriter; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pWriter, "Writer", "AssignBinaryStream"); + pJournalEntry->addHandleParameter("Instance", pInstance); + pJournalEntry->addHandleParameter("BinaryStream", pBinaryStream); + } + IBase* pIBaseClassInstance = (IBase *)pInstance; + IBase* pIInstance = dynamic_cast(pIBaseClassInstance); + if (!pIInstance) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); + + IBase* pIBaseClassBinaryStream = (IBase *)pBinaryStream; + IBinaryStream* pIBinaryStream = dynamic_cast(pIBaseClassBinaryStream); + if (!pIBinaryStream) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); + + IWriter* pIWriter = dynamic_cast(pIBaseClass); + if (!pIWriter) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIWriter->AssignBinaryStream(pIInstance, pIBinaryStream); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_writer_registercustomnamespace(Lib3MF_Writer pWriter, const char * pPrefix, const char * pNameSpace) +{ + IBase* pIBaseClass = (IBase *)pWriter; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pWriter, "Writer", "RegisterCustomNamespace"); + pJournalEntry->addStringParameter("Prefix", pPrefix); + pJournalEntry->addStringParameter("NameSpace", pNameSpace); + } + if (pPrefix == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pNameSpace == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sPrefix(pPrefix); + std::string sNameSpace(pNameSpace); + IWriter* pIWriter = dynamic_cast(pIBaseClass); + if (!pIWriter) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIWriter->RegisterCustomNamespace(sPrefix, sNameSpace); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + + +/************************************************************************************************************************* + Class implementation for PersistentReaderSource +**************************************************************************************************************************/ +Lib3MFResult lib3mf_persistentreadersource_getsourcetype(Lib3MF_PersistentReaderSource pPersistentReaderSource, eLib3MFPersistentReaderSourceType * pSourceType) +{ + IBase* pIBaseClass = (IBase *)pPersistentReaderSource; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pPersistentReaderSource, "PersistentReaderSource", "GetSourceType"); + } + if (pSourceType == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IPersistentReaderSource* pIPersistentReaderSource = dynamic_cast(pIBaseClass); + if (!pIPersistentReaderSource) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pSourceType = pIPersistentReaderSource->GetSourceType(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addEnumResult("SourceType", "PersistentReaderSourceType", (Lib3MF_int32)(*pSourceType)); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_persistentreadersource_invalidatesourcedata(Lib3MF_PersistentReaderSource pPersistentReaderSource) +{ + IBase* pIBaseClass = (IBase *)pPersistentReaderSource; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pPersistentReaderSource, "PersistentReaderSource", "InvalidateSourceData"); + } + IPersistentReaderSource* pIPersistentReaderSource = dynamic_cast(pIBaseClass); + if (!pIPersistentReaderSource) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIPersistentReaderSource->InvalidateSourceData(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_persistentreadersource_sourcedataisvalid(Lib3MF_PersistentReaderSource pPersistentReaderSource, bool * pDataIsValid) +{ + IBase* pIBaseClass = (IBase *)pPersistentReaderSource; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pPersistentReaderSource, "PersistentReaderSource", "SourceDataIsValid"); + } + if (pDataIsValid == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IPersistentReaderSource* pIPersistentReaderSource = dynamic_cast(pIBaseClass); + if (!pIPersistentReaderSource) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pDataIsValid = pIPersistentReaderSource->SourceDataIsValid(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("DataIsValid", *pDataIsValid); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + + +/************************************************************************************************************************* + Class implementation for Reader +**************************************************************************************************************************/ +Lib3MFResult lib3mf_reader_readfrompersistentsource(Lib3MF_Reader pReader, Lib3MF_PersistentReaderSource pSource) +{ + IBase* pIBaseClass = (IBase *)pReader; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pReader, "Reader", "ReadFromPersistentSource"); + pJournalEntry->addHandleParameter("Source", pSource); + } + IBase* pIBaseClassSource = (IBase *)pSource; + IPersistentReaderSource* pISource = dynamic_cast(pIBaseClassSource); + if (!pISource) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); + + IReader* pIReader = dynamic_cast(pIBaseClass); + if (!pIReader) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIReader->ReadFromPersistentSource(pISource); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_reader_readfromfile(Lib3MF_Reader pReader, const char * pFilename) +{ + IBase* pIBaseClass = (IBase *)pReader; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pReader, "Reader", "ReadFromFile"); + pJournalEntry->addStringParameter("Filename", pFilename); + } + if (pFilename == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sFilename(pFilename); + IReader* pIReader = dynamic_cast(pIBaseClass); if (!pIReader) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); @@ -1475,29 +2040,49 @@ Lib3MFResult lib3mf_resourceiterator_count(Lib3MF_ResourceIterator pResourceIter /************************************************************************************************************************* - Class implementation for SliceStackIterator + Class implementation for CustomXMLAttribute **************************************************************************************************************************/ -Lib3MFResult lib3mf_slicestackiterator_getcurrentslicestack(Lib3MF_SliceStackIterator pSliceStackIterator, Lib3MF_SliceStack * pResource) +Lib3MFResult lib3mf_customxmlattribute_getname(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) { - IBase* pIBaseClass = (IBase *)pSliceStackIterator; + IBase* pIBaseClass = (IBase *)pCustomXMLAttribute; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pSliceStackIterator, "SliceStackIterator", "GetCurrentSliceStack"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLAttribute, "CustomXMLAttribute", "GetName"); } - if (pResource == nullptr) + if ( (!pNameBuffer) && !(pNameNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseResource(nullptr); - ISliceStackIterator* pISliceStackIterator = dynamic_cast(pIBaseClass); - if (!pISliceStackIterator) + std::string sName(""); + ICustomXMLAttribute* pICustomXMLAttribute = dynamic_cast(pIBaseClass); + if (!pICustomXMLAttribute) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseResource = pISliceStackIterator->GetCurrentSliceStack(); + bool isCacheCall = (pNameBuffer == nullptr); + if (isCacheCall) { + sName = pICustomXMLAttribute->GetName(); - *pResource = (IBase*)(pBaseResource); + pICustomXMLAttribute->_setCache (new ParameterCache_1 (sName)); + } + else { + auto cache = dynamic_cast*> (pICustomXMLAttribute->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sName); + pICustomXMLAttribute->_setCache (nullptr); + } + + if (pNameNeededChars) + *pNameNeededChars = (Lib3MF_uint32) (sName.size()+1); + if (pNameBuffer) { + if (sName.size() >= nNameBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iName = 0; iName < sName.size(); iName++) + pNameBuffer[iName] = sName[iName]; + pNameBuffer[sName.size()] = 0; + } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Resource", *pResource); + pJournalEntry->addStringResult("Name", sName.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -1513,31 +2098,47 @@ Lib3MFResult lib3mf_slicestackiterator_getcurrentslicestack(Lib3MF_SliceStackIte } } - -/************************************************************************************************************************* - Class implementation for ObjectIterator -**************************************************************************************************************************/ -Lib3MFResult lib3mf_objectiterator_getcurrentobject(Lib3MF_ObjectIterator pObjectIterator, Lib3MF_Object * pResource) -{ - IBase* pIBaseClass = (IBase *)pObjectIterator; +Lib3MFResult lib3mf_customxmlattribute_getvalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer) +{ + IBase* pIBaseClass = (IBase *)pCustomXMLAttribute; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pObjectIterator, "ObjectIterator", "GetCurrentObject"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLAttribute, "CustomXMLAttribute", "GetValue"); } - if (pResource == nullptr) + if ( (!pValueBuffer) && !(pValueNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseResource(nullptr); - IObjectIterator* pIObjectIterator = dynamic_cast(pIBaseClass); - if (!pIObjectIterator) + std::string sValue(""); + ICustomXMLAttribute* pICustomXMLAttribute = dynamic_cast(pIBaseClass); + if (!pICustomXMLAttribute) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseResource = pIObjectIterator->GetCurrentObject(); + bool isCacheCall = (pValueBuffer == nullptr); + if (isCacheCall) { + sValue = pICustomXMLAttribute->GetValue(); - *pResource = (IBase*)(pBaseResource); + pICustomXMLAttribute->_setCache (new ParameterCache_1 (sValue)); + } + else { + auto cache = dynamic_cast*> (pICustomXMLAttribute->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sValue); + pICustomXMLAttribute->_setCache (nullptr); + } + + if (pValueNeededChars) + *pValueNeededChars = (Lib3MF_uint32) (sValue.size()+1); + if (pValueBuffer) { + if (sValue.size() >= nValueBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iValue = 0; iValue < sValue.size(); iValue++) + pValueBuffer[iValue] = sValue[iValue]; + pValueBuffer[sValue.size()] = 0; + } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Resource", *pResource); + pJournalEntry->addStringResult("Value", sValue.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -1553,31 +2154,27 @@ Lib3MFResult lib3mf_objectiterator_getcurrentobject(Lib3MF_ObjectIterator pObjec } } - -/************************************************************************************************************************* - Class implementation for MeshObjectIterator -**************************************************************************************************************************/ -Lib3MFResult lib3mf_meshobjectiterator_getcurrentmeshobject(Lib3MF_MeshObjectIterator pMeshObjectIterator, Lib3MF_MeshObject * pResource) +Lib3MFResult lib3mf_customxmlattribute_isvalidinteger(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nMinValue, Lib3MF_int64 nMaxValue, bool * pIsValid) { - IBase* pIBaseClass = (IBase *)pMeshObjectIterator; + IBase* pIBaseClass = (IBase *)pCustomXMLAttribute; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObjectIterator, "MeshObjectIterator", "GetCurrentMeshObject"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLAttribute, "CustomXMLAttribute", "IsValidInteger"); + pJournalEntry->addInt64Parameter("MinValue", nMinValue); + pJournalEntry->addInt64Parameter("MaxValue", nMaxValue); } - if (pResource == nullptr) + if (pIsValid == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseResource(nullptr); - IMeshObjectIterator* pIMeshObjectIterator = dynamic_cast(pIBaseClass); - if (!pIMeshObjectIterator) + ICustomXMLAttribute* pICustomXMLAttribute = dynamic_cast(pIBaseClass); + if (!pICustomXMLAttribute) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseResource = pIMeshObjectIterator->GetCurrentMeshObject(); + *pIsValid = pICustomXMLAttribute->IsValidInteger(nMinValue, nMaxValue); - *pResource = (IBase*)(pBaseResource); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Resource", *pResource); + pJournalEntry->addBooleanResult("IsValid", *pIsValid); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -1593,31 +2190,27 @@ Lib3MFResult lib3mf_meshobjectiterator_getcurrentmeshobject(Lib3MF_MeshObjectIte } } - -/************************************************************************************************************************* - Class implementation for ComponentsObjectIterator -**************************************************************************************************************************/ -Lib3MFResult lib3mf_componentsobjectiterator_getcurrentcomponentsobject(Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource) +Lib3MFResult lib3mf_customxmlattribute_getintegervalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nMinValue, Lib3MF_int64 nMaxValue, Lib3MF_int64 * pValue) { - IBase* pIBaseClass = (IBase *)pComponentsObjectIterator; + IBase* pIBaseClass = (IBase *)pCustomXMLAttribute; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComponentsObjectIterator, "ComponentsObjectIterator", "GetCurrentComponentsObject"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLAttribute, "CustomXMLAttribute", "GetIntegerValue"); + pJournalEntry->addInt64Parameter("MinValue", nMinValue); + pJournalEntry->addInt64Parameter("MaxValue", nMaxValue); } - if (pResource == nullptr) + if (pValue == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseResource(nullptr); - IComponentsObjectIterator* pIComponentsObjectIterator = dynamic_cast(pIBaseClass); - if (!pIComponentsObjectIterator) + ICustomXMLAttribute* pICustomXMLAttribute = dynamic_cast(pIBaseClass); + if (!pICustomXMLAttribute) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseResource = pIComponentsObjectIterator->GetCurrentComponentsObject(); + *pValue = pICustomXMLAttribute->GetIntegerValue(nMinValue, nMaxValue); - *pResource = (IBase*)(pBaseResource); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Resource", *pResource); + pJournalEntry->addInt64Result("Value", *pValue); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -1633,31 +2226,27 @@ Lib3MFResult lib3mf_componentsobjectiterator_getcurrentcomponentsobject(Lib3MF_C } } - -/************************************************************************************************************************* - Class implementation for Texture2DIterator -**************************************************************************************************************************/ -Lib3MFResult lib3mf_texture2diterator_getcurrenttexture2d(Lib3MF_Texture2DIterator pTexture2DIterator, Lib3MF_Texture2D * pResource) +Lib3MFResult lib3mf_customxmlattribute_isvaliddouble(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, bool * pIsValid) { - IBase* pIBaseClass = (IBase *)pTexture2DIterator; + IBase* pIBaseClass = (IBase *)pCustomXMLAttribute; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DIterator, "Texture2DIterator", "GetCurrentTexture2D"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLAttribute, "CustomXMLAttribute", "IsValidDouble"); + pJournalEntry->addDoubleParameter("MinValue", dMinValue); + pJournalEntry->addDoubleParameter("MaxValue", dMaxValue); } - if (pResource == nullptr) + if (pIsValid == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseResource(nullptr); - ITexture2DIterator* pITexture2DIterator = dynamic_cast(pIBaseClass); - if (!pITexture2DIterator) + ICustomXMLAttribute* pICustomXMLAttribute = dynamic_cast(pIBaseClass); + if (!pICustomXMLAttribute) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseResource = pITexture2DIterator->GetCurrentTexture2D(); + *pIsValid = pICustomXMLAttribute->IsValidDouble(dMinValue, dMaxValue); - *pResource = (IBase*)(pBaseResource); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Resource", *pResource); + pJournalEntry->addBooleanResult("IsValid", *pIsValid); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -1673,31 +2262,27 @@ Lib3MFResult lib3mf_texture2diterator_getcurrenttexture2d(Lib3MF_Texture2DIterat } } - -/************************************************************************************************************************* - Class implementation for BaseMaterialGroupIterator -**************************************************************************************************************************/ -Lib3MFResult lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup(Lib3MF_BaseMaterialGroupIterator pBaseMaterialGroupIterator, Lib3MF_BaseMaterialGroup * pResource) +Lib3MFResult lib3mf_customxmlattribute_getdoublevalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, Lib3MF_double * pValue) { - IBase* pIBaseClass = (IBase *)pBaseMaterialGroupIterator; + IBase* pIBaseClass = (IBase *)pCustomXMLAttribute; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroupIterator, "BaseMaterialGroupIterator", "GetCurrentBaseMaterialGroup"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLAttribute, "CustomXMLAttribute", "GetDoubleValue"); + pJournalEntry->addDoubleParameter("MinValue", dMinValue); + pJournalEntry->addDoubleParameter("MaxValue", dMaxValue); } - if (pResource == nullptr) + if (pValue == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseResource(nullptr); - IBaseMaterialGroupIterator* pIBaseMaterialGroupIterator = dynamic_cast(pIBaseClass); - if (!pIBaseMaterialGroupIterator) + ICustomXMLAttribute* pICustomXMLAttribute = dynamic_cast(pIBaseClass); + if (!pICustomXMLAttribute) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseResource = pIBaseMaterialGroupIterator->GetCurrentBaseMaterialGroup(); + *pValue = pICustomXMLAttribute->GetDoubleValue(dMinValue, dMaxValue); - *pResource = (IBase*)(pBaseResource); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Resource", *pResource); + pJournalEntry->addDoubleResult("Value", *pValue); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -1713,31 +2298,25 @@ Lib3MFResult lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup(Lib3MF } } - -/************************************************************************************************************************* - Class implementation for ColorGroupIterator -**************************************************************************************************************************/ -Lib3MFResult lib3mf_colorgroupiterator_getcurrentcolorgroup(Lib3MF_ColorGroupIterator pColorGroupIterator, Lib3MF_ColorGroup * pResource) +Lib3MFResult lib3mf_customxmlattribute_isvalidbool(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, bool * pIsValid) { - IBase* pIBaseClass = (IBase *)pColorGroupIterator; + IBase* pIBaseClass = (IBase *)pCustomXMLAttribute; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroupIterator, "ColorGroupIterator", "GetCurrentColorGroup"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLAttribute, "CustomXMLAttribute", "IsValidBool"); } - if (pResource == nullptr) + if (pIsValid == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseResource(nullptr); - IColorGroupIterator* pIColorGroupIterator = dynamic_cast(pIBaseClass); - if (!pIColorGroupIterator) + ICustomXMLAttribute* pICustomXMLAttribute = dynamic_cast(pIBaseClass); + if (!pICustomXMLAttribute) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseResource = pIColorGroupIterator->GetCurrentColorGroup(); + *pIsValid = pICustomXMLAttribute->IsValidBool(); - *pResource = (IBase*)(pBaseResource); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Resource", *pResource); + pJournalEntry->addBooleanResult("IsValid", *pIsValid); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -1753,31 +2332,27 @@ Lib3MFResult lib3mf_colorgroupiterator_getcurrentcolorgroup(Lib3MF_ColorGroupIte } } - -/************************************************************************************************************************* - Class implementation for Texture2DGroupIterator -**************************************************************************************************************************/ -Lib3MFResult lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup(Lib3MF_Texture2DGroupIterator pTexture2DGroupIterator, Lib3MF_Texture2DGroup * pResource) +Lib3MFResult lib3mf_customxmlattribute_getboolvalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dMinValue, Lib3MF_double dMaxValue, bool * pValue) { - IBase* pIBaseClass = (IBase *)pTexture2DGroupIterator; + IBase* pIBaseClass = (IBase *)pCustomXMLAttribute; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroupIterator, "Texture2DGroupIterator", "GetCurrentTexture2DGroup"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLAttribute, "CustomXMLAttribute", "GetBoolValue"); + pJournalEntry->addDoubleParameter("MinValue", dMinValue); + pJournalEntry->addDoubleParameter("MaxValue", dMaxValue); } - if (pResource == nullptr) + if (pValue == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseResource(nullptr); - ITexture2DGroupIterator* pITexture2DGroupIterator = dynamic_cast(pIBaseClass); - if (!pITexture2DGroupIterator) + ICustomXMLAttribute* pICustomXMLAttribute = dynamic_cast(pIBaseClass); + if (!pICustomXMLAttribute) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseResource = pITexture2DGroupIterator->GetCurrentTexture2DGroup(); + *pValue = pICustomXMLAttribute->GetBoolValue(dMinValue, dMaxValue); - *pResource = (IBase*)(pBaseResource); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Resource", *pResource); + pJournalEntry->addBooleanResult("Value", *pValue); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -1793,31 +2368,26 @@ Lib3MFResult lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup(Lib3MF_Textu } } - -/************************************************************************************************************************* - Class implementation for CompositeMaterialsIterator -**************************************************************************************************************************/ -Lib3MFResult lib3mf_compositematerialsiterator_getcurrentcompositematerials(Lib3MF_CompositeMaterialsIterator pCompositeMaterialsIterator, Lib3MF_CompositeMaterials * pResource) +Lib3MFResult lib3mf_customxmlattribute_setvalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, const char * pValue) { - IBase* pIBaseClass = (IBase *)pCompositeMaterialsIterator; + IBase* pIBaseClass = (IBase *)pCustomXMLAttribute; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterialsIterator, "CompositeMaterialsIterator", "GetCurrentCompositeMaterials"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLAttribute, "CustomXMLAttribute", "SetValue"); + pJournalEntry->addStringParameter("Value", pValue); } - if (pResource == nullptr) + if (pValue == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseResource(nullptr); - ICompositeMaterialsIterator* pICompositeMaterialsIterator = dynamic_cast(pIBaseClass); - if (!pICompositeMaterialsIterator) + std::string sValue(pValue); + ICustomXMLAttribute* pICustomXMLAttribute = dynamic_cast(pIBaseClass); + if (!pICustomXMLAttribute) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseResource = pICompositeMaterialsIterator->GetCurrentCompositeMaterials(); + pICustomXMLAttribute->SetValue(sValue); - *pResource = (IBase*)(pBaseResource); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Resource", *pResource); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -1833,31 +2403,23 @@ Lib3MFResult lib3mf_compositematerialsiterator_getcurrentcompositematerials(Lib3 } } - -/************************************************************************************************************************* - Class implementation for MultiPropertyGroupIterator -**************************************************************************************************************************/ -Lib3MFResult lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup(Lib3MF_MultiPropertyGroupIterator pMultiPropertyGroupIterator, Lib3MF_MultiPropertyGroup * pResource) +Lib3MFResult lib3mf_customxmlattribute_setintegervalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_int64 nValue) { - IBase* pIBaseClass = (IBase *)pMultiPropertyGroupIterator; + IBase* pIBaseClass = (IBase *)pCustomXMLAttribute; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroupIterator, "MultiPropertyGroupIterator", "GetCurrentMultiPropertyGroup"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLAttribute, "CustomXMLAttribute", "SetIntegerValue"); + pJournalEntry->addInt64Parameter("Value", nValue); } - if (pResource == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseResource(nullptr); - IMultiPropertyGroupIterator* pIMultiPropertyGroupIterator = dynamic_cast(pIBaseClass); - if (!pIMultiPropertyGroupIterator) + ICustomXMLAttribute* pICustomXMLAttribute = dynamic_cast(pIBaseClass); + if (!pICustomXMLAttribute) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseResource = pIMultiPropertyGroupIterator->GetCurrentMultiPropertyGroup(); + pICustomXMLAttribute->SetIntegerValue(nValue); - *pResource = (IBase*)(pBaseResource); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Resource", *pResource); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -1873,51 +2435,55 @@ Lib3MFResult lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup(Lib3 } } - -/************************************************************************************************************************* - Class implementation for MetaData -**************************************************************************************************************************/ -Lib3MFResult lib3mf_metadata_getnamespace(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer) +Lib3MFResult lib3mf_customxmlattribute_setdoublevalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, Lib3MF_double dValue) { - IBase* pIBaseClass = (IBase *)pMetaData; + IBase* pIBaseClass = (IBase *)pCustomXMLAttribute; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaData, "MetaData", "GetNameSpace"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLAttribute, "CustomXMLAttribute", "SetDoubleValue"); + pJournalEntry->addDoubleParameter("Value", dValue); } - if ( (!pNameSpaceBuffer) && !(pNameSpaceNeededChars) ) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sNameSpace(""); - IMetaData* pIMetaData = dynamic_cast(pIBaseClass); - if (!pIMetaData) + ICustomXMLAttribute* pICustomXMLAttribute = dynamic_cast(pIBaseClass); + if (!pICustomXMLAttribute) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pNameSpaceBuffer == nullptr); - if (isCacheCall) { - sNameSpace = pIMetaData->GetNameSpace(); + pICustomXMLAttribute->SetDoubleValue(dValue); - pIMetaData->_setCache (new ParameterCache_1 (sNameSpace)); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); } - else { - auto cache = dynamic_cast*> (pIMetaData->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sNameSpace); - pIMetaData->_setCache (nullptr); + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_customxmlattribute_setboolvalue(Lib3MF_CustomXMLAttribute pCustomXMLAttribute, bool bValue) +{ + IBase* pIBaseClass = (IBase *)pCustomXMLAttribute; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLAttribute, "CustomXMLAttribute", "SetBoolValue"); + pJournalEntry->addBooleanParameter("Value", bValue); } + ICustomXMLAttribute* pICustomXMLAttribute = dynamic_cast(pIBaseClass); + if (!pICustomXMLAttribute) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - if (pNameSpaceNeededChars) - *pNameSpaceNeededChars = (Lib3MF_uint32) (sNameSpace.size()+1); - if (pNameSpaceBuffer) { - if (sNameSpace.size() >= nNameSpaceBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iNameSpace = 0; iNameSpace < sNameSpace.size(); iNameSpace++) - pNameSpaceBuffer[iNameSpace] = sNameSpace[iNameSpace]; - pNameSpaceBuffer[sNameSpace.size()] = 0; - } + pICustomXMLAttribute->SetBoolValue(bValue); + if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("NameSpace", sNameSpace.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -1933,24 +2499,20 @@ Lib3MFResult lib3mf_metadata_getnamespace(Lib3MF_MetaData pMetaData, const Lib3M } } -Lib3MFResult lib3mf_metadata_setnamespace(Lib3MF_MetaData pMetaData, const char * pNameSpace) +Lib3MFResult lib3mf_customxmlattribute_remove(Lib3MF_CustomXMLAttribute pCustomXMLAttribute) { - IBase* pIBaseClass = (IBase *)pMetaData; + IBase* pIBaseClass = (IBase *)pCustomXMLAttribute; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaData, "MetaData", "SetNameSpace"); - pJournalEntry->addStringParameter("NameSpace", pNameSpace); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLAttribute, "CustomXMLAttribute", "Remove"); } - if (pNameSpace == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sNameSpace(pNameSpace); - IMetaData* pIMetaData = dynamic_cast(pIBaseClass); - if (!pIMetaData) + ICustomXMLAttribute* pICustomXMLAttribute = dynamic_cast(pIBaseClass); + if (!pICustomXMLAttribute) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMetaData->SetNameSpace(sNameSpace); + pICustomXMLAttribute->Remove(); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -1968,34 +2530,38 @@ Lib3MFResult lib3mf_metadata_setnamespace(Lib3MF_MetaData pMetaData, const char } } -Lib3MFResult lib3mf_metadata_getname(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) + +/************************************************************************************************************************* + Class implementation for CustomXMLNode +**************************************************************************************************************************/ +Lib3MFResult lib3mf_customxmlnode_getname(Lib3MF_CustomXMLNode pCustomXMLNode, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) { - IBase* pIBaseClass = (IBase *)pMetaData; + IBase* pIBaseClass = (IBase *)pCustomXMLNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaData, "MetaData", "GetName"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNode, "CustomXMLNode", "GetName"); } if ( (!pNameBuffer) && !(pNameNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); std::string sName(""); - IMetaData* pIMetaData = dynamic_cast(pIBaseClass); - if (!pIMetaData) + ICustomXMLNode* pICustomXMLNode = dynamic_cast(pIBaseClass); + if (!pICustomXMLNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); bool isCacheCall = (pNameBuffer == nullptr); if (isCacheCall) { - sName = pIMetaData->GetName(); + sName = pICustomXMLNode->GetName(); - pIMetaData->_setCache (new ParameterCache_1 (sName)); + pICustomXMLNode->_setCache (new ParameterCache_1 (sName)); } else { - auto cache = dynamic_cast*> (pIMetaData->_getCache ()); + auto cache = dynamic_cast*> (pICustomXMLNode->_getCache ()); if (cache == nullptr) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); cache->retrieveData (sName); - pIMetaData->_setCache (nullptr); + pICustomXMLNode->_setCache (nullptr); } if (pNameNeededChars) @@ -2024,82 +2590,47 @@ Lib3MFResult lib3mf_metadata_getname(Lib3MF_MetaData pMetaData, const Lib3MF_uin } } -Lib3MFResult lib3mf_metadata_setname(Lib3MF_MetaData pMetaData, const char * pName) +Lib3MFResult lib3mf_customxmlnode_getnamespace(Lib3MF_CustomXMLNode pCustomXMLNode, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer) { - IBase* pIBaseClass = (IBase *)pMetaData; + IBase* pIBaseClass = (IBase *)pCustomXMLNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaData, "MetaData", "SetName"); - pJournalEntry->addStringParameter("Name", pName); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNode, "CustomXMLNode", "GetNameSpace"); } - if (pName == nullptr) + if ( (!pNameSpaceBuffer) && !(pNameSpaceNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sName(pName); - IMetaData* pIMetaData = dynamic_cast(pIBaseClass); - if (!pIMetaData) + std::string sNameSpace(""); + ICustomXMLNode* pICustomXMLNode = dynamic_cast(pIBaseClass); + if (!pICustomXMLNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMetaData->SetName(sName); + bool isCacheCall = (pNameSpaceBuffer == nullptr); + if (isCacheCall) { + sNameSpace = pICustomXMLNode->GetNameSpace(); - if (pJournalEntry.get() != nullptr) { - pJournalEntry->writeSuccess(); - } - return LIB3MF_SUCCESS; - } - catch (ELib3MFInterfaceException & Exception) { - return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); - } - catch (std::exception & StdException) { - return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); - } - catch (...) { - return handleUnhandledException(pIBaseClass, pJournalEntry.get()); - } -} - -Lib3MFResult lib3mf_metadata_getkey(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nKeyBufferSize, Lib3MF_uint32* pKeyNeededChars, char * pKeyBuffer) -{ - IBase* pIBaseClass = (IBase *)pMetaData; - - PLib3MFInterfaceJournalEntry pJournalEntry; - try { - if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaData, "MetaData", "GetKey"); - } - if ( (!pKeyBuffer) && !(pKeyNeededChars) ) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sKey(""); - IMetaData* pIMetaData = dynamic_cast(pIBaseClass); - if (!pIMetaData) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - - bool isCacheCall = (pKeyBuffer == nullptr); - if (isCacheCall) { - sKey = pIMetaData->GetKey(); - - pIMetaData->_setCache (new ParameterCache_1 (sKey)); + pICustomXMLNode->_setCache (new ParameterCache_1 (sNameSpace)); } else { - auto cache = dynamic_cast*> (pIMetaData->_getCache ()); + auto cache = dynamic_cast*> (pICustomXMLNode->_getCache ()); if (cache == nullptr) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sKey); - pIMetaData->_setCache (nullptr); + cache->retrieveData (sNameSpace); + pICustomXMLNode->_setCache (nullptr); } - if (pKeyNeededChars) - *pKeyNeededChars = (Lib3MF_uint32) (sKey.size()+1); - if (pKeyBuffer) { - if (sKey.size() >= nKeyBufferSize) + if (pNameSpaceNeededChars) + *pNameSpaceNeededChars = (Lib3MF_uint32) (sNameSpace.size()+1); + if (pNameSpaceBuffer) { + if (sNameSpace.size() >= nNameSpaceBufferSize) throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iKey = 0; iKey < sKey.size(); iKey++) - pKeyBuffer[iKey] = sKey[iKey]; - pKeyBuffer[sKey.size()] = 0; + for (size_t iNameSpace = 0; iNameSpace < sNameSpace.size(); iNameSpace++) + pNameSpaceBuffer[iNameSpace] = sNameSpace[iNameSpace]; + pNameSpaceBuffer[sNameSpace.size()] = 0; } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("Key", sKey.c_str()); + pJournalEntry->addStringResult("NameSpace", sNameSpace.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -2115,25 +2646,25 @@ Lib3MFResult lib3mf_metadata_getkey(Lib3MF_MetaData pMetaData, const Lib3MF_uint } } -Lib3MFResult lib3mf_metadata_getmustpreserve(Lib3MF_MetaData pMetaData, bool * pMustPreserve) +Lib3MFResult lib3mf_customxmlnode_getattributecount(Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 * pCount) { - IBase* pIBaseClass = (IBase *)pMetaData; + IBase* pIBaseClass = (IBase *)pCustomXMLNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaData, "MetaData", "GetMustPreserve"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNode, "CustomXMLNode", "GetAttributeCount"); } - if (pMustPreserve == nullptr) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMetaData* pIMetaData = dynamic_cast(pIBaseClass); - if (!pIMetaData) + ICustomXMLNode* pICustomXMLNode = dynamic_cast(pIBaseClass); + if (!pICustomXMLNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pMustPreserve = pIMetaData->GetMustPreserve(); + *pCount = pICustomXMLNode->GetAttributeCount(); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addBooleanResult("MustPreserve", *pMustPreserve); + pJournalEntry->addUInt64Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -2149,23 +2680,28 @@ Lib3MFResult lib3mf_metadata_getmustpreserve(Lib3MF_MetaData pMetaData, bool * p } } -Lib3MFResult lib3mf_metadata_setmustpreserve(Lib3MF_MetaData pMetaData, bool bMustPreserve) +Lib3MFResult lib3mf_customxmlnode_getattribute(Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 nIndex, Lib3MF_CustomXMLAttribute * pAttributeInstance) { - IBase* pIBaseClass = (IBase *)pMetaData; + IBase* pIBaseClass = (IBase *)pCustomXMLNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaData, "MetaData", "SetMustPreserve"); - pJournalEntry->addBooleanParameter("MustPreserve", bMustPreserve); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNode, "CustomXMLNode", "GetAttribute"); + pJournalEntry->addUInt64Parameter("Index", nIndex); } - IMetaData* pIMetaData = dynamic_cast(pIBaseClass); - if (!pIMetaData) + if (pAttributeInstance == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseAttributeInstance(nullptr); + ICustomXMLNode* pICustomXMLNode = dynamic_cast(pIBaseClass); + if (!pICustomXMLNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMetaData->SetMustPreserve(bMustPreserve); + pBaseAttributeInstance = pICustomXMLNode->GetAttribute(nIndex); + *pAttributeInstance = (IBase*)(pBaseAttributeInstance); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("AttributeInstance", *pAttributeInstance); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -2181,47 +2717,29 @@ Lib3MFResult lib3mf_metadata_setmustpreserve(Lib3MF_MetaData pMetaData, bool bMu } } -Lib3MFResult lib3mf_metadata_gettype(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nTypeBufferSize, Lib3MF_uint32* pTypeNeededChars, char * pTypeBuffer) +Lib3MFResult lib3mf_customxmlnode_hasattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pAttributeExists) { - IBase* pIBaseClass = (IBase *)pMetaData; + IBase* pIBaseClass = (IBase *)pCustomXMLNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaData, "MetaData", "GetType"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNode, "CustomXMLNode", "HasAttribute"); + pJournalEntry->addStringParameter("Name", pName); } - if ( (!pTypeBuffer) && !(pTypeNeededChars) ) + if (pName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sType(""); - IMetaData* pIMetaData = dynamic_cast(pIBaseClass); - if (!pIMetaData) + if (pAttributeExists == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(pName); + ICustomXMLNode* pICustomXMLNode = dynamic_cast(pIBaseClass); + if (!pICustomXMLNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pTypeBuffer == nullptr); - if (isCacheCall) { - sType = pIMetaData->GetType(); + *pAttributeExists = pICustomXMLNode->HasAttribute(sName); - pIMetaData->_setCache (new ParameterCache_1 (sType)); - } - else { - auto cache = dynamic_cast*> (pIMetaData->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sType); - pIMetaData->_setCache (nullptr); - } - - if (pTypeNeededChars) - *pTypeNeededChars = (Lib3MF_uint32) (sType.size()+1); - if (pTypeBuffer) { - if (sType.size() >= nTypeBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iType = 0; iType < sType.size(); iType++) - pTypeBuffer[iType] = sType[iType]; - pTypeBuffer[sType.size()] = 0; - } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("Type", sType.c_str()); + pJournalEntry->addBooleanResult("AttributeExists", *pAttributeExists); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -2237,26 +2755,32 @@ Lib3MFResult lib3mf_metadata_gettype(Lib3MF_MetaData pMetaData, const Lib3MF_uin } } -Lib3MFResult lib3mf_metadata_settype(Lib3MF_MetaData pMetaData, const char * pType) +Lib3MFResult lib3mf_customxmlnode_findattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bMustExist, Lib3MF_CustomXMLAttribute * pAttributeInstance) { - IBase* pIBaseClass = (IBase *)pMetaData; + IBase* pIBaseClass = (IBase *)pCustomXMLNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaData, "MetaData", "SetType"); - pJournalEntry->addStringParameter("Type", pType); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNode, "CustomXMLNode", "FindAttribute"); + pJournalEntry->addStringParameter("Name", pName); + pJournalEntry->addBooleanParameter("MustExist", bMustExist); } - if (pType == nullptr) + if (pName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sType(pType); - IMetaData* pIMetaData = dynamic_cast(pIBaseClass); - if (!pIMetaData) + if (pAttributeInstance == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(pName); + IBase* pBaseAttributeInstance(nullptr); + ICustomXMLNode* pICustomXMLNode = dynamic_cast(pIBaseClass); + if (!pICustomXMLNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMetaData->SetType(sType); + pBaseAttributeInstance = pICustomXMLNode->FindAttribute(sName, bMustExist); + *pAttributeInstance = (IBase*)(pBaseAttributeInstance); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("AttributeInstance", *pAttributeInstance); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -2272,47 +2796,29 @@ Lib3MFResult lib3mf_metadata_settype(Lib3MF_MetaData pMetaData, const char * pTy } } -Lib3MFResult lib3mf_metadata_getvalue(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer) +Lib3MFResult lib3mf_customxmlnode_removeattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pAttributeRemoved) { - IBase* pIBaseClass = (IBase *)pMetaData; + IBase* pIBaseClass = (IBase *)pCustomXMLNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaData, "MetaData", "GetValue"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNode, "CustomXMLNode", "RemoveAttribute"); + pJournalEntry->addStringParameter("Name", pName); } - if ( (!pValueBuffer) && !(pValueNeededChars) ) + if (pName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sValue(""); - IMetaData* pIMetaData = dynamic_cast(pIBaseClass); - if (!pIMetaData) + if (pAttributeRemoved == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(pName); + ICustomXMLNode* pICustomXMLNode = dynamic_cast(pIBaseClass); + if (!pICustomXMLNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pValueBuffer == nullptr); - if (isCacheCall) { - sValue = pIMetaData->GetValue(); + *pAttributeRemoved = pICustomXMLNode->RemoveAttribute(sName); - pIMetaData->_setCache (new ParameterCache_1 (sValue)); - } - else { - auto cache = dynamic_cast*> (pIMetaData->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sValue); - pIMetaData->_setCache (nullptr); - } - - if (pValueNeededChars) - *pValueNeededChars = (Lib3MF_uint32) (sValue.size()+1); - if (pValueBuffer) { - if (sValue.size() >= nValueBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iValue = 0; iValue < sValue.size(); iValue++) - pValueBuffer[iValue] = sValue[iValue]; - pValueBuffer[sValue.size()] = 0; - } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("Value", sValue.c_str()); + pJournalEntry->addBooleanResult("AttributeRemoved", *pAttributeRemoved); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -2328,26 +2834,26 @@ Lib3MFResult lib3mf_metadata_getvalue(Lib3MF_MetaData pMetaData, const Lib3MF_ui } } -Lib3MFResult lib3mf_metadata_setvalue(Lib3MF_MetaData pMetaData, const char * pValue) +Lib3MFResult lib3mf_customxmlnode_removeattributebyindex(Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_uint64 nIndex, bool * pAttributeRemoved) { - IBase* pIBaseClass = (IBase *)pMetaData; + IBase* pIBaseClass = (IBase *)pCustomXMLNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaData, "MetaData", "SetValue"); - pJournalEntry->addStringParameter("Value", pValue); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNode, "CustomXMLNode", "RemoveAttributeByIndex"); + pJournalEntry->addUInt64Parameter("Index", nIndex); } - if (pValue == nullptr) + if (pAttributeRemoved == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sValue(pValue); - IMetaData* pIMetaData = dynamic_cast(pIBaseClass); - if (!pIMetaData) + ICustomXMLNode* pICustomXMLNode = dynamic_cast(pIBaseClass); + if (!pICustomXMLNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMetaData->SetValue(sValue); + *pAttributeRemoved = pICustomXMLNode->RemoveAttributeByIndex(nIndex); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("AttributeRemoved", *pAttributeRemoved); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -2363,29 +2869,30 @@ Lib3MFResult lib3mf_metadata_setvalue(Lib3MF_MetaData pMetaData, const char * pV } } - -/************************************************************************************************************************* - Class implementation for MetaDataGroup -**************************************************************************************************************************/ -Lib3MFResult lib3mf_metadatagroup_getmetadatacount(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 * pCount) +Lib3MFResult lib3mf_customxmlnode_addattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, const char * pValue) { - IBase* pIBaseClass = (IBase *)pMetaDataGroup; + IBase* pIBaseClass = (IBase *)pCustomXMLNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaDataGroup, "MetaDataGroup", "GetMetaDataCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNode, "CustomXMLNode", "AddAttribute"); + pJournalEntry->addStringParameter("Name", pName); + pJournalEntry->addStringParameter("Value", pValue); } - if (pCount == nullptr) + if (pName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMetaDataGroup* pIMetaDataGroup = dynamic_cast(pIBaseClass); - if (!pIMetaDataGroup) + if (pValue == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(pName); + std::string sValue(pValue); + ICustomXMLNode* pICustomXMLNode = dynamic_cast(pIBaseClass); + if (!pICustomXMLNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pIMetaDataGroup->GetMetaDataCount(); + pICustomXMLNode->AddAttribute(sName, sValue); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -2401,28 +2908,27 @@ Lib3MFResult lib3mf_metadatagroup_getmetadatacount(Lib3MF_MetaDataGroup pMetaDat } } -Lib3MFResult lib3mf_metadatagroup_getmetadata(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex, Lib3MF_MetaData * pMetaData) +Lib3MFResult lib3mf_customxmlnode_addintegerattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_int64 nValue) { - IBase* pIBaseClass = (IBase *)pMetaDataGroup; + IBase* pIBaseClass = (IBase *)pCustomXMLNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaDataGroup, "MetaDataGroup", "GetMetaData"); - pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNode, "CustomXMLNode", "AddIntegerAttribute"); + pJournalEntry->addStringParameter("Name", pName); + pJournalEntry->addInt64Parameter("Value", nValue); } - if (pMetaData == nullptr) + if (pName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseMetaData(nullptr); - IMetaDataGroup* pIMetaDataGroup = dynamic_cast(pIBaseClass); - if (!pIMetaDataGroup) + std::string sName(pName); + ICustomXMLNode* pICustomXMLNode = dynamic_cast(pIBaseClass); + if (!pICustomXMLNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseMetaData = pIMetaDataGroup->GetMetaData(nIndex); + pICustomXMLNode->AddIntegerAttribute(sName, nValue); - *pMetaData = (IBase*)(pBaseMetaData); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("MetaData", *pMetaData); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -2438,35 +2944,27 @@ Lib3MFResult lib3mf_metadatagroup_getmetadata(Lib3MF_MetaDataGroup pMetaDataGrou } } -Lib3MFResult lib3mf_metadatagroup_getmetadatabykey(Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, Lib3MF_MetaData * pMetaData) +Lib3MFResult lib3mf_customxmlnode_adddoubleattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_double dValue) { - IBase* pIBaseClass = (IBase *)pMetaDataGroup; + IBase* pIBaseClass = (IBase *)pCustomXMLNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaDataGroup, "MetaDataGroup", "GetMetaDataByKey"); - pJournalEntry->addStringParameter("NameSpace", pNameSpace); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNode, "CustomXMLNode", "AddDoubleAttribute"); pJournalEntry->addStringParameter("Name", pName); + pJournalEntry->addDoubleParameter("Value", dValue); } - if (pNameSpace == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); if (pName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (pMetaData == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sNameSpace(pNameSpace); std::string sName(pName); - IBase* pBaseMetaData(nullptr); - IMetaDataGroup* pIMetaDataGroup = dynamic_cast(pIBaseClass); - if (!pIMetaDataGroup) + ICustomXMLNode* pICustomXMLNode = dynamic_cast(pIBaseClass); + if (!pICustomXMLNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseMetaData = pIMetaDataGroup->GetMetaDataByKey(sNameSpace, sName); + pICustomXMLNode->AddDoubleAttribute(sName, dValue); - *pMetaData = (IBase*)(pBaseMetaData); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("MetaData", *pMetaData); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -2482,21 +2980,25 @@ Lib3MFResult lib3mf_metadatagroup_getmetadatabykey(Lib3MF_MetaDataGroup pMetaDat } } -Lib3MFResult lib3mf_metadatagroup_removemetadatabyindex(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex) +Lib3MFResult lib3mf_customxmlnode_addboolattribute(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bValue) { - IBase* pIBaseClass = (IBase *)pMetaDataGroup; + IBase* pIBaseClass = (IBase *)pCustomXMLNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaDataGroup, "MetaDataGroup", "RemoveMetaDataByIndex"); - pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNode, "CustomXMLNode", "AddBoolAttribute"); + pJournalEntry->addStringParameter("Name", pName); + pJournalEntry->addBooleanParameter("Value", bValue); } - IMetaDataGroup* pIMetaDataGroup = dynamic_cast(pIBaseClass); - if (!pIMetaDataGroup) + if (pName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(pName); + ICustomXMLNode* pICustomXMLNode = dynamic_cast(pIBaseClass); + if (!pICustomXMLNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMetaDataGroup->RemoveMetaDataByIndex(nIndex); + pICustomXMLNode->AddBoolAttribute(sName, bValue); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -2514,28 +3016,27 @@ Lib3MFResult lib3mf_metadatagroup_removemetadatabyindex(Lib3MF_MetaDataGroup pMe } } -Lib3MFResult lib3mf_metadatagroup_removemetadata(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_MetaData pTheMetaData) +Lib3MFResult lib3mf_customxmlnode_getchildren(Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_CustomXMLNodes * pChildNodes) { - IBase* pIBaseClass = (IBase *)pMetaDataGroup; + IBase* pIBaseClass = (IBase *)pCustomXMLNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaDataGroup, "MetaDataGroup", "RemoveMetaData"); - pJournalEntry->addHandleParameter("TheMetaData", pTheMetaData); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNode, "CustomXMLNode", "GetChildren"); } - IBase* pIBaseClassTheMetaData = (IBase *)pTheMetaData; - IMetaData* pITheMetaData = dynamic_cast(pIBaseClassTheMetaData); - if (!pITheMetaData) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); - - IMetaDataGroup* pIMetaDataGroup = dynamic_cast(pIBaseClass); - if (!pIMetaDataGroup) + if (pChildNodes == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseChildNodes(nullptr); + ICustomXMLNode* pICustomXMLNode = dynamic_cast(pIBaseClass); + if (!pICustomXMLNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMetaDataGroup->RemoveMetaData(pITheMetaData); + pBaseChildNodes = pICustomXMLNode->GetChildren(); + *pChildNodes = (IBase*)(pBaseChildNodes); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("ChildNodes", *pChildNodes); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -2551,44 +3052,29 @@ Lib3MFResult lib3mf_metadatagroup_removemetadata(Lib3MF_MetaDataGroup pMetaDataG } } -Lib3MFResult lib3mf_metadatagroup_addmetadata(Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, const char * pValue, const char * pType, bool bMustPreserve, Lib3MF_MetaData * pMetaData) +Lib3MFResult lib3mf_customxmlnode_countchildrenbyname(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_uint64 * pCount) { - IBase* pIBaseClass = (IBase *)pMetaDataGroup; + IBase* pIBaseClass = (IBase *)pCustomXMLNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaDataGroup, "MetaDataGroup", "AddMetaData"); - pJournalEntry->addStringParameter("NameSpace", pNameSpace); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNode, "CustomXMLNode", "CountChildrenByName"); pJournalEntry->addStringParameter("Name", pName); - pJournalEntry->addStringParameter("Value", pValue); - pJournalEntry->addStringParameter("Type", pType); - pJournalEntry->addBooleanParameter("MustPreserve", bMustPreserve); } - if (pNameSpace == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); if (pName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (pValue == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (pType == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (pMetaData == nullptr) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sNameSpace(pNameSpace); std::string sName(pName); - std::string sValue(pValue); - std::string sType(pType); - IBase* pBaseMetaData(nullptr); - IMetaDataGroup* pIMetaDataGroup = dynamic_cast(pIBaseClass); - if (!pIMetaDataGroup) + ICustomXMLNode* pICustomXMLNode = dynamic_cast(pIBaseClass); + if (!pICustomXMLNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseMetaData = pIMetaDataGroup->AddMetaData(sNameSpace, sName, sValue, sType, bMustPreserve); + *pCount = pICustomXMLNode->CountChildrenByName(sName); - *pMetaData = (IBase*)(pBaseMetaData); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("MetaData", *pMetaData); + pJournalEntry->addUInt64Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -2604,29 +3090,31 @@ Lib3MFResult lib3mf_metadatagroup_addmetadata(Lib3MF_MetaDataGroup pMetaDataGrou } } - -/************************************************************************************************************************* - Class implementation for Object -**************************************************************************************************************************/ -Lib3MFResult lib3mf_object_gettype(Lib3MF_Object pObject, eLib3MFObjectType * pObjectType) -{ - IBase* pIBaseClass = (IBase *)pObject; +Lib3MFResult lib3mf_customxmlnode_getchildrenbyname(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_CustomXMLNodes * pChildNodes) +{ + IBase* pIBaseClass = (IBase *)pCustomXMLNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "GetType"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNode, "CustomXMLNode", "GetChildrenByName"); + pJournalEntry->addStringParameter("Name", pName); } - if (pObjectType == nullptr) + if (pName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IObject* pIObject = dynamic_cast(pIBaseClass); - if (!pIObject) + if (pChildNodes == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(pName); + IBase* pBaseChildNodes(nullptr); + ICustomXMLNode* pICustomXMLNode = dynamic_cast(pIBaseClass); + if (!pICustomXMLNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pObjectType = pIObject->GetType(); + pBaseChildNodes = pICustomXMLNode->GetChildrenByName(sName); + *pChildNodes = (IBase*)(pBaseChildNodes); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addEnumResult("ObjectType", "ObjectType", (Lib3MF_int32)(*pObjectType)); + pJournalEntry->addHandleResult("ChildNodes", *pChildNodes); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -2642,23 +3130,29 @@ Lib3MFResult lib3mf_object_gettype(Lib3MF_Object pObject, eLib3MFObjectType * pO } } -Lib3MFResult lib3mf_object_settype(Lib3MF_Object pObject, eLib3MFObjectType eObjectType) +Lib3MFResult lib3mf_customxmlnode_haschild(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pChildExists) { - IBase* pIBaseClass = (IBase *)pObject; + IBase* pIBaseClass = (IBase *)pCustomXMLNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "SetType"); - pJournalEntry->addEnumParameter("ObjectType", "ObjectType", (Lib3MF_int32)(eObjectType)); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNode, "CustomXMLNode", "HasChild"); + pJournalEntry->addStringParameter("Name", pName); } - IObject* pIObject = dynamic_cast(pIBaseClass); - if (!pIObject) + if (pName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pChildExists == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(pName); + ICustomXMLNode* pICustomXMLNode = dynamic_cast(pIBaseClass); + if (!pICustomXMLNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIObject->SetType(eObjectType); + *pChildExists = pICustomXMLNode->HasChild(sName); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("ChildExists", *pChildExists); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -2674,47 +3168,29 @@ Lib3MFResult lib3mf_object_settype(Lib3MF_Object pObject, eLib3MFObjectType eObj } } -Lib3MFResult lib3mf_object_getname(Lib3MF_Object pObject, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) +Lib3MFResult lib3mf_customxmlnode_hasuniquechild(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool * pChildExists) { - IBase* pIBaseClass = (IBase *)pObject; + IBase* pIBaseClass = (IBase *)pCustomXMLNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "GetName"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNode, "CustomXMLNode", "HasUniqueChild"); + pJournalEntry->addStringParameter("Name", pName); } - if ( (!pNameBuffer) && !(pNameNeededChars) ) + if (pName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sName(""); - IObject* pIObject = dynamic_cast(pIBaseClass); - if (!pIObject) + if (pChildExists == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(pName); + ICustomXMLNode* pICustomXMLNode = dynamic_cast(pIBaseClass); + if (!pICustomXMLNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pNameBuffer == nullptr); - if (isCacheCall) { - sName = pIObject->GetName(); + *pChildExists = pICustomXMLNode->HasUniqueChild(sName); - pIObject->_setCache (new ParameterCache_1 (sName)); - } - else { - auto cache = dynamic_cast*> (pIObject->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sName); - pIObject->_setCache (nullptr); - } - - if (pNameNeededChars) - *pNameNeededChars = (Lib3MF_uint32) (sName.size()+1); - if (pNameBuffer) { - if (sName.size() >= nNameBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iName = 0; iName < sName.size(); iName++) - pNameBuffer[iName] = sName[iName]; - pNameBuffer[sName.size()] = 0; - } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("Name", sName.c_str()); + pJournalEntry->addBooleanResult("ChildExists", *pChildExists); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -2730,26 +3206,32 @@ Lib3MFResult lib3mf_object_getname(Lib3MF_Object pObject, const Lib3MF_uint32 nN } } -Lib3MFResult lib3mf_object_setname(Lib3MF_Object pObject, const char * pName) +Lib3MFResult lib3mf_customxmlnode_findchild(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, bool bMustExist, Lib3MF_CustomXMLNode * pChildInstance) { - IBase* pIBaseClass = (IBase *)pObject; + IBase* pIBaseClass = (IBase *)pCustomXMLNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "SetName"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNode, "CustomXMLNode", "FindChild"); pJournalEntry->addStringParameter("Name", pName); + pJournalEntry->addBooleanParameter("MustExist", bMustExist); } if (pName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pChildInstance == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); std::string sName(pName); - IObject* pIObject = dynamic_cast(pIBaseClass); - if (!pIObject) + IBase* pBaseChildInstance(nullptr); + ICustomXMLNode* pICustomXMLNode = dynamic_cast(pIBaseClass); + if (!pICustomXMLNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIObject->SetName(sName); + pBaseChildInstance = pICustomXMLNode->FindChild(sName, bMustExist); + *pChildInstance = (IBase*)(pBaseChildInstance); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("ChildInstance", *pChildInstance); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -2765,47 +3247,31 @@ Lib3MFResult lib3mf_object_setname(Lib3MF_Object pObject, const char * pName) } } -Lib3MFResult lib3mf_object_getpartnumber(Lib3MF_Object pObject, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer) +Lib3MFResult lib3mf_customxmlnode_addchild(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_CustomXMLNode * pChildInstance) { - IBase* pIBaseClass = (IBase *)pObject; + IBase* pIBaseClass = (IBase *)pCustomXMLNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "GetPartNumber"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNode, "CustomXMLNode", "AddChild"); + pJournalEntry->addStringParameter("Name", pName); } - if ( (!pPartNumberBuffer) && !(pPartNumberNeededChars) ) + if (pName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sPartNumber(""); - IObject* pIObject = dynamic_cast(pIBaseClass); - if (!pIObject) + if (pChildInstance == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(pName); + IBase* pBaseChildInstance(nullptr); + ICustomXMLNode* pICustomXMLNode = dynamic_cast(pIBaseClass); + if (!pICustomXMLNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pPartNumberBuffer == nullptr); - if (isCacheCall) { - sPartNumber = pIObject->GetPartNumber(); + pBaseChildInstance = pICustomXMLNode->AddChild(sName); - pIObject->_setCache (new ParameterCache_1 (sPartNumber)); - } - else { - auto cache = dynamic_cast*> (pIObject->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sPartNumber); - pIObject->_setCache (nullptr); - } - - if (pPartNumberNeededChars) - *pPartNumberNeededChars = (Lib3MF_uint32) (sPartNumber.size()+1); - if (pPartNumberBuffer) { - if (sPartNumber.size() >= nPartNumberBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iPartNumber = 0; iPartNumber < sPartNumber.size(); iPartNumber++) - pPartNumberBuffer[iPartNumber] = sPartNumber[iPartNumber]; - pPartNumberBuffer[sPartNumber.size()] = 0; - } + *pChildInstance = (IBase*)(pBaseChildInstance); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("PartNumber", sPartNumber.c_str()); + pJournalEntry->addHandleResult("ChildInstance", *pChildInstance); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -2821,24 +3287,26 @@ Lib3MFResult lib3mf_object_getpartnumber(Lib3MF_Object pObject, const Lib3MF_uin } } -Lib3MFResult lib3mf_object_setpartnumber(Lib3MF_Object pObject, const char * pPartNumber) +Lib3MFResult lib3mf_customxmlnode_removechild(Lib3MF_CustomXMLNode pCustomXMLNode, Lib3MF_CustomXMLNode pChildInstance) { - IBase* pIBaseClass = (IBase *)pObject; + IBase* pIBaseClass = (IBase *)pCustomXMLNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "SetPartNumber"); - pJournalEntry->addStringParameter("PartNumber", pPartNumber); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNode, "CustomXMLNode", "RemoveChild"); + pJournalEntry->addHandleParameter("ChildInstance", pChildInstance); } - if (pPartNumber == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sPartNumber(pPartNumber); - IObject* pIObject = dynamic_cast(pIBaseClass); - if (!pIObject) + IBase* pIBaseClassChildInstance = (IBase *)pChildInstance; + ICustomXMLNode* pIChildInstance = dynamic_cast(pIBaseClassChildInstance); + if (!pIChildInstance) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); + + ICustomXMLNode* pICustomXMLNode = dynamic_cast(pIBaseClass); + if (!pICustomXMLNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIObject->SetPartNumber(sPartNumber); + pICustomXMLNode->RemoveChild(pIChildInstance); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -2856,25 +3324,29 @@ Lib3MFResult lib3mf_object_setpartnumber(Lib3MF_Object pObject, const char * pPa } } -Lib3MFResult lib3mf_object_ismeshobject(Lib3MF_Object pObject, bool * pIsMeshObject) +Lib3MFResult lib3mf_customxmlnode_removechildrenwithname(Lib3MF_CustomXMLNode pCustomXMLNode, const char * pName, Lib3MF_uint64 * pNumberOfDeletedChildren) { - IBase* pIBaseClass = (IBase *)pObject; + IBase* pIBaseClass = (IBase *)pCustomXMLNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "IsMeshObject"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNode, "CustomXMLNode", "RemoveChildrenWithName"); + pJournalEntry->addStringParameter("Name", pName); } - if (pIsMeshObject == nullptr) + if (pName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IObject* pIObject = dynamic_cast(pIBaseClass); - if (!pIObject) + if (pNumberOfDeletedChildren == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(pName); + ICustomXMLNode* pICustomXMLNode = dynamic_cast(pIBaseClass); + if (!pICustomXMLNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pIsMeshObject = pIObject->IsMeshObject(); + *pNumberOfDeletedChildren = pICustomXMLNode->RemoveChildrenWithName(sName); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addBooleanResult("IsMeshObject", *pIsMeshObject); + pJournalEntry->addUInt64Result("NumberOfDeletedChildren", *pNumberOfDeletedChildren); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -2890,25 +3362,22 @@ Lib3MFResult lib3mf_object_ismeshobject(Lib3MF_Object pObject, bool * pIsMeshObj } } -Lib3MFResult lib3mf_object_iscomponentsobject(Lib3MF_Object pObject, bool * pIsComponentsObject) +Lib3MFResult lib3mf_customxmlnode_remove(Lib3MF_CustomXMLNode pCustomXMLNode) { - IBase* pIBaseClass = (IBase *)pObject; + IBase* pIBaseClass = (IBase *)pCustomXMLNode; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "IsComponentsObject"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNode, "CustomXMLNode", "Remove"); } - if (pIsComponentsObject == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IObject* pIObject = dynamic_cast(pIBaseClass); - if (!pIObject) + ICustomXMLNode* pICustomXMLNode = dynamic_cast(pIBaseClass); + if (!pICustomXMLNode) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pIsComponentsObject = pIObject->IsComponentsObject(); + pICustomXMLNode->Remove(); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addBooleanResult("IsComponentsObject", *pIsComponentsObject); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -2924,25 +3393,29 @@ Lib3MFResult lib3mf_object_iscomponentsobject(Lib3MF_Object pObject, bool * pIsC } } -Lib3MFResult lib3mf_object_isvalid(Lib3MF_Object pObject, bool * pIsValid) + +/************************************************************************************************************************* + Class implementation for CustomXMLNodes +**************************************************************************************************************************/ +Lib3MFResult lib3mf_customxmlnodes_getnodecount(Lib3MF_CustomXMLNodes pCustomXMLNodes, Lib3MF_uint64 * pCount) { - IBase* pIBaseClass = (IBase *)pObject; + IBase* pIBaseClass = (IBase *)pCustomXMLNodes; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "IsValid"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNodes, "CustomXMLNodes", "GetNodeCount"); } - if (pIsValid == nullptr) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IObject* pIObject = dynamic_cast(pIBaseClass); - if (!pIObject) + ICustomXMLNodes* pICustomXMLNodes = dynamic_cast(pIBaseClass); + if (!pICustomXMLNodes) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pIsValid = pIObject->IsValid(); + *pCount = pICustomXMLNodes->GetNodeCount(); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addBooleanResult("IsValid", *pIsValid); + pJournalEntry->addUInt64Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -2958,28 +3431,28 @@ Lib3MFResult lib3mf_object_isvalid(Lib3MF_Object pObject, bool * pIsValid) } } -Lib3MFResult lib3mf_object_setattachmentasthumbnail(Lib3MF_Object pObject, Lib3MF_Attachment pAttachment) +Lib3MFResult lib3mf_customxmlnodes_getnode(Lib3MF_CustomXMLNodes pCustomXMLNodes, Lib3MF_uint64 nIndex, Lib3MF_CustomXMLNode * pNodeInstance) { - IBase* pIBaseClass = (IBase *)pObject; + IBase* pIBaseClass = (IBase *)pCustomXMLNodes; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "SetAttachmentAsThumbnail"); - pJournalEntry->addHandleParameter("Attachment", pAttachment); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNodes, "CustomXMLNodes", "GetNode"); + pJournalEntry->addUInt64Parameter("Index", nIndex); } - IBase* pIBaseClassAttachment = (IBase *)pAttachment; - IAttachment* pIAttachment = dynamic_cast(pIBaseClassAttachment); - if (!pIAttachment) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); - - IObject* pIObject = dynamic_cast(pIBaseClass); - if (!pIObject) + if (pNodeInstance == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseNodeInstance(nullptr); + ICustomXMLNodes* pICustomXMLNodes = dynamic_cast(pIBaseClass); + if (!pICustomXMLNodes) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIObject->SetAttachmentAsThumbnail(pIAttachment); + pBaseNodeInstance = pICustomXMLNodes->GetNode(nIndex); + *pNodeInstance = (IBase*)(pBaseNodeInstance); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("NodeInstance", *pNodeInstance); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -2995,27 +3468,29 @@ Lib3MFResult lib3mf_object_setattachmentasthumbnail(Lib3MF_Object pObject, Lib3M } } -Lib3MFResult lib3mf_object_getthumbnailattachment(Lib3MF_Object pObject, Lib3MF_Attachment * pAttachment) +Lib3MFResult lib3mf_customxmlnodes_countnodesbyname(Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, Lib3MF_uint64 * pCount) { - IBase* pIBaseClass = (IBase *)pObject; + IBase* pIBaseClass = (IBase *)pCustomXMLNodes; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "GetThumbnailAttachment"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNodes, "CustomXMLNodes", "CountNodesByName"); + pJournalEntry->addStringParameter("Name", pName); } - if (pAttachment == nullptr) + if (pName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseAttachment(nullptr); - IObject* pIObject = dynamic_cast(pIBaseClass); - if (!pIObject) + if (pCount == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(pName); + ICustomXMLNodes* pICustomXMLNodes = dynamic_cast(pIBaseClass); + if (!pICustomXMLNodes) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseAttachment = pIObject->GetThumbnailAttachment(); + *pCount = pICustomXMLNodes->CountNodesByName(sName); - *pAttachment = (IBase*)(pBaseAttachment); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Attachment", *pAttachment); + pJournalEntry->addUInt64Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -3031,22 +3506,31 @@ Lib3MFResult lib3mf_object_getthumbnailattachment(Lib3MF_Object pObject, Lib3MF_ } } -Lib3MFResult lib3mf_object_clearthumbnailattachment(Lib3MF_Object pObject) +Lib3MFResult lib3mf_customxmlnodes_getnodesbyname(Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, Lib3MF_CustomXMLNodes * pNodes) { - IBase* pIBaseClass = (IBase *)pObject; + IBase* pIBaseClass = (IBase *)pCustomXMLNodes; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "ClearThumbnailAttachment"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNodes, "CustomXMLNodes", "GetNodesByName"); + pJournalEntry->addStringParameter("Name", pName); } - IObject* pIObject = dynamic_cast(pIBaseClass); - if (!pIObject) + if (pName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pNodes == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(pName); + IBase* pBaseNodes(nullptr); + ICustomXMLNodes* pICustomXMLNodes = dynamic_cast(pIBaseClass); + if (!pICustomXMLNodes) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIObject->ClearThumbnailAttachment(); + pBaseNodes = pICustomXMLNodes->GetNodesByName(sName); + *pNodes = (IBase*)(pBaseNodes); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Nodes", *pNodes); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -3062,24 +3546,29 @@ Lib3MFResult lib3mf_object_clearthumbnailattachment(Lib3MF_Object pObject) } } -Lib3MFResult lib3mf_object_getoutbox(Lib3MF_Object pObject, sLib3MFBox * pOutbox) +Lib3MFResult lib3mf_customxmlnodes_hasnode(Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool * pNodeExists) { - IBase* pIBaseClass = (IBase *)pObject; + IBase* pIBaseClass = (IBase *)pCustomXMLNodes; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "GetOutbox"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNodes, "CustomXMLNodes", "HasNode"); + pJournalEntry->addStringParameter("Name", pName); } - if (pOutbox == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IObject* pIObject = dynamic_cast(pIBaseClass); - if (!pIObject) + if (pName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pNodeExists == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(pName); + ICustomXMLNodes* pICustomXMLNodes = dynamic_cast(pIBaseClass); + if (!pICustomXMLNodes) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pOutbox = pIObject->GetOutbox(); + *pNodeExists = pICustomXMLNodes->HasNode(sName); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("NodeExists", *pNodeExists); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -3095,50 +3584,29 @@ Lib3MFResult lib3mf_object_getoutbox(Lib3MF_Object pObject, sLib3MFBox * pOutbox } } -Lib3MFResult lib3mf_object_getuuid(Lib3MF_Object pObject, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) +Lib3MFResult lib3mf_customxmlnodes_hasuniquenode(Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool * pNodeExists) { - IBase* pIBaseClass = (IBase *)pObject; + IBase* pIBaseClass = (IBase *)pCustomXMLNodes; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "GetUUID"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNodes, "CustomXMLNodes", "HasUniqueNode"); + pJournalEntry->addStringParameter("Name", pName); } - if (!pHasUUID) + if (pName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if ( (!pUUIDBuffer) && !(pUUIDNeededChars) ) + if (pNodeExists == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sUUID(""); - IObject* pIObject = dynamic_cast(pIBaseClass); - if (!pIObject) + std::string sName(pName); + ICustomXMLNodes* pICustomXMLNodes = dynamic_cast(pIBaseClass); + if (!pICustomXMLNodes) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pUUIDBuffer == nullptr); - if (isCacheCall) { - sUUID = pIObject->GetUUID(*pHasUUID); + *pNodeExists = pICustomXMLNodes->HasUniqueNode(sName); - pIObject->_setCache (new ParameterCache_2 (*pHasUUID, sUUID)); - } - else { - auto cache = dynamic_cast*> (pIObject->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (*pHasUUID, sUUID); - pIObject->_setCache (nullptr); - } - - if (pUUIDNeededChars) - *pUUIDNeededChars = (Lib3MF_uint32) (sUUID.size()+1); - if (pUUIDBuffer) { - if (sUUID.size() >= nUUIDBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iUUID = 0; iUUID < sUUID.size(); iUUID++) - pUUIDBuffer[iUUID] = sUUID[iUUID]; - pUUIDBuffer[sUUID.size()] = 0; - } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addBooleanResult("HasUUID", *pHasUUID); - pJournalEntry->addStringResult("UUID", sUUID.c_str()); + pJournalEntry->addBooleanResult("NodeExists", *pNodeExists); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -3154,26 +3622,32 @@ Lib3MFResult lib3mf_object_getuuid(Lib3MF_Object pObject, bool * pHasUUID, const } } -Lib3MFResult lib3mf_object_setuuid(Lib3MF_Object pObject, const char * pUUID) +Lib3MFResult lib3mf_customxmlnodes_findnode(Lib3MF_CustomXMLNodes pCustomXMLNodes, const char * pName, bool bMustExist, Lib3MF_CustomXMLNode * pNodeInstance) { - IBase* pIBaseClass = (IBase *)pObject; + IBase* pIBaseClass = (IBase *)pCustomXMLNodes; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "SetUUID"); - pJournalEntry->addStringParameter("UUID", pUUID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomXMLNodes, "CustomXMLNodes", "FindNode"); + pJournalEntry->addStringParameter("Name", pName); + pJournalEntry->addBooleanParameter("MustExist", bMustExist); } - if (pUUID == nullptr) + if (pName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sUUID(pUUID); - IObject* pIObject = dynamic_cast(pIBaseClass); - if (!pIObject) + if (pNodeInstance == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(pName); + IBase* pBaseNodeInstance(nullptr); + ICustomXMLNodes* pICustomXMLNodes = dynamic_cast(pIBaseClass); + if (!pICustomXMLNodes) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIObject->SetUUID(sUUID); + pBaseNodeInstance = pICustomXMLNodes->FindNode(sName, bMustExist); + *pNodeInstance = (IBase*)(pBaseNodeInstance); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("NodeInstance", *pNodeInstance); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -3189,27 +3663,51 @@ Lib3MFResult lib3mf_object_setuuid(Lib3MF_Object pObject, const char * pUUID) } } -Lib3MFResult lib3mf_object_getmetadatagroup(Lib3MF_Object pObject, Lib3MF_MetaDataGroup * pMetaDataGroup) -{ - IBase* pIBaseClass = (IBase *)pObject; - PLib3MFInterfaceJournalEntry pJournalEntry; +/************************************************************************************************************************* + Class implementation for CustomDOMTree +**************************************************************************************************************************/ +Lib3MFResult lib3mf_customdomtree_getnamespace(Lib3MF_CustomDOMTree pCustomDOMTree, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer) +{ + IBase* pIBaseClass = (IBase *)pCustomDOMTree; + + PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "GetMetaDataGroup"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomDOMTree, "CustomDOMTree", "GetNameSpace"); } - if (pMetaDataGroup == nullptr) + if ( (!pNameSpaceBuffer) && !(pNameSpaceNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseMetaDataGroup(nullptr); - IObject* pIObject = dynamic_cast(pIBaseClass); - if (!pIObject) + std::string sNameSpace(""); + ICustomDOMTree* pICustomDOMTree = dynamic_cast(pIBaseClass); + if (!pICustomDOMTree) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseMetaDataGroup = pIObject->GetMetaDataGroup(); + bool isCacheCall = (pNameSpaceBuffer == nullptr); + if (isCacheCall) { + sNameSpace = pICustomDOMTree->GetNameSpace(); - *pMetaDataGroup = (IBase*)(pBaseMetaDataGroup); + pICustomDOMTree->_setCache (new ParameterCache_1 (sNameSpace)); + } + else { + auto cache = dynamic_cast*> (pICustomDOMTree->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sNameSpace); + pICustomDOMTree->_setCache (nullptr); + } + + if (pNameSpaceNeededChars) + *pNameSpaceNeededChars = (Lib3MF_uint32) (sNameSpace.size()+1); + if (pNameSpaceBuffer) { + if (sNameSpace.size() >= nNameSpaceBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iNameSpace = 0; iNameSpace < sNameSpace.size(); iNameSpace++) + pNameSpaceBuffer[iNameSpace] = sNameSpace[iNameSpace]; + pNameSpaceBuffer[sNameSpace.size()] = 0; + } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("MetaDataGroup", *pMetaDataGroup); + pJournalEntry->addStringResult("NameSpace", sNameSpace.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -3225,23 +3723,27 @@ Lib3MFResult lib3mf_object_getmetadatagroup(Lib3MF_Object pObject, Lib3MF_MetaDa } } -Lib3MFResult lib3mf_object_setslicesmeshresolution(Lib3MF_Object pObject, eLib3MFSlicesMeshResolution eMeshResolution) +Lib3MFResult lib3mf_customdomtree_getrootnode(Lib3MF_CustomDOMTree pCustomDOMTree, Lib3MF_CustomXMLNode * pRootNode) { - IBase* pIBaseClass = (IBase *)pObject; + IBase* pIBaseClass = (IBase *)pCustomDOMTree; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "SetSlicesMeshResolution"); - pJournalEntry->addEnumParameter("MeshResolution", "SlicesMeshResolution", (Lib3MF_int32)(eMeshResolution)); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomDOMTree, "CustomDOMTree", "GetRootNode"); } - IObject* pIObject = dynamic_cast(pIBaseClass); - if (!pIObject) + if (pRootNode == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseRootNode(nullptr); + ICustomDOMTree* pICustomDOMTree = dynamic_cast(pIBaseClass); + if (!pICustomDOMTree) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIObject->SetSlicesMeshResolution(eMeshResolution); + pBaseRootNode = pICustomDOMTree->GetRootNode(); + *pRootNode = (IBase*)(pBaseRootNode); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("RootNode", *pRootNode); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -3257,25 +3759,47 @@ Lib3MFResult lib3mf_object_setslicesmeshresolution(Lib3MF_Object pObject, eLib3M } } -Lib3MFResult lib3mf_object_getslicesmeshresolution(Lib3MF_Object pObject, eLib3MFSlicesMeshResolution * pMeshResolution) +Lib3MFResult lib3mf_customdomtree_savetostring(Lib3MF_CustomDOMTree pCustomDOMTree, const Lib3MF_uint32 nXMLStringBufferSize, Lib3MF_uint32* pXMLStringNeededChars, char * pXMLStringBuffer) { - IBase* pIBaseClass = (IBase *)pObject; + IBase* pIBaseClass = (IBase *)pCustomDOMTree; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "GetSlicesMeshResolution"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCustomDOMTree, "CustomDOMTree", "SaveToString"); } - if (pMeshResolution == nullptr) + if ( (!pXMLStringBuffer) && !(pXMLStringNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IObject* pIObject = dynamic_cast(pIBaseClass); - if (!pIObject) + std::string sXMLString(""); + ICustomDOMTree* pICustomDOMTree = dynamic_cast(pIBaseClass); + if (!pICustomDOMTree) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pMeshResolution = pIObject->GetSlicesMeshResolution(); + bool isCacheCall = (pXMLStringBuffer == nullptr); + if (isCacheCall) { + sXMLString = pICustomDOMTree->SaveToString(); + pICustomDOMTree->_setCache (new ParameterCache_1 (sXMLString)); + } + else { + auto cache = dynamic_cast*> (pICustomDOMTree->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sXMLString); + pICustomDOMTree->_setCache (nullptr); + } + + if (pXMLStringNeededChars) + *pXMLStringNeededChars = (Lib3MF_uint32) (sXMLString.size()+1); + if (pXMLStringBuffer) { + if (sXMLString.size() >= nXMLStringBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iXMLString = 0; iXMLString < sXMLString.size(); iXMLString++) + pXMLStringBuffer[iXMLString] = sXMLString[iXMLString]; + pXMLStringBuffer[sXMLString.size()] = 0; + } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addEnumResult("MeshResolution", "SlicesMeshResolution", (Lib3MF_int32)(*pMeshResolution)); + pJournalEntry->addStringResult("XMLString", sXMLString.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -3291,26 +3815,31 @@ Lib3MFResult lib3mf_object_getslicesmeshresolution(Lib3MF_Object pObject, eLib3M } } -Lib3MFResult lib3mf_object_hasslices(Lib3MF_Object pObject, bool bRecursive, bool * pHasSlices) + +/************************************************************************************************************************* + Class implementation for SliceStackIterator +**************************************************************************************************************************/ +Lib3MFResult lib3mf_slicestackiterator_getcurrentslicestack(Lib3MF_SliceStackIterator pSliceStackIterator, Lib3MF_SliceStack * pResource) { - IBase* pIBaseClass = (IBase *)pObject; + IBase* pIBaseClass = (IBase *)pSliceStackIterator; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "HasSlices"); - pJournalEntry->addBooleanParameter("Recursive", bRecursive); + pJournalEntry = m_GlobalJournal->beginClassMethod(pSliceStackIterator, "SliceStackIterator", "GetCurrentSliceStack"); } - if (pHasSlices == nullptr) + if (pResource == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IObject* pIObject = dynamic_cast(pIBaseClass); - if (!pIObject) + IBase* pBaseResource(nullptr); + ISliceStackIterator* pISliceStackIterator = dynamic_cast(pIBaseClass); + if (!pISliceStackIterator) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pHasSlices = pIObject->HasSlices(bRecursive); + pBaseResource = pISliceStackIterator->GetCurrentSliceStack(); + *pResource = (IBase*)(pBaseResource); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addBooleanResult("HasSlices", *pHasSlices); + pJournalEntry->addHandleResult("Resource", *pResource); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -3326,22 +3855,31 @@ Lib3MFResult lib3mf_object_hasslices(Lib3MF_Object pObject, bool bRecursive, boo } } -Lib3MFResult lib3mf_object_clearslicestack(Lib3MF_Object pObject) + +/************************************************************************************************************************* + Class implementation for ObjectIterator +**************************************************************************************************************************/ +Lib3MFResult lib3mf_objectiterator_getcurrentobject(Lib3MF_ObjectIterator pObjectIterator, Lib3MF_Object * pResource) { - IBase* pIBaseClass = (IBase *)pObject; + IBase* pIBaseClass = (IBase *)pObjectIterator; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "ClearSliceStack"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pObjectIterator, "ObjectIterator", "GetCurrentObject"); } - IObject* pIObject = dynamic_cast(pIBaseClass); - if (!pIObject) + if (pResource == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseResource(nullptr); + IObjectIterator* pIObjectIterator = dynamic_cast(pIBaseClass); + if (!pIObjectIterator) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIObject->ClearSliceStack(); + pBaseResource = pIObjectIterator->GetCurrentObject(); + *pResource = (IBase*)(pBaseResource); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Resource", *pResource); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -3357,27 +3895,31 @@ Lib3MFResult lib3mf_object_clearslicestack(Lib3MF_Object pObject) } } -Lib3MFResult lib3mf_object_getslicestack(Lib3MF_Object pObject, Lib3MF_SliceStack * pSliceStackInstance) + +/************************************************************************************************************************* + Class implementation for MeshObjectIterator +**************************************************************************************************************************/ +Lib3MFResult lib3mf_meshobjectiterator_getcurrentmeshobject(Lib3MF_MeshObjectIterator pMeshObjectIterator, Lib3MF_MeshObject * pResource) { - IBase* pIBaseClass = (IBase *)pObject; + IBase* pIBaseClass = (IBase *)pMeshObjectIterator; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "GetSliceStack"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObjectIterator, "MeshObjectIterator", "GetCurrentMeshObject"); } - if (pSliceStackInstance == nullptr) + if (pResource == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseSliceStackInstance(nullptr); - IObject* pIObject = dynamic_cast(pIBaseClass); - if (!pIObject) + IBase* pBaseResource(nullptr); + IMeshObjectIterator* pIMeshObjectIterator = dynamic_cast(pIBaseClass); + if (!pIMeshObjectIterator) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseSliceStackInstance = pIObject->GetSliceStack(); + pBaseResource = pIMeshObjectIterator->GetCurrentMeshObject(); - *pSliceStackInstance = (IBase*)(pBaseSliceStackInstance); + *pResource = (IBase*)(pBaseResource); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("SliceStackInstance", *pSliceStackInstance); + pJournalEntry->addHandleResult("Resource", *pResource); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -3393,28 +3935,31 @@ Lib3MFResult lib3mf_object_getslicestack(Lib3MF_Object pObject, Lib3MF_SliceStac } } -Lib3MFResult lib3mf_object_assignslicestack(Lib3MF_Object pObject, Lib3MF_SliceStack pSliceStackInstance) + +/************************************************************************************************************************* + Class implementation for ComponentsObjectIterator +**************************************************************************************************************************/ +Lib3MFResult lib3mf_componentsobjectiterator_getcurrentcomponentsobject(Lib3MF_ComponentsObjectIterator pComponentsObjectIterator, Lib3MF_ComponentsObject * pResource) { - IBase* pIBaseClass = (IBase *)pObject; + IBase* pIBaseClass = (IBase *)pComponentsObjectIterator; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "AssignSliceStack"); - pJournalEntry->addHandleParameter("SliceStackInstance", pSliceStackInstance); + pJournalEntry = m_GlobalJournal->beginClassMethod(pComponentsObjectIterator, "ComponentsObjectIterator", "GetCurrentComponentsObject"); } - IBase* pIBaseClassSliceStackInstance = (IBase *)pSliceStackInstance; - ISliceStack* pISliceStackInstance = dynamic_cast(pIBaseClassSliceStackInstance); - if (!pISliceStackInstance) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); - - IObject* pIObject = dynamic_cast(pIBaseClass); - if (!pIObject) + if (pResource == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseResource(nullptr); + IComponentsObjectIterator* pIComponentsObjectIterator = dynamic_cast(pIBaseClass); + if (!pIComponentsObjectIterator) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIObject->AssignSliceStack(pISliceStackInstance); + pBaseResource = pIComponentsObjectIterator->GetCurrentComponentsObject(); + *pResource = (IBase*)(pBaseResource); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Resource", *pResource); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -3432,27 +3977,29 @@ Lib3MFResult lib3mf_object_assignslicestack(Lib3MF_Object pObject, Lib3MF_SliceS /************************************************************************************************************************* - Class implementation for MeshObject + Class implementation for Texture2DIterator **************************************************************************************************************************/ -Lib3MFResult lib3mf_meshobject_getvertexcount(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount) +Lib3MFResult lib3mf_texture2diterator_getcurrenttexture2d(Lib3MF_Texture2DIterator pTexture2DIterator, Lib3MF_Texture2D * pResource) { - IBase* pIBaseClass = (IBase *)pMeshObject; + IBase* pIBaseClass = (IBase *)pTexture2DIterator; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "GetVertexCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DIterator, "Texture2DIterator", "GetCurrentTexture2D"); } - if (pVertexCount == nullptr) + if (pResource == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); - if (!pIMeshObject) + IBase* pBaseResource(nullptr); + ITexture2DIterator* pITexture2DIterator = dynamic_cast(pIBaseClass); + if (!pITexture2DIterator) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pVertexCount = pIMeshObject->GetVertexCount(); + pBaseResource = pITexture2DIterator->GetCurrentTexture2D(); + *pResource = (IBase*)(pBaseResource); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("VertexCount", *pVertexCount); + pJournalEntry->addHandleResult("Resource", *pResource); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -3468,25 +4015,31 @@ Lib3MFResult lib3mf_meshobject_getvertexcount(Lib3MF_MeshObject pMeshObject, Lib } } -Lib3MFResult lib3mf_meshobject_gettrianglecount(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount) + +/************************************************************************************************************************* + Class implementation for BaseMaterialGroupIterator +**************************************************************************************************************************/ +Lib3MFResult lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup(Lib3MF_BaseMaterialGroupIterator pBaseMaterialGroupIterator, Lib3MF_BaseMaterialGroup * pResource) { - IBase* pIBaseClass = (IBase *)pMeshObject; + IBase* pIBaseClass = (IBase *)pBaseMaterialGroupIterator; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "GetTriangleCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroupIterator, "BaseMaterialGroupIterator", "GetCurrentBaseMaterialGroup"); } - if (pVertexCount == nullptr) + if (pResource == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); - if (!pIMeshObject) + IBase* pBaseResource(nullptr); + IBaseMaterialGroupIterator* pIBaseMaterialGroupIterator = dynamic_cast(pIBaseClass); + if (!pIBaseMaterialGroupIterator) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pVertexCount = pIMeshObject->GetTriangleCount(); + pBaseResource = pIBaseMaterialGroupIterator->GetCurrentBaseMaterialGroup(); + *pResource = (IBase*)(pBaseResource); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("VertexCount", *pVertexCount); + pJournalEntry->addHandleResult("Resource", *pResource); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -3502,25 +4055,31 @@ Lib3MFResult lib3mf_meshobject_gettrianglecount(Lib3MF_MeshObject pMeshObject, L } } -Lib3MFResult lib3mf_meshobject_getvertex(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFPosition * pCoordinates) + +/************************************************************************************************************************* + Class implementation for ColorGroupIterator +**************************************************************************************************************************/ +Lib3MFResult lib3mf_colorgroupiterator_getcurrentcolorgroup(Lib3MF_ColorGroupIterator pColorGroupIterator, Lib3MF_ColorGroup * pResource) { - IBase* pIBaseClass = (IBase *)pMeshObject; + IBase* pIBaseClass = (IBase *)pColorGroupIterator; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "GetVertex"); - pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroupIterator, "ColorGroupIterator", "GetCurrentColorGroup"); } - if (pCoordinates == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); - if (!pIMeshObject) + if (pResource == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseResource(nullptr); + IColorGroupIterator* pIColorGroupIterator = dynamic_cast(pIBaseClass); + if (!pIColorGroupIterator) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCoordinates = pIMeshObject->GetVertex(nIndex); + pBaseResource = pIColorGroupIterator->GetCurrentColorGroup(); + *pResource = (IBase*)(pBaseResource); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Resource", *pResource); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -3536,23 +4095,31 @@ Lib3MFResult lib3mf_meshobject_getvertex(Lib3MF_MeshObject pMeshObject, Lib3MF_u } } -Lib3MFResult lib3mf_meshobject_setvertex(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFPosition * pCoordinates) + +/************************************************************************************************************************* + Class implementation for Texture2DGroupIterator +**************************************************************************************************************************/ +Lib3MFResult lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup(Lib3MF_Texture2DGroupIterator pTexture2DGroupIterator, Lib3MF_Texture2DGroup * pResource) { - IBase* pIBaseClass = (IBase *)pMeshObject; + IBase* pIBaseClass = (IBase *)pTexture2DGroupIterator; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "SetVertex"); - pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroupIterator, "Texture2DGroupIterator", "GetCurrentTexture2DGroup"); } - IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); - if (!pIMeshObject) + if (pResource == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseResource(nullptr); + ITexture2DGroupIterator* pITexture2DGroupIterator = dynamic_cast(pIBaseClass); + if (!pITexture2DGroupIterator) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMeshObject->SetVertex(nIndex, *pCoordinates); + pBaseResource = pITexture2DGroupIterator->GetCurrentTexture2DGroup(); + *pResource = (IBase*)(pBaseResource); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Resource", *pResource); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -3568,25 +4135,4233 @@ Lib3MFResult lib3mf_meshobject_setvertex(Lib3MF_MeshObject pMeshObject, Lib3MF_u } } -Lib3MFResult lib3mf_meshobject_addvertex(Lib3MF_MeshObject pMeshObject, const sLib3MFPosition * pCoordinates, Lib3MF_uint32 * pNewIndex) + +/************************************************************************************************************************* + Class implementation for CompositeMaterialsIterator +**************************************************************************************************************************/ +Lib3MFResult lib3mf_compositematerialsiterator_getcurrentcompositematerials(Lib3MF_CompositeMaterialsIterator pCompositeMaterialsIterator, Lib3MF_CompositeMaterials * pResource) { - IBase* pIBaseClass = (IBase *)pMeshObject; + IBase* pIBaseClass = (IBase *)pCompositeMaterialsIterator; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "AddVertex"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterialsIterator, "CompositeMaterialsIterator", "GetCurrentCompositeMaterials"); } - if (pNewIndex == nullptr) + if (pResource == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); - if (!pIMeshObject) + IBase* pBaseResource(nullptr); + ICompositeMaterialsIterator* pICompositeMaterialsIterator = dynamic_cast(pIBaseClass); + if (!pICompositeMaterialsIterator) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseResource = pICompositeMaterialsIterator->GetCurrentCompositeMaterials(); + + *pResource = (IBase*)(pBaseResource); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Resource", *pResource); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + + +/************************************************************************************************************************* + Class implementation for MultiPropertyGroupIterator +**************************************************************************************************************************/ +Lib3MFResult lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup(Lib3MF_MultiPropertyGroupIterator pMultiPropertyGroupIterator, Lib3MF_MultiPropertyGroup * pResource) +{ + IBase* pIBaseClass = (IBase *)pMultiPropertyGroupIterator; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroupIterator, "MultiPropertyGroupIterator", "GetCurrentMultiPropertyGroup"); + } + if (pResource == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseResource(nullptr); + IMultiPropertyGroupIterator* pIMultiPropertyGroupIterator = dynamic_cast(pIBaseClass); + if (!pIMultiPropertyGroupIterator) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseResource = pIMultiPropertyGroupIterator->GetCurrentMultiPropertyGroup(); + + *pResource = (IBase*)(pBaseResource); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Resource", *pResource); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + + +/************************************************************************************************************************* + Class implementation for MetaData +**************************************************************************************************************************/ +Lib3MFResult lib3mf_metadata_getnamespace(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer) +{ + IBase* pIBaseClass = (IBase *)pMetaData; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaData, "MetaData", "GetNameSpace"); + } + if ( (!pNameSpaceBuffer) && !(pNameSpaceNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpace(""); + IMetaData* pIMetaData = dynamic_cast(pIBaseClass); + if (!pIMetaData) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + bool isCacheCall = (pNameSpaceBuffer == nullptr); + if (isCacheCall) { + sNameSpace = pIMetaData->GetNameSpace(); + + pIMetaData->_setCache (new ParameterCache_1 (sNameSpace)); + } + else { + auto cache = dynamic_cast*> (pIMetaData->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sNameSpace); + pIMetaData->_setCache (nullptr); + } + + if (pNameSpaceNeededChars) + *pNameSpaceNeededChars = (Lib3MF_uint32) (sNameSpace.size()+1); + if (pNameSpaceBuffer) { + if (sNameSpace.size() >= nNameSpaceBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iNameSpace = 0; iNameSpace < sNameSpace.size(); iNameSpace++) + pNameSpaceBuffer[iNameSpace] = sNameSpace[iNameSpace]; + pNameSpaceBuffer[sNameSpace.size()] = 0; + } + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("NameSpace", sNameSpace.c_str()); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_metadata_setnamespace(Lib3MF_MetaData pMetaData, const char * pNameSpace) +{ + IBase* pIBaseClass = (IBase *)pMetaData; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaData, "MetaData", "SetNameSpace"); + pJournalEntry->addStringParameter("NameSpace", pNameSpace); + } + if (pNameSpace == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpace(pNameSpace); + IMetaData* pIMetaData = dynamic_cast(pIBaseClass); + if (!pIMetaData) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIMetaData->SetNameSpace(sNameSpace); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_metadata_getname(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) +{ + IBase* pIBaseClass = (IBase *)pMetaData; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaData, "MetaData", "GetName"); + } + if ( (!pNameBuffer) && !(pNameNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(""); + IMetaData* pIMetaData = dynamic_cast(pIBaseClass); + if (!pIMetaData) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + bool isCacheCall = (pNameBuffer == nullptr); + if (isCacheCall) { + sName = pIMetaData->GetName(); + + pIMetaData->_setCache (new ParameterCache_1 (sName)); + } + else { + auto cache = dynamic_cast*> (pIMetaData->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sName); + pIMetaData->_setCache (nullptr); + } + + if (pNameNeededChars) + *pNameNeededChars = (Lib3MF_uint32) (sName.size()+1); + if (pNameBuffer) { + if (sName.size() >= nNameBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iName = 0; iName < sName.size(); iName++) + pNameBuffer[iName] = sName[iName]; + pNameBuffer[sName.size()] = 0; + } + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("Name", sName.c_str()); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_metadata_setname(Lib3MF_MetaData pMetaData, const char * pName) +{ + IBase* pIBaseClass = (IBase *)pMetaData; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaData, "MetaData", "SetName"); + pJournalEntry->addStringParameter("Name", pName); + } + if (pName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(pName); + IMetaData* pIMetaData = dynamic_cast(pIBaseClass); + if (!pIMetaData) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIMetaData->SetName(sName); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_metadata_getkey(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nKeyBufferSize, Lib3MF_uint32* pKeyNeededChars, char * pKeyBuffer) +{ + IBase* pIBaseClass = (IBase *)pMetaData; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaData, "MetaData", "GetKey"); + } + if ( (!pKeyBuffer) && !(pKeyNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sKey(""); + IMetaData* pIMetaData = dynamic_cast(pIBaseClass); + if (!pIMetaData) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + bool isCacheCall = (pKeyBuffer == nullptr); + if (isCacheCall) { + sKey = pIMetaData->GetKey(); + + pIMetaData->_setCache (new ParameterCache_1 (sKey)); + } + else { + auto cache = dynamic_cast*> (pIMetaData->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sKey); + pIMetaData->_setCache (nullptr); + } + + if (pKeyNeededChars) + *pKeyNeededChars = (Lib3MF_uint32) (sKey.size()+1); + if (pKeyBuffer) { + if (sKey.size() >= nKeyBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iKey = 0; iKey < sKey.size(); iKey++) + pKeyBuffer[iKey] = sKey[iKey]; + pKeyBuffer[sKey.size()] = 0; + } + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("Key", sKey.c_str()); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_metadata_getmustpreserve(Lib3MF_MetaData pMetaData, bool * pMustPreserve) +{ + IBase* pIBaseClass = (IBase *)pMetaData; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaData, "MetaData", "GetMustPreserve"); + } + if (pMustPreserve == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IMetaData* pIMetaData = dynamic_cast(pIBaseClass); + if (!pIMetaData) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pMustPreserve = pIMetaData->GetMustPreserve(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("MustPreserve", *pMustPreserve); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_metadata_setmustpreserve(Lib3MF_MetaData pMetaData, bool bMustPreserve) +{ + IBase* pIBaseClass = (IBase *)pMetaData; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaData, "MetaData", "SetMustPreserve"); + pJournalEntry->addBooleanParameter("MustPreserve", bMustPreserve); + } + IMetaData* pIMetaData = dynamic_cast(pIBaseClass); + if (!pIMetaData) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIMetaData->SetMustPreserve(bMustPreserve); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_metadata_gettype(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nTypeBufferSize, Lib3MF_uint32* pTypeNeededChars, char * pTypeBuffer) +{ + IBase* pIBaseClass = (IBase *)pMetaData; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaData, "MetaData", "GetType"); + } + if ( (!pTypeBuffer) && !(pTypeNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sType(""); + IMetaData* pIMetaData = dynamic_cast(pIBaseClass); + if (!pIMetaData) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + bool isCacheCall = (pTypeBuffer == nullptr); + if (isCacheCall) { + sType = pIMetaData->GetType(); + + pIMetaData->_setCache (new ParameterCache_1 (sType)); + } + else { + auto cache = dynamic_cast*> (pIMetaData->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sType); + pIMetaData->_setCache (nullptr); + } + + if (pTypeNeededChars) + *pTypeNeededChars = (Lib3MF_uint32) (sType.size()+1); + if (pTypeBuffer) { + if (sType.size() >= nTypeBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iType = 0; iType < sType.size(); iType++) + pTypeBuffer[iType] = sType[iType]; + pTypeBuffer[sType.size()] = 0; + } + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("Type", sType.c_str()); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_metadata_settype(Lib3MF_MetaData pMetaData, const char * pType) +{ + IBase* pIBaseClass = (IBase *)pMetaData; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaData, "MetaData", "SetType"); + pJournalEntry->addStringParameter("Type", pType); + } + if (pType == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sType(pType); + IMetaData* pIMetaData = dynamic_cast(pIBaseClass); + if (!pIMetaData) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIMetaData->SetType(sType); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_metadata_getvalue(Lib3MF_MetaData pMetaData, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer) +{ + IBase* pIBaseClass = (IBase *)pMetaData; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaData, "MetaData", "GetValue"); + } + if ( (!pValueBuffer) && !(pValueNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sValue(""); + IMetaData* pIMetaData = dynamic_cast(pIBaseClass); + if (!pIMetaData) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + bool isCacheCall = (pValueBuffer == nullptr); + if (isCacheCall) { + sValue = pIMetaData->GetValue(); + + pIMetaData->_setCache (new ParameterCache_1 (sValue)); + } + else { + auto cache = dynamic_cast*> (pIMetaData->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sValue); + pIMetaData->_setCache (nullptr); + } + + if (pValueNeededChars) + *pValueNeededChars = (Lib3MF_uint32) (sValue.size()+1); + if (pValueBuffer) { + if (sValue.size() >= nValueBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iValue = 0; iValue < sValue.size(); iValue++) + pValueBuffer[iValue] = sValue[iValue]; + pValueBuffer[sValue.size()] = 0; + } + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("Value", sValue.c_str()); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_metadata_setvalue(Lib3MF_MetaData pMetaData, const char * pValue) +{ + IBase* pIBaseClass = (IBase *)pMetaData; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaData, "MetaData", "SetValue"); + pJournalEntry->addStringParameter("Value", pValue); + } + if (pValue == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sValue(pValue); + IMetaData* pIMetaData = dynamic_cast(pIBaseClass); + if (!pIMetaData) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIMetaData->SetValue(sValue); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + + +/************************************************************************************************************************* + Class implementation for MetaDataGroup +**************************************************************************************************************************/ +Lib3MFResult lib3mf_metadatagroup_getmetadatacount(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 * pCount) +{ + IBase* pIBaseClass = (IBase *)pMetaDataGroup; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaDataGroup, "MetaDataGroup", "GetMetaDataCount"); + } + if (pCount == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IMetaDataGroup* pIMetaDataGroup = dynamic_cast(pIBaseClass); + if (!pIMetaDataGroup) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pCount = pIMetaDataGroup->GetMetaDataCount(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("Count", *pCount); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_metadatagroup_getmetadata(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex, Lib3MF_MetaData * pMetaData) +{ + IBase* pIBaseClass = (IBase *)pMetaDataGroup; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaDataGroup, "MetaDataGroup", "GetMetaData"); + pJournalEntry->addUInt32Parameter("Index", nIndex); + } + if (pMetaData == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseMetaData(nullptr); + IMetaDataGroup* pIMetaDataGroup = dynamic_cast(pIBaseClass); + if (!pIMetaDataGroup) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseMetaData = pIMetaDataGroup->GetMetaData(nIndex); + + *pMetaData = (IBase*)(pBaseMetaData); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("MetaData", *pMetaData); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_metadatagroup_getmetadatabykey(Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, Lib3MF_MetaData * pMetaData) +{ + IBase* pIBaseClass = (IBase *)pMetaDataGroup; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaDataGroup, "MetaDataGroup", "GetMetaDataByKey"); + pJournalEntry->addStringParameter("NameSpace", pNameSpace); + pJournalEntry->addStringParameter("Name", pName); + } + if (pNameSpace == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pMetaData == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpace(pNameSpace); + std::string sName(pName); + IBase* pBaseMetaData(nullptr); + IMetaDataGroup* pIMetaDataGroup = dynamic_cast(pIBaseClass); + if (!pIMetaDataGroup) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseMetaData = pIMetaDataGroup->GetMetaDataByKey(sNameSpace, sName); + + *pMetaData = (IBase*)(pBaseMetaData); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("MetaData", *pMetaData); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_metadatagroup_removemetadatabyindex(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_uint32 nIndex) +{ + IBase* pIBaseClass = (IBase *)pMetaDataGroup; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaDataGroup, "MetaDataGroup", "RemoveMetaDataByIndex"); + pJournalEntry->addUInt32Parameter("Index", nIndex); + } + IMetaDataGroup* pIMetaDataGroup = dynamic_cast(pIBaseClass); + if (!pIMetaDataGroup) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIMetaDataGroup->RemoveMetaDataByIndex(nIndex); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_metadatagroup_removemetadata(Lib3MF_MetaDataGroup pMetaDataGroup, Lib3MF_MetaData pTheMetaData) +{ + IBase* pIBaseClass = (IBase *)pMetaDataGroup; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaDataGroup, "MetaDataGroup", "RemoveMetaData"); + pJournalEntry->addHandleParameter("TheMetaData", pTheMetaData); + } + IBase* pIBaseClassTheMetaData = (IBase *)pTheMetaData; + IMetaData* pITheMetaData = dynamic_cast(pIBaseClassTheMetaData); + if (!pITheMetaData) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); + + IMetaDataGroup* pIMetaDataGroup = dynamic_cast(pIBaseClass); + if (!pIMetaDataGroup) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIMetaDataGroup->RemoveMetaData(pITheMetaData); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_metadatagroup_addmetadata(Lib3MF_MetaDataGroup pMetaDataGroup, const char * pNameSpace, const char * pName, const char * pValue, const char * pType, bool bMustPreserve, Lib3MF_MetaData * pMetaData) +{ + IBase* pIBaseClass = (IBase *)pMetaDataGroup; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMetaDataGroup, "MetaDataGroup", "AddMetaData"); + pJournalEntry->addStringParameter("NameSpace", pNameSpace); + pJournalEntry->addStringParameter("Name", pName); + pJournalEntry->addStringParameter("Value", pValue); + pJournalEntry->addStringParameter("Type", pType); + pJournalEntry->addBooleanParameter("MustPreserve", bMustPreserve); + } + if (pNameSpace == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pValue == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pType == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pMetaData == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpace(pNameSpace); + std::string sName(pName); + std::string sValue(pValue); + std::string sType(pType); + IBase* pBaseMetaData(nullptr); + IMetaDataGroup* pIMetaDataGroup = dynamic_cast(pIBaseClass); + if (!pIMetaDataGroup) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseMetaData = pIMetaDataGroup->AddMetaData(sNameSpace, sName, sValue, sType, bMustPreserve); + + *pMetaData = (IBase*)(pBaseMetaData); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("MetaData", *pMetaData); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + + +/************************************************************************************************************************* + Class implementation for Object +**************************************************************************************************************************/ +Lib3MFResult lib3mf_object_gettype(Lib3MF_Object pObject, eLib3MFObjectType * pObjectType) +{ + IBase* pIBaseClass = (IBase *)pObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "GetType"); + } + if (pObjectType == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IObject* pIObject = dynamic_cast(pIBaseClass); + if (!pIObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pObjectType = pIObject->GetType(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addEnumResult("ObjectType", "ObjectType", (Lib3MF_int32)(*pObjectType)); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_object_settype(Lib3MF_Object pObject, eLib3MFObjectType eObjectType) +{ + IBase* pIBaseClass = (IBase *)pObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "SetType"); + pJournalEntry->addEnumParameter("ObjectType", "ObjectType", (Lib3MF_int32)(eObjectType)); + } + IObject* pIObject = dynamic_cast(pIBaseClass); + if (!pIObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIObject->SetType(eObjectType); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_object_getname(Lib3MF_Object pObject, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) +{ + IBase* pIBaseClass = (IBase *)pObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "GetName"); + } + if ( (!pNameBuffer) && !(pNameNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(""); + IObject* pIObject = dynamic_cast(pIBaseClass); + if (!pIObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + bool isCacheCall = (pNameBuffer == nullptr); + if (isCacheCall) { + sName = pIObject->GetName(); + + pIObject->_setCache (new ParameterCache_1 (sName)); + } + else { + auto cache = dynamic_cast*> (pIObject->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sName); + pIObject->_setCache (nullptr); + } + + if (pNameNeededChars) + *pNameNeededChars = (Lib3MF_uint32) (sName.size()+1); + if (pNameBuffer) { + if (sName.size() >= nNameBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iName = 0; iName < sName.size(); iName++) + pNameBuffer[iName] = sName[iName]; + pNameBuffer[sName.size()] = 0; + } + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("Name", sName.c_str()); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_object_setname(Lib3MF_Object pObject, const char * pName) +{ + IBase* pIBaseClass = (IBase *)pObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "SetName"); + pJournalEntry->addStringParameter("Name", pName); + } + if (pName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(pName); + IObject* pIObject = dynamic_cast(pIBaseClass); + if (!pIObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIObject->SetName(sName); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_object_getpartnumber(Lib3MF_Object pObject, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer) +{ + IBase* pIBaseClass = (IBase *)pObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "GetPartNumber"); + } + if ( (!pPartNumberBuffer) && !(pPartNumberNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sPartNumber(""); + IObject* pIObject = dynamic_cast(pIBaseClass); + if (!pIObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + bool isCacheCall = (pPartNumberBuffer == nullptr); + if (isCacheCall) { + sPartNumber = pIObject->GetPartNumber(); + + pIObject->_setCache (new ParameterCache_1 (sPartNumber)); + } + else { + auto cache = dynamic_cast*> (pIObject->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sPartNumber); + pIObject->_setCache (nullptr); + } + + if (pPartNumberNeededChars) + *pPartNumberNeededChars = (Lib3MF_uint32) (sPartNumber.size()+1); + if (pPartNumberBuffer) { + if (sPartNumber.size() >= nPartNumberBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iPartNumber = 0; iPartNumber < sPartNumber.size(); iPartNumber++) + pPartNumberBuffer[iPartNumber] = sPartNumber[iPartNumber]; + pPartNumberBuffer[sPartNumber.size()] = 0; + } + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("PartNumber", sPartNumber.c_str()); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_object_setpartnumber(Lib3MF_Object pObject, const char * pPartNumber) +{ + IBase* pIBaseClass = (IBase *)pObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "SetPartNumber"); + pJournalEntry->addStringParameter("PartNumber", pPartNumber); + } + if (pPartNumber == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sPartNumber(pPartNumber); + IObject* pIObject = dynamic_cast(pIBaseClass); + if (!pIObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIObject->SetPartNumber(sPartNumber); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_object_ismeshobject(Lib3MF_Object pObject, bool * pIsMeshObject) +{ + IBase* pIBaseClass = (IBase *)pObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "IsMeshObject"); + } + if (pIsMeshObject == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IObject* pIObject = dynamic_cast(pIBaseClass); + if (!pIObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pIsMeshObject = pIObject->IsMeshObject(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("IsMeshObject", *pIsMeshObject); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_object_iscomponentsobject(Lib3MF_Object pObject, bool * pIsComponentsObject) +{ + IBase* pIBaseClass = (IBase *)pObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "IsComponentsObject"); + } + if (pIsComponentsObject == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IObject* pIObject = dynamic_cast(pIBaseClass); + if (!pIObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pIsComponentsObject = pIObject->IsComponentsObject(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("IsComponentsObject", *pIsComponentsObject); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_object_isvalid(Lib3MF_Object pObject, bool * pIsValid) +{ + IBase* pIBaseClass = (IBase *)pObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "IsValid"); + } + if (pIsValid == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IObject* pIObject = dynamic_cast(pIBaseClass); + if (!pIObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pIsValid = pIObject->IsValid(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("IsValid", *pIsValid); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_object_setattachmentasthumbnail(Lib3MF_Object pObject, Lib3MF_Attachment pAttachment) +{ + IBase* pIBaseClass = (IBase *)pObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "SetAttachmentAsThumbnail"); + pJournalEntry->addHandleParameter("Attachment", pAttachment); + } + IBase* pIBaseClassAttachment = (IBase *)pAttachment; + IAttachment* pIAttachment = dynamic_cast(pIBaseClassAttachment); + if (!pIAttachment) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); + + IObject* pIObject = dynamic_cast(pIBaseClass); + if (!pIObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIObject->SetAttachmentAsThumbnail(pIAttachment); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_object_getthumbnailattachment(Lib3MF_Object pObject, Lib3MF_Attachment * pAttachment) +{ + IBase* pIBaseClass = (IBase *)pObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "GetThumbnailAttachment"); + } + if (pAttachment == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseAttachment(nullptr); + IObject* pIObject = dynamic_cast(pIBaseClass); + if (!pIObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseAttachment = pIObject->GetThumbnailAttachment(); + + *pAttachment = (IBase*)(pBaseAttachment); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Attachment", *pAttachment); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_object_clearthumbnailattachment(Lib3MF_Object pObject) +{ + IBase* pIBaseClass = (IBase *)pObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "ClearThumbnailAttachment"); + } + IObject* pIObject = dynamic_cast(pIBaseClass); + if (!pIObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIObject->ClearThumbnailAttachment(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_object_getoutbox(Lib3MF_Object pObject, sLib3MFBox * pOutbox) +{ + IBase* pIBaseClass = (IBase *)pObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "GetOutbox"); + } + if (pOutbox == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IObject* pIObject = dynamic_cast(pIBaseClass); + if (!pIObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pOutbox = pIObject->GetOutbox(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_object_getuuid(Lib3MF_Object pObject, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) +{ + IBase* pIBaseClass = (IBase *)pObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "GetUUID"); + } + if (!pHasUUID) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if ( (!pUUIDBuffer) && !(pUUIDNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sUUID(""); + IObject* pIObject = dynamic_cast(pIBaseClass); + if (!pIObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + bool isCacheCall = (pUUIDBuffer == nullptr); + if (isCacheCall) { + sUUID = pIObject->GetUUID(*pHasUUID); + + pIObject->_setCache (new ParameterCache_2 (*pHasUUID, sUUID)); + } + else { + auto cache = dynamic_cast*> (pIObject->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (*pHasUUID, sUUID); + pIObject->_setCache (nullptr); + } + + if (pUUIDNeededChars) + *pUUIDNeededChars = (Lib3MF_uint32) (sUUID.size()+1); + if (pUUIDBuffer) { + if (sUUID.size() >= nUUIDBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iUUID = 0; iUUID < sUUID.size(); iUUID++) + pUUIDBuffer[iUUID] = sUUID[iUUID]; + pUUIDBuffer[sUUID.size()] = 0; + } + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("HasUUID", *pHasUUID); + pJournalEntry->addStringResult("UUID", sUUID.c_str()); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_object_setuuid(Lib3MF_Object pObject, const char * pUUID) +{ + IBase* pIBaseClass = (IBase *)pObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "SetUUID"); + pJournalEntry->addStringParameter("UUID", pUUID); + } + if (pUUID == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sUUID(pUUID); + IObject* pIObject = dynamic_cast(pIBaseClass); + if (!pIObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIObject->SetUUID(sUUID); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_object_getmetadatagroup(Lib3MF_Object pObject, Lib3MF_MetaDataGroup * pMetaDataGroup) +{ + IBase* pIBaseClass = (IBase *)pObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "GetMetaDataGroup"); + } + if (pMetaDataGroup == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseMetaDataGroup(nullptr); + IObject* pIObject = dynamic_cast(pIBaseClass); + if (!pIObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseMetaDataGroup = pIObject->GetMetaDataGroup(); + + *pMetaDataGroup = (IBase*)(pBaseMetaDataGroup); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("MetaDataGroup", *pMetaDataGroup); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_object_setslicesmeshresolution(Lib3MF_Object pObject, eLib3MFSlicesMeshResolution eMeshResolution) +{ + IBase* pIBaseClass = (IBase *)pObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "SetSlicesMeshResolution"); + pJournalEntry->addEnumParameter("MeshResolution", "SlicesMeshResolution", (Lib3MF_int32)(eMeshResolution)); + } + IObject* pIObject = dynamic_cast(pIBaseClass); + if (!pIObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIObject->SetSlicesMeshResolution(eMeshResolution); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_object_getslicesmeshresolution(Lib3MF_Object pObject, eLib3MFSlicesMeshResolution * pMeshResolution) +{ + IBase* pIBaseClass = (IBase *)pObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "GetSlicesMeshResolution"); + } + if (pMeshResolution == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IObject* pIObject = dynamic_cast(pIBaseClass); + if (!pIObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pMeshResolution = pIObject->GetSlicesMeshResolution(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addEnumResult("MeshResolution", "SlicesMeshResolution", (Lib3MF_int32)(*pMeshResolution)); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_object_hasslices(Lib3MF_Object pObject, bool bRecursive, bool * pHasSlices) +{ + IBase* pIBaseClass = (IBase *)pObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "HasSlices"); + pJournalEntry->addBooleanParameter("Recursive", bRecursive); + } + if (pHasSlices == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IObject* pIObject = dynamic_cast(pIBaseClass); + if (!pIObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pHasSlices = pIObject->HasSlices(bRecursive); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("HasSlices", *pHasSlices); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_object_clearslicestack(Lib3MF_Object pObject) +{ + IBase* pIBaseClass = (IBase *)pObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "ClearSliceStack"); + } + IObject* pIObject = dynamic_cast(pIBaseClass); + if (!pIObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIObject->ClearSliceStack(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_object_getslicestack(Lib3MF_Object pObject, Lib3MF_SliceStack * pSliceStackInstance) +{ + IBase* pIBaseClass = (IBase *)pObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "GetSliceStack"); + } + if (pSliceStackInstance == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseSliceStackInstance(nullptr); + IObject* pIObject = dynamic_cast(pIBaseClass); + if (!pIObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseSliceStackInstance = pIObject->GetSliceStack(); + + *pSliceStackInstance = (IBase*)(pBaseSliceStackInstance); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("SliceStackInstance", *pSliceStackInstance); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_object_assignslicestack(Lib3MF_Object pObject, Lib3MF_SliceStack pSliceStackInstance) +{ + IBase* pIBaseClass = (IBase *)pObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pObject, "Object", "AssignSliceStack"); + pJournalEntry->addHandleParameter("SliceStackInstance", pSliceStackInstance); + } + IBase* pIBaseClassSliceStackInstance = (IBase *)pSliceStackInstance; + ISliceStack* pISliceStackInstance = dynamic_cast(pIBaseClassSliceStackInstance); + if (!pISliceStackInstance) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); + + IObject* pIObject = dynamic_cast(pIBaseClass); + if (!pIObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIObject->AssignSliceStack(pISliceStackInstance); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + + +/************************************************************************************************************************* + Class implementation for MeshObject +**************************************************************************************************************************/ +Lib3MFResult lib3mf_meshobject_getvertexcount(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount) +{ + IBase* pIBaseClass = (IBase *)pMeshObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "GetVertexCount"); + } + if (pVertexCount == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); + if (!pIMeshObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pVertexCount = pIMeshObject->GetVertexCount(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("VertexCount", *pVertexCount); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_meshobject_gettrianglecount(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pVertexCount) +{ + IBase* pIBaseClass = (IBase *)pMeshObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "GetTriangleCount"); + } + if (pVertexCount == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); + if (!pIMeshObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pVertexCount = pIMeshObject->GetTriangleCount(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("VertexCount", *pVertexCount); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_meshobject_getvertex(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFPosition * pCoordinates) +{ + IBase* pIBaseClass = (IBase *)pMeshObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "GetVertex"); + pJournalEntry->addUInt32Parameter("Index", nIndex); + } + if (pCoordinates == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); + if (!pIMeshObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pCoordinates = pIMeshObject->GetVertex(nIndex); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_meshobject_setvertex(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFPosition * pCoordinates) +{ + IBase* pIBaseClass = (IBase *)pMeshObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "SetVertex"); + pJournalEntry->addUInt32Parameter("Index", nIndex); + } + IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); + if (!pIMeshObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIMeshObject->SetVertex(nIndex, *pCoordinates); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_meshobject_addvertex(Lib3MF_MeshObject pMeshObject, const sLib3MFPosition * pCoordinates, Lib3MF_uint32 * pNewIndex) +{ + IBase* pIBaseClass = (IBase *)pMeshObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "AddVertex"); + } + if (pNewIndex == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); + if (!pIMeshObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pNewIndex = pIMeshObject->AddVertex(*pCoordinates); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("NewIndex", *pNewIndex); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_meshobject_getvertices(Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, sLib3MFPosition * pVerticesBuffer) +{ + IBase* pIBaseClass = (IBase *)pMeshObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "GetVertices"); + } + if ((!pVerticesBuffer) && !(pVerticesNeededCount)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); + if (!pIMeshObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIMeshObject->GetVertices(nVerticesBufferSize, pVerticesNeededCount, pVerticesBuffer); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_meshobject_gettriangle(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFTriangle * pIndices) +{ + IBase* pIBaseClass = (IBase *)pMeshObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "GetTriangle"); + pJournalEntry->addUInt32Parameter("Index", nIndex); + } + if (pIndices == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); + if (!pIMeshObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pIndices = pIMeshObject->GetTriangle(nIndex); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_meshobject_settriangle(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFTriangle * pIndices) +{ + IBase* pIBaseClass = (IBase *)pMeshObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "SetTriangle"); + pJournalEntry->addUInt32Parameter("Index", nIndex); + } + IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); + if (!pIMeshObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIMeshObject->SetTriangle(nIndex, *pIndices); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_meshobject_addtriangle(Lib3MF_MeshObject pMeshObject, const sLib3MFTriangle * pIndices, Lib3MF_uint32 * pNewIndex) +{ + IBase* pIBaseClass = (IBase *)pMeshObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "AddTriangle"); + } + if (pNewIndex == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); + if (!pIMeshObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pNewIndex = pIMeshObject->AddTriangle(*pIndices); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("NewIndex", *pNewIndex); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_meshobject_gettriangleindices(Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, sLib3MFTriangle * pIndicesBuffer) +{ + IBase* pIBaseClass = (IBase *)pMeshObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "GetTriangleIndices"); + } + if ((!pIndicesBuffer) && !(pIndicesNeededCount)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); + if (!pIMeshObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIMeshObject->GetTriangleIndices(nIndicesBufferSize, pIndicesNeededCount, pIndicesBuffer); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_meshobject_setobjectlevelproperty(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nUniqueResourceID, Lib3MF_uint32 nPropertyID) +{ + IBase* pIBaseClass = (IBase *)pMeshObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "SetObjectLevelProperty"); + pJournalEntry->addUInt32Parameter("UniqueResourceID", nUniqueResourceID); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + } + IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); + if (!pIMeshObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIMeshObject->SetObjectLevelProperty(nUniqueResourceID, nPropertyID); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_meshobject_getobjectlevelproperty(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pUniqueResourceID, Lib3MF_uint32 * pPropertyID, bool * pHasObjectLevelProperty) +{ + IBase* pIBaseClass = (IBase *)pMeshObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "GetObjectLevelProperty"); + } + if (!pUniqueResourceID) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (!pPropertyID) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pHasObjectLevelProperty == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); + if (!pIMeshObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pHasObjectLevelProperty = pIMeshObject->GetObjectLevelProperty(*pUniqueResourceID, *pPropertyID); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("UniqueResourceID", *pUniqueResourceID); + pJournalEntry->addUInt32Result("PropertyID", *pPropertyID); + pJournalEntry->addBooleanResult("HasObjectLevelProperty", *pHasObjectLevelProperty); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_meshobject_settriangleproperties(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFTriangleProperties * pProperties) +{ + IBase* pIBaseClass = (IBase *)pMeshObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "SetTriangleProperties"); + pJournalEntry->addUInt32Parameter("Index", nIndex); + } + IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); + if (!pIMeshObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIMeshObject->SetTriangleProperties(nIndex, *pProperties); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_meshobject_gettriangleproperties(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFTriangleProperties * pProperty) +{ + IBase* pIBaseClass = (IBase *)pMeshObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "GetTriangleProperties"); + pJournalEntry->addUInt32Parameter("Index", nIndex); + } + if (!pProperty) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); + if (!pIMeshObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIMeshObject->GetTriangleProperties(nIndex, *pProperty); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_meshobject_setalltriangleproperties(Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nPropertiesArrayBufferSize, const sLib3MFTriangleProperties * pPropertiesArrayBuffer) +{ + IBase* pIBaseClass = (IBase *)pMeshObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "SetAllTriangleProperties"); + } + if ( (!pPropertiesArrayBuffer) && (nPropertiesArrayBufferSize>0)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); + if (!pIMeshObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIMeshObject->SetAllTriangleProperties(nPropertiesArrayBufferSize, pPropertiesArrayBuffer); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_meshobject_getalltriangleproperties(Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nPropertiesArrayBufferSize, Lib3MF_uint64* pPropertiesArrayNeededCount, sLib3MFTriangleProperties * pPropertiesArrayBuffer) +{ + IBase* pIBaseClass = (IBase *)pMeshObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "GetAllTriangleProperties"); + } + if ((!pPropertiesArrayBuffer) && !(pPropertiesArrayNeededCount)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); + if (!pIMeshObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIMeshObject->GetAllTriangleProperties(nPropertiesArrayBufferSize, pPropertiesArrayNeededCount, pPropertiesArrayBuffer); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_meshobject_clearallproperties(Lib3MF_MeshObject pMeshObject) +{ + IBase* pIBaseClass = (IBase *)pMeshObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "ClearAllProperties"); + } + IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); + if (!pIMeshObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIMeshObject->ClearAllProperties(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_meshobject_setgeometry(Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nVerticesBufferSize, const sLib3MFPosition * pVerticesBuffer, Lib3MF_uint64 nIndicesBufferSize, const sLib3MFTriangle * pIndicesBuffer) +{ + IBase* pIBaseClass = (IBase *)pMeshObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "SetGeometry"); + } + if ( (!pVerticesBuffer) && (nVerticesBufferSize>0)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if ( (!pIndicesBuffer) && (nIndicesBufferSize>0)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); + if (!pIMeshObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIMeshObject->SetGeometry(nVerticesBufferSize, pVerticesBuffer, nIndicesBufferSize, pIndicesBuffer); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_meshobject_ismanifoldandoriented(Lib3MF_MeshObject pMeshObject, bool * pIsManifoldAndOriented) +{ + IBase* pIBaseClass = (IBase *)pMeshObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "IsManifoldAndOriented"); + } + if (pIsManifoldAndOriented == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); + if (!pIMeshObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pIsManifoldAndOriented = pIMeshObject->IsManifoldAndOriented(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("IsManifoldAndOriented", *pIsManifoldAndOriented); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_meshobject_beamlattice(Lib3MF_MeshObject pMeshObject, Lib3MF_BeamLattice * pTheBeamLattice) +{ + IBase* pIBaseClass = (IBase *)pMeshObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "BeamLattice"); + } + if (pTheBeamLattice == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseTheBeamLattice(nullptr); + IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); + if (!pIMeshObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseTheBeamLattice = pIMeshObject->BeamLattice(); + + *pTheBeamLattice = (IBase*)(pBaseTheBeamLattice); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("TheBeamLattice", *pTheBeamLattice); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + + +/************************************************************************************************************************* + Class implementation for BeamLattice +**************************************************************************************************************************/ +Lib3MFResult lib3mf_beamlattice_getminlength(Lib3MF_BeamLattice pBeamLattice, Lib3MF_double * pMinLength) +{ + IBase* pIBaseClass = (IBase *)pBeamLattice; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetMinLength"); + } + if (pMinLength == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pMinLength = pIBeamLattice->GetMinLength(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addDoubleResult("MinLength", *pMinLength); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamlattice_setminlength(Lib3MF_BeamLattice pBeamLattice, Lib3MF_double dMinLength) +{ + IBase* pIBaseClass = (IBase *)pBeamLattice; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetMinLength"); + pJournalEntry->addDoubleParameter("MinLength", dMinLength); + } + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBeamLattice->SetMinLength(dMinLength); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamlattice_getclipping(Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode * pClipMode, Lib3MF_uint32 * pUniqueResourceID) +{ + IBase* pIBaseClass = (IBase *)pBeamLattice; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetClipping"); + } + if (!pClipMode) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (!pUniqueResourceID) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBeamLattice->GetClipping(*pClipMode, *pUniqueResourceID); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addEnumResult("ClipMode", "BeamLatticeClipMode", (Lib3MF_int32)(*pClipMode)); + pJournalEntry->addUInt32Result("UniqueResourceID", *pUniqueResourceID); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamlattice_setclipping(Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode eClipMode, Lib3MF_uint32 nUniqueResourceID) +{ + IBase* pIBaseClass = (IBase *)pBeamLattice; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetClipping"); + pJournalEntry->addEnumParameter("ClipMode", "BeamLatticeClipMode", (Lib3MF_int32)(eClipMode)); + pJournalEntry->addUInt32Parameter("UniqueResourceID", nUniqueResourceID); + } + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBeamLattice->SetClipping(eClipMode, nUniqueResourceID); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamlattice_getrepresentation(Lib3MF_BeamLattice pBeamLattice, bool * pHasRepresentation, Lib3MF_uint32 * pUniqueResourceID) +{ + IBase* pIBaseClass = (IBase *)pBeamLattice; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetRepresentation"); + } + if (pHasRepresentation == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (!pUniqueResourceID) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pHasRepresentation = pIBeamLattice->GetRepresentation(*pUniqueResourceID); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("HasRepresentation", *pHasRepresentation); + pJournalEntry->addUInt32Result("UniqueResourceID", *pUniqueResourceID); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamlattice_setrepresentation(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nUniqueResourceID) +{ + IBase* pIBaseClass = (IBase *)pBeamLattice; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetRepresentation"); + pJournalEntry->addUInt32Parameter("UniqueResourceID", nUniqueResourceID); + } + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBeamLattice->SetRepresentation(nUniqueResourceID); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamlattice_getballoptions(Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode * pBallMode, Lib3MF_double * pBallRadius) +{ + IBase* pIBaseClass = (IBase *)pBeamLattice; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBallOptions"); + } + if (!pBallMode) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (!pBallRadius) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBeamLattice->GetBallOptions(*pBallMode, *pBallRadius); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addEnumResult("BallMode", "BeamLatticeBallMode", (Lib3MF_int32)(*pBallMode)); + pJournalEntry->addDoubleResult("BallRadius", *pBallRadius); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamlattice_setballoptions(Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode eBallMode, Lib3MF_double dBallRadius) +{ + IBase* pIBaseClass = (IBase *)pBeamLattice; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetBallOptions"); + pJournalEntry->addEnumParameter("BallMode", "BeamLatticeBallMode", (Lib3MF_int32)(eBallMode)); + pJournalEntry->addDoubleParameter("BallRadius", dBallRadius); + } + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBeamLattice->SetBallOptions(eBallMode, dBallRadius); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamlattice_getbeamcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount) +{ + IBase* pIBaseClass = (IBase *)pBeamLattice; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBeamCount"); + } + if (pCount == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pCount = pIBeamLattice->GetBeamCount(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("Count", *pCount); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamlattice_getbeam(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBeam * pBeamInfo) +{ + IBase* pIBaseClass = (IBase *)pBeamLattice; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBeam"); + pJournalEntry->addUInt32Parameter("Index", nIndex); + } + if (pBeamInfo == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pBeamInfo = pIBeamLattice->GetBeam(nIndex); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamlattice_addbeam(Lib3MF_BeamLattice pBeamLattice, const sLib3MFBeam * pBeamInfo, Lib3MF_uint32 * pIndex) +{ + IBase* pIBaseClass = (IBase *)pBeamLattice; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "AddBeam"); + } + if (pIndex == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pIndex = pIBeamLattice->AddBeam(*pBeamInfo); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("Index", *pIndex); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamlattice_setbeam(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBeam * pBeamInfo) +{ + IBase* pIBaseClass = (IBase *)pBeamLattice; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetBeam"); + pJournalEntry->addUInt32Parameter("Index", nIndex); + } + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBeamLattice->SetBeam(nIndex, *pBeamInfo); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamlattice_setbeams(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBeamInfoBufferSize, const sLib3MFBeam * pBeamInfoBuffer) +{ + IBase* pIBaseClass = (IBase *)pBeamLattice; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetBeams"); + } + if ( (!pBeamInfoBuffer) && (nBeamInfoBufferSize>0)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBeamLattice->SetBeams(nBeamInfoBufferSize, pBeamInfoBuffer); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamlattice_getbeams(Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBeamInfoBufferSize, Lib3MF_uint64* pBeamInfoNeededCount, sLib3MFBeam * pBeamInfoBuffer) +{ + IBase* pIBaseClass = (IBase *)pBeamLattice; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBeams"); + } + if ((!pBeamInfoBuffer) && !(pBeamInfoNeededCount)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBeamLattice->GetBeams(nBeamInfoBufferSize, pBeamInfoNeededCount, pBeamInfoBuffer); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamlattice_getballcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount) +{ + IBase* pIBaseClass = (IBase *)pBeamLattice; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBallCount"); + } + if (pCount == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pCount = pIBeamLattice->GetBallCount(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("Count", *pCount); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamlattice_getball(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBall * pBallInfo) +{ + IBase* pIBaseClass = (IBase *)pBeamLattice; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBall"); + pJournalEntry->addUInt32Parameter("Index", nIndex); + } + if (pBallInfo == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pBallInfo = pIBeamLattice->GetBall(nIndex); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamlattice_addball(Lib3MF_BeamLattice pBeamLattice, const sLib3MFBall * pBallInfo, Lib3MF_uint32 * pIndex) +{ + IBase* pIBaseClass = (IBase *)pBeamLattice; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "AddBall"); + } + if (pIndex == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pIndex = pIBeamLattice->AddBall(*pBallInfo); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("Index", *pIndex); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamlattice_setball(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBall * pBallInfo) +{ + IBase* pIBaseClass = (IBase *)pBeamLattice; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetBall"); + pJournalEntry->addUInt32Parameter("Index", nIndex); + } + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBeamLattice->SetBall(nIndex, *pBallInfo); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamlattice_setballs(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBallInfoBufferSize, const sLib3MFBall * pBallInfoBuffer) +{ + IBase* pIBaseClass = (IBase *)pBeamLattice; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetBalls"); + } + if ( (!pBallInfoBuffer) && (nBallInfoBufferSize>0)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBeamLattice->SetBalls(nBallInfoBufferSize, pBallInfoBuffer); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamlattice_getballs(Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBallInfoBufferSize, Lib3MF_uint64* pBallInfoNeededCount, sLib3MFBall * pBallInfoBuffer) +{ + IBase* pIBaseClass = (IBase *)pBeamLattice; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBalls"); + } + if ((!pBallInfoBuffer) && !(pBallInfoNeededCount)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBeamLattice->GetBalls(nBallInfoBufferSize, pBallInfoNeededCount, pBallInfoBuffer); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamlattice_getbeamsetcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount) +{ + IBase* pIBaseClass = (IBase *)pBeamLattice; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBeamSetCount"); + } + if (pCount == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pCount = pIBeamLattice->GetBeamSetCount(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("Count", *pCount); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamlattice_addbeamset(Lib3MF_BeamLattice pBeamLattice, Lib3MF_BeamSet * pBeamSet) +{ + IBase* pIBaseClass = (IBase *)pBeamLattice; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "AddBeamSet"); + } + if (pBeamSet == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseBeamSet(nullptr); + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseBeamSet = pIBeamLattice->AddBeamSet(); + + *pBeamSet = (IBase*)(pBaseBeamSet); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("BeamSet", *pBeamSet); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamlattice_getbeamset(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF_BeamSet * pBeamSet) +{ + IBase* pIBaseClass = (IBase *)pBeamLattice; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBeamSet"); + pJournalEntry->addUInt32Parameter("Index", nIndex); + } + if (pBeamSet == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseBeamSet(nullptr); + IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); + if (!pIBeamLattice) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseBeamSet = pIBeamLattice->GetBeamSet(nIndex); + + *pBeamSet = (IBase*)(pBaseBeamSet); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("BeamSet", *pBeamSet); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + + +/************************************************************************************************************************* + Class implementation for Component +**************************************************************************************************************************/ +Lib3MFResult lib3mf_component_getobjectresource(Lib3MF_Component pComponent, Lib3MF_Object * pObjectResource) +{ + IBase* pIBaseClass = (IBase *)pComponent; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "GetObjectResource"); + } + if (pObjectResource == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseObjectResource(nullptr); + IComponent* pIComponent = dynamic_cast(pIBaseClass); + if (!pIComponent) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseObjectResource = pIComponent->GetObjectResource(); + + *pObjectResource = (IBase*)(pBaseObjectResource); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("ObjectResource", *pObjectResource); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_component_getobjectresourceid(Lib3MF_Component pComponent, Lib3MF_uint32 * pUniqueResourceID) +{ + IBase* pIBaseClass = (IBase *)pComponent; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "GetObjectResourceID"); + } + if (pUniqueResourceID == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IComponent* pIComponent = dynamic_cast(pIBaseClass); + if (!pIComponent) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pUniqueResourceID = pIComponent->GetObjectResourceID(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("UniqueResourceID", *pUniqueResourceID); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_component_getuuid(Lib3MF_Component pComponent, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) +{ + IBase* pIBaseClass = (IBase *)pComponent; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "GetUUID"); + } + if (!pHasUUID) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if ( (!pUUIDBuffer) && !(pUUIDNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sUUID(""); + IComponent* pIComponent = dynamic_cast(pIBaseClass); + if (!pIComponent) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + bool isCacheCall = (pUUIDBuffer == nullptr); + if (isCacheCall) { + sUUID = pIComponent->GetUUID(*pHasUUID); + + pIComponent->_setCache (new ParameterCache_2 (*pHasUUID, sUUID)); + } + else { + auto cache = dynamic_cast*> (pIComponent->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (*pHasUUID, sUUID); + pIComponent->_setCache (nullptr); + } + + if (pUUIDNeededChars) + *pUUIDNeededChars = (Lib3MF_uint32) (sUUID.size()+1); + if (pUUIDBuffer) { + if (sUUID.size() >= nUUIDBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iUUID = 0; iUUID < sUUID.size(); iUUID++) + pUUIDBuffer[iUUID] = sUUID[iUUID]; + pUUIDBuffer[sUUID.size()] = 0; + } + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("HasUUID", *pHasUUID); + pJournalEntry->addStringResult("UUID", sUUID.c_str()); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_component_setuuid(Lib3MF_Component pComponent, const char * pUUID) +{ + IBase* pIBaseClass = (IBase *)pComponent; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "SetUUID"); + pJournalEntry->addStringParameter("UUID", pUUID); + } + if (pUUID == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sUUID(pUUID); + IComponent* pIComponent = dynamic_cast(pIBaseClass); + if (!pIComponent) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIComponent->SetUUID(sUUID); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_component_hastransform(Lib3MF_Component pComponent, bool * pHasTransform) +{ + IBase* pIBaseClass = (IBase *)pComponent; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "HasTransform"); + } + if (pHasTransform == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IComponent* pIComponent = dynamic_cast(pIBaseClass); + if (!pIComponent) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pHasTransform = pIComponent->HasTransform(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("HasTransform", *pHasTransform); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_component_gettransform(Lib3MF_Component pComponent, sLib3MFTransform * pTransform) +{ + IBase* pIBaseClass = (IBase *)pComponent; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "GetTransform"); + } + if (pTransform == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IComponent* pIComponent = dynamic_cast(pIBaseClass); + if (!pIComponent) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pTransform = pIComponent->GetTransform(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_component_settransform(Lib3MF_Component pComponent, const sLib3MFTransform * pTransform) +{ + IBase* pIBaseClass = (IBase *)pComponent; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "SetTransform"); + } + IComponent* pIComponent = dynamic_cast(pIBaseClass); + if (!pIComponent) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIComponent->SetTransform(*pTransform); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + + +/************************************************************************************************************************* + Class implementation for ComponentsObject +**************************************************************************************************************************/ +Lib3MFResult lib3mf_componentsobject_addcomponent(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_Object pObjectResource, const sLib3MFTransform * pTransform, Lib3MF_Component * pComponentInstance) +{ + IBase* pIBaseClass = (IBase *)pComponentsObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pComponentsObject, "ComponentsObject", "AddComponent"); + pJournalEntry->addHandleParameter("ObjectResource", pObjectResource); + } + if (pComponentInstance == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pIBaseClassObjectResource = (IBase *)pObjectResource; + IObject* pIObjectResource = dynamic_cast(pIBaseClassObjectResource); + if (!pIObjectResource) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); + + IBase* pBaseComponentInstance(nullptr); + IComponentsObject* pIComponentsObject = dynamic_cast(pIBaseClass); + if (!pIComponentsObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseComponentInstance = pIComponentsObject->AddComponent(pIObjectResource, *pTransform); + + *pComponentInstance = (IBase*)(pBaseComponentInstance); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("ComponentInstance", *pComponentInstance); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_componentsobject_getcomponent(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 nIndex, Lib3MF_Component * pComponentInstance) +{ + IBase* pIBaseClass = (IBase *)pComponentsObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pComponentsObject, "ComponentsObject", "GetComponent"); + pJournalEntry->addUInt32Parameter("Index", nIndex); + } + if (pComponentInstance == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseComponentInstance(nullptr); + IComponentsObject* pIComponentsObject = dynamic_cast(pIBaseClass); + if (!pIComponentsObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseComponentInstance = pIComponentsObject->GetComponent(nIndex); + + *pComponentInstance = (IBase*)(pBaseComponentInstance); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("ComponentInstance", *pComponentInstance); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_componentsobject_getcomponentcount(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 * pCount) +{ + IBase* pIBaseClass = (IBase *)pComponentsObject; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pComponentsObject, "ComponentsObject", "GetComponentCount"); + } + if (pCount == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IComponentsObject* pIComponentsObject = dynamic_cast(pIBaseClass); + if (!pIComponentsObject) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pCount = pIComponentsObject->GetComponentCount(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("Count", *pCount); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + + +/************************************************************************************************************************* + Class implementation for BeamSet +**************************************************************************************************************************/ +Lib3MFResult lib3mf_beamset_setname(Lib3MF_BeamSet pBeamSet, const char * pName) +{ + IBase* pIBaseClass = (IBase *)pBeamSet; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "SetName"); + pJournalEntry->addStringParameter("Name", pName); + } + if (pName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(pName); + IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); + if (!pIBeamSet) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBeamSet->SetName(sName); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamset_getname(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) +{ + IBase* pIBaseClass = (IBase *)pBeamSet; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "GetName"); + } + if ( (!pNameBuffer) && !(pNameNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(""); + IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); + if (!pIBeamSet) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + bool isCacheCall = (pNameBuffer == nullptr); + if (isCacheCall) { + sName = pIBeamSet->GetName(); + + pIBeamSet->_setCache (new ParameterCache_1 (sName)); + } + else { + auto cache = dynamic_cast*> (pIBeamSet->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sName); + pIBeamSet->_setCache (nullptr); + } + + if (pNameNeededChars) + *pNameNeededChars = (Lib3MF_uint32) (sName.size()+1); + if (pNameBuffer) { + if (sName.size() >= nNameBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iName = 0; iName < sName.size(); iName++) + pNameBuffer[iName] = sName[iName]; + pNameBuffer[sName.size()] = 0; + } + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("Name", sName.c_str()); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamset_setidentifier(Lib3MF_BeamSet pBeamSet, const char * pIdentifier) +{ + IBase* pIBaseClass = (IBase *)pBeamSet; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "SetIdentifier"); + pJournalEntry->addStringParameter("Identifier", pIdentifier); + } + if (pIdentifier == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sIdentifier(pIdentifier); + IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); + if (!pIBeamSet) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBeamSet->SetIdentifier(sIdentifier); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamset_getidentifier(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer) +{ + IBase* pIBaseClass = (IBase *)pBeamSet; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "GetIdentifier"); + } + if ( (!pIdentifierBuffer) && !(pIdentifierNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sIdentifier(""); + IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); + if (!pIBeamSet) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + bool isCacheCall = (pIdentifierBuffer == nullptr); + if (isCacheCall) { + sIdentifier = pIBeamSet->GetIdentifier(); + + pIBeamSet->_setCache (new ParameterCache_1 (sIdentifier)); + } + else { + auto cache = dynamic_cast*> (pIBeamSet->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sIdentifier); + pIBeamSet->_setCache (nullptr); + } + + if (pIdentifierNeededChars) + *pIdentifierNeededChars = (Lib3MF_uint32) (sIdentifier.size()+1); + if (pIdentifierBuffer) { + if (sIdentifier.size() >= nIdentifierBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iIdentifier = 0; iIdentifier < sIdentifier.size(); iIdentifier++) + pIdentifierBuffer[iIdentifier] = sIdentifier[iIdentifier]; + pIdentifierBuffer[sIdentifier.size()] = 0; + } + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("Identifier", sIdentifier.c_str()); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamset_getreferencecount(Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount) +{ + IBase* pIBaseClass = (IBase *)pBeamSet; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "GetReferenceCount"); + } + if (pCount == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); + if (!pIBeamSet) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pCount = pIBeamSet->GetReferenceCount(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("Count", *pCount); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamset_setreferences(Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nReferencesBufferSize, const Lib3MF_uint32 * pReferencesBuffer) +{ + IBase* pIBaseClass = (IBase *)pBeamSet; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "SetReferences"); + } + if ( (!pReferencesBuffer) && (nReferencesBufferSize>0)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); + if (!pIBeamSet) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBeamSet->SetReferences(nReferencesBufferSize, pReferencesBuffer); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamset_getreferences(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nReferencesBufferSize, Lib3MF_uint64* pReferencesNeededCount, Lib3MF_uint32 * pReferencesBuffer) +{ + IBase* pIBaseClass = (IBase *)pBeamSet; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "GetReferences"); + } + if ((!pReferencesBuffer) && !(pReferencesNeededCount)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); + if (!pIBeamSet) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBeamSet->GetReferences(nReferencesBufferSize, pReferencesNeededCount, pReferencesBuffer); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamset_getballreferencecount(Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount) +{ + IBase* pIBaseClass = (IBase *)pBeamSet; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "GetBallReferenceCount"); + } + if (pCount == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); + if (!pIBeamSet) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pCount = pIBeamSet->GetBallReferenceCount(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("Count", *pCount); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamset_setballreferences(Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nBallReferencesBufferSize, const Lib3MF_uint32 * pBallReferencesBuffer) +{ + IBase* pIBaseClass = (IBase *)pBeamSet; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "SetBallReferences"); + } + if ( (!pBallReferencesBuffer) && (nBallReferencesBufferSize>0)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); + if (!pIBeamSet) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBeamSet->SetBallReferences(nBallReferencesBufferSize, pBallReferencesBuffer); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_beamset_getballreferences(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nBallReferencesBufferSize, Lib3MF_uint64* pBallReferencesNeededCount, Lib3MF_uint32 * pBallReferencesBuffer) +{ + IBase* pIBaseClass = (IBase *)pBeamSet; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "GetBallReferences"); + } + if ((!pBallReferencesBuffer) && !(pBallReferencesNeededCount)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); + if (!pIBeamSet) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBeamSet->GetBallReferences(nBallReferencesBufferSize, pBallReferencesNeededCount, pBallReferencesBuffer); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + + +/************************************************************************************************************************* + Class implementation for BaseMaterialGroup +**************************************************************************************************************************/ +Lib3MFResult lib3mf_basematerialgroup_getcount(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 * pCount) +{ + IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "GetCount"); + } + if (pCount == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); + if (!pIBaseMaterialGroup) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pCount = pIBaseMaterialGroup->GetCount(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("Count", *pCount); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_basematerialgroup_getallpropertyids(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) +{ + IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "GetAllPropertyIDs"); + } + if ((!pPropertyIDsBuffer) && !(pPropertyIDsNeededCount)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); + if (!pIBaseMaterialGroup) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBaseMaterialGroup->GetAllPropertyIDs(nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_basematerialgroup_addmaterial(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const char * pName, const sLib3MFColor * pDisplayColor, Lib3MF_uint32 * pPropertyID) +{ + IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "AddMaterial"); + pJournalEntry->addStringParameter("Name", pName); + } + if (pName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pPropertyID == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(pName); + IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); + if (!pIBaseMaterialGroup) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pPropertyID = pIBaseMaterialGroup->AddMaterial(sName, *pDisplayColor); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("PropertyID", *pPropertyID); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_basematerialgroup_removematerial(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID) +{ + IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "RemoveMaterial"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + } + IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); + if (!pIBaseMaterialGroup) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBaseMaterialGroup->RemoveMaterial(nPropertyID); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_basematerialgroup_getname(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) +{ + IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "GetName"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + } + if ( (!pNameBuffer) && !(pNameNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(""); + IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); + if (!pIBaseMaterialGroup) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + bool isCacheCall = (pNameBuffer == nullptr); + if (isCacheCall) { + sName = pIBaseMaterialGroup->GetName(nPropertyID); + + pIBaseMaterialGroup->_setCache (new ParameterCache_1 (sName)); + } + else { + auto cache = dynamic_cast*> (pIBaseMaterialGroup->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sName); + pIBaseMaterialGroup->_setCache (nullptr); + } + + if (pNameNeededChars) + *pNameNeededChars = (Lib3MF_uint32) (sName.size()+1); + if (pNameBuffer) { + if (sName.size() >= nNameBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iName = 0; iName < sName.size(); iName++) + pNameBuffer[iName] = sName[iName]; + pNameBuffer[sName.size()] = 0; + } + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("Name", sName.c_str()); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_basematerialgroup_setname(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const char * pName) +{ + IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "SetName"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry->addStringParameter("Name", pName); + } + if (pName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(pName); + IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); + if (!pIBaseMaterialGroup) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBaseMaterialGroup->SetName(nPropertyID, sName); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_basematerialgroup_setdisplaycolor(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor) +{ + IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "SetDisplayColor"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + } + IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); + if (!pIBaseMaterialGroup) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIBaseMaterialGroup->SetDisplayColor(nPropertyID, *pTheColor); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_basematerialgroup_getdisplaycolor(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor) +{ + IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "GetDisplayColor"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + } + if (pTheColor == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); + if (!pIBaseMaterialGroup) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pTheColor = pIBaseMaterialGroup->GetDisplayColor(nPropertyID); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + + +/************************************************************************************************************************* + Class implementation for ColorGroup +**************************************************************************************************************************/ +Lib3MFResult lib3mf_colorgroup_getcount(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 * pCount) +{ + IBase* pIBaseClass = (IBase *)pColorGroup; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroup, "ColorGroup", "GetCount"); + } + if (pCount == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IColorGroup* pIColorGroup = dynamic_cast(pIBaseClass); + if (!pIColorGroup) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pCount = pIColorGroup->GetCount(); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("Count", *pCount); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_colorgroup_getallpropertyids(Lib3MF_ColorGroup pColorGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) +{ + IBase* pIBaseClass = (IBase *)pColorGroup; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroup, "ColorGroup", "GetAllPropertyIDs"); + } + if ((!pPropertyIDsBuffer) && !(pPropertyIDsNeededCount)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IColorGroup* pIColorGroup = dynamic_cast(pIBaseClass); + if (!pIColorGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pNewIndex = pIMeshObject->AddVertex(*pCoordinates); + pIColorGroup->GetAllPropertyIDs(nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("NewIndex", *pNewIndex); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -3602,24 +8377,25 @@ Lib3MFResult lib3mf_meshobject_addvertex(Lib3MF_MeshObject pMeshObject, const sL } } -Lib3MFResult lib3mf_meshobject_getvertices(Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, sLib3MFPosition * pVerticesBuffer) +Lib3MFResult lib3mf_colorgroup_addcolor(Lib3MF_ColorGroup pColorGroup, const sLib3MFColor * pTheColor, Lib3MF_uint32 * pPropertyID) { - IBase* pIBaseClass = (IBase *)pMeshObject; + IBase* pIBaseClass = (IBase *)pColorGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "GetVertices"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroup, "ColorGroup", "AddColor"); } - if ((!pVerticesBuffer) && !(pVerticesNeededCount)) + if (pPropertyID == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); - if (!pIMeshObject) + IColorGroup* pIColorGroup = dynamic_cast(pIBaseClass); + if (!pIColorGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMeshObject->GetVertices(nVerticesBufferSize, pVerticesNeededCount, pVerticesBuffer); + *pPropertyID = pIColorGroup->AddColor(*pTheColor); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("PropertyID", *pPropertyID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -3635,23 +8411,87 @@ Lib3MFResult lib3mf_meshobject_getvertices(Lib3MF_MeshObject pMeshObject, const } } -Lib3MFResult lib3mf_meshobject_gettriangle(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFTriangle * pIndices) +Lib3MFResult lib3mf_colorgroup_removecolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID) { - IBase* pIBaseClass = (IBase *)pMeshObject; + IBase* pIBaseClass = (IBase *)pColorGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "GetTriangle"); - pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroup, "ColorGroup", "RemoveColor"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); } - if (pIndices == nullptr) + IColorGroup* pIColorGroup = dynamic_cast(pIBaseClass); + if (!pIColorGroup) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIColorGroup->RemoveColor(nPropertyID); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_colorgroup_setcolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor) +{ + IBase* pIBaseClass = (IBase *)pColorGroup; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroup, "ColorGroup", "SetColor"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + } + IColorGroup* pIColorGroup = dynamic_cast(pIBaseClass); + if (!pIColorGroup) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pIColorGroup->SetColor(nPropertyID, *pTheColor); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_colorgroup_getcolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor) +{ + IBase* pIBaseClass = (IBase *)pColorGroup; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroup, "ColorGroup", "GetColor"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + } + if (pTheColor == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); - if (!pIMeshObject) + IColorGroup* pIColorGroup = dynamic_cast(pIBaseClass); + if (!pIColorGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pIndices = pIMeshObject->GetTriangle(nIndex); + *pTheColor = pIColorGroup->GetColor(nPropertyID); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -3669,23 +8509,29 @@ Lib3MFResult lib3mf_meshobject_gettriangle(Lib3MF_MeshObject pMeshObject, Lib3MF } } -Lib3MFResult lib3mf_meshobject_settriangle(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFTriangle * pIndices) + +/************************************************************************************************************************* + Class implementation for Texture2DGroup +**************************************************************************************************************************/ +Lib3MFResult lib3mf_texture2dgroup_getcount(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 * pCount) { - IBase* pIBaseClass = (IBase *)pMeshObject; + IBase* pIBaseClass = (IBase *)pTexture2DGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "SetTriangle"); - pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroup, "Texture2DGroup", "GetCount"); } - IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); - if (!pIMeshObject) + if (pCount == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + ITexture2DGroup* pITexture2DGroup = dynamic_cast(pIBaseClass); + if (!pITexture2DGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMeshObject->SetTriangle(nIndex, *pIndices); + *pCount = pITexture2DGroup->GetCount(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -3701,25 +8547,24 @@ Lib3MFResult lib3mf_meshobject_settriangle(Lib3MF_MeshObject pMeshObject, Lib3MF } } -Lib3MFResult lib3mf_meshobject_addtriangle(Lib3MF_MeshObject pMeshObject, const sLib3MFTriangle * pIndices, Lib3MF_uint32 * pNewIndex) +Lib3MFResult lib3mf_texture2dgroup_getallpropertyids(Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) { - IBase* pIBaseClass = (IBase *)pMeshObject; + IBase* pIBaseClass = (IBase *)pTexture2DGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "AddTriangle"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroup, "Texture2DGroup", "GetAllPropertyIDs"); } - if (pNewIndex == nullptr) + if ((!pPropertyIDsBuffer) && !(pPropertyIDsNeededCount)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); - if (!pIMeshObject) + ITexture2DGroup* pITexture2DGroup = dynamic_cast(pIBaseClass); + if (!pITexture2DGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pNewIndex = pIMeshObject->AddTriangle(*pIndices); + pITexture2DGroup->GetAllPropertyIDs(nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("NewIndex", *pNewIndex); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -3735,24 +8580,25 @@ Lib3MFResult lib3mf_meshobject_addtriangle(Lib3MF_MeshObject pMeshObject, const } } -Lib3MFResult lib3mf_meshobject_gettriangleindices(Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, sLib3MFTriangle * pIndicesBuffer) +Lib3MFResult lib3mf_texture2dgroup_addtex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, const sLib3MFTex2Coord * pUVCoordinate, Lib3MF_uint32 * pPropertyID) { - IBase* pIBaseClass = (IBase *)pMeshObject; + IBase* pIBaseClass = (IBase *)pTexture2DGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "GetTriangleIndices"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroup, "Texture2DGroup", "AddTex2Coord"); } - if ((!pIndicesBuffer) && !(pIndicesNeededCount)) + if (pPropertyID == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); - if (!pIMeshObject) + ITexture2DGroup* pITexture2DGroup = dynamic_cast(pIBaseClass); + if (!pITexture2DGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMeshObject->GetTriangleIndices(nIndicesBufferSize, pIndicesNeededCount, pIndicesBuffer); + *pPropertyID = pITexture2DGroup->AddTex2Coord(*pUVCoordinate); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("PropertyID", *pPropertyID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -3768,22 +8614,23 @@ Lib3MFResult lib3mf_meshobject_gettriangleindices(Lib3MF_MeshObject pMeshObject, } } -Lib3MFResult lib3mf_meshobject_setobjectlevelproperty(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nUniqueResourceID, Lib3MF_uint32 nPropertyID) +Lib3MFResult lib3mf_texture2dgroup_gettex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID, sLib3MFTex2Coord * pUVCoordinate) { - IBase* pIBaseClass = (IBase *)pMeshObject; + IBase* pIBaseClass = (IBase *)pTexture2DGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "SetObjectLevelProperty"); - pJournalEntry->addUInt32Parameter("UniqueResourceID", nUniqueResourceID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroup, "Texture2DGroup", "GetTex2Coord"); pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); } - IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); - if (!pIMeshObject) + if (pUVCoordinate == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + ITexture2DGroup* pITexture2DGroup = dynamic_cast(pIBaseClass); + if (!pITexture2DGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMeshObject->SetObjectLevelProperty(nUniqueResourceID, nPropertyID); + *pUVCoordinate = pITexture2DGroup->GetTex2Coord(nPropertyID); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -3801,31 +8648,59 @@ Lib3MFResult lib3mf_meshobject_setobjectlevelproperty(Lib3MF_MeshObject pMeshObj } } -Lib3MFResult lib3mf_meshobject_getobjectlevelproperty(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 * pUniqueResourceID, Lib3MF_uint32 * pPropertyID, bool * pHasObjectLevelProperty) +Lib3MFResult lib3mf_texture2dgroup_removetex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID) { - IBase* pIBaseClass = (IBase *)pMeshObject; + IBase* pIBaseClass = (IBase *)pTexture2DGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "GetObjectLevelProperty"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroup, "Texture2DGroup", "RemoveTex2Coord"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); } - if (!pUniqueResourceID) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (!pPropertyID) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (pHasObjectLevelProperty == nullptr) + ITexture2DGroup* pITexture2DGroup = dynamic_cast(pIBaseClass); + if (!pITexture2DGroup) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pITexture2DGroup->RemoveTex2Coord(nPropertyID); + + if (pJournalEntry.get() != nullptr) { + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_texture2dgroup_gettexture2d(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_Texture2D * pTexture2DInstance) +{ + IBase* pIBaseClass = (IBase *)pTexture2DGroup; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroup, "Texture2DGroup", "GetTexture2D"); + } + if (pTexture2DInstance == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); - if (!pIMeshObject) + IBase* pBaseTexture2DInstance(nullptr); + ITexture2DGroup* pITexture2DGroup = dynamic_cast(pIBaseClass); + if (!pITexture2DGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pHasObjectLevelProperty = pIMeshObject->GetObjectLevelProperty(*pUniqueResourceID, *pPropertyID); + pBaseTexture2DInstance = pITexture2DGroup->GetTexture2D(); + *pTexture2DInstance = (IBase*)(pBaseTexture2DInstance); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("UniqueResourceID", *pUniqueResourceID); - pJournalEntry->addUInt32Result("PropertyID", *pPropertyID); - pJournalEntry->addBooleanResult("HasObjectLevelProperty", *pHasObjectLevelProperty); + pJournalEntry->addHandleResult("Texture2DInstance", *pTexture2DInstance); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -3841,23 +8716,29 @@ Lib3MFResult lib3mf_meshobject_getobjectlevelproperty(Lib3MF_MeshObject pMeshObj } } -Lib3MFResult lib3mf_meshobject_settriangleproperties(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, const sLib3MFTriangleProperties * pProperties) + +/************************************************************************************************************************* + Class implementation for CompositeMaterials +**************************************************************************************************************************/ +Lib3MFResult lib3mf_compositematerials_getcount(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 * pCount) { - IBase* pIBaseClass = (IBase *)pMeshObject; + IBase* pIBaseClass = (IBase *)pCompositeMaterials; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "SetTriangleProperties"); - pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterials, "CompositeMaterials", "GetCount"); } - IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); - if (!pIMeshObject) + if (pCount == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + ICompositeMaterials* pICompositeMaterials = dynamic_cast(pIBaseClass); + if (!pICompositeMaterials) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMeshObject->SetTriangleProperties(nIndex, *pProperties); + *pCount = pICompositeMaterials->GetCount(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -3873,23 +8754,22 @@ Lib3MFResult lib3mf_meshobject_settriangleproperties(Lib3MF_MeshObject pMeshObje } } -Lib3MFResult lib3mf_meshobject_gettriangleproperties(Lib3MF_MeshObject pMeshObject, Lib3MF_uint32 nIndex, sLib3MFTriangleProperties * pProperty) +Lib3MFResult lib3mf_compositematerials_getallpropertyids(Lib3MF_CompositeMaterials pCompositeMaterials, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) { - IBase* pIBaseClass = (IBase *)pMeshObject; + IBase* pIBaseClass = (IBase *)pCompositeMaterials; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "GetTriangleProperties"); - pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterials, "CompositeMaterials", "GetAllPropertyIDs"); } - if (!pProperty) + if ((!pPropertyIDsBuffer) && !(pPropertyIDsNeededCount)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); - if (!pIMeshObject) + ICompositeMaterials* pICompositeMaterials = dynamic_cast(pIBaseClass); + if (!pICompositeMaterials) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMeshObject->GetTriangleProperties(nIndex, *pProperty); + pICompositeMaterials->GetAllPropertyIDs(nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -3907,24 +8787,27 @@ Lib3MFResult lib3mf_meshobject_gettriangleproperties(Lib3MF_MeshObject pMeshObje } } -Lib3MFResult lib3mf_meshobject_setalltriangleproperties(Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nPropertiesArrayBufferSize, const sLib3MFTriangleProperties * pPropertiesArrayBuffer) +Lib3MFResult lib3mf_compositematerials_getbasematerialgroup(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance) { - IBase* pIBaseClass = (IBase *)pMeshObject; + IBase* pIBaseClass = (IBase *)pCompositeMaterials; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "SetAllTriangleProperties"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterials, "CompositeMaterials", "GetBaseMaterialGroup"); } - if ( (!pPropertiesArrayBuffer) && (nPropertiesArrayBufferSize>0)) + if (pBaseMaterialGroupInstance == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); - if (!pIMeshObject) + IBase* pBaseBaseMaterialGroupInstance(nullptr); + ICompositeMaterials* pICompositeMaterials = dynamic_cast(pIBaseClass); + if (!pICompositeMaterials) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMeshObject->SetAllTriangleProperties(nPropertiesArrayBufferSize, pPropertiesArrayBuffer); + pBaseBaseMaterialGroupInstance = pICompositeMaterials->GetBaseMaterialGroup(); + *pBaseMaterialGroupInstance = (IBase*)(pBaseBaseMaterialGroupInstance); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("BaseMaterialGroupInstance", *pBaseMaterialGroupInstance); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -3940,24 +8823,27 @@ Lib3MFResult lib3mf_meshobject_setalltriangleproperties(Lib3MF_MeshObject pMeshO } } -Lib3MFResult lib3mf_meshobject_getalltriangleproperties(Lib3MF_MeshObject pMeshObject, const Lib3MF_uint64 nPropertiesArrayBufferSize, Lib3MF_uint64* pPropertiesArrayNeededCount, sLib3MFTriangleProperties * pPropertiesArrayBuffer) +Lib3MFResult lib3mf_compositematerials_addcomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint64 nCompositeBufferSize, const sLib3MFCompositeConstituent * pCompositeBuffer, Lib3MF_uint32 * pPropertyID) { - IBase* pIBaseClass = (IBase *)pMeshObject; + IBase* pIBaseClass = (IBase *)pCompositeMaterials; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "GetAllTriangleProperties"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterials, "CompositeMaterials", "AddComposite"); } - if ((!pPropertiesArrayBuffer) && !(pPropertiesArrayNeededCount)) + if ( (!pCompositeBuffer) && (nCompositeBufferSize>0)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); - if (!pIMeshObject) + if (pPropertyID == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + ICompositeMaterials* pICompositeMaterials = dynamic_cast(pIBaseClass); + if (!pICompositeMaterials) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMeshObject->GetAllTriangleProperties(nPropertiesArrayBufferSize, pPropertiesArrayNeededCount, pPropertiesArrayBuffer); + *pPropertyID = pICompositeMaterials->AddComposite(nCompositeBufferSize, pCompositeBuffer); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("PropertyID", *pPropertyID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -3973,20 +8859,21 @@ Lib3MFResult lib3mf_meshobject_getalltriangleproperties(Lib3MF_MeshObject pMeshO } } -Lib3MFResult lib3mf_meshobject_clearallproperties(Lib3MF_MeshObject pMeshObject) +Lib3MFResult lib3mf_compositematerials_removecomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID) { - IBase* pIBaseClass = (IBase *)pMeshObject; + IBase* pIBaseClass = (IBase *)pCompositeMaterials; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "ClearAllProperties"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterials, "CompositeMaterials", "RemoveComposite"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); } - IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); - if (!pIMeshObject) + ICompositeMaterials* pICompositeMaterials = dynamic_cast(pIBaseClass); + if (!pICompositeMaterials) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMeshObject->ClearAllProperties(); + pICompositeMaterials->RemoveComposite(nPropertyID); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -4004,24 +8891,23 @@ Lib3MFResult lib3mf_meshobject_clearallproperties(Lib3MF_MeshObject pMeshObject) } } -Lib3MFResult lib3mf_meshobject_setgeometry(Lib3MF_MeshObject pMeshObject, Lib3MF_uint64 nVerticesBufferSize, const sLib3MFPosition * pVerticesBuffer, Lib3MF_uint64 nIndicesBufferSize, const sLib3MFTriangle * pIndicesBuffer) +Lib3MFResult lib3mf_compositematerials_getcomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nCompositeBufferSize, Lib3MF_uint64* pCompositeNeededCount, sLib3MFCompositeConstituent * pCompositeBuffer) { - IBase* pIBaseClass = (IBase *)pMeshObject; + IBase* pIBaseClass = (IBase *)pCompositeMaterials; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "SetGeometry"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterials, "CompositeMaterials", "GetComposite"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); } - if ( (!pVerticesBuffer) && (nVerticesBufferSize>0)) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if ( (!pIndicesBuffer) && (nIndicesBufferSize>0)) + if ((!pCompositeBuffer) && !(pCompositeNeededCount)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); - if (!pIMeshObject) + ICompositeMaterials* pICompositeMaterials = dynamic_cast(pIBaseClass); + if (!pICompositeMaterials) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMeshObject->SetGeometry(nVerticesBufferSize, pVerticesBuffer, nIndicesBufferSize, pIndicesBuffer); + pICompositeMaterials->GetComposite(nPropertyID, nCompositeBufferSize, pCompositeNeededCount, pCompositeBuffer); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -4039,25 +8925,29 @@ Lib3MFResult lib3mf_meshobject_setgeometry(Lib3MF_MeshObject pMeshObject, Lib3MF } } -Lib3MFResult lib3mf_meshobject_ismanifoldandoriented(Lib3MF_MeshObject pMeshObject, bool * pIsManifoldAndOriented) + +/************************************************************************************************************************* + Class implementation for MultiPropertyGroup +**************************************************************************************************************************/ +Lib3MFResult lib3mf_multipropertygroup_getcount(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount) { - IBase* pIBaseClass = (IBase *)pMeshObject; + IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "IsManifoldAndOriented"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "GetCount"); } - if (pIsManifoldAndOriented == nullptr) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); - if (!pIMeshObject) + IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); + if (!pIMultiPropertyGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pIsManifoldAndOriented = pIMeshObject->IsManifoldAndOriented(); + *pCount = pIMultiPropertyGroup->GetCount(); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addBooleanResult("IsManifoldAndOriented", *pIsManifoldAndOriented); + pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -4073,27 +8963,24 @@ Lib3MFResult lib3mf_meshobject_ismanifoldandoriented(Lib3MF_MeshObject pMeshObje } } -Lib3MFResult lib3mf_meshobject_beamlattice(Lib3MF_MeshObject pMeshObject, Lib3MF_BeamLattice * pTheBeamLattice) +Lib3MFResult lib3mf_multipropertygroup_getallpropertyids(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) { - IBase* pIBaseClass = (IBase *)pMeshObject; + IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMeshObject, "MeshObject", "BeamLattice"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "GetAllPropertyIDs"); } - if (pTheBeamLattice == nullptr) + if ((!pPropertyIDsBuffer) && !(pPropertyIDsNeededCount)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseTheBeamLattice(nullptr); - IMeshObject* pIMeshObject = dynamic_cast(pIBaseClass); - if (!pIMeshObject) + IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); + if (!pIMultiPropertyGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseTheBeamLattice = pIMeshObject->BeamLattice(); + pIMultiPropertyGroup->GetAllPropertyIDs(nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); - *pTheBeamLattice = (IBase*)(pBaseTheBeamLattice); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("TheBeamLattice", *pTheBeamLattice); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -4109,29 +8996,27 @@ Lib3MFResult lib3mf_meshobject_beamlattice(Lib3MF_MeshObject pMeshObject, Lib3MF } } - -/************************************************************************************************************************* - Class implementation for BeamLattice -**************************************************************************************************************************/ -Lib3MFResult lib3mf_beamlattice_getminlength(Lib3MF_BeamLattice pBeamLattice, Lib3MF_double * pMinLength) +Lib3MFResult lib3mf_multipropertygroup_addmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer, Lib3MF_uint32 * pPropertyID) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetMinLength"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "AddMultiProperty"); } - if (pMinLength == nullptr) + if ( (!pPropertyIDsBuffer) && (nPropertyIDsBufferSize>0)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + if (pPropertyID == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); + if (!pIMultiPropertyGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pMinLength = pIBeamLattice->GetMinLength(); + *pPropertyID = pIMultiPropertyGroup->AddMultiProperty(nPropertyIDsBufferSize, pPropertyIDsBuffer); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addDoubleResult("MinLength", *pMinLength); + pJournalEntry->addUInt32Result("PropertyID", *pPropertyID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -4147,21 +9032,23 @@ Lib3MFResult lib3mf_beamlattice_getminlength(Lib3MF_BeamLattice pBeamLattice, Li } } -Lib3MFResult lib3mf_beamlattice_setminlength(Lib3MF_BeamLattice pBeamLattice, Lib3MF_double dMinLength) +Lib3MFResult lib3mf_multipropertygroup_setmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetMinLength"); - pJournalEntry->addDoubleParameter("MinLength", dMinLength); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "SetMultiProperty"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); } - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + if ( (!pPropertyIDsBuffer) && (nPropertyIDsBufferSize>0)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); + if (!pIMultiPropertyGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamLattice->SetMinLength(dMinLength); + pIMultiPropertyGroup->SetMultiProperty(nPropertyID, nPropertyIDsBufferSize, pPropertyIDsBuffer); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -4179,28 +9066,25 @@ Lib3MFResult lib3mf_beamlattice_setminlength(Lib3MF_BeamLattice pBeamLattice, Li } } -Lib3MFResult lib3mf_beamlattice_getclipping(Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode * pClipMode, Lib3MF_uint32 * pUniqueResourceID) +Lib3MFResult lib3mf_multipropertygroup_getmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetClipping"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "GetMultiProperty"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); } - if (!pClipMode) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (!pUniqueResourceID) + if ((!pPropertyIDsBuffer) && !(pPropertyIDsNeededCount)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); + if (!pIMultiPropertyGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamLattice->GetClipping(*pClipMode, *pUniqueResourceID); + pIMultiPropertyGroup->GetMultiProperty(nPropertyID, nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addEnumResult("ClipMode", "BeamLatticeClipMode", (Lib3MF_int32)(*pClipMode)); - pJournalEntry->addUInt32Result("UniqueResourceID", *pUniqueResourceID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -4216,22 +9100,21 @@ Lib3MFResult lib3mf_beamlattice_getclipping(Lib3MF_BeamLattice pBeamLattice, eLi } } -Lib3MFResult lib3mf_beamlattice_setclipping(Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeClipMode eClipMode, Lib3MF_uint32 nUniqueResourceID) +Lib3MFResult lib3mf_multipropertygroup_removemultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetClipping"); - pJournalEntry->addEnumParameter("ClipMode", "BeamLatticeClipMode", (Lib3MF_int32)(eClipMode)); - pJournalEntry->addUInt32Parameter("UniqueResourceID", nUniqueResourceID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "RemoveMultiProperty"); + pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); } - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); + if (!pIMultiPropertyGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamLattice->SetClipping(eClipMode, nUniqueResourceID); + pIMultiPropertyGroup->RemoveMultiProperty(nPropertyID); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -4249,28 +9132,25 @@ Lib3MFResult lib3mf_beamlattice_setclipping(Lib3MF_BeamLattice pBeamLattice, eLi } } -Lib3MFResult lib3mf_beamlattice_getrepresentation(Lib3MF_BeamLattice pBeamLattice, bool * pHasRepresentation, Lib3MF_uint32 * pUniqueResourceID) +Lib3MFResult lib3mf_multipropertygroup_getlayercount(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetRepresentation"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "GetLayerCount"); } - if (pHasRepresentation == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (!pUniqueResourceID) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); + if (!pIMultiPropertyGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pHasRepresentation = pIBeamLattice->GetRepresentation(*pUniqueResourceID); + *pCount = pIMultiPropertyGroup->GetLayerCount(); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addBooleanResult("HasRepresentation", *pHasRepresentation); - pJournalEntry->addUInt32Result("UniqueResourceID", *pUniqueResourceID); + pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -4286,23 +9166,25 @@ Lib3MFResult lib3mf_beamlattice_getrepresentation(Lib3MF_BeamLattice pBeamLattic } } -Lib3MFResult lib3mf_beamlattice_setrepresentation(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nUniqueResourceID) +Lib3MFResult lib3mf_multipropertygroup_addlayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const sLib3MFMultiPropertyLayer * pTheLayer, Lib3MF_uint32 * pLayerIndex) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetRepresentation"); - pJournalEntry->addUInt32Parameter("UniqueResourceID", nUniqueResourceID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "AddLayer"); } - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + if (pLayerIndex == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); + if (!pIMultiPropertyGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamLattice->SetRepresentation(nUniqueResourceID); + *pLayerIndex = pIMultiPropertyGroup->AddLayer(*pTheLayer); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("LayerIndex", *pLayerIndex); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -4318,28 +9200,25 @@ Lib3MFResult lib3mf_beamlattice_setrepresentation(Lib3MF_BeamLattice pBeamLattic } } -Lib3MFResult lib3mf_beamlattice_getballoptions(Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode * pBallMode, Lib3MF_double * pBallRadius) +Lib3MFResult lib3mf_multipropertygroup_getlayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex, sLib3MFMultiPropertyLayer * pTheLayer) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBallOptions"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "GetLayer"); + pJournalEntry->addUInt32Parameter("LayerIndex", nLayerIndex); } - if (!pBallMode) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (!pBallRadius) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + if (pTheLayer == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); + if (!pIMultiPropertyGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamLattice->GetBallOptions(*pBallMode, *pBallRadius); + *pTheLayer = pIMultiPropertyGroup->GetLayer(nLayerIndex); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addEnumResult("BallMode", "BeamLatticeBallMode", (Lib3MF_int32)(*pBallMode)); - pJournalEntry->addDoubleResult("BallRadius", *pBallRadius); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -4355,22 +9234,21 @@ Lib3MFResult lib3mf_beamlattice_getballoptions(Lib3MF_BeamLattice pBeamLattice, } } -Lib3MFResult lib3mf_beamlattice_setballoptions(Lib3MF_BeamLattice pBeamLattice, eLib3MFBeamLatticeBallMode eBallMode, Lib3MF_double dBallRadius) +Lib3MFResult lib3mf_multipropertygroup_removelayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetBallOptions"); - pJournalEntry->addEnumParameter("BallMode", "BeamLatticeBallMode", (Lib3MF_int32)(eBallMode)); - pJournalEntry->addDoubleParameter("BallRadius", dBallRadius); + pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "RemoveLayer"); + pJournalEntry->addUInt32Parameter("LayerIndex", nLayerIndex); } - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); + if (!pIMultiPropertyGroup) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamLattice->SetBallOptions(eBallMode, dBallRadius); + pIMultiPropertyGroup->RemoveLayer(nLayerIndex); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -4388,25 +9266,51 @@ Lib3MFResult lib3mf_beamlattice_setballoptions(Lib3MF_BeamLattice pBeamLattice, } } -Lib3MFResult lib3mf_beamlattice_getbeamcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount) + +/************************************************************************************************************************* + Class implementation for Attachment +**************************************************************************************************************************/ +Lib3MFResult lib3mf_attachment_getpath(Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pAttachment; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBeamCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "GetPath"); } - if (pCount == nullptr) + if ( (!pPathBuffer) && !(pPathNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + std::string sPath(""); + IAttachment* pIAttachment = dynamic_cast(pIBaseClass); + if (!pIAttachment) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pIBeamLattice->GetBeamCount(); + bool isCacheCall = (pPathBuffer == nullptr); + if (isCacheCall) { + sPath = pIAttachment->GetPath(); + pIAttachment->_setCache (new ParameterCache_1 (sPath)); + } + else { + auto cache = dynamic_cast*> (pIAttachment->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sPath); + pIAttachment->_setCache (nullptr); + } + + if (pPathNeededChars) + *pPathNeededChars = (Lib3MF_uint32) (sPath.size()+1); + if (pPathBuffer) { + if (sPath.size() >= nPathBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iPath = 0; iPath < sPath.size(); iPath++) + pPathBuffer[iPath] = sPath[iPath]; + pPathBuffer[sPath.size()] = 0; + } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); + pJournalEntry->addStringResult("Path", sPath.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -4422,23 +9326,24 @@ Lib3MFResult lib3mf_beamlattice_getbeamcount(Lib3MF_BeamLattice pBeamLattice, Li } } -Lib3MFResult lib3mf_beamlattice_getbeam(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBeam * pBeamInfo) +Lib3MFResult lib3mf_attachment_setpath(Lib3MF_Attachment pAttachment, const char * pPath) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pAttachment; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBeam"); - pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "SetPath"); + pJournalEntry->addStringParameter("Path", pPath); } - if (pBeamInfo == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + if (pPath == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sPath(pPath); + IAttachment* pIAttachment = dynamic_cast(pIBaseClass); + if (!pIAttachment) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pBeamInfo = pIBeamLattice->GetBeam(nIndex); + pIAttachment->SetPath(sPath); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -4456,25 +9361,27 @@ Lib3MFResult lib3mf_beamlattice_getbeam(Lib3MF_BeamLattice pBeamLattice, Lib3MF_ } } -Lib3MFResult lib3mf_beamlattice_addbeam(Lib3MF_BeamLattice pBeamLattice, const sLib3MFBeam * pBeamInfo, Lib3MF_uint32 * pIndex) +Lib3MFResult lib3mf_attachment_packagepart(Lib3MF_Attachment pAttachment, Lib3MF_PackagePart * pPackagePart) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pAttachment; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "AddBeam"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "PackagePart"); } - if (pIndex == nullptr) + if (pPackagePart == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + IBase* pBasePackagePart(nullptr); + IAttachment* pIAttachment = dynamic_cast(pIBaseClass); + if (!pIAttachment) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pIndex = pIBeamLattice->AddBeam(*pBeamInfo); + pBasePackagePart = pIAttachment->PackagePart(); + *pPackagePart = (IBase*)(pBasePackagePart); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Index", *pIndex); + pJournalEntry->addHandleResult("PackagePart", *pPackagePart); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -4490,23 +9397,47 @@ Lib3MFResult lib3mf_beamlattice_addbeam(Lib3MF_BeamLattice pBeamLattice, const s } } -Lib3MFResult lib3mf_beamlattice_setbeam(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBeam * pBeamInfo) +Lib3MFResult lib3mf_attachment_getrelationshiptype(Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pAttachment; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetBeam"); - pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "GetRelationShipType"); } - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + if ( (!pPathBuffer) && !(pPathNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sPath(""); + IAttachment* pIAttachment = dynamic_cast(pIBaseClass); + if (!pIAttachment) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamLattice->SetBeam(nIndex, *pBeamInfo); + bool isCacheCall = (pPathBuffer == nullptr); + if (isCacheCall) { + sPath = pIAttachment->GetRelationShipType(); + pIAttachment->_setCache (new ParameterCache_1 (sPath)); + } + else { + auto cache = dynamic_cast*> (pIAttachment->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sPath); + pIAttachment->_setCache (nullptr); + } + + if (pPathNeededChars) + *pPathNeededChars = (Lib3MF_uint32) (sPath.size()+1); + if (pPathBuffer) { + if (sPath.size() >= nPathBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iPath = 0; iPath < sPath.size(); iPath++) + pPathBuffer[iPath] = sPath[iPath]; + pPathBuffer[sPath.size()] = 0; + } if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("Path", sPath.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -4522,22 +9453,24 @@ Lib3MFResult lib3mf_beamlattice_setbeam(Lib3MF_BeamLattice pBeamLattice, Lib3MF_ } } -Lib3MFResult lib3mf_beamlattice_setbeams(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBeamInfoBufferSize, const sLib3MFBeam * pBeamInfoBuffer) +Lib3MFResult lib3mf_attachment_setrelationshiptype(Lib3MF_Attachment pAttachment, const char * pPath) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pAttachment; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetBeams"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "SetRelationShipType"); + pJournalEntry->addStringParameter("Path", pPath); } - if ( (!pBeamInfoBuffer) && (nBeamInfoBufferSize>0)) + if (pPath == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + std::string sPath(pPath); + IAttachment* pIAttachment = dynamic_cast(pIBaseClass); + if (!pIAttachment) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamLattice->SetBeams(nBeamInfoBufferSize, pBeamInfoBuffer); + pIAttachment->SetRelationShipType(sPath); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -4555,22 +9488,24 @@ Lib3MFResult lib3mf_beamlattice_setbeams(Lib3MF_BeamLattice pBeamLattice, Lib3MF } } -Lib3MFResult lib3mf_beamlattice_getbeams(Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBeamInfoBufferSize, Lib3MF_uint64* pBeamInfoNeededCount, sLib3MFBeam * pBeamInfoBuffer) +Lib3MFResult lib3mf_attachment_writetofile(Lib3MF_Attachment pAttachment, const char * pFileName) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pAttachment; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBeams"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "WriteToFile"); + pJournalEntry->addStringParameter("FileName", pFileName); } - if ((!pBeamInfoBuffer) && !(pBeamInfoNeededCount)) + if (pFileName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + std::string sFileName(pFileName); + IAttachment* pIAttachment = dynamic_cast(pIBaseClass); + if (!pIAttachment) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamLattice->GetBeams(nBeamInfoBufferSize, pBeamInfoNeededCount, pBeamInfoBuffer); + pIAttachment->WriteToFile(sFileName); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -4588,25 +9523,26 @@ Lib3MFResult lib3mf_beamlattice_getbeams(Lib3MF_BeamLattice pBeamLattice, const } } -Lib3MFResult lib3mf_beamlattice_getballcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount) +Lib3MFResult lib3mf_attachment_readfromfile(Lib3MF_Attachment pAttachment, const char * pFileName) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pAttachment; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBallCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "ReadFromFile"); + pJournalEntry->addStringParameter("FileName", pFileName); } - if (pCount == nullptr) + if (pFileName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + std::string sFileName(pFileName); + IAttachment* pIAttachment = dynamic_cast(pIBaseClass); + if (!pIAttachment) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pIBeamLattice->GetBallCount(); + pIAttachment->ReadFromFile(sFileName); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -4622,23 +9558,22 @@ Lib3MFResult lib3mf_beamlattice_getballcount(Lib3MF_BeamLattice pBeamLattice, Li } } -Lib3MFResult lib3mf_beamlattice_getball(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, sLib3MFBall * pBallInfo) +Lib3MFResult lib3mf_attachment_readfromcallback(Lib3MF_Attachment pAttachment, Lib3MFReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MFSeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pAttachment; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBall"); - pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "ReadFromCallback"); + pJournalEntry->addUInt64Parameter("StreamSize", nStreamSize); + pJournalEntry->addPointerParameter("UserData", pUserData); } - if (pBallInfo == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + IAttachment* pIAttachment = dynamic_cast(pIBaseClass); + if (!pIAttachment) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pBallInfo = pIBeamLattice->GetBall(nIndex); + pIAttachment->ReadFromCallback(pTheReadCallback, nStreamSize, pTheSeekCallback, pUserData); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -4656,25 +9591,25 @@ Lib3MFResult lib3mf_beamlattice_getball(Lib3MF_BeamLattice pBeamLattice, Lib3MF_ } } -Lib3MFResult lib3mf_beamlattice_addball(Lib3MF_BeamLattice pBeamLattice, const sLib3MFBall * pBallInfo, Lib3MF_uint32 * pIndex) +Lib3MFResult lib3mf_attachment_getstreamsize(Lib3MF_Attachment pAttachment, Lib3MF_uint64 * pStreamSize) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pAttachment; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "AddBall"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "GetStreamSize"); } - if (pIndex == nullptr) + if (pStreamSize == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + IAttachment* pIAttachment = dynamic_cast(pIBaseClass); + if (!pIAttachment) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pIndex = pIBeamLattice->AddBall(*pBallInfo); + *pStreamSize = pIAttachment->GetStreamSize(); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Index", *pIndex); + pJournalEntry->addUInt64Result("StreamSize", *pStreamSize); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -4690,21 +9625,22 @@ Lib3MFResult lib3mf_beamlattice_addball(Lib3MF_BeamLattice pBeamLattice, const s } } -Lib3MFResult lib3mf_beamlattice_setball(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, const sLib3MFBall * pBallInfo) +Lib3MFResult lib3mf_attachment_writetobuffer(Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pAttachment; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetBall"); - pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "WriteToBuffer"); } - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + if ((!pBufferBuffer) && !(pBufferNeededCount)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IAttachment* pIAttachment = dynamic_cast(pIBaseClass); + if (!pIAttachment) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamLattice->SetBall(nIndex, *pBallInfo); + pIAttachment->WriteToBuffer(nBufferBufferSize, pBufferNeededCount, pBufferBuffer); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -4722,22 +9658,22 @@ Lib3MFResult lib3mf_beamlattice_setball(Lib3MF_BeamLattice pBeamLattice, Lib3MF_ } } -Lib3MFResult lib3mf_beamlattice_setballs(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint64 nBallInfoBufferSize, const sLib3MFBall * pBallInfoBuffer) +Lib3MFResult lib3mf_attachment_readfrombuffer(Lib3MF_Attachment pAttachment, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pAttachment; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "SetBalls"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "ReadFromBuffer"); } - if ( (!pBallInfoBuffer) && (nBallInfoBufferSize>0)) + if ( (!pBufferBuffer) && (nBufferBufferSize>0)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + IAttachment* pIAttachment = dynamic_cast(pIBaseClass); + if (!pIAttachment) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamLattice->SetBalls(nBallInfoBufferSize, pBallInfoBuffer); + pIAttachment->ReadFromBuffer(nBufferBufferSize, pBufferBuffer); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -4755,24 +9691,31 @@ Lib3MFResult lib3mf_beamlattice_setballs(Lib3MF_BeamLattice pBeamLattice, Lib3MF } } -Lib3MFResult lib3mf_beamlattice_getballs(Lib3MF_BeamLattice pBeamLattice, const Lib3MF_uint64 nBallInfoBufferSize, Lib3MF_uint64* pBallInfoNeededCount, sLib3MFBall * pBallInfoBuffer) + +/************************************************************************************************************************* + Class implementation for Texture2D +**************************************************************************************************************************/ +Lib3MFResult lib3mf_texture2d_getattachment(Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment * pAttachment) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pTexture2D; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBalls"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "GetAttachment"); } - if ((!pBallInfoBuffer) && !(pBallInfoNeededCount)) + if (pAttachment == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + IBase* pBaseAttachment(nullptr); + ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); + if (!pITexture2D) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamLattice->GetBalls(nBallInfoBufferSize, pBallInfoNeededCount, pBallInfoBuffer); + pBaseAttachment = pITexture2D->GetAttachment(); + *pAttachment = (IBase*)(pBaseAttachment); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Attachment", *pAttachment); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -4788,25 +9731,28 @@ Lib3MFResult lib3mf_beamlattice_getballs(Lib3MF_BeamLattice pBeamLattice, const } } -Lib3MFResult lib3mf_beamlattice_getbeamsetcount(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 * pCount) +Lib3MFResult lib3mf_texture2d_setattachment(Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment pAttachment) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pTexture2D; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBeamSetCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "SetAttachment"); + pJournalEntry->addHandleParameter("Attachment", pAttachment); } - if (pCount == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + IBase* pIBaseClassAttachment = (IBase *)pAttachment; + IAttachment* pIAttachment = dynamic_cast(pIBaseClassAttachment); + if (!pIAttachment) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); + + ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); + if (!pITexture2D) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pIBeamLattice->GetBeamSetCount(); + pITexture2D->SetAttachment(pIAttachment); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -4822,27 +9768,25 @@ Lib3MFResult lib3mf_beamlattice_getbeamsetcount(Lib3MF_BeamLattice pBeamLattice, } } -Lib3MFResult lib3mf_beamlattice_addbeamset(Lib3MF_BeamLattice pBeamLattice, Lib3MF_BeamSet * pBeamSet) +Lib3MFResult lib3mf_texture2d_getcontenttype(Lib3MF_Texture2D pTexture2D, eLib3MFTextureType * pContentType) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pTexture2D; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "AddBeamSet"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "GetContentType"); } - if (pBeamSet == nullptr) + if (pContentType == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseBeamSet(nullptr); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); + if (!pITexture2D) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseBeamSet = pIBeamLattice->AddBeamSet(); + *pContentType = pITexture2D->GetContentType(); - *pBeamSet = (IBase*)(pBaseBeamSet); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("BeamSet", *pBeamSet); + pJournalEntry->addEnumResult("ContentType", "TextureType", (Lib3MF_int32)(*pContentType)); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -4858,28 +9802,23 @@ Lib3MFResult lib3mf_beamlattice_addbeamset(Lib3MF_BeamLattice pBeamLattice, Lib3 } } -Lib3MFResult lib3mf_beamlattice_getbeamset(Lib3MF_BeamLattice pBeamLattice, Lib3MF_uint32 nIndex, Lib3MF_BeamSet * pBeamSet) +Lib3MFResult lib3mf_texture2d_setcontenttype(Lib3MF_Texture2D pTexture2D, eLib3MFTextureType eContentType) { - IBase* pIBaseClass = (IBase *)pBeamLattice; + IBase* pIBaseClass = (IBase *)pTexture2D; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamLattice, "BeamLattice", "GetBeamSet"); - pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "SetContentType"); + pJournalEntry->addEnumParameter("ContentType", "TextureType", (Lib3MF_int32)(eContentType)); } - if (pBeamSet == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseBeamSet(nullptr); - IBeamLattice* pIBeamLattice = dynamic_cast(pIBaseClass); - if (!pIBeamLattice) + ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); + if (!pITexture2D) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseBeamSet = pIBeamLattice->GetBeamSet(nIndex); + pITexture2D->SetContentType(eContentType); - *pBeamSet = (IBase*)(pBaseBeamSet); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("BeamSet", *pBeamSet); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -4895,31 +9834,28 @@ Lib3MFResult lib3mf_beamlattice_getbeamset(Lib3MF_BeamLattice pBeamLattice, Lib3 } } - -/************************************************************************************************************************* - Class implementation for Component -**************************************************************************************************************************/ -Lib3MFResult lib3mf_component_getobjectresource(Lib3MF_Component pComponent, Lib3MF_Object * pObjectResource) +Lib3MFResult lib3mf_texture2d_gettilestyleuv(Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle * pTileStyleU, eLib3MFTextureTileStyle * pTileStyleV) { - IBase* pIBaseClass = (IBase *)pComponent; + IBase* pIBaseClass = (IBase *)pTexture2D; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "GetObjectResource"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "GetTileStyleUV"); } - if (pObjectResource == nullptr) + if (!pTileStyleU) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseObjectResource(nullptr); - IComponent* pIComponent = dynamic_cast(pIBaseClass); - if (!pIComponent) + if (!pTileStyleV) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); + if (!pITexture2D) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseObjectResource = pIComponent->GetObjectResource(); + pITexture2D->GetTileStyleUV(*pTileStyleU, *pTileStyleV); - *pObjectResource = (IBase*)(pBaseObjectResource); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("ObjectResource", *pObjectResource); + pJournalEntry->addEnumResult("TileStyleU", "TextureTileStyle", (Lib3MF_int32)(*pTileStyleU)); + pJournalEntry->addEnumResult("TileStyleV", "TextureTileStyle", (Lib3MF_int32)(*pTileStyleV)); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -4935,25 +9871,24 @@ Lib3MFResult lib3mf_component_getobjectresource(Lib3MF_Component pComponent, Lib } } -Lib3MFResult lib3mf_component_getobjectresourceid(Lib3MF_Component pComponent, Lib3MF_uint32 * pUniqueResourceID) +Lib3MFResult lib3mf_texture2d_settilestyleuv(Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle eTileStyleU, eLib3MFTextureTileStyle eTileStyleV) { - IBase* pIBaseClass = (IBase *)pComponent; + IBase* pIBaseClass = (IBase *)pTexture2D; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "GetObjectResourceID"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "SetTileStyleUV"); + pJournalEntry->addEnumParameter("TileStyleU", "TextureTileStyle", (Lib3MF_int32)(eTileStyleU)); + pJournalEntry->addEnumParameter("TileStyleV", "TextureTileStyle", (Lib3MF_int32)(eTileStyleV)); } - if (pUniqueResourceID == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IComponent* pIComponent = dynamic_cast(pIBaseClass); - if (!pIComponent) + ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); + if (!pITexture2D) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pUniqueResourceID = pIComponent->GetObjectResourceID(); + pITexture2D->SetTileStyleUV(eTileStyleU, eTileStyleV); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("UniqueResourceID", *pUniqueResourceID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -4969,50 +9904,25 @@ Lib3MFResult lib3mf_component_getobjectresourceid(Lib3MF_Component pComponent, L } } -Lib3MFResult lib3mf_component_getuuid(Lib3MF_Component pComponent, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) +Lib3MFResult lib3mf_texture2d_getfilter(Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter * pFilter) { - IBase* pIBaseClass = (IBase *)pComponent; + IBase* pIBaseClass = (IBase *)pTexture2D; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "GetUUID"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "GetFilter"); } - if (!pHasUUID) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if ( (!pUUIDBuffer) && !(pUUIDNeededChars) ) + if (pFilter == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sUUID(""); - IComponent* pIComponent = dynamic_cast(pIBaseClass); - if (!pIComponent) + ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); + if (!pITexture2D) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pUUIDBuffer == nullptr); - if (isCacheCall) { - sUUID = pIComponent->GetUUID(*pHasUUID); + *pFilter = pITexture2D->GetFilter(); - pIComponent->_setCache (new ParameterCache_2 (*pHasUUID, sUUID)); - } - else { - auto cache = dynamic_cast*> (pIComponent->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (*pHasUUID, sUUID); - pIComponent->_setCache (nullptr); - } - - if (pUUIDNeededChars) - *pUUIDNeededChars = (Lib3MF_uint32) (sUUID.size()+1); - if (pUUIDBuffer) { - if (sUUID.size() >= nUUIDBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iUUID = 0; iUUID < sUUID.size(); iUUID++) - pUUIDBuffer[iUUID] = sUUID[iUUID]; - pUUIDBuffer[sUUID.size()] = 0; - } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addBooleanResult("HasUUID", *pHasUUID); - pJournalEntry->addStringResult("UUID", sUUID.c_str()); + pJournalEntry->addEnumResult("Filter", "TextureFilter", (Lib3MF_int32)(*pFilter)); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5028,24 +9938,21 @@ Lib3MFResult lib3mf_component_getuuid(Lib3MF_Component pComponent, bool * pHasUU } } -Lib3MFResult lib3mf_component_setuuid(Lib3MF_Component pComponent, const char * pUUID) +Lib3MFResult lib3mf_texture2d_setfilter(Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter eFilter) { - IBase* pIBaseClass = (IBase *)pComponent; + IBase* pIBaseClass = (IBase *)pTexture2D; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "SetUUID"); - pJournalEntry->addStringParameter("UUID", pUUID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "SetFilter"); + pJournalEntry->addEnumParameter("Filter", "TextureFilter", (Lib3MF_int32)(eFilter)); } - if (pUUID == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sUUID(pUUID); - IComponent* pIComponent = dynamic_cast(pIBaseClass); - if (!pIComponent) + ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); + if (!pITexture2D) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIComponent->SetUUID(sUUID); + pITexture2D->SetFilter(eFilter); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -5063,25 +9970,31 @@ Lib3MFResult lib3mf_component_setuuid(Lib3MF_Component pComponent, const char * } } -Lib3MFResult lib3mf_component_hastransform(Lib3MF_Component pComponent, bool * pHasTransform) + +/************************************************************************************************************************* + Class implementation for BuildItem +**************************************************************************************************************************/ +Lib3MFResult lib3mf_builditem_getobjectresource(Lib3MF_BuildItem pBuildItem, Lib3MF_Object * pObjectResource) { - IBase* pIBaseClass = (IBase *)pComponent; + IBase* pIBaseClass = (IBase *)pBuildItem; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "HasTransform"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItem, "BuildItem", "GetObjectResource"); } - if (pHasTransform == nullptr) + if (pObjectResource == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IComponent* pIComponent = dynamic_cast(pIBaseClass); - if (!pIComponent) + IBase* pBaseObjectResource(nullptr); + IBuildItem* pIBuildItem = dynamic_cast(pIBaseClass); + if (!pIBuildItem) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pHasTransform = pIComponent->HasTransform(); + pBaseObjectResource = pIBuildItem->GetObjectResource(); + *pObjectResource = (IBase*)(pBaseObjectResource); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addBooleanResult("HasTransform", *pHasTransform); + pJournalEntry->addHandleResult("ObjectResource", *pObjectResource); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5097,24 +10010,50 @@ Lib3MFResult lib3mf_component_hastransform(Lib3MF_Component pComponent, bool * p } } -Lib3MFResult lib3mf_component_gettransform(Lib3MF_Component pComponent, sLib3MFTransform * pTransform) +Lib3MFResult lib3mf_builditem_getuuid(Lib3MF_BuildItem pBuildItem, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) { - IBase* pIBaseClass = (IBase *)pComponent; + IBase* pIBaseClass = (IBase *)pBuildItem; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "GetTransform"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItem, "BuildItem", "GetUUID"); } - if (pTransform == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IComponent* pIComponent = dynamic_cast(pIBaseClass); - if (!pIComponent) + if (!pHasUUID) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if ( (!pUUIDBuffer) && !(pUUIDNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sUUID(""); + IBuildItem* pIBuildItem = dynamic_cast(pIBaseClass); + if (!pIBuildItem) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pTransform = pIComponent->GetTransform(); + bool isCacheCall = (pUUIDBuffer == nullptr); + if (isCacheCall) { + sUUID = pIBuildItem->GetUUID(*pHasUUID); + pIBuildItem->_setCache (new ParameterCache_2 (*pHasUUID, sUUID)); + } + else { + auto cache = dynamic_cast*> (pIBuildItem->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (*pHasUUID, sUUID); + pIBuildItem->_setCache (nullptr); + } + + if (pUUIDNeededChars) + *pUUIDNeededChars = (Lib3MF_uint32) (sUUID.size()+1); + if (pUUIDBuffer) { + if (sUUID.size() >= nUUIDBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iUUID = 0; iUUID < sUUID.size(); iUUID++) + pUUIDBuffer[iUUID] = sUUID[iUUID]; + pUUIDBuffer[sUUID.size()] = 0; + } if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("HasUUID", *pHasUUID); + pJournalEntry->addStringResult("UUID", sUUID.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5130,20 +10069,24 @@ Lib3MFResult lib3mf_component_gettransform(Lib3MF_Component pComponent, sLib3MFT } } -Lib3MFResult lib3mf_component_settransform(Lib3MF_Component pComponent, const sLib3MFTransform * pTransform) +Lib3MFResult lib3mf_builditem_setuuid(Lib3MF_BuildItem pBuildItem, const char * pUUID) { - IBase* pIBaseClass = (IBase *)pComponent; + IBase* pIBaseClass = (IBase *)pBuildItem; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComponent, "Component", "SetTransform"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItem, "BuildItem", "SetUUID"); + pJournalEntry->addStringParameter("UUID", pUUID); } - IComponent* pIComponent = dynamic_cast(pIBaseClass); - if (!pIComponent) + if (pUUID == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sUUID(pUUID); + IBuildItem* pIBuildItem = dynamic_cast(pIBaseClass); + if (!pIBuildItem) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIComponent->SetTransform(*pTransform); + pIBuildItem->SetUUID(sUUID); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -5161,37 +10104,25 @@ Lib3MFResult lib3mf_component_settransform(Lib3MF_Component pComponent, const sL } } - -/************************************************************************************************************************* - Class implementation for ComponentsObject -**************************************************************************************************************************/ -Lib3MFResult lib3mf_componentsobject_addcomponent(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_Object pObjectResource, const sLib3MFTransform * pTransform, Lib3MF_Component * pComponentInstance) +Lib3MFResult lib3mf_builditem_getobjectresourceid(Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pUniqueResourceID) { - IBase* pIBaseClass = (IBase *)pComponentsObject; + IBase* pIBaseClass = (IBase *)pBuildItem; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComponentsObject, "ComponentsObject", "AddComponent"); - pJournalEntry->addHandleParameter("ObjectResource", pObjectResource); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItem, "BuildItem", "GetObjectResourceID"); } - if (pComponentInstance == nullptr) + if (pUniqueResourceID == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pIBaseClassObjectResource = (IBase *)pObjectResource; - IObject* pIObjectResource = dynamic_cast(pIBaseClassObjectResource); - if (!pIObjectResource) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); - - IBase* pBaseComponentInstance(nullptr); - IComponentsObject* pIComponentsObject = dynamic_cast(pIBaseClass); - if (!pIComponentsObject) + IBuildItem* pIBuildItem = dynamic_cast(pIBaseClass); + if (!pIBuildItem) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseComponentInstance = pIComponentsObject->AddComponent(pIObjectResource, *pTransform); + *pUniqueResourceID = pIBuildItem->GetObjectResourceID(); - *pComponentInstance = (IBase*)(pBaseComponentInstance); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("ComponentInstance", *pComponentInstance); + pJournalEntry->addUInt32Result("UniqueResourceID", *pUniqueResourceID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5207,28 +10138,25 @@ Lib3MFResult lib3mf_componentsobject_addcomponent(Lib3MF_ComponentsObject pCompo } } -Lib3MFResult lib3mf_componentsobject_getcomponent(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 nIndex, Lib3MF_Component * pComponentInstance) +Lib3MFResult lib3mf_builditem_hasobjecttransform(Lib3MF_BuildItem pBuildItem, bool * pHasTransform) { - IBase* pIBaseClass = (IBase *)pComponentsObject; + IBase* pIBaseClass = (IBase *)pBuildItem; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComponentsObject, "ComponentsObject", "GetComponent"); - pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItem, "BuildItem", "HasObjectTransform"); } - if (pComponentInstance == nullptr) + if (pHasTransform == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseComponentInstance(nullptr); - IComponentsObject* pIComponentsObject = dynamic_cast(pIBaseClass); - if (!pIComponentsObject) + IBuildItem* pIBuildItem = dynamic_cast(pIBaseClass); + if (!pIBuildItem) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseComponentInstance = pIComponentsObject->GetComponent(nIndex); + *pHasTransform = pIBuildItem->HasObjectTransform(); - *pComponentInstance = (IBase*)(pBaseComponentInstance); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("ComponentInstance", *pComponentInstance); + pJournalEntry->addBooleanResult("HasTransform", *pHasTransform); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5244,25 +10172,24 @@ Lib3MFResult lib3mf_componentsobject_getcomponent(Lib3MF_ComponentsObject pCompo } } -Lib3MFResult lib3mf_componentsobject_getcomponentcount(Lib3MF_ComponentsObject pComponentsObject, Lib3MF_uint32 * pCount) +Lib3MFResult lib3mf_builditem_getobjecttransform(Lib3MF_BuildItem pBuildItem, sLib3MFTransform * pTransform) { - IBase* pIBaseClass = (IBase *)pComponentsObject; + IBase* pIBaseClass = (IBase *)pBuildItem; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pComponentsObject, "ComponentsObject", "GetComponentCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItem, "BuildItem", "GetObjectTransform"); } - if (pCount == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IComponentsObject* pIComponentsObject = dynamic_cast(pIBaseClass); - if (!pIComponentsObject) + if (pTransform == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBuildItem* pIBuildItem = dynamic_cast(pIBaseClass); + if (!pIBuildItem) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pIComponentsObject->GetComponentCount(); + *pTransform = pIBuildItem->GetObjectTransform(); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5278,28 +10205,20 @@ Lib3MFResult lib3mf_componentsobject_getcomponentcount(Lib3MF_ComponentsObject p } } - -/************************************************************************************************************************* - Class implementation for BeamSet -**************************************************************************************************************************/ -Lib3MFResult lib3mf_beamset_setname(Lib3MF_BeamSet pBeamSet, const char * pName) +Lib3MFResult lib3mf_builditem_setobjecttransform(Lib3MF_BuildItem pBuildItem, const sLib3MFTransform * pTransform) { - IBase* pIBaseClass = (IBase *)pBeamSet; + IBase* pIBaseClass = (IBase *)pBuildItem; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "SetName"); - pJournalEntry->addStringParameter("Name", pName); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItem, "BuildItem", "SetObjectTransform"); } - if (pName == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sName(pName); - IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); - if (!pIBeamSet) + IBuildItem* pIBuildItem = dynamic_cast(pIBaseClass); + if (!pIBuildItem) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamSet->SetName(sName); + pIBuildItem->SetObjectTransform(*pTransform); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -5317,47 +10236,47 @@ Lib3MFResult lib3mf_beamset_setname(Lib3MF_BeamSet pBeamSet, const char * pName) } } -Lib3MFResult lib3mf_beamset_getname(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) +Lib3MFResult lib3mf_builditem_getpartnumber(Lib3MF_BuildItem pBuildItem, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer) { - IBase* pIBaseClass = (IBase *)pBeamSet; + IBase* pIBaseClass = (IBase *)pBuildItem; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "GetName"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItem, "BuildItem", "GetPartNumber"); } - if ( (!pNameBuffer) && !(pNameNeededChars) ) + if ( (!pPartNumberBuffer) && !(pPartNumberNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sName(""); - IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); - if (!pIBeamSet) + std::string sPartNumber(""); + IBuildItem* pIBuildItem = dynamic_cast(pIBaseClass); + if (!pIBuildItem) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pNameBuffer == nullptr); + bool isCacheCall = (pPartNumberBuffer == nullptr); if (isCacheCall) { - sName = pIBeamSet->GetName(); + sPartNumber = pIBuildItem->GetPartNumber(); - pIBeamSet->_setCache (new ParameterCache_1 (sName)); + pIBuildItem->_setCache (new ParameterCache_1 (sPartNumber)); } else { - auto cache = dynamic_cast*> (pIBeamSet->_getCache ()); + auto cache = dynamic_cast*> (pIBuildItem->_getCache ()); if (cache == nullptr) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sName); - pIBeamSet->_setCache (nullptr); + cache->retrieveData (sPartNumber); + pIBuildItem->_setCache (nullptr); } - if (pNameNeededChars) - *pNameNeededChars = (Lib3MF_uint32) (sName.size()+1); - if (pNameBuffer) { - if (sName.size() >= nNameBufferSize) + if (pPartNumberNeededChars) + *pPartNumberNeededChars = (Lib3MF_uint32) (sPartNumber.size()+1); + if (pPartNumberBuffer) { + if (sPartNumber.size() >= nPartNumberBufferSize) throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iName = 0; iName < sName.size(); iName++) - pNameBuffer[iName] = sName[iName]; - pNameBuffer[sName.size()] = 0; + for (size_t iPartNumber = 0; iPartNumber < sPartNumber.size(); iPartNumber++) + pPartNumberBuffer[iPartNumber] = sPartNumber[iPartNumber]; + pPartNumberBuffer[sPartNumber.size()] = 0; } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("Name", sName.c_str()); + pJournalEntry->addStringResult("PartNumber", sPartNumber.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5373,24 +10292,24 @@ Lib3MFResult lib3mf_beamset_getname(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 } } -Lib3MFResult lib3mf_beamset_setidentifier(Lib3MF_BeamSet pBeamSet, const char * pIdentifier) +Lib3MFResult lib3mf_builditem_setpartnumber(Lib3MF_BuildItem pBuildItem, const char * pSetPartnumber) { - IBase* pIBaseClass = (IBase *)pBeamSet; + IBase* pIBaseClass = (IBase *)pBuildItem; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "SetIdentifier"); - pJournalEntry->addStringParameter("Identifier", pIdentifier); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItem, "BuildItem", "SetPartNumber"); + pJournalEntry->addStringParameter("SetPartnumber", pSetPartnumber); } - if (pIdentifier == nullptr) + if (pSetPartnumber == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sIdentifier(pIdentifier); - IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); - if (!pIBeamSet) + std::string sSetPartnumber(pSetPartnumber); + IBuildItem* pIBuildItem = dynamic_cast(pIBaseClass); + if (!pIBuildItem) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamSet->SetIdentifier(sIdentifier); + pIBuildItem->SetPartNumber(sSetPartnumber); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -5408,47 +10327,27 @@ Lib3MFResult lib3mf_beamset_setidentifier(Lib3MF_BeamSet pBeamSet, const char * } } -Lib3MFResult lib3mf_beamset_getidentifier(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint32 nIdentifierBufferSize, Lib3MF_uint32* pIdentifierNeededChars, char * pIdentifierBuffer) +Lib3MFResult lib3mf_builditem_getmetadatagroup(Lib3MF_BuildItem pBuildItem, Lib3MF_MetaDataGroup * pMetaDataGroup) { - IBase* pIBaseClass = (IBase *)pBeamSet; + IBase* pIBaseClass = (IBase *)pBuildItem; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "GetIdentifier"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItem, "BuildItem", "GetMetaDataGroup"); } - if ( (!pIdentifierBuffer) && !(pIdentifierNeededChars) ) + if (pMetaDataGroup == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sIdentifier(""); - IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); - if (!pIBeamSet) + IBase* pBaseMetaDataGroup(nullptr); + IBuildItem* pIBuildItem = dynamic_cast(pIBaseClass); + if (!pIBuildItem) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pIdentifierBuffer == nullptr); - if (isCacheCall) { - sIdentifier = pIBeamSet->GetIdentifier(); + pBaseMetaDataGroup = pIBuildItem->GetMetaDataGroup(); - pIBeamSet->_setCache (new ParameterCache_1 (sIdentifier)); - } - else { - auto cache = dynamic_cast*> (pIBeamSet->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sIdentifier); - pIBeamSet->_setCache (nullptr); - } - - if (pIdentifierNeededChars) - *pIdentifierNeededChars = (Lib3MF_uint32) (sIdentifier.size()+1); - if (pIdentifierBuffer) { - if (sIdentifier.size() >= nIdentifierBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iIdentifier = 0; iIdentifier < sIdentifier.size(); iIdentifier++) - pIdentifierBuffer[iIdentifier] = sIdentifier[iIdentifier]; - pIdentifierBuffer[sIdentifier.size()] = 0; - } + *pMetaDataGroup = (IBase*)(pBaseMetaDataGroup); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("Identifier", sIdentifier.c_str()); + pJournalEntry->addHandleResult("MetaDataGroup", *pMetaDataGroup); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5464,25 +10363,24 @@ Lib3MFResult lib3mf_beamset_getidentifier(Lib3MF_BeamSet pBeamSet, const Lib3MF_ } } -Lib3MFResult lib3mf_beamset_getreferencecount(Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount) +Lib3MFResult lib3mf_builditem_getoutbox(Lib3MF_BuildItem pBuildItem, sLib3MFBox * pOutbox) { - IBase* pIBaseClass = (IBase *)pBeamSet; + IBase* pIBaseClass = (IBase *)pBuildItem; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "GetReferenceCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItem, "BuildItem", "GetOutbox"); } - if (pCount == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); - if (!pIBeamSet) + if (pOutbox == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBuildItem* pIBuildItem = dynamic_cast(pIBaseClass); + if (!pIBuildItem) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pIBeamSet->GetReferenceCount(); + *pOutbox = pIBuildItem->GetOutbox(); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5498,24 +10396,29 @@ Lib3MFResult lib3mf_beamset_getreferencecount(Lib3MF_BeamSet pBeamSet, Lib3MF_ui } } -Lib3MFResult lib3mf_beamset_setreferences(Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nReferencesBufferSize, const Lib3MF_uint32 * pReferencesBuffer) + +/************************************************************************************************************************* + Class implementation for BuildItemIterator +**************************************************************************************************************************/ +Lib3MFResult lib3mf_builditemiterator_movenext(Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasNext) { - IBase* pIBaseClass = (IBase *)pBeamSet; + IBase* pIBaseClass = (IBase *)pBuildItemIterator; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "SetReferences"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItemIterator, "BuildItemIterator", "MoveNext"); } - if ( (!pReferencesBuffer) && (nReferencesBufferSize>0)) + if (pHasNext == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); - if (!pIBeamSet) + IBuildItemIterator* pIBuildItemIterator = dynamic_cast(pIBaseClass); + if (!pIBuildItemIterator) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamSet->SetReferences(nReferencesBufferSize, pReferencesBuffer); + *pHasNext = pIBuildItemIterator->MoveNext(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("HasNext", *pHasNext); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5531,24 +10434,25 @@ Lib3MFResult lib3mf_beamset_setreferences(Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 } } -Lib3MFResult lib3mf_beamset_getreferences(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nReferencesBufferSize, Lib3MF_uint64* pReferencesNeededCount, Lib3MF_uint32 * pReferencesBuffer) +Lib3MFResult lib3mf_builditemiterator_moveprevious(Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasPrevious) { - IBase* pIBaseClass = (IBase *)pBeamSet; + IBase* pIBaseClass = (IBase *)pBuildItemIterator; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "GetReferences"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItemIterator, "BuildItemIterator", "MovePrevious"); } - if ((!pReferencesBuffer) && !(pReferencesNeededCount)) + if (pHasPrevious == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); - if (!pIBeamSet) + IBuildItemIterator* pIBuildItemIterator = dynamic_cast(pIBaseClass); + if (!pIBuildItemIterator) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamSet->GetReferences(nReferencesBufferSize, pReferencesNeededCount, pReferencesBuffer); + *pHasPrevious = pIBuildItemIterator->MovePrevious(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("HasPrevious", *pHasPrevious); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5564,25 +10468,27 @@ Lib3MFResult lib3mf_beamset_getreferences(Lib3MF_BeamSet pBeamSet, const Lib3MF_ } } -Lib3MFResult lib3mf_beamset_getballreferencecount(Lib3MF_BeamSet pBeamSet, Lib3MF_uint32 * pCount) +Lib3MFResult lib3mf_builditemiterator_getcurrent(Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItem * pBuildItem) { - IBase* pIBaseClass = (IBase *)pBeamSet; + IBase* pIBaseClass = (IBase *)pBuildItemIterator; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "GetBallReferenceCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItemIterator, "BuildItemIterator", "GetCurrent"); } - if (pCount == nullptr) + if (pBuildItem == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); - if (!pIBeamSet) + IBase* pBaseBuildItem(nullptr); + IBuildItemIterator* pIBuildItemIterator = dynamic_cast(pIBaseClass); + if (!pIBuildItemIterator) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pIBeamSet->GetBallReferenceCount(); + pBaseBuildItem = pIBuildItemIterator->GetCurrent(); + *pBuildItem = (IBase*)(pBaseBuildItem); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); + pJournalEntry->addHandleResult("BuildItem", *pBuildItem); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5598,24 +10504,27 @@ Lib3MFResult lib3mf_beamset_getballreferencecount(Lib3MF_BeamSet pBeamSet, Lib3M } } -Lib3MFResult lib3mf_beamset_setballreferences(Lib3MF_BeamSet pBeamSet, Lib3MF_uint64 nBallReferencesBufferSize, const Lib3MF_uint32 * pBallReferencesBuffer) +Lib3MFResult lib3mf_builditemiterator_clone(Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItemIterator * pOutBuildItemIterator) { - IBase* pIBaseClass = (IBase *)pBeamSet; + IBase* pIBaseClass = (IBase *)pBuildItemIterator; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "SetBallReferences"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItemIterator, "BuildItemIterator", "Clone"); } - if ( (!pBallReferencesBuffer) && (nBallReferencesBufferSize>0)) + if (pOutBuildItemIterator == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); - if (!pIBeamSet) + IBase* pBaseOutBuildItemIterator(nullptr); + IBuildItemIterator* pIBuildItemIterator = dynamic_cast(pIBaseClass); + if (!pIBuildItemIterator) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamSet->SetBallReferences(nBallReferencesBufferSize, pBallReferencesBuffer); + pBaseOutBuildItemIterator = pIBuildItemIterator->Clone(); + *pOutBuildItemIterator = (IBase*)(pBaseOutBuildItemIterator); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("OutBuildItemIterator", *pOutBuildItemIterator); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5631,24 +10540,25 @@ Lib3MFResult lib3mf_beamset_setballreferences(Lib3MF_BeamSet pBeamSet, Lib3MF_ui } } -Lib3MFResult lib3mf_beamset_getballreferences(Lib3MF_BeamSet pBeamSet, const Lib3MF_uint64 nBallReferencesBufferSize, Lib3MF_uint64* pBallReferencesNeededCount, Lib3MF_uint32 * pBallReferencesBuffer) +Lib3MFResult lib3mf_builditemiterator_count(Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_uint64 * pCount) { - IBase* pIBaseClass = (IBase *)pBeamSet; + IBase* pIBaseClass = (IBase *)pBuildItemIterator; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBeamSet, "BeamSet", "GetBallReferences"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItemIterator, "BuildItemIterator", "Count"); } - if ((!pBallReferencesBuffer) && !(pBallReferencesNeededCount)) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBeamSet* pIBeamSet = dynamic_cast(pIBaseClass); - if (!pIBeamSet) + IBuildItemIterator* pIBuildItemIterator = dynamic_cast(pIBaseClass); + if (!pIBuildItemIterator) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBeamSet->GetBallReferences(nBallReferencesBufferSize, pBallReferencesNeededCount, pBallReferencesBuffer); + *pCount = pIBuildItemIterator->Count(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt64Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5666,27 +10576,26 @@ Lib3MFResult lib3mf_beamset_getballreferences(Lib3MF_BeamSet pBeamSet, const Lib /************************************************************************************************************************* - Class implementation for BaseMaterialGroup + Class implementation for Slice **************************************************************************************************************************/ -Lib3MFResult lib3mf_basematerialgroup_getcount(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 * pCount) +Lib3MFResult lib3mf_slice_setvertices(Lib3MF_Slice pSlice, Lib3MF_uint64 nVerticesBufferSize, const sLib3MFPosition2D * pVerticesBuffer) { - IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; + IBase* pIBaseClass = (IBase *)pSlice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "GetCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pSlice, "Slice", "SetVertices"); } - if (pCount == nullptr) + if ( (!pVerticesBuffer) && (nVerticesBufferSize>0)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); - if (!pIBaseMaterialGroup) + ISlice* pISlice = dynamic_cast(pIBaseClass); + if (!pISlice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pIBaseMaterialGroup->GetCount(); + pISlice->SetVertices(nVerticesBufferSize, pVerticesBuffer); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5702,22 +10611,22 @@ Lib3MFResult lib3mf_basematerialgroup_getcount(Lib3MF_BaseMaterialGroup pBaseMat } } -Lib3MFResult lib3mf_basematerialgroup_getallpropertyids(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) +Lib3MFResult lib3mf_slice_getvertices(Lib3MF_Slice pSlice, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, sLib3MFPosition2D * pVerticesBuffer) { - IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; + IBase* pIBaseClass = (IBase *)pSlice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "GetAllPropertyIDs"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pSlice, "Slice", "GetVertices"); } - if ((!pPropertyIDsBuffer) && !(pPropertyIDsNeededCount)) + if ((!pVerticesBuffer) && !(pVerticesNeededCount)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); - if (!pIBaseMaterialGroup) + ISlice* pISlice = dynamic_cast(pIBaseClass); + if (!pISlice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBaseMaterialGroup->GetAllPropertyIDs(nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); + pISlice->GetVertices(nVerticesBufferSize, pVerticesNeededCount, pVerticesBuffer); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -5735,29 +10644,25 @@ Lib3MFResult lib3mf_basematerialgroup_getallpropertyids(Lib3MF_BaseMaterialGroup } } -Lib3MFResult lib3mf_basematerialgroup_addmaterial(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, const char * pName, const sLib3MFColor * pDisplayColor, Lib3MF_uint32 * pPropertyID) +Lib3MFResult lib3mf_slice_getvertexcount(Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount) { - IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; + IBase* pIBaseClass = (IBase *)pSlice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "AddMaterial"); - pJournalEntry->addStringParameter("Name", pName); + pJournalEntry = m_GlobalJournal->beginClassMethod(pSlice, "Slice", "GetVertexCount"); } - if (pName == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (pPropertyID == nullptr) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sName(pName); - IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); - if (!pIBaseMaterialGroup) + ISlice* pISlice = dynamic_cast(pIBaseClass); + if (!pISlice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pPropertyID = pIBaseMaterialGroup->AddMaterial(sName, *pDisplayColor); + *pCount = pISlice->GetVertexCount(); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("PropertyID", *pPropertyID); + pJournalEntry->addUInt64Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5773,23 +10678,27 @@ Lib3MFResult lib3mf_basematerialgroup_addmaterial(Lib3MF_BaseMaterialGroup pBase } } -Lib3MFResult lib3mf_basematerialgroup_removematerial(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID) +Lib3MFResult lib3mf_slice_addpolygon(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer, Lib3MF_uint64 * pIndex) { - IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; + IBase* pIBaseClass = (IBase *)pSlice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "RemoveMaterial"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pSlice, "Slice", "AddPolygon"); } - IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); - if (!pIBaseMaterialGroup) + if ( (!pIndicesBuffer) && (nIndicesBufferSize>0)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pIndex == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + ISlice* pISlice = dynamic_cast(pIBaseClass); + if (!pISlice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBaseMaterialGroup->RemoveMaterial(nPropertyID); + *pIndex = pISlice->AddPolygon(nIndicesBufferSize, pIndicesBuffer); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt64Result("Index", *pIndex); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5805,48 +10714,25 @@ Lib3MFResult lib3mf_basematerialgroup_removematerial(Lib3MF_BaseMaterialGroup pB } } -Lib3MFResult lib3mf_basematerialgroup_getname(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) +Lib3MFResult lib3mf_slice_getpolygoncount(Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount) { - IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; + IBase* pIBaseClass = (IBase *)pSlice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "GetName"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pSlice, "Slice", "GetPolygonCount"); } - if ( (!pNameBuffer) && !(pNameNeededChars) ) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sName(""); - IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); - if (!pIBaseMaterialGroup) + ISlice* pISlice = dynamic_cast(pIBaseClass); + if (!pISlice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pNameBuffer == nullptr); - if (isCacheCall) { - sName = pIBaseMaterialGroup->GetName(nPropertyID); + *pCount = pISlice->GetPolygonCount(); - pIBaseMaterialGroup->_setCache (new ParameterCache_1 (sName)); - } - else { - auto cache = dynamic_cast*> (pIBaseMaterialGroup->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sName); - pIBaseMaterialGroup->_setCache (nullptr); - } - - if (pNameNeededChars) - *pNameNeededChars = (Lib3MF_uint32) (sName.size()+1); - if (pNameBuffer) { - if (sName.size() >= nNameBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iName = 0; iName < sName.size(); iName++) - pNameBuffer[iName] = sName[iName]; - pNameBuffer[sName.size()] = 0; - } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("Name", sName.c_str()); + pJournalEntry->addUInt64Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5862,25 +10748,23 @@ Lib3MFResult lib3mf_basematerialgroup_getname(Lib3MF_BaseMaterialGroup pBaseMate } } -Lib3MFResult lib3mf_basematerialgroup_setname(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const char * pName) +Lib3MFResult lib3mf_slice_setpolygonindices(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer) { - IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; + IBase* pIBaseClass = (IBase *)pSlice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "SetName"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); - pJournalEntry->addStringParameter("Name", pName); + pJournalEntry = m_GlobalJournal->beginClassMethod(pSlice, "Slice", "SetPolygonIndices"); + pJournalEntry->addUInt64Parameter("Index", nIndex); } - if (pName == nullptr) + if ( (!pIndicesBuffer) && (nIndicesBufferSize>0)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sName(pName); - IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); - if (!pIBaseMaterialGroup) + ISlice* pISlice = dynamic_cast(pIBaseClass); + if (!pISlice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBaseMaterialGroup->SetName(nPropertyID, sName); + pISlice->SetPolygonIndices(nIndex, nIndicesBufferSize, pIndicesBuffer); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -5898,21 +10782,23 @@ Lib3MFResult lib3mf_basematerialgroup_setname(Lib3MF_BaseMaterialGroup pBaseMate } } -Lib3MFResult lib3mf_basematerialgroup_setdisplaycolor(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor) +Lib3MFResult lib3mf_slice_getpolygonindices(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF_uint32 * pIndicesBuffer) { - IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; + IBase* pIBaseClass = (IBase *)pSlice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "SetDisplayColor"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pSlice, "Slice", "GetPolygonIndices"); + pJournalEntry->addUInt64Parameter("Index", nIndex); } - IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); - if (!pIBaseMaterialGroup) + if ((!pIndicesBuffer) && !(pIndicesNeededCount)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + ISlice* pISlice = dynamic_cast(pIBaseClass); + if (!pISlice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBaseMaterialGroup->SetDisplayColor(nPropertyID, *pTheColor); + pISlice->GetPolygonIndices(nIndex, nIndicesBufferSize, pIndicesNeededCount, pIndicesBuffer); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -5930,25 +10816,26 @@ Lib3MFResult lib3mf_basematerialgroup_setdisplaycolor(Lib3MF_BaseMaterialGroup p } } -Lib3MFResult lib3mf_basematerialgroup_getdisplaycolor(Lib3MF_BaseMaterialGroup pBaseMaterialGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor) +Lib3MFResult lib3mf_slice_getpolygonindexcount(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 * pCount) { - IBase* pIBaseClass = (IBase *)pBaseMaterialGroup; + IBase* pIBaseClass = (IBase *)pSlice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBaseMaterialGroup, "BaseMaterialGroup", "GetDisplayColor"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pSlice, "Slice", "GetPolygonIndexCount"); + pJournalEntry->addUInt64Parameter("Index", nIndex); } - if (pTheColor == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBaseMaterialGroup* pIBaseMaterialGroup = dynamic_cast(pIBaseClass); - if (!pIBaseMaterialGroup) + if (pCount == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + ISlice* pISlice = dynamic_cast(pIBaseClass); + if (!pISlice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pTheColor = pIBaseMaterialGroup->GetDisplayColor(nPropertyID); + *pCount = pISlice->GetPolygonIndexCount(nIndex); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt64Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -5964,29 +10851,25 @@ Lib3MFResult lib3mf_basematerialgroup_getdisplaycolor(Lib3MF_BaseMaterialGroup p } } - -/************************************************************************************************************************* - Class implementation for ColorGroup -**************************************************************************************************************************/ -Lib3MFResult lib3mf_colorgroup_getcount(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 * pCount) +Lib3MFResult lib3mf_slice_getztop(Lib3MF_Slice pSlice, Lib3MF_double * pZTop) { - IBase* pIBaseClass = (IBase *)pColorGroup; + IBase* pIBaseClass = (IBase *)pSlice; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroup, "ColorGroup", "GetCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pSlice, "Slice", "GetZTop"); } - if (pCount == nullptr) + if (pZTop == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IColorGroup* pIColorGroup = dynamic_cast(pIBaseClass); - if (!pIColorGroup) + ISlice* pISlice = dynamic_cast(pIBaseClass); + if (!pISlice) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pIColorGroup->GetCount(); + *pZTop = pISlice->GetZTop(); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); + pJournalEntry->addDoubleResult("ZTop", *pZTop); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6002,24 +10885,51 @@ Lib3MFResult lib3mf_colorgroup_getcount(Lib3MF_ColorGroup pColorGroup, Lib3MF_ui } } -Lib3MFResult lib3mf_colorgroup_getallpropertyids(Lib3MF_ColorGroup pColorGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) + +/************************************************************************************************************************* + Class implementation for ToolpathProfile +**************************************************************************************************************************/ +Lib3MFResult lib3mf_toolpathprofile_getuuid(Lib3MF_ToolpathProfile pToolpathProfile, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) { - IBase* pIBaseClass = (IBase *)pColorGroup; + IBase* pIBaseClass = (IBase *)pToolpathProfile; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroup, "ColorGroup", "GetAllPropertyIDs"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathProfile, "ToolpathProfile", "GetUUID"); } - if ((!pPropertyIDsBuffer) && !(pPropertyIDsNeededCount)) + if ( (!pUUIDBuffer) && !(pUUIDNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IColorGroup* pIColorGroup = dynamic_cast(pIBaseClass); - if (!pIColorGroup) + std::string sUUID(""); + IToolpathProfile* pIToolpathProfile = dynamic_cast(pIBaseClass); + if (!pIToolpathProfile) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIColorGroup->GetAllPropertyIDs(nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); + bool isCacheCall = (pUUIDBuffer == nullptr); + if (isCacheCall) { + sUUID = pIToolpathProfile->GetUUID(); + pIToolpathProfile->_setCache (new ParameterCache_1 (sUUID)); + } + else { + auto cache = dynamic_cast*> (pIToolpathProfile->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sUUID); + pIToolpathProfile->_setCache (nullptr); + } + + if (pUUIDNeededChars) + *pUUIDNeededChars = (Lib3MF_uint32) (sUUID.size()+1); + if (pUUIDBuffer) { + if (sUUID.size() >= nUUIDBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iUUID = 0; iUUID < sUUID.size(); iUUID++) + pUUIDBuffer[iUUID] = sUUID[iUUID]; + pUUIDBuffer[sUUID.size()] = 0; + } if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("UUID", sUUID.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6035,25 +10945,47 @@ Lib3MFResult lib3mf_colorgroup_getallpropertyids(Lib3MF_ColorGroup pColorGroup, } } -Lib3MFResult lib3mf_colorgroup_addcolor(Lib3MF_ColorGroup pColorGroup, const sLib3MFColor * pTheColor, Lib3MF_uint32 * pPropertyID) +Lib3MFResult lib3mf_toolpathprofile_getname(Lib3MF_ToolpathProfile pToolpathProfile, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) { - IBase* pIBaseClass = (IBase *)pColorGroup; + IBase* pIBaseClass = (IBase *)pToolpathProfile; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroup, "ColorGroup", "AddColor"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathProfile, "ToolpathProfile", "GetName"); } - if (pPropertyID == nullptr) + if ( (!pNameBuffer) && !(pNameNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IColorGroup* pIColorGroup = dynamic_cast(pIBaseClass); - if (!pIColorGroup) + std::string sName(""); + IToolpathProfile* pIToolpathProfile = dynamic_cast(pIBaseClass); + if (!pIToolpathProfile) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pPropertyID = pIColorGroup->AddColor(*pTheColor); + bool isCacheCall = (pNameBuffer == nullptr); + if (isCacheCall) { + sName = pIToolpathProfile->GetName(); + pIToolpathProfile->_setCache (new ParameterCache_1 (sName)); + } + else { + auto cache = dynamic_cast*> (pIToolpathProfile->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sName); + pIToolpathProfile->_setCache (nullptr); + } + + if (pNameNeededChars) + *pNameNeededChars = (Lib3MF_uint32) (sName.size()+1); + if (pNameBuffer) { + if (sName.size() >= nNameBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iName = 0; iName < sName.size(); iName++) + pNameBuffer[iName] = sName[iName]; + pNameBuffer[sName.size()] = 0; + } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("PropertyID", *pPropertyID); + pJournalEntry->addStringResult("Name", sName.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6069,23 +11001,25 @@ Lib3MFResult lib3mf_colorgroup_addcolor(Lib3MF_ColorGroup pColorGroup, const sLi } } -Lib3MFResult lib3mf_colorgroup_removecolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID) +Lib3MFResult lib3mf_toolpathprofile_getparametercount(Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 * pCount) { - IBase* pIBaseClass = (IBase *)pColorGroup; + IBase* pIBaseClass = (IBase *)pToolpathProfile; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroup, "ColorGroup", "RemoveColor"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathProfile, "ToolpathProfile", "GetParameterCount"); } - IColorGroup* pIColorGroup = dynamic_cast(pIBaseClass); - if (!pIColorGroup) + if (pCount == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IToolpathProfile* pIToolpathProfile = dynamic_cast(pIBaseClass); + if (!pIToolpathProfile) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIColorGroup->RemoveColor(nPropertyID); + *pCount = pIToolpathProfile->GetParameterCount(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6101,23 +11035,48 @@ Lib3MFResult lib3mf_colorgroup_removecolor(Lib3MF_ColorGroup pColorGroup, Lib3MF } } -Lib3MFResult lib3mf_colorgroup_setcolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, const sLib3MFColor * pTheColor) +Lib3MFResult lib3mf_toolpathprofile_getparametername(Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameBufferSize, Lib3MF_uint32* pNameNeededChars, char * pNameBuffer) { - IBase* pIBaseClass = (IBase *)pColorGroup; + IBase* pIBaseClass = (IBase *)pToolpathProfile; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroup, "ColorGroup", "SetColor"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathProfile, "ToolpathProfile", "GetParameterName"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - IColorGroup* pIColorGroup = dynamic_cast(pIBaseClass); - if (!pIColorGroup) + if ( (!pNameBuffer) && !(pNameNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(""); + IToolpathProfile* pIToolpathProfile = dynamic_cast(pIBaseClass); + if (!pIToolpathProfile) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIColorGroup->SetColor(nPropertyID, *pTheColor); + bool isCacheCall = (pNameBuffer == nullptr); + if (isCacheCall) { + sName = pIToolpathProfile->GetParameterName(nIndex); + pIToolpathProfile->_setCache (new ParameterCache_1 (sName)); + } + else { + auto cache = dynamic_cast*> (pIToolpathProfile->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sName); + pIToolpathProfile->_setCache (nullptr); + } + + if (pNameNeededChars) + *pNameNeededChars = (Lib3MF_uint32) (sName.size()+1); + if (pNameBuffer) { + if (sName.size() >= nNameBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iName = 0; iName < sName.size(); iName++) + pNameBuffer[iName] = sName[iName]; + pNameBuffer[sName.size()] = 0; + } if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("Name", sName.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6133,25 +11092,48 @@ Lib3MFResult lib3mf_colorgroup_setcolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_ui } } -Lib3MFResult lib3mf_colorgroup_getcolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_uint32 nPropertyID, sLib3MFColor * pTheColor) +Lib3MFResult lib3mf_toolpathprofile_getparameternamespace(Lib3MF_ToolpathProfile pToolpathProfile, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer) { - IBase* pIBaseClass = (IBase *)pColorGroup; + IBase* pIBaseClass = (IBase *)pToolpathProfile; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pColorGroup, "ColorGroup", "GetColor"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathProfile, "ToolpathProfile", "GetParameterNameSpace"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - if (pTheColor == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IColorGroup* pIColorGroup = dynamic_cast(pIBaseClass); - if (!pIColorGroup) + if ( (!pNameSpaceBuffer) && !(pNameSpaceNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpace(""); + IToolpathProfile* pIToolpathProfile = dynamic_cast(pIBaseClass); + if (!pIToolpathProfile) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pTheColor = pIColorGroup->GetColor(nPropertyID); + bool isCacheCall = (pNameSpaceBuffer == nullptr); + if (isCacheCall) { + sNameSpace = pIToolpathProfile->GetParameterNameSpace(nIndex); + pIToolpathProfile->_setCache (new ParameterCache_1 (sNameSpace)); + } + else { + auto cache = dynamic_cast*> (pIToolpathProfile->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sNameSpace); + pIToolpathProfile->_setCache (nullptr); + } + + if (pNameSpaceNeededChars) + *pNameSpaceNeededChars = (Lib3MF_uint32) (sNameSpace.size()+1); + if (pNameSpaceBuffer) { + if (sNameSpace.size() >= nNameSpaceBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iNameSpace = 0; iNameSpace < sNameSpace.size(); iNameSpace++) + pNameSpaceBuffer[iNameSpace] = sNameSpace[iNameSpace]; + pNameSpaceBuffer[sNameSpace.size()] = 0; + } if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("NameSpace", sNameSpace.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6167,29 +11149,33 @@ Lib3MFResult lib3mf_colorgroup_getcolor(Lib3MF_ColorGroup pColorGroup, Lib3MF_ui } } - -/************************************************************************************************************************* - Class implementation for Texture2DGroup -**************************************************************************************************************************/ -Lib3MFResult lib3mf_texture2dgroup_getcount(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 * pCount) +Lib3MFResult lib3mf_toolpathprofile_hasparametervalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool * pValueExists) { - IBase* pIBaseClass = (IBase *)pTexture2DGroup; + IBase* pIBaseClass = (IBase *)pToolpathProfile; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroup, "Texture2DGroup", "GetCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathProfile, "ToolpathProfile", "HasParameterValue"); + pJournalEntry->addStringParameter("NameSpaceName", pNameSpaceName); + pJournalEntry->addStringParameter("ValueName", pValueName); } - if (pCount == nullptr) + if (pNameSpaceName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ITexture2DGroup* pITexture2DGroup = dynamic_cast(pIBaseClass); - if (!pITexture2DGroup) + if (pValueName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pValueExists == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpaceName(pNameSpaceName); + std::string sValueName(pValueName); + IToolpathProfile* pIToolpathProfile = dynamic_cast(pIBaseClass); + if (!pIToolpathProfile) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pITexture2DGroup->GetCount(); + *pValueExists = pIToolpathProfile->HasParameterValue(sNameSpaceName, sValueName); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); + pJournalEntry->addBooleanResult("ValueExists", *pValueExists); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6205,24 +11191,55 @@ Lib3MFResult lib3mf_texture2dgroup_getcount(Lib3MF_Texture2DGroup pTexture2DGrou } } -Lib3MFResult lib3mf_texture2dgroup_getallpropertyids(Lib3MF_Texture2DGroup pTexture2DGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) +Lib3MFResult lib3mf_toolpathprofile_getparametervalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer) { - IBase* pIBaseClass = (IBase *)pTexture2DGroup; + IBase* pIBaseClass = (IBase *)pToolpathProfile; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroup, "Texture2DGroup", "GetAllPropertyIDs"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathProfile, "ToolpathProfile", "GetParameterValue"); + pJournalEntry->addStringParameter("NameSpaceName", pNameSpaceName); + pJournalEntry->addStringParameter("ValueName", pValueName); } - if ((!pPropertyIDsBuffer) && !(pPropertyIDsNeededCount)) + if (pNameSpaceName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ITexture2DGroup* pITexture2DGroup = dynamic_cast(pIBaseClass); - if (!pITexture2DGroup) + if (pValueName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if ( (!pValueBuffer) && !(pValueNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpaceName(pNameSpaceName); + std::string sValueName(pValueName); + std::string sValue(""); + IToolpathProfile* pIToolpathProfile = dynamic_cast(pIBaseClass); + if (!pIToolpathProfile) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pITexture2DGroup->GetAllPropertyIDs(nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); + bool isCacheCall = (pValueBuffer == nullptr); + if (isCacheCall) { + sValue = pIToolpathProfile->GetParameterValue(sNameSpaceName, sValueName); + pIToolpathProfile->_setCache (new ParameterCache_1 (sValue)); + } + else { + auto cache = dynamic_cast*> (pIToolpathProfile->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sValue); + pIToolpathProfile->_setCache (nullptr); + } + + if (pValueNeededChars) + *pValueNeededChars = (Lib3MF_uint32) (sValue.size()+1); + if (pValueBuffer) { + if (sValue.size() >= nValueBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iValue = 0; iValue < sValue.size(); iValue++) + pValueBuffer[iValue] = sValue[iValue]; + pValueBuffer[sValue.size()] = 0; + } if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("Value", sValue.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6238,25 +11255,59 @@ Lib3MFResult lib3mf_texture2dgroup_getallpropertyids(Lib3MF_Texture2DGroup pText } } -Lib3MFResult lib3mf_texture2dgroup_addtex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, const sLib3MFTex2Coord * pUVCoordinate, Lib3MF_uint32 * pPropertyID) +Lib3MFResult lib3mf_toolpathprofile_getparametervaluedef(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const char * pDefaultValue, const Lib3MF_uint32 nValueBufferSize, Lib3MF_uint32* pValueNeededChars, char * pValueBuffer) { - IBase* pIBaseClass = (IBase *)pTexture2DGroup; + IBase* pIBaseClass = (IBase *)pToolpathProfile; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroup, "Texture2DGroup", "AddTex2Coord"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathProfile, "ToolpathProfile", "GetParameterValueDef"); + pJournalEntry->addStringParameter("NameSpaceName", pNameSpaceName); + pJournalEntry->addStringParameter("ValueName", pValueName); + pJournalEntry->addStringParameter("DefaultValue", pDefaultValue); } - if (pPropertyID == nullptr) + if (pNameSpaceName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ITexture2DGroup* pITexture2DGroup = dynamic_cast(pIBaseClass); - if (!pITexture2DGroup) + if (pValueName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pDefaultValue == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if ( (!pValueBuffer) && !(pValueNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpaceName(pNameSpaceName); + std::string sValueName(pValueName); + std::string sDefaultValue(pDefaultValue); + std::string sValue(""); + IToolpathProfile* pIToolpathProfile = dynamic_cast(pIBaseClass); + if (!pIToolpathProfile) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pPropertyID = pITexture2DGroup->AddTex2Coord(*pUVCoordinate); + bool isCacheCall = (pValueBuffer == nullptr); + if (isCacheCall) { + sValue = pIToolpathProfile->GetParameterValueDef(sNameSpaceName, sValueName, sDefaultValue); + pIToolpathProfile->_setCache (new ParameterCache_1 (sValue)); + } + else { + auto cache = dynamic_cast*> (pIToolpathProfile->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sValue); + pIToolpathProfile->_setCache (nullptr); + } + + if (pValueNeededChars) + *pValueNeededChars = (Lib3MF_uint32) (sValue.size()+1); + if (pValueBuffer) { + if (sValue.size() >= nValueBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iValue = 0; iValue < sValue.size(); iValue++) + pValueBuffer[iValue] = sValue[iValue]; + pValueBuffer[sValue.size()] = 0; + } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("PropertyID", *pPropertyID); + pJournalEntry->addStringResult("Value", sValue.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6272,25 +11323,33 @@ Lib3MFResult lib3mf_texture2dgroup_addtex2coord(Lib3MF_Texture2DGroup pTexture2D } } -Lib3MFResult lib3mf_texture2dgroup_gettex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID, sLib3MFTex2Coord * pUVCoordinate) +Lib3MFResult lib3mf_toolpathprofile_getparameterdoublevalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double * pValue) { - IBase* pIBaseClass = (IBase *)pTexture2DGroup; + IBase* pIBaseClass = (IBase *)pToolpathProfile; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroup, "Texture2DGroup", "GetTex2Coord"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathProfile, "ToolpathProfile", "GetParameterDoubleValue"); + pJournalEntry->addStringParameter("NameSpaceName", pNameSpaceName); + pJournalEntry->addStringParameter("ValueName", pValueName); } - if (pUVCoordinate == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ITexture2DGroup* pITexture2DGroup = dynamic_cast(pIBaseClass); - if (!pITexture2DGroup) + if (pNameSpaceName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pValueName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pValue == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpaceName(pNameSpaceName); + std::string sValueName(pValueName); + IToolpathProfile* pIToolpathProfile = dynamic_cast(pIBaseClass); + if (!pIToolpathProfile) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pUVCoordinate = pITexture2DGroup->GetTex2Coord(nPropertyID); + *pValue = pIToolpathProfile->GetParameterDoubleValue(sNameSpaceName, sValueName); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addDoubleResult("Value", *pValue); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6306,23 +11365,34 @@ Lib3MFResult lib3mf_texture2dgroup_gettex2coord(Lib3MF_Texture2DGroup pTexture2D } } -Lib3MFResult lib3mf_texture2dgroup_removetex2coord(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_uint32 nPropertyID) +Lib3MFResult lib3mf_toolpathprofile_getparameterdoublevaluedef(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double dDefaultValue, Lib3MF_double * pValue) { - IBase* pIBaseClass = (IBase *)pTexture2DGroup; + IBase* pIBaseClass = (IBase *)pToolpathProfile; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroup, "Texture2DGroup", "RemoveTex2Coord"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathProfile, "ToolpathProfile", "GetParameterDoubleValueDef"); + pJournalEntry->addStringParameter("NameSpaceName", pNameSpaceName); + pJournalEntry->addStringParameter("ValueName", pValueName); + pJournalEntry->addDoubleParameter("DefaultValue", dDefaultValue); } - ITexture2DGroup* pITexture2DGroup = dynamic_cast(pIBaseClass); - if (!pITexture2DGroup) + if (pNameSpaceName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pValueName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pValue == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpaceName(pNameSpaceName); + std::string sValueName(pValueName); + IToolpathProfile* pIToolpathProfile = dynamic_cast(pIBaseClass); + if (!pIToolpathProfile) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pITexture2DGroup->RemoveTex2Coord(nPropertyID); + *pValue = pIToolpathProfile->GetParameterDoubleValueDef(sNameSpaceName, sValueName, dDefaultValue); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addDoubleResult("Value", *pValue); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6338,27 +11408,33 @@ Lib3MFResult lib3mf_texture2dgroup_removetex2coord(Lib3MF_Texture2DGroup pTextur } } -Lib3MFResult lib3mf_texture2dgroup_gettexture2d(Lib3MF_Texture2DGroup pTexture2DGroup, Lib3MF_Texture2D * pTexture2DInstance) +Lib3MFResult lib3mf_toolpathprofile_getparameterintegervalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 * pValue) { - IBase* pIBaseClass = (IBase *)pTexture2DGroup; + IBase* pIBaseClass = (IBase *)pToolpathProfile; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2DGroup, "Texture2DGroup", "GetTexture2D"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathProfile, "ToolpathProfile", "GetParameterIntegerValue"); + pJournalEntry->addStringParameter("NameSpaceName", pNameSpaceName); + pJournalEntry->addStringParameter("ValueName", pValueName); } - if (pTexture2DInstance == nullptr) + if (pNameSpaceName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseTexture2DInstance(nullptr); - ITexture2DGroup* pITexture2DGroup = dynamic_cast(pIBaseClass); - if (!pITexture2DGroup) + if (pValueName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pValue == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpaceName(pNameSpaceName); + std::string sValueName(pValueName); + IToolpathProfile* pIToolpathProfile = dynamic_cast(pIBaseClass); + if (!pIToolpathProfile) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseTexture2DInstance = pITexture2DGroup->GetTexture2D(); + *pValue = pIToolpathProfile->GetParameterIntegerValue(sNameSpaceName, sValueName); - *pTexture2DInstance = (IBase*)(pBaseTexture2DInstance); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Texture2DInstance", *pTexture2DInstance); + pJournalEntry->addInt64Result("Value", *pValue); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6374,29 +11450,34 @@ Lib3MFResult lib3mf_texture2dgroup_gettexture2d(Lib3MF_Texture2DGroup pTexture2D } } - -/************************************************************************************************************************* - Class implementation for CompositeMaterials -**************************************************************************************************************************/ -Lib3MFResult lib3mf_compositematerials_getcount(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 * pCount) +Lib3MFResult lib3mf_toolpathprofile_getparameterintegervaluedef(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 nDefaultValue, Lib3MF_int64 * pValue) { - IBase* pIBaseClass = (IBase *)pCompositeMaterials; + IBase* pIBaseClass = (IBase *)pToolpathProfile; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterials, "CompositeMaterials", "GetCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathProfile, "ToolpathProfile", "GetParameterIntegerValueDef"); + pJournalEntry->addStringParameter("NameSpaceName", pNameSpaceName); + pJournalEntry->addStringParameter("ValueName", pValueName); + pJournalEntry->addInt64Parameter("DefaultValue", nDefaultValue); } - if (pCount == nullptr) + if (pNameSpaceName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ICompositeMaterials* pICompositeMaterials = dynamic_cast(pIBaseClass); - if (!pICompositeMaterials) + if (pValueName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pValue == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpaceName(pNameSpaceName); + std::string sValueName(pValueName); + IToolpathProfile* pIToolpathProfile = dynamic_cast(pIBaseClass); + if (!pIToolpathProfile) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pICompositeMaterials->GetCount(); + *pValue = pIToolpathProfile->GetParameterIntegerValueDef(sNameSpaceName, sValueName, nDefaultValue); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); + pJournalEntry->addInt64Result("Value", *pValue); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6412,24 +11493,33 @@ Lib3MFResult lib3mf_compositematerials_getcount(Lib3MF_CompositeMaterials pCompo } } -Lib3MFResult lib3mf_compositematerials_getallpropertyids(Lib3MF_CompositeMaterials pCompositeMaterials, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) +Lib3MFResult lib3mf_toolpathprofile_getparameterboolvalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool * pValue) { - IBase* pIBaseClass = (IBase *)pCompositeMaterials; + IBase* pIBaseClass = (IBase *)pToolpathProfile; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterials, "CompositeMaterials", "GetAllPropertyIDs"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathProfile, "ToolpathProfile", "GetParameterBoolValue"); + pJournalEntry->addStringParameter("NameSpaceName", pNameSpaceName); + pJournalEntry->addStringParameter("ValueName", pValueName); } - if ((!pPropertyIDsBuffer) && !(pPropertyIDsNeededCount)) + if (pNameSpaceName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ICompositeMaterials* pICompositeMaterials = dynamic_cast(pIBaseClass); - if (!pICompositeMaterials) + if (pValueName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pValue == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpaceName(pNameSpaceName); + std::string sValueName(pValueName); + IToolpathProfile* pIToolpathProfile = dynamic_cast(pIBaseClass); + if (!pIToolpathProfile) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pICompositeMaterials->GetAllPropertyIDs(nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); + *pValue = pIToolpathProfile->GetParameterBoolValue(sNameSpaceName, sValueName); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("Value", *pValue); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6445,27 +11535,34 @@ Lib3MFResult lib3mf_compositematerials_getallpropertyids(Lib3MF_CompositeMateria } } -Lib3MFResult lib3mf_compositematerials_getbasematerialgroup(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_BaseMaterialGroup * pBaseMaterialGroupInstance) +Lib3MFResult lib3mf_toolpathprofile_getparameterboolvaluedef(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool bDefaultValue, bool * pValue) { - IBase* pIBaseClass = (IBase *)pCompositeMaterials; + IBase* pIBaseClass = (IBase *)pToolpathProfile; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterials, "CompositeMaterials", "GetBaseMaterialGroup"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathProfile, "ToolpathProfile", "GetParameterBoolValueDef"); + pJournalEntry->addStringParameter("NameSpaceName", pNameSpaceName); + pJournalEntry->addStringParameter("ValueName", pValueName); + pJournalEntry->addBooleanParameter("DefaultValue", bDefaultValue); } - if (pBaseMaterialGroupInstance == nullptr) + if (pNameSpaceName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseBaseMaterialGroupInstance(nullptr); - ICompositeMaterials* pICompositeMaterials = dynamic_cast(pIBaseClass); - if (!pICompositeMaterials) + if (pValueName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pValue == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpaceName(pNameSpaceName); + std::string sValueName(pValueName); + IToolpathProfile* pIToolpathProfile = dynamic_cast(pIBaseClass); + if (!pIToolpathProfile) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseBaseMaterialGroupInstance = pICompositeMaterials->GetBaseMaterialGroup(); + *pValue = pIToolpathProfile->GetParameterBoolValueDef(sNameSpaceName, sValueName, bDefaultValue); - *pBaseMaterialGroupInstance = (IBase*)(pBaseBaseMaterialGroupInstance); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("BaseMaterialGroupInstance", *pBaseMaterialGroupInstance); + pJournalEntry->addBooleanResult("Value", *pValue); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6481,27 +11578,26 @@ Lib3MFResult lib3mf_compositematerials_getbasematerialgroup(Lib3MF_CompositeMate } } -Lib3MFResult lib3mf_compositematerials_addcomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint64 nCompositeBufferSize, const sLib3MFCompositeConstituent * pCompositeBuffer, Lib3MF_uint32 * pPropertyID) +Lib3MFResult lib3mf_toolpathprofile_setname(Lib3MF_ToolpathProfile pToolpathProfile, const char * pName) { - IBase* pIBaseClass = (IBase *)pCompositeMaterials; + IBase* pIBaseClass = (IBase *)pToolpathProfile; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterials, "CompositeMaterials", "AddComposite"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathProfile, "ToolpathProfile", "SetName"); + pJournalEntry->addStringParameter("Name", pName); } - if ( (!pCompositeBuffer) && (nCompositeBufferSize>0)) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (pPropertyID == nullptr) + if (pName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ICompositeMaterials* pICompositeMaterials = dynamic_cast(pIBaseClass); - if (!pICompositeMaterials) + std::string sName(pName); + IToolpathProfile* pIToolpathProfile = dynamic_cast(pIBaseClass); + if (!pIToolpathProfile) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pPropertyID = pICompositeMaterials->AddComposite(nCompositeBufferSize, pCompositeBuffer); + pIToolpathProfile->SetName(sName); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("PropertyID", *pPropertyID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6517,21 +11613,32 @@ Lib3MFResult lib3mf_compositematerials_addcomposite(Lib3MF_CompositeMaterials pC } } -Lib3MFResult lib3mf_compositematerials_removecomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID) +Lib3MFResult lib3mf_toolpathprofile_setparametervalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, const char * pValue) { - IBase* pIBaseClass = (IBase *)pCompositeMaterials; + IBase* pIBaseClass = (IBase *)pToolpathProfile; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterials, "CompositeMaterials", "RemoveComposite"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathProfile, "ToolpathProfile", "SetParameterValue"); + pJournalEntry->addStringParameter("NameSpaceName", pNameSpaceName); + pJournalEntry->addStringParameter("ValueName", pValueName); + pJournalEntry->addStringParameter("Value", pValue); } - ICompositeMaterials* pICompositeMaterials = dynamic_cast(pIBaseClass); - if (!pICompositeMaterials) + if (pNameSpaceName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pValueName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pValue == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpaceName(pNameSpaceName); + std::string sValueName(pValueName); + std::string sValue(pValue); + IToolpathProfile* pIToolpathProfile = dynamic_cast(pIBaseClass); + if (!pIToolpathProfile) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pICompositeMaterials->RemoveComposite(nPropertyID); + pIToolpathProfile->SetParameterValue(sNameSpaceName, sValueName, sValue); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -6549,23 +11656,29 @@ Lib3MFResult lib3mf_compositematerials_removecomposite(Lib3MF_CompositeMaterials } } -Lib3MFResult lib3mf_compositematerials_getcomposite(Lib3MF_CompositeMaterials pCompositeMaterials, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nCompositeBufferSize, Lib3MF_uint64* pCompositeNeededCount, sLib3MFCompositeConstituent * pCompositeBuffer) +Lib3MFResult lib3mf_toolpathprofile_setparameterdoublevalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_double dValue) { - IBase* pIBaseClass = (IBase *)pCompositeMaterials; + IBase* pIBaseClass = (IBase *)pToolpathProfile; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pCompositeMaterials, "CompositeMaterials", "GetComposite"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathProfile, "ToolpathProfile", "SetParameterDoubleValue"); + pJournalEntry->addStringParameter("NameSpaceName", pNameSpaceName); + pJournalEntry->addStringParameter("ValueName", pValueName); + pJournalEntry->addDoubleParameter("Value", dValue); } - if ((!pCompositeBuffer) && !(pCompositeNeededCount)) + if (pNameSpaceName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ICompositeMaterials* pICompositeMaterials = dynamic_cast(pIBaseClass); - if (!pICompositeMaterials) + if (pValueName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpaceName(pNameSpaceName); + std::string sValueName(pValueName); + IToolpathProfile* pIToolpathProfile = dynamic_cast(pIBaseClass); + if (!pIToolpathProfile) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pICompositeMaterials->GetComposite(nPropertyID, nCompositeBufferSize, pCompositeNeededCount, pCompositeBuffer); + pIToolpathProfile->SetParameterDoubleValue(sNameSpaceName, sValueName, dValue); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -6583,29 +11696,31 @@ Lib3MFResult lib3mf_compositematerials_getcomposite(Lib3MF_CompositeMaterials pC } } - -/************************************************************************************************************************* - Class implementation for MultiPropertyGroup -**************************************************************************************************************************/ -Lib3MFResult lib3mf_multipropertygroup_getcount(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount) +Lib3MFResult lib3mf_toolpathprofile_setparameterintegervalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, Lib3MF_int64 nValue) { - IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; + IBase* pIBaseClass = (IBase *)pToolpathProfile; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "GetCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathProfile, "ToolpathProfile", "SetParameterIntegerValue"); + pJournalEntry->addStringParameter("NameSpaceName", pNameSpaceName); + pJournalEntry->addStringParameter("ValueName", pValueName); + pJournalEntry->addInt64Parameter("Value", nValue); } - if (pCount == nullptr) + if (pNameSpaceName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); - if (!pIMultiPropertyGroup) + if (pValueName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpaceName(pNameSpaceName); + std::string sValueName(pValueName); + IToolpathProfile* pIToolpathProfile = dynamic_cast(pIBaseClass); + if (!pIToolpathProfile) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pIMultiPropertyGroup->GetCount(); + pIToolpathProfile->SetParameterIntegerValue(sNameSpaceName, sValueName, nValue); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6621,22 +11736,29 @@ Lib3MFResult lib3mf_multipropertygroup_getcount(Lib3MF_MultiPropertyGroup pMulti } } -Lib3MFResult lib3mf_multipropertygroup_getallpropertyids(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) +Lib3MFResult lib3mf_toolpathprofile_setparameterboolvalue(Lib3MF_ToolpathProfile pToolpathProfile, const char * pNameSpaceName, const char * pValueName, bool bValue) { - IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; + IBase* pIBaseClass = (IBase *)pToolpathProfile; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "GetAllPropertyIDs"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathProfile, "ToolpathProfile", "SetParameterBoolValue"); + pJournalEntry->addStringParameter("NameSpaceName", pNameSpaceName); + pJournalEntry->addStringParameter("ValueName", pValueName); + pJournalEntry->addBooleanParameter("Value", bValue); } - if ((!pPropertyIDsBuffer) && !(pPropertyIDsNeededCount)) + if (pNameSpaceName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); - if (!pIMultiPropertyGroup) + if (pValueName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpaceName(pNameSpaceName); + std::string sValueName(pValueName); + IToolpathProfile* pIToolpathProfile = dynamic_cast(pIBaseClass); + if (!pIToolpathProfile) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMultiPropertyGroup->GetAllPropertyIDs(nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); + pIToolpathProfile->SetParameterBoolValue(sNameSpaceName, sValueName, bValue); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -6654,27 +11776,51 @@ Lib3MFResult lib3mf_multipropertygroup_getallpropertyids(Lib3MF_MultiPropertyGro } } -Lib3MFResult lib3mf_multipropertygroup_addmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer, Lib3MF_uint32 * pPropertyID) + +/************************************************************************************************************************* + Class implementation for ToolpathLayerReader +**************************************************************************************************************************/ +Lib3MFResult lib3mf_toolpathlayerreader_getlayerdatauuid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) { - IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; + IBase* pIBaseClass = (IBase *)pToolpathLayerReader; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "AddMultiProperty"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerReader, "ToolpathLayerReader", "GetLayerDataUUID"); } - if ( (!pPropertyIDsBuffer) && (nPropertyIDsBufferSize>0)) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (pPropertyID == nullptr) + if ( (!pUUIDBuffer) && !(pUUIDNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); - if (!pIMultiPropertyGroup) + std::string sUUID(""); + IToolpathLayerReader* pIToolpathLayerReader = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerReader) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pPropertyID = pIMultiPropertyGroup->AddMultiProperty(nPropertyIDsBufferSize, pPropertyIDsBuffer); + bool isCacheCall = (pUUIDBuffer == nullptr); + if (isCacheCall) { + sUUID = pIToolpathLayerReader->GetLayerDataUUID(); + pIToolpathLayerReader->_setCache (new ParameterCache_1 (sUUID)); + } + else { + auto cache = dynamic_cast*> (pIToolpathLayerReader->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sUUID); + pIToolpathLayerReader->_setCache (nullptr); + } + + if (pUUIDNeededChars) + *pUUIDNeededChars = (Lib3MF_uint32) (sUUID.size()+1); + if (pUUIDBuffer) { + if (sUUID.size() >= nUUIDBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iUUID = 0; iUUID < sUUID.size(); iUUID++) + pUUIDBuffer[iUUID] = sUUID[iUUID]; + pUUIDBuffer[sUUID.size()] = 0; + } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("PropertyID", *pPropertyID); + pJournalEntry->addStringResult("UUID", sUUID.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6690,25 +11836,25 @@ Lib3MFResult lib3mf_multipropertygroup_addmultiproperty(Lib3MF_MultiPropertyGrou } } -Lib3MFResult lib3mf_multipropertygroup_setmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, Lib3MF_uint64 nPropertyIDsBufferSize, const Lib3MF_uint32 * pPropertyIDsBuffer) +Lib3MFResult lib3mf_toolpathlayerreader_getsegmentcount(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 * pCount) { - IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; + IBase* pIBaseClass = (IBase *)pToolpathLayerReader; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "SetMultiProperty"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerReader, "ToolpathLayerReader", "GetSegmentCount"); } - if ( (!pPropertyIDsBuffer) && (nPropertyIDsBufferSize>0)) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); - if (!pIMultiPropertyGroup) + IToolpathLayerReader* pIToolpathLayerReader = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerReader) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMultiPropertyGroup->SetMultiProperty(nPropertyID, nPropertyIDsBufferSize, pPropertyIDsBuffer); + *pCount = pIToolpathLayerReader->GetSegmentCount(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6724,25 +11870,29 @@ Lib3MFResult lib3mf_multipropertygroup_setmultiproperty(Lib3MF_MultiPropertyGrou } } -Lib3MFResult lib3mf_multipropertygroup_getmultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID, const Lib3MF_uint64 nPropertyIDsBufferSize, Lib3MF_uint64* pPropertyIDsNeededCount, Lib3MF_uint32 * pPropertyIDsBuffer) +Lib3MFResult lib3mf_toolpathlayerreader_getsegmentinfo(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, eLib3MFToolpathSegmentType * pType, Lib3MF_uint32 * pPointCount) { - IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; + IBase* pIBaseClass = (IBase *)pToolpathLayerReader; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "GetMultiProperty"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerReader, "ToolpathLayerReader", "GetSegmentInfo"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - if ((!pPropertyIDsBuffer) && !(pPropertyIDsNeededCount)) + if (!pType) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); - if (!pIMultiPropertyGroup) + if (!pPointCount) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IToolpathLayerReader* pIToolpathLayerReader = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerReader) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMultiPropertyGroup->GetMultiProperty(nPropertyID, nPropertyIDsBufferSize, pPropertyIDsNeededCount, pPropertyIDsBuffer); + pIToolpathLayerReader->GetSegmentInfo(nIndex, *pType, *pPointCount); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addEnumResult("Type", "ToolpathSegmentType", (Lib3MF_int32)(*pType)); + pJournalEntry->addUInt32Result("PointCount", *pPointCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6758,23 +11908,28 @@ Lib3MFResult lib3mf_multipropertygroup_getmultiproperty(Lib3MF_MultiPropertyGrou } } -Lib3MFResult lib3mf_multipropertygroup_removemultiproperty(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nPropertyID) +Lib3MFResult lib3mf_toolpathlayerreader_getsegmentprofile(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_ToolpathProfile * pProfile) { - IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; + IBase* pIBaseClass = (IBase *)pToolpathLayerReader; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "RemoveMultiProperty"); - pJournalEntry->addUInt32Parameter("PropertyID", nPropertyID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerReader, "ToolpathLayerReader", "GetSegmentProfile"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); - if (!pIMultiPropertyGroup) + if (pProfile == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseProfile(nullptr); + IToolpathLayerReader* pIToolpathLayerReader = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerReader) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMultiPropertyGroup->RemoveMultiProperty(nPropertyID); + pBaseProfile = pIToolpathLayerReader->GetSegmentProfile(nIndex); + *pProfile = (IBase*)(pBaseProfile); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Profile", *pProfile); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6790,25 +11945,48 @@ Lib3MFResult lib3mf_multipropertygroup_removemultiproperty(Lib3MF_MultiPropertyG } } -Lib3MFResult lib3mf_multipropertygroup_getlayercount(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 * pCount) +Lib3MFResult lib3mf_toolpathlayerreader_getsegmentprofileuuid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nProfileUUIDBufferSize, Lib3MF_uint32* pProfileUUIDNeededChars, char * pProfileUUIDBuffer) { - IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; + IBase* pIBaseClass = (IBase *)pToolpathLayerReader; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "GetLayerCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerReader, "ToolpathLayerReader", "GetSegmentProfileUUID"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - if (pCount == nullptr) + if ( (!pProfileUUIDBuffer) && !(pProfileUUIDNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); - if (!pIMultiPropertyGroup) + std::string sProfileUUID(""); + IToolpathLayerReader* pIToolpathLayerReader = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerReader) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pIMultiPropertyGroup->GetLayerCount(); + bool isCacheCall = (pProfileUUIDBuffer == nullptr); + if (isCacheCall) { + sProfileUUID = pIToolpathLayerReader->GetSegmentProfileUUID(nIndex); + pIToolpathLayerReader->_setCache (new ParameterCache_1 (sProfileUUID)); + } + else { + auto cache = dynamic_cast*> (pIToolpathLayerReader->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sProfileUUID); + pIToolpathLayerReader->_setCache (nullptr); + } + + if (pProfileUUIDNeededChars) + *pProfileUUIDNeededChars = (Lib3MF_uint32) (sProfileUUID.size()+1); + if (pProfileUUIDBuffer) { + if (sProfileUUID.size() >= nProfileUUIDBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iProfileUUID = 0; iProfileUUID < sProfileUUID.size(); iProfileUUID++) + pProfileUUIDBuffer[iProfileUUID] = sProfileUUID[iProfileUUID]; + pProfileUUIDBuffer[sProfileUUID.size()] = 0; + } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("Count", *pCount); + pJournalEntry->addStringResult("ProfileUUID", sProfileUUID.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6824,25 +12002,28 @@ Lib3MFResult lib3mf_multipropertygroup_getlayercount(Lib3MF_MultiPropertyGroup p } } -Lib3MFResult lib3mf_multipropertygroup_addlayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, const sLib3MFMultiPropertyLayer * pTheLayer, Lib3MF_uint32 * pLayerIndex) +Lib3MFResult lib3mf_toolpathlayerreader_getsegmentpart(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_BuildItem * pBuildItem) { - IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; + IBase* pIBaseClass = (IBase *)pToolpathLayerReader; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "AddLayer"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerReader, "ToolpathLayerReader", "GetSegmentPart"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - if (pLayerIndex == nullptr) + if (pBuildItem == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); - if (!pIMultiPropertyGroup) + IBase* pBaseBuildItem(nullptr); + IToolpathLayerReader* pIToolpathLayerReader = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerReader) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pLayerIndex = pIMultiPropertyGroup->AddLayer(*pTheLayer); + pBaseBuildItem = pIToolpathLayerReader->GetSegmentPart(nIndex); + *pBuildItem = (IBase*)(pBaseBuildItem); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("LayerIndex", *pLayerIndex); + pJournalEntry->addHandleResult("BuildItem", *pBuildItem); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6858,25 +12039,48 @@ Lib3MFResult lib3mf_multipropertygroup_addlayer(Lib3MF_MultiPropertyGroup pMulti } } -Lib3MFResult lib3mf_multipropertygroup_getlayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex, sLib3MFMultiPropertyLayer * pTheLayer) +Lib3MFResult lib3mf_toolpathlayerreader_getsegmentpartuuid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nPartUUIDBufferSize, Lib3MF_uint32* pPartUUIDNeededChars, char * pPartUUIDBuffer) { - IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; + IBase* pIBaseClass = (IBase *)pToolpathLayerReader; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "GetLayer"); - pJournalEntry->addUInt32Parameter("LayerIndex", nLayerIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerReader, "ToolpathLayerReader", "GetSegmentPartUUID"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - if (pTheLayer == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); - if (!pIMultiPropertyGroup) + if ( (!pPartUUIDBuffer) && !(pPartUUIDNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sPartUUID(""); + IToolpathLayerReader* pIToolpathLayerReader = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerReader) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pTheLayer = pIMultiPropertyGroup->GetLayer(nLayerIndex); + bool isCacheCall = (pPartUUIDBuffer == nullptr); + if (isCacheCall) { + sPartUUID = pIToolpathLayerReader->GetSegmentPartUUID(nIndex); + pIToolpathLayerReader->_setCache (new ParameterCache_1 (sPartUUID)); + } + else { + auto cache = dynamic_cast*> (pIToolpathLayerReader->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sPartUUID); + pIToolpathLayerReader->_setCache (nullptr); + } + + if (pPartUUIDNeededChars) + *pPartUUIDNeededChars = (Lib3MF_uint32) (sPartUUID.size()+1); + if (pPartUUIDBuffer) { + if (sPartUUID.size() >= nPartUUIDBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iPartUUID = 0; iPartUUID < sPartUUID.size(); iPartUUID++) + pPartUUIDBuffer[iPartUUID] = sPartUUID[iPartUUID]; + pPartUUIDBuffer[sPartUUID.size()] = 0; + } if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("PartUUID", sPartUUID.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6892,23 +12096,26 @@ Lib3MFResult lib3mf_multipropertygroup_getlayer(Lib3MF_MultiPropertyGroup pMulti } } -Lib3MFResult lib3mf_multipropertygroup_removelayer(Lib3MF_MultiPropertyGroup pMultiPropertyGroup, Lib3MF_uint32 nLayerIndex) +Lib3MFResult lib3mf_toolpathlayerreader_getsegmentlocalpartid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 * pLocalPartID) { - IBase* pIBaseClass = (IBase *)pMultiPropertyGroup; + IBase* pIBaseClass = (IBase *)pToolpathLayerReader; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pMultiPropertyGroup, "MultiPropertyGroup", "RemoveLayer"); - pJournalEntry->addUInt32Parameter("LayerIndex", nLayerIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerReader, "ToolpathLayerReader", "GetSegmentLocalPartID"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - IMultiPropertyGroup* pIMultiPropertyGroup = dynamic_cast(pIBaseClass); - if (!pIMultiPropertyGroup) + if (pLocalPartID == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IToolpathLayerReader* pIToolpathLayerReader = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerReader) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIMultiPropertyGroup->RemoveLayer(nLayerIndex); + *pLocalPartID = pIToolpathLayerReader->GetSegmentLocalPartID(nIndex); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("LocalPartID", *pLocalPartID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6924,51 +12131,48 @@ Lib3MFResult lib3mf_multipropertygroup_removelayer(Lib3MF_MultiPropertyGroup pMu } } - -/************************************************************************************************************************* - Class implementation for Attachment -**************************************************************************************************************************/ -Lib3MFResult lib3mf_attachment_getpath(Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer) +Lib3MFResult lib3mf_toolpathlayerreader_getpartuuidbylocalpartid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nLocalPartID, const Lib3MF_uint32 nPartUUIDBufferSize, Lib3MF_uint32* pPartUUIDNeededChars, char * pPartUUIDBuffer) { - IBase* pIBaseClass = (IBase *)pAttachment; + IBase* pIBaseClass = (IBase *)pToolpathLayerReader; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "GetPath"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerReader, "ToolpathLayerReader", "GetPartUUIDByLocalPartID"); + pJournalEntry->addUInt32Parameter("LocalPartID", nLocalPartID); } - if ( (!pPathBuffer) && !(pPathNeededChars) ) + if ( (!pPartUUIDBuffer) && !(pPartUUIDNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sPath(""); - IAttachment* pIAttachment = dynamic_cast(pIBaseClass); - if (!pIAttachment) + std::string sPartUUID(""); + IToolpathLayerReader* pIToolpathLayerReader = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerReader) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pPathBuffer == nullptr); + bool isCacheCall = (pPartUUIDBuffer == nullptr); if (isCacheCall) { - sPath = pIAttachment->GetPath(); + sPartUUID = pIToolpathLayerReader->GetPartUUIDByLocalPartID(nLocalPartID); - pIAttachment->_setCache (new ParameterCache_1 (sPath)); + pIToolpathLayerReader->_setCache (new ParameterCache_1 (sPartUUID)); } else { - auto cache = dynamic_cast*> (pIAttachment->_getCache ()); + auto cache = dynamic_cast*> (pIToolpathLayerReader->_getCache ()); if (cache == nullptr) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sPath); - pIAttachment->_setCache (nullptr); + cache->retrieveData (sPartUUID); + pIToolpathLayerReader->_setCache (nullptr); } - if (pPathNeededChars) - *pPathNeededChars = (Lib3MF_uint32) (sPath.size()+1); - if (pPathBuffer) { - if (sPath.size() >= nPathBufferSize) + if (pPartUUIDNeededChars) + *pPartUUIDNeededChars = (Lib3MF_uint32) (sPartUUID.size()+1); + if (pPartUUIDBuffer) { + if (sPartUUID.size() >= nPartUUIDBufferSize) throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iPath = 0; iPath < sPath.size(); iPath++) - pPathBuffer[iPath] = sPath[iPath]; - pPathBuffer[sPath.size()] = 0; + for (size_t iPartUUID = 0; iPartUUID < sPartUUID.size(); iPartUUID++) + pPartUUIDBuffer[iPartUUID] = sPartUUID[iPartUUID]; + pPartUUIDBuffer[sPartUUID.size()] = 0; } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("Path", sPath.c_str()); + pJournalEntry->addStringResult("PartUUID", sPartUUID.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -6984,24 +12188,23 @@ Lib3MFResult lib3mf_attachment_getpath(Lib3MF_Attachment pAttachment, const Lib3 } } -Lib3MFResult lib3mf_attachment_setpath(Lib3MF_Attachment pAttachment, const char * pPath) +Lib3MFResult lib3mf_toolpathlayerreader_getsegmentpointdata(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint64 nPointDataBufferSize, Lib3MF_uint64* pPointDataNeededCount, sLib3MFPosition2D * pPointDataBuffer) { - IBase* pIBaseClass = (IBase *)pAttachment; + IBase* pIBaseClass = (IBase *)pToolpathLayerReader; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "SetPath"); - pJournalEntry->addStringParameter("Path", pPath); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerReader, "ToolpathLayerReader", "GetSegmentPointData"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - if (pPath == nullptr) + if ((!pPointDataBuffer) && !(pPointDataNeededCount)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sPath(pPath); - IAttachment* pIAttachment = dynamic_cast(pIBaseClass); - if (!pIAttachment) + IToolpathLayerReader* pIToolpathLayerReader = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerReader) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIAttachment->SetPath(sPath); + pIToolpathLayerReader->GetSegmentPointData(nIndex, nPointDataBufferSize, pPointDataNeededCount, pPointDataBuffer); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -7019,27 +12222,36 @@ Lib3MFResult lib3mf_attachment_setpath(Lib3MF_Attachment pAttachment, const char } } -Lib3MFResult lib3mf_attachment_packagepart(Lib3MF_Attachment pAttachment, Lib3MF_PackagePart * pPackagePart) +Lib3MFResult lib3mf_toolpathlayerreader_findattributeinfobyname(Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, Lib3MF_uint32 * pID, eLib3MFToolpathAttributeType * pAttributeType) { - IBase* pIBaseClass = (IBase *)pAttachment; + IBase* pIBaseClass = (IBase *)pToolpathLayerReader; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "PackagePart"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerReader, "ToolpathLayerReader", "FindAttributeInfoByName"); + pJournalEntry->addStringParameter("NameSpace", pNameSpace); + pJournalEntry->addStringParameter("AttributeName", pAttributeName); } - if (pPackagePart == nullptr) + if (pNameSpace == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBasePackagePart(nullptr); - IAttachment* pIAttachment = dynamic_cast(pIBaseClass); - if (!pIAttachment) + if (pAttributeName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (!pID) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (!pAttributeType) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpace(pNameSpace); + std::string sAttributeName(pAttributeName); + IToolpathLayerReader* pIToolpathLayerReader = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerReader) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBasePackagePart = pIAttachment->PackagePart(); + pIToolpathLayerReader->FindAttributeInfoByName(sNameSpace, sAttributeName, *pID, *pAttributeType); - *pPackagePart = (IBase*)(pBasePackagePart); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("PackagePart", *pPackagePart); + pJournalEntry->addUInt32Result("ID", *pID); + pJournalEntry->addEnumResult("AttributeType", "ToolpathAttributeType", (Lib3MF_int32)(*pAttributeType)); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7055,47 +12267,75 @@ Lib3MFResult lib3mf_attachment_packagepart(Lib3MF_Attachment pAttachment, Lib3MF } } -Lib3MFResult lib3mf_attachment_getrelationshiptype(Lib3MF_Attachment pAttachment, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer) +Lib3MFResult lib3mf_toolpathlayerreader_findattributeidbyname(Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, Lib3MF_uint32 * pID) { - IBase* pIBaseClass = (IBase *)pAttachment; + IBase* pIBaseClass = (IBase *)pToolpathLayerReader; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "GetRelationShipType"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerReader, "ToolpathLayerReader", "FindAttributeIDByName"); + pJournalEntry->addStringParameter("NameSpace", pNameSpace); + pJournalEntry->addStringParameter("AttributeName", pAttributeName); } - if ( (!pPathBuffer) && !(pPathNeededChars) ) + if (pNameSpace == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sPath(""); - IAttachment* pIAttachment = dynamic_cast(pIBaseClass); - if (!pIAttachment) + if (pAttributeName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pID == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpace(pNameSpace); + std::string sAttributeName(pAttributeName); + IToolpathLayerReader* pIToolpathLayerReader = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerReader) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pPathBuffer == nullptr); - if (isCacheCall) { - sPath = pIAttachment->GetRelationShipType(); + *pID = pIToolpathLayerReader->FindAttributeIDByName(sNameSpace, sAttributeName); - pIAttachment->_setCache (new ParameterCache_1 (sPath)); - } - else { - auto cache = dynamic_cast*> (pIAttachment->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sPath); - pIAttachment->_setCache (nullptr); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("ID", *pID); + pJournalEntry->writeSuccess(); } - - if (pPathNeededChars) - *pPathNeededChars = (Lib3MF_uint32) (sPath.size()+1); - if (pPathBuffer) { - if (sPath.size() >= nPathBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iPath = 0; iPath < sPath.size(); iPath++) - pPathBuffer[iPath] = sPath[iPath]; - pPathBuffer[sPath.size()] = 0; + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_toolpathlayerreader_findattributevaluebyname(Lib3MF_ToolpathLayerReader pToolpathLayerReader, const char * pNameSpace, const char * pAttributeName, eLib3MFToolpathAttributeType * pAttributeType) +{ + IBase* pIBaseClass = (IBase *)pToolpathLayerReader; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerReader, "ToolpathLayerReader", "FindAttributeValueByName"); + pJournalEntry->addStringParameter("NameSpace", pNameSpace); + pJournalEntry->addStringParameter("AttributeName", pAttributeName); } + if (pNameSpace == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pAttributeName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pAttributeType == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpace(pNameSpace); + std::string sAttributeName(pAttributeName); + IToolpathLayerReader* pIToolpathLayerReader = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerReader) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + *pAttributeType = pIToolpathLayerReader->FindAttributeValueByName(sNameSpace, sAttributeName); + if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("Path", sPath.c_str()); + pJournalEntry->addEnumResult("AttributeType", "ToolpathAttributeType", (Lib3MF_int32)(*pAttributeType)); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7111,26 +12351,27 @@ Lib3MFResult lib3mf_attachment_getrelationshiptype(Lib3MF_Attachment pAttachment } } -Lib3MFResult lib3mf_attachment_setrelationshiptype(Lib3MF_Attachment pAttachment, const char * pPath) +Lib3MFResult lib3mf_toolpathlayerreader_getsegmentintegerattributebyid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 nID, Lib3MF_int64 * pValue) { - IBase* pIBaseClass = (IBase *)pAttachment; + IBase* pIBaseClass = (IBase *)pToolpathLayerReader; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "SetRelationShipType"); - pJournalEntry->addStringParameter("Path", pPath); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerReader, "ToolpathLayerReader", "GetSegmentIntegerAttributeByID"); + pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry->addUInt32Parameter("ID", nID); } - if (pPath == nullptr) + if (pValue == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sPath(pPath); - IAttachment* pIAttachment = dynamic_cast(pIBaseClass); - if (!pIAttachment) + IToolpathLayerReader* pIToolpathLayerReader = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerReader) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIAttachment->SetRelationShipType(sPath); + *pValue = pIToolpathLayerReader->GetSegmentIntegerAttributeByID(nIndex, nID); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addInt64Result("Value", *pValue); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7146,26 +12387,34 @@ Lib3MFResult lib3mf_attachment_setrelationshiptype(Lib3MF_Attachment pAttachment } } -Lib3MFResult lib3mf_attachment_writetofile(Lib3MF_Attachment pAttachment, const char * pFileName) +Lib3MFResult lib3mf_toolpathlayerreader_getsegmentintegerattributebyname(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const char * pNameSpace, const char * pAttributeName, Lib3MF_int64 * pValue) { - IBase* pIBaseClass = (IBase *)pAttachment; + IBase* pIBaseClass = (IBase *)pToolpathLayerReader; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "WriteToFile"); - pJournalEntry->addStringParameter("FileName", pFileName); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerReader, "ToolpathLayerReader", "GetSegmentIntegerAttributeByName"); + pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry->addStringParameter("NameSpace", pNameSpace); + pJournalEntry->addStringParameter("AttributeName", pAttributeName); } - if (pFileName == nullptr) + if (pNameSpace == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sFileName(pFileName); - IAttachment* pIAttachment = dynamic_cast(pIBaseClass); - if (!pIAttachment) + if (pAttributeName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pValue == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpace(pNameSpace); + std::string sAttributeName(pAttributeName); + IToolpathLayerReader* pIToolpathLayerReader = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerReader) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIAttachment->WriteToFile(sFileName); + *pValue = pIToolpathLayerReader->GetSegmentIntegerAttributeByName(nIndex, sNameSpace, sAttributeName); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addInt64Result("Value", *pValue); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7181,26 +12430,27 @@ Lib3MFResult lib3mf_attachment_writetofile(Lib3MF_Attachment pAttachment, const } } -Lib3MFResult lib3mf_attachment_readfromfile(Lib3MF_Attachment pAttachment, const char * pFileName) +Lib3MFResult lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_uint32 nID, Lib3MF_double * pValue) { - IBase* pIBaseClass = (IBase *)pAttachment; + IBase* pIBaseClass = (IBase *)pToolpathLayerReader; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "ReadFromFile"); - pJournalEntry->addStringParameter("FileName", pFileName); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerReader, "ToolpathLayerReader", "GetSegmentDoubleAttributeByID"); + pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry->addUInt32Parameter("ID", nID); } - if (pFileName == nullptr) + if (pValue == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sFileName(pFileName); - IAttachment* pIAttachment = dynamic_cast(pIBaseClass); - if (!pIAttachment) + IToolpathLayerReader* pIToolpathLayerReader = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerReader) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIAttachment->ReadFromFile(sFileName); + *pValue = pIToolpathLayerReader->GetSegmentDoubleAttributeByID(nIndex, nID); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addDoubleResult("Value", *pValue); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7216,24 +12466,34 @@ Lib3MFResult lib3mf_attachment_readfromfile(Lib3MF_Attachment pAttachment, const } } -Lib3MFResult lib3mf_attachment_readfromcallback(Lib3MF_Attachment pAttachment, Lib3MFReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MFSeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData) +Lib3MFResult lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const char * pNameSpace, const char * pAttributeName, Lib3MF_double * pValue) { - IBase* pIBaseClass = (IBase *)pAttachment; + IBase* pIBaseClass = (IBase *)pToolpathLayerReader; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "ReadFromCallback"); - pJournalEntry->addUInt64Parameter("StreamSize", nStreamSize); - pJournalEntry->addPointerParameter("UserData", pUserData); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerReader, "ToolpathLayerReader", "GetSegmentDoubleAttributeByName"); + pJournalEntry->addUInt32Parameter("Index", nIndex); + pJournalEntry->addStringParameter("NameSpace", pNameSpace); + pJournalEntry->addStringParameter("AttributeName", pAttributeName); } - IAttachment* pIAttachment = dynamic_cast(pIBaseClass); - if (!pIAttachment) + if (pNameSpace == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pAttributeName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pValue == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpace(pNameSpace); + std::string sAttributeName(pAttributeName); + IToolpathLayerReader* pIToolpathLayerReader = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerReader) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIAttachment->ReadFromCallback(pTheReadCallback, nStreamSize, pTheSeekCallback, pUserData); + *pValue = pIToolpathLayerReader->GetSegmentDoubleAttributeByName(nIndex, sNameSpace, sAttributeName); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addDoubleResult("Value", *pValue); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7249,25 +12509,25 @@ Lib3MFResult lib3mf_attachment_readfromcallback(Lib3MF_Attachment pAttachment, L } } -Lib3MFResult lib3mf_attachment_getstreamsize(Lib3MF_Attachment pAttachment, Lib3MF_uint64 * pStreamSize) +Lib3MFResult lib3mf_toolpathlayerreader_getcustomdatacount(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 * pCount) { - IBase* pIBaseClass = (IBase *)pAttachment; + IBase* pIBaseClass = (IBase *)pToolpathLayerReader; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "GetStreamSize"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerReader, "ToolpathLayerReader", "GetCustomDataCount"); } - if (pStreamSize == nullptr) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IAttachment* pIAttachment = dynamic_cast(pIBaseClass); - if (!pIAttachment) + IToolpathLayerReader* pIToolpathLayerReader = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerReader) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pStreamSize = pIAttachment->GetStreamSize(); + *pCount = pIToolpathLayerReader->GetCustomDataCount(); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt64Result("StreamSize", *pStreamSize); + pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7283,24 +12543,28 @@ Lib3MFResult lib3mf_attachment_getstreamsize(Lib3MF_Attachment pAttachment, Lib3 } } -Lib3MFResult lib3mf_attachment_writetobuffer(Lib3MF_Attachment pAttachment, const Lib3MF_uint64 nBufferBufferSize, Lib3MF_uint64* pBufferNeededCount, Lib3MF_uint8 * pBufferBuffer) +Lib3MFResult lib3mf_toolpathlayerreader_getcustomdata(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, Lib3MF_CustomDOMTree * pData) { - IBase* pIBaseClass = (IBase *)pAttachment; + IBase* pIBaseClass = (IBase *)pToolpathLayerReader; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "WriteToBuffer"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerReader, "ToolpathLayerReader", "GetCustomData"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - if ((!pBufferBuffer) && !(pBufferNeededCount)) + if (pData == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IAttachment* pIAttachment = dynamic_cast(pIBaseClass); - if (!pIAttachment) + IBase* pBaseData(nullptr); + IToolpathLayerReader* pIToolpathLayerReader = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerReader) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIAttachment->WriteToBuffer(nBufferBufferSize, pBufferNeededCount, pBufferBuffer); + pBaseData = pIToolpathLayerReader->GetCustomData(nIndex); + *pData = (IBase*)(pBaseData); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Data", *pData); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7316,24 +12580,61 @@ Lib3MFResult lib3mf_attachment_writetobuffer(Lib3MF_Attachment pAttachment, cons } } -Lib3MFResult lib3mf_attachment_readfrombuffer(Lib3MF_Attachment pAttachment, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer) +Lib3MFResult lib3mf_toolpathlayerreader_getcustomdataname(Lib3MF_ToolpathLayerReader pToolpathLayerReader, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer, const Lib3MF_uint32 nDataNameBufferSize, Lib3MF_uint32* pDataNameNeededChars, char * pDataNameBuffer) { - IBase* pIBaseClass = (IBase *)pAttachment; + IBase* pIBaseClass = (IBase *)pToolpathLayerReader; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pAttachment, "Attachment", "ReadFromBuffer"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerReader, "ToolpathLayerReader", "GetCustomDataName"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - if ( (!pBufferBuffer) && (nBufferBufferSize>0)) + if ( (!pNameSpaceBuffer) && !(pNameSpaceNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IAttachment* pIAttachment = dynamic_cast(pIBaseClass); - if (!pIAttachment) + if ( (!pDataNameBuffer) && !(pDataNameNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpace(""); + std::string sDataName(""); + IToolpathLayerReader* pIToolpathLayerReader = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerReader) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIAttachment->ReadFromBuffer(nBufferBufferSize, pBufferBuffer); + bool isCacheCall = (pNameSpaceBuffer == nullptr) || (pDataNameBuffer == nullptr); + if (isCacheCall) { + pIToolpathLayerReader->GetCustomDataName(nIndex, sNameSpace, sDataName); + pIToolpathLayerReader->_setCache (new ParameterCache_2 (sNameSpace, sDataName)); + } + else { + auto cache = dynamic_cast*> (pIToolpathLayerReader->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sNameSpace, sDataName); + pIToolpathLayerReader->_setCache (nullptr); + } + + if (pNameSpaceNeededChars) + *pNameSpaceNeededChars = (Lib3MF_uint32) (sNameSpace.size()+1); + if (pNameSpaceBuffer) { + if (sNameSpace.size() >= nNameSpaceBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iNameSpace = 0; iNameSpace < sNameSpace.size(); iNameSpace++) + pNameSpaceBuffer[iNameSpace] = sNameSpace[iNameSpace]; + pNameSpaceBuffer[sNameSpace.size()] = 0; + } + if (pDataNameNeededChars) + *pDataNameNeededChars = (Lib3MF_uint32) (sDataName.size()+1); + if (pDataNameBuffer) { + if (sDataName.size() >= nDataNameBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iDataName = 0; iDataName < sDataName.size(); iDataName++) + pDataNameBuffer[iDataName] = sDataName[iDataName]; + pDataNameBuffer[sDataName.size()] = 0; + } if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("NameSpace", sNameSpace.c_str()); + pJournalEntry->addStringResult("DataName", sDataName.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7351,29 +12652,49 @@ Lib3MFResult lib3mf_attachment_readfrombuffer(Lib3MF_Attachment pAttachment, Lib /************************************************************************************************************************* - Class implementation for Texture2D + Class implementation for ToolpathLayerData **************************************************************************************************************************/ -Lib3MFResult lib3mf_texture2d_getattachment(Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment * pAttachment) +Lib3MFResult lib3mf_toolpathlayerdata_getlayerdatauuid(Lib3MF_ToolpathLayerData pToolpathLayerData, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) { - IBase* pIBaseClass = (IBase *)pTexture2D; + IBase* pIBaseClass = (IBase *)pToolpathLayerData; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "GetAttachment"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerData, "ToolpathLayerData", "GetLayerDataUUID"); } - if (pAttachment == nullptr) + if ( (!pUUIDBuffer) && !(pUUIDNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseAttachment(nullptr); - ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); - if (!pITexture2D) + std::string sUUID(""); + IToolpathLayerData* pIToolpathLayerData = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerData) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseAttachment = pITexture2D->GetAttachment(); + bool isCacheCall = (pUUIDBuffer == nullptr); + if (isCacheCall) { + sUUID = pIToolpathLayerData->GetLayerDataUUID(); - *pAttachment = (IBase*)(pBaseAttachment); + pIToolpathLayerData->_setCache (new ParameterCache_1 (sUUID)); + } + else { + auto cache = dynamic_cast*> (pIToolpathLayerData->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sUUID); + pIToolpathLayerData->_setCache (nullptr); + } + + if (pUUIDNeededChars) + *pUUIDNeededChars = (Lib3MF_uint32) (sUUID.size()+1); + if (pUUIDBuffer) { + if (sUUID.size() >= nUUIDBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iUUID = 0; iUUID < sUUID.size(); iUUID++) + pUUIDBuffer[iUUID] = sUUID[iUUID]; + pUUIDBuffer[sUUID.size()] = 0; + } if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("Attachment", *pAttachment); + pJournalEntry->addStringResult("UUID", sUUID.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7389,28 +12710,31 @@ Lib3MFResult lib3mf_texture2d_getattachment(Lib3MF_Texture2D pTexture2D, Lib3MF_ } } -Lib3MFResult lib3mf_texture2d_setattachment(Lib3MF_Texture2D pTexture2D, Lib3MF_Attachment pAttachment) +Lib3MFResult lib3mf_toolpathlayerdata_registerprofile(Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_ToolpathProfile pProfile, Lib3MF_uint32 * pProfileID) { - IBase* pIBaseClass = (IBase *)pTexture2D; + IBase* pIBaseClass = (IBase *)pToolpathLayerData; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "SetAttachment"); - pJournalEntry->addHandleParameter("Attachment", pAttachment); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerData, "ToolpathLayerData", "RegisterProfile"); + pJournalEntry->addHandleParameter("Profile", pProfile); } - IBase* pIBaseClassAttachment = (IBase *)pAttachment; - IAttachment* pIAttachment = dynamic_cast(pIBaseClassAttachment); - if (!pIAttachment) + if (pProfileID == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pIBaseClassProfile = (IBase *)pProfile; + IToolpathProfile* pIProfile = dynamic_cast(pIBaseClassProfile); + if (!pIProfile) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); - ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); - if (!pITexture2D) + IToolpathLayerData* pIToolpathLayerData = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerData) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pITexture2D->SetAttachment(pIAttachment); + *pProfileID = pIToolpathLayerData->RegisterProfile(pIProfile); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("ProfileID", *pProfileID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7426,25 +12750,31 @@ Lib3MFResult lib3mf_texture2d_setattachment(Lib3MF_Texture2D pTexture2D, Lib3MF_ } } -Lib3MFResult lib3mf_texture2d_getcontenttype(Lib3MF_Texture2D pTexture2D, eLib3MFTextureType * pContentType) +Lib3MFResult lib3mf_toolpathlayerdata_registerbuilditem(Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pPartID) { - IBase* pIBaseClass = (IBase *)pTexture2D; + IBase* pIBaseClass = (IBase *)pToolpathLayerData; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "GetContentType"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerData, "ToolpathLayerData", "RegisterBuildItem"); + pJournalEntry->addHandleParameter("BuildItem", pBuildItem); } - if (pContentType == nullptr) + if (pPartID == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); - if (!pITexture2D) + IBase* pIBaseClassBuildItem = (IBase *)pBuildItem; + IBuildItem* pIBuildItem = dynamic_cast(pIBaseClassBuildItem); + if (!pIBuildItem) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); + + IToolpathLayerData* pIToolpathLayerData = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerData) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pContentType = pITexture2D->GetContentType(); + *pPartID = pIToolpathLayerData->RegisterBuildItem(pIBuildItem); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addEnumResult("ContentType", "TextureType", (Lib3MF_int32)(*pContentType)); + pJournalEntry->addUInt32Result("PartID", *pPartID); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7460,21 +12790,32 @@ Lib3MFResult lib3mf_texture2d_getcontenttype(Lib3MF_Texture2D pTexture2D, eLib3M } } -Lib3MFResult lib3mf_texture2d_setcontenttype(Lib3MF_Texture2D pTexture2D, eLib3MFTextureType eContentType) +Lib3MFResult lib3mf_toolpathlayerdata_setsegmentattribute(Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pAttributeName, const char * pValue) { - IBase* pIBaseClass = (IBase *)pTexture2D; + IBase* pIBaseClass = (IBase *)pToolpathLayerData; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "SetContentType"); - pJournalEntry->addEnumParameter("ContentType", "TextureType", (Lib3MF_int32)(eContentType)); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerData, "ToolpathLayerData", "SetSegmentAttribute"); + pJournalEntry->addStringParameter("NameSpace", pNameSpace); + pJournalEntry->addStringParameter("AttributeName", pAttributeName); + pJournalEntry->addStringParameter("Value", pValue); } - ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); - if (!pITexture2D) + if (pNameSpace == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pAttributeName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pValue == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpace(pNameSpace); + std::string sAttributeName(pAttributeName); + std::string sValue(pValue); + IToolpathLayerData* pIToolpathLayerData = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerData) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pITexture2D->SetContentType(eContentType); + pIToolpathLayerData->SetSegmentAttribute(sNameSpace, sAttributeName, sValue); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -7492,28 +12833,22 @@ Lib3MFResult lib3mf_texture2d_setcontenttype(Lib3MF_Texture2D pTexture2D, eLib3M } } -Lib3MFResult lib3mf_texture2d_gettilestyleuv(Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle * pTileStyleU, eLib3MFTextureTileStyle * pTileStyleV) +Lib3MFResult lib3mf_toolpathlayerdata_clearsegmentattributes(Lib3MF_ToolpathLayerData pToolpathLayerData) { - IBase* pIBaseClass = (IBase *)pTexture2D; + IBase* pIBaseClass = (IBase *)pToolpathLayerData; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "GetTileStyleUV"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerData, "ToolpathLayerData", "ClearSegmentAttributes"); } - if (!pTileStyleU) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (!pTileStyleV) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); - if (!pITexture2D) + IToolpathLayerData* pIToolpathLayerData = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerData) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pITexture2D->GetTileStyleUV(*pTileStyleU, *pTileStyleV); + pIToolpathLayerData->ClearSegmentAttributes(); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addEnumResult("TileStyleU", "TextureTileStyle", (Lib3MF_int32)(*pTileStyleU)); - pJournalEntry->addEnumResult("TileStyleV", "TextureTileStyle", (Lib3MF_int32)(*pTileStyleV)); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7529,22 +12864,24 @@ Lib3MFResult lib3mf_texture2d_gettilestyleuv(Lib3MF_Texture2D pTexture2D, eLib3M } } -Lib3MFResult lib3mf_texture2d_settilestyleuv(Lib3MF_Texture2D pTexture2D, eLib3MFTextureTileStyle eTileStyleU, eLib3MFTextureTileStyle eTileStyleV) +Lib3MFResult lib3mf_toolpathlayerdata_writehatchdata(Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const sLib3MFPosition2D * pPointDataBuffer) { - IBase* pIBaseClass = (IBase *)pTexture2D; + IBase* pIBaseClass = (IBase *)pToolpathLayerData; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "SetTileStyleUV"); - pJournalEntry->addEnumParameter("TileStyleU", "TextureTileStyle", (Lib3MF_int32)(eTileStyleU)); - pJournalEntry->addEnumParameter("TileStyleV", "TextureTileStyle", (Lib3MF_int32)(eTileStyleV)); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerData, "ToolpathLayerData", "WriteHatchData"); + pJournalEntry->addUInt32Parameter("ProfileID", nProfileID); + pJournalEntry->addUInt32Parameter("PartID", nPartID); } - ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); - if (!pITexture2D) + if ( (!pPointDataBuffer) && (nPointDataBufferSize>0)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IToolpathLayerData* pIToolpathLayerData = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerData) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pITexture2D->SetTileStyleUV(eTileStyleU, eTileStyleV); + pIToolpathLayerData->WriteHatchData(nProfileID, nPartID, nPointDataBufferSize, pPointDataBuffer); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -7562,25 +12899,26 @@ Lib3MFResult lib3mf_texture2d_settilestyleuv(Lib3MF_Texture2D pTexture2D, eLib3M } } -Lib3MFResult lib3mf_texture2d_getfilter(Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter * pFilter) +Lib3MFResult lib3mf_toolpathlayerdata_writeloop(Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const sLib3MFPosition2D * pPointDataBuffer) { - IBase* pIBaseClass = (IBase *)pTexture2D; + IBase* pIBaseClass = (IBase *)pToolpathLayerData; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "GetFilter"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerData, "ToolpathLayerData", "WriteLoop"); + pJournalEntry->addUInt32Parameter("ProfileID", nProfileID); + pJournalEntry->addUInt32Parameter("PartID", nPartID); } - if (pFilter == nullptr) + if ( (!pPointDataBuffer) && (nPointDataBufferSize>0)) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); - if (!pITexture2D) + IToolpathLayerData* pIToolpathLayerData = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerData) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pFilter = pITexture2D->GetFilter(); + pIToolpathLayerData->WriteLoop(nProfileID, nPartID, nPointDataBufferSize, pPointDataBuffer); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addEnumResult("Filter", "TextureFilter", (Lib3MF_int32)(*pFilter)); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7596,21 +12934,24 @@ Lib3MFResult lib3mf_texture2d_getfilter(Lib3MF_Texture2D pTexture2D, eLib3MFText } } -Lib3MFResult lib3mf_texture2d_setfilter(Lib3MF_Texture2D pTexture2D, eLib3MFTextureFilter eFilter) +Lib3MFResult lib3mf_toolpathlayerdata_writepolyline(Lib3MF_ToolpathLayerData pToolpathLayerData, Lib3MF_uint32 nProfileID, Lib3MF_uint32 nPartID, Lib3MF_uint64 nPointDataBufferSize, const sLib3MFPosition2D * pPointDataBuffer) { - IBase* pIBaseClass = (IBase *)pTexture2D; + IBase* pIBaseClass = (IBase *)pToolpathLayerData; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pTexture2D, "Texture2D", "SetFilter"); - pJournalEntry->addEnumParameter("Filter", "TextureFilter", (Lib3MF_int32)(eFilter)); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerData, "ToolpathLayerData", "WritePolyline"); + pJournalEntry->addUInt32Parameter("ProfileID", nProfileID); + pJournalEntry->addUInt32Parameter("PartID", nPartID); } - ITexture2D* pITexture2D = dynamic_cast(pIBaseClass); - if (!pITexture2D) + if ( (!pPointDataBuffer) && (nPointDataBufferSize>0)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IToolpathLayerData* pIToolpathLayerData = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerData) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pITexture2D->SetFilter(eFilter); + pIToolpathLayerData->WritePolyline(nProfileID, nPartID, nPointDataBufferSize, pPointDataBuffer); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -7628,31 +12969,35 @@ Lib3MFResult lib3mf_texture2d_setfilter(Lib3MF_Texture2D pTexture2D, eLib3MFText } } - -/************************************************************************************************************************* - Class implementation for BuildItem -**************************************************************************************************************************/ -Lib3MFResult lib3mf_builditem_getobjectresource(Lib3MF_BuildItem pBuildItem, Lib3MF_Object * pObjectResource) +Lib3MFResult lib3mf_toolpathlayerdata_addcustomdata(Lib3MF_ToolpathLayerData pToolpathLayerData, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData) { - IBase* pIBaseClass = (IBase *)pBuildItem; + IBase* pIBaseClass = (IBase *)pToolpathLayerData; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItem, "BuildItem", "GetObjectResource"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerData, "ToolpathLayerData", "AddCustomData"); + pJournalEntry->addStringParameter("NameSpace", pNameSpace); + pJournalEntry->addStringParameter("DataName", pDataName); } - if (pObjectResource == nullptr) + if (pNameSpace == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseObjectResource(nullptr); - IBuildItem* pIBuildItem = dynamic_cast(pIBaseClass); - if (!pIBuildItem) + if (pDataName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pData == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpace(pNameSpace); + std::string sDataName(pDataName); + IBase* pBaseData(nullptr); + IToolpathLayerData* pIToolpathLayerData = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerData) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseObjectResource = pIBuildItem->GetObjectResource(); + pBaseData = pIToolpathLayerData->AddCustomData(sNameSpace, sDataName); - *pObjectResource = (IBase*)(pBaseObjectResource); + *pData = (IBase*)(pBaseData); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("ObjectResource", *pObjectResource); + pJournalEntry->addHandleResult("Data", *pData); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7666,52 +13011,24 @@ Lib3MFResult lib3mf_builditem_getobjectresource(Lib3MF_BuildItem pBuildItem, Lib catch (...) { return handleUnhandledException(pIBaseClass, pJournalEntry.get()); } -} - -Lib3MFResult lib3mf_builditem_getuuid(Lib3MF_BuildItem pBuildItem, bool * pHasUUID, const Lib3MF_uint32 nUUIDBufferSize, Lib3MF_uint32* pUUIDNeededChars, char * pUUIDBuffer) -{ - IBase* pIBaseClass = (IBase *)pBuildItem; - - PLib3MFInterfaceJournalEntry pJournalEntry; - try { - if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItem, "BuildItem", "GetUUID"); - } - if (!pHasUUID) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if ( (!pUUIDBuffer) && !(pUUIDNeededChars) ) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sUUID(""); - IBuildItem* pIBuildItem = dynamic_cast(pIBaseClass); - if (!pIBuildItem) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - - bool isCacheCall = (pUUIDBuffer == nullptr); - if (isCacheCall) { - sUUID = pIBuildItem->GetUUID(*pHasUUID); +} - pIBuildItem->_setCache (new ParameterCache_2 (*pHasUUID, sUUID)); - } - else { - auto cache = dynamic_cast*> (pIBuildItem->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (*pHasUUID, sUUID); - pIBuildItem->_setCache (nullptr); +Lib3MFResult lib3mf_toolpathlayerdata_finish(Lib3MF_ToolpathLayerData pToolpathLayerData) +{ + IBase* pIBaseClass = (IBase *)pToolpathLayerData; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathLayerData, "ToolpathLayerData", "Finish"); } + IToolpathLayerData* pIToolpathLayerData = dynamic_cast(pIBaseClass); + if (!pIToolpathLayerData) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - if (pUUIDNeededChars) - *pUUIDNeededChars = (Lib3MF_uint32) (sUUID.size()+1); - if (pUUIDBuffer) { - if (sUUID.size() >= nUUIDBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iUUID = 0; iUUID < sUUID.size(); iUUID++) - pUUIDBuffer[iUUID] = sUUID[iUUID]; - pUUIDBuffer[sUUID.size()] = 0; - } + pIToolpathLayerData->Finish(); + if (pJournalEntry.get() != nullptr) { - pJournalEntry->addBooleanResult("HasUUID", *pHasUUID); - pJournalEntry->addStringResult("UUID", sUUID.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7727,26 +13044,29 @@ Lib3MFResult lib3mf_builditem_getuuid(Lib3MF_BuildItem pBuildItem, bool * pHasUU } } -Lib3MFResult lib3mf_builditem_setuuid(Lib3MF_BuildItem pBuildItem, const char * pUUID) + +/************************************************************************************************************************* + Class implementation for Toolpath +**************************************************************************************************************************/ +Lib3MFResult lib3mf_toolpath_getunits(Lib3MF_Toolpath pToolpath, Lib3MF_double * pUnits) { - IBase* pIBaseClass = (IBase *)pBuildItem; + IBase* pIBaseClass = (IBase *)pToolpath; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItem, "BuildItem", "SetUUID"); - pJournalEntry->addStringParameter("UUID", pUUID); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpath, "Toolpath", "GetUnits"); } - if (pUUID == nullptr) + if (pUnits == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sUUID(pUUID); - IBuildItem* pIBuildItem = dynamic_cast(pIBaseClass); - if (!pIBuildItem) + IToolpath* pIToolpath = dynamic_cast(pIBaseClass); + if (!pIToolpath) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBuildItem->SetUUID(sUUID); + *pUnits = pIToolpath->GetUnits(); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addDoubleResult("Units", *pUnits); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7762,25 +13082,25 @@ Lib3MFResult lib3mf_builditem_setuuid(Lib3MF_BuildItem pBuildItem, const char * } } -Lib3MFResult lib3mf_builditem_getobjectresourceid(Lib3MF_BuildItem pBuildItem, Lib3MF_uint32 * pUniqueResourceID) +Lib3MFResult lib3mf_toolpath_getlayercount(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount) { - IBase* pIBaseClass = (IBase *)pBuildItem; + IBase* pIBaseClass = (IBase *)pToolpath; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItem, "BuildItem", "GetObjectResourceID"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpath, "Toolpath", "GetLayerCount"); } - if (pUniqueResourceID == nullptr) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBuildItem* pIBuildItem = dynamic_cast(pIBaseClass); - if (!pIBuildItem) + IToolpath* pIToolpath = dynamic_cast(pIBaseClass); + if (!pIToolpath) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pUniqueResourceID = pIBuildItem->GetObjectResourceID(); + *pCount = pIToolpath->GetLayerCount(); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt32Result("UniqueResourceID", *pUniqueResourceID); + pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7796,25 +13116,25 @@ Lib3MFResult lib3mf_builditem_getobjectresourceid(Lib3MF_BuildItem pBuildItem, L } } -Lib3MFResult lib3mf_builditem_hasobjecttransform(Lib3MF_BuildItem pBuildItem, bool * pHasTransform) +Lib3MFResult lib3mf_toolpath_getprofilecount(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount) { - IBase* pIBaseClass = (IBase *)pBuildItem; + IBase* pIBaseClass = (IBase *)pToolpath; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItem, "BuildItem", "HasObjectTransform"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpath, "Toolpath", "GetProfileCount"); } - if (pHasTransform == nullptr) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBuildItem* pIBuildItem = dynamic_cast(pIBaseClass); - if (!pIBuildItem) + IToolpath* pIToolpath = dynamic_cast(pIBaseClass); + if (!pIToolpath) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pHasTransform = pIBuildItem->HasObjectTransform(); + *pCount = pIToolpath->GetProfileCount(); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addBooleanResult("HasTransform", *pHasTransform); + pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7830,24 +13150,38 @@ Lib3MFResult lib3mf_builditem_hasobjecttransform(Lib3MF_BuildItem pBuildItem, bo } } -Lib3MFResult lib3mf_builditem_getobjecttransform(Lib3MF_BuildItem pBuildItem, sLib3MFTransform * pTransform) +Lib3MFResult lib3mf_toolpath_addlayer(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nZMax, const char * pPath, Lib3MF_Writer pModelWriter, Lib3MF_ToolpathLayerData * pLayerData) { - IBase* pIBaseClass = (IBase *)pBuildItem; + IBase* pIBaseClass = (IBase *)pToolpath; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItem, "BuildItem", "GetObjectTransform"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpath, "Toolpath", "AddLayer"); + pJournalEntry->addUInt32Parameter("ZMax", nZMax); + pJournalEntry->addStringParameter("Path", pPath); + pJournalEntry->addHandleParameter("ModelWriter", pModelWriter); } - if (pTransform == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBuildItem* pIBuildItem = dynamic_cast(pIBaseClass); - if (!pIBuildItem) + if (pPath == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pLayerData == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sPath(pPath); + IBase* pIBaseClassModelWriter = (IBase *)pModelWriter; + IWriter* pIModelWriter = dynamic_cast(pIBaseClassModelWriter); + if (!pIModelWriter) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); + + IBase* pBaseLayerData(nullptr); + IToolpath* pIToolpath = dynamic_cast(pIBaseClass); + if (!pIToolpath) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pTransform = pIBuildItem->GetObjectTransform(); + pBaseLayerData = pIToolpath->AddLayer(nZMax, sPath, pIModelWriter); + *pLayerData = (IBase*)(pBaseLayerData); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("LayerData", *pLayerData); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7863,22 +13197,28 @@ Lib3MFResult lib3mf_builditem_getobjecttransform(Lib3MF_BuildItem pBuildItem, sL } } -Lib3MFResult lib3mf_builditem_setobjecttransform(Lib3MF_BuildItem pBuildItem, const sLib3MFTransform * pTransform) +Lib3MFResult lib3mf_toolpath_getlayerattachment(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_Attachment * pAttachment) { - IBase* pIBaseClass = (IBase *)pBuildItem; + IBase* pIBaseClass = (IBase *)pToolpath; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItem, "BuildItem", "SetObjectTransform"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpath, "Toolpath", "GetLayerAttachment"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - IBuildItem* pIBuildItem = dynamic_cast(pIBaseClass); - if (!pIBuildItem) + if (pAttachment == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseAttachment(nullptr); + IToolpath* pIToolpath = dynamic_cast(pIBaseClass); + if (!pIToolpath) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBuildItem->SetObjectTransform(*pTransform); + pBaseAttachment = pIToolpath->GetLayerAttachment(nIndex); + *pAttachment = (IBase*)(pBaseAttachment); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Attachment", *pAttachment); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7894,47 +13234,28 @@ Lib3MFResult lib3mf_builditem_setobjecttransform(Lib3MF_BuildItem pBuildItem, co } } -Lib3MFResult lib3mf_builditem_getpartnumber(Lib3MF_BuildItem pBuildItem, const Lib3MF_uint32 nPartNumberBufferSize, Lib3MF_uint32* pPartNumberNeededChars, char * pPartNumberBuffer) +Lib3MFResult lib3mf_toolpath_readlayerdata(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_ToolpathLayerReader * pToolpathReader) { - IBase* pIBaseClass = (IBase *)pBuildItem; + IBase* pIBaseClass = (IBase *)pToolpath; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItem, "BuildItem", "GetPartNumber"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpath, "Toolpath", "ReadLayerData"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - if ( (!pPartNumberBuffer) && !(pPartNumberNeededChars) ) + if (pToolpathReader == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sPartNumber(""); - IBuildItem* pIBuildItem = dynamic_cast(pIBaseClass); - if (!pIBuildItem) + IBase* pBaseToolpathReader(nullptr); + IToolpath* pIToolpath = dynamic_cast(pIBaseClass); + if (!pIToolpath) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - bool isCacheCall = (pPartNumberBuffer == nullptr); - if (isCacheCall) { - sPartNumber = pIBuildItem->GetPartNumber(); + pBaseToolpathReader = pIToolpath->ReadLayerData(nIndex); - pIBuildItem->_setCache (new ParameterCache_1 (sPartNumber)); - } - else { - auto cache = dynamic_cast*> (pIBuildItem->_getCache ()); - if (cache == nullptr) - throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - cache->retrieveData (sPartNumber); - pIBuildItem->_setCache (nullptr); - } - - if (pPartNumberNeededChars) - *pPartNumberNeededChars = (Lib3MF_uint32) (sPartNumber.size()+1); - if (pPartNumberBuffer) { - if (sPartNumber.size() >= nPartNumberBufferSize) - throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); - for (size_t iPartNumber = 0; iPartNumber < sPartNumber.size(); iPartNumber++) - pPartNumberBuffer[iPartNumber] = sPartNumber[iPartNumber]; - pPartNumberBuffer[sPartNumber.size()] = 0; - } + *pToolpathReader = (IBase*)(pBaseToolpathReader); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addStringResult("PartNumber", sPartNumber.c_str()); + pJournalEntry->addHandleResult("ToolpathReader", *pToolpathReader); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7950,26 +13271,48 @@ Lib3MFResult lib3mf_builditem_getpartnumber(Lib3MF_BuildItem pBuildItem, const L } } -Lib3MFResult lib3mf_builditem_setpartnumber(Lib3MF_BuildItem pBuildItem, const char * pSetPartnumber) +Lib3MFResult lib3mf_toolpath_getlayerpath(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nPathBufferSize, Lib3MF_uint32* pPathNeededChars, char * pPathBuffer) { - IBase* pIBaseClass = (IBase *)pBuildItem; + IBase* pIBaseClass = (IBase *)pToolpath; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItem, "BuildItem", "SetPartNumber"); - pJournalEntry->addStringParameter("SetPartnumber", pSetPartnumber); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpath, "Toolpath", "GetLayerPath"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - if (pSetPartnumber == nullptr) + if ( (!pPathBuffer) && !(pPathNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - std::string sSetPartnumber(pSetPartnumber); - IBuildItem* pIBuildItem = dynamic_cast(pIBaseClass); - if (!pIBuildItem) + std::string sPath(""); + IToolpath* pIToolpath = dynamic_cast(pIBaseClass); + if (!pIToolpath) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pIBuildItem->SetPartNumber(sSetPartnumber); + bool isCacheCall = (pPathBuffer == nullptr); + if (isCacheCall) { + sPath = pIToolpath->GetLayerPath(nIndex); + pIToolpath->_setCache (new ParameterCache_1 (sPath)); + } + else { + auto cache = dynamic_cast*> (pIToolpath->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sPath); + pIToolpath->_setCache (nullptr); + } + + if (pPathNeededChars) + *pPathNeededChars = (Lib3MF_uint32) (sPath.size()+1); + if (pPathBuffer) { + if (sPath.size() >= nPathBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iPath = 0; iPath < sPath.size(); iPath++) + pPathBuffer[iPath] = sPath[iPath]; + pPathBuffer[sPath.size()] = 0; + } if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("Path", sPath.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -7985,27 +13328,26 @@ Lib3MFResult lib3mf_builditem_setpartnumber(Lib3MF_BuildItem pBuildItem, const c } } -Lib3MFResult lib3mf_builditem_getmetadatagroup(Lib3MF_BuildItem pBuildItem, Lib3MF_MetaDataGroup * pMetaDataGroup) +Lib3MFResult lib3mf_toolpath_getlayerzmax(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_uint32 * pZMax) { - IBase* pIBaseClass = (IBase *)pBuildItem; + IBase* pIBaseClass = (IBase *)pToolpath; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItem, "BuildItem", "GetMetaDataGroup"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpath, "Toolpath", "GetLayerZMax"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - if (pMetaDataGroup == nullptr) + if (pZMax == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseMetaDataGroup(nullptr); - IBuildItem* pIBuildItem = dynamic_cast(pIBaseClass); - if (!pIBuildItem) + IToolpath* pIToolpath = dynamic_cast(pIBaseClass); + if (!pIToolpath) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseMetaDataGroup = pIBuildItem->GetMetaDataGroup(); + *pZMax = pIToolpath->GetLayerZMax(nIndex); - *pMetaDataGroup = (IBase*)(pBaseMetaDataGroup); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("MetaDataGroup", *pMetaDataGroup); + pJournalEntry->addUInt32Result("ZMax", *pZMax); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8021,24 +13363,26 @@ Lib3MFResult lib3mf_builditem_getmetadatagroup(Lib3MF_BuildItem pBuildItem, Lib3 } } -Lib3MFResult lib3mf_builditem_getoutbox(Lib3MF_BuildItem pBuildItem, sLib3MFBox * pOutbox) +Lib3MFResult lib3mf_toolpath_getlayerz(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nLayerIndex, Lib3MF_uint32 * pZValue) { - IBase* pIBaseClass = (IBase *)pBuildItem; + IBase* pIBaseClass = (IBase *)pToolpath; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItem, "BuildItem", "GetOutbox"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpath, "Toolpath", "GetLayerZ"); + pJournalEntry->addUInt32Parameter("LayerIndex", nLayerIndex); } - if (pOutbox == nullptr) - throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBuildItem* pIBuildItem = dynamic_cast(pIBaseClass); - if (!pIBuildItem) + if (pZValue == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IToolpath* pIToolpath = dynamic_cast(pIBaseClass); + if (!pIToolpath) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pOutbox = pIBuildItem->GetOutbox(); + *pZValue = pIToolpath->GetLayerZ(nLayerIndex); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addUInt32Result("ZValue", *pZValue); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8054,29 +13398,31 @@ Lib3MFResult lib3mf_builditem_getoutbox(Lib3MF_BuildItem pBuildItem, sLib3MFBox } } - -/************************************************************************************************************************* - Class implementation for BuildItemIterator -**************************************************************************************************************************/ -Lib3MFResult lib3mf_builditemiterator_movenext(Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasNext) +Lib3MFResult lib3mf_toolpath_addprofile(Lib3MF_Toolpath pToolpath, const char * pName, Lib3MF_ToolpathProfile * pProfile) { - IBase* pIBaseClass = (IBase *)pBuildItemIterator; + IBase* pIBaseClass = (IBase *)pToolpath; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItemIterator, "BuildItemIterator", "MoveNext"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpath, "Toolpath", "AddProfile"); + pJournalEntry->addStringParameter("Name", pName); } - if (pHasNext == nullptr) + if (pName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBuildItemIterator* pIBuildItemIterator = dynamic_cast(pIBaseClass); - if (!pIBuildItemIterator) + if (pProfile == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sName(pName); + IBase* pBaseProfile(nullptr); + IToolpath* pIToolpath = dynamic_cast(pIBaseClass); + if (!pIToolpath) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pHasNext = pIBuildItemIterator->MoveNext(); + pBaseProfile = pIToolpath->AddProfile(sName); + *pProfile = (IBase*)(pBaseProfile); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addBooleanResult("HasNext", *pHasNext); + pJournalEntry->addHandleResult("Profile", *pProfile); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8092,25 +13438,28 @@ Lib3MFResult lib3mf_builditemiterator_movenext(Lib3MF_BuildItemIterator pBuildIt } } -Lib3MFResult lib3mf_builditemiterator_moveprevious(Lib3MF_BuildItemIterator pBuildItemIterator, bool * pHasPrevious) +Lib3MFResult lib3mf_toolpath_getprofile(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nProfileIndex, Lib3MF_ToolpathProfile * pProfile) { - IBase* pIBaseClass = (IBase *)pBuildItemIterator; + IBase* pIBaseClass = (IBase *)pToolpath; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItemIterator, "BuildItemIterator", "MovePrevious"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpath, "Toolpath", "GetProfile"); + pJournalEntry->addUInt32Parameter("ProfileIndex", nProfileIndex); } - if (pHasPrevious == nullptr) + if (pProfile == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBuildItemIterator* pIBuildItemIterator = dynamic_cast(pIBaseClass); - if (!pIBuildItemIterator) + IBase* pBaseProfile(nullptr); + IToolpath* pIToolpath = dynamic_cast(pIBaseClass); + if (!pIToolpath) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pHasPrevious = pIBuildItemIterator->MovePrevious(); + pBaseProfile = pIToolpath->GetProfile(nProfileIndex); + *pProfile = (IBase*)(pBaseProfile); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addBooleanResult("HasPrevious", *pHasPrevious); + pJournalEntry->addHandleResult("Profile", *pProfile); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8126,27 +13475,31 @@ Lib3MFResult lib3mf_builditemiterator_moveprevious(Lib3MF_BuildItemIterator pBui } } -Lib3MFResult lib3mf_builditemiterator_getcurrent(Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItem * pBuildItem) +Lib3MFResult lib3mf_toolpath_getprofileuuid(Lib3MF_Toolpath pToolpath, const char * pProfileUUID, Lib3MF_ToolpathProfile * pProfile) { - IBase* pIBaseClass = (IBase *)pBuildItemIterator; + IBase* pIBaseClass = (IBase *)pToolpath; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItemIterator, "BuildItemIterator", "GetCurrent"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpath, "Toolpath", "GetProfileUUID"); + pJournalEntry->addStringParameter("ProfileUUID", pProfileUUID); } - if (pBuildItem == nullptr) + if (pProfileUUID == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseBuildItem(nullptr); - IBuildItemIterator* pIBuildItemIterator = dynamic_cast(pIBaseClass); - if (!pIBuildItemIterator) + if (pProfile == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sProfileUUID(pProfileUUID); + IBase* pBaseProfile(nullptr); + IToolpath* pIToolpath = dynamic_cast(pIBaseClass); + if (!pIToolpath) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseBuildItem = pIBuildItemIterator->GetCurrent(); + pBaseProfile = pIToolpath->GetProfileUUID(sProfileUUID); - *pBuildItem = (IBase*)(pBaseBuildItem); + *pProfile = (IBase*)(pBaseProfile); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("BuildItem", *pBuildItem); + pJournalEntry->addHandleResult("Profile", *pProfile); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8162,27 +13515,25 @@ Lib3MFResult lib3mf_builditemiterator_getcurrent(Lib3MF_BuildItemIterator pBuild } } -Lib3MFResult lib3mf_builditemiterator_clone(Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_BuildItemIterator * pOutBuildItemIterator) +Lib3MFResult lib3mf_toolpath_getcustomdatacount(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pCount) { - IBase* pIBaseClass = (IBase *)pBuildItemIterator; + IBase* pIBaseClass = (IBase *)pToolpath; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItemIterator, "BuildItemIterator", "Clone"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpath, "Toolpath", "GetCustomDataCount"); } - if (pOutBuildItemIterator == nullptr) + if (pCount == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBase* pBaseOutBuildItemIterator(nullptr); - IBuildItemIterator* pIBuildItemIterator = dynamic_cast(pIBaseClass); - if (!pIBuildItemIterator) + IToolpath* pIToolpath = dynamic_cast(pIBaseClass); + if (!pIToolpath) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pBaseOutBuildItemIterator = pIBuildItemIterator->Clone(); + *pCount = pIToolpath->GetCustomDataCount(); - *pOutBuildItemIterator = (IBase*)(pBaseOutBuildItemIterator); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addHandleResult("OutBuildItemIterator", *pOutBuildItemIterator); + pJournalEntry->addUInt32Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8198,25 +13549,28 @@ Lib3MFResult lib3mf_builditemiterator_clone(Lib3MF_BuildItemIterator pBuildItemI } } -Lib3MFResult lib3mf_builditemiterator_count(Lib3MF_BuildItemIterator pBuildItemIterator, Lib3MF_uint64 * pCount) +Lib3MFResult lib3mf_toolpath_getcustomdata(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, Lib3MF_CustomDOMTree * pData) { - IBase* pIBaseClass = (IBase *)pBuildItemIterator; + IBase* pIBaseClass = (IBase *)pToolpath; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pBuildItemIterator, "BuildItemIterator", "Count"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpath, "Toolpath", "GetCustomData"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - if (pCount == nullptr) + if (pData == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - IBuildItemIterator* pIBuildItemIterator = dynamic_cast(pIBaseClass); - if (!pIBuildItemIterator) + IBase* pBaseData(nullptr); + IToolpath* pIToolpath = dynamic_cast(pIBaseClass); + if (!pIToolpath) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pIBuildItemIterator->Count(); + pBaseData = pIToolpath->GetCustomData(nIndex); + *pData = (IBase*)(pBaseData); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt64Result("Count", *pCount); + pJournalEntry->addHandleResult("Data", *pData); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8232,28 +13586,61 @@ Lib3MFResult lib3mf_builditemiterator_count(Lib3MF_BuildItemIterator pBuildItemI } } - -/************************************************************************************************************************* - Class implementation for Slice -**************************************************************************************************************************/ -Lib3MFResult lib3mf_slice_setvertices(Lib3MF_Slice pSlice, Lib3MF_uint64 nVerticesBufferSize, const sLib3MFPosition2D * pVerticesBuffer) +Lib3MFResult lib3mf_toolpath_getcustomdataname(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 nIndex, const Lib3MF_uint32 nNameSpaceBufferSize, Lib3MF_uint32* pNameSpaceNeededChars, char * pNameSpaceBuffer, const Lib3MF_uint32 nDataNameBufferSize, Lib3MF_uint32* pDataNameNeededChars, char * pDataNameBuffer) { - IBase* pIBaseClass = (IBase *)pSlice; + IBase* pIBaseClass = (IBase *)pToolpath; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pSlice, "Slice", "SetVertices"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpath, "Toolpath", "GetCustomDataName"); + pJournalEntry->addUInt32Parameter("Index", nIndex); } - if ( (!pVerticesBuffer) && (nVerticesBufferSize>0)) + if ( (!pNameSpaceBuffer) && !(pNameSpaceNeededChars) ) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ISlice* pISlice = dynamic_cast(pIBaseClass); - if (!pISlice) + if ( (!pDataNameBuffer) && !(pDataNameNeededChars) ) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpace(""); + std::string sDataName(""); + IToolpath* pIToolpath = dynamic_cast(pIBaseClass); + if (!pIToolpath) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pISlice->SetVertices(nVerticesBufferSize, pVerticesBuffer); + bool isCacheCall = (pNameSpaceBuffer == nullptr) || (pDataNameBuffer == nullptr); + if (isCacheCall) { + pIToolpath->GetCustomDataName(nIndex, sNameSpace, sDataName); + pIToolpath->_setCache (new ParameterCache_2 (sNameSpace, sDataName)); + } + else { + auto cache = dynamic_cast*> (pIToolpath->_getCache ()); + if (cache == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + cache->retrieveData (sNameSpace, sDataName); + pIToolpath->_setCache (nullptr); + } + + if (pNameSpaceNeededChars) + *pNameSpaceNeededChars = (Lib3MF_uint32) (sNameSpace.size()+1); + if (pNameSpaceBuffer) { + if (sNameSpace.size() >= nNameSpaceBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iNameSpace = 0; iNameSpace < sNameSpace.size(); iNameSpace++) + pNameSpaceBuffer[iNameSpace] = sNameSpace[iNameSpace]; + pNameSpaceBuffer[sNameSpace.size()] = 0; + } + if (pDataNameNeededChars) + *pDataNameNeededChars = (Lib3MF_uint32) (sDataName.size()+1); + if (pDataNameBuffer) { + if (sDataName.size() >= nDataNameBufferSize) + throw ELib3MFInterfaceException (LIB3MF_ERROR_BUFFERTOOSMALL); + for (size_t iDataName = 0; iDataName < sDataName.size(); iDataName++) + pDataNameBuffer[iDataName] = sDataName[iDataName]; + pDataNameBuffer[sDataName.size()] = 0; + } if (pJournalEntry.get() != nullptr) { + pJournalEntry->addStringResult("NameSpace", sNameSpace.c_str()); + pJournalEntry->addStringResult("DataName", sDataName.c_str()); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8269,24 +13656,33 @@ Lib3MFResult lib3mf_slice_setvertices(Lib3MF_Slice pSlice, Lib3MF_uint64 nVertic } } -Lib3MFResult lib3mf_slice_getvertices(Lib3MF_Slice pSlice, const Lib3MF_uint64 nVerticesBufferSize, Lib3MF_uint64* pVerticesNeededCount, sLib3MFPosition2D * pVerticesBuffer) +Lib3MFResult lib3mf_toolpath_hasuniquecustomdata(Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, bool * pCustomDataExists) { - IBase* pIBaseClass = (IBase *)pSlice; + IBase* pIBaseClass = (IBase *)pToolpath; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pSlice, "Slice", "GetVertices"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpath, "Toolpath", "HasUniqueCustomData"); + pJournalEntry->addStringParameter("NameSpace", pNameSpace); + pJournalEntry->addStringParameter("DataName", pDataName); } - if ((!pVerticesBuffer) && !(pVerticesNeededCount)) + if (pNameSpace == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ISlice* pISlice = dynamic_cast(pIBaseClass); - if (!pISlice) + if (pDataName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pCustomDataExists == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpace(pNameSpace); + std::string sDataName(pDataName); + IToolpath* pIToolpath = dynamic_cast(pIBaseClass); + if (!pIToolpath) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pISlice->GetVertices(nVerticesBufferSize, pVerticesNeededCount, pVerticesBuffer); + *pCustomDataExists = pIToolpath->HasUniqueCustomData(sNameSpace, sDataName); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("CustomDataExists", *pCustomDataExists); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8302,25 +13698,35 @@ Lib3MFResult lib3mf_slice_getvertices(Lib3MF_Slice pSlice, const Lib3MF_uint64 n } } -Lib3MFResult lib3mf_slice_getvertexcount(Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount) +Lib3MFResult lib3mf_toolpath_finduniquecustomdata(Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData) { - IBase* pIBaseClass = (IBase *)pSlice; + IBase* pIBaseClass = (IBase *)pToolpath; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pSlice, "Slice", "GetVertexCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpath, "Toolpath", "FindUniqueCustomData"); + pJournalEntry->addStringParameter("NameSpace", pNameSpace); + pJournalEntry->addStringParameter("DataName", pDataName); } - if (pCount == nullptr) + if (pNameSpace == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ISlice* pISlice = dynamic_cast(pIBaseClass); - if (!pISlice) + if (pDataName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pData == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpace(pNameSpace); + std::string sDataName(pDataName); + IBase* pBaseData(nullptr); + IToolpath* pIToolpath = dynamic_cast(pIBaseClass); + if (!pIToolpath) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pISlice->GetVertexCount(); + pBaseData = pIToolpath->FindUniqueCustomData(sNameSpace, sDataName); + *pData = (IBase*)(pBaseData); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt64Result("Count", *pCount); + pJournalEntry->addHandleResult("Data", *pData); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8336,27 +13742,35 @@ Lib3MFResult lib3mf_slice_getvertexcount(Lib3MF_Slice pSlice, Lib3MF_uint64 * pC } } -Lib3MFResult lib3mf_slice_addpolygon(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer, Lib3MF_uint64 * pIndex) +Lib3MFResult lib3mf_toolpath_addcustomdata(Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pDataName, Lib3MF_CustomDOMTree * pData) { - IBase* pIBaseClass = (IBase *)pSlice; + IBase* pIBaseClass = (IBase *)pToolpath; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pSlice, "Slice", "AddPolygon"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpath, "Toolpath", "AddCustomData"); + pJournalEntry->addStringParameter("NameSpace", pNameSpace); + pJournalEntry->addStringParameter("DataName", pDataName); } - if ( (!pIndicesBuffer) && (nIndicesBufferSize>0)) + if (pNameSpace == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - if (pIndex == nullptr) + if (pDataName == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ISlice* pISlice = dynamic_cast(pIBaseClass); - if (!pISlice) + if (pData == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpace(pNameSpace); + std::string sDataName(pDataName); + IBase* pBaseData(nullptr); + IToolpath* pIToolpath = dynamic_cast(pIBaseClass); + if (!pIToolpath) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pIndex = pISlice->AddPolygon(nIndicesBufferSize, pIndicesBuffer); + pBaseData = pIToolpath->AddCustomData(sNameSpace, sDataName); + *pData = (IBase*)(pBaseData); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt64Result("Index", *pIndex); + pJournalEntry->addHandleResult("Data", *pData); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8372,25 +13786,25 @@ Lib3MFResult lib3mf_slice_addpolygon(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndices } } -Lib3MFResult lib3mf_slice_getpolygoncount(Lib3MF_Slice pSlice, Lib3MF_uint64 * pCount) +Lib3MFResult lib3mf_toolpath_clearcustomdata(Lib3MF_Toolpath pToolpath, Lib3MF_uint32 * pNumberOfDeletedItems) { - IBase* pIBaseClass = (IBase *)pSlice; + IBase* pIBaseClass = (IBase *)pToolpath; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pSlice, "Slice", "GetPolygonCount"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpath, "Toolpath", "ClearCustomData"); } - if (pCount == nullptr) + if (pNumberOfDeletedItems == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ISlice* pISlice = dynamic_cast(pIBaseClass); - if (!pISlice) + IToolpath* pIToolpath = dynamic_cast(pIBaseClass); + if (!pIToolpath) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pISlice->GetPolygonCount(); + *pNumberOfDeletedItems = pIToolpath->ClearCustomData(); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt64Result("Count", *pCount); + pJournalEntry->addUInt32Result("NumberOfDeletedItems", *pNumberOfDeletedItems); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8406,25 +13820,31 @@ Lib3MFResult lib3mf_slice_getpolygoncount(Lib3MF_Slice pSlice, Lib3MF_uint64 * p } } -Lib3MFResult lib3mf_slice_setpolygonindices(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 nIndicesBufferSize, const Lib3MF_uint32 * pIndicesBuffer) +Lib3MFResult lib3mf_toolpath_deletecustomdata(Lib3MF_Toolpath pToolpath, Lib3MF_CustomDOMTree pData, bool * pSuccess) { - IBase* pIBaseClass = (IBase *)pSlice; + IBase* pIBaseClass = (IBase *)pToolpath; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pSlice, "Slice", "SetPolygonIndices"); - pJournalEntry->addUInt64Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpath, "Toolpath", "DeleteCustomData"); + pJournalEntry->addHandleParameter("Data", pData); } - if ( (!pIndicesBuffer) && (nIndicesBufferSize>0)) + if (pSuccess == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ISlice* pISlice = dynamic_cast(pIBaseClass); - if (!pISlice) + IBase* pIBaseClassData = (IBase *)pData; + ICustomDOMTree* pIData = dynamic_cast(pIBaseClassData); + if (!pIData) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDCAST); + + IToolpath* pIToolpath = dynamic_cast(pIBaseClass); + if (!pIToolpath) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pISlice->SetPolygonIndices(nIndex, nIndicesBufferSize, pIndicesBuffer); + *pSuccess = pIToolpath->DeleteCustomData(pIData); if (pJournalEntry.get() != nullptr) { + pJournalEntry->addBooleanResult("Success", *pSuccess); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8440,23 +13860,28 @@ Lib3MFResult lib3mf_slice_setpolygonindices(Lib3MF_Slice pSlice, Lib3MF_uint64 n } } -Lib3MFResult lib3mf_slice_getpolygonindices(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, const Lib3MF_uint64 nIndicesBufferSize, Lib3MF_uint64* pIndicesNeededCount, Lib3MF_uint32 * pIndicesBuffer) +Lib3MFResult lib3mf_toolpath_registercustomintegerattribute(Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pAttributeName) { - IBase* pIBaseClass = (IBase *)pSlice; + IBase* pIBaseClass = (IBase *)pToolpath; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pSlice, "Slice", "GetPolygonIndices"); - pJournalEntry->addUInt64Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpath, "Toolpath", "RegisterCustomIntegerAttribute"); + pJournalEntry->addStringParameter("NameSpace", pNameSpace); + pJournalEntry->addStringParameter("AttributeName", pAttributeName); } - if ((!pIndicesBuffer) && !(pIndicesNeededCount)) + if (pNameSpace == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ISlice* pISlice = dynamic_cast(pIBaseClass); - if (!pISlice) + if (pAttributeName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpace(pNameSpace); + std::string sAttributeName(pAttributeName); + IToolpath* pIToolpath = dynamic_cast(pIBaseClass); + if (!pIToolpath) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - pISlice->GetPolygonIndices(nIndex, nIndicesBufferSize, pIndicesNeededCount, pIndicesBuffer); + pIToolpath->RegisterCustomIntegerAttribute(sNameSpace, sAttributeName); if (pJournalEntry.get() != nullptr) { pJournalEntry->writeSuccess(); @@ -8474,26 +13899,30 @@ Lib3MFResult lib3mf_slice_getpolygonindices(Lib3MF_Slice pSlice, Lib3MF_uint64 n } } -Lib3MFResult lib3mf_slice_getpolygonindexcount(Lib3MF_Slice pSlice, Lib3MF_uint64 nIndex, Lib3MF_uint64 * pCount) +Lib3MFResult lib3mf_toolpath_registercustomdoubleattribute(Lib3MF_Toolpath pToolpath, const char * pNameSpace, const char * pAttributeName) { - IBase* pIBaseClass = (IBase *)pSlice; + IBase* pIBaseClass = (IBase *)pToolpath; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pSlice, "Slice", "GetPolygonIndexCount"); - pJournalEntry->addUInt64Parameter("Index", nIndex); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpath, "Toolpath", "RegisterCustomDoubleAttribute"); + pJournalEntry->addStringParameter("NameSpace", pNameSpace); + pJournalEntry->addStringParameter("AttributeName", pAttributeName); } - if (pCount == nullptr) + if (pNameSpace == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ISlice* pISlice = dynamic_cast(pIBaseClass); - if (!pISlice) + if (pAttributeName == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sNameSpace(pNameSpace); + std::string sAttributeName(pAttributeName); + IToolpath* pIToolpath = dynamic_cast(pIBaseClass); + if (!pIToolpath) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pCount = pISlice->GetPolygonIndexCount(nIndex); + pIToolpath->RegisterCustomDoubleAttribute(sNameSpace, sAttributeName); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addUInt64Result("Count", *pCount); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -8509,25 +13938,31 @@ Lib3MFResult lib3mf_slice_getpolygonindexcount(Lib3MF_Slice pSlice, Lib3MF_uint6 } } -Lib3MFResult lib3mf_slice_getztop(Lib3MF_Slice pSlice, Lib3MF_double * pZTop) + +/************************************************************************************************************************* + Class implementation for ToolpathIterator +**************************************************************************************************************************/ +Lib3MFResult lib3mf_toolpathiterator_getcurrenttoolpath(Lib3MF_ToolpathIterator pToolpathIterator, Lib3MF_Toolpath * pResource) { - IBase* pIBaseClass = (IBase *)pSlice; + IBase* pIBaseClass = (IBase *)pToolpathIterator; PLib3MFInterfaceJournalEntry pJournalEntry; try { if (m_GlobalJournal.get() != nullptr) { - pJournalEntry = m_GlobalJournal->beginClassMethod(pSlice, "Slice", "GetZTop"); + pJournalEntry = m_GlobalJournal->beginClassMethod(pToolpathIterator, "ToolpathIterator", "GetCurrentToolpath"); } - if (pZTop == nullptr) + if (pResource == nullptr) throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); - ISlice* pISlice = dynamic_cast(pIBaseClass); - if (!pISlice) + IBase* pBaseResource(nullptr); + IToolpathIterator* pIToolpathIterator = dynamic_cast(pIBaseClass); + if (!pIToolpathIterator) throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); - *pZTop = pISlice->GetZTop(); + pBaseResource = pIToolpathIterator->GetCurrentToolpath(); + *pResource = (IBase*)(pBaseResource); if (pJournalEntry.get() != nullptr) { - pJournalEntry->addDoubleResult("ZTop", *pZTop); + pJournalEntry->addHandleResult("Resource", *pResource); pJournalEntry->writeSuccess(); } return LIB3MF_SUCCESS; @@ -11778,6 +17213,42 @@ Lib3MFResult lib3mf_model_getmultipropertygroups(Lib3MF_Model pModel, Lib3MF_Mul } } +Lib3MFResult lib3mf_model_gettoolpaths(Lib3MF_Model pModel, Lib3MF_ToolpathIterator * pResourceIterator) +{ + IBase* pIBaseClass = (IBase *)pModel; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pModel, "Model", "GetToolpaths"); + } + if (pResourceIterator == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseResourceIterator(nullptr); + IModel* pIModel = dynamic_cast(pIBaseClass); + if (!pIModel) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseResourceIterator = pIModel->GetToolpaths(); + + *pResourceIterator = (IBase*)(pBaseResourceIterator); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("ResourceIterator", *pResourceIterator); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + Lib3MFResult lib3mf_model_getslicestacks(Lib3MF_Model pModel, Lib3MF_SliceStackIterator * pResourceIterator) { IBase* pIBaseClass = (IBase *)pModel; @@ -12272,6 +17743,43 @@ Lib3MFResult lib3mf_model_removebuilditem(Lib3MF_Model pModel, Lib3MF_BuildItem } } +Lib3MFResult lib3mf_model_addtoolpath(Lib3MF_Model pModel, Lib3MF_double dUnitFactor, Lib3MF_Toolpath * pToolpathInstance) +{ + IBase* pIBaseClass = (IBase *)pModel; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pModel, "Model", "AddToolpath"); + pJournalEntry->addDoubleParameter("UnitFactor", dUnitFactor); + } + if (pToolpathInstance == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseToolpathInstance(nullptr); + IModel* pIModel = dynamic_cast(pIBaseClass); + if (!pIModel) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseToolpathInstance = pIModel->AddToolpath(dUnitFactor); + + *pToolpathInstance = (IBase*)(pBaseToolpathInstance); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("ToolpathInstance", *pToolpathInstance); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + Lib3MFResult lib3mf_model_getmetadatagroup(Lib3MF_Model pModel, Lib3MF_MetaDataGroup * pTheMetaDataGroup) { IBase* pIBaseClass = (IBase *)pModel; @@ -12779,6 +18287,122 @@ Lib3MFResult lib3mf_model_getkeystore(Lib3MF_Model pModel, Lib3MF_KeyStore * pKe } } +Lib3MFResult lib3mf_model_createpersistentsourcefromfile(Lib3MF_Model pModel, const char * pFilename, Lib3MF_PersistentReaderSource * pInstance) +{ + IBase* pIBaseClass = (IBase *)pModel; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pModel, "Model", "CreatePersistentSourceFromFile"); + pJournalEntry->addStringParameter("Filename", pFilename); + } + if (pFilename == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pInstance == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + std::string sFilename(pFilename); + IBase* pBaseInstance(nullptr); + IModel* pIModel = dynamic_cast(pIBaseClass); + if (!pIModel) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseInstance = pIModel->CreatePersistentSourceFromFile(sFilename); + + *pInstance = (IBase*)(pBaseInstance); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Instance", *pInstance); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_model_createpersistentsourcefrombuffer(Lib3MF_Model pModel, Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer, Lib3MF_PersistentReaderSource * pInstance) +{ + IBase* pIBaseClass = (IBase *)pModel; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pModel, "Model", "CreatePersistentSourceFromBuffer"); + } + if ( (!pBufferBuffer) && (nBufferBufferSize>0)) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + if (pInstance == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseInstance(nullptr); + IModel* pIModel = dynamic_cast(pIBaseClass); + if (!pIModel) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseInstance = pIModel->CreatePersistentSourceFromBuffer(nBufferBufferSize, pBufferBuffer); + + *pInstance = (IBase*)(pBaseInstance); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Instance", *pInstance); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + +Lib3MFResult lib3mf_model_createpersistentsourcefromcallback(Lib3MF_Model pModel, Lib3MFReadCallback pTheReadCallback, Lib3MF_uint64 nStreamSize, Lib3MFSeekCallback pTheSeekCallback, Lib3MF_pvoid pUserData, Lib3MF_PersistentReaderSource * pInstance) +{ + IBase* pIBaseClass = (IBase *)pModel; + + PLib3MFInterfaceJournalEntry pJournalEntry; + try { + if (m_GlobalJournal.get() != nullptr) { + pJournalEntry = m_GlobalJournal->beginClassMethod(pModel, "Model", "CreatePersistentSourceFromCallback"); + pJournalEntry->addUInt64Parameter("StreamSize", nStreamSize); + pJournalEntry->addPointerParameter("UserData", pUserData); + } + if (pInstance == nullptr) + throw ELib3MFInterfaceException (LIB3MF_ERROR_INVALIDPARAM); + IBase* pBaseInstance(nullptr); + IModel* pIModel = dynamic_cast(pIBaseClass); + if (!pIModel) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + pBaseInstance = pIModel->CreatePersistentSourceFromCallback(pTheReadCallback, nStreamSize, pTheSeekCallback, pUserData); + + *pInstance = (IBase*)(pBaseInstance); + if (pJournalEntry.get() != nullptr) { + pJournalEntry->addHandleResult("Instance", *pInstance); + pJournalEntry->writeSuccess(); + } + return LIB3MF_SUCCESS; + } + catch (ELib3MFInterfaceException & Exception) { + return handleLib3MFException(pIBaseClass, Exception, pJournalEntry.get()); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException, pJournalEntry.get()); + } + catch (...) { + return handleUnhandledException(pIBaseClass, pJournalEntry.get()); + } +} + /************************************************************************************************************************* @@ -12796,6 +18420,20 @@ Lib3MFResult Lib3MF::Impl::Lib3MF_GetProcAddress (const char * pProcName, void * if (sProcName == "lib3mf_base_classtypeid") *ppProcAddress = (void*) &lib3mf_base_classtypeid; + if (sProcName == "lib3mf_binarystream_getbinarypath") + *ppProcAddress = (void*) &lib3mf_binarystream_getbinarypath; + if (sProcName == "lib3mf_binarystream_getindexpath") + *ppProcAddress = (void*) &lib3mf_binarystream_getindexpath; + if (sProcName == "lib3mf_binarystream_getuuid") + *ppProcAddress = (void*) &lib3mf_binarystream_getuuid; + if (sProcName == "lib3mf_binarystream_disablediscretizedarraycompression") + *ppProcAddress = (void*) &lib3mf_binarystream_disablediscretizedarraycompression; + if (sProcName == "lib3mf_binarystream_enablediscretizedarraycompression") + *ppProcAddress = (void*) &lib3mf_binarystream_enablediscretizedarraycompression; + if (sProcName == "lib3mf_binarystream_enablelzma") + *ppProcAddress = (void*) &lib3mf_binarystream_enablelzma; + if (sProcName == "lib3mf_binarystream_disablelzma") + *ppProcAddress = (void*) &lib3mf_binarystream_disablelzma; if (sProcName == "lib3mf_writer_writetofile") *ppProcAddress = (void*) &lib3mf_writer_writetofile; if (sProcName == "lib3mf_writer_getstreamsize") @@ -12822,6 +18460,20 @@ Lib3MFResult Lib3MF::Impl::Lib3MF_GetProcAddress (const char * pProcName, void * *ppProcAddress = (void*) &lib3mf_writer_addkeywrappingcallback; if (sProcName == "lib3mf_writer_setcontentencryptioncallback") *ppProcAddress = (void*) &lib3mf_writer_setcontentencryptioncallback; + if (sProcName == "lib3mf_writer_createbinarystream") + *ppProcAddress = (void*) &lib3mf_writer_createbinarystream; + if (sProcName == "lib3mf_writer_assignbinarystream") + *ppProcAddress = (void*) &lib3mf_writer_assignbinarystream; + if (sProcName == "lib3mf_writer_registercustomnamespace") + *ppProcAddress = (void*) &lib3mf_writer_registercustomnamespace; + if (sProcName == "lib3mf_persistentreadersource_getsourcetype") + *ppProcAddress = (void*) &lib3mf_persistentreadersource_getsourcetype; + if (sProcName == "lib3mf_persistentreadersource_invalidatesourcedata") + *ppProcAddress = (void*) &lib3mf_persistentreadersource_invalidatesourcedata; + if (sProcName == "lib3mf_persistentreadersource_sourcedataisvalid") + *ppProcAddress = (void*) &lib3mf_persistentreadersource_sourcedataisvalid; + if (sProcName == "lib3mf_reader_readfrompersistentsource") + *ppProcAddress = (void*) &lib3mf_reader_readfrompersistentsource; if (sProcName == "lib3mf_reader_readfromfile") *ppProcAddress = (void*) &lib3mf_reader_readfromfile; if (sProcName == "lib3mf_reader_readfrombuffer") @@ -12870,6 +18522,96 @@ Lib3MFResult Lib3MF::Impl::Lib3MF_GetProcAddress (const char * pProcName, void * *ppProcAddress = (void*) &lib3mf_resourceiterator_clone; if (sProcName == "lib3mf_resourceiterator_count") *ppProcAddress = (void*) &lib3mf_resourceiterator_count; + if (sProcName == "lib3mf_customxmlattribute_getname") + *ppProcAddress = (void*) &lib3mf_customxmlattribute_getname; + if (sProcName == "lib3mf_customxmlattribute_getvalue") + *ppProcAddress = (void*) &lib3mf_customxmlattribute_getvalue; + if (sProcName == "lib3mf_customxmlattribute_isvalidinteger") + *ppProcAddress = (void*) &lib3mf_customxmlattribute_isvalidinteger; + if (sProcName == "lib3mf_customxmlattribute_getintegervalue") + *ppProcAddress = (void*) &lib3mf_customxmlattribute_getintegervalue; + if (sProcName == "lib3mf_customxmlattribute_isvaliddouble") + *ppProcAddress = (void*) &lib3mf_customxmlattribute_isvaliddouble; + if (sProcName == "lib3mf_customxmlattribute_getdoublevalue") + *ppProcAddress = (void*) &lib3mf_customxmlattribute_getdoublevalue; + if (sProcName == "lib3mf_customxmlattribute_isvalidbool") + *ppProcAddress = (void*) &lib3mf_customxmlattribute_isvalidbool; + if (sProcName == "lib3mf_customxmlattribute_getboolvalue") + *ppProcAddress = (void*) &lib3mf_customxmlattribute_getboolvalue; + if (sProcName == "lib3mf_customxmlattribute_setvalue") + *ppProcAddress = (void*) &lib3mf_customxmlattribute_setvalue; + if (sProcName == "lib3mf_customxmlattribute_setintegervalue") + *ppProcAddress = (void*) &lib3mf_customxmlattribute_setintegervalue; + if (sProcName == "lib3mf_customxmlattribute_setdoublevalue") + *ppProcAddress = (void*) &lib3mf_customxmlattribute_setdoublevalue; + if (sProcName == "lib3mf_customxmlattribute_setboolvalue") + *ppProcAddress = (void*) &lib3mf_customxmlattribute_setboolvalue; + if (sProcName == "lib3mf_customxmlattribute_remove") + *ppProcAddress = (void*) &lib3mf_customxmlattribute_remove; + if (sProcName == "lib3mf_customxmlnode_getname") + *ppProcAddress = (void*) &lib3mf_customxmlnode_getname; + if (sProcName == "lib3mf_customxmlnode_getnamespace") + *ppProcAddress = (void*) &lib3mf_customxmlnode_getnamespace; + if (sProcName == "lib3mf_customxmlnode_getattributecount") + *ppProcAddress = (void*) &lib3mf_customxmlnode_getattributecount; + if (sProcName == "lib3mf_customxmlnode_getattribute") + *ppProcAddress = (void*) &lib3mf_customxmlnode_getattribute; + if (sProcName == "lib3mf_customxmlnode_hasattribute") + *ppProcAddress = (void*) &lib3mf_customxmlnode_hasattribute; + if (sProcName == "lib3mf_customxmlnode_findattribute") + *ppProcAddress = (void*) &lib3mf_customxmlnode_findattribute; + if (sProcName == "lib3mf_customxmlnode_removeattribute") + *ppProcAddress = (void*) &lib3mf_customxmlnode_removeattribute; + if (sProcName == "lib3mf_customxmlnode_removeattributebyindex") + *ppProcAddress = (void*) &lib3mf_customxmlnode_removeattributebyindex; + if (sProcName == "lib3mf_customxmlnode_addattribute") + *ppProcAddress = (void*) &lib3mf_customxmlnode_addattribute; + if (sProcName == "lib3mf_customxmlnode_addintegerattribute") + *ppProcAddress = (void*) &lib3mf_customxmlnode_addintegerattribute; + if (sProcName == "lib3mf_customxmlnode_adddoubleattribute") + *ppProcAddress = (void*) &lib3mf_customxmlnode_adddoubleattribute; + if (sProcName == "lib3mf_customxmlnode_addboolattribute") + *ppProcAddress = (void*) &lib3mf_customxmlnode_addboolattribute; + if (sProcName == "lib3mf_customxmlnode_getchildren") + *ppProcAddress = (void*) &lib3mf_customxmlnode_getchildren; + if (sProcName == "lib3mf_customxmlnode_countchildrenbyname") + *ppProcAddress = (void*) &lib3mf_customxmlnode_countchildrenbyname; + if (sProcName == "lib3mf_customxmlnode_getchildrenbyname") + *ppProcAddress = (void*) &lib3mf_customxmlnode_getchildrenbyname; + if (sProcName == "lib3mf_customxmlnode_haschild") + *ppProcAddress = (void*) &lib3mf_customxmlnode_haschild; + if (sProcName == "lib3mf_customxmlnode_hasuniquechild") + *ppProcAddress = (void*) &lib3mf_customxmlnode_hasuniquechild; + if (sProcName == "lib3mf_customxmlnode_findchild") + *ppProcAddress = (void*) &lib3mf_customxmlnode_findchild; + if (sProcName == "lib3mf_customxmlnode_addchild") + *ppProcAddress = (void*) &lib3mf_customxmlnode_addchild; + if (sProcName == "lib3mf_customxmlnode_removechild") + *ppProcAddress = (void*) &lib3mf_customxmlnode_removechild; + if (sProcName == "lib3mf_customxmlnode_removechildrenwithname") + *ppProcAddress = (void*) &lib3mf_customxmlnode_removechildrenwithname; + if (sProcName == "lib3mf_customxmlnode_remove") + *ppProcAddress = (void*) &lib3mf_customxmlnode_remove; + if (sProcName == "lib3mf_customxmlnodes_getnodecount") + *ppProcAddress = (void*) &lib3mf_customxmlnodes_getnodecount; + if (sProcName == "lib3mf_customxmlnodes_getnode") + *ppProcAddress = (void*) &lib3mf_customxmlnodes_getnode; + if (sProcName == "lib3mf_customxmlnodes_countnodesbyname") + *ppProcAddress = (void*) &lib3mf_customxmlnodes_countnodesbyname; + if (sProcName == "lib3mf_customxmlnodes_getnodesbyname") + *ppProcAddress = (void*) &lib3mf_customxmlnodes_getnodesbyname; + if (sProcName == "lib3mf_customxmlnodes_hasnode") + *ppProcAddress = (void*) &lib3mf_customxmlnodes_hasnode; + if (sProcName == "lib3mf_customxmlnodes_hasuniquenode") + *ppProcAddress = (void*) &lib3mf_customxmlnodes_hasuniquenode; + if (sProcName == "lib3mf_customxmlnodes_findnode") + *ppProcAddress = (void*) &lib3mf_customxmlnodes_findnode; + if (sProcName == "lib3mf_customdomtree_getnamespace") + *ppProcAddress = (void*) &lib3mf_customdomtree_getnamespace; + if (sProcName == "lib3mf_customdomtree_getrootnode") + *ppProcAddress = (void*) &lib3mf_customdomtree_getrootnode; + if (sProcName == "lib3mf_customdomtree_savetostring") + *ppProcAddress = (void*) &lib3mf_customdomtree_savetostring; if (sProcName == "lib3mf_slicestackiterator_getcurrentslicestack") *ppProcAddress = (void*) &lib3mf_slicestackiterator_getcurrentslicestack; if (sProcName == "lib3mf_objectiterator_getcurrentobject") @@ -13254,6 +18996,150 @@ Lib3MFResult Lib3MF::Impl::Lib3MF_GetProcAddress (const char * pProcName, void * *ppProcAddress = (void*) &lib3mf_slice_getpolygonindexcount; if (sProcName == "lib3mf_slice_getztop") *ppProcAddress = (void*) &lib3mf_slice_getztop; + if (sProcName == "lib3mf_toolpathprofile_getuuid") + *ppProcAddress = (void*) &lib3mf_toolpathprofile_getuuid; + if (sProcName == "lib3mf_toolpathprofile_getname") + *ppProcAddress = (void*) &lib3mf_toolpathprofile_getname; + if (sProcName == "lib3mf_toolpathprofile_getparametercount") + *ppProcAddress = (void*) &lib3mf_toolpathprofile_getparametercount; + if (sProcName == "lib3mf_toolpathprofile_getparametername") + *ppProcAddress = (void*) &lib3mf_toolpathprofile_getparametername; + if (sProcName == "lib3mf_toolpathprofile_getparameternamespace") + *ppProcAddress = (void*) &lib3mf_toolpathprofile_getparameternamespace; + if (sProcName == "lib3mf_toolpathprofile_hasparametervalue") + *ppProcAddress = (void*) &lib3mf_toolpathprofile_hasparametervalue; + if (sProcName == "lib3mf_toolpathprofile_getparametervalue") + *ppProcAddress = (void*) &lib3mf_toolpathprofile_getparametervalue; + if (sProcName == "lib3mf_toolpathprofile_getparametervaluedef") + *ppProcAddress = (void*) &lib3mf_toolpathprofile_getparametervaluedef; + if (sProcName == "lib3mf_toolpathprofile_getparameterdoublevalue") + *ppProcAddress = (void*) &lib3mf_toolpathprofile_getparameterdoublevalue; + if (sProcName == "lib3mf_toolpathprofile_getparameterdoublevaluedef") + *ppProcAddress = (void*) &lib3mf_toolpathprofile_getparameterdoublevaluedef; + if (sProcName == "lib3mf_toolpathprofile_getparameterintegervalue") + *ppProcAddress = (void*) &lib3mf_toolpathprofile_getparameterintegervalue; + if (sProcName == "lib3mf_toolpathprofile_getparameterintegervaluedef") + *ppProcAddress = (void*) &lib3mf_toolpathprofile_getparameterintegervaluedef; + if (sProcName == "lib3mf_toolpathprofile_getparameterboolvalue") + *ppProcAddress = (void*) &lib3mf_toolpathprofile_getparameterboolvalue; + if (sProcName == "lib3mf_toolpathprofile_getparameterboolvaluedef") + *ppProcAddress = (void*) &lib3mf_toolpathprofile_getparameterboolvaluedef; + if (sProcName == "lib3mf_toolpathprofile_setname") + *ppProcAddress = (void*) &lib3mf_toolpathprofile_setname; + if (sProcName == "lib3mf_toolpathprofile_setparametervalue") + *ppProcAddress = (void*) &lib3mf_toolpathprofile_setparametervalue; + if (sProcName == "lib3mf_toolpathprofile_setparameterdoublevalue") + *ppProcAddress = (void*) &lib3mf_toolpathprofile_setparameterdoublevalue; + if (sProcName == "lib3mf_toolpathprofile_setparameterintegervalue") + *ppProcAddress = (void*) &lib3mf_toolpathprofile_setparameterintegervalue; + if (sProcName == "lib3mf_toolpathprofile_setparameterboolvalue") + *ppProcAddress = (void*) &lib3mf_toolpathprofile_setparameterboolvalue; + if (sProcName == "lib3mf_toolpathlayerreader_getlayerdatauuid") + *ppProcAddress = (void*) &lib3mf_toolpathlayerreader_getlayerdatauuid; + if (sProcName == "lib3mf_toolpathlayerreader_getsegmentcount") + *ppProcAddress = (void*) &lib3mf_toolpathlayerreader_getsegmentcount; + if (sProcName == "lib3mf_toolpathlayerreader_getsegmentinfo") + *ppProcAddress = (void*) &lib3mf_toolpathlayerreader_getsegmentinfo; + if (sProcName == "lib3mf_toolpathlayerreader_getsegmentprofile") + *ppProcAddress = (void*) &lib3mf_toolpathlayerreader_getsegmentprofile; + if (sProcName == "lib3mf_toolpathlayerreader_getsegmentprofileuuid") + *ppProcAddress = (void*) &lib3mf_toolpathlayerreader_getsegmentprofileuuid; + if (sProcName == "lib3mf_toolpathlayerreader_getsegmentpart") + *ppProcAddress = (void*) &lib3mf_toolpathlayerreader_getsegmentpart; + if (sProcName == "lib3mf_toolpathlayerreader_getsegmentpartuuid") + *ppProcAddress = (void*) &lib3mf_toolpathlayerreader_getsegmentpartuuid; + if (sProcName == "lib3mf_toolpathlayerreader_getsegmentlocalpartid") + *ppProcAddress = (void*) &lib3mf_toolpathlayerreader_getsegmentlocalpartid; + if (sProcName == "lib3mf_toolpathlayerreader_getpartuuidbylocalpartid") + *ppProcAddress = (void*) &lib3mf_toolpathlayerreader_getpartuuidbylocalpartid; + if (sProcName == "lib3mf_toolpathlayerreader_getsegmentpointdata") + *ppProcAddress = (void*) &lib3mf_toolpathlayerreader_getsegmentpointdata; + if (sProcName == "lib3mf_toolpathlayerreader_findattributeinfobyname") + *ppProcAddress = (void*) &lib3mf_toolpathlayerreader_findattributeinfobyname; + if (sProcName == "lib3mf_toolpathlayerreader_findattributeidbyname") + *ppProcAddress = (void*) &lib3mf_toolpathlayerreader_findattributeidbyname; + if (sProcName == "lib3mf_toolpathlayerreader_findattributevaluebyname") + *ppProcAddress = (void*) &lib3mf_toolpathlayerreader_findattributevaluebyname; + if (sProcName == "lib3mf_toolpathlayerreader_getsegmentintegerattributebyid") + *ppProcAddress = (void*) &lib3mf_toolpathlayerreader_getsegmentintegerattributebyid; + if (sProcName == "lib3mf_toolpathlayerreader_getsegmentintegerattributebyname") + *ppProcAddress = (void*) &lib3mf_toolpathlayerreader_getsegmentintegerattributebyname; + if (sProcName == "lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid") + *ppProcAddress = (void*) &lib3mf_toolpathlayerreader_getsegmentdoubleattributebyid; + if (sProcName == "lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname") + *ppProcAddress = (void*) &lib3mf_toolpathlayerreader_getsegmentdoubleattributebyname; + if (sProcName == "lib3mf_toolpathlayerreader_getcustomdatacount") + *ppProcAddress = (void*) &lib3mf_toolpathlayerreader_getcustomdatacount; + if (sProcName == "lib3mf_toolpathlayerreader_getcustomdata") + *ppProcAddress = (void*) &lib3mf_toolpathlayerreader_getcustomdata; + if (sProcName == "lib3mf_toolpathlayerreader_getcustomdataname") + *ppProcAddress = (void*) &lib3mf_toolpathlayerreader_getcustomdataname; + if (sProcName == "lib3mf_toolpathlayerdata_getlayerdatauuid") + *ppProcAddress = (void*) &lib3mf_toolpathlayerdata_getlayerdatauuid; + if (sProcName == "lib3mf_toolpathlayerdata_registerprofile") + *ppProcAddress = (void*) &lib3mf_toolpathlayerdata_registerprofile; + if (sProcName == "lib3mf_toolpathlayerdata_registerbuilditem") + *ppProcAddress = (void*) &lib3mf_toolpathlayerdata_registerbuilditem; + if (sProcName == "lib3mf_toolpathlayerdata_setsegmentattribute") + *ppProcAddress = (void*) &lib3mf_toolpathlayerdata_setsegmentattribute; + if (sProcName == "lib3mf_toolpathlayerdata_clearsegmentattributes") + *ppProcAddress = (void*) &lib3mf_toolpathlayerdata_clearsegmentattributes; + if (sProcName == "lib3mf_toolpathlayerdata_writehatchdata") + *ppProcAddress = (void*) &lib3mf_toolpathlayerdata_writehatchdata; + if (sProcName == "lib3mf_toolpathlayerdata_writeloop") + *ppProcAddress = (void*) &lib3mf_toolpathlayerdata_writeloop; + if (sProcName == "lib3mf_toolpathlayerdata_writepolyline") + *ppProcAddress = (void*) &lib3mf_toolpathlayerdata_writepolyline; + if (sProcName == "lib3mf_toolpathlayerdata_addcustomdata") + *ppProcAddress = (void*) &lib3mf_toolpathlayerdata_addcustomdata; + if (sProcName == "lib3mf_toolpathlayerdata_finish") + *ppProcAddress = (void*) &lib3mf_toolpathlayerdata_finish; + if (sProcName == "lib3mf_toolpath_getunits") + *ppProcAddress = (void*) &lib3mf_toolpath_getunits; + if (sProcName == "lib3mf_toolpath_getlayercount") + *ppProcAddress = (void*) &lib3mf_toolpath_getlayercount; + if (sProcName == "lib3mf_toolpath_getprofilecount") + *ppProcAddress = (void*) &lib3mf_toolpath_getprofilecount; + if (sProcName == "lib3mf_toolpath_addlayer") + *ppProcAddress = (void*) &lib3mf_toolpath_addlayer; + if (sProcName == "lib3mf_toolpath_getlayerattachment") + *ppProcAddress = (void*) &lib3mf_toolpath_getlayerattachment; + if (sProcName == "lib3mf_toolpath_readlayerdata") + *ppProcAddress = (void*) &lib3mf_toolpath_readlayerdata; + if (sProcName == "lib3mf_toolpath_getlayerpath") + *ppProcAddress = (void*) &lib3mf_toolpath_getlayerpath; + if (sProcName == "lib3mf_toolpath_getlayerzmax") + *ppProcAddress = (void*) &lib3mf_toolpath_getlayerzmax; + if (sProcName == "lib3mf_toolpath_getlayerz") + *ppProcAddress = (void*) &lib3mf_toolpath_getlayerz; + if (sProcName == "lib3mf_toolpath_addprofile") + *ppProcAddress = (void*) &lib3mf_toolpath_addprofile; + if (sProcName == "lib3mf_toolpath_getprofile") + *ppProcAddress = (void*) &lib3mf_toolpath_getprofile; + if (sProcName == "lib3mf_toolpath_getprofileuuid") + *ppProcAddress = (void*) &lib3mf_toolpath_getprofileuuid; + if (sProcName == "lib3mf_toolpath_getcustomdatacount") + *ppProcAddress = (void*) &lib3mf_toolpath_getcustomdatacount; + if (sProcName == "lib3mf_toolpath_getcustomdata") + *ppProcAddress = (void*) &lib3mf_toolpath_getcustomdata; + if (sProcName == "lib3mf_toolpath_getcustomdataname") + *ppProcAddress = (void*) &lib3mf_toolpath_getcustomdataname; + if (sProcName == "lib3mf_toolpath_hasuniquecustomdata") + *ppProcAddress = (void*) &lib3mf_toolpath_hasuniquecustomdata; + if (sProcName == "lib3mf_toolpath_finduniquecustomdata") + *ppProcAddress = (void*) &lib3mf_toolpath_finduniquecustomdata; + if (sProcName == "lib3mf_toolpath_addcustomdata") + *ppProcAddress = (void*) &lib3mf_toolpath_addcustomdata; + if (sProcName == "lib3mf_toolpath_clearcustomdata") + *ppProcAddress = (void*) &lib3mf_toolpath_clearcustomdata; + if (sProcName == "lib3mf_toolpath_deletecustomdata") + *ppProcAddress = (void*) &lib3mf_toolpath_deletecustomdata; + if (sProcName == "lib3mf_toolpath_registercustomintegerattribute") + *ppProcAddress = (void*) &lib3mf_toolpath_registercustomintegerattribute; + if (sProcName == "lib3mf_toolpath_registercustomdoubleattribute") + *ppProcAddress = (void*) &lib3mf_toolpath_registercustomdoubleattribute; + if (sProcName == "lib3mf_toolpathiterator_getcurrenttoolpath") + *ppProcAddress = (void*) &lib3mf_toolpathiterator_getcurrenttoolpath; if (sProcName == "lib3mf_slicestack_getbottomz") *ppProcAddress = (void*) &lib3mf_slicestack_getbottomz; if (sProcName == "lib3mf_slicestack_getslicecount") @@ -13420,6 +19306,8 @@ Lib3MFResult Lib3MF::Impl::Lib3MF_GetProcAddress (const char * pProcName, void * *ppProcAddress = (void*) &lib3mf_model_getcompositematerials; if (sProcName == "lib3mf_model_getmultipropertygroups") *ppProcAddress = (void*) &lib3mf_model_getmultipropertygroups; + if (sProcName == "lib3mf_model_gettoolpaths") + *ppProcAddress = (void*) &lib3mf_model_gettoolpaths; if (sProcName == "lib3mf_model_getslicestacks") *ppProcAddress = (void*) &lib3mf_model_getslicestacks; if (sProcName == "lib3mf_model_mergetomodel") @@ -13446,6 +19334,8 @@ Lib3MFResult Lib3MF::Impl::Lib3MF_GetProcAddress (const char * pProcName, void * *ppProcAddress = (void*) &lib3mf_model_addbuilditem; if (sProcName == "lib3mf_model_removebuilditem") *ppProcAddress = (void*) &lib3mf_model_removebuilditem; + if (sProcName == "lib3mf_model_addtoolpath") + *ppProcAddress = (void*) &lib3mf_model_addtoolpath; if (sProcName == "lib3mf_model_getmetadatagroup") *ppProcAddress = (void*) &lib3mf_model_getmetadatagroup; if (sProcName == "lib3mf_model_addattachment") @@ -13474,6 +19364,12 @@ Lib3MFResult Lib3MF::Impl::Lib3MF_GetProcAddress (const char * pProcName, void * *ppProcAddress = (void*) &lib3mf_model_setrandomnumbercallback; if (sProcName == "lib3mf_model_getkeystore") *ppProcAddress = (void*) &lib3mf_model_getkeystore; + if (sProcName == "lib3mf_model_createpersistentsourcefromfile") + *ppProcAddress = (void*) &lib3mf_model_createpersistentsourcefromfile; + if (sProcName == "lib3mf_model_createpersistentsourcefrombuffer") + *ppProcAddress = (void*) &lib3mf_model_createpersistentsourcefrombuffer; + if (sProcName == "lib3mf_model_createpersistentsourcefromcallback") + *ppProcAddress = (void*) &lib3mf_model_createpersistentsourcefromcallback; if (sProcName == "lib3mf_getlibraryversion") *ppProcAddress = (void*) &lib3mf_getlibraryversion; if (sProcName == "lib3mf_getprereleaseinformation") diff --git a/Autogenerated/Source/lib3mf_types.hpp b/Autogenerated/Source/lib3mf_types.hpp index 705f02718..d7b8241ca 100644 --- a/Autogenerated/Source/lib3mf_types.hpp +++ b/Autogenerated/Source/lib3mf_types.hpp @@ -129,13 +129,27 @@ typedef void * Lib3MF_pvoid; #define LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER 140 /** A progress identifier is unknown */ #define LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT 141 /** An element buffer exceeds its spec limit */ #define LIB3MF_ERROR_INVALIDRESOURCE 142 /** A resource is invalid */ +#define LIB3MF_ERROR_INVALIDNODEINDEX 143 /** Invalid node index */ +#define LIB3MF_ERROR_INVALIDATTRIBUTEINDEX 144 /** Invalid attribute index */ +#define LIB3MF_ERROR_DUPLICATECUSTOMDATA 145 /** Duplicate custom data */ +#define LIB3MF_ERROR_CUSTOMDATANOTFOUND 146 /** Custom data not found */ #define LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE 2000 /** This object type is not valid for beamlattices */ #define LIB3MF_ERROR_INVALIDKEYSTORE 3000 /** The keystore object is invalid */ #define LIB3MF_ERROR_INVALIDKEYSTORECONSUMER 3001 /** The consumer keystore object is invalid */ #define LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND 3002 /** A consumer has not been found */ #define LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND 3003 /** A resource data has not been found */ #define LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED 3004 /** A Key or Conentent encryption callback has not been registered */ -#define LIB3MF_ERROR_INVALIDKEYSIZE 3005 /** The key siue is invalid */ +#define LIB3MF_ERROR_INVALIDKEYSIZE 3005 /** The key size is invalid */ +#define LIB3MF_ERROR_TOOLPATH_NOTWRITINGHEADER 4000 /** Not in toolpath header writing mode */ +#define LIB3MF_ERROR_TOOLPATH_NOTWRITINGDATA 4001 /** Not in toolpath data writing mode */ +#define LIB3MF_ERROR_TOOLPATH_DATAHASBEENWRITTEN 4002 /** Toolpath has already been written out */ +#define LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT 4003 /** Toolpath has an invalid number of points */ +#define LIB3MF_ERROR_TOOLPATH_ATTRIBUTEALREADYDEFINED 4004 /** Toolpath attribute already defined */ +#define LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE 4005 /** Toolpath attribute is of invalid type */ +#define LIB3MF_ERROR_EMPTYNAMESPACEPREFIX 4006 /** Empty namespace prefix. */ +#define LIB3MF_ERROR_EMPTYNAMESPACE 4007 /** Empty namespace. */ +#define LIB3MF_ERROR_INVALIDNAMESPACEPREFIX 4008 /** Invalid namespace prefix. */ +#define LIB3MF_ERROR_WRITERDOESNOTSUPPORTNAMESPACES 4009 /** Writer does not support namespaces. */ /************************************************************************************************************************* Error strings for Lib3MF @@ -180,13 +194,27 @@ inline const char * LIB3MF_GETERRORSTRING (Lib3MFResult nErrorCode) { case LIB3MF_ERROR_UNKOWNPROGRESSIDENTIFIER: return "A progress identifier is unknown"; case LIB3MF_ERROR_ELEMENTCOUNTEXCEEDSLIMIT: return "An element buffer exceeds its spec limit"; case LIB3MF_ERROR_INVALIDRESOURCE: return "A resource is invalid"; + case LIB3MF_ERROR_INVALIDNODEINDEX: return "Invalid node index"; + case LIB3MF_ERROR_INVALIDATTRIBUTEINDEX: return "Invalid attribute index"; + case LIB3MF_ERROR_DUPLICATECUSTOMDATA: return "Duplicate custom data"; + case LIB3MF_ERROR_CUSTOMDATANOTFOUND: return "Custom data not found"; case LIB3MF_ERROR_BEAMLATTICE_INVALID_OBJECTTYPE: return "This object type is not valid for beamlattices"; case LIB3MF_ERROR_INVALIDKEYSTORE: return "The keystore object is invalid"; case LIB3MF_ERROR_INVALIDKEYSTORECONSUMER: return "The consumer keystore object is invalid"; case LIB3MF_ERROR_KEYSTORECONSUMERNOTFOUND: return "A consumer has not been found"; case LIB3MF_ERROR_KEYSTORERESOURCEDATANOTFOUND: return "A resource data has not been found"; case LIB3MF_ERROR_SECURECONTEXTNOTREGISTERED: return "A Key or Conentent encryption callback has not been registered"; - case LIB3MF_ERROR_INVALIDKEYSIZE: return "The key siue is invalid"; + case LIB3MF_ERROR_INVALIDKEYSIZE: return "The key size is invalid"; + case LIB3MF_ERROR_TOOLPATH_NOTWRITINGHEADER: return "Not in toolpath header writing mode"; + case LIB3MF_ERROR_TOOLPATH_NOTWRITINGDATA: return "Not in toolpath data writing mode"; + case LIB3MF_ERROR_TOOLPATH_DATAHASBEENWRITTEN: return "Toolpath has already been written out"; + case LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT: return "Toolpath has an invalid number of points"; + case LIB3MF_ERROR_TOOLPATH_ATTRIBUTEALREADYDEFINED: return "Toolpath attribute already defined"; + case LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE: return "Toolpath attribute is of invalid type"; + case LIB3MF_ERROR_EMPTYNAMESPACEPREFIX: return "Empty namespace prefix."; + case LIB3MF_ERROR_EMPTYNAMESPACE: return "Empty namespace."; + case LIB3MF_ERROR_INVALIDNAMESPACEPREFIX: return "Invalid namespace prefix."; + case LIB3MF_ERROR_WRITERDOESNOTSUPPORTNAMESPACES: return "Writer does not support namespaces."; default: return "unknown error"; } } @@ -196,11 +224,17 @@ inline const char * LIB3MF_GETERRORSTRING (Lib3MFResult nErrorCode) { **************************************************************************************************************************/ typedef Lib3MFHandle Lib3MF_Base; +typedef Lib3MFHandle Lib3MF_BinaryStream; typedef Lib3MFHandle Lib3MF_Writer; +typedef Lib3MFHandle Lib3MF_PersistentReaderSource; typedef Lib3MFHandle Lib3MF_Reader; typedef Lib3MFHandle Lib3MF_PackagePart; typedef Lib3MFHandle Lib3MF_Resource; typedef Lib3MFHandle Lib3MF_ResourceIterator; +typedef Lib3MFHandle Lib3MF_CustomXMLAttribute; +typedef Lib3MFHandle Lib3MF_CustomXMLNode; +typedef Lib3MFHandle Lib3MF_CustomXMLNodes; +typedef Lib3MFHandle Lib3MF_CustomDOMTree; typedef Lib3MFHandle Lib3MF_SliceStackIterator; typedef Lib3MFHandle Lib3MF_ObjectIterator; typedef Lib3MFHandle Lib3MF_MeshObjectIterator; @@ -229,6 +263,11 @@ typedef Lib3MFHandle Lib3MF_Texture2D; typedef Lib3MFHandle Lib3MF_BuildItem; typedef Lib3MFHandle Lib3MF_BuildItemIterator; typedef Lib3MFHandle Lib3MF_Slice; +typedef Lib3MFHandle Lib3MF_ToolpathProfile; +typedef Lib3MFHandle Lib3MF_ToolpathLayerReader; +typedef Lib3MFHandle Lib3MF_ToolpathLayerData; +typedef Lib3MFHandle Lib3MF_Toolpath; +typedef Lib3MFHandle Lib3MF_ToolpathIterator; typedef Lib3MFHandle Lib3MF_SliceStack; typedef Lib3MFHandle Lib3MF_Consumer; typedef Lib3MFHandle Lib3MF_AccessRight; @@ -258,6 +297,13 @@ namespace Lib3MF { Lowres = 1 }; + enum class ePersistentReaderSourceType : Lib3MF_int32 { + Unknown = 0, + FileOnDisk = 1, + MemoryBuffer = 2, + Callback = 3 + }; + enum class eModelUnit : Lib3MF_int32 { MicroMeter = 0, MilliMeter = 1, @@ -311,6 +357,11 @@ namespace Lib3MF { All = 2 }; + enum class eBinaryStreamPredictionType : Lib3MF_int32 { + NoPrediction = 0, + DeltaPrediction = 1 + }; + enum class eProgressIdentifier : Lib3MF_int32 { QUERYCANCELED = 0, DONE = 1, @@ -344,6 +395,19 @@ namespace Lib3MF { Multiply = 2 }; + enum class eToolpathSegmentType : Lib3MF_int32 { + Unknown = 0, + Hatch = 1, + Loop = 2, + Polyline = 3 + }; + + enum class eToolpathAttributeType : Lib3MF_int32 { + Unknown = 0, + Integer = 1, + Double = 2 + }; + enum class eEncryptionAlgorithm : Lib3MF_int32 { AES256_GCM = 1 /** http://www.w3.org/2009/xmlenc11#aes256-gcm */ }; @@ -520,6 +584,7 @@ namespace Lib3MF { // define legacy C-names for enums, structs and function types typedef Lib3MF::ePropertyType eLib3MFPropertyType; typedef Lib3MF::eSlicesMeshResolution eLib3MFSlicesMeshResolution; +typedef Lib3MF::ePersistentReaderSourceType eLib3MFPersistentReaderSourceType; typedef Lib3MF::eModelUnit eLib3MFModelUnit; typedef Lib3MF::eObjectType eLib3MFObjectType; typedef Lib3MF::eTextureType eLib3MFTextureType; @@ -528,8 +593,11 @@ typedef Lib3MF::eTextureFilter eLib3MFTextureFilter; typedef Lib3MF::eBeamLatticeCapMode eLib3MFBeamLatticeCapMode; typedef Lib3MF::eBeamLatticeClipMode eLib3MFBeamLatticeClipMode; typedef Lib3MF::eBeamLatticeBallMode eLib3MFBeamLatticeBallMode; +typedef Lib3MF::eBinaryStreamPredictionType eLib3MFBinaryStreamPredictionType; typedef Lib3MF::eProgressIdentifier eLib3MFProgressIdentifier; typedef Lib3MF::eBlendMethod eLib3MFBlendMethod; +typedef Lib3MF::eToolpathSegmentType eLib3MFToolpathSegmentType; +typedef Lib3MF::eToolpathAttributeType eLib3MFToolpathAttributeType; typedef Lib3MF::eEncryptionAlgorithm eLib3MFEncryptionAlgorithm; typedef Lib3MF::eWrappingAlgorithm eLib3MFWrappingAlgorithm; typedef Lib3MF::eMgfAlgorithm eLib3MFMgfAlgorithm; diff --git a/AutomaticComponentToolkit/lib3mf.xml b/AutomaticComponentToolkit/lib3mf.xml index 078cdc4b4..d56f2f913 100644 --- a/AutomaticComponentToolkit/lib3mf.xml +++ b/AutomaticComponentToolkit/lib3mf.xml @@ -78,6 +78,10 @@ + + + + @@ -85,8 +89,21 @@ - - + + + + + + + + + + + + + + + @@ -102,6 +119,14 @@ + + + + + + + + + + + + + + @@ -285,6 +329,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -333,9 +409,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -428,6 +542,242 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -620,6 +970,7 @@ + @@ -1163,6 +1514,413 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1513,6 +2271,10 @@ + + + + @@ -1558,6 +2320,11 @@ + + + + + @@ -1605,6 +2372,23 @@ + + + + + + + + + + + + + + + + + diff --git a/CMakeLists.txt b/CMakeLists.txt index aaca07d2c..bd2e07113 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,6 +131,7 @@ target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_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 (USE_INCLUDED_LIBZIP) # Something goes here to check if submodules exist and initialize the submodules if it does not target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Libraries/libzip/Include) @@ -237,7 +238,7 @@ install(TARGETS ${PROJECT_NAME} install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR_AUTOGENERATED}/Bindings DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") ######################################################### -option(LIB3MF_TESTS "Switch whether the tests of lib3mf should be build" ON) +option(LIB3MF_TESTS "Switch whether the tests of lib3mf should be build" OFF) message("LIB3MF_TESTS ... " ${LIB3MF_TESTS}) if(LIB3MF_TESTS) diff --git a/Include/API/lib3mf_binarystream.hpp b/Include/API/lib3mf_binarystream.hpp new file mode 100644 index 000000000..5787c734b --- /dev/null +++ b/Include/API/lib3mf_binarystream.hpp @@ -0,0 +1,84 @@ +/*++ + +Copyright (C) 2019 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is the class declaration of CBinaryStream + +*/ + + +#ifndef __LIB3MF_BINARYSTREAM +#define __LIB3MF_BINARYSTREAM + +#include "lib3mf_interfaces.hpp" + +// Parent classes +#include "lib3mf_base.hpp" +#pragma warning( push) +#pragma warning( disable : 4250) + +// Include custom headers here. +#include "Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamWriter.h" + +namespace Lib3MF { +namespace Impl { + + +/************************************************************************************************************************* + Class declaration of CBinaryStream +**************************************************************************************************************************/ + +class CBinaryStream : public virtual IBinaryStream, public virtual CBase { +private: + + NMR::PChunkedBinaryStreamWriter m_pStreamWriter; + std::string m_sPackageIndexPath; + std::string m_sPackageBinaryPath; + std::string m_sUUID; + +protected: + + +public: + + CBinaryStream (std::string sPackageIndexPath, std::string sPackageBinaryPath, NMR::PChunkedBinaryStreamWriter pStreamWriter); + + std::string GetBinaryPath(); + std::string GetIndexPath(); + std::string GetUUID(); + + + void DisableDiscretizedArrayCompression(); + void EnableDiscretizedArrayCompression(const Lib3MF_double dUnits, const Lib3MF::eBinaryStreamPredictionType ePredictionType); + void EnableLZMA(const Lib3MF_uint32 nLZMALevel); + void DisableLZMA(); + +}; + +} // namespace Impl +} // namespace Lib3MF + +#pragma warning( pop ) +#endif // __LIB3MF_BINARYSTREAM diff --git a/Include/API/lib3mf_builditem.hpp b/Include/API/lib3mf_builditem.hpp index 5a693acf8..5deff78f6 100644 --- a/Include/API/lib3mf_builditem.hpp +++ b/Include/API/lib3mf_builditem.hpp @@ -100,6 +100,9 @@ class CBuildItem : public virtual IBuildItem, public virtual CBase { IMetaDataGroup * GetMetaDataGroup (); Lib3MF::sBox GetOutbox(); + + NMR::PModelBuildItem getBuildItemInstance(); + }; } diff --git a/Include/API/lib3mf_customdomtree.hpp b/Include/API/lib3mf_customdomtree.hpp new file mode 100644 index 000000000..752c0a046 --- /dev/null +++ b/Include/API/lib3mf_customdomtree.hpp @@ -0,0 +1,94 @@ +/*++ + +Copyright (C) 2019 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is the class declaration of CCustomDOMTree + +*/ + + +#ifndef __LIB3MF_CUSTOMDOMTREE +#define __LIB3MF_CUSTOMDOMTREE + +#include "lib3mf_interfaces.hpp" + +// Parent classes +#include "lib3mf_base.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4250) +#endif + +// Include custom headers here. +#include "Model/Classes/NMR_CustomXMLTree.h" + +namespace Lib3MF { +namespace Impl { + + +/************************************************************************************************************************* + Class declaration of CCustomDOMTree +**************************************************************************************************************************/ + +class CCustomDOMTree : public virtual ICustomDOMTree, public virtual CBase { +private: + + NMR::PCustomXMLTree m_pXMLTree; + +public: + CCustomDOMTree(NMR::PCustomXMLTree pXMLTree); + + virtual ~CCustomDOMTree(); + + NMR::PCustomXMLTree getXMLTreeInstance (); + + /** + * ICustomDOMTree::GetNameSpace - Returns the namespace identifier for the DOM Tree. + * @return returns the namespace of the DOM Tree. + */ + std::string GetNameSpace() override; + + /** + * ICustomDOMTree::GetRootNode - Returns root node of the document. + * @return Root node of the document. + */ + ICustomXMLNode * GetRootNode() override; + + /** + * ICustomDOMTree::SaveToString - Saves the XML document into a string. + * @param[in] bAddLineBreaks - If true, line breaks and indentation will be added to the output string. + * @return String with the XML Content. + */ + std::string SaveToString() override; + +}; + +} // namespace Impl +} // namespace Lib3MF + +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#endif // __LIB3MF_CUSTOMDOMTREE diff --git a/Include/API/lib3mf_customxmlattribute.hpp b/Include/API/lib3mf_customxmlattribute.hpp new file mode 100644 index 000000000..31f915e71 --- /dev/null +++ b/Include/API/lib3mf_customxmlattribute.hpp @@ -0,0 +1,167 @@ +/*++ + +Copyright (C) 2019 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is the class declaration of CCustomXMLAttribute + +*/ + + +#ifndef __LIB3MF_CUSTOMXMLATTRIBUTE +#define __LIB3MF_CUSTOMXMLATTRIBUTE + +#include "lib3mf_interfaces.hpp" + +// Parent classes +#include "lib3mf_base.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4250) +#endif + +// Include custom headers here. +#include "Model/Classes/NMR_CustomXMLAttribute.h" +#include "Model/Classes/NMR_CustomXMLNode.h" + + +namespace Lib3MF { +namespace Impl { + + +/************************************************************************************************************************* + Class declaration of CCustomXMLAttribute +**************************************************************************************************************************/ + +class CCustomXMLAttribute : public virtual ICustomXMLAttribute, public virtual CBase { +private: + +private: + + NMR::PCustomXMLNode m_pXMLNode; + NMR::PCustomXMLAttribute m_pXMLAttribute; + +public: + + CCustomXMLAttribute(NMR::PCustomXMLNode pXMLNode, NMR::PCustomXMLAttribute pXMLAttribute); + + virtual ~CCustomXMLAttribute(); + + + /** + * ICustomXMLAttribute::GetName - Retrieves name of the attribute. + * @return returns the name of the attribute. + */ + std::string GetName() override; + + /** + * ICustomXMLAttribute::GetValue - Retrieves value of the attribute as string. + * @return returns the value of the attribute. + */ + std::string GetValue() override; + + /** + * ICustomXMLAttribute::IsValidInteger - Checks if the value is a valid integer in the given range. + * @param[in] nMinValue - Minimum allowed value + * @param[in] nMaxValue - Maximum allowed value + * @return returns if the value is a valid integer. + */ + bool IsValidInteger(const Lib3MF_int64 nMinValue, const Lib3MF_int64 nMaxValue) override; + + /** + * ICustomXMLAttribute::GetIntegerValue - Returns the value as integer. Fails if the value is not a valid integer in the given range. + * @param[in] nMinValue - Minimum allowed value + * @param[in] nMaxValue - Maximum allowed value + * @return returns the value. + */ + Lib3MF_int64 GetIntegerValue(const Lib3MF_int64 nMinValue, const Lib3MF_int64 nMaxValue) override; + + /** + * ICustomXMLAttribute::IsValidDouble - Checks if the value is a valid double in the given range. + * @param[in] dMinValue - Minimum allowed value + * @param[in] dMaxValue - Maximum allowed value + * @return returns if the value is a valid double. + */ + bool IsValidDouble(const Lib3MF_double dMinValue, const Lib3MF_double dMaxValue) override; + + /** + * ICustomXMLAttribute::GetDoubleValue - Returns the value as double. Fails if the value is not a valid double in the given range. + * @param[in] dMinValue - Minimum allowed value + * @param[in] dMaxValue - Maximum allowed value + * @return returns the value . + */ + Lib3MF_double GetDoubleValue(const Lib3MF_double dMinValue, const Lib3MF_double dMaxValue) override; + + /** + * ICustomXMLAttribute::IsValidBool - Checks if the value is a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. + * @return returns if the value is a valid bool. + */ + bool IsValidBool() override; + + /** + * ICustomXMLAttribute::GetBoolValue - Returns the value as bool. Fails if the value is not a valid boolean value, meaning an integer or true or false as string. The value will be trimmed and any character will be converted to lowercase. + * @param[in] dMinValue - Minimum allowed value + * @param[in] dMaxValue - Maximum allowed value + * @return returns the value . + */ + bool GetBoolValue(const Lib3MF_double dMinValue, const Lib3MF_double dMaxValue) override; + + /** + * ICustomXMLAttribute::SetValue - Sets the value of the attribute as string. + * @param[in] sValue - new value of the attribute. + */ + void SetValue(const std::string & sValue) override; + + /** + * ICustomXMLAttribute::SetIntegerValue - Sets the value of the attribute as integer. + * @param[in] nValue - new value of the attribute. + */ + void SetIntegerValue(const Lib3MF_int64 nValue) override; + + /** + * ICustomXMLAttribute::SetDoubleValue - Sets the value of the attribute as double. + * @param[in] dValue - new value of the attribute. + */ + void SetDoubleValue(const Lib3MF_double dValue) override; + + /** + * ICustomXMLAttribute::SetBoolValue - Sets the value of the attribute as bool. + * @param[in] bValue - new value of the attribute. + */ + void SetBoolValue(const bool bValue) override; + + /** + * ICustomXMLAttribute::Remove - Removes the attribute from its parent node. All subsequent calls to the class will fail. + */ + void Remove() override; + +}; + +} // namespace Impl +} // namespace Lib3MF + +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#endif // __LIB3MF_CUSTOMXMLATTRIBUTE diff --git a/Include/API/lib3mf_customxmlnode.hpp b/Include/API/lib3mf_customxmlnode.hpp new file mode 100644 index 000000000..868422acf --- /dev/null +++ b/Include/API/lib3mf_customxmlnode.hpp @@ -0,0 +1,232 @@ +/*++ + +Copyright (C) 2019 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is the class declaration of CCustomXMLNode + +*/ + + +#ifndef __LIB3MF_CUSTOMXMLNODE +#define __LIB3MF_CUSTOMXMLNODE + +#include "lib3mf_interfaces.hpp" + +// Parent classes +#include "lib3mf_base.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4250) +#endif + +// Include custom headers here. +#include "Model/Classes/NMR_CustomXMLNode.h" +#include "Model/Classes/NMR_CustomXMLTree.h" + + +namespace Lib3MF { +namespace Impl { + + +/************************************************************************************************************************* + Class declaration of CCustomXMLNode +**************************************************************************************************************************/ + +class CCustomXMLNode : public virtual ICustomXMLNode, public virtual CBase { +private: + + NMR::PCustomXMLTree m_pXMLTree; + NMR::PCustomXMLNode m_pXMLNode; + +public: + + CCustomXMLNode(NMR::PCustomXMLTree pXMLTree, NMR::PCustomXMLNode pXMLNode); + + virtual ~CCustomXMLNode(); + + NMR::PCustomXMLNode getNodeInstance(); + + /** + * ICustomXMLNode::GetName - Retrieves name of the node. + * @return returns the name of the node. + */ + std::string GetName() override; + + /** + * ICustomXMLNode::GetNameSpace - Retrieves namespace of the node. + * @return returns the namespace of the node. + */ + std::string GetNameSpace() override; + + /** + * ICustomXMLNode::GetAttributeCount - Returns number of attributes. + * @return returns the number of attributes. + */ + Lib3MF_uint64 GetAttributeCount() override; + + /** + * ICustomXMLNode::GetAttribute - Returns attribute instance. Fails if Index is out of range. + * @param[in] nIndex - Index of the attribute to return (0-based). + * @return XML Document attribute. + */ + ICustomXMLAttribute * GetAttribute(const Lib3MF_uint64 nIndex) override; + + /** + * ICustomXMLNode::HasAttribute - Returns if attribute of a specific name exists. + * @param[in] sName - Name of the attribute. + * @return Returns if the attribute exists. + */ + bool HasAttribute(const std::string & sName) override; + + /** + * ICustomXMLNode::FindAttribute - Returns attribute instance of a specific name. + * @param[in] sName - Name of the attribute. + * @param[in] bMustExist - If true, the call fails if attribute does not exist. If falls, the call will return null if the attribute does not exist. + * @return XML Document attribute. + */ + ICustomXMLAttribute * FindAttribute(const std::string & sName, const bool bMustExist) override; + + /** + * ICustomXMLNode::RemoveAttribute - Removes the attribute with a specific name. Does nothing if attribute does not exist. + * @param[in] sName - Name of the attribute. + */ + bool RemoveAttribute(const std::string & sName) override; + + /** + * ICustomXMLNode::RemoveAttributeByIndex - Removes the attribute with a specific index. Does nothing if attribute does not exist. + * @param[in] nIndex - Index of the attribute to remove (0-based). + */ + bool RemoveAttributeByIndex(const Lib3MF_uint64 nIndex) override; + + /** + * ICustomXMLNode::AddAttribute - Adds an attribute with a specific name and string value. Fails if attribute already exists. + * @param[in] sName - Name of the attribute. + * @param[in] sValue - Value of the attribute. + */ + void AddAttribute(const std::string & sName, const std::string & sValue) override; + + /** + * ICustomXMLNode::AddIntegerAttribute - Adds an attribute with a specific name and integer value. Fails if attribute already exists. + * @param[in] sName - Name of the attribute. + * @param[in] nValue - Value of the attribute. + */ + void AddIntegerAttribute(const std::string & sName, const Lib3MF_int64 nValue) override; + + /** + * ICustomXMLNode::AddDoubleAttribute - Adds an attribute with a specific name and double value. Fails if attribute already exists. + * @param[in] sName - Name of the attribute. + * @param[in] dValue - Value of the attribute. + */ + void AddDoubleAttribute(const std::string & sName, const Lib3MF_double dValue) override; + + /** + * ICustomXMLNode::AddBoolAttribute - Adds an attribute with a specific name and bool value. Fails if attribute already exists. + * @param[in] sName - Name of the attribute. + * @param[in] bValue - Value of the attribute. + */ + void AddBoolAttribute(const std::string & sName, const bool bValue) override; + + /** + * ICustomXMLNode::GetChildren - Returns all the child nodes of the XML Node. + * @return returns the list of child nodes. + */ + ICustomXMLNodes * GetChildren() override; + + /** + * ICustomXMLNode::CountChildrenByName - Returns how many children of the XML Node have a specific name. + * @param[in] sNameSpace - New namespace of the child. MUST be either an empty string for the root namespace, or previously being registered with the document. + * @param[in] sName - Name of the node. + * @return returns the number children with the specified name. + */ + Lib3MF_uint64 CountChildrenByName(const std::string & sName) override; + + /** + * ICustomXMLNode::GetChildrenByName - Returns all the child nodes of the XML Node with a specific name. + * @param[in] sNameSpace - New namespace of the child. MUST be either an empty string for the root namespace, or previously being registered with the document. + * @param[in] sName - Name of the child. + * @return returns the list of child nodes. + */ + ICustomXMLNodes * GetChildrenByName(const std::string & sName) override; + + /** + * ICustomXMLNode::HasChild - Returns if a child with a specific name exist. + * @param[in] sNameSpace - New namespace of the child. MUST be either an empty string for the root namespace, or previously being registered with the document. + * @param[in] sName - Name of the child. + * @return returns if a child with a specific name exists. + */ + bool HasChild(const std::string & sName) override; + + /** + * ICustomXMLNode::HasUniqueChild - Returns if a child with a specific name exist once and only once. + * @param[in] sNameSpace - New namespace of the child. MUST be either an empty string for the root namespace, or previously being registered with the document. + * @param[in] sName - Name of the child. + * @return returns if a child with a specific name exists once and only once. + */ + bool HasUniqueChild(const std::string & sName) override; + + /** + * ICustomXMLNode::FindChild - Returns child with a specific name. Throws an error if name does not exist once and only once. + * @param[in] sNameSpace - New namespace of the child. MUST be either an empty string for the root namespace, or previously being registered with the document. + * @param[in] sName - Name of the child. + * @param[in] bMustExist - If true, the call fails if child does not exist. If falls, the call will return null if the child does not exist. + * @return returns child instance or null. + */ + ICustomXMLNode * FindChild(const std::string & sName, const bool bMustExist) override; + + /** + * ICustomXMLNode::AddChild - Adds a new child with a specific name. + * @param[in] sNameSpace - New namespace of the child. MUST be either an empty string for the root namespace, or previously being registered with the document. + * @param[in] sName - Name of the child. + * @return returns child instance. + */ + ICustomXMLNode * AddChild(const std::string & sName) override; + + /** + * ICustomXMLNode::RemoveChild - Removes a child with a specific name. All subsequent calls to the child will fail after the call. + * @param[in] pChildInstance - child instance to remove. Fails if given instance is not a child of the node. + */ + void RemoveChild(ICustomXMLNode* pChildInstance) override; + + /** + * ICustomXMLNode::RemoveChildrenWithName - Removes all children with a specific name. Does nothing if no child with the name exists. . All subsequent calls to the deleted children will fail after the call. + * @param[in] sNameSpace - New namespace of the child. MUST be either an empty string for the root namespace, or previously being registered with the document. + * @param[in] sName - Name of the children. + */ + uint64_t RemoveChildrenWithName(const std::string & sName) override; + + /** + * ICustomXMLNode::Remove - Removes the node from its parent. The root node of the document can not be removed. + */ + void Remove() override; + +}; + +} // namespace Impl +} // namespace Lib3MF + +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#endif // __LIB3MF_CUSTOMXMLNODE diff --git a/Include/API/lib3mf_customxmlnodes.hpp b/Include/API/lib3mf_customxmlnodes.hpp new file mode 100644 index 000000000..fef970916 --- /dev/null +++ b/Include/API/lib3mf_customxmlnodes.hpp @@ -0,0 +1,125 @@ +/*++ + +Copyright (C) 2019 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is the class declaration of CCustomXMLNodes + +*/ + + +#ifndef __LIB3MF_CUSTOMXMLNODES +#define __LIB3MF_CUSTOMXMLNODES + +#include "lib3mf_interfaces.hpp" + +// Parent classes +#include "lib3mf_base.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4250) +#endif + +// Include custom headers here. +#include "Model/Classes/NMR_CustomXMLNode.h" +#include "Model/Classes/NMR_CustomXMLTree.h" + + +namespace Lib3MF { +namespace Impl { + + +/************************************************************************************************************************* + Class declaration of CCustomXMLNodes +**************************************************************************************************************************/ + +class CCustomXMLNodes : public virtual ICustomXMLNodes, public virtual CBase { +private: + + NMR::PCustomXMLTree m_pXMLTree; + std::vector m_pXMLNodes; + + +protected: + +public: + + CCustomXMLNodes(NMR::PCustomXMLTree pXMLTree, std::vector pXMLNodes); + + virtual ~CCustomXMLNodes(); + + Lib3MF_uint64 GetNodeCount() override; + + /** + * ICustomXMLNodes::GetNode - Returns node instance. Fails if Index is out of range. + * @param[in] nIndex - Index of the node to return (0-based). + * @return XML Node node. + */ + ICustomXMLNode * GetNode(const Lib3MF_uint64 nIndex) override; + + /** + * ICustomXMLNodes::CountNodesByName - Returns how many nodes of the XML Node have a specific name. + * @param[in] sName - Name of the node. + * @return returns the number of nodes with the specified name. + */ + Lib3MF_uint64 CountNodesByName(const std::string & sName) override; + + /** + * ICustomXMLNodes::GetNodesByName - Returns all the nodes nodes of the XML Node with a specific name. + * @param[in] sName - Name of the node. + * @return returns the list of node nodes. + */ + ICustomXMLNodes * GetNodesByName(const std::string & sName) override; + + /** + * ICustomXMLNodes::HasNode - Returns if a node with a specific name exist. + * @param[in] sName - Name of the node. + * @return returns if a node with a specific name exists. + */ + bool HasNode(const std::string & sName) override; + + /** + * ICustomXMLNodes::HasUniqueNode - Returns if a node with a specific name exist once and only once. + * @param[in] sName - Name of the node. + * @return returns if a node with a specific name exists once and only once. + */ + bool HasUniqueNode(const std::string & sName) override; + + /** + * ICustomXMLNodes::FindNode - Returns node with a specific name. Throws an error if name does not exist once and only once. + * @param[in] sName - Name of the node. + * @param[in] bMustExist - If true, the call fails if node does not exist. If falls, the call will return null if the node does not exist. + * @return returns node instance. + */ + ICustomXMLNode * FindNode(const std::string & sName, const bool bMustExist) override; + +}; + +} // namespace Impl +} // namespace Lib3MF + +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#endif // __LIB3MF_CUSTOMXMLNODES diff --git a/Include/API/lib3mf_model.hpp b/Include/API/lib3mf_model.hpp index d491ea086..5371395c2 100644 --- a/Include/API/lib3mf_model.hpp +++ b/Include/API/lib3mf_model.hpp @@ -143,6 +143,8 @@ class CModel : public virtual IModel, public virtual CBase { IMultiPropertyGroupIterator * GetMultiPropertyGroups() override; + IToolpathIterator* GetToolpaths() override; + ISliceStackIterator * GetSliceStacks() override; IModel * MergeToModel() override; @@ -169,6 +171,8 @@ class CModel : public virtual IModel, public virtual CBase { void RemoveBuildItem(IBuildItem* pBuildItemInstance) override; + IToolpath* AddToolpath(const Lib3MF_double dUnitFactor) override; + IMetaDataGroup * GetMetaDataGroup() override; IAttachment * AddAttachment(const std::string & sURI, const std::string & sRelationShipType) override; @@ -198,6 +202,13 @@ class CModel : public virtual IModel, public virtual CBase { IKeyStore * GetKeyStore(); void SetRandomNumberCallback(const Lib3MF::RandomNumberCallback pTheCallback, const Lib3MF_pvoid pUserData); + + IPersistentReaderSource* CreatePersistentSourceFromFile(const std::string& sFilename) override; + + IPersistentReaderSource* CreatePersistentSourceFromBuffer(const Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8* pBufferBuffer) override; + + IPersistentReaderSource* CreatePersistentSourceFromCallback(const Lib3MF::ReadCallback pTheReadCallback, const Lib3MF_uint64 nStreamSize, const Lib3MF::SeekCallback pTheSeekCallback, const Lib3MF_pvoid pUserData) override; + }; } diff --git a/Include/API/lib3mf_persistentreadersource.hpp b/Include/API/lib3mf_persistentreadersource.hpp new file mode 100644 index 000000000..64d160527 --- /dev/null +++ b/Include/API/lib3mf_persistentreadersource.hpp @@ -0,0 +1,83 @@ +/*++ + +Copyright (C) 2019 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is the class declaration of CPersistentReaderSource + +*/ + + +#ifndef __LIB3MF_PERSISTENTREADERSOURCE +#define __LIB3MF_PERSISTENTREADERSOURCE + +#include "lib3mf_interfaces.hpp" + +// Parent classes +#include "lib3mf_base.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4250) +#endif + +// Include custom headers here. +#include "Model/Reader/NMR_ModelPersistentDataSource.h" + +namespace Lib3MF { +namespace Impl { + + +/************************************************************************************************************************* + Class declaration of CPersistentReaderSource +**************************************************************************************************************************/ + +class CPersistentReaderSource : public virtual IPersistentReaderSource, public virtual CBase { +private: + +protected: + NMR::PModelPersistentDataSource m_pDataSource; + +public: + + CPersistentReaderSource(NMR::PModelPersistentDataSource pDataSource); + + virtual ~CPersistentReaderSource(); + + Lib3MF::ePersistentReaderSourceType GetSourceType() override; + + void InvalidateSourceData() override; + + bool SourceDataIsValid() override; + + NMR::PModelPersistentDataSource getDataSource(); + +}; + +} // namespace Impl +} // namespace Lib3MF + +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#endif // __LIB3MF_PERSISTENTREADERSOURCE diff --git a/Include/API/lib3mf_reader.hpp b/Include/API/lib3mf_reader.hpp index 1e0f76ed9..f93f57a22 100644 --- a/Include/API/lib3mf_reader.hpp +++ b/Include/API/lib3mf_reader.hpp @@ -80,6 +80,8 @@ class CReader : public virtual IReader, public virtual CBase { * Public member functions to implement. */ + void ReadFromPersistentSource(IPersistentReaderSource* pSource) override; + void ReadFromFile (const std::string & sFilename); void ReadFromBuffer (const Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer); diff --git a/Include/API/lib3mf_writer.hpp b/Include/API/lib3mf_writer.hpp index b06fb7a86..782880942 100644 --- a/Include/API/lib3mf_writer.hpp +++ b/Include/API/lib3mf_writer.hpp @@ -112,6 +112,14 @@ class CWriter : public virtual IWriter, public virtual CBase { Lib3MF_uint32 GetWarningCount(); + NMR::PModelWriter getModelWriter (); + + IBinaryStream* CreateBinaryStream(const std::string& sIndexPath, const std::string& sBinaryPath); + + void AssignBinaryStream(IBase* pInstance, IBinaryStream* pBinaryStream); + + void RegisterCustomNamespace(const std::string& sPrefix, const std::string& sNameSpace) override; + }; } diff --git a/Include/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamCollection.h b/Include/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamCollection.h new file mode 100644 index 000000000..c23a796e6 --- /dev/null +++ b/Include/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamCollection.h @@ -0,0 +1,62 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--*/ + +#ifndef __NMR_CHUNKEDBINARYSTREAMCOLLECTION +#define __NMR_CHUNKEDBINARYSTREAMCOLLECTION + +#include "Common/NMR_Types.h" +#include "Common/NMR_Local.h" +#include "Common/Platform/NMR_ImportStream.h" + +#include +#include +#include + +#include "Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamReader.h" + +namespace NMR { + + class CChunkedBinaryStreamCollection { + private: + std::map m_ReaderMap; + + public: + CChunkedBinaryStreamCollection(); + + void registerReader (const std::string & sPath, PChunkedBinaryStreamReader pReader); + CChunkedBinaryStreamReader * findReader(const std::string & sPath); + + }; + + typedef std::shared_ptr PChunkedBinaryStreamCollection; + + +} + +#endif // __NMR_CHUNKEDBINARYSTREAMCOLLECTION + diff --git a/Include/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamReader.h b/Include/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamReader.h new file mode 100644 index 000000000..1b97b7c50 --- /dev/null +++ b/Include/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamReader.h @@ -0,0 +1,106 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--*/ + +#ifndef __NMR_CHUNKEDBINARYSTREAMREADER +#define __NMR_CHUNKEDBINARYSTREAMREADER + +#include "Common/NMR_Types.h" +#include "Common/NMR_Local.h" +#include "Common/Platform/NMR_ImportStream.h" + +#include +#include + +#include "Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamTypes.h" + +namespace NMR { + + class CChunkedBinaryStreamReader; + typedef std::shared_ptr PChunkedBinaryStreamReader; + + class CChunkedBinaryStreamReaderChunk; + typedef std::shared_ptr PChunkedBinaryStreamReaderChunk; + + class CChunkedBinaryStreamReaderChunk { + private: + CChunkedBinaryStreamReader * m_pReader; + std::vector m_ChunkEntries; + + nfBool m_bHasCachedData; + std::vector m_Data; + + BINARYCHUNKFILECHUNK m_Chunk; + nfUint32 m_nChunkIndex; + nfUint32 m_nCurrentReadPosition; + nfUint32 m_nCurrentEndPosition; + + public: + CChunkedBinaryStreamReaderChunk(CChunkedBinaryStreamReader * pReader, const BINARYCHUNKFILECHUNK & Chunk, const nfUint32 nChunkIndex); + + void loadData(); + void unloadData(); + + void getInformation(nfUint32 nEntryIndex, eChunkedBinaryDataType & dataType, nfUint32 & nCount); + + void seekToEntry(nfUint32 nEntryIndex, nfUint32 & nEntryType, nfUint32 & nEntrySize); + nfInt32 readInt32(); + nfFloat readFloat(); + + }; + + class CChunkedBinaryStreamReader { + private: + PImportStream m_pImportStream; + + std::vector m_Chunks; + std::map > m_ChunkMap; + + void readHeader(); + CChunkedBinaryStreamReaderChunk * findChunkByEntry (_In_ nfUint32 nEntryID, _Out_ nfUint32 & nEntryIndex); + + public: + + CChunkedBinaryStreamReader(PImportStream pImportStream); + + void findChunkInformation (nfUint32 nEntryID, eChunkedBinaryDataType & dataType, nfUint32 & nCount); + nfUint32 getTypedChunkEntryCount(nfUint32 nEntryID, eChunkedBinaryDataType dataType); + + void readIntArray(nfUint32 nEntryID, nfInt32 * pData, nfUint32 nDataCount); + void readFloatArray(nfUint32 nEntryID, nfFloat * pData, nfUint32 nDataCount); + + void clearCache (); + + friend class CChunkedBinaryStreamReaderChunk; + + }; + + +} + +#endif // __NMR_CHUNKEDBINARYSTREAMREADER + diff --git a/Include/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamTypes.h b/Include/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamTypes.h new file mode 100644 index 000000000..8969cf28f --- /dev/null +++ b/Include/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamTypes.h @@ -0,0 +1,98 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--*/ + +#ifndef __NMR_CHUNKEDBINARYSTREAMTYPES +#define __NMR_CHUNKEDBINARYSTREAMTYPES + +#include "Common/NMR_Types.h" +#include "Common/NMR_Local.h" + +#define BINARYCHUNKFILEHEADERSIGN 0x5A464D33 +#define BINARYCHUNKFILEHEADERVERSION 0x00000001 +#define BINARYCHUNKFILEHEADERRESERVED 8 +#define BINARYCHUNKFILECHUNKRESERVED 1 + +#define BINARYCHUNKFILEMAXCHUNKCOUNT (1024*1024*1024) +#define BINARYCHUNKFILEMAXENTRYCOUNT (1024*1024*1024) +#define BINARYCHUNKFILEMAXCHUNKDATASIZE (1024*1024*1024) + +#define BINARYCHUNKFILEENTRYTYPE_INT32ARRAY_NOPREDICTION 1 +#define BINARYCHUNKFILEENTRYTYPE_INT32ARRAY_DELTAPREDICTION 2 +#define BINARYCHUNKFILEENTRYTYPE_FLOAT32ARRAY_NOPREDICTION 3 +#define BINARYCHUNKFILEENTRYTYPE_FLOAT32ARRAY_DELTAPREDICTION 4 +#define BINARYCHUNKFILEENTRYTYPE_FLOAT32ARRAY_RAWDATA 5 + +#define BINARYCHUNKFILE_MAXFLOATUNITS (1024 * 1024 * 1024) + +#define BINARYCHUNKFILEENTRY_COMPRESSIONTYPE_NONE 1 +#define BINARYCHUNKFILEENTRY_COMPRESSIONTYPE_LZMA 2 + + +namespace NMR { + +#pragma pack (1) + + typedef struct { + nfUint32 m_Sign; + nfUint32 m_Version; + nfUint32 m_ChunkCount; + nfUint64 m_ChunkTableStart; + nfUint32 m_Reserved[BINARYCHUNKFILEHEADERRESERVED]; + } BINARYCHUNKFILEHEADER; + + + typedef struct { + nfUint32 m_ChunkID; + nfUint32 m_EntryCount; + nfUint64 m_EntryTableStart; + nfUint64 m_CompressedDataStart; + nfUint32 m_CompressedDataSize; + nfUint32 m_CompressedPropsSize; + nfUint32 m_UncompressedDataSize; + nfByte m_MD5Checksum[16]; + nfUint32 m_CompressionMode; + nfUint32 m_Reserved[BINARYCHUNKFILECHUNKRESERVED]; + } BINARYCHUNKFILECHUNK; + + typedef struct { + nfUint32 m_EntryID; + nfUint32 m_EntryType; + nfUint32 m_PositionInChunk; + nfUint32 m_SizeInBytes; + } BINARYCHUNKFILEENTRY; + +#pragma pack() + + enum eChunkedBinaryPredictionType { eptNoPredicition, eptDeltaPredicition }; + + enum eChunkedBinaryDataType { edtUnknown, edtInt32Array, edtFloatArray }; + +} + +#endif // __NMR_CHUNKEDBINARYSTREAMTYPES + diff --git a/Include/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamWriter.h b/Include/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamWriter.h new file mode 100644 index 000000000..ac5e46e92 --- /dev/null +++ b/Include/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamWriter.h @@ -0,0 +1,110 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--*/ + +#ifndef __NMR_CHUNKEDBINARYSTREAMWRITER +#define __NMR_CHUNKEDBINARYSTREAMWRITER + +#include "Common/NMR_Types.h" +#include "Common/NMR_Local.h" +#include "Common/Platform/NMR_ExportStream.h" +#include "Common/Platform/NMR_ExportStream_Memory.h" + +#include "Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamTypes.h" +#include +#include + +namespace NMR { + + class CChunkedBinaryStreamWriter { + private: + PExportStreamMemory m_pBinaryExportStream; + std::string m_sBinaryPath; + std::string m_sIndexPath; + + nfUint32 m_elementIDCounter; + nfBool m_bIsFinished; + nfUint64 m_ChunkTableStart; + + nfBool m_bIsEmpty; + + bool m_bEnableLZMA; + uint32_t m_nLZMALevel; + + eChunkedBinaryPredictionType m_PredictionType; + bool m_bQuantizeFloats; + double m_dQuantizationUnits; + + std::vector m_Chunks; + std::map>> m_ChunkEntries; + + BINARYCHUNKFILECHUNK * m_CurrentChunk; + std::shared_ptr> m_CurrentChunkEntries; + std::vector m_CurrentChunkData; + + void writeHeader(); + void writeChunkTable(); + + public: + + CChunkedBinaryStreamWriter (const std::string & sIndexPath, const std::string & sBinaryPath, PExportStreamMemory pBinaryExportStream); + + void beginChunk(); + void finishChunk(); + nfUint32 getChunkCount (); + + void setEnableLZMA(bool bEnableLZMA); + void setLZMALevel(uint32_t nLZMALevel); + + void finishWriting (); + + nfUint32 addIntArray (const nfInt32 * pData, nfUint32 nLength, eChunkedBinaryPredictionType predictionType); + nfUint32 addFloatArray(const nfFloat * pData, nfUint32 nLength, eChunkedBinaryPredictionType predictionType, nfFloat fDiscretizationUnits); + nfUint32 addRawFloatArray(const nfFloat* pData, nfUint32 nLength); + + void copyBinaryToStream (PExportStream pStream); + void writeIndexXML(PExportStream pStream); + + nfBool isEmpty(); + + void setDefaultCompressionMode (bool bQuantizeFloat, double dQuantizationUnits, eChunkedBinaryPredictionType predictionType); + bool getFloatQuantization(); + double getFloatQuantizationUnits(); + eChunkedBinaryPredictionType getPredictionType(); + + std::string getBinaryPath(); + + std::string getIndexPath(); + + + }; + + typedef std::shared_ptr PChunkedBinaryStreamWriter; + +} + +#endif // __NMR_CHUNKEDBINARYSTREAMWRITER diff --git a/Include/Common/NMR_ErrorConst.h b/Include/Common/NMR_ErrorConst.h index aaaf60fb8..81525d375 100644 --- a/Include/Common/NMR_ErrorConst.h +++ b/Include/Common/NMR_ErrorConst.h @@ -302,6 +302,159 @@ NMR_ErrorConst.h defines all error code constants. // Too many slices #define NMR_ERROR_TOOMANYSLICES 0x1053 +// Duplicate value +#define NMR_ERROR_DUPLICATEVALUE 0x1054 + +// Root node can not be deleted +#define NMR_ERROR_ROOTNODECANNOTBEDELETED 0x1055 + +// Tried to access invalidated node +#define NMR_ERROR_TRIEDTOACCESSINVALIDATEDNODE 0x1056 + +// XML child node is not unique +#define NMR_ERROR_XMLCHILDNODEISNOTUNIQUE 0x1057 + +// XML child node not found +#define NMR_ERROR_XMLCHILDNODENOTFOUND 0x1058 + +// XML attribute not found +#define NMR_ERROR_XMLATTRIBUTENOTFOUND 0x1059 + +// Duplicate XML attribute +#define NMR_ERROR_DUPLICATEXMLATTRIBUTE 0x105A + +// Too many custom XML Data Entries +#define NMR_ERROR_TOOMANYCUSTOMXMLDATAENTRIES 0x105B + +// Stream Chunk already open +#define NMR_ERROR_STREAMCHUNKALREADYOPEN 0x105C + +// No Stream Chunk open +#define NMR_ERROR_NOSTREAMCHUNKOPEN 0x105D + +// Stream writer already finished +#define NMR_ERROR_STREAMWRITERALREADYFINISHED 0x105E + +// Stream writer not finished +#define NMR_ERROR_STREAMWRITERNOTFINISHED 0x105F + +// Duplicate Binary Stream +#define NMR_ERROR_DUPLICATEBINARYSTREAM 0x1060 + +// Duplicate Binary Stream Path +#define NMR_ERROR_DUPLICATEBINARYSTREAMPATH 0x1061 + +// Could not compress data +#define NMR_ERROR_COULDNOTCOMPRESSDATA 0x1062 + +// Discretization Value out of range +#define NMR_ERROR_BINARYCHUNK_DISCRETIZATIONVALUEOUTOFRANGE 0x1063 + +// Duplicate Binary Stream UUID +#define NMR_ERROR_DUPLICATEBINARYSTREAMUUID 0x1064 + +// Binary stream not found +#define NMR_ERROR_BINARYSTREAMNOTFOUND 0x1065 + +// Binary streams not allowed +#define NMR_ERROR_BINARYSTREAMSNOTALLOWED 0x1066 + +// Invalid binary chunk stream +#define NMR_ERROR_INVALIDCHUNKSTREAM 0x1067 + +// Invalid binary chunk stream sign +#define NMR_ERROR_INVALIDCHUNKSTREAMSIGN 0x1068 + +// Invalid binary chunk stream version +#define NMR_ERROR_INVALIDCHUNKSTREAMVERSION 0x1069 + +// Too many binary chunks +#define NMR_ERROR_TOOMANYBINARYCHUNKS 0x106A + +// Too many binary chunk entries +#define NMR_ERROR_TOOMANYBINARYCHUNKENTRIES 0x106B + +// Duplicate chunk entry in binary stream +#define NMR_ERROR_DUPLICATECHUNKENTRY 0x106C + +// Invalid file chunk data size +#define NMR_ERROR_INVALIDFILECHUNKDATASIZE 0x106D + +// Invalid chunk compressed data +#define NMR_ERROR_INVALIDCHUNKCOMPRESSEDDATA 0x106E + +// Could not uncompressed data +#define NMR_ERROR_COULDNOTUNCOMPRESSDATA 0x106F + +// Binary chunk entry not found +#define NMR_ERROR_BINARYCHUNKENTRYNOTFOUND 0x1070 + +// Invalid chunk entry index +#define NMR_ERROR_INVALIDENTRYINDEX 0x1071 + +// Invalid chunk data +#define NMR_ERROR_INVALIDCHUNKDATA 0x1072 + +// Invalid chunk entry position +#define NMR_ERROR_INVALIDCHUNKENTRYPOSITION 0x1073 + +// Invalid chunk entry end position +#define NMR_ERROR_INVALIDCHUNKENTRYENDPOSITION 0x1074 + +// Invalid chunk entry size +#define NMR_ERROR_INVALIDCHUNKENTRYSIZE 0x1075 + +// Not enough data to read from chunk +#define NMR_ERROR_NOTENOUGHDATATOREADFROMCHUNK 0x1076 + +// Invalid chunk entry type +#define NMR_ERROR_INVALIDCHUNKENTRYTYPE 0x1077 + +// Unexpected chunk data type +#define NMR_ERROR_UNEXPECTEDCHUNKDATATYPE 0x1078 + +// Invalid float value +#define NMR_ERROR_INVALIDFLOATVALUE 0x1079 + +// Segment attribute defined after reading +#define NMR_ERROR_SEGMENTATTRIBUTEDEFINEDAFTERREADING 0x107A + +// Invalid segment attribute type +#define NMR_ERROR_INVALIDSEGMENTATTRIBUTETYPE 0x107B + +// Invalid segment attribute namespace +#define NMR_ERROR_INVALIDSEGMENTATTRIBUTENAMESPACE 0x107C + +// Invalid segment attribute name +#define NMR_ERROR_INVALIDSEGMENTATTRIBUTENAME 0x107D + +// Invalid segment attribute id +#define NMR_ERROR_INVALIDSEGMENTATTRIBUTEID 0x107E + +// Invalid segment attribute data size +#define NMR_ERROR_INVALIDSEGMENTATTRIBUTEDATASIZE 0x107F + +// Segment attribute is not uint32 +#define NMR_ERROR_SEGMENTATTRIBUTEISNOTUINT32 0x1080 + +// Segment attribute is not double +#define NMR_ERROR_SEGMENTATTRIBUTEISNOTDOUBLE 0x1081 + +// Segment attribute not found +#define NMR_ERROR_SEGMENTATTRIBUTENOTFOUND 0x1082 + +// Namespace prefix already defined +#define NMR_ERROR_NAMESPACEPREFIXALREADYDEFINED 0x1083 + +// Writer does not support namespaces +#define NMR_ERROR_WRITERDOESNOTSUPPORTNAMESPACES 0x1084 + +// Namespace prefix is reserved +#define NMR_ERROR_NAMESPACEPREFIXISRESERVED 0x1085 + +// Namespace not found +#define NMR_ERROR_NAMESPACENOTFOUND 0x1086 + /*------------------------------------------------------------------- Core framework error codes (0x2XXX) -------------------------------------------------------------------*/ @@ -1224,13 +1377,71 @@ Model error codes (0x8XXX) // A transform attribute is duplicated #define NMR_ERROR_DUPLICATETRANSFORM 0x810C - // A component resource is invalid #define NMR_ERROR_INVALIDCOMPONENTRESOURCE 0x810D // A keystore element is not base64 encoded #define NMR_ERROR_KEYSTOREINVALIDENCODING 0x810E + +// Duplicate Mesh Binary Path +#define NMR_ERROR_DUPLICATEMESHBINARYPATH 0x810F + +// Invalid XML attribute in namespace +#define NMR_ERROR_INVALIDBINARYELEMENTID 0x8110 + +// No Binary stream available +#define NMR_ERROR_NOBINARYSTREAMAVAILABLE 0x8111 + +// Missing Name +#define NMR_ERROR_MISSINGNAME 0x8112 + +// Missing Laser Power +#define NMR_ERROR_MISSINGLASERPOWER 0x8113 + +// Missing Laser Speed +#define NMR_ERROR_MISSINGLASERSPEED 0x8114 + +// Missing Laser Focus +#define NMR_ERROR_MISSINGLASERFOCUS 0x8115 + +// Missing Path +#define NMR_ERROR_MISSINGPATH 0x8116 + +// Missing ZTop +#define NMR_ERROR_MISSINGZTOP 0x8117 + +// Duplicate ID +#define NMR_ERROR_DUPLICATEID 0x8118 + +// Missing ID +#define NMR_ERROR_MISSINGID 0x8119 + +// Duplicate Type Attribute +#define NMR_ERROR_DUPLICATETYPEATTRIBUTE 0x811A + +// Invalid Type Attribute +#define NMR_ERROR_INVALIDTYPEATTRIBUTE 0x811B + +// Missing Type Attribute +#define NMR_ERROR_MISSINGTYPEATTRIBUTE 0x811C + +// Missing Coordinate +#define NMR_ERROR_MISSINGCOORDINATE 0x811D + +// Data source is invalid +#define NMR_ERROR_DATASOURCEISINVALIDATED 0x811E + +// Inconsistent binary stream count +#define NMR_ERROR_INCONSISTENTBINARYSTREAMCOUNT 0x811F + +// Missing Unit Factor +#define NMR_ERROR_MISSINGUNITFACTOR 0x8120 + +// Invalid Mesh Binary Path +#define NMR_ERROR_INVALIDMESHBINARYPATH 0x8121 + + /*------------------------------------------------------------------- XML Parser Error Constants (0x9XXX) -------------------------------------------------------------------*/ @@ -1344,5 +1555,35 @@ Library errors (0xAXXX) // Using cryptographically weak random number generator #define NMR_ERROR_RNGCALLBACKNOTCRYPTOSTRONG 0XA00C +/*------------------------------------------------------------------- +Toolpath errors (0xBXXX) +-------------------------------------------------------------------*/ + +// Not in toolpath header writing mode +#define NMR_ERROR_TOOLPATH_NOTWRITINGHEADER 0xB001 + +// Not in toolpath data writing mode +#define NMR_ERROR_TOOLPATH_NOTWRITINGDATA 0xB002 + +// Toolpath has already been written out +#define NMR_ERROR_TOOLPATH_DATAHASBEENWRITTEN 0xB003 + +// Toolpath has an invalid number of points +#define NMR_ERROR_TOOLPATH_INVALIDPOINTCOUNT 0xB004 + +// Layer segment is not open +#define NMR_ERROR_LAYERSEGMENTNOTOPEN 0xB005 + +// Layer segment is already open +#define NMR_ERROR_LAYERSEGMENTALREADYOPEN 0xB006 + +// Profile value not found +#define NMR_ERROR_PROFILEVALUENOTFOUND 0xB007 + +// Too many profile values +#define NMR_ERROR_TOOMANYPROFILEVALUES 0xB008 + +// Too many profile values +#define NMR_ERROR_INVALIDPARAMETERINDEX 0xB009 #endif // __NMR_ERRORCONST diff --git a/Include/Common/NMR_StringUtils.h b/Include/Common/NMR_StringUtils.h index 4cafe3a76..77a1024e2 100644 --- a/Include/Common/NMR_StringUtils.h +++ b/Include/Common/NMR_StringUtils.h @@ -110,6 +110,11 @@ namespace NMR { std::string fnExtractFileName(_In_ const std::string sFullPath); std::string fnExtractFileDir(_In_ const std::string sFullPath); + std::string fnTrimString (_In_ std::string sString); + std::string fnStringToLower(_In_ std::string sString); + + bool fnStringIsValidAlphanumericNameString(const std::string& sString); + template std::vector fnVctType_fromString(_In_ const std::string sInString) { diff --git a/Include/Common/OPC/NMR_IOpcPackageReader.h b/Include/Common/OPC/NMR_IOpcPackageReader.h index 873d24911..50030dfc2 100644 --- a/Include/Common/OPC/NMR_IOpcPackageReader.h +++ b/Include/Common/OPC/NMR_IOpcPackageReader.h @@ -5,6 +5,7 @@ #include #include "Common/NMR_Types.h" #include "Common/NMR_Local.h" +#include "Common/Platform/NMR_ImportStream.h" namespace NMR { class COpcPackageRelationship; @@ -15,6 +16,7 @@ namespace NMR { public: virtual _Ret_maybenull_ COpcPackageRelationship * findRootRelation(_In_ std::string sRelationType, _In_ nfBool bMustBeUnique) = 0; virtual POpcPackagePart createPart(_In_ std::string sPath) = 0; + virtual PImportStream readPartStreamIntoMemory(_In_ std::string sPath) = 0; virtual nfUint64 getPartSize(_In_ std::string sPath) = 0; virtual void close() {} }; diff --git a/Include/Common/OPC/NMR_OpcPackageReader.h b/Include/Common/OPC/NMR_OpcPackageReader.h index 3e1987609..fb6f4d5a5 100644 --- a/Include/Common/OPC/NMR_OpcPackageReader.h +++ b/Include/Common/OPC/NMR_OpcPackageReader.h @@ -80,6 +80,9 @@ namespace NMR { _Ret_maybenull_ COpcPackageRelationship * findRootRelation(_In_ std::string sRelationType, _In_ nfBool bMustBeUnique) override; POpcPackagePart createPart(_In_ std::string sPath) override; nfUint64 getPartSize(_In_ std::string sPath) override; + + PImportStream readPartStreamIntoMemory(_In_ std::string sPath) override; + }; typedef std::shared_ptr POpcPackageReader; diff --git a/Include/Common/Platform/NMR_XmlWriter.h b/Include/Common/Platform/NMR_XmlWriter.h index e5b2e29bf..c81b65b6d 100644 --- a/Include/Common/Platform/NMR_XmlWriter.h +++ b/Include/Common/Platform/NMR_XmlWriter.h @@ -58,7 +58,7 @@ namespace NMR { virtual void WriteText(_In_ const nfChar * pszContent, _In_ const nfUint32 cbLength) = 0; virtual bool GetNamespacePrefix(const std::string &sNameSpaceURI, std::string &sNameSpacePrefix) = 0; - virtual void RegisterCustomNameSpace(const std::string &sNameSpace, const std::string &sNameSpacePrefix) = 0; + virtual void RegisterCustomNameSpace(const std::string &sNameSpace, const std::string &sNameSpacePrefix, bool bFailIfExisting) = 0; virtual nfUint32 GetNamespaceCount() = 0; virtual std::string GetNamespacePrefix(nfUint32 nIndex) = 0; virtual std::string GetNamespace(nfUint32 nIndex) = 0; diff --git a/Include/Common/Platform/NMR_XmlWriter_Native.h b/Include/Common/Platform/NMR_XmlWriter_Native.h index 95284f307..fffc1f48f 100644 --- a/Include/Common/Platform/NMR_XmlWriter_Native.h +++ b/Include/Common/Platform/NMR_XmlWriter_Native.h @@ -95,7 +95,7 @@ namespace NMR { virtual void WriteRawLine(_In_ const nfChar * pszRawData, _In_ nfUint32 cbCount); virtual bool GetNamespacePrefix(const std::string &sNameSpaceURI, std::string &sNameSpacePrefix); - virtual void RegisterCustomNameSpace(const std::string &sNameSpace, const std::string &sNameSpacePrefix); + virtual void RegisterCustomNameSpace(const std::string &sNameSpace, const std::string &sNameSpacePrefix, bool bFailIfExisting); virtual nfUint32 GetNamespaceCount(); virtual std::string GetNamespacePrefix(nfUint32 nIndex); virtual std::string GetNamespace(nfUint32 nIndex); diff --git a/Include/Libraries/lzma/7z.h b/Include/Libraries/lzma/7z.h new file mode 100644 index 000000000..6c7886e38 --- /dev/null +++ b/Include/Libraries/lzma/7z.h @@ -0,0 +1,202 @@ +/* 7z.h -- 7z interface +2017-04-03 : Igor Pavlov : Public domain */ + +#ifndef __7Z_H +#define __7Z_H + +#include "7zTypes.h" + +EXTERN_C_BEGIN + +#define k7zStartHeaderSize 0x20 +#define k7zSignatureSize 6 + +extern const Byte k7zSignature[k7zSignatureSize]; + +typedef struct +{ + const Byte *Data; + size_t Size; +} CSzData; + +/* CSzCoderInfo & CSzFolder support only default methods */ + +typedef struct +{ + size_t PropsOffset; + UInt32 MethodID; + Byte NumStreams; + Byte PropsSize; +} CSzCoderInfo; + +typedef struct +{ + UInt32 InIndex; + UInt32 OutIndex; +} CSzBond; + +#define SZ_NUM_CODERS_IN_FOLDER_MAX 4 +#define SZ_NUM_BONDS_IN_FOLDER_MAX 3 +#define SZ_NUM_PACK_STREAMS_IN_FOLDER_MAX 4 + +typedef struct +{ + UInt32 NumCoders; + UInt32 NumBonds; + UInt32 NumPackStreams; + UInt32 UnpackStream; + UInt32 PackStreams[SZ_NUM_PACK_STREAMS_IN_FOLDER_MAX]; + CSzBond Bonds[SZ_NUM_BONDS_IN_FOLDER_MAX]; + CSzCoderInfo Coders[SZ_NUM_CODERS_IN_FOLDER_MAX]; +} CSzFolder; + + +SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd); + +typedef struct +{ + UInt32 Low; + UInt32 High; +} CNtfsFileTime; + +typedef struct +{ + Byte *Defs; /* MSB 0 bit numbering */ + UInt32 *Vals; +} CSzBitUi32s; + +typedef struct +{ + Byte *Defs; /* MSB 0 bit numbering */ + // UInt64 *Vals; + CNtfsFileTime *Vals; +} CSzBitUi64s; + +#define SzBitArray_Check(p, i) (((p)[(i) >> 3] & (0x80 >> ((i) & 7))) != 0) + +#define SzBitWithVals_Check(p, i) ((p)->Defs && ((p)->Defs[(i) >> 3] & (0x80 >> ((i) & 7))) != 0) + +typedef struct +{ + UInt32 NumPackStreams; + UInt32 NumFolders; + + UInt64 *PackPositions; // NumPackStreams + 1 + CSzBitUi32s FolderCRCs; // NumFolders + + size_t *FoCodersOffsets; // NumFolders + 1 + UInt32 *FoStartPackStreamIndex; // NumFolders + 1 + UInt32 *FoToCoderUnpackSizes; // NumFolders + 1 + Byte *FoToMainUnpackSizeIndex; // NumFolders + UInt64 *CoderUnpackSizes; // for all coders in all folders + + Byte *CodersData; +} CSzAr; + +UInt64 SzAr_GetFolderUnpackSize(const CSzAr *p, UInt32 folderIndex); + +SRes SzAr_DecodeFolder(const CSzAr *p, UInt32 folderIndex, + ILookInStream *stream, UInt64 startPos, + Byte *outBuffer, size_t outSize, + ISzAllocPtr allocMain); + +typedef struct +{ + CSzAr db; + + UInt64 startPosAfterHeader; + UInt64 dataPos; + + UInt32 NumFiles; + + UInt64 *UnpackPositions; // NumFiles + 1 + // Byte *IsEmptyFiles; + Byte *IsDirs; + CSzBitUi32s CRCs; + + CSzBitUi32s Attribs; + // CSzBitUi32s Parents; + CSzBitUi64s MTime; + CSzBitUi64s CTime; + + UInt32 *FolderToFile; // NumFolders + 1 + UInt32 *FileToFolder; // NumFiles + + size_t *FileNameOffsets; /* in 2-byte steps */ + Byte *FileNames; /* UTF-16-LE */ +} CSzArEx; + +#define SzArEx_IsDir(p, i) (SzBitArray_Check((p)->IsDirs, i)) + +#define SzArEx_GetFileSize(p, i) ((p)->UnpackPositions[(i) + 1] - (p)->UnpackPositions[i]) + +void SzArEx_Init(CSzArEx *p); +void SzArEx_Free(CSzArEx *p, ISzAllocPtr alloc); +UInt64 SzArEx_GetFolderStreamPos(const CSzArEx *p, UInt32 folderIndex, UInt32 indexInFolder); +int SzArEx_GetFolderFullPackSize(const CSzArEx *p, UInt32 folderIndex, UInt64 *resSize); + +/* +if dest == NULL, the return value specifies the required size of the buffer, + in 16-bit characters, including the null-terminating character. +if dest != NULL, the return value specifies the number of 16-bit characters that + are written to the dest, including the null-terminating character. */ + +size_t SzArEx_GetFileNameUtf16(const CSzArEx *p, size_t fileIndex, UInt16 *dest); + +/* +size_t SzArEx_GetFullNameLen(const CSzArEx *p, size_t fileIndex); +UInt16 *SzArEx_GetFullNameUtf16_Back(const CSzArEx *p, size_t fileIndex, UInt16 *dest); +*/ + + + +/* + SzArEx_Extract extracts file from archive + + *outBuffer must be 0 before first call for each new archive. + + Extracting cache: + If you need to decompress more than one file, you can send + these values from previous call: + *blockIndex, + *outBuffer, + *outBufferSize + You can consider "*outBuffer" as cache of solid block. If your archive is solid, + it will increase decompression speed. + + If you use external function, you can declare these 3 cache variables + (blockIndex, outBuffer, outBufferSize) as static in that external function. + + Free *outBuffer and set *outBuffer to 0, if you want to flush cache. +*/ + +SRes SzArEx_Extract( + const CSzArEx *db, + ILookInStream *inStream, + UInt32 fileIndex, /* index of file */ + UInt32 *blockIndex, /* index of solid block */ + Byte **outBuffer, /* pointer to pointer to output buffer (allocated with allocMain) */ + size_t *outBufferSize, /* buffer size for output buffer */ + size_t *offset, /* offset of stream for required file in *outBuffer */ + size_t *outSizeProcessed, /* size of file in *outBuffer */ + ISzAllocPtr allocMain, + ISzAllocPtr allocTemp); + + +/* +SzArEx_Open Errors: +SZ_ERROR_NO_ARCHIVE +SZ_ERROR_ARCHIVE +SZ_ERROR_UNSUPPORTED +SZ_ERROR_MEM +SZ_ERROR_CRC +SZ_ERROR_INPUT_EOF +SZ_ERROR_FAIL +*/ + +SRes SzArEx_Open(CSzArEx *p, ILookInStream *inStream, + ISzAllocPtr allocMain, ISzAllocPtr allocTemp); + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/7zAlloc.h b/Include/Libraries/lzma/7zAlloc.h new file mode 100644 index 000000000..44778f9b2 --- /dev/null +++ b/Include/Libraries/lzma/7zAlloc.h @@ -0,0 +1,19 @@ +/* 7zAlloc.h -- Allocation functions +2017-04-03 : Igor Pavlov : Public domain */ + +#ifndef __7Z_ALLOC_H +#define __7Z_ALLOC_H + +#include "7zTypes.h" + +EXTERN_C_BEGIN + +void *SzAlloc(ISzAllocPtr p, size_t size); +void SzFree(ISzAllocPtr p, void *address); + +void *SzAllocTemp(ISzAllocPtr p, size_t size); +void SzFreeTemp(ISzAllocPtr p, void *address); + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/7zBuf.h b/Include/Libraries/lzma/7zBuf.h new file mode 100644 index 000000000..81d1b5b64 --- /dev/null +++ b/Include/Libraries/lzma/7zBuf.h @@ -0,0 +1,35 @@ +/* 7zBuf.h -- Byte Buffer +2017-04-03 : Igor Pavlov : Public domain */ + +#ifndef __7Z_BUF_H +#define __7Z_BUF_H + +#include "7zTypes.h" + +EXTERN_C_BEGIN + +typedef struct +{ + Byte *data; + size_t size; +} CBuf; + +void Buf_Init(CBuf *p); +int Buf_Create(CBuf *p, size_t size, ISzAllocPtr alloc); +void Buf_Free(CBuf *p, ISzAllocPtr alloc); + +typedef struct +{ + Byte *data; + size_t size; + size_t pos; +} CDynBuf; + +void DynBuf_Construct(CDynBuf *p); +void DynBuf_SeekToBeg(CDynBuf *p); +int DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAllocPtr alloc); +void DynBuf_Free(CDynBuf *p, ISzAllocPtr alloc); + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/7zCrc.h b/Include/Libraries/lzma/7zCrc.h new file mode 100644 index 000000000..8fd579587 --- /dev/null +++ b/Include/Libraries/lzma/7zCrc.h @@ -0,0 +1,25 @@ +/* 7zCrc.h -- CRC32 calculation +2013-01-18 : Igor Pavlov : Public domain */ + +#ifndef __7Z_CRC_H +#define __7Z_CRC_H + +#include "7zTypes.h" + +EXTERN_C_BEGIN + +extern UInt32 g_CrcTable[]; + +/* Call CrcGenerateTable one time before other CRC functions */ +void MY_FAST_CALL CrcGenerateTable(void); + +#define CRC_INIT_VAL 0xFFFFFFFF +#define CRC_GET_DIGEST(crc) ((crc) ^ CRC_INIT_VAL) +#define CRC_UPDATE_BYTE(crc, b) (g_CrcTable[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8)) + +UInt32 MY_FAST_CALL CrcUpdate(UInt32 crc, const void *data, size_t size); +UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size); + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/7zFile.h b/Include/Libraries/lzma/7zFile.h new file mode 100644 index 000000000..0e7925382 --- /dev/null +++ b/Include/Libraries/lzma/7zFile.h @@ -0,0 +1,83 @@ +/* 7zFile.h -- File IO +2017-04-03 : Igor Pavlov : Public domain */ + +#ifndef __7Z_FILE_H +#define __7Z_FILE_H + +#ifdef _WIN32 +#define USE_WINDOWS_FILE +#endif + +#ifdef USE_WINDOWS_FILE +#include +#else +#include +#endif + +#include "7zTypes.h" + +EXTERN_C_BEGIN + +/* ---------- File ---------- */ + +typedef struct +{ + #ifdef USE_WINDOWS_FILE + HANDLE handle; + #else + FILE *file; + #endif +} CSzFile; + +void File_Construct(CSzFile *p); +#if !defined(UNDER_CE) || !defined(USE_WINDOWS_FILE) +WRes InFile_Open(CSzFile *p, const char *name); +WRes OutFile_Open(CSzFile *p, const char *name); +#endif +#ifdef USE_WINDOWS_FILE +WRes InFile_OpenW(CSzFile *p, const WCHAR *name); +WRes OutFile_OpenW(CSzFile *p, const WCHAR *name); +#endif +WRes File_Close(CSzFile *p); + +/* reads max(*size, remain file's size) bytes */ +WRes File_Read(CSzFile *p, void *data, size_t *size); + +/* writes *size bytes */ +WRes File_Write(CSzFile *p, const void *data, size_t *size); + +WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin); +WRes File_GetLength(CSzFile *p, UInt64 *length); + + +/* ---------- FileInStream ---------- */ + +typedef struct +{ + ISeqInStream vt; + CSzFile file; +} CFileSeqInStream; + +void FileSeqInStream_CreateVTable(CFileSeqInStream *p); + + +typedef struct +{ + ISeekInStream vt; + CSzFile file; +} CFileInStream; + +void FileInStream_CreateVTable(CFileInStream *p); + + +typedef struct +{ + ISeqOutStream vt; + CSzFile file; +} CFileOutStream; + +void FileOutStream_CreateVTable(CFileOutStream *p); + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/7zTypes.h b/Include/Libraries/lzma/7zTypes.h new file mode 100644 index 000000000..65b3af63c --- /dev/null +++ b/Include/Libraries/lzma/7zTypes.h @@ -0,0 +1,375 @@ +/* 7zTypes.h -- Basic types +2018-08-04 : Igor Pavlov : Public domain */ + +#ifndef __7Z_TYPES_H +#define __7Z_TYPES_H + +#ifdef _WIN32 +/* #include */ +#endif + +#include + +#ifndef EXTERN_C_BEGIN +#ifdef __cplusplus +#define EXTERN_C_BEGIN extern "C" { +#define EXTERN_C_END } +#else +#define EXTERN_C_BEGIN +#define EXTERN_C_END +#endif +#endif + +EXTERN_C_BEGIN + +#define SZ_OK 0 + +#define SZ_ERROR_DATA 1 +#define SZ_ERROR_MEM 2 +#define SZ_ERROR_CRC 3 +#define SZ_ERROR_UNSUPPORTED 4 +#define SZ_ERROR_PARAM 5 +#define SZ_ERROR_INPUT_EOF 6 +#define SZ_ERROR_OUTPUT_EOF 7 +#define SZ_ERROR_READ 8 +#define SZ_ERROR_WRITE 9 +#define SZ_ERROR_PROGRESS 10 +#define SZ_ERROR_FAIL 11 +#define SZ_ERROR_THREAD 12 + +#define SZ_ERROR_ARCHIVE 16 +#define SZ_ERROR_NO_ARCHIVE 17 + +typedef int SRes; + + +#ifdef _WIN32 + +/* typedef DWORD WRes; */ +typedef unsigned WRes; +#define MY_SRes_HRESULT_FROM_WRes(x) HRESULT_FROM_WIN32(x) + +#else + +typedef int WRes; +#define MY__FACILITY_WIN32 7 +#define MY__FACILITY__WRes MY__FACILITY_WIN32 +#define MY_SRes_HRESULT_FROM_WRes(x) ((HRESULT)(x) <= 0 ? ((HRESULT)(x)) : ((HRESULT) (((x) & 0x0000FFFF) | (MY__FACILITY__WRes << 16) | 0x80000000))) + +#endif + + +#ifndef RINOK +#define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; } +#endif + +typedef unsigned char Byte; +typedef short Int16; +typedef unsigned short UInt16; + +#ifdef _LZMA_UINT32_IS_ULONG +typedef long Int32; +typedef unsigned long UInt32; +#else +typedef int Int32; +typedef unsigned int UInt32; +#endif + +#ifdef _SZ_NO_INT_64 + +/* define _SZ_NO_INT_64, if your compiler doesn't support 64-bit integers. + NOTES: Some code will work incorrectly in that case! */ + +typedef long Int64; +typedef unsigned long UInt64; + +#else + +#if defined(_MSC_VER) || defined(__BORLANDC__) +typedef __int64 Int64; +typedef unsigned __int64 UInt64; +#define UINT64_CONST(n) n +#else +typedef long long int Int64; +typedef unsigned long long int UInt64; +#define UINT64_CONST(n) n ## ULL +#endif + +#endif + +#ifdef _LZMA_NO_SYSTEM_SIZE_T +typedef UInt32 SizeT; +#else +typedef size_t SizeT; +#endif + +typedef int BoolInt; +/* typedef BoolInt Bool; */ +#define True 1 +#define False 0 + + +#ifdef _WIN32 +#define MY_STD_CALL __stdcall +#else +#define MY_STD_CALL +#endif + +#ifdef _MSC_VER + +#if _MSC_VER >= 1300 +#define MY_NO_INLINE __declspec(noinline) +#else +#define MY_NO_INLINE +#endif + +#define MY_FORCE_INLINE __forceinline + +#define MY_CDECL __cdecl +#define MY_FAST_CALL __fastcall + +#else + +#define MY_NO_INLINE +#define MY_FORCE_INLINE +#define MY_CDECL +#define MY_FAST_CALL + +/* inline keyword : for C++ / C99 */ + +/* GCC, clang: */ +/* +#if defined (__GNUC__) && (__GNUC__ >= 4) +#define MY_FORCE_INLINE __attribute__((always_inline)) +#define MY_NO_INLINE __attribute__((noinline)) +#endif +*/ + +#endif + + +/* The following interfaces use first parameter as pointer to structure */ + +typedef struct IByteIn IByteIn; +struct IByteIn +{ + Byte (*Read)(const IByteIn *p); /* reads one byte, returns 0 in case of EOF or error */ +}; +#define IByteIn_Read(p) (p)->Read(p) + + +typedef struct IByteOut IByteOut; +struct IByteOut +{ + void (*Write)(const IByteOut *p, Byte b); +}; +#define IByteOut_Write(p, b) (p)->Write(p, b) + + +typedef struct ISeqInStream ISeqInStream; +struct ISeqInStream +{ + SRes (*Read)(const ISeqInStream *p, void *buf, size_t *size); + /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream. + (output(*size) < input(*size)) is allowed */ +}; +#define ISeqInStream_Read(p, buf, size) (p)->Read(p, buf, size) + +/* it can return SZ_ERROR_INPUT_EOF */ +SRes SeqInStream_Read(const ISeqInStream *stream, void *buf, size_t size); +SRes SeqInStream_Read2(const ISeqInStream *stream, void *buf, size_t size, SRes errorType); +SRes SeqInStream_ReadByte(const ISeqInStream *stream, Byte *buf); + + +typedef struct ISeqOutStream ISeqOutStream; +struct ISeqOutStream +{ + size_t (*Write)(const ISeqOutStream *p, const void *buf, size_t size); + /* Returns: result - the number of actually written bytes. + (result < size) means error */ +}; +#define ISeqOutStream_Write(p, buf, size) (p)->Write(p, buf, size) + +typedef enum +{ + SZ_SEEK_SET = 0, + SZ_SEEK_CUR = 1, + SZ_SEEK_END = 2 +} ESzSeek; + + +typedef struct ISeekInStream ISeekInStream; +struct ISeekInStream +{ + SRes (*Read)(const ISeekInStream *p, void *buf, size_t *size); /* same as ISeqInStream::Read */ + SRes (*Seek)(const ISeekInStream *p, Int64 *pos, ESzSeek origin); +}; +#define ISeekInStream_Read(p, buf, size) (p)->Read(p, buf, size) +#define ISeekInStream_Seek(p, pos, origin) (p)->Seek(p, pos, origin) + + +typedef struct ILookInStream ILookInStream; +struct ILookInStream +{ + SRes (*Look)(const ILookInStream *p, const void **buf, size_t *size); + /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream. + (output(*size) > input(*size)) is not allowed + (output(*size) < input(*size)) is allowed */ + SRes (*Skip)(const ILookInStream *p, size_t offset); + /* offset must be <= output(*size) of Look */ + + SRes (*Read)(const ILookInStream *p, void *buf, size_t *size); + /* reads directly (without buffer). It's same as ISeqInStream::Read */ + SRes (*Seek)(const ILookInStream *p, Int64 *pos, ESzSeek origin); +}; + +#define ILookInStream_Look(p, buf, size) (p)->Look(p, buf, size) +#define ILookInStream_Skip(p, offset) (p)->Skip(p, offset) +#define ILookInStream_Read(p, buf, size) (p)->Read(p, buf, size) +#define ILookInStream_Seek(p, pos, origin) (p)->Seek(p, pos, origin) + + +SRes LookInStream_LookRead(const ILookInStream *stream, void *buf, size_t *size); +SRes LookInStream_SeekTo(const ILookInStream *stream, UInt64 offset); + +/* reads via ILookInStream::Read */ +SRes LookInStream_Read2(const ILookInStream *stream, void *buf, size_t size, SRes errorType); +SRes LookInStream_Read(const ILookInStream *stream, void *buf, size_t size); + + + +typedef struct +{ + ILookInStream vt; + const ISeekInStream *realStream; + + size_t pos; + size_t size; /* it's data size */ + + /* the following variables must be set outside */ + Byte *buf; + size_t bufSize; +} CLookToRead2; + +void LookToRead2_CreateVTable(CLookToRead2 *p, int lookahead); + +#define LookToRead2_Init(p) { (p)->pos = (p)->size = 0; } + + +typedef struct +{ + ISeqInStream vt; + const ILookInStream *realStream; +} CSecToLook; + +void SecToLook_CreateVTable(CSecToLook *p); + + + +typedef struct +{ + ISeqInStream vt; + const ILookInStream *realStream; +} CSecToRead; + +void SecToRead_CreateVTable(CSecToRead *p); + + +typedef struct ICompressProgress ICompressProgress; + +struct ICompressProgress +{ + SRes (*Progress)(const ICompressProgress *p, UInt64 inSize, UInt64 outSize); + /* Returns: result. (result != SZ_OK) means break. + Value (UInt64)(Int64)-1 for size means unknown value. */ +}; +#define ICompressProgress_Progress(p, inSize, outSize) (p)->Progress(p, inSize, outSize) + + + +typedef struct ISzAlloc ISzAlloc; +typedef const ISzAlloc * ISzAllocPtr; + +struct ISzAlloc +{ + void *(*Alloc)(ISzAllocPtr p, size_t size); + void (*Free)(ISzAllocPtr p, void *address); /* address can be 0 */ +}; + +#define ISzAlloc_Alloc(p, size) (p)->Alloc(p, size) +#define ISzAlloc_Free(p, a) (p)->Free(p, a) + +/* deprecated */ +#define IAlloc_Alloc(p, size) ISzAlloc_Alloc(p, size) +#define IAlloc_Free(p, a) ISzAlloc_Free(p, a) + + + + + +#ifndef MY_offsetof + #ifdef offsetof + #define MY_offsetof(type, m) offsetof(type, m) + /* + #define MY_offsetof(type, m) FIELD_OFFSET(type, m) + */ + #else + #define MY_offsetof(type, m) ((size_t)&(((type *)0)->m)) + #endif +#endif + + + +#ifndef MY_container_of + +/* +#define MY_container_of(ptr, type, m) container_of(ptr, type, m) +#define MY_container_of(ptr, type, m) CONTAINING_RECORD(ptr, type, m) +#define MY_container_of(ptr, type, m) ((type *)((char *)(ptr) - offsetof(type, m))) +#define MY_container_of(ptr, type, m) (&((type *)0)->m == (ptr), ((type *)(((char *)(ptr)) - MY_offsetof(type, m)))) +*/ + +/* + GCC shows warning: "perhaps the 'offsetof' macro was used incorrectly" + GCC 3.4.4 : classes with constructor + GCC 4.8.1 : classes with non-public variable members" +*/ + +#define MY_container_of(ptr, type, m) ((type *)((char *)(1 ? (ptr) : &((type *)0)->m) - MY_offsetof(type, m))) + + +#endif + +#define CONTAINER_FROM_VTBL_SIMPLE(ptr, type, m) ((type *)(ptr)) + +/* +#define CONTAINER_FROM_VTBL(ptr, type, m) CONTAINER_FROM_VTBL_SIMPLE(ptr, type, m) +*/ +#define CONTAINER_FROM_VTBL(ptr, type, m) MY_container_of(ptr, type, m) + +#define CONTAINER_FROM_VTBL_CLS(ptr, type, m) CONTAINER_FROM_VTBL_SIMPLE(ptr, type, m) +/* +#define CONTAINER_FROM_VTBL_CLS(ptr, type, m) CONTAINER_FROM_VTBL(ptr, type, m) +*/ + + + +#ifdef _WIN32 + +#define CHAR_PATH_SEPARATOR '\\' +#define WCHAR_PATH_SEPARATOR L'\\' +#define STRING_PATH_SEPARATOR "\\" +#define WSTRING_PATH_SEPARATOR L"\\" + +#else + +#define CHAR_PATH_SEPARATOR '/' +#define WCHAR_PATH_SEPARATOR L'/' +#define STRING_PATH_SEPARATOR "/" +#define WSTRING_PATH_SEPARATOR L"/" + +#endif + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/7zVersion.h b/Include/Libraries/lzma/7zVersion.h new file mode 100644 index 000000000..c176823a4 --- /dev/null +++ b/Include/Libraries/lzma/7zVersion.h @@ -0,0 +1,27 @@ +#define MY_VER_MAJOR 19 +#define MY_VER_MINOR 00 +#define MY_VER_BUILD 0 +#define MY_VERSION_NUMBERS "19.00" +#define MY_VERSION MY_VERSION_NUMBERS + +#ifdef MY_CPU_NAME + #define MY_VERSION_CPU MY_VERSION " (" MY_CPU_NAME ")" +#else + #define MY_VERSION_CPU MY_VERSION +#endif + +#define MY_DATE "2019-02-21" +#undef MY_COPYRIGHT +#undef MY_VERSION_COPYRIGHT_DATE +#define MY_AUTHOR_NAME "Igor Pavlov" +#define MY_COPYRIGHT_PD "Igor Pavlov : Public domain" +#define MY_COPYRIGHT_CR "Copyright (c) 1999-2018 Igor Pavlov" + +#ifdef USE_COPYRIGHT_CR + #define MY_COPYRIGHT MY_COPYRIGHT_CR +#else + #define MY_COPYRIGHT MY_COPYRIGHT_PD +#endif + +#define MY_COPYRIGHT_DATE MY_COPYRIGHT " : " MY_DATE +#define MY_VERSION_COPYRIGHT_DATE MY_VERSION_CPU " : " MY_COPYRIGHT " : " MY_DATE diff --git a/Include/Libraries/lzma/7zVersion.rc b/Include/Libraries/lzma/7zVersion.rc new file mode 100644 index 000000000..e520995dd --- /dev/null +++ b/Include/Libraries/lzma/7zVersion.rc @@ -0,0 +1,55 @@ +#define MY_VS_FFI_FILEFLAGSMASK 0x0000003FL +#define MY_VOS_NT_WINDOWS32 0x00040004L +#define MY_VOS_CE_WINDOWS32 0x00050004L + +#define MY_VFT_APP 0x00000001L +#define MY_VFT_DLL 0x00000002L + +// #include + +#ifndef MY_VERSION +#include "7zVersion.h" +#endif + +#define MY_VER MY_VER_MAJOR,MY_VER_MINOR,MY_VER_BUILD,0 + +#ifdef DEBUG +#define DBG_FL VS_FF_DEBUG +#else +#define DBG_FL 0 +#endif + +#define MY_VERSION_INFO(fileType, descr, intName, origName) \ +LANGUAGE 9, 1 \ +1 VERSIONINFO \ + FILEVERSION MY_VER \ + PRODUCTVERSION MY_VER \ + FILEFLAGSMASK MY_VS_FFI_FILEFLAGSMASK \ + FILEFLAGS DBG_FL \ + FILEOS MY_VOS_NT_WINDOWS32 \ + FILETYPE fileType \ + FILESUBTYPE 0x0L \ +BEGIN \ + BLOCK "StringFileInfo" \ + BEGIN \ + BLOCK "040904b0" \ + BEGIN \ + VALUE "CompanyName", "Igor Pavlov" \ + VALUE "FileDescription", descr \ + VALUE "FileVersion", MY_VERSION \ + VALUE "InternalName", intName \ + VALUE "LegalCopyright", MY_COPYRIGHT \ + VALUE "OriginalFilename", origName \ + VALUE "ProductName", "7-Zip" \ + VALUE "ProductVersion", MY_VERSION \ + END \ + END \ + BLOCK "VarFileInfo" \ + BEGIN \ + VALUE "Translation", 0x409, 1200 \ + END \ +END + +#define MY_VERSION_INFO_APP(descr, intName) MY_VERSION_INFO(MY_VFT_APP, descr, intName, intName ".exe") + +#define MY_VERSION_INFO_DLL(descr, intName) MY_VERSION_INFO(MY_VFT_DLL, descr, intName, intName ".dll") diff --git a/Include/Libraries/lzma/Aes.h b/Include/Libraries/lzma/Aes.h new file mode 100644 index 000000000..64979b5bc --- /dev/null +++ b/Include/Libraries/lzma/Aes.h @@ -0,0 +1,38 @@ +/* Aes.h -- AES encryption / decryption +2013-01-18 : Igor Pavlov : Public domain */ + +#ifndef __AES_H +#define __AES_H + +#include "7zTypes.h" + +EXTERN_C_BEGIN + +#define AES_BLOCK_SIZE 16 + +/* Call AesGenTables one time before other AES functions */ +void AesGenTables(void); + +/* UInt32 pointers must be 16-byte aligned */ + +/* 16-byte (4 * 32-bit words) blocks: 1 (IV) + 1 (keyMode) + 15 (AES-256 roundKeys) */ +#define AES_NUM_IVMRK_WORDS ((1 + 1 + 15) * 4) + +/* aes - 16-byte aligned pointer to keyMode+roundKeys sequence */ +/* keySize = 16 or 24 or 32 (bytes) */ +typedef void (MY_FAST_CALL *AES_SET_KEY_FUNC)(UInt32 *aes, const Byte *key, unsigned keySize); +void MY_FAST_CALL Aes_SetKey_Enc(UInt32 *aes, const Byte *key, unsigned keySize); +void MY_FAST_CALL Aes_SetKey_Dec(UInt32 *aes, const Byte *key, unsigned keySize); + +/* ivAes - 16-byte aligned pointer to iv+keyMode+roundKeys sequence: UInt32[AES_NUM_IVMRK_WORDS] */ +void AesCbc_Init(UInt32 *ivAes, const Byte *iv); /* iv size is AES_BLOCK_SIZE */ +/* data - 16-byte aligned pointer to data */ +/* numBlocks - the number of 16-byte blocks in data array */ +typedef void (MY_FAST_CALL *AES_CODE_FUNC)(UInt32 *ivAes, Byte *data, size_t numBlocks); +extern AES_CODE_FUNC g_AesCbc_Encode; +extern AES_CODE_FUNC g_AesCbc_Decode; +extern AES_CODE_FUNC g_AesCtr_Code; + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/Alloc.h b/Include/Libraries/lzma/Alloc.h new file mode 100644 index 000000000..648237646 --- /dev/null +++ b/Include/Libraries/lzma/Alloc.h @@ -0,0 +1,51 @@ +/* Alloc.h -- Memory allocation functions +2018-02-19 : Igor Pavlov : Public domain */ + +#ifndef __COMMON_ALLOC_H +#define __COMMON_ALLOC_H + +#include "7zTypes.h" + +EXTERN_C_BEGIN + +void *MyAlloc(size_t size); +void MyFree(void *address); + +#ifdef _WIN32 + +void SetLargePageSize(); + +void *MidAlloc(size_t size); +void MidFree(void *address); +void *BigAlloc(size_t size); +void BigFree(void *address); + +#else + +#define MidAlloc(size) MyAlloc(size) +#define MidFree(address) MyFree(address) +#define BigAlloc(size) MyAlloc(size) +#define BigFree(address) MyFree(address) + +#endif + +extern const ISzAlloc g_Alloc; +extern const ISzAlloc g_BigAlloc; +extern const ISzAlloc g_MidAlloc; +extern const ISzAlloc g_AlignedAlloc; + + +typedef struct +{ + ISzAlloc vt; + ISzAllocPtr baseAlloc; + unsigned numAlignBits; /* ((1 << numAlignBits) >= sizeof(void *)) */ + size_t offset; /* (offset == (k * sizeof(void *)) && offset < (1 << numAlignBits) */ +} CAlignOffsetAlloc; + +void AlignOffsetAlloc_CreateVTable(CAlignOffsetAlloc *p); + + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/Bcj2.h b/Include/Libraries/lzma/Bcj2.h new file mode 100644 index 000000000..8824080ac --- /dev/null +++ b/Include/Libraries/lzma/Bcj2.h @@ -0,0 +1,146 @@ +/* Bcj2.h -- BCJ2 Converter for x86 code +2014-11-10 : Igor Pavlov : Public domain */ + +#ifndef __BCJ2_H +#define __BCJ2_H + +#include "7zTypes.h" + +EXTERN_C_BEGIN + +#define BCJ2_NUM_STREAMS 4 + +enum +{ + BCJ2_STREAM_MAIN, + BCJ2_STREAM_CALL, + BCJ2_STREAM_JUMP, + BCJ2_STREAM_RC +}; + +enum +{ + BCJ2_DEC_STATE_ORIG_0 = BCJ2_NUM_STREAMS, + BCJ2_DEC_STATE_ORIG_1, + BCJ2_DEC_STATE_ORIG_2, + BCJ2_DEC_STATE_ORIG_3, + + BCJ2_DEC_STATE_ORIG, + BCJ2_DEC_STATE_OK +}; + +enum +{ + BCJ2_ENC_STATE_ORIG = BCJ2_NUM_STREAMS, + BCJ2_ENC_STATE_OK +}; + + +#define BCJ2_IS_32BIT_STREAM(s) ((s) == BCJ2_STREAM_CALL || (s) == BCJ2_STREAM_JUMP) + +/* +CBcj2Dec / CBcj2Enc +bufs sizes: + BUF_SIZE(n) = lims[n] - bufs[n] +bufs sizes for BCJ2_STREAM_CALL and BCJ2_STREAM_JUMP must be mutliply of 4: + (BUF_SIZE(BCJ2_STREAM_CALL) & 3) == 0 + (BUF_SIZE(BCJ2_STREAM_JUMP) & 3) == 0 +*/ + +/* +CBcj2Dec: +dest is allowed to overlap with bufs[BCJ2_STREAM_MAIN], with the following conditions: + bufs[BCJ2_STREAM_MAIN] >= dest && + bufs[BCJ2_STREAM_MAIN] - dest >= tempReserv + + BUF_SIZE(BCJ2_STREAM_CALL) + + BUF_SIZE(BCJ2_STREAM_JUMP) + tempReserv = 0 : for first call of Bcj2Dec_Decode + tempReserv = 4 : for any other calls of Bcj2Dec_Decode + overlap with offset = 1 is not allowed +*/ + +typedef struct +{ + const Byte *bufs[BCJ2_NUM_STREAMS]; + const Byte *lims[BCJ2_NUM_STREAMS]; + Byte *dest; + const Byte *destLim; + + unsigned state; /* BCJ2_STREAM_MAIN has more priority than BCJ2_STATE_ORIG */ + + UInt32 ip; + Byte temp[4]; + UInt32 range; + UInt32 code; + UInt16 probs[2 + 256]; +} CBcj2Dec; + +void Bcj2Dec_Init(CBcj2Dec *p); + +/* Returns: SZ_OK or SZ_ERROR_DATA */ +SRes Bcj2Dec_Decode(CBcj2Dec *p); + +#define Bcj2Dec_IsFinished(_p_) ((_p_)->code == 0) + + + +typedef enum +{ + BCJ2_ENC_FINISH_MODE_CONTINUE, + BCJ2_ENC_FINISH_MODE_END_BLOCK, + BCJ2_ENC_FINISH_MODE_END_STREAM +} EBcj2Enc_FinishMode; + +typedef struct +{ + Byte *bufs[BCJ2_NUM_STREAMS]; + const Byte *lims[BCJ2_NUM_STREAMS]; + const Byte *src; + const Byte *srcLim; + + unsigned state; + EBcj2Enc_FinishMode finishMode; + + Byte prevByte; + + Byte cache; + UInt32 range; + UInt64 low; + UInt64 cacheSize; + + UInt32 ip; + + /* 32-bit ralative offset in JUMP/CALL commands is + - (mod 4 GB) in 32-bit mode + - signed Int32 in 64-bit mode + We use (mod 4 GB) check for fileSize. + Use fileSize up to 2 GB, if you want to support 32-bit and 64-bit code conversion. */ + UInt32 fileIp; + UInt32 fileSize; /* (fileSize <= ((UInt32)1 << 31)), 0 means no_limit */ + UInt32 relatLimit; /* (relatLimit <= ((UInt32)1 << 31)), 0 means desable_conversion */ + + UInt32 tempTarget; + unsigned tempPos; + Byte temp[4 * 2]; + + unsigned flushPos; + + UInt16 probs[2 + 256]; +} CBcj2Enc; + +void Bcj2Enc_Init(CBcj2Enc *p); +void Bcj2Enc_Encode(CBcj2Enc *p); + +#define Bcj2Enc_Get_InputData_Size(p) ((SizeT)((p)->srcLim - (p)->src) + (p)->tempPos) +#define Bcj2Enc_IsFinished(p) ((p)->flushPos == 5) + + +#define BCJ2_RELAT_LIMIT_NUM_BITS 26 +#define BCJ2_RELAT_LIMIT ((UInt32)1 << BCJ2_RELAT_LIMIT_NUM_BITS) + +/* limit for CBcj2Enc::fileSize variable */ +#define BCJ2_FileSize_MAX ((UInt32)1 << 31) + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/Bra.h b/Include/Libraries/lzma/Bra.h new file mode 100644 index 000000000..855e37a6b --- /dev/null +++ b/Include/Libraries/lzma/Bra.h @@ -0,0 +1,64 @@ +/* Bra.h -- Branch converters for executables +2013-01-18 : Igor Pavlov : Public domain */ + +#ifndef __BRA_H +#define __BRA_H + +#include "7zTypes.h" + +EXTERN_C_BEGIN + +/* +These functions convert relative addresses to absolute addresses +in CALL instructions to increase the compression ratio. + + In: + data - data buffer + size - size of data + ip - current virtual Instruction Pinter (IP) value + state - state variable for x86 converter + encoding - 0 (for decoding), 1 (for encoding) + + Out: + state - state variable for x86 converter + + Returns: + The number of processed bytes. If you call these functions with multiple calls, + you must start next call with first byte after block of processed bytes. + + Type Endian Alignment LookAhead + + x86 little 1 4 + ARMT little 2 2 + ARM little 4 0 + PPC big 4 0 + SPARC big 4 0 + IA64 little 16 0 + + size must be >= Alignment + LookAhead, if it's not last block. + If (size < Alignment + LookAhead), converter returns 0. + + Example: + + UInt32 ip = 0; + for () + { + ; size must be >= Alignment + LookAhead, if it's not last block + SizeT processed = Convert(data, size, ip, 1); + data += processed; + size -= processed; + ip += processed; + } +*/ + +#define x86_Convert_Init(state) { state = 0; } +SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding); +SizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding); +SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding); +SizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding); +SizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding); +SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding); + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/Compiler.h b/Include/Libraries/lzma/Compiler.h new file mode 100644 index 000000000..0cc409d8a --- /dev/null +++ b/Include/Libraries/lzma/Compiler.h @@ -0,0 +1,33 @@ +/* Compiler.h +2017-04-03 : Igor Pavlov : Public domain */ + +#ifndef __7Z_COMPILER_H +#define __7Z_COMPILER_H + +#ifdef _MSC_VER + + #ifdef UNDER_CE + #define RPC_NO_WINDOWS_H + /* #pragma warning(disable : 4115) // '_RPC_ASYNC_STATE' : named type definition in parentheses */ + #pragma warning(disable : 4201) // nonstandard extension used : nameless struct/union + #pragma warning(disable : 4214) // nonstandard extension used : bit field types other than int + #endif + + #if _MSC_VER >= 1300 + #pragma warning(disable : 4996) // This function or variable may be unsafe + #else + #pragma warning(disable : 4511) // copy constructor could not be generated + #pragma warning(disable : 4512) // assignment operator could not be generated + #pragma warning(disable : 4514) // unreferenced inline function has been removed + #pragma warning(disable : 4702) // unreachable code + #pragma warning(disable : 4710) // not inlined + #pragma warning(disable : 4714) // function marked as __forceinline not inlined + #pragma warning(disable : 4786) // identifier was truncated to '255' characters in the debug information + #endif + +#endif + +#define UNUSED_VAR(x) (void)x; +/* #define UNUSED_VAR(x) x=x; */ + +#endif diff --git a/Include/Libraries/lzma/CpuArch.h b/Include/Libraries/lzma/CpuArch.h new file mode 100644 index 000000000..bd4293880 --- /dev/null +++ b/Include/Libraries/lzma/CpuArch.h @@ -0,0 +1,336 @@ +/* CpuArch.h -- CPU specific code +2018-02-18 : Igor Pavlov : Public domain */ + +#ifndef __CPU_ARCH_H +#define __CPU_ARCH_H + +#include "7zTypes.h" + +EXTERN_C_BEGIN + +/* +MY_CPU_LE means that CPU is LITTLE ENDIAN. +MY_CPU_BE means that CPU is BIG ENDIAN. +If MY_CPU_LE and MY_CPU_BE are not defined, we don't know about ENDIANNESS of platform. + +MY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned memory accesses. +*/ + +#if defined(_M_X64) \ + || defined(_M_AMD64) \ + || defined(__x86_64__) \ + || defined(__AMD64__) \ + || defined(__amd64__) + #define MY_CPU_AMD64 + #ifdef __ILP32__ + #define MY_CPU_NAME "x32" + #else + #define MY_CPU_NAME "x64" + #endif + #define MY_CPU_64BIT +#endif + + +#if defined(_M_IX86) \ + || defined(__i386__) + #define MY_CPU_X86 + #define MY_CPU_NAME "x86" + #define MY_CPU_32BIT +#endif + + +#if defined(_M_ARM64) \ + || defined(__AARCH64EL__) \ + || defined(__AARCH64EB__) \ + || defined(__aarch64__) + #define MY_CPU_ARM64 + #define MY_CPU_NAME "arm64" + #define MY_CPU_64BIT +#endif + + +#if defined(_M_ARM) \ + || defined(_M_ARM_NT) \ + || defined(_M_ARMT) \ + || defined(__arm__) \ + || defined(__thumb__) \ + || defined(__ARMEL__) \ + || defined(__ARMEB__) \ + || defined(__THUMBEL__) \ + || defined(__THUMBEB__) + #define MY_CPU_ARM + #define MY_CPU_NAME "arm" + #define MY_CPU_32BIT +#endif + + +#if defined(_M_IA64) \ + || defined(__ia64__) + #define MY_CPU_IA64 + #define MY_CPU_NAME "ia64" + #define MY_CPU_64BIT +#endif + + +#if defined(__mips64) \ + || defined(__mips64__) \ + || (defined(__mips) && (__mips == 64 || __mips == 4 || __mips == 3)) + #define MY_CPU_NAME "mips64" + #define MY_CPU_64BIT +#elif defined(__mips__) + #define MY_CPU_NAME "mips" + /* #define MY_CPU_32BIT */ +#endif + + +#if defined(__ppc64__) \ + || defined(__powerpc64__) + #ifdef __ILP32__ + #define MY_CPU_NAME "ppc64-32" + #else + #define MY_CPU_NAME "ppc64" + #endif + #define MY_CPU_64BIT +#elif defined(__ppc__) \ + || defined(__powerpc__) + #define MY_CPU_NAME "ppc" + #define MY_CPU_32BIT +#endif + + +#if defined(__sparc64__) + #define MY_CPU_NAME "sparc64" + #define MY_CPU_64BIT +#elif defined(__sparc__) + #define MY_CPU_NAME "sparc" + /* #define MY_CPU_32BIT */ +#endif + + +#if defined(MY_CPU_X86) || defined(MY_CPU_AMD64) +#define MY_CPU_X86_OR_AMD64 +#endif + + +#ifdef _WIN32 + + #ifdef MY_CPU_ARM + #define MY_CPU_ARM_LE + #endif + + #ifdef MY_CPU_ARM64 + #define MY_CPU_ARM64_LE + #endif + + #ifdef _M_IA64 + #define MY_CPU_IA64_LE + #endif + +#endif + + +#if defined(MY_CPU_X86_OR_AMD64) \ + || defined(MY_CPU_ARM_LE) \ + || defined(MY_CPU_ARM64_LE) \ + || defined(MY_CPU_IA64_LE) \ + || defined(__LITTLE_ENDIAN__) \ + || defined(__ARMEL__) \ + || defined(__THUMBEL__) \ + || defined(__AARCH64EL__) \ + || defined(__MIPSEL__) \ + || defined(__MIPSEL) \ + || defined(_MIPSEL) \ + || defined(__BFIN__) \ + || (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) + #define MY_CPU_LE +#endif + +#if defined(__BIG_ENDIAN__) \ + || defined(__ARMEB__) \ + || defined(__THUMBEB__) \ + || defined(__AARCH64EB__) \ + || defined(__MIPSEB__) \ + || defined(__MIPSEB) \ + || defined(_MIPSEB) \ + || defined(__m68k__) \ + || defined(__s390__) \ + || defined(__s390x__) \ + || defined(__zarch__) \ + || (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) + #define MY_CPU_BE +#endif + + +#if defined(MY_CPU_LE) && defined(MY_CPU_BE) + #error Stop_Compiling_Bad_Endian +#endif + + +#if defined(MY_CPU_32BIT) && defined(MY_CPU_64BIT) + #error Stop_Compiling_Bad_32_64_BIT +#endif + + +#ifndef MY_CPU_NAME + #ifdef MY_CPU_LE + #define MY_CPU_NAME "LE" + #elif defined(MY_CPU_BE) + #define MY_CPU_NAME "BE" + #else + /* + #define MY_CPU_NAME "" + */ + #endif +#endif + + + + + +#ifdef MY_CPU_LE + #if defined(MY_CPU_X86_OR_AMD64) \ + || defined(MY_CPU_ARM64) \ + || defined(__ARM_FEATURE_UNALIGNED) + #define MY_CPU_LE_UNALIGN + #endif +#endif + + +#ifdef MY_CPU_LE_UNALIGN + +#define GetUi16(p) (*(const UInt16 *)(const void *)(p)) +#define GetUi32(p) (*(const UInt32 *)(const void *)(p)) +#define GetUi64(p) (*(const UInt64 *)(const void *)(p)) + +#define SetUi16(p, v) { *(UInt16 *)(p) = (v); } +#define SetUi32(p, v) { *(UInt32 *)(p) = (v); } +#define SetUi64(p, v) { *(UInt64 *)(p) = (v); } + +#else + +#define GetUi16(p) ( (UInt16) ( \ + ((const Byte *)(p))[0] | \ + ((UInt16)((const Byte *)(p))[1] << 8) )) + +#define GetUi32(p) ( \ + ((const Byte *)(p))[0] | \ + ((UInt32)((const Byte *)(p))[1] << 8) | \ + ((UInt32)((const Byte *)(p))[2] << 16) | \ + ((UInt32)((const Byte *)(p))[3] << 24)) + +#define GetUi64(p) (GetUi32(p) | ((UInt64)GetUi32(((const Byte *)(p)) + 4) << 32)) + +#define SetUi16(p, v) { Byte *_ppp_ = (Byte *)(p); UInt32 _vvv_ = (v); \ + _ppp_[0] = (Byte)_vvv_; \ + _ppp_[1] = (Byte)(_vvv_ >> 8); } + +#define SetUi32(p, v) { Byte *_ppp_ = (Byte *)(p); UInt32 _vvv_ = (v); \ + _ppp_[0] = (Byte)_vvv_; \ + _ppp_[1] = (Byte)(_vvv_ >> 8); \ + _ppp_[2] = (Byte)(_vvv_ >> 16); \ + _ppp_[3] = (Byte)(_vvv_ >> 24); } + +#define SetUi64(p, v) { Byte *_ppp2_ = (Byte *)(p); UInt64 _vvv2_ = (v); \ + SetUi32(_ppp2_ , (UInt32)_vvv2_); \ + SetUi32(_ppp2_ + 4, (UInt32)(_vvv2_ >> 32)); } + +#endif + +#ifdef __has_builtin + #define MY__has_builtin(x) __has_builtin(x) +#else + #define MY__has_builtin(x) 0 +#endif + +#if defined(MY_CPU_LE_UNALIGN) && /* defined(_WIN64) && */ (_MSC_VER >= 1300) + +/* Note: we use bswap instruction, that is unsupported in 386 cpu */ + +#include + +#pragma intrinsic(_byteswap_ushort) +#pragma intrinsic(_byteswap_ulong) +#pragma intrinsic(_byteswap_uint64) + +/* #define GetBe16(p) _byteswap_ushort(*(const UInt16 *)(const Byte *)(p)) */ +#define GetBe32(p) _byteswap_ulong(*(const UInt32 *)(const Byte *)(p)) +#define GetBe64(p) _byteswap_uint64(*(const UInt64 *)(const Byte *)(p)) + +#define SetBe32(p, v) (*(UInt32 *)(void *)(p)) = _byteswap_ulong(v) + +#elif defined(MY_CPU_LE_UNALIGN) && ( \ + (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) \ + || (defined(__clang__) && MY__has_builtin(__builtin_bswap16)) ) + +/* #define GetBe16(p) __builtin_bswap16(*(const UInt16 *)(const Byte *)(p)) */ +#define GetBe32(p) __builtin_bswap32(*(const UInt32 *)(const Byte *)(p)) +#define GetBe64(p) __builtin_bswap64(*(const UInt64 *)(const Byte *)(p)) + +#define SetBe32(p, v) (*(UInt32 *)(void *)(p)) = __builtin_bswap32(v) + +#else + +#define GetBe32(p) ( \ + ((UInt32)((const Byte *)(p))[0] << 24) | \ + ((UInt32)((const Byte *)(p))[1] << 16) | \ + ((UInt32)((const Byte *)(p))[2] << 8) | \ + ((const Byte *)(p))[3] ) + +#define GetBe64(p) (((UInt64)GetBe32(p) << 32) | GetBe32(((const Byte *)(p)) + 4)) + +#define SetBe32(p, v) { Byte *_ppp_ = (Byte *)(p); UInt32 _vvv_ = (v); \ + _ppp_[0] = (Byte)(_vvv_ >> 24); \ + _ppp_[1] = (Byte)(_vvv_ >> 16); \ + _ppp_[2] = (Byte)(_vvv_ >> 8); \ + _ppp_[3] = (Byte)_vvv_; } + +#endif + + +#ifndef GetBe16 + +#define GetBe16(p) ( (UInt16) ( \ + ((UInt16)((const Byte *)(p))[0] << 8) | \ + ((const Byte *)(p))[1] )) + +#endif + + + +#ifdef MY_CPU_X86_OR_AMD64 + +typedef struct +{ + UInt32 maxFunc; + UInt32 vendor[3]; + UInt32 ver; + UInt32 b; + UInt32 c; + UInt32 d; +} Cx86cpuid; + +enum +{ + CPU_FIRM_INTEL, + CPU_FIRM_AMD, + CPU_FIRM_VIA +}; + +void MyCPUID(UInt32 function, UInt32 *a, UInt32 *b, UInt32 *c, UInt32 *d); + +BoolInt x86cpuid_CheckAndRead(Cx86cpuid *p); +int x86cpuid_GetFirm(const Cx86cpuid *p); + +#define x86cpuid_GetFamily(ver) (((ver >> 16) & 0xFF0) | ((ver >> 8) & 0xF)) +#define x86cpuid_GetModel(ver) (((ver >> 12) & 0xF0) | ((ver >> 4) & 0xF)) +#define x86cpuid_GetStepping(ver) (ver & 0xF) + +BoolInt CPU_Is_InOrder(); +BoolInt CPU_Is_Aes_Supported(); +BoolInt CPU_IsSupported_PageGB(); + +#endif + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/Delta.h b/Include/Libraries/lzma/Delta.h new file mode 100644 index 000000000..2fa54ad67 --- /dev/null +++ b/Include/Libraries/lzma/Delta.h @@ -0,0 +1,19 @@ +/* Delta.h -- Delta converter +2013-01-18 : Igor Pavlov : Public domain */ + +#ifndef __DELTA_H +#define __DELTA_H + +#include "7zTypes.h" + +EXTERN_C_BEGIN + +#define DELTA_STATE_SIZE 256 + +void Delta_Init(Byte *state); +void Delta_Encode(Byte *state, unsigned delta, Byte *data, SizeT size); +void Delta_Decode(Byte *state, unsigned delta, Byte *data, SizeT size); + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/DllSecur.h b/Include/Libraries/lzma/DllSecur.h new file mode 100644 index 000000000..e2a049ad2 --- /dev/null +++ b/Include/Libraries/lzma/DllSecur.h @@ -0,0 +1,20 @@ +/* DllSecur.h -- DLL loading for security +2018-02-19 : Igor Pavlov : Public domain */ + +#ifndef __DLL_SECUR_H +#define __DLL_SECUR_H + +#include "7zTypes.h" + +EXTERN_C_BEGIN + +#ifdef _WIN32 + +void My_SetDefaultDllDirectories(); +void LoadSecurityDlls(); + +#endif + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/LzFind.h b/Include/Libraries/lzma/LzFind.h new file mode 100644 index 000000000..42c13be15 --- /dev/null +++ b/Include/Libraries/lzma/LzFind.h @@ -0,0 +1,121 @@ +/* LzFind.h -- Match finder for LZ algorithms +2017-06-10 : Igor Pavlov : Public domain */ + +#ifndef __LZ_FIND_H +#define __LZ_FIND_H + +#include "7zTypes.h" + +EXTERN_C_BEGIN + +typedef UInt32 CLzRef; + +typedef struct _CMatchFinder +{ + Byte *buffer; + UInt32 pos; + UInt32 posLimit; + UInt32 streamPos; + UInt32 lenLimit; + + UInt32 cyclicBufferPos; + UInt32 cyclicBufferSize; /* it must be = (historySize + 1) */ + + Byte streamEndWasReached; + Byte btMode; + Byte bigHash; + Byte directInput; + + UInt32 matchMaxLen; + CLzRef *hash; + CLzRef *son; + UInt32 hashMask; + UInt32 cutValue; + + Byte *bufferBase; + ISeqInStream *stream; + + UInt32 blockSize; + UInt32 keepSizeBefore; + UInt32 keepSizeAfter; + + UInt32 numHashBytes; + size_t directInputRem; + UInt32 historySize; + UInt32 fixedHashSize; + UInt32 hashSizeSum; + SRes result; + UInt32 crc[256]; + size_t numRefs; + + UInt64 expectedDataSize; +} CMatchFinder; + +#define Inline_MatchFinder_GetPointerToCurrentPos(p) ((p)->buffer) + +#define Inline_MatchFinder_GetNumAvailableBytes(p) ((p)->streamPos - (p)->pos) + +#define Inline_MatchFinder_IsFinishedOK(p) \ + ((p)->streamEndWasReached \ + && (p)->streamPos == (p)->pos \ + && (!(p)->directInput || (p)->directInputRem == 0)) + +int MatchFinder_NeedMove(CMatchFinder *p); +Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p); +void MatchFinder_MoveBlock(CMatchFinder *p); +void MatchFinder_ReadIfRequired(CMatchFinder *p); + +void MatchFinder_Construct(CMatchFinder *p); + +/* Conditions: + historySize <= 3 GB + keepAddBufferBefore + matchMaxLen + keepAddBufferAfter < 511MB +*/ +int MatchFinder_Create(CMatchFinder *p, UInt32 historySize, + UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter, + ISzAllocPtr alloc); +void MatchFinder_Free(CMatchFinder *p, ISzAllocPtr alloc); +void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, size_t numItems); +void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue); + +UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *buffer, CLzRef *son, + UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue, + UInt32 *distances, UInt32 maxLen); + +/* +Conditions: + Mf_GetNumAvailableBytes_Func must be called before each Mf_GetMatchLen_Func. + Mf_GetPointerToCurrentPos_Func's result must be used only before any other function +*/ + +typedef void (*Mf_Init_Func)(void *object); +typedef UInt32 (*Mf_GetNumAvailableBytes_Func)(void *object); +typedef const Byte * (*Mf_GetPointerToCurrentPos_Func)(void *object); +typedef UInt32 (*Mf_GetMatches_Func)(void *object, UInt32 *distances); +typedef void (*Mf_Skip_Func)(void *object, UInt32); + +typedef struct _IMatchFinder +{ + Mf_Init_Func Init; + Mf_GetNumAvailableBytes_Func GetNumAvailableBytes; + Mf_GetPointerToCurrentPos_Func GetPointerToCurrentPos; + Mf_GetMatches_Func GetMatches; + Mf_Skip_Func Skip; +} IMatchFinder; + +void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable); + +void MatchFinder_Init_LowHash(CMatchFinder *p); +void MatchFinder_Init_HighHash(CMatchFinder *p); +void MatchFinder_Init_3(CMatchFinder *p, int readData); +void MatchFinder_Init(CMatchFinder *p); + +UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances); +UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances); + +void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num); +void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num); + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/LzFindMt.h b/Include/Libraries/lzma/LzFindMt.h new file mode 100644 index 000000000..ef431e3f5 --- /dev/null +++ b/Include/Libraries/lzma/LzFindMt.h @@ -0,0 +1,101 @@ +/* LzFindMt.h -- multithreaded Match finder for LZ algorithms +2018-07-04 : Igor Pavlov : Public domain */ + +#ifndef __LZ_FIND_MT_H +#define __LZ_FIND_MT_H + +#include "LzFind.h" +#include "Threads.h" + +EXTERN_C_BEGIN + +#define kMtHashBlockSize (1 << 13) +#define kMtHashNumBlocks (1 << 3) +#define kMtHashNumBlocksMask (kMtHashNumBlocks - 1) + +#define kMtBtBlockSize (1 << 14) +#define kMtBtNumBlocks (1 << 6) +#define kMtBtNumBlocksMask (kMtBtNumBlocks - 1) + +typedef struct _CMtSync +{ + BoolInt wasCreated; + BoolInt needStart; + BoolInt exit; + BoolInt stopWriting; + + CThread thread; + CAutoResetEvent canStart; + CAutoResetEvent wasStarted; + CAutoResetEvent wasStopped; + CSemaphore freeSemaphore; + CSemaphore filledSemaphore; + BoolInt csWasInitialized; + BoolInt csWasEntered; + CCriticalSection cs; + UInt32 numProcessedBlocks; +} CMtSync; + +typedef UInt32 * (*Mf_Mix_Matches)(void *p, UInt32 matchMinPos, UInt32 *distances); + +/* kMtCacheLineDummy must be >= size_of_CPU_cache_line */ +#define kMtCacheLineDummy 128 + +typedef void (*Mf_GetHeads)(const Byte *buffer, UInt32 pos, + UInt32 *hash, UInt32 hashMask, UInt32 *heads, UInt32 numHeads, const UInt32 *crc); + +typedef struct _CMatchFinderMt +{ + /* LZ */ + const Byte *pointerToCurPos; + UInt32 *btBuf; + UInt32 btBufPos; + UInt32 btBufPosLimit; + UInt32 lzPos; + UInt32 btNumAvailBytes; + + UInt32 *hash; + UInt32 fixedHashSize; + UInt32 historySize; + const UInt32 *crc; + + Mf_Mix_Matches MixMatchesFunc; + + /* LZ + BT */ + CMtSync btSync; + Byte btDummy[kMtCacheLineDummy]; + + /* BT */ + UInt32 *hashBuf; + UInt32 hashBufPos; + UInt32 hashBufPosLimit; + UInt32 hashNumAvail; + + CLzRef *son; + UInt32 matchMaxLen; + UInt32 numHashBytes; + UInt32 pos; + const Byte *buffer; + UInt32 cyclicBufferPos; + UInt32 cyclicBufferSize; /* it must be historySize + 1 */ + UInt32 cutValue; + + /* BT + Hash */ + CMtSync hashSync; + /* Byte hashDummy[kMtCacheLineDummy]; */ + + /* Hash */ + Mf_GetHeads GetHeadsFunc; + CMatchFinder *MatchFinder; +} CMatchFinderMt; + +void MatchFinderMt_Construct(CMatchFinderMt *p); +void MatchFinderMt_Destruct(CMatchFinderMt *p, ISzAllocPtr alloc); +SRes MatchFinderMt_Create(CMatchFinderMt *p, UInt32 historySize, UInt32 keepAddBufferBefore, + UInt32 matchMaxLen, UInt32 keepAddBufferAfter, ISzAllocPtr alloc); +void MatchFinderMt_CreateVTable(CMatchFinderMt *p, IMatchFinder *vTable); +void MatchFinderMt_ReleaseStream(CMatchFinderMt *p); + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/LzHash.h b/Include/Libraries/lzma/LzHash.h new file mode 100644 index 000000000..e7c942303 --- /dev/null +++ b/Include/Libraries/lzma/LzHash.h @@ -0,0 +1,57 @@ +/* LzHash.h -- HASH functions for LZ algorithms +2015-04-12 : Igor Pavlov : Public domain */ + +#ifndef __LZ_HASH_H +#define __LZ_HASH_H + +#define kHash2Size (1 << 10) +#define kHash3Size (1 << 16) +#define kHash4Size (1 << 20) + +#define kFix3HashSize (kHash2Size) +#define kFix4HashSize (kHash2Size + kHash3Size) +#define kFix5HashSize (kHash2Size + kHash3Size + kHash4Size) + +#define HASH2_CALC hv = cur[0] | ((UInt32)cur[1] << 8); + +#define HASH3_CALC { \ + UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ + h2 = temp & (kHash2Size - 1); \ + hv = (temp ^ ((UInt32)cur[2] << 8)) & p->hashMask; } + +#define HASH4_CALC { \ + UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ + h2 = temp & (kHash2Size - 1); \ + temp ^= ((UInt32)cur[2] << 8); \ + h3 = temp & (kHash3Size - 1); \ + hv = (temp ^ (p->crc[cur[3]] << 5)) & p->hashMask; } + +#define HASH5_CALC { \ + UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ + h2 = temp & (kHash2Size - 1); \ + temp ^= ((UInt32)cur[2] << 8); \ + h3 = temp & (kHash3Size - 1); \ + temp ^= (p->crc[cur[3]] << 5); \ + h4 = temp & (kHash4Size - 1); \ + hv = (temp ^ (p->crc[cur[4]] << 3)) & p->hashMask; } + +/* #define HASH_ZIP_CALC hv = ((cur[0] | ((UInt32)cur[1] << 8)) ^ p->crc[cur[2]]) & 0xFFFF; */ +#define HASH_ZIP_CALC hv = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF; + + +#define MT_HASH2_CALC \ + h2 = (p->crc[cur[0]] ^ cur[1]) & (kHash2Size - 1); + +#define MT_HASH3_CALC { \ + UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ + h2 = temp & (kHash2Size - 1); \ + h3 = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); } + +#define MT_HASH4_CALC { \ + UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ + h2 = temp & (kHash2Size - 1); \ + temp ^= ((UInt32)cur[2] << 8); \ + h3 = temp & (kHash3Size - 1); \ + h4 = (temp ^ (p->crc[cur[3]] << 5)) & (kHash4Size - 1); } + +#endif diff --git a/Include/Libraries/lzma/Lzma2Dec.h b/Include/Libraries/lzma/Lzma2Dec.h new file mode 100644 index 000000000..b8ddeac89 --- /dev/null +++ b/Include/Libraries/lzma/Lzma2Dec.h @@ -0,0 +1,120 @@ +/* Lzma2Dec.h -- LZMA2 Decoder +2018-02-19 : Igor Pavlov : Public domain */ + +#ifndef __LZMA2_DEC_H +#define __LZMA2_DEC_H + +#include "LzmaDec.h" + +EXTERN_C_BEGIN + +/* ---------- State Interface ---------- */ + +typedef struct +{ + unsigned state; + Byte control; + Byte needInitLevel; + Byte isExtraMode; + Byte _pad_; + UInt32 packSize; + UInt32 unpackSize; + CLzmaDec decoder; +} CLzma2Dec; + +#define Lzma2Dec_Construct(p) LzmaDec_Construct(&(p)->decoder) +#define Lzma2Dec_FreeProbs(p, alloc) LzmaDec_FreeProbs(&(p)->decoder, alloc) +#define Lzma2Dec_Free(p, alloc) LzmaDec_Free(&(p)->decoder, alloc) + +SRes Lzma2Dec_AllocateProbs(CLzma2Dec *p, Byte prop, ISzAllocPtr alloc); +SRes Lzma2Dec_Allocate(CLzma2Dec *p, Byte prop, ISzAllocPtr alloc); +void Lzma2Dec_Init(CLzma2Dec *p); + +/* +finishMode: + It has meaning only if the decoding reaches output limit (*destLen or dicLimit). + LZMA_FINISH_ANY - use smallest number of input bytes + LZMA_FINISH_END - read EndOfStream marker after decoding + +Returns: + SZ_OK + status: + LZMA_STATUS_FINISHED_WITH_MARK + LZMA_STATUS_NOT_FINISHED + LZMA_STATUS_NEEDS_MORE_INPUT + SZ_ERROR_DATA - Data error +*/ + +SRes Lzma2Dec_DecodeToDic(CLzma2Dec *p, SizeT dicLimit, + const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); + +SRes Lzma2Dec_DecodeToBuf(CLzma2Dec *p, Byte *dest, SizeT *destLen, + const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); + + +/* ---------- LZMA2 block and chunk parsing ---------- */ + +/* +Lzma2Dec_Parse() parses compressed data stream up to next independent block or next chunk data. +It can return LZMA_STATUS_* code or LZMA2_PARSE_STATUS_* code: + - LZMA2_PARSE_STATUS_NEW_BLOCK - there is new block, and 1 additional byte (control byte of next block header) was read from input. + - LZMA2_PARSE_STATUS_NEW_CHUNK - there is new chunk, and only lzma2 header of new chunk was read. + CLzma2Dec::unpackSize contains unpack size of that chunk +*/ + +typedef enum +{ +/* + LZMA_STATUS_NOT_SPECIFIED // data error + LZMA_STATUS_FINISHED_WITH_MARK + LZMA_STATUS_NOT_FINISHED // + LZMA_STATUS_NEEDS_MORE_INPUT + LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK // unused +*/ + LZMA2_PARSE_STATUS_NEW_BLOCK = LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK + 1, + LZMA2_PARSE_STATUS_NEW_CHUNK +} ELzma2ParseStatus; + +ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p, + SizeT outSize, // output size + const Byte *src, SizeT *srcLen, + int checkFinishBlock // set (checkFinishBlock = 1), if it must read full input data, if decoder.dicPos reaches blockMax position. + ); + +/* +LZMA2 parser doesn't decode LZMA chunks, so we must read + full input LZMA chunk to decode some part of LZMA chunk. + +Lzma2Dec_GetUnpackExtra() returns the value that shows + max possible number of output bytes that can be output by decoder + at current input positon. +*/ + +#define Lzma2Dec_GetUnpackExtra(p) ((p)->isExtraMode ? (p)->unpackSize : 0); + + +/* ---------- One Call Interface ---------- */ + +/* +finishMode: + It has meaning only if the decoding reaches output limit (*destLen). + LZMA_FINISH_ANY - use smallest number of input bytes + LZMA_FINISH_END - read EndOfStream marker after decoding + +Returns: + SZ_OK + status: + LZMA_STATUS_FINISHED_WITH_MARK + LZMA_STATUS_NOT_FINISHED + SZ_ERROR_DATA - Data error + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_UNSUPPORTED - Unsupported properties + SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src). +*/ + +SRes Lzma2Decode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, + Byte prop, ELzmaFinishMode finishMode, ELzmaStatus *status, ISzAllocPtr alloc); + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/Lzma2DecMt.h b/Include/Libraries/lzma/Lzma2DecMt.h new file mode 100644 index 000000000..7791c310b --- /dev/null +++ b/Include/Libraries/lzma/Lzma2DecMt.h @@ -0,0 +1,79 @@ +/* Lzma2DecMt.h -- LZMA2 Decoder Multi-thread +2018-02-17 : Igor Pavlov : Public domain */ + +#ifndef __LZMA2_DEC_MT_H +#define __LZMA2_DEC_MT_H + +#include "7zTypes.h" + +EXTERN_C_BEGIN + +typedef struct +{ + size_t inBufSize_ST; + size_t outStep_ST; + + #ifndef _7ZIP_ST + unsigned numThreads; + size_t inBufSize_MT; + size_t outBlockMax; + size_t inBlockMax; + #endif +} CLzma2DecMtProps; + +/* init to single-thread mode */ +void Lzma2DecMtProps_Init(CLzma2DecMtProps *p); + + +/* ---------- CLzma2DecMtHandle Interface ---------- */ + +/* Lzma2DecMt_ * functions can return the following exit codes: +SRes: + SZ_OK - OK + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_PARAM - Incorrect paramater in props + SZ_ERROR_WRITE - ISeqOutStream write callback error + // SZ_ERROR_OUTPUT_EOF - output buffer overflow - version with (Byte *) output + SZ_ERROR_PROGRESS - some break from progress callback + SZ_ERROR_THREAD - error in multithreading functions (only for Mt version) +*/ + +typedef void * CLzma2DecMtHandle; + +CLzma2DecMtHandle Lzma2DecMt_Create(ISzAllocPtr alloc, ISzAllocPtr allocMid); +void Lzma2DecMt_Destroy(CLzma2DecMtHandle p); + +SRes Lzma2DecMt_Decode(CLzma2DecMtHandle p, + Byte prop, + const CLzma2DecMtProps *props, + ISeqOutStream *outStream, + const UInt64 *outDataSize, // NULL means undefined + int finishMode, // 0 - partial unpacking is allowed, 1 - if lzma2 stream must be finished + // Byte *outBuf, size_t *outBufSize, + ISeqInStream *inStream, + // const Byte *inData, size_t inDataSize, + + // out variables: + UInt64 *inProcessed, + int *isMT, /* out: (*isMT == 0), if single thread decoding was used */ + + // UInt64 *outProcessed, + ICompressProgress *progress); + + +/* ---------- Read from CLzma2DecMtHandle Interface ---------- */ + +SRes Lzma2DecMt_Init(CLzma2DecMtHandle pp, + Byte prop, + const CLzma2DecMtProps *props, + const UInt64 *outDataSize, int finishMode, + ISeqInStream *inStream); + +SRes Lzma2DecMt_Read(CLzma2DecMtHandle pp, + Byte *data, size_t *outSize, + UInt64 *inStreamProcessed); + + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/Lzma2Enc.h b/Include/Libraries/lzma/Lzma2Enc.h new file mode 100644 index 000000000..6a6110ff7 --- /dev/null +++ b/Include/Libraries/lzma/Lzma2Enc.h @@ -0,0 +1,55 @@ +/* Lzma2Enc.h -- LZMA2 Encoder +2017-07-27 : Igor Pavlov : Public domain */ + +#ifndef __LZMA2_ENC_H +#define __LZMA2_ENC_H + +#include "LzmaEnc.h" + +EXTERN_C_BEGIN + +#define LZMA2_ENC_PROPS__BLOCK_SIZE__AUTO 0 +#define LZMA2_ENC_PROPS__BLOCK_SIZE__SOLID ((UInt64)(Int64)-1) + +typedef struct +{ + CLzmaEncProps lzmaProps; + UInt64 blockSize; + int numBlockThreads_Reduced; + int numBlockThreads_Max; + int numTotalThreads; +} CLzma2EncProps; + +void Lzma2EncProps_Init(CLzma2EncProps *p); +void Lzma2EncProps_Normalize(CLzma2EncProps *p); + +/* ---------- CLzmaEnc2Handle Interface ---------- */ + +/* Lzma2Enc_* functions can return the following exit codes: +SRes: + SZ_OK - OK + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_PARAM - Incorrect paramater in props + SZ_ERROR_WRITE - ISeqOutStream write callback error + SZ_ERROR_OUTPUT_EOF - output buffer overflow - version with (Byte *) output + SZ_ERROR_PROGRESS - some break from progress callback + SZ_ERROR_THREAD - error in multithreading functions (only for Mt version) +*/ + +typedef void * CLzma2EncHandle; + +CLzma2EncHandle Lzma2Enc_Create(ISzAllocPtr alloc, ISzAllocPtr allocBig); +void Lzma2Enc_Destroy(CLzma2EncHandle p); +SRes Lzma2Enc_SetProps(CLzma2EncHandle p, const CLzma2EncProps *props); +void Lzma2Enc_SetDataSize(CLzma2EncHandle p, UInt64 expectedDataSiize); +Byte Lzma2Enc_WriteProperties(CLzma2EncHandle p); +SRes Lzma2Enc_Encode2(CLzma2EncHandle p, + ISeqOutStream *outStream, + Byte *outBuf, size_t *outBufSize, + ISeqInStream *inStream, + const Byte *inData, size_t inDataSize, + ICompressProgress *progress); + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/Lzma86.h b/Include/Libraries/lzma/Lzma86.h new file mode 100644 index 000000000..bebed5cb7 --- /dev/null +++ b/Include/Libraries/lzma/Lzma86.h @@ -0,0 +1,111 @@ +/* Lzma86.h -- LZMA + x86 (BCJ) Filter +2013-01-18 : Igor Pavlov : Public domain */ + +#ifndef __LZMA86_H +#define __LZMA86_H + +#include "7zTypes.h" + +EXTERN_C_BEGIN + +#define LZMA86_SIZE_OFFSET (1 + 5) +#define LZMA86_HEADER_SIZE (LZMA86_SIZE_OFFSET + 8) + +/* +It's an example for LZMA + x86 Filter use. +You can use .lzma86 extension, if you write that stream to file. +.lzma86 header adds one additional byte to standard .lzma header. +.lzma86 header (14 bytes): + Offset Size Description + 0 1 = 0 - no filter, pure LZMA + = 1 - x86 filter + LZMA + 1 1 lc, lp and pb in encoded form + 2 4 dictSize (little endian) + 6 8 uncompressed size (little endian) + + +Lzma86_Encode +------------- +level - compression level: 0 <= level <= 9, the default value for "level" is 5. + +dictSize - The dictionary size in bytes. The maximum value is + 128 MB = (1 << 27) bytes for 32-bit version + 1 GB = (1 << 30) bytes for 64-bit version + The default value is 16 MB = (1 << 24) bytes, for level = 5. + It's recommended to use the dictionary that is larger than 4 KB and + that can be calculated as (1 << N) or (3 << N) sizes. + For better compression ratio dictSize must be >= inSize. + +filterMode: + SZ_FILTER_NO - no Filter + SZ_FILTER_YES - x86 Filter + SZ_FILTER_AUTO - it tries both alternatives to select best. + Encoder will use 2 or 3 passes: + 2 passes when FILTER_NO provides better compression. + 3 passes when FILTER_YES provides better compression. + +Lzma86Encode allocates Data with MyAlloc functions. +RAM Requirements for compressing: + RamSize = dictionarySize * 11.5 + 6MB + FilterBlockSize + filterMode FilterBlockSize + SZ_FILTER_NO 0 + SZ_FILTER_YES inSize + SZ_FILTER_AUTO inSize + + +Return code: + SZ_OK - OK + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_PARAM - Incorrect paramater + SZ_ERROR_OUTPUT_EOF - output buffer overflow + SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) +*/ + +enum ESzFilterMode +{ + SZ_FILTER_NO, + SZ_FILTER_YES, + SZ_FILTER_AUTO +}; + +SRes Lzma86_Encode(Byte *dest, size_t *destLen, const Byte *src, size_t srcLen, + int level, UInt32 dictSize, int filterMode); + + +/* +Lzma86_GetUnpackSize: + In: + src - input data + srcLen - input data size + Out: + unpackSize - size of uncompressed stream + Return code: + SZ_OK - OK + SZ_ERROR_INPUT_EOF - Error in headers +*/ + +SRes Lzma86_GetUnpackSize(const Byte *src, SizeT srcLen, UInt64 *unpackSize); + +/* +Lzma86_Decode: + In: + dest - output data + destLen - output data size + src - input data + srcLen - input data size + Out: + destLen - processed output size + srcLen - processed input size + Return code: + SZ_OK - OK + SZ_ERROR_DATA - Data error + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_UNSUPPORTED - unsupported file + SZ_ERROR_INPUT_EOF - it needs more bytes in input buffer +*/ + +SRes Lzma86_Decode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen); + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/LzmaDec.h b/Include/Libraries/lzma/LzmaDec.h new file mode 100644 index 000000000..1f0927ab1 --- /dev/null +++ b/Include/Libraries/lzma/LzmaDec.h @@ -0,0 +1,234 @@ +/* LzmaDec.h -- LZMA Decoder +2018-04-21 : Igor Pavlov : Public domain */ + +#ifndef __LZMA_DEC_H +#define __LZMA_DEC_H + +#include "7zTypes.h" + +EXTERN_C_BEGIN + +/* #define _LZMA_PROB32 */ +/* _LZMA_PROB32 can increase the speed on some CPUs, + but memory usage for CLzmaDec::probs will be doubled in that case */ + +typedef +#ifdef _LZMA_PROB32 + UInt32 +#else + UInt16 +#endif + CLzmaProb; + + +/* ---------- LZMA Properties ---------- */ + +#define LZMA_PROPS_SIZE 5 + +typedef struct _CLzmaProps +{ + Byte lc; + Byte lp; + Byte pb; + Byte _pad_; + UInt32 dicSize; +} CLzmaProps; + +/* LzmaProps_Decode - decodes properties +Returns: + SZ_OK + SZ_ERROR_UNSUPPORTED - Unsupported properties +*/ + +SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size); + + +/* ---------- LZMA Decoder state ---------- */ + +/* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case. + Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */ + +#define LZMA_REQUIRED_INPUT_MAX 20 + +typedef struct +{ + /* Don't change this structure. ASM code can use it. */ + CLzmaProps prop; + CLzmaProb *probs; + CLzmaProb *probs_1664; + Byte *dic; + SizeT dicBufSize; + SizeT dicPos; + const Byte *buf; + UInt32 range; + UInt32 code; + UInt32 processedPos; + UInt32 checkDicSize; + UInt32 reps[4]; + UInt32 state; + UInt32 remainLen; + + UInt32 numProbs; + unsigned tempBufSize; + Byte tempBuf[LZMA_REQUIRED_INPUT_MAX]; +} CLzmaDec; + +#define LzmaDec_Construct(p) { (p)->dic = NULL; (p)->probs = NULL; } + +void LzmaDec_Init(CLzmaDec *p); + +/* There are two types of LZMA streams: + - Stream with end mark. That end mark adds about 6 bytes to compressed size. + - Stream without end mark. You must know exact uncompressed size to decompress such stream. */ + +typedef enum +{ + LZMA_FINISH_ANY, /* finish at any point */ + LZMA_FINISH_END /* block must be finished at the end */ +} ELzmaFinishMode; + +/* ELzmaFinishMode has meaning only if the decoding reaches output limit !!! + + You must use LZMA_FINISH_END, when you know that current output buffer + covers last bytes of block. In other cases you must use LZMA_FINISH_ANY. + + If LZMA decoder sees end marker before reaching output limit, it returns SZ_OK, + and output value of destLen will be less than output buffer size limit. + You can check status result also. + + You can use multiple checks to test data integrity after full decompression: + 1) Check Result and "status" variable. + 2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize. + 3) Check that output(srcLen) = compressedSize, if you know real compressedSize. + You must use correct finish mode in that case. */ + +typedef enum +{ + LZMA_STATUS_NOT_SPECIFIED, /* use main error code instead */ + LZMA_STATUS_FINISHED_WITH_MARK, /* stream was finished with end mark. */ + LZMA_STATUS_NOT_FINISHED, /* stream was not finished */ + LZMA_STATUS_NEEDS_MORE_INPUT, /* you must provide more input bytes */ + LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK /* there is probability that stream was finished without end mark */ +} ELzmaStatus; + +/* ELzmaStatus is used only as output value for function call */ + + +/* ---------- Interfaces ---------- */ + +/* There are 3 levels of interfaces: + 1) Dictionary Interface + 2) Buffer Interface + 3) One Call Interface + You can select any of these interfaces, but don't mix functions from different + groups for same object. */ + + +/* There are two variants to allocate state for Dictionary Interface: + 1) LzmaDec_Allocate / LzmaDec_Free + 2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs + You can use variant 2, if you set dictionary buffer manually. + For Buffer Interface you must always use variant 1. + +LzmaDec_Allocate* can return: + SZ_OK + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_UNSUPPORTED - Unsupported properties +*/ + +SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAllocPtr alloc); +void LzmaDec_FreeProbs(CLzmaDec *p, ISzAllocPtr alloc); + +SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAllocPtr alloc); +void LzmaDec_Free(CLzmaDec *p, ISzAllocPtr alloc); + +/* ---------- Dictionary Interface ---------- */ + +/* You can use it, if you want to eliminate the overhead for data copying from + dictionary to some other external buffer. + You must work with CLzmaDec variables directly in this interface. + + STEPS: + LzmaDec_Construct() + LzmaDec_Allocate() + for (each new stream) + { + LzmaDec_Init() + while (it needs more decompression) + { + LzmaDec_DecodeToDic() + use data from CLzmaDec::dic and update CLzmaDec::dicPos + } + } + LzmaDec_Free() +*/ + +/* LzmaDec_DecodeToDic + + The decoding to internal dictionary buffer (CLzmaDec::dic). + You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!! + +finishMode: + It has meaning only if the decoding reaches output limit (dicLimit). + LZMA_FINISH_ANY - Decode just dicLimit bytes. + LZMA_FINISH_END - Stream must be finished after dicLimit. + +Returns: + SZ_OK + status: + LZMA_STATUS_FINISHED_WITH_MARK + LZMA_STATUS_NOT_FINISHED + LZMA_STATUS_NEEDS_MORE_INPUT + LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK + SZ_ERROR_DATA - Data error +*/ + +SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, + const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); + + +/* ---------- Buffer Interface ---------- */ + +/* It's zlib-like interface. + See LzmaDec_DecodeToDic description for information about STEPS and return results, + but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need + to work with CLzmaDec variables manually. + +finishMode: + It has meaning only if the decoding reaches output limit (*destLen). + LZMA_FINISH_ANY - Decode just destLen bytes. + LZMA_FINISH_END - Stream must be finished after (*destLen). +*/ + +SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, + const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); + + +/* ---------- One Call Interface ---------- */ + +/* LzmaDecode + +finishMode: + It has meaning only if the decoding reaches output limit (*destLen). + LZMA_FINISH_ANY - Decode just destLen bytes. + LZMA_FINISH_END - Stream must be finished after (*destLen). + +Returns: + SZ_OK + status: + LZMA_STATUS_FINISHED_WITH_MARK + LZMA_STATUS_NOT_FINISHED + LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK + SZ_ERROR_DATA - Data error + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_UNSUPPORTED - Unsupported properties + SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src). +*/ + +SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, + const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, + ELzmaStatus *status, ISzAllocPtr alloc); + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/LzmaEnc.h b/Include/Libraries/lzma/LzmaEnc.h new file mode 100644 index 000000000..9194ee576 --- /dev/null +++ b/Include/Libraries/lzma/LzmaEnc.h @@ -0,0 +1,76 @@ +/* LzmaEnc.h -- LZMA Encoder +2017-07-27 : Igor Pavlov : Public domain */ + +#ifndef __LZMA_ENC_H +#define __LZMA_ENC_H + +#include "7zTypes.h" + +EXTERN_C_BEGIN + +#define LZMA_PROPS_SIZE 5 + +typedef struct _CLzmaEncProps +{ + int level; /* 0 <= level <= 9 */ + UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version + (1 << 12) <= dictSize <= (3 << 29) for 64-bit version + default = (1 << 24) */ + int lc; /* 0 <= lc <= 8, default = 3 */ + int lp; /* 0 <= lp <= 4, default = 0 */ + int pb; /* 0 <= pb <= 4, default = 2 */ + int algo; /* 0 - fast, 1 - normal, default = 1 */ + int fb; /* 5 <= fb <= 273, default = 32 */ + int btMode; /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */ + int numHashBytes; /* 2, 3 or 4, default = 4 */ + UInt32 mc; /* 1 <= mc <= (1 << 30), default = 32 */ + unsigned writeEndMark; /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */ + int numThreads; /* 1 or 2, default = 2 */ + + UInt64 reduceSize; /* estimated size of data that will be compressed. default = (UInt64)(Int64)-1. + Encoder uses this value to reduce dictionary size */ +} CLzmaEncProps; + +void LzmaEncProps_Init(CLzmaEncProps *p); +void LzmaEncProps_Normalize(CLzmaEncProps *p); +UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2); + + +/* ---------- CLzmaEncHandle Interface ---------- */ + +/* LzmaEnc* functions can return the following exit codes: +SRes: + SZ_OK - OK + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_PARAM - Incorrect paramater in props + SZ_ERROR_WRITE - ISeqOutStream write callback error + SZ_ERROR_OUTPUT_EOF - output buffer overflow - version with (Byte *) output + SZ_ERROR_PROGRESS - some break from progress callback + SZ_ERROR_THREAD - error in multithreading functions (only for Mt version) +*/ + +typedef void * CLzmaEncHandle; + +CLzmaEncHandle LzmaEnc_Create(ISzAllocPtr alloc); +void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAllocPtr alloc, ISzAllocPtr allocBig); + +SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props); +void LzmaEnc_SetDataSize(CLzmaEncHandle p, UInt64 expectedDataSiize); +SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size); +unsigned LzmaEnc_IsWriteEndMark(CLzmaEncHandle p); + +SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream, + ICompressProgress *progress, ISzAllocPtr alloc, ISzAllocPtr allocBig); +SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, + int writeEndMark, ICompressProgress *progress, ISzAllocPtr alloc, ISzAllocPtr allocBig); + + +/* ---------- One Call Interface ---------- */ + +SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, + const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, + ICompressProgress *progress, ISzAllocPtr alloc, ISzAllocPtr allocBig); + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/LzmaLib.h b/Include/Libraries/lzma/LzmaLib.h new file mode 100644 index 000000000..88fa87d35 --- /dev/null +++ b/Include/Libraries/lzma/LzmaLib.h @@ -0,0 +1,131 @@ +/* LzmaLib.h -- LZMA library interface +2013-01-18 : Igor Pavlov : Public domain */ + +#ifndef __LZMA_LIB_H +#define __LZMA_LIB_H + +#include "7zTypes.h" + +EXTERN_C_BEGIN + +#define MY_STDAPI int MY_STD_CALL + +#define LZMA_PROPS_SIZE 5 + +/* +RAM requirements for LZMA: + for compression: (dictSize * 11.5 + 6 MB) + state_size + for decompression: dictSize + state_size + state_size = (4 + (1.5 << (lc + lp))) KB + by default (lc=3, lp=0), state_size = 16 KB. + +LZMA properties (5 bytes) format + Offset Size Description + 0 1 lc, lp and pb in encoded form. + 1 4 dictSize (little endian). +*/ + +/* +LzmaCompress +------------ + +outPropsSize - + In: the pointer to the size of outProps buffer; *outPropsSize = LZMA_PROPS_SIZE = 5. + Out: the pointer to the size of written properties in outProps buffer; *outPropsSize = LZMA_PROPS_SIZE = 5. + + LZMA Encoder will use defult values for any parameter, if it is + -1 for any from: level, loc, lp, pb, fb, numThreads + 0 for dictSize + +level - compression level: 0 <= level <= 9; + + level dictSize algo fb + 0: 16 KB 0 32 + 1: 64 KB 0 32 + 2: 256 KB 0 32 + 3: 1 MB 0 32 + 4: 4 MB 0 32 + 5: 16 MB 1 32 + 6: 32 MB 1 32 + 7+: 64 MB 1 64 + + The default value for "level" is 5. + + algo = 0 means fast method + algo = 1 means normal method + +dictSize - The dictionary size in bytes. The maximum value is + 128 MB = (1 << 27) bytes for 32-bit version + 1 GB = (1 << 30) bytes for 64-bit version + The default value is 16 MB = (1 << 24) bytes. + It's recommended to use the dictionary that is larger than 4 KB and + that can be calculated as (1 << N) or (3 << N) sizes. + +lc - The number of literal context bits (high bits of previous literal). + It can be in the range from 0 to 8. The default value is 3. + Sometimes lc=4 gives the gain for big files. + +lp - The number of literal pos bits (low bits of current position for literals). + It can be in the range from 0 to 4. The default value is 0. + The lp switch is intended for periodical data when the period is equal to 2^lp. + For example, for 32-bit (4 bytes) periodical data you can use lp=2. Often it's + better to set lc=0, if you change lp switch. + +pb - The number of pos bits (low bits of current position). + It can be in the range from 0 to 4. The default value is 2. + The pb switch is intended for periodical data when the period is equal 2^pb. + +fb - Word size (the number of fast bytes). + It can be in the range from 5 to 273. The default value is 32. + Usually, a big number gives a little bit better compression ratio and + slower compression process. + +numThreads - The number of thereads. 1 or 2. The default value is 2. + Fast mode (algo = 0) can use only 1 thread. + +Out: + destLen - processed output size +Returns: + SZ_OK - OK + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_PARAM - Incorrect paramater + SZ_ERROR_OUTPUT_EOF - output buffer overflow + SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) +*/ + +MY_STDAPI LzmaCompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t srcLen, + unsigned char *outProps, size_t *outPropsSize, /* *outPropsSize must be = 5 */ + int level, /* 0 <= level <= 9, default = 5 */ + unsigned dictSize, /* default = (1 << 24) */ + int lc, /* 0 <= lc <= 8, default = 3 */ + int lp, /* 0 <= lp <= 4, default = 0 */ + int pb, /* 0 <= pb <= 4, default = 2 */ + int fb, /* 5 <= fb <= 273, default = 32 */ + int numThreads /* 1 or 2, default = 2 */ + ); + +/* +LzmaUncompress +-------------- +In: + dest - output data + destLen - output data size + src - input data + srcLen - input data size +Out: + destLen - processed output size + srcLen - processed input size +Returns: + SZ_OK - OK + SZ_ERROR_DATA - Data error + SZ_ERROR_MEM - Memory allocation arror + SZ_ERROR_UNSUPPORTED - Unsupported properties + SZ_ERROR_INPUT_EOF - it needs more bytes in input buffer (src) +*/ + +MY_STDAPI LzmaUncompress(unsigned char *dest, size_t *destLen, const unsigned char *src, SizeT *srcLen, + const unsigned char *props, size_t propsSize); + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/MtCoder.h b/Include/Libraries/lzma/MtCoder.h new file mode 100644 index 000000000..5a5f4d11b --- /dev/null +++ b/Include/Libraries/lzma/MtCoder.h @@ -0,0 +1,141 @@ +/* MtCoder.h -- Multi-thread Coder +2018-07-04 : Igor Pavlov : Public domain */ + +#ifndef __MT_CODER_H +#define __MT_CODER_H + +#include "MtDec.h" + +EXTERN_C_BEGIN + +/* + if ( defined MTCODER__USE_WRITE_THREAD) : main thread writes all data blocks to output stream + if (not defined MTCODER__USE_WRITE_THREAD) : any coder thread can write data blocks to output stream +*/ +/* #define MTCODER__USE_WRITE_THREAD */ + +#ifndef _7ZIP_ST + #define MTCODER__GET_NUM_BLOCKS_FROM_THREADS(numThreads) ((numThreads) + (numThreads) / 8 + 1) + #define MTCODER__THREADS_MAX 64 + #define MTCODER__BLOCKS_MAX (MTCODER__GET_NUM_BLOCKS_FROM_THREADS(MTCODER__THREADS_MAX) + 3) +#else + #define MTCODER__THREADS_MAX 1 + #define MTCODER__BLOCKS_MAX 1 +#endif + + +#ifndef _7ZIP_ST + + +typedef struct +{ + ICompressProgress vt; + CMtProgress *mtProgress; + UInt64 inSize; + UInt64 outSize; +} CMtProgressThunk; + +void MtProgressThunk_CreateVTable(CMtProgressThunk *p); + +#define MtProgressThunk_Init(p) { (p)->inSize = 0; (p)->outSize = 0; } + + +struct _CMtCoder; + + +typedef struct +{ + struct _CMtCoder *mtCoder; + unsigned index; + int stop; + Byte *inBuf; + + CAutoResetEvent startEvent; + CThread thread; +} CMtCoderThread; + + +typedef struct +{ + SRes (*Code)(void *p, unsigned coderIndex, unsigned outBufIndex, + const Byte *src, size_t srcSize, int finished); + SRes (*Write)(void *p, unsigned outBufIndex); +} IMtCoderCallback2; + + +typedef struct +{ + SRes res; + unsigned bufIndex; + BoolInt finished; +} CMtCoderBlock; + + +typedef struct _CMtCoder +{ + /* input variables */ + + size_t blockSize; /* size of input block */ + unsigned numThreadsMax; + UInt64 expectedDataSize; + + ISeqInStream *inStream; + const Byte *inData; + size_t inDataSize; + + ICompressProgress *progress; + ISzAllocPtr allocBig; + + IMtCoderCallback2 *mtCallback; + void *mtCallbackObject; + + + /* internal variables */ + + size_t allocatedBufsSize; + + CAutoResetEvent readEvent; + CSemaphore blocksSemaphore; + + BoolInt stopReading; + SRes readRes; + + #ifdef MTCODER__USE_WRITE_THREAD + CAutoResetEvent writeEvents[MTCODER__BLOCKS_MAX]; + #else + CAutoResetEvent finishedEvent; + SRes writeRes; + unsigned writeIndex; + Byte ReadyBlocks[MTCODER__BLOCKS_MAX]; + LONG numFinishedThreads; + #endif + + unsigned numStartedThreadsLimit; + unsigned numStartedThreads; + + unsigned numBlocksMax; + unsigned blockIndex; + UInt64 readProcessed; + + CCriticalSection cs; + + unsigned freeBlockHead; + unsigned freeBlockList[MTCODER__BLOCKS_MAX]; + + CMtProgress mtProgress; + CMtCoderBlock blocks[MTCODER__BLOCKS_MAX]; + CMtCoderThread threads[MTCODER__THREADS_MAX]; +} CMtCoder; + + +void MtCoder_Construct(CMtCoder *p); +void MtCoder_Destruct(CMtCoder *p); +SRes MtCoder_Code(CMtCoder *p); + + +#endif + + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/MtDec.h b/Include/Libraries/lzma/MtDec.h new file mode 100644 index 000000000..9b5776672 --- /dev/null +++ b/Include/Libraries/lzma/MtDec.h @@ -0,0 +1,201 @@ +/* MtDec.h -- Multi-thread Decoder +2018-07-04 : Igor Pavlov : Public domain */ + +#ifndef __MT_DEC_H +#define __MT_DEC_H + +#include "7zTypes.h" + +#ifndef _7ZIP_ST +#include "Threads.h" +#endif + +EXTERN_C_BEGIN + +#ifndef _7ZIP_ST + +#ifndef _7ZIP_ST + #define MTDEC__THREADS_MAX 32 +#else + #define MTDEC__THREADS_MAX 1 +#endif + + +typedef struct +{ + ICompressProgress *progress; + SRes res; + UInt64 totalInSize; + UInt64 totalOutSize; + CCriticalSection cs; +} CMtProgress; + +void MtProgress_Init(CMtProgress *p, ICompressProgress *progress); +SRes MtProgress_Progress_ST(CMtProgress *p); +SRes MtProgress_ProgressAdd(CMtProgress *p, UInt64 inSize, UInt64 outSize); +SRes MtProgress_GetError(CMtProgress *p); +void MtProgress_SetError(CMtProgress *p, SRes res); + +struct _CMtDec; + +typedef struct +{ + struct _CMtDec *mtDec; + unsigned index; + void *inBuf; + + size_t inDataSize_Start; // size of input data in start block + UInt64 inDataSize; // total size of input data in all blocks + + CThread thread; + CAutoResetEvent canRead; + CAutoResetEvent canWrite; + void *allocaPtr; +} CMtDecThread; + +void MtDecThread_FreeInBufs(CMtDecThread *t); + + +typedef enum +{ + MTDEC_PARSE_CONTINUE, // continue this block with more input data + MTDEC_PARSE_OVERFLOW, // MT buffers overflow, need switch to single-thread + MTDEC_PARSE_NEW, // new block + MTDEC_PARSE_END // end of block threading. But we still can return to threading after Write(&needContinue) +} EMtDecParseState; + +typedef struct +{ + // in + int startCall; + const Byte *src; + size_t srcSize; + // in : (srcSize == 0) is allowed + // out : it's allowed to return less that actually was used ? + int srcFinished; + + // out + EMtDecParseState state; + BoolInt canCreateNewThread; + UInt64 outPos; // check it (size_t) +} CMtDecCallbackInfo; + + +typedef struct +{ + void (*Parse)(void *p, unsigned coderIndex, CMtDecCallbackInfo *ci); + + // PreCode() and Code(): + // (SRes_return_result != SZ_OK) means stop decoding, no need another blocks + SRes (*PreCode)(void *p, unsigned coderIndex); + SRes (*Code)(void *p, unsigned coderIndex, + const Byte *src, size_t srcSize, int srcFinished, + UInt64 *inCodePos, UInt64 *outCodePos, int *stop); + // stop - means stop another Code calls + + + /* Write() must be called, if Parse() was called + set (needWrite) if + { + && (was not interrupted by progress) + && (was not interrupted in previous block) + } + + out: + if (*needContinue), decoder still need to continue decoding with new iteration, + even after MTDEC_PARSE_END + if (*canRecode), we didn't flush current block data, so we still can decode current block later. + */ + SRes (*Write)(void *p, unsigned coderIndex, + BoolInt needWriteToStream, + const Byte *src, size_t srcSize, + // int srcFinished, + BoolInt *needContinue, + BoolInt *canRecode); +} IMtDecCallback; + + + +typedef struct _CMtDec +{ + /* input variables */ + + size_t inBufSize; /* size of input block */ + unsigned numThreadsMax; + // size_t inBlockMax; + unsigned numThreadsMax_2; + + ISeqInStream *inStream; + // const Byte *inData; + // size_t inDataSize; + + ICompressProgress *progress; + ISzAllocPtr alloc; + + IMtDecCallback *mtCallback; + void *mtCallbackObject; + + + /* internal variables */ + + size_t allocatedBufsSize; + + BoolInt exitThread; + WRes exitThreadWRes; + + UInt64 blockIndex; + BoolInt isAllocError; + BoolInt overflow; + SRes threadingErrorSRes; + + BoolInt needContinue; + + // CAutoResetEvent finishedEvent; + + SRes readRes; + SRes codeRes; + + BoolInt wasInterrupted; + + unsigned numStartedThreads_Limit; + unsigned numStartedThreads; + + Byte *crossBlock; + size_t crossStart; + size_t crossEnd; + UInt64 readProcessed; + BoolInt readWasFinished; + UInt64 inProcessed; + + unsigned filledThreadStart; + unsigned numFilledThreads; + + #ifndef _7ZIP_ST + BoolInt needInterrupt; + UInt64 interruptIndex; + CMtProgress mtProgress; + CMtDecThread threads[MTDEC__THREADS_MAX]; + #endif +} CMtDec; + + +void MtDec_Construct(CMtDec *p); +void MtDec_Destruct(CMtDec *p); + +/* +MtDec_Code() returns: + SZ_OK - in most cases + MY_SRes_HRESULT_FROM_WRes(WRes_error) - in case of unexpected error in threading function +*/ + +SRes MtDec_Code(CMtDec *p); +Byte *MtDec_GetCrossBuff(CMtDec *p); + +int MtDec_PrepareRead(CMtDec *p); +const Byte *MtDec_Read(CMtDec *p, size_t *inLim); + +#endif + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/Ppmd.h b/Include/Libraries/lzma/Ppmd.h new file mode 100644 index 000000000..a5c1e3ef2 --- /dev/null +++ b/Include/Libraries/lzma/Ppmd.h @@ -0,0 +1,85 @@ +/* Ppmd.h -- PPMD codec common code +2017-04-03 : Igor Pavlov : Public domain +This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */ + +#ifndef __PPMD_H +#define __PPMD_H + +#include "CpuArch.h" + +EXTERN_C_BEGIN + +#ifdef MY_CPU_32BIT + #define PPMD_32BIT +#endif + +#define PPMD_INT_BITS 7 +#define PPMD_PERIOD_BITS 7 +#define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS)) + +#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift)) +#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2) +#define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob)) +#define PPMD_UPDATE_PROB_1(prob) ((prob) - PPMD_GET_MEAN(prob)) + +#define PPMD_N1 4 +#define PPMD_N2 4 +#define PPMD_N3 4 +#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4) +#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4) + +#pragma pack(push, 1) +/* Most compilers works OK here even without #pragma pack(push, 1), but some GCC compilers need it. */ + +/* SEE-contexts for PPM-contexts with masked symbols */ +typedef struct +{ + UInt16 Summ; /* Freq */ + Byte Shift; /* Speed of Freq change; low Shift is for fast change */ + Byte Count; /* Count to next change of Shift */ +} CPpmd_See; + +#define Ppmd_See_Update(p) if ((p)->Shift < PPMD_PERIOD_BITS && --(p)->Count == 0) \ + { (p)->Summ <<= 1; (p)->Count = (Byte)(3 << (p)->Shift++); } + +typedef struct +{ + Byte Symbol; + Byte Freq; + UInt16 SuccessorLow; + UInt16 SuccessorHigh; +} CPpmd_State; + +#pragma pack(pop) + +typedef + #ifdef PPMD_32BIT + CPpmd_State * + #else + UInt32 + #endif + CPpmd_State_Ref; + +typedef + #ifdef PPMD_32BIT + void * + #else + UInt32 + #endif + CPpmd_Void_Ref; + +typedef + #ifdef PPMD_32BIT + Byte * + #else + UInt32 + #endif + CPpmd_Byte_Ref; + +#define PPMD_SetAllBitsIn256Bytes(p) \ + { size_t z; for (z = 0; z < 256 / sizeof(p[0]); z += 8) { \ + p[z+7] = p[z+6] = p[z+5] = p[z+4] = p[z+3] = p[z+2] = p[z+1] = p[z+0] = ~(size_t)0; }} + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/Ppmd7.h b/Include/Libraries/lzma/Ppmd7.h new file mode 100644 index 000000000..610539a04 --- /dev/null +++ b/Include/Libraries/lzma/Ppmd7.h @@ -0,0 +1,142 @@ +/* Ppmd7.h -- PPMdH compression codec +2018-07-04 : Igor Pavlov : Public domain +This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */ + +/* This code supports virtual RangeDecoder and includes the implementation +of RangeCoder from 7z, instead of RangeCoder from original PPMd var.H. +If you need the compatibility with original PPMd var.H, you can use external RangeDecoder */ + +#ifndef __PPMD7_H +#define __PPMD7_H + +#include "Ppmd.h" + +EXTERN_C_BEGIN + +#define PPMD7_MIN_ORDER 2 +#define PPMD7_MAX_ORDER 64 + +#define PPMD7_MIN_MEM_SIZE (1 << 11) +#define PPMD7_MAX_MEM_SIZE (0xFFFFFFFF - 12 * 3) + +struct CPpmd7_Context_; + +typedef + #ifdef PPMD_32BIT + struct CPpmd7_Context_ * + #else + UInt32 + #endif + CPpmd7_Context_Ref; + +typedef struct CPpmd7_Context_ +{ + UInt16 NumStats; + UInt16 SummFreq; + CPpmd_State_Ref Stats; + CPpmd7_Context_Ref Suffix; +} CPpmd7_Context; + +#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq) + +typedef struct +{ + CPpmd7_Context *MinContext, *MaxContext; + CPpmd_State *FoundState; + unsigned OrderFall, InitEsc, PrevSuccess, MaxOrder, HiBitsFlag; + Int32 RunLength, InitRL; /* must be 32-bit at least */ + + UInt32 Size; + UInt32 GlueCount; + Byte *Base, *LoUnit, *HiUnit, *Text, *UnitsStart; + UInt32 AlignOffset; + + Byte Indx2Units[PPMD_NUM_INDEXES]; + Byte Units2Indx[128]; + CPpmd_Void_Ref FreeList[PPMD_NUM_INDEXES]; + Byte NS2Indx[256], NS2BSIndx[256], HB2Flag[256]; + CPpmd_See DummySee, See[25][16]; + UInt16 BinSumm[128][64]; +} CPpmd7; + +void Ppmd7_Construct(CPpmd7 *p); +BoolInt Ppmd7_Alloc(CPpmd7 *p, UInt32 size, ISzAllocPtr alloc); +void Ppmd7_Free(CPpmd7 *p, ISzAllocPtr alloc); +void Ppmd7_Init(CPpmd7 *p, unsigned maxOrder); +#define Ppmd7_WasAllocated(p) ((p)->Base != NULL) + + +/* ---------- Internal Functions ---------- */ + +extern const Byte PPMD7_kExpEscape[16]; + +#ifdef PPMD_32BIT + #define Ppmd7_GetPtr(p, ptr) (ptr) + #define Ppmd7_GetContext(p, ptr) (ptr) + #define Ppmd7_GetStats(p, ctx) ((ctx)->Stats) +#else + #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs))) + #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs))) + #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats))) +#endif + +void Ppmd7_Update1(CPpmd7 *p); +void Ppmd7_Update1_0(CPpmd7 *p); +void Ppmd7_Update2(CPpmd7 *p); +void Ppmd7_UpdateBin(CPpmd7 *p); + +#define Ppmd7_GetBinSumm(p) \ + &p->BinSumm[(size_t)(unsigned)Ppmd7Context_OneState(p->MinContext)->Freq - 1][p->PrevSuccess + \ + p->NS2BSIndx[(size_t)Ppmd7_GetContext(p, p->MinContext->Suffix)->NumStats - 1] + \ + (p->HiBitsFlag = p->HB2Flag[p->FoundState->Symbol]) + \ + 2 * p->HB2Flag[(unsigned)Ppmd7Context_OneState(p->MinContext)->Symbol] + \ + ((p->RunLength >> 26) & 0x20)] + +CPpmd_See *Ppmd7_MakeEscFreq(CPpmd7 *p, unsigned numMasked, UInt32 *scale); + + +/* ---------- Decode ---------- */ + +typedef struct IPpmd7_RangeDec IPpmd7_RangeDec; + +struct IPpmd7_RangeDec +{ + UInt32 (*GetThreshold)(const IPpmd7_RangeDec *p, UInt32 total); + void (*Decode)(const IPpmd7_RangeDec *p, UInt32 start, UInt32 size); + UInt32 (*DecodeBit)(const IPpmd7_RangeDec *p, UInt32 size0); +}; + +typedef struct +{ + IPpmd7_RangeDec vt; + UInt32 Range; + UInt32 Code; + IByteIn *Stream; +} CPpmd7z_RangeDec; + +void Ppmd7z_RangeDec_CreateVTable(CPpmd7z_RangeDec *p); +BoolInt Ppmd7z_RangeDec_Init(CPpmd7z_RangeDec *p); +#define Ppmd7z_RangeDec_IsFinishedOK(p) ((p)->Code == 0) + +int Ppmd7_DecodeSymbol(CPpmd7 *p, const IPpmd7_RangeDec *rc); + + +/* ---------- Encode ---------- */ + +typedef struct +{ + UInt64 Low; + UInt32 Range; + Byte Cache; + UInt64 CacheSize; + IByteOut *Stream; +} CPpmd7z_RangeEnc; + +void Ppmd7z_RangeEnc_Init(CPpmd7z_RangeEnc *p); +void Ppmd7z_RangeEnc_FlushData(CPpmd7z_RangeEnc *p); + +void Ppmd7_EncodeSymbol(CPpmd7 *p, CPpmd7z_RangeEnc *rc, int symbol); + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/Precomp.h b/Include/Libraries/lzma/Precomp.h new file mode 100644 index 000000000..e8ff8b40e --- /dev/null +++ b/Include/Libraries/lzma/Precomp.h @@ -0,0 +1,10 @@ +/* Precomp.h -- StdAfx +2013-11-12 : Igor Pavlov : Public domain */ + +#ifndef __7Z_PRECOMP_H +#define __7Z_PRECOMP_H + +#include "Compiler.h" +/* #include "7zTypes.h" */ + +#endif diff --git a/Include/Libraries/lzma/RotateDefs.h b/Include/Libraries/lzma/RotateDefs.h new file mode 100644 index 000000000..8f01d1a6c --- /dev/null +++ b/Include/Libraries/lzma/RotateDefs.h @@ -0,0 +1,30 @@ +/* RotateDefs.h -- Rotate functions +2015-03-25 : Igor Pavlov : Public domain */ + +#ifndef __ROTATE_DEFS_H +#define __ROTATE_DEFS_H + +#ifdef _MSC_VER + +#include + +/* don't use _rotl with MINGW. It can insert slow call to function. */ + +/* #if (_MSC_VER >= 1200) */ +#pragma intrinsic(_rotl) +#pragma intrinsic(_rotr) +/* #endif */ + +#define rotlFixed(x, n) _rotl((x), (n)) +#define rotrFixed(x, n) _rotr((x), (n)) + +#else + +/* new compilers can translate these macros to fast commands. */ + +#define rotlFixed(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) +#define rotrFixed(x, n) (((x) >> (n)) | ((x) << (32 - (n)))) + +#endif + +#endif diff --git a/Include/Libraries/lzma/Sha256.h b/Include/Libraries/lzma/Sha256.h new file mode 100644 index 000000000..3f455dbc0 --- /dev/null +++ b/Include/Libraries/lzma/Sha256.h @@ -0,0 +1,26 @@ +/* Sha256.h -- SHA-256 Hash +2013-01-18 : Igor Pavlov : Public domain */ + +#ifndef __CRYPTO_SHA256_H +#define __CRYPTO_SHA256_H + +#include "7zTypes.h" + +EXTERN_C_BEGIN + +#define SHA256_DIGEST_SIZE 32 + +typedef struct +{ + UInt32 state[8]; + UInt64 count; + Byte buffer[64]; +} CSha256; + +void Sha256_Init(CSha256 *p); +void Sha256_Update(CSha256 *p, const Byte *data, size_t size); +void Sha256_Final(CSha256 *p, Byte *digest); + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/Sort.h b/Include/Libraries/lzma/Sort.h new file mode 100644 index 000000000..2e2963a23 --- /dev/null +++ b/Include/Libraries/lzma/Sort.h @@ -0,0 +1,18 @@ +/* Sort.h -- Sort functions +2014-04-05 : Igor Pavlov : Public domain */ + +#ifndef __7Z_SORT_H +#define __7Z_SORT_H + +#include "7zTypes.h" + +EXTERN_C_BEGIN + +void HeapSort(UInt32 *p, size_t size); +void HeapSort64(UInt64 *p, size_t size); + +/* void HeapSortRef(UInt32 *p, UInt32 *vals, size_t size); */ + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/Threads.h b/Include/Libraries/lzma/Threads.h new file mode 100644 index 000000000..e53ace435 --- /dev/null +++ b/Include/Libraries/lzma/Threads.h @@ -0,0 +1,68 @@ +/* Threads.h -- multithreading library +2017-06-18 : Igor Pavlov : Public domain */ + +#ifndef __7Z_THREADS_H +#define __7Z_THREADS_H + +#ifdef _WIN32 +#include +#endif + +#include "7zTypes.h" + +EXTERN_C_BEGIN + +WRes HandlePtr_Close(HANDLE *h); +WRes Handle_WaitObject(HANDLE h); + +typedef HANDLE CThread; +#define Thread_Construct(p) *(p) = NULL +#define Thread_WasCreated(p) (*(p) != NULL) +#define Thread_Close(p) HandlePtr_Close(p) +#define Thread_Wait(p) Handle_WaitObject(*(p)) + +typedef +#ifdef UNDER_CE + DWORD +#else + unsigned +#endif + THREAD_FUNC_RET_TYPE; + +#define THREAD_FUNC_CALL_TYPE MY_STD_CALL +#define THREAD_FUNC_DECL THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE +typedef THREAD_FUNC_RET_TYPE (THREAD_FUNC_CALL_TYPE * THREAD_FUNC_TYPE)(void *); +WRes Thread_Create(CThread *p, THREAD_FUNC_TYPE func, LPVOID param); + +typedef HANDLE CEvent; +typedef CEvent CAutoResetEvent; +typedef CEvent CManualResetEvent; +#define Event_Construct(p) *(p) = NULL +#define Event_IsCreated(p) (*(p) != NULL) +#define Event_Close(p) HandlePtr_Close(p) +#define Event_Wait(p) Handle_WaitObject(*(p)) +WRes Event_Set(CEvent *p); +WRes Event_Reset(CEvent *p); +WRes ManualResetEvent_Create(CManualResetEvent *p, int signaled); +WRes ManualResetEvent_CreateNotSignaled(CManualResetEvent *p); +WRes AutoResetEvent_Create(CAutoResetEvent *p, int signaled); +WRes AutoResetEvent_CreateNotSignaled(CAutoResetEvent *p); + +typedef HANDLE CSemaphore; +#define Semaphore_Construct(p) *(p) = NULL +#define Semaphore_IsCreated(p) (*(p) != NULL) +#define Semaphore_Close(p) HandlePtr_Close(p) +#define Semaphore_Wait(p) Handle_WaitObject(*(p)) +WRes Semaphore_Create(CSemaphore *p, UInt32 initCount, UInt32 maxCount); +WRes Semaphore_ReleaseN(CSemaphore *p, UInt32 num); +WRes Semaphore_Release1(CSemaphore *p); + +typedef CRITICAL_SECTION CCriticalSection; +WRes CriticalSection_Init(CCriticalSection *p); +#define CriticalSection_Delete(p) DeleteCriticalSection(p) +#define CriticalSection_Enter(p) EnterCriticalSection(p) +#define CriticalSection_Leave(p) LeaveCriticalSection(p) + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/Xz.h b/Include/Libraries/lzma/Xz.h new file mode 100644 index 000000000..544ee18f2 --- /dev/null +++ b/Include/Libraries/lzma/Xz.h @@ -0,0 +1,460 @@ +/* Xz.h - Xz interface +2018-07-04 : Igor Pavlov : Public domain */ + +#ifndef __XZ_H +#define __XZ_H + +#include "Sha256.h" + +EXTERN_C_BEGIN + +#define XZ_ID_Subblock 1 +#define XZ_ID_Delta 3 +#define XZ_ID_X86 4 +#define XZ_ID_PPC 5 +#define XZ_ID_IA64 6 +#define XZ_ID_ARM 7 +#define XZ_ID_ARMT 8 +#define XZ_ID_SPARC 9 +#define XZ_ID_LZMA2 0x21 + +unsigned Xz_ReadVarInt(const Byte *p, size_t maxSize, UInt64 *value); +unsigned Xz_WriteVarInt(Byte *buf, UInt64 v); + +/* ---------- xz block ---------- */ + +#define XZ_BLOCK_HEADER_SIZE_MAX 1024 + +#define XZ_NUM_FILTERS_MAX 4 +#define XZ_BF_NUM_FILTERS_MASK 3 +#define XZ_BF_PACK_SIZE (1 << 6) +#define XZ_BF_UNPACK_SIZE (1 << 7) + +#define XZ_FILTER_PROPS_SIZE_MAX 20 + +typedef struct +{ + UInt64 id; + UInt32 propsSize; + Byte props[XZ_FILTER_PROPS_SIZE_MAX]; +} CXzFilter; + +typedef struct +{ + UInt64 packSize; + UInt64 unpackSize; + Byte flags; + CXzFilter filters[XZ_NUM_FILTERS_MAX]; +} CXzBlock; + +#define XzBlock_GetNumFilters(p) (((p)->flags & XZ_BF_NUM_FILTERS_MASK) + 1) +#define XzBlock_HasPackSize(p) (((p)->flags & XZ_BF_PACK_SIZE) != 0) +#define XzBlock_HasUnpackSize(p) (((p)->flags & XZ_BF_UNPACK_SIZE) != 0) +#define XzBlock_HasUnsupportedFlags(p) (((p)->flags & ~(XZ_BF_NUM_FILTERS_MASK | XZ_BF_PACK_SIZE | XZ_BF_UNPACK_SIZE)) != 0) + +SRes XzBlock_Parse(CXzBlock *p, const Byte *header); +SRes XzBlock_ReadHeader(CXzBlock *p, ISeqInStream *inStream, BoolInt *isIndex, UInt32 *headerSizeRes); + +/* ---------- xz stream ---------- */ + +#define XZ_SIG_SIZE 6 +#define XZ_FOOTER_SIG_SIZE 2 + +extern const Byte XZ_SIG[XZ_SIG_SIZE]; + +/* +extern const Byte XZ_FOOTER_SIG[XZ_FOOTER_SIG_SIZE]; +*/ + +#define XZ_FOOTER_SIG_0 'Y' +#define XZ_FOOTER_SIG_1 'Z' + +#define XZ_STREAM_FLAGS_SIZE 2 +#define XZ_STREAM_CRC_SIZE 4 + +#define XZ_STREAM_HEADER_SIZE (XZ_SIG_SIZE + XZ_STREAM_FLAGS_SIZE + XZ_STREAM_CRC_SIZE) +#define XZ_STREAM_FOOTER_SIZE (XZ_FOOTER_SIG_SIZE + XZ_STREAM_FLAGS_SIZE + XZ_STREAM_CRC_SIZE + 4) + +#define XZ_CHECK_MASK 0xF +#define XZ_CHECK_NO 0 +#define XZ_CHECK_CRC32 1 +#define XZ_CHECK_CRC64 4 +#define XZ_CHECK_SHA256 10 + +typedef struct +{ + unsigned mode; + UInt32 crc; + UInt64 crc64; + CSha256 sha; +} CXzCheck; + +void XzCheck_Init(CXzCheck *p, unsigned mode); +void XzCheck_Update(CXzCheck *p, const void *data, size_t size); +int XzCheck_Final(CXzCheck *p, Byte *digest); + +typedef UInt16 CXzStreamFlags; + +#define XzFlags_IsSupported(f) ((f) <= XZ_CHECK_MASK) +#define XzFlags_GetCheckType(f) ((f) & XZ_CHECK_MASK) +#define XzFlags_HasDataCrc32(f) (Xz_GetCheckType(f) == XZ_CHECK_CRC32) +unsigned XzFlags_GetCheckSize(CXzStreamFlags f); + +SRes Xz_ParseHeader(CXzStreamFlags *p, const Byte *buf); +SRes Xz_ReadHeader(CXzStreamFlags *p, ISeqInStream *inStream); + +typedef struct +{ + UInt64 unpackSize; + UInt64 totalSize; +} CXzBlockSizes; + +typedef struct +{ + CXzStreamFlags flags; + size_t numBlocks; + CXzBlockSizes *blocks; + UInt64 startOffset; +} CXzStream; + +void Xz_Construct(CXzStream *p); +void Xz_Free(CXzStream *p, ISzAllocPtr alloc); + +#define XZ_SIZE_OVERFLOW ((UInt64)(Int64)-1) + +UInt64 Xz_GetUnpackSize(const CXzStream *p); +UInt64 Xz_GetPackSize(const CXzStream *p); + +typedef struct +{ + size_t num; + size_t numAllocated; + CXzStream *streams; +} CXzs; + +void Xzs_Construct(CXzs *p); +void Xzs_Free(CXzs *p, ISzAllocPtr alloc); +SRes Xzs_ReadBackward(CXzs *p, ILookInStream *inStream, Int64 *startOffset, ICompressProgress *progress, ISzAllocPtr alloc); + +UInt64 Xzs_GetNumBlocks(const CXzs *p); +UInt64 Xzs_GetUnpackSize(const CXzs *p); + + +// ECoderStatus values are identical to ELzmaStatus values of LZMA2 decoder + +typedef enum +{ + CODER_STATUS_NOT_SPECIFIED, /* use main error code instead */ + CODER_STATUS_FINISHED_WITH_MARK, /* stream was finished with end mark. */ + CODER_STATUS_NOT_FINISHED, /* stream was not finished */ + CODER_STATUS_NEEDS_MORE_INPUT /* you must provide more input bytes */ +} ECoderStatus; + + +// ECoderFinishMode values are identical to ELzmaFinishMode + +typedef enum +{ + CODER_FINISH_ANY, /* finish at any point */ + CODER_FINISH_END /* block must be finished at the end */ +} ECoderFinishMode; + + +typedef struct _IStateCoder +{ + void *p; + void (*Free)(void *p, ISzAllocPtr alloc); + SRes (*SetProps)(void *p, const Byte *props, size_t propSize, ISzAllocPtr alloc); + void (*Init)(void *p); + SRes (*Code2)(void *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, + int srcWasFinished, ECoderFinishMode finishMode, + // int *wasFinished, + ECoderStatus *status); + SizeT (*Filter)(void *p, Byte *data, SizeT size); +} IStateCoder; + + + +#define MIXCODER_NUM_FILTERS_MAX 4 + +typedef struct +{ + ISzAllocPtr alloc; + Byte *buf; + unsigned numCoders; + + Byte *outBuf; + size_t outBufSize; + size_t outWritten; // is equal to lzmaDecoder.dicPos (in outBuf mode) + BoolInt wasFinished; + SRes res; + ECoderStatus status; + // BoolInt SingleBufMode; + + int finished[MIXCODER_NUM_FILTERS_MAX - 1]; + size_t pos[MIXCODER_NUM_FILTERS_MAX - 1]; + size_t size[MIXCODER_NUM_FILTERS_MAX - 1]; + UInt64 ids[MIXCODER_NUM_FILTERS_MAX]; + SRes results[MIXCODER_NUM_FILTERS_MAX]; + IStateCoder coders[MIXCODER_NUM_FILTERS_MAX]; +} CMixCoder; + + +typedef enum +{ + XZ_STATE_STREAM_HEADER, + XZ_STATE_STREAM_INDEX, + XZ_STATE_STREAM_INDEX_CRC, + XZ_STATE_STREAM_FOOTER, + XZ_STATE_STREAM_PADDING, + XZ_STATE_BLOCK_HEADER, + XZ_STATE_BLOCK, + XZ_STATE_BLOCK_FOOTER +} EXzState; + + +typedef struct +{ + EXzState state; + UInt32 pos; + unsigned alignPos; + unsigned indexPreSize; + + CXzStreamFlags streamFlags; + + UInt32 blockHeaderSize; + UInt64 packSize; + UInt64 unpackSize; + + UInt64 numBlocks; // number of finished blocks in current stream + UInt64 indexSize; + UInt64 indexPos; + UInt64 padSize; + + UInt64 numStartedStreams; + UInt64 numFinishedStreams; + UInt64 numTotalBlocks; + + UInt32 crc; + CMixCoder decoder; + CXzBlock block; + CXzCheck check; + CSha256 sha; + + BoolInt parseMode; + BoolInt headerParsedOk; + BoolInt decodeToStreamSignature; + unsigned decodeOnlyOneBlock; + + Byte *outBuf; + size_t outBufSize; + size_t outDataWritten; // the size of data in (outBuf) that were fully unpacked + + Byte shaDigest[SHA256_DIGEST_SIZE]; + Byte buf[XZ_BLOCK_HEADER_SIZE_MAX]; +} CXzUnpacker; + +/* alloc : aligned for cache line allocation is better */ +void XzUnpacker_Construct(CXzUnpacker *p, ISzAllocPtr alloc); +void XzUnpacker_Init(CXzUnpacker *p); +void XzUnpacker_SetOutBuf(CXzUnpacker *p, Byte *outBuf, size_t outBufSize); +void XzUnpacker_Free(CXzUnpacker *p); + +/* + XzUnpacker + The sequence for decoding functions: + { + XzUnpacker_Construct() + [Decoding_Calls] + XzUnpacker_Free() + } + + [Decoding_Calls] + + There are 3 types of interfaces for [Decoding_Calls] calls: + + Interface-1 : Partial output buffers: + { + XzUnpacker_Init() + for() + XzUnpacker_Code(); + } + + Interface-2 : Direct output buffer: + Use it, if you know exact size of decoded data, and you need + whole xz unpacked data in one output buffer. + xz unpacker doesn't allocate additional buffer for lzma2 dictionary in that mode. + { + XzUnpacker_Init() + XzUnpacker_SetOutBufMode(); // to set output buffer and size + for() + XzUnpacker_Code(); // (dest = NULL) in XzUnpacker_Code() + } + + Interface-3 : Direct output buffer : One call full decoding + It unpacks whole input buffer to output buffer in one call. + It uses Interface-2 internally. + { + XzUnpacker_CodeFull() + } +*/ + +/* +finishMode: + It has meaning only if the decoding reaches output limit (*destLen). + CODER_FINISH_ANY - use smallest number of input bytes + CODER_FINISH_END - read EndOfStream marker after decoding + +Returns: + SZ_OK + status: + CODER_STATUS_NOT_FINISHED, + CODER_STATUS_NEEDS_MORE_INPUT - maybe there are more xz streams, + call XzUnpacker_IsStreamWasFinished to check that current stream was finished + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_DATA - Data error + SZ_ERROR_UNSUPPORTED - Unsupported method or method properties + SZ_ERROR_CRC - CRC error + // SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src). + + SZ_ERROR_NO_ARCHIVE - the error with xz Stream Header with one of the following reasons: + - xz Stream Signature failure + - CRC32 of xz Stream Header is failed + - The size of Stream padding is not multiple of four bytes. + It's possible to get that error, if xz stream was finished and the stream + contains some another data. In that case you can call XzUnpacker_GetExtraSize() + function to get real size of xz stream. +*/ + + +SRes XzUnpacker_Code(CXzUnpacker *p, Byte *dest, SizeT *destLen, + const Byte *src, SizeT *srcLen, int srcFinished, + ECoderFinishMode finishMode, ECoderStatus *status); + +SRes XzUnpacker_CodeFull(CXzUnpacker *p, Byte *dest, SizeT *destLen, + const Byte *src, SizeT *srcLen, + ECoderFinishMode finishMode, ECoderStatus *status); + +BoolInt XzUnpacker_IsStreamWasFinished(const CXzUnpacker *p); + +/* +XzUnpacker_GetExtraSize() returns then number of uncofirmed bytes, + if it's in (XZ_STATE_STREAM_HEADER) state or in (XZ_STATE_STREAM_PADDING) state. +These bytes can be some bytes after xz archive, or +it can be start of new xz stream. + +Call XzUnpacker_GetExtraSize() after XzUnpacker_Code() function to detect real size of +xz stream in two cases, if XzUnpacker_Code() returns: + res == SZ_OK && status == CODER_STATUS_NEEDS_MORE_INPUT + res == SZ_ERROR_NO_ARCHIVE +*/ + +UInt64 XzUnpacker_GetExtraSize(const CXzUnpacker *p); + + +/* + for random block decoding: + XzUnpacker_Init(); + set CXzUnpacker::streamFlags + XzUnpacker_PrepareToRandomBlockDecoding() + loop + { + XzUnpacker_Code() + XzUnpacker_IsBlockFinished() + } +*/ + +void XzUnpacker_PrepareToRandomBlockDecoding(CXzUnpacker *p); +BoolInt XzUnpacker_IsBlockFinished(const CXzUnpacker *p); + +#define XzUnpacker_GetPackSizeForIndex(p) ((p)->packSize + (p)->blockHeaderSize + XzFlags_GetCheckSize((p)->streamFlags)) + + + +/* ---------- Multi Threading Decoding ---------- */ + + +typedef struct +{ + size_t inBufSize_ST; + size_t outStep_ST; + BoolInt ignoreErrors; + + #ifndef _7ZIP_ST + unsigned numThreads; + size_t inBufSize_MT; + size_t memUseMax; + #endif +} CXzDecMtProps; + +void XzDecMtProps_Init(CXzDecMtProps *p); + + +typedef void * CXzDecMtHandle; + +/* + alloc : XzDecMt uses CAlignOffsetAlloc for addresses allocated by (alloc). + allocMid : for big allocations, aligned allocation is better +*/ + +CXzDecMtHandle XzDecMt_Create(ISzAllocPtr alloc, ISzAllocPtr allocMid); +void XzDecMt_Destroy(CXzDecMtHandle p); + + +typedef struct +{ + Byte UnpackSize_Defined; + Byte NumStreams_Defined; + Byte NumBlocks_Defined; + + Byte DataAfterEnd; + Byte DecodingTruncated; // Decoding was Truncated, we need only partial output data + + UInt64 InSize; // pack size processed + UInt64 OutSize; + + UInt64 NumStreams; + UInt64 NumBlocks; + + SRes DecodeRes; + SRes ReadRes; + SRes ProgressRes; + SRes CombinedRes; + SRes CombinedRes_Type; + +} CXzStatInfo; + +void XzStatInfo_Clear(CXzStatInfo *p); + +/* +XzDecMt_Decode() +SRes: + SZ_OK - OK + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_NO_ARCHIVE - is not xz archive + SZ_ERROR_ARCHIVE - Headers error + SZ_ERROR_DATA - Data Error + SZ_ERROR_CRC - CRC Error + SZ_ERROR_INPUT_EOF - it needs more input data + SZ_ERROR_WRITE - ISeqOutStream error + (SZ_ERROR_READ) - ISeqInStream errors + (SZ_ERROR_PROGRESS) - ICompressProgress errors + // SZ_ERROR_THREAD - error in multi-threading functions + MY_SRes_HRESULT_FROM_WRes(WRes_error) - error in multi-threading function +*/ + +SRes XzDecMt_Decode(CXzDecMtHandle p, + const CXzDecMtProps *props, + const UInt64 *outDataSize, // NULL means undefined + int finishMode, // 0 - partial unpacking is allowed, 1 - xz stream(s) must be finished + ISeqOutStream *outStream, + // Byte *outBuf, size_t *outBufSize, + ISeqInStream *inStream, + // const Byte *inData, size_t inDataSize, + CXzStatInfo *stat, + int *isMT, // 0 means that ST (Single-Thread) version was used + ICompressProgress *progress); + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/XzCrc64.h b/Include/Libraries/lzma/XzCrc64.h new file mode 100644 index 000000000..08dbc330c --- /dev/null +++ b/Include/Libraries/lzma/XzCrc64.h @@ -0,0 +1,26 @@ +/* XzCrc64.h -- CRC64 calculation +2013-01-18 : Igor Pavlov : Public domain */ + +#ifndef __XZ_CRC64_H +#define __XZ_CRC64_H + +#include + +#include "7zTypes.h" + +EXTERN_C_BEGIN + +extern UInt64 g_Crc64Table[]; + +void MY_FAST_CALL Crc64GenerateTable(void); + +#define CRC64_INIT_VAL UINT64_CONST(0xFFFFFFFFFFFFFFFF) +#define CRC64_GET_DIGEST(crc) ((crc) ^ CRC64_INIT_VAL) +#define CRC64_UPDATE_BYTE(crc, b) (g_Crc64Table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8)) + +UInt64 MY_FAST_CALL Crc64Update(UInt64 crc, const void *data, size_t size); +UInt64 MY_FAST_CALL Crc64Calc(const void *data, size_t size); + +EXTERN_C_END + +#endif diff --git a/Include/Libraries/lzma/XzEnc.h b/Include/Libraries/lzma/XzEnc.h new file mode 100644 index 000000000..0c29e7e1e --- /dev/null +++ b/Include/Libraries/lzma/XzEnc.h @@ -0,0 +1,60 @@ +/* XzEnc.h -- Xz Encode +2017-06-27 : Igor Pavlov : Public domain */ + +#ifndef __XZ_ENC_H +#define __XZ_ENC_H + +#include "Lzma2Enc.h" + +#include "Xz.h" + +EXTERN_C_BEGIN + + +#define XZ_PROPS__BLOCK_SIZE__AUTO LZMA2_ENC_PROPS__BLOCK_SIZE__AUTO +#define XZ_PROPS__BLOCK_SIZE__SOLID LZMA2_ENC_PROPS__BLOCK_SIZE__SOLID + + +typedef struct +{ + UInt32 id; + UInt32 delta; + UInt32 ip; + int ipDefined; +} CXzFilterProps; + +void XzFilterProps_Init(CXzFilterProps *p); + + +typedef struct +{ + CLzma2EncProps lzma2Props; + CXzFilterProps filterProps; + unsigned checkId; + UInt64 blockSize; + int numBlockThreads_Reduced; + int numBlockThreads_Max; + int numTotalThreads; + int forceWriteSizesInHeader; + UInt64 reduceSize; +} CXzProps; + +void XzProps_Init(CXzProps *p); + + +typedef void * CXzEncHandle; + +CXzEncHandle XzEnc_Create(ISzAllocPtr alloc, ISzAllocPtr allocBig); +void XzEnc_Destroy(CXzEncHandle p); +SRes XzEnc_SetProps(CXzEncHandle p, const CXzProps *props); +void XzEnc_SetDataSize(CXzEncHandle p, UInt64 expectedDataSiize); +SRes XzEnc_Encode(CXzEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress); + +SRes Xz_Encode(ISeqOutStream *outStream, ISeqInStream *inStream, + const CXzProps *props, ICompressProgress *progress); + +SRes Xz_EncodeEmpty(ISeqOutStream *outStream); + +EXTERN_C_END + +#endif diff --git a/Include/Model/Classes/NMR_CustomXMLAttribute.h b/Include/Model/Classes/NMR_CustomXMLAttribute.h new file mode 100644 index 000000000..ec1d7711a --- /dev/null +++ b/Include/Model/Classes/NMR_CustomXMLAttribute.h @@ -0,0 +1,68 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#ifndef __NMR_CUSTOMXMLATTRIBUTE +#define __NMR_CUSTOMXMLATTRIBUTE + +#include +#include +#include +#include +#include + +namespace NMR { + + + class CCustomXMLAttribute; + typedef std::shared_ptr PCustomXMLAttribute; + + class CCustomXMLAttribute { + private: + + std::string m_sName; + + std::string m_sValue; + + public: + CCustomXMLAttribute() = delete; + CCustomXMLAttribute(const std::string & sName, const std::string & sValue); + + ~CCustomXMLAttribute(); + + std::string getName (); + + std::string getValue (); + + void setValue (const std::string & sValue); + + }; + +} + +#endif // __NMR_CUSTOMXMLATTRIBUTE diff --git a/Include/Model/Classes/NMR_CustomXMLNode.h b/Include/Model/Classes/NMR_CustomXMLNode.h new file mode 100644 index 000000000..380c96931 --- /dev/null +++ b/Include/Model/Classes/NMR_CustomXMLNode.h @@ -0,0 +1,125 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#ifndef __NMR_CUSTOMXMLNODE +#define __NMR_CUSTOMXMLNODE + +#include +#include +#include +#include +#include + +#include "Common/Platform/NMR_XmlWriter.h" +#include "NMR_CustomXMLAttribute.h" + +namespace NMR { + + class CCustomXMLNode; + typedef std::shared_ptr PCustomXMLNode; + + class CCustomXMLNode { + private: + + std::string m_sName; + + // Parent of node (null means rootNode) + CCustomXMLNode * m_pParentNode; + + // Flag if Node has been invalidated (e.g. removed) + bool m_bHasBeenInvalidated; + + // Ordered list of Children + std::vector m_Children; + + // Child multi-map + std::map> m_ChildMap; + + // Attributes + std::vector m_Attributes; + std::map m_AttributeMap; + + // Throws an error if the node has been deleted (flagged invalidated) + void checkInvalidation(); + + // Invalidates the node and all of its children + void invalidateNodeAndAllChildren(); + + public: + CCustomXMLNode() = delete; + CCustomXMLNode(CCustomXMLNode* pParentNode, const std::string & sName); + + ~CCustomXMLNode(); + + std::string getName (); + + CCustomXMLNode* getParentNode(); + + std::vector getChildren (); + + std::vector findChildrenWithName (const std::string & sName); + + size_t getChildCount (); + + PCustomXMLNode getChildByIndex(const size_t nIndex); + + bool hasChild (const std::string & sName); + + bool hasUniqueChild(const std::string& sName); + + PCustomXMLNode addChild (const std::string & sName); + + PCustomXMLNode findUniqueChild (const std::string & sName, bool bMustExist); + + size_t removeChildrenWithName(const std::string& sName); + + void removeChild (CCustomXMLNode * pXMLNode); + + void remove(); + + size_t getAttributeCount(); + + PCustomXMLAttribute getAttributeByIndex(size_t nIndex); + + bool hasAttribute(const std::string& sName); + + PCustomXMLAttribute findAttribute(const std::string& sName, bool bMustExist); + + PCustomXMLAttribute addAttribute(const std::string& sName, const std::string& sValue); + + bool removeAttribute(const std::string& sName); + + bool removeAttributeByIndex(const uint64_t nIndex); + + void writeContentToXML (CXmlWriter * pXMLWriter); + }; + +} + +#endif // __NMR_CUSTOMXMLNODE diff --git a/Include/Model/Classes/NMR_CustomXMLTree.h b/Include/Model/Classes/NMR_CustomXMLTree.h new file mode 100644 index 000000000..f7ad4e44d --- /dev/null +++ b/Include/Model/Classes/NMR_CustomXMLTree.h @@ -0,0 +1,65 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#ifndef __NMR_CUSTOMXMLTREE +#define __NMR_CUSTOMXMLTREE + +#include "NMR_CustomXMLNode.h" + +namespace NMR { + + + class CCustomXMLTree { + private: + + std::string m_sNameSpace; + + PCustomXMLNode m_pRootNode; + + public: + CCustomXMLTree() = delete; + CCustomXMLTree(const std::string & sNameSpace, const std::string & sRootName); + + ~CCustomXMLTree(); + + std::string getNameSpace (); + std::string getRootName (); + + PCustomXMLNode getRootNode (); + + std::string saveToString(); + + }; + + + typedef std::shared_ptr PCustomXMLTree; + +} + +#endif // __NMR_CUSTOMXMLTREE diff --git a/Include/Model/Classes/NMR_Model.h b/Include/Model/Classes/NMR_Model.h index ebb114608..a0713bbfd 100644 --- a/Include/Model/Classes/NMR_Model.h +++ b/Include/Model/Classes/NMR_Model.h @@ -40,6 +40,7 @@ NMR_Model.h defines the Model Class. A model is an in memory representation of t #include "Common/Mesh/NMR_Mesh.h" #include "Model/Classes/NMR_PackageResourceID.h" +#include "Model/Reader/NMR_ModelPersistentDataSource.h" #include #include @@ -109,6 +110,10 @@ namespace NMR { std::map m_ResourceMap; CResourceHandler m_resourceHandler; private: + + // Persistent source of model + PModelPersistentDataSource m_pPersistentDataSource; + std::vector m_Resources; // Model Build Items @@ -318,6 +323,10 @@ namespace NMR { // Sorts objects by correct dependency std::list getSortedObjectList (); + // Persistent data source support + PImportStream readPathFromPersistentDataSource(_In_ std::string sPath); + void setPersistentDataSource(PModelPersistentDataSource pPersistentDataSource); + void releasePersistentDataSource(); // Gets the KeyStore PKeyStore getKeyStore(); diff --git a/Include/Model/Classes/NMR_ModelConstants.h b/Include/Model/Classes/NMR_ModelConstants.h index 21191891b..2b94fe590 100644 --- a/Include/Model/Classes/NMR_ModelConstants.h +++ b/Include/Model/Classes/NMR_ModelConstants.h @@ -72,6 +72,10 @@ These are given by the 3MF Standard #define PACKAGE_MUST_PRESERVE_RELATIONSHIP_TYPE "http://schemas.openxmlformats.org/package/2006/relationships/mustpreserve" #define PACKAGE_KEYSTORE_RELATIONSHIP_TYPE "http://schemas.microsoft.com/3dmanufacturing/2019/04/keystore" #define PACKAGE_ENCRYPTED_FILE_RELATIONSHIP "http://schemas.openxmlformats.org/package/2006/relationships/encryptedfile" +#define PACKAGE_TOOLPATH_RELATIONSHIP_TYPE "http://schemas.microsoft.com/3dmanufacturing/2019/05/toolpath" +#define PACKAGE_BINARY_RELATIONSHIP_TYPE "http://schemas.microsoft.com/3dmanufacturing/2019/05/binary" +#define PACKAGE_BINARYINDEX_RELATIONSHIP_TYPE "http://schemas.microsoft.com/3dmanufacturing/2019/05/binaryindex" + #define XML_3MF_NAMESPACE_XML "http://www.w3.org/XML/1998/namespace" #define XML_3MF_NAMESPACE_XMLNS "http://www.w3.org/2000/xmlns/" @@ -84,12 +88,16 @@ These are given by the 3MF Standard #define XML_3MF_NAMESPACE_SECURECONTENTSPEC "http://schemas.microsoft.com/3dmanufacturing/securecontent/2019/04" #define XML_3MF_NAMESPACE_DIGITALSIGNATURESPEC "http://www.w3.org/2000/09/xmldsig#" #define XML_3MF_NAMESPACE_CIPHERVALUESPEC "http://www.w3.org/2001/04/xmlenc#" +#define XML_3MF_NAMESPACE_TOOLPATHSPEC "http://schemas.microsoft.com/3dmanufacturing/toolpath/2019/05" +#define XML_3MF_NAMESPACE_BINARYSPEC "http://schemas.microsoft.com/3dmanufacturing/binary/2023/05" #define XML_3MF_NAMESPACEPREFIX_MATERIAL "m" #define XML_3MF_NAMESPACEPREFIX_PRODUCTION "p" #define XML_3MF_NAMESPACEPREFIX_BEAMLATTICE "b" #define XML_3MF_NAMESPACEPREFIX_SLICE "s" #define XML_3MF_NAMESPACEPREFIX_SECURECONTENT "sc" +#define XML_3MF_NAMESPACEPREFIX_TOOLPATH "t" +#define XML_3MF_NAMESPACEPREFIX_BINARY "bin" #define XML_3MF_ATTRIBUTE_XMLNS "xmlns" #define XML_3MF_ATTRIBUTE_PREFIX_XML "xml" @@ -122,6 +130,9 @@ These are given by the 3MF Standard #define XML_3MF_ELEMENT_SLICES "slices" #define XML_3MF_ATTRIBUTE_SLICES_SLICEHEIGHT "sliceheight" +// Layer element +#define XML_3MF_ELEMENT_LAYER "layer" + // Components element. #define XML_3MF_ELEMENT_COMPONENTS "components" @@ -159,6 +170,7 @@ These are given by the 3MF Standard #define XML_3MF_ATTRIBUTE_TRIANGLE_P1 "p1" #define XML_3MF_ATTRIBUTE_TRIANGLE_P2 "p2" #define XML_3MF_ATTRIBUTE_TRIANGLE_P3 "p3" +#define XML_3MF_ATTRIBUTE_MESH_BINARY "binary" #define XML_3MF_ATTRIBUTE_BEAMLATTICE_V1 "v1" #define XML_3MF_ATTRIBUTE_BEAMLATTICE_V2 "v2" #define XML_3MF_ATTRIBUTE_BEAMLATTICE_NAME "name" @@ -356,6 +368,55 @@ These are given by the 3MF Standard #define XML_3MF_BEAMLATTICE_BALLMODE_MIXED "mixed" #define XML_3MF_BEAMLATTICE_BALLMODE_ALL "all" +// Toolpath +#define XML_3MF_ELEMENT_TOOLPATHRESOURCE "toolpathresource" +#define XML_3MF_ELEMENT_TOOLPATHPROFILES "toolpathprofiles" +#define XML_3MF_ELEMENT_TOOLPATHPROFILE "toolpathprofile" +#define XML_3MF_ELEMENT_TOOLPATHLAYERS "toolpathlayers" +#define XML_3MF_ELEMENT_TOOLPATHLAYER "toolpathlayer" +#define XML_3MF_ELEMENT_TOOLPATHDATA "toolpathdata" + +#define XML_3MF_ATTRIBUTE_TOOLPATH_ID "id" +#define XML_3MF_ATTRIBUTE_TOOLPATH_UNITFACTOR "unitfactor" + +#define XML_3MF_ATTRIBUTE_TOOLPATHPROFILE_UUID "uuid" +#define XML_3MF_ATTRIBUTE_TOOLPATHPROFILE_NAME "name" +#define XML_3MF_ATTRIBUTE_TOOLPATHPROFILE_LASERPOWER "laserpower" +#define XML_3MF_ATTRIBUTE_TOOLPATHPROFILE_LASERSPEED "laserspeed" +#define XML_3MF_ATTRIBUTE_TOOLPATHPROFILE_LASERFOCUS "laserfocus" +#define XML_3MF_ATTRIBUTE_TOOLPATHPROFILE_LASERINDEX "laserindex" +#define XML_3MF_ATTRIBUTE_TOOLPATHLAYER_ZTOP "ztop" +#define XML_3MF_ATTRIBUTE_TOOLPATHLAYER_PATH "path" + +#define XML_3MF_TOOLPATHELEMENT_LAYER "layer" +#define XML_3MF_TOOLPATHELEMENT_PARTS "parts" +#define XML_3MF_TOOLPATHELEMENT_PART "part" +#define XML_3MF_TOOLPATHELEMENT_PROFILES "profiles" +#define XML_3MF_TOOLPATHELEMENT_PROFILE "profile" +#define XML_3MF_TOOLPATHELEMENT_SEGMENTS "segments" +#define XML_3MF_TOOLPATHELEMENT_SEGMENT "segment" +#define XML_3MF_TOOLPATHELEMENT_DATA "data" +#define XML_3MF_TOOLPATHELEMENT_HATCH "hatch" +#define XML_3MF_TOOLPATHELEMENT_POINT "point" +#define XML_3MF_TOOLPATHATTRIBUTE_ID "id" +#define XML_3MF_TOOLPATHATTRIBUTE_UUID "uuid" +#define XML_3MF_TOOLPATHATTRIBUTE_TYPE "type" +#define XML_3MF_TOOLPATHATTRIBUTE_BINARY "binary" +#define XML_3MF_TOOLPATHATTRIBUTE_PARTID "partid" +#define XML_3MF_TOOLPATHATTRIBUTE_PROFILEID "profileid" +#define XML_3MF_TOOLPATHATTRIBUTE_X "x" +#define XML_3MF_TOOLPATHATTRIBUTE_Y "y" +#define XML_3MF_TOOLPATHATTRIBUTE_X1 "x1" +#define XML_3MF_TOOLPATHATTRIBUTE_Y1 "y1" +#define XML_3MF_TOOLPATHATTRIBUTE_X2 "x2" +#define XML_3MF_TOOLPATHATTRIBUTE_Y2 "y2" + +#define XML_3MF_TOOLPATHTYPE_HATCH "hatch" +#define XML_3MF_TOOLPATHTYPE_LOOP "loop" +#define XML_3MF_TOOLPATHTYPE_POLYLINE "polyline" +#define XML_3MF_TOOLPATHTYPE_SYNC "sync" +#define XML_3MF_TOOLPATHTYPE_DELAY "delay" + // KeyStore element. #define XML_3MF_ELEMENT_KEYSTORE "keystore" #define XML_3MF_ELEMENT_CONSUMER "consumer" diff --git a/Include/Model/Classes/NMR_ModelContext.h b/Include/Model/Classes/NMR_ModelContext.h index 4e584c50c..7122fc9f0 100644 --- a/Include/Model/Classes/NMR_ModelContext.h +++ b/Include/Model/Classes/NMR_ModelContext.h @@ -64,7 +64,7 @@ namespace NMR { public: CModelContext() = delete; CModelContext(_In_ PModel pModel); - virtual ~CModelContext() = default; + virtual ~CModelContext(); inline PModel const & model() const{ return m_pModel; @@ -89,6 +89,8 @@ namespace NMR { void SetProgressCallback(Lib3MFProgressCallback callback, void* userData); }; + + typedef std::shared_ptr PModelContext; } #endif // !NMR_MODELCONTEXT diff --git a/Include/Model/Classes/NMR_ModelToolpath.h b/Include/Model/Classes/NMR_ModelToolpath.h new file mode 100644 index 000000000..e5380303b --- /dev/null +++ b/Include/Model/Classes/NMR_ModelToolpath.h @@ -0,0 +1,98 @@ +/*++ + +Copyright (C) 2018 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +NMR_ModelToolpath.h defines the Model Toolpath. + +--*/ + +#ifndef __NMR_MODELTOOLPATH +#define __NMR_MODELTOOLPATH + +#include "Common/NMR_Types.h" + + +#include "Model/Classes/NMR_ModelResource.h" +#include "Model/Classes/NMR_ModelToolpathLayer.h" +#include "Model/Classes/NMR_CustomXMLTree.h" +#include "Model/Classes/NMR_ModelToolpathProfile.h" +#include "Model/Classes/NMR_Model.h" +#include +#include "Common/Platform/NMR_ImportStream.h" +#include +#include +#include + +namespace NMR { + + class CModel; + typedef std::shared_ptr PModel; + + class CModelToolpath; + typedef std::shared_ptr PModelToolpath; + + class CModelToolpath : public CModelResource { + private: + double m_dUnitFactor; + std::vector m_Layers; + std::vector m_Profiles; + std::map m_ProfileMap; + + std::vector m_CustomXMLData; + + public: + CModelToolpath() = delete; + CModelToolpath(_In_ const ModelResourceID sID, _In_ CModel * pModel, double dUnitFactor); + + static PModelToolpath make(_In_ const ModelResourceID sID, _In_ CModel * pModel, double dUnitFactor); + + PModelToolpathLayer addLayer (const std::string & sPath, nfUint32 nMaxZ); + nfUint32 getLayerCount(); + PModelToolpathLayer getLayer(nfUint32 nIndex); + + PModelToolpathProfile addProfile(const std::string & sName); + PModelToolpathProfile addExistingProfile(const std::string & sUUID, const std::string & sName); + + nfUint32 getProfileCount(); + PModelToolpathProfile getProfile(nfUint32 nIndex); + PModelToolpathProfile getProfileByUUID(std::string sUUID); + + double getUnitFactor (); + + uint32_t getCustomXMLDataCount(); + PCustomXMLTree getCustomXMLData(uint32_t nIndex); + void addCustomXMLData(PCustomXMLTree pCustomXMLTree); + uint32_t clearCustomXMLData(); + bool deleteCustomXMLData(CCustomXMLTree * pCustomXMLTree); + + }; + + +} + +#endif // __NMR_MODELTOOLPATH + diff --git a/Include/Model/Classes/NMR_ModelToolpathLayer.h b/Include/Model/Classes/NMR_ModelToolpathLayer.h new file mode 100644 index 000000000..50df5bc52 --- /dev/null +++ b/Include/Model/Classes/NMR_ModelToolpathLayer.h @@ -0,0 +1,66 @@ +/*++ + +Copyright (C) 2018 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +NMR_ModelToolpathLayer.h defines the Model Toolpath Layer. + +--*/ + +#ifndef __NMR_MODELTOOLPATHLAYER +#define __NMR_MODELTOOLPATHLAYER + +#include "Common/NMR_Types.h" +#include "Model/Classes/NMR_ModelAttachment.h" + + +#include +#include +#include +#include + +namespace NMR { + + class CModelToolpathLayer { + private: + std::string m_sLayerDataPath; + nfUint32 m_nMaxZ; + + public: + CModelToolpathLayer() = delete; + CModelToolpathLayer(std::string sLayerDataPath, nfUint32 nMaxZ); + + nfUint32 getMaxZ(); + + std::string getLayerDataPath(); + }; + + typedef std::shared_ptr PModelToolpathLayer; + +} + +#endif // __NMR_MODELTOOLPATHLAYER + diff --git a/Include/Model/Classes/NMR_ModelToolpathLayerReadData.h b/Include/Model/Classes/NMR_ModelToolpathLayerReadData.h new file mode 100644 index 000000000..fd20ca677 --- /dev/null +++ b/Include/Model/Classes/NMR_ModelToolpathLayerReadData.h @@ -0,0 +1,146 @@ +/*++ + +Copyright (C) 2018 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +NMR_ModelToolpath.h defines the Model Toolpath Layer Data. + +--*/ + +#ifndef __NMR_MODELTOOLPATHLAYERREADDATA +#define __NMR_MODELTOOLPATHLAYERREADDATA + +#include "Common/NMR_Types.h" +#include "Common/NMR_PagedVector.h" + +#include "Model/Classes/NMR_ModelToolpath.h" +#include "Model/Classes/NMR_CustomXMLTree.h" +#include "Model/Writer/NMR_ModelWriter.h" +#include "Model/Writer/NMR_ModelWriter_3MF.h" + +#include +#include "Common/Platform/NMR_ImportStream.h" +#include +#include +#include + +#define TOOLPATHSEGMENTATTRIBUTEPAGESIZE 65536 + +namespace NMR { + + class CModelToolpath; + typedef std::shared_ptr PModelToolpath; + + enum class eModelToolpathSegmentType : nfUint32 { + HatchSegment = 0, + LoopSegment = 1, + PolylineSegment = 2 + }; + + enum class eModelToolpathSegmentAttributeType : nfUint32 { + Unknown = 0, + SegmentAttributeInt64 = 1, + SegmentAttributeDouble = 2, + }; + + typedef struct { + eModelToolpathSegmentType m_eType; + nfUint32 m_nProfileID; + nfUint32 m_nPartID; + nfUint32 m_nStartPoint; + nfUint32 m_nPointCount; + nfInt64* m_pAttributeData; + } TOOLPATHREADSEGMENT; + + typedef std::vector CToolpathLayerAttributePage; + + class CModelToolpathLayerReadData { + private: + std::string m_sUUID; + + PModelToolpath m_pModelToolpath; + + CPagedVector m_Segments; + std::vector>> m_SegmentAttributeDefinitions; + std::map, std::pair> m_SegmentAttributeMap; + std::vector m_AttributesOfNextSegment; + + std::vector m_AttributeBuffer; + CToolpathLayerAttributePage * m_pCurrentAttributePage; + size_t m_nCurrentPositionOnPage; + + int64_t* allocAttributeBuffer(uint32_t nEntryCount); + + CPagedVector m_Points; + TOOLPATHREADSEGMENT * m_pCurrentSegment; + + std::map m_UUIDMap; + + std::vector m_CustomXMLData; + + public: + CModelToolpathLayerReadData() = delete; + CModelToolpathLayerReadData(_In_ PModelToolpath pModelToolpath); + + ~CModelToolpathLayerReadData(); + + std::string getUUID(); + + void beginSegment(eModelToolpathSegmentType eType, nfUint32 nProfileID, nfUint32 nPartID); + void endSegment(); + void addPoint (nfFloat fX, nfFloat fY); + + nfUint32 getSegmentCount(); + void getSegmentInfo (nfUint32 nSegmentIndex, eModelToolpathSegmentType & eType, nfUint32 & nProfileID, nfUint32 & nPartID, nfUint32 & nPointCount); + NVEC2 getSegmentPoint (nfUint32 nSegmentIndex, nfUint32 nPointIndex); + + void registerUUID (nfUint32 nID, std::string sUUID); + std::string mapIDtoUUID(nfUint32 nID); + + uint32_t getCustomXMLDataCount(); + PCustomXMLTree getCustomXMLData(uint32_t nIndex); + void addCustomXMLData(PCustomXMLTree pCustomXMLTree); + + uint32_t registerCustomSegmentAttribute (const std::string& sNameSpace, const std::string& sAttributeName, eModelToolpathSegmentAttributeType eSegmentType); + + void clearSegmentAttributes (); + void storeSegmentAttribute (const std::string & sNameSpace, const std::string & sAttributeName, const std::string & sAttributeValue); + int64_t getSegmentIntegerAttribute(nfUint32 nSegmentIndex, uint32_t nAttributeID); + double getSegmentDoubleAttribute(nfUint32 nSegmentIndex, uint32_t nAttributeID); + std::pair findAttribute(const std::string& sNameSpace, const std::string& sAttributeName, bool bMustExist); + + + + }; + + typedef std::shared_ptr PModelToolpathLayerReadData; + + + +} + +#endif // __NMR_MODELTOOLPATHLAYERREADDATA + diff --git a/Include/Model/Classes/NMR_ModelToolpathLayerWriteData.h b/Include/Model/Classes/NMR_ModelToolpathLayerWriteData.h new file mode 100644 index 000000000..08773a644 --- /dev/null +++ b/Include/Model/Classes/NMR_ModelToolpathLayerWriteData.h @@ -0,0 +1,132 @@ +/*++ + +Copyright (C) 2018 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +NMR_ModelToolpath.h defines the Model Toolpath Layer Data. + +--*/ + +#ifndef __NMR_MODELTOOLPATHLAYERWRITEDATA +#define __NMR_MODELTOOLPATHLAYERWRITEDATA + +#include "Common/NMR_Types.h" + +#include "Model/Classes/NMR_ModelToolpath.h" +#include "Model/Writer/NMR_ModelWriter.h" +#include "Model/Writer/NMR_ModelWriter_3MF.h" + +#include "Common/Platform/NMR_XmlWriter.h" +#include "Common/Platform/NMR_ExportStream_Memory.h" + +#include +#include "Common/Platform/NMR_ImportStream.h" +#include +#include +#include + +#include "Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamWriter.h" + +namespace NMR { + + class CModelToolpath; + typedef std::shared_ptr PModelToolpath; + + class CModelToolpathLayerWriteData { + private: + std::string m_sUUID; + std::string m_sPackagePath; + + CModelToolpath * m_pModelToolpath; + + NMR::PModelWriter_3MF m_pModelWriter; + + NMR::PXmlWriter m_pXmlWriter; + NMR::PExportStreamMemory m_pExportStream; + + std::map m_Profiles; + std::map m_Parts; + + bool m_bWritingHeader; + bool m_bWritingData; + bool m_bWritingFinished; + unsigned int m_nIDCounter; + + std::vector m_CustomXMLData; + std::map, std::string> m_CustomSegmentAttributes; + std::map m_NameSpaceToPrefixMap; + std::map m_PrefixToNameSpaceMap; + + double m_dUnits; + + NMR::CChunkedBinaryStreamWriter * getStreamWriter(std::string & sPath); + + NMR::PImportStream createStream(); + + void writeCustomXMLDataNode(PCustomXMLNode pXMLNode, const std::string & sNameSpace); + + std::string findNameSpacePrefix(const std::string& sNameSpace); + + public: + CModelToolpathLayerWriteData() = delete; + CModelToolpathLayerWriteData(CModelToolpath * pModelToolpath, NMR::PModelWriter_3MF pModelWriter, const std::string & sPackagePath, std::map PrefixToNameSpaceMap); + + ~CModelToolpathLayerWriteData(); + + void addCustomXMLData (PCustomXMLTree pXMLTree); + + nfUint32 RegisterProfile(PModelToolpathProfile pProfile); + + nfUint32 RegisterPart(PModelBuildItem pBuildItem); + + void WriteHatchData(const nfUint32 nProfileID, const nfUint32 nPartID, const nfUint32 nHatchCount, const nfInt32 * pX1Buffer, const nfInt32 * pY1Buffer, const nfInt32 * pX2Buffer, const nfInt32 * pY2Buffer); + + void WriteLoop(const nfUint32 nProfileID, const nfUint32 nPartID, const nfUint32 nPointCount, const nfInt32 * pXBuffer, const nfInt32 * pYBuffer); + + void WritePolyline(const nfUint32 nProfileID, const nfUint32 nPartID, const nfUint32 nPointCount, const nfInt32 * pXBuffer, const nfInt32 * pYBuffer); + + void finishHeader(); + + double getUnits(); + + std::string getUUID(); + + void finishWriting(); + + void setCustomSegmentAttribute(const std::string& sNameSpace, const std::string& sAttributeName, const std::string& sValue); + + void clearCustomSegmentAttributes(); + + + + }; + + typedef std::shared_ptr PModelToolpathLayerWriteData; + +} + +#endif // __NMR_MODELTOOLPATHLAYERWRITEDATA + diff --git a/Include/Model/Classes/NMR_ModelToolpathProfile.h b/Include/Model/Classes/NMR_ModelToolpathProfile.h new file mode 100644 index 000000000..408c398a3 --- /dev/null +++ b/Include/Model/Classes/NMR_ModelToolpathProfile.h @@ -0,0 +1,87 @@ +/*++ + +Copyright (C) 2018 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +NMR_ModelToolpathProfile.h defines the Model Toolpath Profile. + +--*/ + +#ifndef __NMR_MODELTOOLPATHPROFILE +#define __NMR_MODELTOOLPATHPROFILE + +#include "Common/NMR_Types.h" + +#define MODELTOOLPATH_MAXCOUNT (1024 * 1024) + +#include +#include +#include +#include +#include + +namespace NMR { + + struct sModelToolpathProfileValue { + std::string m_sNameSpace; + std::string m_sValueName; + std::string m_sValue; + }; + + class CModelToolpathProfile { + private: + std::string m_sUUID; + std::string m_sName; + + std::vector> m_Parameters; + std::map, std::string> m_Values; + + public: + CModelToolpathProfile() = delete; + CModelToolpathProfile(std::string sUUID, std::string sName); + + std::string getUUID(); + std::string getName(); + void setName (const std::string & sName); + + bool hasValue (const std::string & sNameSpace, const std::string & sValueName); + std::string getValue(const std::string& sNameSpace, const std::string& sValueName); + void addValue(const std::string& sNameSpace, const std::string& sValueName, const std::string & sValue); + + uint32_t getParameterCount(); + std::string getParameterName(const uint32_t nIndex); + std::string getParameterNameSpace(const uint32_t nIndex); + + std::list listValues(); + + }; + + typedef std::shared_ptr PModelToolpathProfile; + +} + +#endif // __NMR_MODELTOOLPATHPROFILE + diff --git a/Include/Model/Reader/NMR_KeyStoreOpcPackageReader.h b/Include/Model/Reader/NMR_KeyStoreOpcPackageReader.h index 41f7d3491..5d520acd8 100644 --- a/Include/Model/Reader/NMR_KeyStoreOpcPackageReader.h +++ b/Include/Model/Reader/NMR_KeyStoreOpcPackageReader.h @@ -65,6 +65,8 @@ namespace NMR { virtual COpcPackageRelationship * findRootRelation(std::string sRelationType, nfBool bMustBeUnique) override; virtual POpcPackagePart createPart(std::string sPath) override; virtual nfUint64 getPartSize(std::string sPath) override; + + PImportStream readPartStreamIntoMemory(_In_ std::string sPath) override; void close() override; }; diff --git a/Include/Model/Reader/NMR_ModelPersistentDataSource.h b/Include/Model/Reader/NMR_ModelPersistentDataSource.h new file mode 100644 index 000000000..f04b91cbe --- /dev/null +++ b/Include/Model/Reader/NMR_ModelPersistentDataSource.h @@ -0,0 +1,69 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--*/ + +#ifndef __NMR_MODELPERSISTENTDATASOURCE +#define __NMR_MODELPERSISTENTDATASOURCE + +#include "Model/Classes/NMR_ModelContext.h" +#include "Common/NMR_ModelWarnings.h" +#include "Common/Platform/NMR_ImportStream.h" +#include "Common/OPC/NMR_IOpcPackageReader.h" + +#include +#include + +namespace NMR { + + class CModelPersistentDataSource { + protected: + + PImportStream m_pImportStream; + PIOpcPackageReader m_pPackageReader; + + public: + CModelPersistentDataSource() = delete; + CModelPersistentDataSource(PImportStream pImportStream); + virtual ~CModelPersistentDataSource(); + + PImportStream getImportStream(); + PIOpcPackageReader getOpcPackageReader(); + + void setOPCPackageReader(PIOpcPackageReader pPackageReader); + void releaseOPCPackageReader(); + + + + bool isValid(); + void invalidateSource(); + }; + + typedef std::shared_ptr PModelPersistentDataSource; + +} + +#endif // __NMR_MODELPERSISTENTDATASOURCE diff --git a/Include/Model/Reader/NMR_ModelReader.h b/Include/Model/Reader/NMR_ModelReader.h index 5f0b95ba1..8eb8712c8 100644 --- a/Include/Model/Reader/NMR_ModelReader.h +++ b/Include/Model/Reader/NMR_ModelReader.h @@ -38,6 +38,8 @@ A model reader reads in a model file and generates an in-memory representation o #include "Common/NMR_ModelWarnings.h" #include "Common/MeshImport/NMR_MeshImporter.h" +#include "Model/Reader/NMR_ModelPersistentDataSource.h" + #include #include @@ -56,7 +58,7 @@ namespace NMR { CModelReader(_In_ PModel pModel); virtual ~CModelReader() = default; - virtual void readStream(_In_ PImportStream pStream) = 0; + virtual void readFromSource(_In_ PModelPersistentDataSource pDataSource) = 0; PImportStream retrievePrintTicket(_Out_ std::string & sContentType); void addRelationToRead(_In_ std::string sRelationShipType); diff --git a/Include/Model/Reader/NMR_ModelReader_3MF.h b/Include/Model/Reader/NMR_ModelReader_3MF.h index dc799de9f..3a22c6b88 100644 --- a/Include/Model/Reader/NMR_ModelReader_3MF.h +++ b/Include/Model/Reader/NMR_ModelReader_3MF.h @@ -35,6 +35,7 @@ NMR_ModelReader_3MF.h defines the Model Reader Class for #define __NMR_MODELREADER_3MF #include "Model/Reader/NMR_ModelReader.h" +#include "Model/Reader/NMR_ModelPersistentDataSource.h" #include "Common/NMR_SecureContentTypes.h" #include #include @@ -43,14 +44,14 @@ namespace NMR { class CModelReader_3MF : public CModelReader { protected: - virtual PImportStream extract3MFOPCPackage(_In_ PImportStream pPackageStream) = 0; + virtual PImportStream extract3MFOPCPackage(PModelPersistentDataSource pDataSource) = 0; virtual void release3MFOPCPackage() = 0; public: CModelReader_3MF() = delete; CModelReader_3MF(_In_ PModel pModel); - virtual void readStream(_In_ PImportStream pStream); + virtual void readFromSource(_In_ PModelPersistentDataSource pDataSource) override; virtual void addTextureAttachment(_In_ std::string sPath, _In_ PImportStream pStream); }; diff --git a/Include/Model/Reader/NMR_ModelReader_3MF_Native.h b/Include/Model/Reader/NMR_ModelReader_3MF_Native.h index c7c26fa63..aa4e25192 100644 --- a/Include/Model/Reader/NMR_ModelReader_3MF_Native.h +++ b/Include/Model/Reader/NMR_ModelReader_3MF_Native.h @@ -39,15 +39,17 @@ It uses libzip and irrxml to parse the OPC package. #include "Model/Reader/NMR_ModelReader.h" #include "Model/Classes/NMR_Model.h" #include "Common/Platform/NMR_XmlReader.h" +#include "Common/OPC/NMR_IOpcPackageReader.h" #include "Model/Reader/NMR_KeyStoreOpcPackageReader.h" #include "Common/OPC/NMR_OpcPackagePart.h" +#include "Model/Reader/NMR_ModelPersistentDataSource.h" #include namespace NMR { class CModelReader_3MF_Native : public CModelReader_3MF { private: - PKeyStoreOpcPackageReader m_pPackageReader; + PModelPersistentDataSource m_pDataSource; protected: void extractCustomDataFromRelationships(_In_ std::string& sTargetPartURIDir, _In_ COpcPackagePart * pModelPart); @@ -55,7 +57,7 @@ namespace NMR { void extractModelDataFromRelationships(_In_ std::string& sTargetPartURIDir, _In_ COpcPackagePart * pModelPart); void checkContentTypes(); - virtual PImportStream extract3MFOPCPackage(_In_ PImportStream pPackageStream); + virtual PImportStream extract3MFOPCPackage(PModelPersistentDataSource pDataSource); virtual void release3MFOPCPackage(); public: diff --git a/Include/Model/Reader/NMR_ModelReader_STL.h b/Include/Model/Reader/NMR_ModelReader_STL.h index 43baf7fc9..a1a327c6f 100644 --- a/Include/Model/Reader/NMR_ModelReader_STL.h +++ b/Include/Model/Reader/NMR_ModelReader_STL.h @@ -48,7 +48,7 @@ namespace NMR { CModelReader_STL() = delete; CModelReader_STL(_In_ PModel pModel); - virtual void readStream(_In_ PImportStream pStream); + virtual void readFromSource(_In_ PModelPersistentDataSource pDataSource) override; }; typedef std::shared_ptr PModelReader_STL; diff --git a/Include/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathData.h b/Include/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathData.h new file mode 100644 index 000000000..ff625caa3 --- /dev/null +++ b/Include/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathData.h @@ -0,0 +1,63 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#ifndef __NMR_MODELREADERNODE_TOOLPATH1905_TOOLPATHDATA +#define __NMR_MODELREADERNODE_TOOLPATH1905_TOOLPATHDATA + +#include "Model/Reader/NMR_ModelReaderNode.h" +#include "Model/Classes/NMR_ModelToolpath.h" + +namespace NMR { + + class CModelReaderNode_Toolpath1905_ToolpathData : public CModelReaderNode { + private: + CModel * m_pModel; + PModelWarnings m_pWarnings; + CModelToolpath * m_pToolpath; + + protected: + virtual void OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue); + virtual void OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace); + virtual void OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader); + public: + CModelReaderNode_Toolpath1905_ToolpathData() = delete; + CModelReaderNode_Toolpath1905_ToolpathData(_In_ CModel * pModel, _In_ CModelToolpath * pToolpath, _In_ PModelWarnings pWarnings); + + virtual void parseXML(_In_ CXmlReader * pXMLReader); + + + }; + + typedef std::shared_ptr PModelReaderNode_Toolpath1905_ToolpathData; + +} + +#endif // __NMR_MODELREADERNODE_TOOLPATH1905_TOOLPATHDATA + + diff --git a/Include/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathDataNode.h b/Include/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathDataNode.h new file mode 100644 index 000000000..c2296fdb1 --- /dev/null +++ b/Include/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathDataNode.h @@ -0,0 +1,66 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--*/ + +#ifndef __NMR_MODELREADERNODE_TOOLPATH1905_TOOLPATHDATANODE +#define __NMR_MODELREADERNODE_TOOLPATH1905_TOOLPATHDATANODE + +#include "Model/Reader/NMR_ModelReaderNode.h" +#include "Model/Classes/NMR_ModelToolpath.h" +#include "Model/Classes/NMR_CustomXMLTree.h" + +namespace NMR { + + class CModelReaderNode_Toolpath1905_ToolpathDataNode : public CModelReaderNode { + private: + CModel * m_pModel; + PModelWarnings m_pWarnings; + CModelToolpath * m_pToolpath; + + PCustomXMLNode m_pXMLNode; + std::string m_sNameSpace; + + protected: + virtual void OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue); + virtual void OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace); + virtual void OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader); + public: + CModelReaderNode_Toolpath1905_ToolpathDataNode() = delete; + CModelReaderNode_Toolpath1905_ToolpathDataNode(_In_ CModel * pModel, _In_ CModelToolpath * pToolpath, _In_ PModelWarnings pWarnings, const std::string& sNameSpace, PCustomXMLNode pXMLNode); + + virtual void parseXML(_In_ CXmlReader * pXMLReader); + + + }; + + typedef std::shared_ptr PModelReaderNode_Toolpath1905_ToolpathDataNode; + +} + +#endif // __NMR_MODELREADERNODE_TOOLPATH1905_TOOLPATHDATANODE + + diff --git a/Include/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathLayer.h b/Include/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathLayer.h new file mode 100644 index 000000000..1565f5f4e --- /dev/null +++ b/Include/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathLayer.h @@ -0,0 +1,76 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: +NMR_ModelReaderNode_Toolpath1905_ToolpathLayer.h covers the official 3MF Toolpath extension. + + +--*/ + +#ifndef __NMR_MODELREADERNODE_TOOLPATH1905_TOOLPATHLAYER +#define __NMR_MODELREADERNODE_TOOLPATH1905_TOOLPATHLAYER + +#include "Model/Reader/NMR_ModelReaderNode.h" +#include "Model/Classes/NMR_ModelComponent.h" +#include "Model/Classes/NMR_ModelComponentsObject.h" +#include "Model/Classes/NMR_ModelObject.h" +#include "Model/Classes/NMR_ModelToolpath.h" + +namespace NMR { + + class CModelReaderNode_Toolpath1905_ToolpathLayer : public CModelReaderNode { + private: + CModel * m_pModel; + PModelWarnings m_pWarnings; + + nfBool m_bHasPath; + std::string m_sPath; + + nfBool m_bHasZTop; + nfInt32 m_nZTop; + + protected: + virtual void OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue); + virtual void OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace); + virtual void OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader); + public: + CModelReaderNode_Toolpath1905_ToolpathLayer() = delete; + CModelReaderNode_Toolpath1905_ToolpathLayer(_In_ CModel * pModel, _In_ PModelWarnings pWarnings); + + virtual void parseXML(_In_ CXmlReader * pXMLReader); + + void createLayer(CModelToolpath * pToolpath); + + + }; + + typedef std::shared_ptr PModelReaderNode_Toolpath1905_ToolpathLayer; + +} + +#endif // __NMR_MODELREADERNODE_TOOLPATH1905_TOOLPATHLAYER + + diff --git a/Include/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathLayers.h b/Include/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathLayers.h new file mode 100644 index 000000000..742d5d487 --- /dev/null +++ b/Include/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathLayers.h @@ -0,0 +1,68 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: +NMR_ModelReaderNode_Toolpath1905_ToolpathLayers.h covers the official 3MF Toolpath extension. + + +--*/ + +#ifndef __NMR_MODELREADERNODE_TOOLPATH1905_TOOLPATHLAYERS +#define __NMR_MODELREADERNODE_TOOLPATH1905_TOOLPATHLAYERS + +#include "Model/Reader/NMR_ModelReaderNode.h" +#include "Model/Classes/NMR_ModelComponent.h" +#include "Model/Classes/NMR_ModelComponentsObject.h" +#include "Model/Classes/NMR_ModelObject.h" +#include "Model/Classes/NMR_ModelToolpath.h" + +namespace NMR { + + class CModelReaderNode_Toolpath1905_ToolpathLayers : public CModelReaderNode { + private: + CModel * m_pModel; + CModelToolpath * m_pToolpath; + PModelWarnings m_pWarnings; + + protected: + virtual void OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue); + virtual void OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace); + virtual void OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader); + public: + CModelReaderNode_Toolpath1905_ToolpathLayers() = delete; + CModelReaderNode_Toolpath1905_ToolpathLayers(_In_ CModel * pModel, _In_ CModelToolpath * pToolpath, _In_ PModelWarnings pWarnings); + + virtual void parseXML(_In_ CXmlReader * pXMLReader); + + }; + + typedef std::shared_ptr PModelReaderNode_Toolpath1905_ToolpathLayers; + +} + +#endif // __NMR_MODELREADERNODE_TOOLPATH1905_TOOLPATHLAYERS + + diff --git a/Include/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathProfile.h b/Include/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathProfile.h new file mode 100644 index 000000000..8488eda3d --- /dev/null +++ b/Include/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathProfile.h @@ -0,0 +1,77 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: +NMR_ModelReaderNode_Toolpath1905_ToolpathProfile.h covers the official 3MF Toolpath extension. + + +--*/ + +#ifndef __NMR_MODELREADERNODE_TOOLPATH1905_TOOLPATHPROFILE +#define __NMR_MODELREADERNODE_TOOLPATH1905_TOOLPATHPROFILE + +#include "Model/Reader/NMR_ModelReaderNode.h" +#include "Model/Classes/NMR_ModelComponent.h" +#include "Model/Classes/NMR_ModelComponentsObject.h" +#include "Model/Classes/NMR_ModelObject.h" +#include "Model/Classes/NMR_ModelToolpath.h" + +namespace NMR { + + class CModelReaderNode_Toolpath1905_ToolpathProfile : public CModelReaderNode { + private: + CModel * m_pModel; + PModelWarnings m_pWarnings; + + nfBool m_bHasUUID; + std::string m_sUUID; + + nfBool m_bHasName; + std::string m_sName; + + std::map , std::string> m_Parameters; + + protected: + virtual void OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue); + virtual void OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace); + virtual void OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader); + public: + CModelReaderNode_Toolpath1905_ToolpathProfile() = delete; + CModelReaderNode_Toolpath1905_ToolpathProfile(_In_ CModel * pModel, _In_ PModelWarnings pWarnings); + + virtual void parseXML(_In_ CXmlReader * pXMLReader); + + void createProfile(CModelToolpath * pToolpath); + + }; + + typedef std::shared_ptr PModelReaderNode_Toolpath1905_ToolpathProfile; + +} + +#endif // __NMR_MODELREADERNODE_TOOLPATH1905_TOOLPATHPROFILE + + diff --git a/Include/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathProfiles.h b/Include/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathProfiles.h new file mode 100644 index 000000000..9113cb505 --- /dev/null +++ b/Include/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathProfiles.h @@ -0,0 +1,69 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: +NMR_ModelReaderNode_Toolpath1905_ToolpathProfiles.h covers the official 3MF Toolpath extension. + + +--*/ + +#ifndef __NMR_MODELREADERNODE_TOOLPATH1905_TOOLPATHPROFILES +#define __NMR_MODELREADERNODE_TOOLPATH1905_TOOLPATHPROFILES + +#include "Model/Reader/NMR_ModelReaderNode.h" +#include "Model/Classes/NMR_ModelComponent.h" +#include "Model/Classes/NMR_ModelComponentsObject.h" +#include "Model/Classes/NMR_ModelObject.h" +#include "Model/Classes/NMR_ModelToolpath.h" + +namespace NMR { + + class CModelReaderNode_Toolpath1905_ToolpathProfiles : public CModelReaderNode { + private: + CModel * m_pModel; + PModelWarnings m_pWarnings; + CModelToolpath * m_pToolpath; + + protected: + virtual void OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue); + virtual void OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace); + virtual void OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader); + public: + CModelReaderNode_Toolpath1905_ToolpathProfiles() = delete; + CModelReaderNode_Toolpath1905_ToolpathProfiles(_In_ CModel * pModel, _In_ CModelToolpath * pToolpath, _In_ PModelWarnings pWarnings); + + virtual void parseXML(_In_ CXmlReader * pXMLReader); + + + }; + + typedef std::shared_ptr PModelReaderNode_Toolpath1905_ToolpathProfiles; + +} + +#endif // __NMR_MODELREADERNODE_TOOLPATH1905_TOOLPATHPROFILES + + diff --git a/Include/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathResource.h b/Include/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathResource.h new file mode 100644 index 000000000..60e15377a --- /dev/null +++ b/Include/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathResource.h @@ -0,0 +1,73 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: +NMR_ModelReaderNode_Toolpath1905_ToolpathResource.h covers the official 3MF Toolpath extension. + + +--*/ + +#ifndef __NMR_MODELREADERNODE_TOOLPATH1905_TOOLPATHRESOURCE +#define __NMR_MODELREADERNODE_TOOLPATH1905_TOOLPATHRESOURCE + +#include "Model/Reader/NMR_ModelReaderNode.h" +#include "Model/Classes/NMR_ModelComponent.h" +#include "Model/Classes/NMR_ModelComponentsObject.h" +#include "Model/Classes/NMR_ModelObject.h" +#include "Model/Classes/NMR_ModelToolpath.h" + +namespace NMR { + + class CModelReaderNode_Toolpath1905_ToolpathResource : public CModelReaderNode { + private: + CModel * m_pModel; + PModelWarnings m_pWarnings; + + ModelResourceID m_nID; + nfBool m_bHasID; + nfDouble m_dUnitFactor; + nfBool m_bHasUnitFactor; + + PModelToolpath m_pToolpath; + + protected: + virtual void OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue); + virtual void OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader); + public: + CModelReaderNode_Toolpath1905_ToolpathResource() = delete; + CModelReaderNode_Toolpath1905_ToolpathResource(_In_ CModel * pModel, _In_ PModelWarnings pWarnings); + + virtual void parseXML(_In_ CXmlReader * pXMLReader); + + }; + + typedef std::shared_ptr PModelReaderNode_Toolpath1905_ToolpathResource; + +} + +#endif // __NMR_MODELREADERNODE_TOOLPATH1905_TOOLPATHRESOURCE + + diff --git a/Include/Model/ToolpathReader/NMR_ToolpathReader.h b/Include/Model/ToolpathReader/NMR_ToolpathReader.h new file mode 100644 index 000000000..91eff0277 --- /dev/null +++ b/Include/Model/ToolpathReader/NMR_ToolpathReader.h @@ -0,0 +1,68 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +NMR_ModelReader_ToolpathReader.h defines the Toolpath Layer Reader. + +--*/ + +#ifndef __NMR_TOOLPATHREADER +#define __NMR_TOOLPATHREADER + +#include +#include +#include "Common/NMR_ModelWarnings.h" +#include "Model/Classes/NMR_ModelToolpathLayerReadData.h" +#include "Common/3MF_ProgressMonitor.h" + + +namespace NMR { + + class CToolpathReader { + protected: + nfBool m_bAllowBinaryStreams; + + PProgressMonitor m_pProgressMonitor; + PModelWarnings m_pWarnings; + + PModelToolpathLayerReadData m_pReadData; + + public: + CToolpathReader() = delete; + CToolpathReader(PModelToolpath pModelToolpath, nfBool bAllowBinaryStreams); + + void readStream(_In_ PImportStream pStream); + + PModelToolpathLayerReadData getReadData(); + }; + + typedef std::shared_ptr PToolpathReader; + +} + +#endif // __NMR_TOOLPATHREADER + diff --git a/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Data.h b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Data.h new file mode 100644 index 000000000..367fc4709 --- /dev/null +++ b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Data.h @@ -0,0 +1,60 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#ifndef __NMR_TOOLPATHREADERNODE_DATA +#define __NMR_TOOLPATHREADERNODE_DATA + +#include "Model/Reader/NMR_ModelReaderNode.h" +#include "Model/Classes/NMR_ModelToolpathLayerReadData.h" +#include "Model/Classes/NMR_CustomXMLTree.h" + +#include "Common/NMR_ModelWarnings.h" + +namespace NMR { + + class CToolpathReaderNode_Data : public CModelReaderNode { + protected: + + CModelToolpathLayerReadData * m_pReadData; + + virtual void OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader); + virtual void OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue); + virtual void OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace); + public: + CToolpathReaderNode_Data() = delete; + CToolpathReaderNode_Data(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, CModelToolpathLayerReadData * pReadData); + + virtual void parseXML(_In_ CXmlReader * pXMLReader); + }; + + typedef std::shared_ptr PToolpathReaderNode_Data; + +} + +#endif // __NMR_TOOLPATHREADERNODE_DATA diff --git a/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_DataNode.h b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_DataNode.h new file mode 100644 index 000000000..4b3f86685 --- /dev/null +++ b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_DataNode.h @@ -0,0 +1,62 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#ifndef __NMR_TOOLPATHREADERNODE_DATANODE +#define __NMR_TOOLPATHREADERNODE_DATANODE + +#include "Model/Reader/NMR_ModelReaderNode.h" +#include "Model/Classes/NMR_ModelToolpathLayerReadData.h" +#include "Model/Classes/NMR_CustomXMLTree.h" + +#include "Common/NMR_ModelWarnings.h" + +namespace NMR { + + class CToolpathReaderNode_DataNode : public CModelReaderNode { + protected: + + CModelToolpathLayerReadData * m_pReadData; + std::string m_sNameSpace; + PCustomXMLNode m_pXMLNode; + + virtual void OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader); + virtual void OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue); + virtual void OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace); + public: + CToolpathReaderNode_DataNode() = delete; + CToolpathReaderNode_DataNode(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, CModelToolpathLayerReadData * pReadData, const std::string & sNameSpace, PCustomXMLNode pXMLNode); + + virtual void parseXML(_In_ CXmlReader * pXMLReader); + }; + + typedef std::shared_ptr PToolpathReaderNode_DataNode; + +} + +#endif // __NMR_TOOLPATHREADERNODE_DATANODE diff --git a/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Hatch.h b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Hatch.h new file mode 100644 index 000000000..c96fa4daa --- /dev/null +++ b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Hatch.h @@ -0,0 +1,74 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--*/ + +#ifndef __NMR_TOOLPATHREADERNODE_HATCH +#define __NMR_TOOLPATHREADERNODE_HATCH + +#include "Model/Reader/NMR_ModelReaderNode.h" +#include "Model/Classes/NMR_ModelToolpathLayerReadData.h" +#include "Common/NMR_ModelWarnings.h" + +namespace NMR { + + class CToolpathReaderNode_Hatch : public CModelReaderNode { + protected: + + nfDouble m_dX1; + nfDouble m_dY1; + nfDouble m_dX2; + nfDouble m_dY2; + + nfBool m_bHasX1; + nfBool m_bHasY1; + nfBool m_bHasX2; + nfBool m_bHasY2; + + CModelToolpathLayerReadData * m_pReadData; + + virtual void OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader); + virtual void OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue); + virtual void OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace); + + public: + CToolpathReaderNode_Hatch() = delete; + CToolpathReaderNode_Hatch(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, CModelToolpathLayerReadData * pReadData); + + virtual void parseXML(_In_ CXmlReader * pXMLReader); + + nfDouble getX1(); + nfDouble getY1(); + nfDouble getX2(); + nfDouble getY2(); + }; + + typedef std::shared_ptr PToolpathReaderNode_Hatch; + +} + +#endif // __NMR_TOOLPATHREADERNODE_HATCH + diff --git a/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Layer.h b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Layer.h new file mode 100644 index 000000000..84aba796f --- /dev/null +++ b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Layer.h @@ -0,0 +1,59 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#ifndef __NMR_TOOLPATHREADERNODE_LAYER +#define __NMR_TOOLPATHREADERNODE_LAYER + +#include "Model/Reader/NMR_ModelReaderNode.h" +#include "Model/Classes/NMR_ModelToolpathLayerReadData.h" +#include "Common/NMR_ModelWarnings.h" + +namespace NMR { + + class CToolpathReaderNode_Layer : public CModelReaderNode { + protected: + + CModelToolpathLayerReadData * m_pReadData; + + virtual void OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader); + virtual void OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue); + virtual void OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace); + + public: + CToolpathReaderNode_Layer() = delete; + CToolpathReaderNode_Layer(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, CModelToolpathLayerReadData * pReadData); + + virtual void parseXML(_In_ CXmlReader * pXMLReader); + }; + + typedef std::shared_ptr PToolpathReaderNode_Layer; + +} + +#endif // __NMR_TOOLPATHREADERNODE_LAYER diff --git a/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Part.h b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Part.h new file mode 100644 index 000000000..af003ce98 --- /dev/null +++ b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Part.h @@ -0,0 +1,67 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#ifndef __NMR_TOOLPATHREADERNODE_PART +#define __NMR_TOOLPATHREADERNODE_PART + +#include "Model/Reader/NMR_ModelReaderNode.h" +#include "Model/Classes/NMR_ModelToolpathLayerReadData.h" +#include "Common/NMR_ModelWarnings.h" + +namespace NMR { + + class CToolpathReaderNode_Part : public CModelReaderNode { + protected: + + CModelToolpathLayerReadData * m_pReadData; + nfUint32 m_nPartID; + std::string m_sUUID; + + virtual void OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader); + virtual void OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue); + virtual void OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace); + + public: + CToolpathReaderNode_Part() = delete; + CToolpathReaderNode_Part(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, CModelToolpathLayerReadData * pReadData); + + virtual void parseXML(_In_ CXmlReader * pXMLReader); + + nfUint32 getPartID (); + bool hasPartID(); + + std::string getUUID (); + bool hasUUID(); + }; + + typedef std::shared_ptr PToolpathReaderNode_Part; + +} + +#endif // __NMR_TOOLPATHREADERNODE_PART diff --git a/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Parts.h b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Parts.h new file mode 100644 index 000000000..46ef468d8 --- /dev/null +++ b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Parts.h @@ -0,0 +1,58 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#ifndef __NMR_TOOLPATHREADERNODE_PARTS +#define __NMR_TOOLPATHREADERNODE_PARTS + +#include "Model/Reader/NMR_ModelReaderNode.h" +#include "Model/Classes/NMR_ModelToolpathLayerReadData.h" +#include "Common/NMR_ModelWarnings.h" + +namespace NMR { + + class CToolpathReaderNode_Parts : public CModelReaderNode { + protected: + + CModelToolpathLayerReadData * m_pReadData; + + virtual void OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader); + virtual void OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue); + virtual void OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace); + public: + CToolpathReaderNode_Parts() = delete; + CToolpathReaderNode_Parts(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, CModelToolpathLayerReadData * pReadData); + + virtual void parseXML(_In_ CXmlReader * pXMLReader); + }; + + typedef std::shared_ptr PToolpathReaderNode_Parts; + +} + +#endif // __NMR_TOOLPATHREADERNODE_PARTS diff --git a/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Point.h b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Point.h new file mode 100644 index 000000000..33f5ce6de --- /dev/null +++ b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Point.h @@ -0,0 +1,68 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#ifndef __NMR_TOOLPATHREADERNODE_POINT +#define __NMR_TOOLPATHREADERNODE_POINT + +#include "Model/Reader/NMR_ModelReaderNode.h" +#include "Model/Classes/NMR_ModelToolpathLayerReadData.h" +#include "Common/NMR_ModelWarnings.h" + +namespace NMR { + + class CToolpathReaderNode_Point : public CModelReaderNode { + protected: + + nfDouble m_dX; + nfDouble m_dY; + + nfBool m_bHasX; + nfBool m_bHasY; + + CModelToolpathLayerReadData * m_pReadData; + + virtual void OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader); + virtual void OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue); + virtual void OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace); + public: + CToolpathReaderNode_Point() = delete; + CToolpathReaderNode_Point(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, CModelToolpathLayerReadData * pReadData); + + virtual void parseXML(_In_ CXmlReader * pXMLReader); + + nfDouble getX(); + nfDouble getY(); + + }; + + typedef std::shared_ptr PToolpathReaderNode_Point; + +} + +#endif // __NMR_TOOLPATHREADERNODE_POINT diff --git a/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Profile.h b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Profile.h new file mode 100644 index 000000000..ea9b6f90f --- /dev/null +++ b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Profile.h @@ -0,0 +1,68 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#ifndef __NMR_TOOLPATHREADERNODE_PROFILE +#define __NMR_TOOLPATHREADERNODE_PROFILE + +#include "Model/Reader/NMR_ModelReaderNode.h" +#include "Model/Classes/NMR_ModelToolpathLayerReadData.h" +#include "Common/NMR_ModelWarnings.h" + +namespace NMR { + + class CToolpathReaderNode_Profile : public CModelReaderNode { + protected: + + nfUint32 m_nProfileID; + std::string m_sUUID; + + CModelToolpathLayerReadData * m_pReadData; + + virtual void OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader); + virtual void OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue); + virtual void OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace); + public: + CToolpathReaderNode_Profile() = delete; + CToolpathReaderNode_Profile(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, CModelToolpathLayerReadData * pReadData); + + virtual void parseXML(_In_ CXmlReader * pXMLReader); + + nfUint32 getProfileID(); + bool hasProfileID(); + + std::string getUUID(); + bool hasUUID(); + + }; + + typedef std::shared_ptr PToolpathReaderNode_Profile; + +} + +#endif // __NMR_TOOLPATHREADERNODE_PROFILE diff --git a/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Profiles.h b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Profiles.h new file mode 100644 index 000000000..a58ab7f8f --- /dev/null +++ b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Profiles.h @@ -0,0 +1,58 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#ifndef __NMR_TOOLPATHREADERNODE_PROFILES +#define __NMR_TOOLPATHREADERNODE_PROFILES + +#include "Model/Reader/NMR_ModelReaderNode.h" +#include "Model/Classes/NMR_ModelToolpathLayerReadData.h" +#include "Common/NMR_ModelWarnings.h" + +namespace NMR { + + class CToolpathReaderNode_Profiles : public CModelReaderNode { + protected: + + CModelToolpathLayerReadData * m_pReadData; + + virtual void OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader); + virtual void OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue); + virtual void OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace); + public: + CToolpathReaderNode_Profiles() = delete; + CToolpathReaderNode_Profiles(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, CModelToolpathLayerReadData * pReadData); + + virtual void parseXML(_In_ CXmlReader * pXMLReader); + }; + + typedef std::shared_ptr PToolpathReaderNode_Profiles; + +} + +#endif // __NMR_TOOLPATHREADERNODE_PROFILES diff --git a/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Segment.h b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Segment.h new file mode 100644 index 000000000..044337206 --- /dev/null +++ b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Segment.h @@ -0,0 +1,70 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#ifndef __NMR_TOOLPATHREADERNODE_SEGMENT +#define __NMR_TOOLPATHREADERNODE_SEGMENT + +#include "Model/Reader/NMR_ModelReaderNode.h" +#include "Model/Classes/NMR_ModelToolpathLayerReadData.h" +#include "Common/NMR_ModelWarnings.h" + +namespace NMR { + + class CToolpathReaderNode_Segment : public CModelReaderNode { + protected: + + CModelToolpathLayerReadData * m_pReadData; + nfUint32 m_nProfileID; + nfUint32 m_nPartID; + eModelToolpathSegmentType m_eSegmentType; + nfBool m_bHasSegmentType; + std::string m_sBinaryStreamPath; + + virtual void OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader); + virtual void OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue); + virtual void OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace); + public: + CToolpathReaderNode_Segment() = delete; + CToolpathReaderNode_Segment(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, _In_ CModelToolpathLayerReadData * pReadData, _In_ std::string sBinaryStreamPath); + + virtual void parseXML(_In_ CXmlReader * pXMLReader); + + nfUint32 getProfileID(); + bool hasProfileID(); + + nfUint32 getPartID(); + bool hasPartID(); + + }; + + typedef std::shared_ptr PToolpathReaderNode_Segment; + +} + +#endif // __NMR_TOOLPATHREADERNODE_SEGMENT diff --git a/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Segments.h b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Segments.h new file mode 100644 index 000000000..d2053bdb8 --- /dev/null +++ b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_Segments.h @@ -0,0 +1,59 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#ifndef __NMR_TOOLPATHREADERNODE_SEGMENTS +#define __NMR_TOOLPATHREADERNODE_SEGMENTS + +#include "Model/Reader/NMR_ModelReaderNode.h" +#include "Model/Classes/NMR_ModelToolpathLayerReadData.h" +#include "Common/NMR_ModelWarnings.h" + +namespace NMR { + + class CToolpathReaderNode_Segments : public CModelReaderNode { + protected: + + CModelToolpathLayerReadData * m_pReadData; + std::string m_sBinaryStreamPath; + + virtual void OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader); + virtual void OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue); + virtual void OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace); + public: + CToolpathReaderNode_Segments() = delete; + CToolpathReaderNode_Segments(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, CModelToolpathLayerReadData * pReadData); + + virtual void parseXML(_In_ CXmlReader * pXMLReader); + }; + + typedef std::shared_ptr PToolpathReaderNode_Segments; + +} + +#endif // __NMR_TOOLPATHREADERNODE_SEGMENTS diff --git a/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_ZHatch.h b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_ZHatch.h new file mode 100644 index 000000000..151f8d6ad --- /dev/null +++ b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_ZHatch.h @@ -0,0 +1,72 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--*/ + +#ifndef __NMR_TOOLPATHREADERNODE_ZHATCH +#define __NMR_TOOLPATHREADERNODE_ZHATCH + +#include "Model/Reader/NMR_ModelReaderNode.h" +#include "Model/Classes/NMR_ModelToolpathLayerReadData.h" +#include "Common/NMR_ModelWarnings.h" + + +namespace NMR { + + class CToolpathReaderNode_ZHatch : public CModelReaderNode { + protected: + + nfInt32 m_nX1Id; + nfInt32 m_nY1Id; + nfInt32 m_nX2Id; + nfInt32 m_nY2Id; + + nfBool m_bHasX1; + nfBool m_bHasY1; + nfBool m_bHasX2; + nfBool m_bHasY2; + + CModelToolpathLayerReadData * m_pReadData; + + virtual void OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader); + virtual void OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue); + virtual void OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace); + + public: + CToolpathReaderNode_ZHatch() = delete; + CToolpathReaderNode_ZHatch(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, CModelToolpathLayerReadData * pReadData); + + virtual void parseXML(_In_ CXmlReader * pXMLReader); + + void getBinaryIDs (nfInt32 & nX1Id, nfInt32 & nY1Id, nfInt32 & nX2Id, nfInt32 & nY2Id); + }; + + typedef std::shared_ptr PToolpathReaderNode_ZHatch; + +} + +#endif // __NMR_TOOLPATHREADERNODE_ZHATCH + diff --git a/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_ZPoint.h b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_ZPoint.h new file mode 100644 index 000000000..0d8db4fb4 --- /dev/null +++ b/Include/Model/ToolpathReader/NMR_ToolpathReaderNode_ZPoint.h @@ -0,0 +1,67 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#ifndef __NMR_TOOLPATHREADERNODE_ZPOINT +#define __NMR_TOOLPATHREADERNODE_ZPOINT + +#include "Model/Reader/NMR_ModelReaderNode.h" +#include "Model/Classes/NMR_ModelToolpathLayerReadData.h" +#include "Common/NMR_ModelWarnings.h" + +namespace NMR { + + class CToolpathReaderNode_ZPoint : public CModelReaderNode { + protected: + + nfInt32 m_nXId; + nfInt32 m_nYId; + + nfBool m_bHasX; + nfBool m_bHasY; + + CModelToolpathLayerReadData * m_pReadData; + + virtual void OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader); + virtual void OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue); + virtual void OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace); + public: + CToolpathReaderNode_ZPoint() = delete; + CToolpathReaderNode_ZPoint(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, CModelToolpathLayerReadData * pReadData); + + virtual void parseXML(_In_ CXmlReader * pXMLReader); + + void getBinaryIDs(nfInt32 & nXId, nfInt32 & nYId); + + }; + + typedef std::shared_ptr PToolpathReaderNode_ZPoint; + +} + +#endif // __NMR_TOOLPATHREADERNODE_ZPOINT diff --git a/Include/Model/Writer/NMR_ModelWriter.h b/Include/Model/Writer/NMR_ModelWriter.h index 295d2ee8f..6faa54a17 100644 --- a/Include/Model/Writer/NMR_ModelWriter.h +++ b/Include/Model/Writer/NMR_ModelWriter.h @@ -38,6 +38,8 @@ A model writer exports the in memory represenation into the 3MF file. #include "Model/Classes/NMR_ModelContext.h" #include "Common/Platform/NMR_ExportStream.h" #include "Common/3MF_ProgressMonitor.h" +#include "Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamWriter.h" + #include namespace NMR { @@ -45,15 +47,33 @@ namespace NMR { class CModelWriter : public CModelContext{ private: nfUint32 m_nDecimalPrecision; + + protected: + nfBool m_bAllowBinaryStreams; + std::map> m_BinaryWriterUUIDMap; + std::map m_BinaryWriterPathMap; + std::map m_BinaryWriterAssignmentMap; + public: CModelWriter() = delete; CModelWriter(_In_ PModel pModel); - virtual ~CModelWriter() = default; + virtual ~CModelWriter(); virtual void exportToStream(_In_ PExportStream pStream) = 0; + void allowBinaryStreams (); + void SetDecimalPrecision(nfUint32); nfUint32 GetDecimalPrecision(); + + void registerBinaryStream(const std::string& sPath, const std::string& sUUID, PChunkedBinaryStreamWriter pStreamWriter); + void unregisterBinaryStreams(); + + void assignBinaryStream(const std::string& InstanceUUID, const std::string& sBinaryStreamUUID); + CChunkedBinaryStreamWriter* findBinaryStream(const std::string& InstanceUUID, std::string& Path); + + virtual void registerCustomNameSpace(const std::string & sPrefix, const std::string & sNameSpace, bool bFailIfExisting); + }; typedef std::shared_ptr PModelWriter; diff --git a/Include/Model/Writer/NMR_ModelWriter_3MF.h b/Include/Model/Writer/NMR_ModelWriter_3MF.h index 7c6e8a924..ff34ba25a 100644 --- a/Include/Model/Writer/NMR_ModelWriter_3MF.h +++ b/Include/Model/Writer/NMR_ModelWriter_3MF.h @@ -42,6 +42,10 @@ namespace NMR { class CModelWriter_3MF : public CModelWriter { protected: + + // Additional streams to write into to package + std::map > m_AdditionalAttachments; + // Creates a model stream void writeModelStream(_In_ CXmlWriter * pXMLWriter, _In_ CModel * pModel); @@ -52,13 +56,24 @@ namespace NMR { virtual void createPackage(_In_ CModel * pModel) = 0; virtual void writePackageToStream(_In_ PExportStream pStream) = 0; virtual void releasePackage() = 0; + + // Namespace prefix mapping + std::map m_CustomNameSpaces; public: CModelWriter_3MF() = delete; CModelWriter_3MF(_In_ PModel pModel); virtual void exportToStream(_In_ PExportStream pStream); + + void addAdditionalAttachment(_In_ std::string sPath, _In_ PImportStream pStream, _In_ std::string sRelationShipType); + + void registerCustomNameSpace(const std::string& sPrefix, const std::string& sNameSpace, bool bFailIfExisting) override; + std::map getCustomNamespaceMap(); + }; + typedef std::shared_ptr PModelWriter_3MF; + } #endif // __NMR_MODELWRITER_3MF diff --git a/Include/Model/Writer/v100/NMR_ModelWriterNode100_Mesh.h b/Include/Model/Writer/v100/NMR_ModelWriterNode100_Mesh.h index 74a5b832d..1bf126a14 100644 --- a/Include/Model/Writer/v100/NMR_ModelWriterNode100_Mesh.h +++ b/Include/Model/Writer/v100/NMR_ModelWriterNode100_Mesh.h @@ -39,6 +39,7 @@ This is the class for exporting the 3mf mesh node. #include "Model/Classes/NMR_ModelMeshObject.h" #include "Common/MeshInformation/NMR_MeshInformation_Properties.h" +#include "Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamWriter.h" #include "Common/Platform/NMR_XmlWriter.h" #include @@ -63,6 +64,7 @@ namespace NMR { class CModelWriterNode100_Mesh : public CModelWriterNode_ModelBase { protected: CModelMeshObject * m_pModelMeshObject; + CChunkedBinaryStreamWriter* m_pBinaryStreamWriter; PMeshInformation_PropertyIndexMapping m_pPropertyIndexMapping; @@ -120,7 +122,9 @@ namespace NMR { public: CModelWriterNode100_Mesh() = delete; CModelWriterNode100_Mesh(_In_ CModelMeshObject * pModelMeshObject, _In_ CXmlWriter * pXMLWriter, _In_ PProgressMonitor pProgressMonitor, - _In_ PMeshInformation_PropertyIndexMapping pPropertyIndexMapping, _In_ int nPosAfterDecPoint, _In_ nfBool bWriteMaterialExtension, _In_ nfBool m_bWriteBeamLatticeExtension); + _In_ PMeshInformation_PropertyIndexMapping pPropertyIndexMapping, _In_ int nPosAfterDecPoint, _In_ nfBool bWriteMaterialExtension, _In_ nfBool m_bWriteBeamLatticeExtension, + CChunkedBinaryStreamWriter* pBinaryStreamWriter); + virtual void writeToXML(); }; diff --git a/Include/Model/Writer/v100/NMR_ModelWriterNode100_Model.h b/Include/Model/Writer/v100/NMR_ModelWriterNode100_Model.h index 6ed375bb2..679db059a 100644 --- a/Include/Model/Writer/v100/NMR_ModelWriterNode100_Model.h +++ b/Include/Model/Writer/v100/NMR_ModelWriterNode100_Model.h @@ -39,6 +39,7 @@ This is the class for exporting the 3mf model stream root node. #include "Model/Classes/NMR_ModelComponentsObject.h" #include "Model/Classes/NMR_ModelMeshObject.h" #include "Common/Platform/NMR_XmlWriter.h" +#include "Model/Classes/NMR_CustomXMLNode.h" #include "Common/MeshInformation/NMR_MeshInformation_Properties.h" @@ -56,18 +57,25 @@ namespace NMR { nfBool m_bWriteBeamLatticeExtension; nfBool m_bWriteNurbsExtension; nfBool m_bWriteSliceExtension; + nfBool m_bWriteToolpaths; nfBool m_bWriteSecureContentExtension; nfBool m_bWriteBaseMaterials; nfBool m_bWriteObjects; nfBool m_bIsRootModel; nfBool m_bWriteCustomNamespaces; + nfBool m_bWriteBinaryExtension; + + std::map> m_BinaryStreamWriters; void writeModelMetaData(); void writeMetaData(_In_ PModelMetaData pMetaData); void writeMetaDataGroup(_In_ PModelMetaDataGroup pMetaDataGroup); + void writeCustomToolpathXMLNode (PCustomXMLNode pXMLNode, const std::string & sPrefix); + void writeResources(); void writeBaseMaterials(); + void writeToolpaths(); void writeTextures2D(); void writeColors(); void writeTex2Coords(); @@ -89,10 +97,15 @@ namespace NMR { public: CModelWriterNode100_Model() = delete; - CModelWriterNode100_Model(_In_ CModel * pModel, _In_ CXmlWriter * pXMLWriter, _In_ PProgressMonitor pProgressMonitor, _In_ nfUint32 nDecimalPrecision); CModelWriterNode100_Model(_In_ CModel * pModel, _In_ CXmlWriter * pXMLWriter, _In_ PProgressMonitor pProgressMonitor, _In_ nfUint32 nDecimalPrecision, _In_ nfBool bWritesRootModel); virtual void writeToXML(); + + void registerStreamWriter(const std::string& sInstanceUUID, const std::string& sPath, CChunkedBinaryStreamWriter* pBinaryStreamWriter); + void setWriteBinaryExtension(bool bWriteBinaryExtension); + + void registerCustomNamespace (const std::string & sPrefix, const std::string & sNamespace, bool bFailIfExisting); + }; } diff --git a/Source/API/lib3mf_binarystream.cpp b/Source/API/lib3mf_binarystream.cpp new file mode 100644 index 000000000..4e7e2d719 --- /dev/null +++ b/Source/API/lib3mf_binarystream.cpp @@ -0,0 +1,102 @@ +/*++ + +Copyright (C) 2019 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is a stub class definition of CBinaryStream + +*/ + +#include "lib3mf_binarystream.hpp" +#include "lib3mf_interfaceexception.hpp" + +// Include custom headers here. +#include "Common/NMR_UUID.h" + + +using namespace Lib3MF::Impl; + +/************************************************************************************************************************* + Class definition of CBinaryStream +**************************************************************************************************************************/ + +CBinaryStream::CBinaryStream(std::string sPackageIndexPath, std::string sPackageBinaryPath, NMR::PChunkedBinaryStreamWriter pStreamWriter) + : m_sPackageIndexPath (sPackageIndexPath), m_sPackageBinaryPath (sPackageBinaryPath), m_pStreamWriter (pStreamWriter) +{ + if (pStreamWriter.get() == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM); + + NMR::CUUID uuid; + m_sUUID = uuid.toString(); + +} + + + +std::string CBinaryStream::GetBinaryPath() +{ + return m_sPackageBinaryPath; +} + +std::string CBinaryStream::GetIndexPath() +{ + return m_sPackageIndexPath; +} + +std::string CBinaryStream::GetUUID() +{ + return m_sUUID; +} + +void CBinaryStream::DisableDiscretizedArrayCompression() +{ + m_pStreamWriter->setDefaultCompressionMode(false, 0.001, NMR::eChunkedBinaryPredictionType::eptNoPredicition); +} + +void CBinaryStream::EnableDiscretizedArrayCompression(const Lib3MF_double dUnits, const Lib3MF::eBinaryStreamPredictionType ePredictionType) +{ + switch (ePredictionType) { + case eBinaryStreamPredictionType::NoPrediction: + m_pStreamWriter->setDefaultCompressionMode(true, dUnits, NMR::eChunkedBinaryPredictionType::eptNoPredicition); + break; + case eBinaryStreamPredictionType::DeltaPrediction: + m_pStreamWriter->setDefaultCompressionMode(true, dUnits, NMR::eChunkedBinaryPredictionType::eptDeltaPredicition); + break; + default: + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM); + } +} + + +void CBinaryStream::EnableLZMA(const Lib3MF_uint32 nLZMALevel) +{ + m_pStreamWriter->setEnableLZMA(true); + m_pStreamWriter->setLZMALevel(nLZMALevel); + +} + +void CBinaryStream::DisableLZMA() +{ + m_pStreamWriter->setEnableLZMA(false); +} diff --git a/Source/API/lib3mf_builditem.cpp b/Source/API/lib3mf_builditem.cpp index a7d414984..34cc14b82 100644 --- a/Source/API/lib3mf_builditem.cpp +++ b/Source/API/lib3mf_builditem.cpp @@ -137,3 +137,8 @@ Lib3MF::sBox CBuildItem::GetOutbox() s.m_MaxCoordinate[2] = sOutbox.m_max.m_fields[2]; return s; } + +NMR::PModelBuildItem CBuildItem::getBuildItemInstance() +{ + return m_pBuildItem; +} diff --git a/Source/API/lib3mf_customdomtree.cpp b/Source/API/lib3mf_customdomtree.cpp new file mode 100644 index 000000000..9d6195e2f --- /dev/null +++ b/Source/API/lib3mf_customdomtree.cpp @@ -0,0 +1,75 @@ +/*++ + +Copyright (C) 2019 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is a stub class definition of CCustomDOMTree + +*/ + +#include "lib3mf_customdomtree.hpp" +#include "lib3mf_interfaceexception.hpp" +#include "lib3mf_customxmlnode.hpp" + +// Include custom headers here. + + +using namespace Lib3MF::Impl; + +/************************************************************************************************************************* + Class definition of CCustomDOMTree +**************************************************************************************************************************/ + +CCustomDOMTree::CCustomDOMTree(NMR::PCustomXMLTree pXMLTree) + : m_pXMLTree (pXMLTree) +{ + if (pXMLTree.get() == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM); +} + +CCustomDOMTree::~CCustomDOMTree() +{ + +} + +NMR::PCustomXMLTree CCustomDOMTree::getXMLTreeInstance() +{ + return m_pXMLTree; +} + +std::string CCustomDOMTree::GetNameSpace() +{ + return m_pXMLTree->getNameSpace(); +} + +ICustomXMLNode * CCustomDOMTree::GetRootNode() +{ + return new CCustomXMLNode(m_pXMLTree, m_pXMLTree->getRootNode ()); +} + +std::string CCustomDOMTree::SaveToString() +{ + return m_pXMLTree->saveToString(); +} + diff --git a/Source/API/lib3mf_customxmlattribute.cpp b/Source/API/lib3mf_customxmlattribute.cpp new file mode 100644 index 000000000..72bea22a0 --- /dev/null +++ b/Source/API/lib3mf_customxmlattribute.cpp @@ -0,0 +1,125 @@ +/*++ + +Copyright (C) 2019 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is a stub class definition of CCustomXMLAttribute + +*/ + +#include "lib3mf_customxmlattribute.hpp" +#include "lib3mf_interfaceexception.hpp" + +// Include custom headers here. +#include "Common/NMR_StringUtils.h" + +using namespace Lib3MF::Impl; + +/************************************************************************************************************************* + Class definition of CCustomXMLAttribute +**************************************************************************************************************************/ + +CCustomXMLAttribute::CCustomXMLAttribute(NMR::PCustomXMLNode pXMLNode, NMR::PCustomXMLAttribute pXMLAttribute) + : m_pXMLNode (pXMLNode), m_pXMLAttribute (pXMLAttribute) +{ + if (pXMLNode.get() == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM); + if (pXMLAttribute.get() == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM); +} + +CCustomXMLAttribute::~CCustomXMLAttribute() +{ + +} + + +std::string CCustomXMLAttribute::GetName() +{ + return m_pXMLAttribute->getName(); +} + +std::string CCustomXMLAttribute::GetValue() +{ + return m_pXMLAttribute->getValue(); +} + +bool CCustomXMLAttribute::IsValidInteger(const Lib3MF_int64 nMinValue, const Lib3MF_int64 nMaxValue) +{ + throw ELib3MFInterfaceException(LIB3MF_ERROR_NOTIMPLEMENTED); +} + +Lib3MF_int64 CCustomXMLAttribute::GetIntegerValue(const Lib3MF_int64 nMinValue, const Lib3MF_int64 nMaxValue) +{ + throw ELib3MFInterfaceException(LIB3MF_ERROR_NOTIMPLEMENTED); +} + +bool CCustomXMLAttribute::IsValidDouble(const Lib3MF_double dMinValue, const Lib3MF_double dMaxValue) +{ + throw ELib3MFInterfaceException(LIB3MF_ERROR_NOTIMPLEMENTED); +} + +Lib3MF_double CCustomXMLAttribute::GetDoubleValue(const Lib3MF_double dMinValue, const Lib3MF_double dMaxValue) +{ + throw ELib3MFInterfaceException(LIB3MF_ERROR_NOTIMPLEMENTED); +} + +bool CCustomXMLAttribute::IsValidBool() +{ + throw ELib3MFInterfaceException(LIB3MF_ERROR_NOTIMPLEMENTED); +} + +bool CCustomXMLAttribute::GetBoolValue(const Lib3MF_double dMinValue, const Lib3MF_double dMaxValue) +{ + throw ELib3MFInterfaceException(LIB3MF_ERROR_NOTIMPLEMENTED); +} + +void CCustomXMLAttribute::SetValue(const std::string & sValue) +{ + throw ELib3MFInterfaceException(LIB3MF_ERROR_NOTIMPLEMENTED); +} + +void CCustomXMLAttribute::SetIntegerValue(const Lib3MF_int64 nValue) +{ + throw ELib3MFInterfaceException(LIB3MF_ERROR_NOTIMPLEMENTED); +} + +void CCustomXMLAttribute::SetDoubleValue(const Lib3MF_double dValue) +{ + throw ELib3MFInterfaceException(LIB3MF_ERROR_NOTIMPLEMENTED); +} + +void CCustomXMLAttribute::SetBoolValue(const bool bValue) +{ + if (bValue) + m_pXMLAttribute->setValue("true"); + else + m_pXMLAttribute->setValue("false"); +} + +void CCustomXMLAttribute::Remove() +{ + m_pXMLNode->removeAttribute(m_pXMLAttribute->getName()); +} + diff --git a/Source/API/lib3mf_customxmlnode.cpp b/Source/API/lib3mf_customxmlnode.cpp new file mode 100644 index 000000000..c007b197e --- /dev/null +++ b/Source/API/lib3mf_customxmlnode.cpp @@ -0,0 +1,197 @@ +/*++ + +Copyright (C) 2019 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is a stub class definition of CCustomXMLNode + +*/ + +#include "lib3mf_customxmlnode.hpp" +#include "lib3mf_customxmlnodes.hpp" +#include "lib3mf_customxmlattribute.hpp" +#include "lib3mf_interfaceexception.hpp" + +// Include custom headers here. + +using namespace Lib3MF::Impl; + +/************************************************************************************************************************* + Class definition of CCustomXMLNode +**************************************************************************************************************************/ +CCustomXMLNode::CCustomXMLNode(NMR::PCustomXMLTree pXMLTree, NMR::PCustomXMLNode pXMLNode) + : m_pXMLTree (pXMLTree), m_pXMLNode (pXMLNode) +{ + if (pXMLTree.get() == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM); + if (pXMLNode.get() == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM); + +} + +NMR::PCustomXMLNode CCustomXMLNode::getNodeInstance() +{ + return m_pXMLNode; +} + + +CCustomXMLNode::~CCustomXMLNode() +{ + +} + +std::string CCustomXMLNode::GetName() +{ + return m_pXMLNode->getName(); +} + +std::string CCustomXMLNode::GetNameSpace() +{ + return m_pXMLTree->getNameSpace(); +} + +Lib3MF_uint64 CCustomXMLNode::GetAttributeCount() +{ + return m_pXMLNode->getAttributeCount(); +} + +ICustomXMLAttribute * CCustomXMLNode::GetAttribute(const Lib3MF_uint64 nIndex) +{ + if (nIndex >= m_pXMLNode->getAttributeCount()) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDATTRIBUTEINDEX); + + return new CCustomXMLAttribute(m_pXMLNode, m_pXMLNode->getAttributeByIndex (nIndex)); +} + +bool CCustomXMLNode::HasAttribute(const std::string & sName) +{ + return m_pXMLNode->hasAttribute(sName); +} + +ICustomXMLAttribute * CCustomXMLNode::FindAttribute(const std::string & sName, const bool bMustExist) +{ + auto pAttribute = m_pXMLNode->findAttribute(sName, bMustExist); + if (pAttribute.get() == nullptr) + return nullptr; + + return new CCustomXMLAttribute(m_pXMLNode, pAttribute); +} + +bool CCustomXMLNode::RemoveAttribute(const std::string & sName) +{ + return m_pXMLNode->removeAttribute(sName); +} + +bool CCustomXMLNode::RemoveAttributeByIndex(const Lib3MF_uint64 nIndex) +{ + return m_pXMLNode->removeAttributeByIndex(nIndex); +} + +void CCustomXMLNode::AddAttribute(const std::string & sName, const std::string & sValue) +{ + m_pXMLNode->addAttribute(sName, sValue); +} + +void CCustomXMLNode::AddIntegerAttribute(const std::string & sName, const Lib3MF_int64 nValue) +{ + m_pXMLNode->addAttribute(sName, std::to_string (nValue)); +} + +void CCustomXMLNode::AddDoubleAttribute(const std::string & sName, const Lib3MF_double dValue) +{ + m_pXMLNode->addAttribute(sName, std::to_string(dValue)); +} + +void CCustomXMLNode::AddBoolAttribute(const std::string & sName, const bool bValue) +{ + if (bValue) + m_pXMLNode->addAttribute(sName, "true"); + else + m_pXMLNode->addAttribute(sName, "false"); +} + +ICustomXMLNodes * CCustomXMLNode::GetChildren() +{ + return new CCustomXMLNodes (m_pXMLTree, m_pXMLNode->getChildren()); +} + +Lib3MF_uint64 CCustomXMLNode::CountChildrenByName(const std::string & sName) +{ + auto childList = m_pXMLNode->findChildrenWithName(sName); + return childList.size (); +} + +ICustomXMLNodes * CCustomXMLNode::GetChildrenByName(const std::string & sName) +{ + auto childList = m_pXMLNode->findChildrenWithName(sName); + return new CCustomXMLNodes(m_pXMLTree, childList); +} + +bool CCustomXMLNode::HasChild(const std::string & sName) +{ + return m_pXMLNode->hasChild(sName); +} + +bool CCustomXMLNode::HasUniqueChild(const std::string & sName) +{ + return m_pXMLNode->hasUniqueChild(sName); +} + +ICustomXMLNode * CCustomXMLNode::FindChild(const std::string & sName, const bool bMustExist) +{ + auto pChild = m_pXMLNode->findUniqueChild(sName, bMustExist); + if (pChild.get() == nullptr) + return nullptr; + + return new CCustomXMLNode(m_pXMLTree, pChild); +} + +ICustomXMLNode * CCustomXMLNode::AddChild(const std::string & sName) +{ + auto pChild = m_pXMLNode->addChild(sName); + return new CCustomXMLNode (m_pXMLTree, pChild); +} + +void CCustomXMLNode::RemoveChild(ICustomXMLNode* pChildInstance) +{ + if (pChildInstance == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM); + + CCustomXMLNode* pChildInstanceImpl = dynamic_cast (pChildInstance); + if (pChildInstanceImpl == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + m_pXMLNode->removeChild(pChildInstanceImpl->getNodeInstance ().get()); +} + +uint64_t CCustomXMLNode::RemoveChildrenWithName(const std::string & sName) +{ + return m_pXMLNode->removeChildrenWithName(sName); +} + +void CCustomXMLNode::Remove() +{ + m_pXMLNode->remove(); +} + diff --git a/Source/API/lib3mf_customxmlnodes.cpp b/Source/API/lib3mf_customxmlnodes.cpp new file mode 100644 index 000000000..a41bb24e1 --- /dev/null +++ b/Source/API/lib3mf_customxmlnodes.cpp @@ -0,0 +1,94 @@ +/*++ + +Copyright (C) 2019 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is a stub class definition of CCustomXMLNodes + +*/ + +#include "lib3mf_customxmlnodes.hpp" +#include "lib3mf_customxmlnode.hpp" +#include "lib3mf_interfaceexception.hpp" + +// Include custom headers here. + + +using namespace Lib3MF::Impl; + +/************************************************************************************************************************* + Class definition of CCustomXMLNodes +**************************************************************************************************************************/ + +CCustomXMLNodes::CCustomXMLNodes(NMR::PCustomXMLTree pXMLTree, std::vector pXMLNodes) + : m_pXMLTree (pXMLTree), m_pXMLNodes (pXMLNodes) +{ + if (pXMLTree.get() == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM); +} + +CCustomXMLNodes::~CCustomXMLNodes() +{ + +} + + +Lib3MF_uint64 CCustomXMLNodes::GetNodeCount() +{ + return m_pXMLNodes.size(); +} + +ICustomXMLNode * CCustomXMLNodes::GetNode(const Lib3MF_uint64 nIndex) +{ + if (nIndex >= m_pXMLNodes.size ()) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDNODEINDEX); + + return new CCustomXMLNode(m_pXMLTree, m_pXMLNodes.at(nIndex)); +} + +Lib3MF_uint64 CCustomXMLNodes::CountNodesByName(const std::string & sName) +{ + throw ELib3MFInterfaceException(LIB3MF_ERROR_NOTIMPLEMENTED); +} + +ICustomXMLNodes * CCustomXMLNodes::GetNodesByName(const std::string & sName) +{ + throw ELib3MFInterfaceException(LIB3MF_ERROR_NOTIMPLEMENTED); +} + +bool CCustomXMLNodes::HasNode(const std::string & sName) +{ + throw ELib3MFInterfaceException(LIB3MF_ERROR_NOTIMPLEMENTED); +} + +bool CCustomXMLNodes::HasUniqueNode(const std::string & sName) +{ + throw ELib3MFInterfaceException(LIB3MF_ERROR_NOTIMPLEMENTED); +} + +ICustomXMLNode * CCustomXMLNodes::FindNode(const std::string & sName, const bool bMustExist) +{ + throw ELib3MFInterfaceException(LIB3MF_ERROR_NOTIMPLEMENTED); +} + diff --git a/Source/API/lib3mf_model.cpp b/Source/API/lib3mf_model.cpp index 69f57312f..4b5490d00 100644 --- a/Source/API/lib3mf_model.cpp +++ b/Source/API/lib3mf_model.cpp @@ -60,16 +60,27 @@ Abstract: This is a stub class definition of CModel #include "lib3mf_multipropertygroupiterator.hpp" #include "lib3mf_packagepart.hpp" #include "lib3mf_keystore.hpp" +#include "lib3mf_toolpath.hpp" +#include "lib3mf_toolpathiterator.hpp" +#include "lib3mf_persistentreadersource.hpp" // Include custom headers here. #include "Model/Classes/NMR_ModelMeshObject.h" #include "Model/Classes/NMR_ModelComponentsObject.h" #include "Common/Platform/NMR_ImportStream_Unique_Memory.h" +#include "Common/Platform/NMR_ImportStream_Shared_Memory.h" + #include "Model/Classes/NMR_ModelColorGroup.h" #include "Model/Classes/NMR_ModelTexture2DGroup.h" #include "Model/Classes/NMR_ModelMultiPropertyGroup.h" +#include "Model/Classes/NMR_ModelToolpath.h" + #include "Common/NMR_SecureContentTypes.h" +#include "Common/Platform/NMR_ImportStream_Callback.h" +#include "Common/Platform/NMR_ImportStream_Memory.h" +#include "Common/Platform/NMR_Platform.h" + #include "lib3mf_utils.hpp" using namespace Lib3MF::Impl; @@ -634,6 +645,18 @@ void CModel::RemoveBuildItem (IBuildItem* pBuildItemInstance) model().removeBuildItem(pLib3MFBuildItem->GetHandle(), true); } +IToolpath* CModel::AddToolpath(const Lib3MF_double dUnitFactor) +{ + if (dUnitFactor <= 0.0) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM); + + auto pToolpath = NMR::CModelToolpath::make(model().generateResourceID(), &model(), dUnitFactor); + model().addResource(pToolpath); + + return new CToolpath(pToolpath); +} + + IMetaDataGroup * CModel::GetMetaDataGroup () { return new CMetaDataGroup(model().getMetaDataGroup()); @@ -764,3 +787,60 @@ void Lib3MF::Impl::CModel::SetRandomNumberCallback(Lib3MF::RandomNumberCallback m_model->setCryptoRandCallback(descriptor); } + +IToolpathIterator* CModel::GetToolpaths() +{ + auto pResult = std::unique_ptr(new CToolpathIterator()); + Lib3MF_uint32 nCount = model().getResourceCount(); + + for (Lib3MF_uint32 nIdx = 0; nIdx < nCount; nIdx++) { + auto resource = model().getResource(nIdx); + if (dynamic_cast(resource.get())) + pResult->addResource(resource); + } + return pResult.release(); +} + + +IPersistentReaderSource* CModel::CreatePersistentSourceFromFile(const std::string& sFilename) +{ + NMR::PImportStream pImportStream = NMR::fnCreateImportStreamInstance(sFilename.c_str()); + + auto pDataSource = std::make_shared (pImportStream); + + return new CPersistentReaderSource(pDataSource); +} + +IPersistentReaderSource* CModel::CreatePersistentSourceFromBuffer(const Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8* pBufferBuffer) +{ + NMR::PImportStream pImportStream = std::make_shared(pBufferBuffer, nBufferBufferSize); + + auto pDataSource = std::make_shared (pImportStream); + + return new CPersistentReaderSource(pDataSource); +} + +IPersistentReaderSource* CModel::CreatePersistentSourceFromCallback(const Lib3MF::ReadCallback pTheReadCallback, const Lib3MF_uint64 nStreamSize, const Lib3MF::SeekCallback pTheSeekCallback, const Lib3MF_pvoid pUserData) +{ + NMR::ImportStream_ReadCallbackType lambdaReadCallback = + [pTheReadCallback](NMR::nfByte* pData, NMR::nfUint64 cbBytes, void* pUserData) + { + (*pTheReadCallback)(reinterpret_cast(pData), cbBytes, pUserData); + return 0; + }; + + NMR::ImportStream_SeekCallbackType lambdaSeekCallback = + [pTheSeekCallback](NMR::nfUint64 nPosition, void* pUserData) + { + (*pTheSeekCallback)(nPosition, pUserData); + return 0; + }; + + NMR::PImportStream pImportStream = std::make_shared( + lambdaReadCallback, lambdaSeekCallback, + pUserData, nStreamSize); + + auto pDataSource = std::make_shared (pImportStream); + + return new CPersistentReaderSource(pDataSource); +} \ No newline at end of file diff --git a/Source/API/lib3mf_persistentreadersource.cpp b/Source/API/lib3mf_persistentreadersource.cpp new file mode 100644 index 000000000..607a0fdd7 --- /dev/null +++ b/Source/API/lib3mf_persistentreadersource.cpp @@ -0,0 +1,91 @@ +/*++ + +Copyright (C) 2019 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is a stub class definition of CPersistentReaderSource + +*/ + +#include "lib3mf_persistentreadersource.hpp" +#include "lib3mf_interfaceexception.hpp" + +// Include custom headers here. +#include "Common/Platform/NMR_ImportStream_Callback.h" +#include "Common/Platform/NMR_ImportStream_Memory.h" +#include "Common/Platform/NMR_ImportStream_Native.h" + +using namespace Lib3MF::Impl; + +/************************************************************************************************************************* + Class definition of CPersistentReaderSource +**************************************************************************************************************************/ +CPersistentReaderSource::CPersistentReaderSource(NMR::PModelPersistentDataSource pDataSource) + : m_pDataSource (pDataSource) +{ + if (pDataSource.get () == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM); + + +} + +CPersistentReaderSource::~CPersistentReaderSource() +{ + +} + + +Lib3MF::ePersistentReaderSourceType CPersistentReaderSource::GetSourceType() +{ + auto pStream = m_pDataSource->getImportStream(); + + auto pMemoryStream = dynamic_cast (pStream.get()); + if (pMemoryStream != nullptr) + return Lib3MF::ePersistentReaderSourceType::MemoryBuffer; + + auto pCallbackStream = dynamic_cast (pStream.get()); + if (pCallbackStream != nullptr) + return Lib3MF::ePersistentReaderSourceType::Callback; + + auto pFileStream = dynamic_cast (pStream.get()); + if (pFileStream != nullptr) + return Lib3MF::ePersistentReaderSourceType::FileOnDisk; + + return Lib3MF::ePersistentReaderSourceType::Unknown; +} + +void CPersistentReaderSource::InvalidateSourceData() +{ + m_pDataSource->invalidateSource(); +} + +bool CPersistentReaderSource::SourceDataIsValid() +{ + return m_pDataSource->isValid(); +} + +NMR::PModelPersistentDataSource CPersistentReaderSource::getDataSource() +{ + return m_pDataSource; +} diff --git a/Source/API/lib3mf_reader.cpp b/Source/API/lib3mf_reader.cpp index 2f4e4f6d6..dd2dec6b5 100644 --- a/Source/API/lib3mf_reader.cpp +++ b/Source/API/lib3mf_reader.cpp @@ -34,6 +34,7 @@ Abstract: This is a stub class definition of CReader #include "lib3mf_interfaceexception.hpp" #include "lib3mf_accessright.hpp" #include "lib3mf_contentencryptionparams.hpp" +#include "lib3mf_persistentreadersource.hpp" #include "Common/Platform/NMR_Platform.h" #include "Common/Platform/NMR_ImportStream_Shared_Memory.h" #include "Common/Platform/NMR_ImportStream_Callback.h" @@ -74,10 +75,16 @@ void CReader::ReadFromFile (const std::string & sFilename) { NMR::PImportStream pImportStream = NMR::fnCreateImportStreamInstance(sFilename.c_str()); + auto pDataSource = std::make_shared(pImportStream); try { - reader().readStream(pImportStream); + reader().readFromSource(pDataSource); + + pDataSource->invalidateSource(); } - catch (NMR::CNMRException&e) { + catch (NMR::CNMRException&e) { + + pDataSource->invalidateSource(); + if (e.getErrorCode() == NMR_USERABORTED) { throw ELib3MFInterfaceException(LIB3MF_ERROR_CALCULATIONABORTED); } @@ -85,14 +92,30 @@ void CReader::ReadFromFile (const std::string & sFilename) } } +void CReader::ReadFromPersistentSource(IPersistentReaderSource* pSource) +{ + auto pSourceInstance = dynamic_cast (pSource); + if (pSourceInstance == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + reader().readFromSource(pSourceInstance->getDataSource ()); +} + + void CReader::ReadFromBuffer (const Lib3MF_uint64 nBufferBufferSize, const Lib3MF_uint8 * pBufferBuffer) { NMR::PImportStream pImportStream = std::make_shared(pBufferBuffer, nBufferBufferSize); + auto pDataSource = std::make_shared(pImportStream); try { - reader().readStream(pImportStream); + + reader().readFromSource(pDataSource); + + pDataSource->invalidateSource(); } catch (NMR::CNMRException&e) { + pDataSource->invalidateSource(); + if (e.getErrorCode() == NMR_USERABORTED) { throw ELib3MFInterfaceException(LIB3MF_ERROR_CALCULATIONABORTED); } @@ -120,10 +143,16 @@ void CReader::ReadFromCallback(const Lib3MFReadCallback pTheReadCallback, const NMR::PImportStream pImportStream = std::make_shared( lambdaReadCallback, lambdaSeekCallback, pUserData, nStreamSize); + + auto pDataSource = std::make_shared(pImportStream); try { - reader().readStream(pImportStream); + + reader().readFromSource(pDataSource); + pDataSource->invalidateSource(); } catch (NMR::CNMRException&e) { + pDataSource->invalidateSource(); + if (e.getErrorCode() == NMR_USERABORTED) { throw ELib3MFInterfaceException(LIB3MF_ERROR_CALCULATIONABORTED); } diff --git a/Source/API/lib3mf_toolpath.cpp b/Source/API/lib3mf_toolpath.cpp new file mode 100644 index 000000000..35689c2cd --- /dev/null +++ b/Source/API/lib3mf_toolpath.cpp @@ -0,0 +1,286 @@ +/*++ + +Copyright (C) 2019 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is a stub class definition of CToolpath + +*/ + +#include "lib3mf_toolpath.hpp" +#include "lib3mf_toolpathprofile.hpp" +#include "lib3mf_toolpathlayerdata.hpp" +#include "lib3mf_attachment.hpp" +#include "lib3mf_interfaceexception.hpp" +#include "lib3mf_customdomtree.hpp" + +#include "lib3mf_writer.hpp" +#include "lib3mf_toolpathlayerreader.hpp" + +#include "Common/NMR_Exception.h" + +// Include custom headers here. +#include "Common/Platform/NMR_ImportStream_Shared_Memory.h" +#include "Model/Classes/NMR_ModelConstants.h" + +#include "Model/ToolpathReader/NMR_ToolpathReader.h" + +using namespace Lib3MF::Impl; + +/************************************************************************************************************************* + Class definition of CToolpath +**************************************************************************************************************************/ + +CToolpath::CToolpath(NMR::PModelToolpath pToolpath) + : CResource(pToolpath), m_pToolpath(pToolpath) +{ + +} + + +Lib3MF_double CToolpath::GetUnits() +{ + return m_pToolpath->getUnitFactor(); +} + +Lib3MF_uint32 CToolpath::GetLayerCount() +{ + return m_pToolpath->getLayerCount(); +} + +Lib3MF_uint32 CToolpath::GetProfileCount() +{ + return m_pToolpath->getProfileCount(); +} + +Lib3MF_uint32 CToolpath::GetLayerZ(const Lib3MF_uint32 nLayerIndex) +{ + auto pLayer = m_pToolpath->getLayer(nLayerIndex); + return pLayer->getMaxZ(); +} + +IToolpathProfile* CToolpath::AddProfile(const std::string& sName) +{ + auto pProfile = m_pToolpath->addProfile(sName); + + return new CToolpathProfile(pProfile); +} + +IToolpathProfile* CToolpath::GetProfile(const Lib3MF_uint32 nProfileIndex) +{ + auto pProfile = m_pToolpath->getProfile(nProfileIndex); + + return new CToolpathProfile(pProfile); + +} + +IToolpathProfile* CToolpath::GetProfileUUID(const std::string& sProfileUUID) +{ + auto pProfile = m_pToolpath->getProfileByUUID(sProfileUUID); + + return new CToolpathProfile(pProfile); +} + + +IToolpathLayerData* CToolpath::AddLayer(const Lib3MF_uint32 nZMax, const std::string& sPath, IWriter* pModelWriter) +{ + if (pModelWriter == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM); + + CWriter* pWriterInstance = dynamic_cast (pModelWriter); + if (pWriterInstance == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + // Retrieve 3mf writer instance + NMR::PModelWriter pNMRModelWriterInstance = pWriterInstance->getModelWriter(); + NMR::PModelWriter_3MF pNMRModelWriter3MFInstance = std::dynamic_pointer_cast (pNMRModelWriterInstance); + if (pNMRModelWriter3MFInstance.get() == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + + auto pWriterData = std::make_shared(m_pToolpath.get(), pNMRModelWriter3MFInstance, sPath, pNMRModelWriter3MFInstance->getCustomNamespaceMap ()); + std::unique_ptr pToolpathData(new CToolpathLayerData(pWriterData)); + + m_pToolpath->addLayer(sPath, nZMax); + + return pToolpathData.release(); + +} + + +IAttachment* CToolpath::GetLayerAttachment(const Lib3MF_uint32 nIndex) +{ + auto pLayer = m_pToolpath->getLayer(nIndex); + auto pModel = m_pToolpath->getModel(); + auto pAttachment = pModel->findModelAttachment(pLayer->getLayerDataPath()); + if (pAttachment.get() == nullptr) + throw NMR::CNMRException(NMR_ERROR_INVALIDMODELATTACHMENT); + + return new CAttachment(pAttachment); + +} + +std::string CToolpath::GetLayerPath(const Lib3MF_uint32 nIndex) +{ + auto pLayer = m_pToolpath->getLayer(nIndex); + return pLayer->getLayerDataPath(); +} + +Lib3MF_uint32 CToolpath::GetLayerZMax(const Lib3MF_uint32 nIndex) +{ + auto pLayer = m_pToolpath->getLayer(nIndex); + return pLayer->getMaxZ(); +} + + +IToolpathLayerReader* CToolpath::ReadLayerData(const Lib3MF_uint32 nIndex) +{ + auto pLayer = m_pToolpath->getLayer(nIndex); + + auto pModel = m_pToolpath->getModel(); + + NMR::PImportStream pLayerDataStream; + + std::string sLayerPathData = pLayer->getLayerDataPath(); + auto pAttachment = pModel->findModelAttachment(sLayerPathData); + if (pAttachment.get() != nullptr) { + pLayerDataStream = pAttachment->getStream(); + } + else { + pLayerDataStream = pModel->readPathFromPersistentDataSource(sLayerPathData); + if (pLayerDataStream.get () == nullptr) + throw NMR::CNMRException(NMR_ERROR_INVALIDMODELATTACHMENT); + } + + auto pReader = std::make_shared(m_pToolpath, true); + auto pReadData = pReader->getReadData(); + for (auto iIter : m_RegisteredAttributes) { + pReadData->registerCustomSegmentAttribute(iIter.first.first, iIter.first.second, iIter.second); + } + + pReader->readStream(pLayerDataStream); + + return new CToolpathLayerReader(pReader->getReadData()); +} + +Lib3MF_uint32 CToolpath::GetCustomDataCount() +{ + return m_pToolpath->getCustomXMLDataCount(); +} + +ICustomDOMTree* CToolpath::GetCustomData(const Lib3MF_uint32 nIndex) +{ + return new CCustomDOMTree(m_pToolpath->getCustomXMLData (nIndex)); +} + +void CToolpath::GetCustomDataName(const Lib3MF_uint32 nIndex, std::string& sNameSpace, std::string& sDataName) +{ + auto pXMLData = m_pToolpath->getCustomXMLData(nIndex); + sNameSpace = pXMLData->getNameSpace(); + sDataName = pXMLData->getRootName(); +} + +bool CToolpath::HasUniqueCustomData(const std::string& sNameSpace, const std::string& sDataName) +{ + uint32_t nFoundData = 0; + + uint32_t nDataCount = m_pToolpath->getCustomXMLDataCount(); + for (uint32_t nIndex = 0; nIndex < nDataCount; nIndex++) { + auto pXMLData = m_pToolpath->getCustomXMLData(nIndex); + if ((sNameSpace == pXMLData->getNameSpace()) && (sDataName == pXMLData->getRootName())) + nFoundData++; + } + + return (nFoundData == 1); + +} + +ICustomDOMTree* CToolpath::FindUniqueCustomData(const std::string& sNameSpace, const std::string& sDataName) +{ + NMR::PCustomXMLTree pFoundTree; + + uint32_t nDataCount = m_pToolpath->getCustomXMLDataCount(); + for (uint32_t nIndex = 0; nIndex < nDataCount; nIndex++) { + auto pXMLData = m_pToolpath->getCustomXMLData(nIndex); + if ((sNameSpace == pXMLData->getNameSpace()) && (sDataName == pXMLData->getRootName())) { + if (pFoundTree.get() != nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_DUPLICATECUSTOMDATA, "duplicate custom data: " + sDataName); + + pFoundTree = pXMLData; + } + + } + + if (pFoundTree.get() == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_CUSTOMDATANOTFOUND, "custom data not found: " + sDataName); + + return new CCustomDOMTree(pFoundTree); +} + +ICustomDOMTree* CToolpath::AddCustomData(const std::string& sNameSpace, const std::string& sDataName) +{ + auto pXMLData = std::make_shared(sNameSpace, sDataName); + m_pToolpath->addCustomXMLData(pXMLData); + return new CCustomDOMTree(pXMLData); +} + +Lib3MF_uint32 CToolpath::ClearCustomData() +{ + return m_pToolpath->clearCustomXMLData(); +} + +bool CToolpath::DeleteCustomData(ICustomDOMTree* pData) +{ + if (pData == nullptr) + return false; + + auto pDataInstance = dynamic_cast (pData); + if (pDataInstance == nullptr) + return false; + + return m_pToolpath->deleteCustomXMLData (pDataInstance->getXMLTreeInstance ().get ()); +} + +void CToolpath::RegisterCustomIntegerAttribute(const std::string& sNameSpace, const std::string& sAttributeName) +{ + auto key = std::make_pair(sNameSpace, sAttributeName); + auto iIter = m_RegisteredAttributes.find (key); + + if (iIter != m_RegisteredAttributes.end()) + throw ELib3MFInterfaceException(LIB3MF_ERROR_TOOLPATH_ATTRIBUTEALREADYDEFINED, "Toolpath attribute already defined: " + sNameSpace + "/" + sAttributeName); + + m_RegisteredAttributes.insert(std::make_pair (key, NMR::eModelToolpathSegmentAttributeType::SegmentAttributeInt64)); +} + +void CToolpath::RegisterCustomDoubleAttribute(const std::string& sNameSpace, const std::string& sAttributeName) +{ + auto key = std::make_pair(sNameSpace, sAttributeName); + auto iIter = m_RegisteredAttributes.find(key); + + if (iIter != m_RegisteredAttributes.end()) + throw ELib3MFInterfaceException(LIB3MF_ERROR_TOOLPATH_ATTRIBUTEALREADYDEFINED, "Toolpath attribute already defined: " + sNameSpace + "/" + sAttributeName); + + m_RegisteredAttributes.insert(std::make_pair(key, NMR::eModelToolpathSegmentAttributeType::SegmentAttributeDouble)); +} + diff --git a/Source/API/lib3mf_toolpath.hpp b/Source/API/lib3mf_toolpath.hpp new file mode 100644 index 000000000..2975f2405 --- /dev/null +++ b/Source/API/lib3mf_toolpath.hpp @@ -0,0 +1,119 @@ +/*++ + +Copyright (C) 2019 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is the class declaration of CToolpath + +*/ + + +#ifndef __LIB3MF_TOOLPATH +#define __LIB3MF_TOOLPATH + +#include "lib3mf_interfaces.hpp" + +// Parent classes +#include "lib3mf_resource.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4250) +#endif + + +#include "Model/Classes/NMR_ModelToolpath.h" +#include "Model/Classes/NMR_ModelToolpathLayerReadData.h" + + +namespace Lib3MF { +namespace Impl { + + +/************************************************************************************************************************* + Class declaration of CToolpath +**************************************************************************************************************************/ + +class CToolpath : public virtual IToolpath, public virtual CResource { +protected: + std::map, NMR::eModelToolpathSegmentAttributeType> m_RegisteredAttributes; + + NMR::PModelToolpath m_pToolpath; +public: + CToolpath(NMR::PModelToolpath pToolpath); + + + Lib3MF_double GetUnits() override; + + Lib3MF_uint32 GetLayerCount() override; + + Lib3MF_uint32 GetProfileCount() override; + + IToolpathLayerData * AddLayer(const Lib3MF_uint32 nZMax, const std::string & sPath, IWriter* pModelWriter) override; + + IAttachment * GetLayerAttachment(const Lib3MF_uint32 nIndex) override; + + IToolpathLayerReader * ReadLayerData(const Lib3MF_uint32 nIndex) override; + + std::string GetLayerPath(const Lib3MF_uint32 nIndex) override; + + Lib3MF_uint32 GetLayerZMax(const Lib3MF_uint32 nIndex) override; + + Lib3MF_uint32 GetLayerZ(const Lib3MF_uint32 nLayerIndex) override; + + IToolpathProfile * AddProfile(const std::string & sName) override; + + IToolpathProfile * GetProfile(const Lib3MF_uint32 nProfileIndex) override; + + IToolpathProfile * GetProfileUUID(const std::string & sProfileUUID) override; + + Lib3MF_uint32 GetCustomDataCount() override; + + ICustomDOMTree* GetCustomData(const Lib3MF_uint32 nIndex) override; + + void GetCustomDataName(const Lib3MF_uint32 nIndex, std::string& sNameSpace, std::string& sDataName) override; + + bool HasUniqueCustomData(const std::string& sNameSpace, const std::string& sDataName) override; + + ICustomDOMTree* FindUniqueCustomData(const std::string& sNameSpace, const std::string& sDataName) override; + + ICustomDOMTree* AddCustomData(const std::string& sNameSpace, const std::string& sDataName) override; + + Lib3MF_uint32 ClearCustomData() override; + + bool DeleteCustomData(ICustomDOMTree* pData) override; + + void RegisterCustomIntegerAttribute(const std::string& sNameSpace, const std::string& sAttributeName) override; + + void RegisterCustomDoubleAttribute(const std::string& sNameSpace, const std::string& sAttributeName) override; + + +}; + +} // namespace Impl +} // namespace Lib3MF + +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#endif // __LIB3MF_TOOLPATH diff --git a/Source/API/lib3mf_toolpathiterator.cpp b/Source/API/lib3mf_toolpathiterator.cpp new file mode 100644 index 000000000..dab6cf2c7 --- /dev/null +++ b/Source/API/lib3mf_toolpathiterator.cpp @@ -0,0 +1,46 @@ +/*++ + +Copyright (C) 2019 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is a stub class definition of CToolpathIterator + +*/ + +#include "lib3mf_toolpathiterator.hpp" +#include "lib3mf_toolpath.hpp" +#include "lib3mf_interfaceexception.hpp" + +using namespace Lib3MF::Impl; + +/************************************************************************************************************************* + Class definition of CToolpathIterator +**************************************************************************************************************************/ + +IToolpath* CToolpathIterator::GetCurrentToolpath() +{ + return new CToolpath(std::dynamic_pointer_cast(GetCurrentResource())); +} + + diff --git a/Source/API/lib3mf_toolpathiterator.hpp b/Source/API/lib3mf_toolpathiterator.hpp new file mode 100644 index 000000000..d00a43c77 --- /dev/null +++ b/Source/API/lib3mf_toolpathiterator.hpp @@ -0,0 +1,89 @@ +/*++ + +Copyright (C) 2019 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is the class declaration of CToolpathIterator + +*/ + + +#ifndef __LIB3MF_TOOLPATHITERATOR +#define __LIB3MF_TOOLPATHITERATOR + +#include "lib3mf_interfaces.hpp" + +// Parent classes +#include "lib3mf_resourceiterator.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4250) +#endif + +// Include custom headers here. + + +namespace Lib3MF { +namespace Impl { + + +/************************************************************************************************************************* + Class declaration of CToolpathIterator +**************************************************************************************************************************/ + +class CToolpathIterator : public virtual IToolpathIterator, public virtual CResourceIterator { +private: + + /** + * Put private members here. + */ + +protected: + + /** + * Put protected members here. + */ + +public: + + /** + * Put additional public members here. They will not be visible in the external API. + */ + + + /** + * Public member functions to implement. + */ + + IToolpath * GetCurrentToolpath() override; + +}; + +} // namespace Impl +} // namespace Lib3MF + +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#endif // __LIB3MF_TOOLPATHITERATOR diff --git a/Source/API/lib3mf_toolpathlayerdata.cpp b/Source/API/lib3mf_toolpathlayerdata.cpp new file mode 100644 index 000000000..6d4fce4be --- /dev/null +++ b/Source/API/lib3mf_toolpathlayerdata.cpp @@ -0,0 +1,219 @@ +/*++ + +Copyright (C) 2019 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is a stub class definition of CToolpathLayerData + +*/ + +#include "lib3mf_toolpathlayerdata.hpp" +#include "lib3mf_interfaceexception.hpp" +#include "lib3mf_toolpathprofile.hpp" +#include "lib3mf_object.hpp" +#include "lib3mf_toolpathlayerreader.hpp" +#include "lib3mf_builditem.hpp" +#include "lib3mf_customdomtree.hpp" + + +// Include custom headers here. +#include "Common/Platform/NMR_ImportStream_Shared_Memory.h" +#include "Common/Platform/NMR_ImportStream_Unique_Memory.h" +#include "Common/Platform/NMR_XmlWriter_Native.h" +#include "Model/Classes/NMR_ModelConstants.h" + +using namespace Lib3MF::Impl; + +/************************************************************************************************************************* + Class definition of CToolpathLayerData +**************************************************************************************************************************/ + +#define LIB3MF_MAXTOOLPATHHATCHCOUNT 1024*1024*1024 +#define LIB3MF_MAXTOOLPATHPOINTCOUNT 1024*1024*1024 + +CToolpathLayerData::CToolpathLayerData(NMR::PModelToolpathLayerWriteData pLayerData) + : m_pLayerData(pLayerData) +{ + if (pLayerData.get() == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM); + + +} + + +CToolpathLayerData::~CToolpathLayerData() +{ + +} + + +Lib3MF_uint32 CToolpathLayerData::RegisterProfile(IToolpathProfile* pProfile) +{ + if (pProfile == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM); + + CToolpathProfile* pProfileClass = dynamic_cast (pProfile); + if (pProfileClass == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + return m_pLayerData->RegisterProfile(pProfileClass->getProfileInstance()); +} + +Lib3MF_uint32 CToolpathLayerData::RegisterBuildItem(IBuildItem* pBuildItem) +{ + if (pBuildItem == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM); + + CBuildItem* pBuildItemClass = dynamic_cast (pBuildItem); + if (pBuildItemClass == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDCAST); + + return m_pLayerData->RegisterPart(pBuildItemClass->getBuildItemInstance()); +} + + +void CToolpathLayerData::Finish() +{ + m_pLayerData->finishWriting(); +} + +ICustomDOMTree* CToolpathLayerData::AddCustomData(const std::string& sNameSpace, const std::string& sDataName) +{ + auto pXMLData = std::make_shared(sNameSpace, sDataName); + m_pLayerData->addCustomXMLData(pXMLData); + return new CCustomDOMTree(pXMLData); +} + + +void CToolpathLayerData::WriteHatchData(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const Lib3MF_uint64 nPointDataBufferSize, const Lib3MF::sPosition2D* pPointDataBuffer) +{ + if (nPointDataBufferSize == 0) + throw ELib3MFInterfaceException(LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT); + if (nPointDataBufferSize % 2 != 0) + throw ELib3MFInterfaceException(LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT); + if (nPointDataBufferSize / 2 > LIB3MF_MAXTOOLPATHHATCHCOUNT) + throw ELib3MFInterfaceException(LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT); + + unsigned int nHatchCount = (unsigned int)nPointDataBufferSize / 2; + double dUnits = m_pLayerData->getUnits(); + + // If we have a streamwriter, write all points into a binary stream + std::vector X1Values; + std::vector Y1Values; + std::vector X2Values; + std::vector Y2Values; + + X1Values.resize(nHatchCount); + Y1Values.resize(nHatchCount); + X2Values.resize(nHatchCount); + Y2Values.resize(nHatchCount); + + unsigned nIndex; + const Lib3MF::sPosition2D* pPointData = pPointDataBuffer; + for (nIndex = 0; nIndex < nHatchCount; nIndex++) { + X1Values[nIndex] = (int)(pPointData->m_Coordinates[0] / dUnits); + Y1Values[nIndex] = (int)(pPointData->m_Coordinates[1] / dUnits); + pPointData++; + X2Values[nIndex] = (int)(pPointData->m_Coordinates[0] / dUnits); + Y2Values[nIndex] = (int)(pPointData->m_Coordinates[1] / dUnits); + pPointData++; + } + + m_pLayerData->WriteHatchData(nProfileID, nPartID, nHatchCount, X1Values.data(), Y1Values.data(), X2Values.data(), Y2Values.data()); + +} + +void CToolpathLayerData::WriteLoop(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const Lib3MF_uint64 nPointDataBufferSize, const Lib3MF::sPosition2D* pPointDataBuffer) +{ + if (nPointDataBufferSize == 0) + throw ELib3MFInterfaceException(LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT); + if (nPointDataBufferSize > LIB3MF_MAXTOOLPATHPOINTCOUNT) + throw ELib3MFInterfaceException(LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT); + + unsigned int nPointCount = (unsigned int)nPointDataBufferSize; + double dUnits = m_pLayerData->getUnits(); + + std::vector XValues; + std::vector YValues; + + XValues.resize(nPointCount); + YValues.resize(nPointCount); + + unsigned nIndex; + const Lib3MF::sPosition2D* pPointData = pPointDataBuffer; + for (nIndex = 0; nIndex < nPointCount; nIndex++) { + XValues[nIndex] = (int)(pPointData->m_Coordinates[0] / dUnits); + YValues[nIndex] = (int)(pPointData->m_Coordinates[1] / dUnits); + pPointData++; + } + + m_pLayerData->WriteLoop(nProfileID, nPartID, nPointCount, XValues.data(), YValues.data()); + +} + +void CToolpathLayerData::WritePolyline(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const Lib3MF_uint64 nPointDataBufferSize, const Lib3MF::sPosition2D* pPointDataBuffer) +{ + + if (nPointDataBufferSize == 0) + throw ELib3MFInterfaceException(LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT); + if (nPointDataBufferSize > LIB3MF_MAXTOOLPATHPOINTCOUNT) + throw ELib3MFInterfaceException(LIB3MF_ERROR_TOOLPATH_INVALIDPOINTCOUNT); + + unsigned int nPointCount = (unsigned int)nPointDataBufferSize; + double dUnits = m_pLayerData->getUnits(); + + std::vector XValues; + std::vector YValues; + + XValues.resize(nPointCount); + YValues.resize(nPointCount); + + unsigned nIndex; + const Lib3MF::sPosition2D* pPointData = pPointDataBuffer; + for (nIndex = 0; nIndex < nPointCount; nIndex++) { + XValues[nIndex] = (int)(pPointData->m_Coordinates[0] / dUnits); + YValues[nIndex] = (int)(pPointData->m_Coordinates[1] / dUnits); + pPointData++; + } + + m_pLayerData->WritePolyline(nProfileID, nPartID, nPointCount, XValues.data(), YValues.data()); +} + + + +std::string CToolpathLayerData::GetLayerDataUUID() +{ + return m_pLayerData->getUUID(); +} + + +void CToolpathLayerData::SetSegmentAttribute(const std::string& sNameSpace, const std::string& sAttributeName, const std::string& sValue) +{ + m_pLayerData->setCustomSegmentAttribute(sNameSpace, sAttributeName, sValue); +} + +void CToolpathLayerData::ClearSegmentAttributes() +{ + m_pLayerData->clearCustomSegmentAttributes(); +} \ No newline at end of file diff --git a/Source/API/lib3mf_toolpathlayerdata.hpp b/Source/API/lib3mf_toolpathlayerdata.hpp new file mode 100644 index 000000000..ce1e79b1a --- /dev/null +++ b/Source/API/lib3mf_toolpathlayerdata.hpp @@ -0,0 +1,101 @@ +/*++ + +Copyright (C) 2019 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is the class declaration of CToolpathLayerData + +*/ + + +#ifndef __LIB3MF_TOOLPATHLAYERDATA +#define __LIB3MF_TOOLPATHLAYERDATA + +#include "lib3mf_interfaces.hpp" + +#include "Common/Platform/NMR_ExportStream.h" +#include "Common/Platform/NMR_XmlWriter.h" +#include "Common/Platform/NMR_ExportStream_Memory.h" + +// Parent classes +#include "lib3mf_base.hpp" +#pragma warning( push) +#pragma warning( disable : 4250) + +// Include custom headers here. +#include "Model/Classes/NMR_ModelAttachment.h" +#include "Model/Classes/NMR_ModelToolpathLayerWriteData.h" + +namespace Lib3MF { +namespace Impl { + + +/************************************************************************************************************************* + Class declaration of CToolpathLayerData +**************************************************************************************************************************/ + +class CToolpathLayerData : public virtual IToolpathLayerData, public virtual CBase { +private: + + +protected: + + NMR::PModelToolpathLayerWriteData m_pLayerData; + +public: + + CToolpathLayerData(NMR::PModelToolpathLayerWriteData pLayerData); + + virtual ~CToolpathLayerData(); + + std::string GetLayerDataUUID() override; + + void SetSegmentAttribute(const std::string& sNameSpace, const std::string& sAttributeName, const std::string& sValue) override; + + void ClearSegmentAttributes() override; + + Lib3MF_uint32 RegisterProfile(IToolpathProfile* pProfile) override; + + Lib3MF_uint32 RegisterBuildItem(IBuildItem* pBuildItem) override; + + void WriteHatchData(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const Lib3MF_uint64 nPointDataBufferSize, const Lib3MF::sPosition2D * pPointDataBuffer) override; + + void WriteLoop(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const Lib3MF_uint64 nPointDataBufferSize, const Lib3MF::sPosition2D * pPointDataBuffer) override; + + void WritePolyline(const Lib3MF_uint32 nProfileID, const Lib3MF_uint32 nPartID, const Lib3MF_uint64 nPointDataBufferSize, const Lib3MF::sPosition2D * pPointDataBuffer) override; + + void Finish() override; + + ICustomDOMTree* AddCustomData(const std::string& sNameSpace, const std::string& sDataName) override; + + +}; + +} // namespace Impl +} // namespace Lib3MF + +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#endif // __LIB3MF_TOOLPATHLAYERDATA diff --git a/Source/API/lib3mf_toolpathlayerreader.cpp b/Source/API/lib3mf_toolpathlayerreader.cpp new file mode 100644 index 000000000..d2c98cff8 --- /dev/null +++ b/Source/API/lib3mf_toolpathlayerreader.cpp @@ -0,0 +1,250 @@ +/*++ + +Copyright (C) 2019 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is a stub class definition of CToolpathLayerReader + +*/ + +#include "lib3mf_toolpathlayerreader.hpp" +#include "lib3mf_interfaceexception.hpp" +#include "lib3mf_customdomtree.hpp" + +using namespace Lib3MF::Impl; + +/************************************************************************************************************************* + Class definition of CToolpathLayerReader +**************************************************************************************************************************/ + +CToolpathLayerReader::CToolpathLayerReader(NMR::PModelToolpathLayerReadData pReadData) + : m_pReadData(pReadData) +{ + if (pReadData.get() == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM); + +} + +CToolpathLayerReader::~CToolpathLayerReader() +{ + +} + +std::string CToolpathLayerReader::GetLayerDataUUID() +{ + return m_pReadData->getUUID(); +} + +Lib3MF_uint32 CToolpathLayerReader::GetSegmentCount() +{ + return m_pReadData->getSegmentCount(); +} + +void CToolpathLayerReader::GetSegmentInfo(const Lib3MF_uint32 nIndex, Lib3MF::eToolpathSegmentType& eType, Lib3MF_uint32& nPointCount) +{ + NMR::eModelToolpathSegmentType eNMRType; + uint32_t nProfileID; + uint32_t nPartID; + m_pReadData->getSegmentInfo(nIndex, eNMRType, nProfileID, nPartID, nPointCount); + + switch (eNMRType) { + case NMR::eModelToolpathSegmentType::HatchSegment: eType = eToolpathSegmentType::Hatch; break; + case NMR::eModelToolpathSegmentType::LoopSegment: eType = eToolpathSegmentType::Loop; break; + case NMR::eModelToolpathSegmentType::PolylineSegment: eType = eToolpathSegmentType::Polyline; break; + default: + eType = eToolpathSegmentType::Unknown; + } +} + +IToolpathProfile* CToolpathLayerReader::GetSegmentProfile(const Lib3MF_uint32 nIndex) +{ + throw ELib3MFInterfaceException(LIB3MF_ERROR_NOTIMPLEMENTED); +} + +std::string CToolpathLayerReader::GetSegmentProfileUUID(const Lib3MF_uint32 nIndex) +{ + NMR::eModelToolpathSegmentType eNMRType; + uint32_t nProfileID; + uint32_t nPartID; + uint32_t nPointCount; + m_pReadData->getSegmentInfo(nIndex, eNMRType, nProfileID, nPartID, nPointCount); + + return m_pReadData->mapIDtoUUID(nProfileID); +} + +IBuildItem* CToolpathLayerReader::GetSegmentPart(const Lib3MF_uint32 nIndex) +{ + throw ELib3MFInterfaceException(LIB3MF_ERROR_NOTIMPLEMENTED); +} + +std::string CToolpathLayerReader::GetSegmentPartUUID(const Lib3MF_uint32 nIndex) +{ + NMR::eModelToolpathSegmentType eNMRType; + uint32_t nProfileID; + uint32_t nPartID; + uint32_t nPointCount; + m_pReadData->getSegmentInfo(nIndex, eNMRType, nProfileID, nPartID, nPointCount); + + return m_pReadData->mapIDtoUUID(nPartID); +} + +Lib3MF_uint32 CToolpathLayerReader::GetSegmentLocalPartID(const Lib3MF_uint32 nIndex) +{ + NMR::eModelToolpathSegmentType eNMRType; + uint32_t nProfileID; + uint32_t nPartID; + uint32_t nPointCount; + m_pReadData->getSegmentInfo(nIndex, eNMRType, nProfileID, nPartID, nPointCount); + + return nPartID; +} + +std::string CToolpathLayerReader::GetPartUUIDByLocalPartID(const Lib3MF_uint32 nLocalPartID) +{ + return m_pReadData->mapIDtoUUID(nLocalPartID); +} + + +void CToolpathLayerReader::GetSegmentPointData(const Lib3MF_uint32 nIndex, Lib3MF_uint64 nPointDataBufferSize, Lib3MF_uint64* pPointDataNeededCount, Lib3MF::sPosition2D* pPointDataBuffer) +{ + NMR::eModelToolpathSegmentType eNMRType; + uint32_t nProfileID; + uint32_t nPartID; + uint32_t nPointCount; + m_pReadData->getSegmentInfo(nIndex, eNMRType, nProfileID, nPartID, nPointCount); + + if (pPointDataNeededCount != nullptr) { + *pPointDataNeededCount = nPointCount; + } + + if (pPointDataBuffer != nullptr) { + if (nPointDataBufferSize < nPointCount) + throw ELib3MFInterfaceException(LIB3MF_ERROR_BUFFERTOOSMALL); + + if (nPointCount > 0) { + + uint32_t nPointIndex; + Lib3MF::sPosition2D* pPoint = pPointDataBuffer; + for (nPointIndex = 0; nPointIndex < nPointCount; nPointIndex++) { + NMR::NVEC2 position = m_pReadData->getSegmentPoint(nIndex, nPointIndex); + pPoint->m_Coordinates[0] = position.m_values.x; + pPoint->m_Coordinates[1] = position.m_values.y; + pPoint++; + } + } + } +} + +Lib3MF_uint32 CToolpathLayerReader::GetCustomDataCount() +{ + return m_pReadData->getCustomXMLDataCount(); +} + +ICustomDOMTree* CToolpathLayerReader::GetCustomData(const Lib3MF_uint32 nIndex) +{ + return new CCustomDOMTree(m_pReadData->getCustomXMLData (nIndex)); +} + +void CToolpathLayerReader::GetCustomDataName(const Lib3MF_uint32 nIndex, std::string& sNameSpace, std::string& sDataName) +{ + auto pCustomData = m_pReadData->getCustomXMLData(nIndex); + sNameSpace = pCustomData->getNameSpace(); + sDataName = pCustomData->getRootName(); +} + +void CToolpathLayerReader::FindAttributeInfoByName(const std::string& sNameSpace, const std::string& sAttributeName, Lib3MF_uint32& nID, Lib3MF::eToolpathAttributeType& eAttributeType) +{ + std::pair attributeInfo = m_pReadData->findAttribute(sNameSpace, sAttributeName, true); + nID = attributeInfo.first; + + switch (attributeInfo.second) { + case NMR::eModelToolpathSegmentAttributeType::SegmentAttributeInt64: + eAttributeType = eToolpathAttributeType::Integer; + break; + case NMR::eModelToolpathSegmentAttributeType::SegmentAttributeDouble: + eAttributeType = eToolpathAttributeType::Double; + break; + default: + throw ELib3MFInterfaceException(LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE); + + + } +} + + +Lib3MF_uint32 CToolpathLayerReader::FindAttributeIDByName(const std::string& sNameSpace, const std::string& sAttributeName) +{ + std::pair attributeInfo = m_pReadData->findAttribute(sNameSpace, sAttributeName, true); + return attributeInfo.first; +} + +Lib3MF::eToolpathAttributeType CToolpathLayerReader::FindAttributeValueByName(const std::string& sNameSpace, const std::string& sAttributeName) +{ + std::pair attributeInfo = m_pReadData->findAttribute(sNameSpace, sAttributeName, true); + + switch (attributeInfo.second) { + case NMR::eModelToolpathSegmentAttributeType::SegmentAttributeInt64: + return eToolpathAttributeType::Integer; + case NMR::eModelToolpathSegmentAttributeType::SegmentAttributeDouble: + return eToolpathAttributeType::Double; + default: + throw ELib3MFInterfaceException(LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE); + + } + +} + +Lib3MF_int64 CToolpathLayerReader::GetSegmentIntegerAttributeByID(const Lib3MF_uint32 nIndex, const Lib3MF_uint32 nID) +{ + return m_pReadData->getSegmentIntegerAttribute (nIndex, nID); +} + +Lib3MF_int64 CToolpathLayerReader::GetSegmentIntegerAttributeByName(const Lib3MF_uint32 nIndex, const std::string& sNameSpace, const std::string& sAttributeName) +{ + std::pair attributeInfo = m_pReadData->findAttribute(sNameSpace, sAttributeName, true); + if (attributeInfo.second != NMR::eModelToolpathSegmentAttributeType::SegmentAttributeInt64) + throw ELib3MFInterfaceException(LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE); + + return m_pReadData->getSegmentIntegerAttribute(nIndex, attributeInfo.first); + +} + + + + + +Lib3MF_double CToolpathLayerReader::GetSegmentDoubleAttributeByID(const Lib3MF_uint32 nIndex, const Lib3MF_uint32 nID) +{ + return m_pReadData->getSegmentDoubleAttribute(nIndex, nID); +} + +Lib3MF_double CToolpathLayerReader::GetSegmentDoubleAttributeByName(const Lib3MF_uint32 nIndex, const std::string& sNameSpace, const std::string& sAttributeName) +{ + std::pair attributeInfo = m_pReadData->findAttribute(sNameSpace, sAttributeName, true); + if (attributeInfo.second != NMR::eModelToolpathSegmentAttributeType::SegmentAttributeDouble) + throw ELib3MFInterfaceException(LIB3MF_ERROR_TOOLPATH_INVALIDATTRIBUTETYPE); + + return m_pReadData->getSegmentDoubleAttribute(nIndex, attributeInfo.first); +} + diff --git a/Source/API/lib3mf_toolpathlayerreader.hpp b/Source/API/lib3mf_toolpathlayerreader.hpp new file mode 100644 index 000000000..b127f135d --- /dev/null +++ b/Source/API/lib3mf_toolpathlayerreader.hpp @@ -0,0 +1,118 @@ +/*++ + +Copyright (C) 2019 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is the class declaration of CToolpathLayerReader + +*/ + + +#ifndef __LIB3MF_TOOLPATHLAYERREADER +#define __LIB3MF_TOOLPATHLAYERREADER + +#include "lib3mf_interfaces.hpp" + +// Parent classes +#include "lib3mf_base.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4250) +#endif + + +// Include custom headers here. +#include "Model/Classes/NMR_ModelToolpathLayerReadData.h" + +namespace Lib3MF { +namespace Impl { + + +/************************************************************************************************************************* + Class declaration of CToolpathLayerReader +**************************************************************************************************************************/ + +class CToolpathLayerReader : public virtual IToolpathLayerReader, public virtual CBase { +private: + +protected: + + NMR::PModelToolpathLayerReadData m_pReadData; + +public: + + CToolpathLayerReader(NMR::PModelToolpathLayerReadData pReadData); + + virtual ~CToolpathLayerReader(); + + std::string GetLayerDataUUID() override; + + Lib3MF_uint32 GetSegmentCount() override; + + void GetSegmentInfo(const Lib3MF_uint32 nIndex, Lib3MF::eToolpathSegmentType & eType, Lib3MF_uint32 & nPointCount) override; + + IToolpathProfile * GetSegmentProfile(const Lib3MF_uint32 nIndex) override; + + std::string GetSegmentProfileUUID(const Lib3MF_uint32 nIndex) override; + + IBuildItem * GetSegmentPart(const Lib3MF_uint32 nIndex) override; + + std::string GetSegmentPartUUID(const Lib3MF_uint32 nIndex) override; + + Lib3MF_uint32 GetSegmentLocalPartID(const Lib3MF_uint32 nIndex) override; + + std::string GetPartUUIDByLocalPartID(const Lib3MF_uint32 nLocalPartID) override; + + void GetSegmentPointData(const Lib3MF_uint32 nIndex, Lib3MF_uint64 nPointDataBufferSize, Lib3MF_uint64* pPointDataNeededCount, Lib3MF::sPosition2D * pPointDataBuffer) override; + + Lib3MF_uint32 GetCustomDataCount() override; + + ICustomDOMTree* GetCustomData(const Lib3MF_uint32 nIndex) override; + + void GetCustomDataName(const Lib3MF_uint32 nIndex, std::string& sNameSpace, std::string& sDataName) override; + + void FindAttributeInfoByName(const std::string& sNameSpace, const std::string& sAttributeName, Lib3MF_uint32& nID, Lib3MF::eToolpathAttributeType& eAttributeType) override; + + Lib3MF_uint32 FindAttributeIDByName(const std::string& sNameSpace, const std::string& sAttributeName) override; + + Lib3MF::eToolpathAttributeType FindAttributeValueByName(const std::string& sNameSpace, const std::string& sAttributeName) override; + + Lib3MF_int64 GetSegmentIntegerAttributeByID(const Lib3MF_uint32 nIndex, const Lib3MF_uint32 nID) override; + + Lib3MF_int64 GetSegmentIntegerAttributeByName(const Lib3MF_uint32 nIndex, const std::string& sNameSpace, const std::string& sAttributeName) override; + + Lib3MF_double GetSegmentDoubleAttributeByID(const Lib3MF_uint32 nIndex, const Lib3MF_uint32 nID) override; + + Lib3MF_double GetSegmentDoubleAttributeByName(const Lib3MF_uint32 nIndex, const std::string& sNameSpace, const std::string& sAttributeName) override; + + +}; + +} // namespace Impl +} // namespace Lib3MF + +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#endif // __LIB3MF_TOOLPATHLAYERREADER diff --git a/Source/API/lib3mf_toolpathprofile.cpp b/Source/API/lib3mf_toolpathprofile.cpp new file mode 100644 index 000000000..3589fc218 --- /dev/null +++ b/Source/API/lib3mf_toolpathprofile.cpp @@ -0,0 +1,200 @@ +/*++ + +Copyright (C) 2019 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is a stub class definition of CToolpathProfile + +*/ + +#include "lib3mf_toolpathprofile.hpp" +#include "lib3mf_interfaceexception.hpp" +// Include custom headers here. +#include "Common/NMR_StringUtils.h" + + +using namespace Lib3MF::Impl; + +/************************************************************************************************************************* + Class definition of CToolpathProfile +**************************************************************************************************************************/ + + +CToolpathProfile::CToolpathProfile(NMR::PModelToolpathProfile pToolpathProfile) + : m_pToolpathProfile(pToolpathProfile) +{ + if (pToolpathProfile.get() == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM); +} + + +CToolpathProfile::~CToolpathProfile() +{ + +} + +std::string CToolpathProfile::GetUUID() +{ + return m_pToolpathProfile->getUUID(); +} + +std::string CToolpathProfile::GetName() +{ + return m_pToolpathProfile->getName(); +} + +Lib3MF_uint32 CToolpathProfile::GetParameterCount() +{ + return m_pToolpathProfile->getParameterCount(); +} + +std::string CToolpathProfile::GetParameterName(const Lib3MF_uint32 nIndex) +{ + return m_pToolpathProfile->getParameterName(nIndex); + +} + +std::string CToolpathProfile::GetParameterNameSpace(const Lib3MF_uint32 nIndex) +{ + return m_pToolpathProfile->getParameterNameSpace(nIndex); +} + + +void CToolpathProfile::SetName(const std::string& sName) +{ + m_pToolpathProfile->setName(sName); +} + + +NMR::PModelToolpathProfile CToolpathProfile::getProfileInstance() +{ + return m_pToolpathProfile; +} + +bool CToolpathProfile::HasParameterValue(const std::string& sNameSpaceName, const std::string& sValueName) +{ + return m_pToolpathProfile->hasValue(sNameSpaceName, sValueName); +} + + +std::string CToolpathProfile::GetParameterValue(const std::string& sNameSpaceName, const std::string& sValueName) +{ + std::string sValue = m_pToolpathProfile->getValue(sNameSpaceName, sValueName); + return sValue; +} + +std::string CToolpathProfile::GetParameterValueDef(const std::string& sNameSpaceName, const std::string& sValueName, const std::string& sDefaultValue) +{ + if (!m_pToolpathProfile->hasValue(sNameSpaceName, sValueName)) + return sDefaultValue; + + std::string sValue = m_pToolpathProfile->getValue(sNameSpaceName, sValueName); + return sValue; +} + +Lib3MF_double CToolpathProfile::GetParameterDoubleValue(const std::string& sNameSpaceName, const std::string& sValueName) +{ + std::string sValue = m_pToolpathProfile->getValue(sNameSpaceName, sValueName); + return std::stod(sValue); +} + +Lib3MF_double CToolpathProfile::GetParameterDoubleValueDef(const std::string& sNameSpaceName, const std::string& sValueName, const Lib3MF_double dDefaultValue) +{ + if (!m_pToolpathProfile->hasValue(sNameSpaceName, sValueName)) + return dDefaultValue; + + std::string sValue = m_pToolpathProfile->getValue(sNameSpaceName, sValueName); + return std::stod(sValue); +} + + +Lib3MF_int64 CToolpathProfile::GetParameterIntegerValue(const std::string& sNameSpaceName, const std::string& sValueName) +{ + std::string sValue = m_pToolpathProfile->getValue(sNameSpaceName, sValueName); + return std::stoll(sValue); +} + +Lib3MF_int64 CToolpathProfile::GetParameterIntegerValueDef(const std::string& sNameSpaceName, const std::string& sValueName, const Lib3MF_int64 nDefaultValue) +{ + if (!m_pToolpathProfile->hasValue(sNameSpaceName, sValueName)) + return nDefaultValue; + + std::string sValue = m_pToolpathProfile->getValue(sNameSpaceName, sValueName); + return std::stoll(sValue); + +} + +bool CToolpathProfile::GetParameterBoolValue(const std::string& sNameSpaceName, const std::string& sValueName) +{ + std::string sValue = NMR::fnTrimString (NMR::fnStringToLower (m_pToolpathProfile->getValue(sNameSpaceName, sValueName))); + if (sValue == "true") + return true; + + if (sValue == "false") + return true; + + return (std::stoll(sValue) != 0); +} + +bool CToolpathProfile::GetParameterBoolValueDef(const std::string& sNameSpaceName, const std::string& sValueName, const bool bDefaultValue) +{ + if (!m_pToolpathProfile->hasValue(sNameSpaceName, sValueName)) + return bDefaultValue; + + std::string sValue = NMR::fnTrimString(NMR::fnStringToLower(m_pToolpathProfile->getValue(sNameSpaceName, sValueName))); + if (sValue == "true") + return true; + + if (sValue == "false") + return true; + + return (std::stoll(sValue) != 0); +} + +void CToolpathProfile::SetParameterValue(const std::string& sNameSpaceName, const std::string& sValueName, const std::string& sValue) +{ + m_pToolpathProfile->addValue(sNameSpaceName, sValueName, sValue); +} + + +void CToolpathProfile::SetParameterDoubleValue(const std::string& sNameSpaceName, const std::string& sValueName, const Lib3MF_double dValue) +{ + m_pToolpathProfile->addValue(sNameSpaceName, sValueName, std::to_string(dValue)); +} + + +void CToolpathProfile::SetParameterIntegerValue(const std::string& sNameSpaceName, const std::string& sValueName, const Lib3MF_int64 nValue) +{ + m_pToolpathProfile->addValue(sNameSpaceName, sValueName, std::to_string(nValue)); + +} + +void CToolpathProfile::SetParameterBoolValue(const std::string& sNameSpaceName, const std::string& sValueName, const bool bValue) +{ + if (bValue) + m_pToolpathProfile->addValue(sNameSpaceName, sValueName, "true"); + else + m_pToolpathProfile->addValue(sNameSpaceName, sValueName, "false"); +} + diff --git a/Source/API/lib3mf_toolpathprofile.hpp b/Source/API/lib3mf_toolpathprofile.hpp new file mode 100644 index 000000000..9c96637ae --- /dev/null +++ b/Source/API/lib3mf_toolpathprofile.hpp @@ -0,0 +1,118 @@ +/*++ + +Copyright (C) 2019 3MF Consortium (Original Author) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: This is the class declaration of CToolpathProfile + +*/ + + +#ifndef __LIB3MF_TOOLPATHPROFILE +#define __LIB3MF_TOOLPATHPROFILE + +#include "lib3mf_interfaces.hpp" + +// Parent classes +#include "lib3mf_base.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4250) +#endif + +// Include custom headers here. +#include "Model/Classes/NMR_ModelToolpathProfile.h" +#include "Model/Classes/NMR_ModelToolpath.h" + +namespace Lib3MF { +namespace Impl { + + +/************************************************************************************************************************* + Class declaration of CToolpathProfile +**************************************************************************************************************************/ + +class CToolpathProfile : public virtual IToolpathProfile, public virtual CBase { +private: + + +protected: + + NMR::PModelToolpathProfile m_pToolpathProfile; + +public: + + CToolpathProfile(NMR::PModelToolpathProfile pToolpathProfile); + + virtual ~CToolpathProfile(); + + std::string GetUUID() override; + + std::string GetName() override; + + Lib3MF_uint32 GetParameterCount() override; + + std::string GetParameterName(const Lib3MF_uint32 nIndex) override; + + std::string GetParameterNameSpace(const Lib3MF_uint32 nIndex) override; + + bool HasParameterValue(const std::string & sNameSpaceName, const std::string & sValueName) override; + + std::string GetParameterValue(const std::string& sNameSpaceName, const std::string& sValueName) override; + + std::string GetParameterValueDef(const std::string& sNameSpaceName, const std::string& sValueName, const std::string& sDefaultValue) override; + + Lib3MF_double GetParameterDoubleValue(const std::string& sNameSpaceName, const std::string& sValueName) override; + + Lib3MF_double GetParameterDoubleValueDef(const std::string& sNameSpaceName, const std::string& sValueName, const Lib3MF_double dDefaultValue) override; + + Lib3MF_int64 GetParameterIntegerValue(const std::string& sNameSpaceName, const std::string& sValueName) override; + + Lib3MF_int64 GetParameterIntegerValueDef(const std::string& sNameSpaceName, const std::string& sValueName, const Lib3MF_int64 nDefaultValue) override; + + bool GetParameterBoolValue(const std::string& sNameSpaceName, const std::string& sValueName) override; + + bool GetParameterBoolValueDef(const std::string& sNameSpaceName, const std::string& sValueName, const bool bDefaultValue) override; + + void SetName(const std::string & sName) override; + + void SetParameterValue(const std::string& sNameSpaceName, const std::string& sValueName, const std::string& sValue) override; + + void SetParameterDoubleValue(const std::string& sNameSpaceName, const std::string& sValueName, const Lib3MF_double dValue) override; + + void SetParameterIntegerValue(const std::string& sNameSpaceName, const std::string& sValueName, const Lib3MF_int64 nValue) override; + + void SetParameterBoolValue(const std::string& sNameSpaceName, const std::string& sValueName, const bool bValue) override; + + NMR::PModelToolpathProfile getProfileInstance(); + +}; + +} // namespace Impl +} // namespace Lib3MF + +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#endif // __LIB3MF_TOOLPATHPROFILE diff --git a/Source/API/lib3mf_writer.cpp b/Source/API/lib3mf_writer.cpp index 27d4ac9b7..7721d8bdf 100644 --- a/Source/API/lib3mf_writer.cpp +++ b/Source/API/lib3mf_writer.cpp @@ -33,6 +33,7 @@ Abstract: This is a stub class definition of CWriter // Include custom headers here. #include "lib3mf_interfaceexception.hpp" #include "lib3mf_accessright.hpp" +#include "lib3mf_binarystream.hpp" #include "lib3mf_contentencryptionparams.hpp" #include "Common/Platform/NMR_Platform.h" #include "Common/Platform/NMR_ExportStream_Callback.h" @@ -42,6 +43,7 @@ Abstract: This is a stub class definition of CWriter #include "Common/NMR_SecureContext.h" #include "Model/Classes/NMR_KeyStore.h" #include "Common/NMR_ModelWarnings.h" +#include "Common/NMR_StringUtils.h" @@ -268,4 +270,58 @@ std::string CWriter::GetWarning(const Lib3MF_uint32 nIndex, Lib3MF_uint32 & nErr Lib3MF_uint32 CWriter::GetWarningCount() { return writer().warnings()->getWarningCount(); -} \ No newline at end of file +} + +NMR::PModelWriter CWriter::getModelWriter() +{ + return m_pWriter; + +} + +IBinaryStream* CWriter::CreateBinaryStream(const std::string& sIndexPath, const std::string& sBinaryPath) +{ + m_pWriter->allowBinaryStreams(); + + NMR::PExportStreamMemory pExportStream = std::make_shared(); + NMR::PChunkedBinaryStreamWriter pStreamWriter = std::make_shared(sIndexPath, sBinaryPath, pExportStream); + + std::unique_ptr pBinaryStream(new CBinaryStream(sIndexPath, sBinaryPath, pStreamWriter)); + + m_pWriter->registerBinaryStream(sIndexPath, pBinaryStream->GetUUID(), pStreamWriter); + + return pBinaryStream.release(); +} + +void CWriter::AssignBinaryStream(IBase* pInstance, IBinaryStream* pBinaryStream) +{ + if (pBinaryStream == nullptr) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDPARAM); + + IToolpathLayerData* pLayerData = dynamic_cast (pInstance); + if (pLayerData != nullptr) + m_pWriter->assignBinaryStream(pLayerData->GetLayerDataUUID(), pBinaryStream->GetUUID()); + + IObject* pObject = dynamic_cast (pInstance); + if (pObject != nullptr) { + bool bHasUUID; + std::string sUUID = pObject->GetUUID(bHasUUID); + if (bHasUUID) { + m_pWriter->assignBinaryStream(sUUID, pBinaryStream->GetUUID()); + } + } +} + + + +void CWriter::RegisterCustomNamespace(const std::string& sPrefix, const std::string& sNameSpace) +{ + if (sPrefix.empty ()) + throw ELib3MFInterfaceException(LIB3MF_ERROR_EMPTYNAMESPACEPREFIX); + if (sNameSpace.empty()) + throw ELib3MFInterfaceException(LIB3MF_ERROR_EMPTYNAMESPACE); + + if (!NMR::fnStringIsValidAlphanumericNameString (sPrefix)) + throw ELib3MFInterfaceException(LIB3MF_ERROR_INVALIDNAMESPACEPREFIX); + + m_pWriter->registerCustomNameSpace(sPrefix, sNameSpace, false); +} diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 2d94b2c24..1f0a8f5c1 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -8,6 +8,7 @@ if (USE_INCLUDED_LIBZIP) endif() endif() + if (USE_INCLUDED_ZLIB) file(GLOB ZLIB_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "Libraries/zlib/Source/*.c") endif() @@ -35,6 +36,7 @@ Source/API/lib3mf_basematerialgroup.cpp Source/API/lib3mf_basematerialgroupiterator.cpp Source/API/lib3mf_beamlattice.cpp Source/API/lib3mf_beamset.cpp +Source/API/lib3mf_binarystream.cpp Source/API/lib3mf_builditem.cpp Source/API/lib3mf_builditemiterator.cpp Source/API/lib3mf_colorgroup.cpp @@ -53,6 +55,10 @@ Source/API/lib3mf_multipropertygroupiterator.cpp Source/API/lib3mf_contentencryptionparams.cpp Source/API/lib3mf_accessright.cpp Source/API/lib3mf_consumer.cpp +Source/API/lib3mf_customdomtree.cpp +Source/API/lib3mf_customxmlattribute.cpp +Source/API/lib3mf_customxmlnode.cpp +Source/API/lib3mf_customxmlnodes.cpp Source/API/lib3mf_resourcedata.cpp Source/API/lib3mf_resourcedatagroup.cpp Source/API/lib3mf_keystore.cpp @@ -60,6 +66,7 @@ Source/API/lib3mf_model.cpp Source/API/lib3mf_object.cpp Source/API/lib3mf_objectiterator.cpp Source/API/lib3mf_packagepart.cpp +Source/API/lib3mf_persistentreadersource.cpp Source/API/lib3mf_reader.cpp Source/API/lib3mf_resource.cpp Source/API/lib3mf_resourceiterator.cpp @@ -70,9 +77,17 @@ Source/API/lib3mf_texture2d.cpp Source/API/lib3mf_texture2dgroup.cpp Source/API/lib3mf_texture2dgroupiterator.cpp Source/API/lib3mf_texture2diterator.cpp +Source/API/lib3mf_toolpath.cpp +Source/API/lib3mf_toolpathiterator.cpp +Source/API/lib3mf_toolpathlayerdata.cpp +Source/API/lib3mf_toolpathlayerreader.cpp +Source/API/lib3mf_toolpathprofile.cpp Source/API/lib3mf_writer.cpp Source/API/lib3mf_utils.cpp Source/Common/3MF_ProgressMonitor.cpp +Source/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamCollection.cpp +Source/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamReader.cpp +Source/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamWriter.cpp Source/Common/Math/NMR_Matrix.cpp Source/Common/Math/NMR_PairMatchingTree.cpp Source/Common/Math/NMR_Vector.cpp @@ -124,6 +139,9 @@ Source/Common/Platform/NMR_XmlReader.cpp Source/Common/Platform/NMR_XmlWriter.cpp Source/Common/Platform/NMR_XmlWriter_Native.cpp Source/Model/Classes/NMR_PackageResourceID.cpp +Source/Model/Classes/NMR_CustomXMLAttribute.cpp +Source/Model/Classes/NMR_CustomXMLNode.cpp +Source/Model/Classes/NMR_CustomXMLTree.cpp Source/Model/Classes/NMR_Model.cpp Source/Model/Classes/NMR_ModelAttachment.cpp Source/Model/Classes/NMR_ModelBaseMaterial.cpp @@ -143,6 +161,11 @@ Source/Model/Classes/NMR_ModelObject.cpp Source/Model/Classes/NMR_ModelResource.cpp Source/Model/Classes/NMR_ModelTexture2D.cpp Source/Model/Classes/NMR_ModelTexture2DGroup.cpp +Source/Model/Classes/NMR_ModelToolpath.cpp +Source/Model/Classes/NMR_ModelToolpathLayer.cpp +Source/Model/Classes/NMR_ModelToolpathLayerReadData.cpp +Source/Model/Classes/NMR_ModelToolpathLayerWriteData.cpp +Source/Model/Classes/NMR_ModelToolpathProfile.cpp Source/Model/Classes/NMR_ModelSlice.cpp Source/Model/Classes/NMR_ModelSliceStack.cpp Source/Model/Classes/NMR_KeyStore.cpp @@ -161,6 +184,7 @@ Source/Model/Reader/BeamLattice1702/NMR_ModelReaderNode_BeamLattice1702_BeamLatt Source/Model/Reader/BeamLattice1702/NMR_ModelReaderNode_BeamLattice1702_BeamSet.cpp Source/Model/Reader/BeamLattice1702/NMR_ModelReaderNode_BeamLattice1702_BeamSets.cpp Source/Model/Reader/BeamLattice1702/NMR_ModelReaderNode_BeamLattice1702_Ref.cpp +Source/Model/Reader/NMR_ModelPersistentDataSource.cpp Source/Model/Reader/NMR_ModelReader.cpp Source/Model/Reader/NMR_ModelReaderNode.cpp Source/Model/Reader/NMR_ModelReaderNode_ModelBase.cpp @@ -221,6 +245,13 @@ Source/Model/Reader/Slice1507/NMR_ModelReader_Slice1507_SliceRefResources.cpp Source/Model/Reader/Slice1507/NMR_ModelReader_Slice1507_SliceStack.cpp Source/Model/Reader/Slice1507/NMR_ModelReader_Slice1507_Vertex.cpp Source/Model/Reader/Slice1507/NMR_ModelReader_Slice1507_Vertices.cpp +Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathData.cpp +Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathDataNode.cpp +Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathLayer.cpp +Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathLayers.cpp +Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathProfile.cpp +Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathProfiles.cpp +Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathResource.cpp Source/Model/Reader/SecureContent101/NMR_ModelReaderNode_KeyStore.cpp Source/Model/Reader/SecureContent101/NMR_ModelReaderNode_KeyStoreCipherValue.cpp Source/Model/Reader/SecureContent101/NMR_ModelReaderNode_KeyStoreKEKParams.cpp @@ -230,6 +261,20 @@ Source/Model/Reader/SecureContent101/NMR_ModelReaderNode_KeyStoreAccessRight.cpp Source/Model/Reader/NMR_ModelReaderNode_StringValue.cpp Source/Model/Reader/SecureContent101/NMR_ModelReaderNode_KeyStoreResourceData.cpp Source/Model/Reader/SecureContent101/NMR_ModelReaderNode_KeyStoreResourceDataGroup.cpp +Source/Model/ToolpathReader/NMR_ToolpathReader.cpp +Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Data.cpp +Source/Model/ToolpathReader/NMR_ToolpathReaderNode_DataNode.cpp +Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Hatch.cpp +Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Layer.cpp +Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Part.cpp +Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Parts.cpp +Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Point.cpp +Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Profile.cpp +Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Profiles.cpp +Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Segment.cpp +Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Segments.cpp +Source/Model/ToolpathReader/NMR_ToolpathReaderNode_ZHatch.cpp +Source/Model/ToolpathReader/NMR_ToolpathReaderNode_ZPoint.cpp Source/Model/Writer/NMR_KeyStoreOpcPackageWriter.cpp Source/Model/Writer/NMR_ModelWriter.cpp Source/Model/Writer/NMR_ModelWriterNode.cpp diff --git a/Source/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamCollection.cpp b/Source/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamCollection.cpp new file mode 100644 index 000000000..552009cc0 --- /dev/null +++ b/Source/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamCollection.cpp @@ -0,0 +1,65 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--*/ + +#include "Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamCollection.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_StringUtils.h" + +#include + + +namespace NMR { + + CChunkedBinaryStreamCollection::CChunkedBinaryStreamCollection() + { + + } + + void CChunkedBinaryStreamCollection::registerReader(const std::string & sPath, PChunkedBinaryStreamReader pReader) + { + if (pReader.get() == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + std::string sAbsolutePath = fnRemoveLeadingPathDelimiter(sPath); + m_ReaderMap.insert(std::make_pair (sAbsolutePath, pReader)); + } + + CChunkedBinaryStreamReader * CChunkedBinaryStreamCollection::findReader(const std::string & sPath) + { + std::string sAbsolutePath = fnRemoveLeadingPathDelimiter(sPath); + + auto iIter = m_ReaderMap.find (sAbsolutePath); + if (iIter != m_ReaderMap.end()) + return iIter->second.get(); + + return nullptr; + } + + +} + diff --git a/Source/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamReader.cpp b/Source/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamReader.cpp new file mode 100644 index 000000000..1b2a7805f --- /dev/null +++ b/Source/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamReader.cpp @@ -0,0 +1,399 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--*/ + +#include "Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamReader.h" +#include "Common/Platform/NMR_ImportStream_Shared_Memory.h" +#include "Common/NMR_Exception.h" +//#include "Libraries/lzma/LzmaLib.h" + +#include + + +namespace NMR { + + CChunkedBinaryStreamReaderChunk::CChunkedBinaryStreamReaderChunk(CChunkedBinaryStreamReader * pReader, const BINARYCHUNKFILECHUNK & Chunk, const nfUint32 nChunkIndex) + : m_pReader (pReader), + m_nChunkIndex (nChunkIndex), + m_Chunk (Chunk), + m_bHasCachedData(false), + m_nCurrentReadPosition(0), + m_nCurrentEndPosition(0) + { + if (pReader == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + if (Chunk.m_UncompressedDataSize > BINARYCHUNKFILEMAXCHUNKDATASIZE) + throw CNMRException(NMR_ERROR_INVALIDFILECHUNKDATASIZE); + if (Chunk.m_CompressedDataSize > BINARYCHUNKFILEMAXCHUNKDATASIZE) + throw CNMRException(NMR_ERROR_INVALIDFILECHUNKDATASIZE); + if (Chunk.m_CompressedPropsSize > BINARYCHUNKFILEMAXCHUNKDATASIZE) + throw CNMRException(NMR_ERROR_INVALIDFILECHUNKDATASIZE); + + CImportStream * pImportStream = pReader->m_pImportStream.get(); + + if (Chunk.m_EntryCount > BINARYCHUNKFILEMAXENTRYCOUNT) + throw CNMRException(NMR_ERROR_TOOMANYBINARYCHUNKENTRIES); + + auto ChunkMap = &pReader->m_ChunkMap; + + pImportStream->seekPosition(Chunk.m_EntryTableStart, true); + if (Chunk.m_EntryCount > 0) { + m_ChunkEntries.resize(Chunk.m_EntryCount); + pImportStream->readIntoBuffer((nfByte *) m_ChunkEntries.data(), sizeof (BINARYCHUNKFILEENTRY) * m_ChunkEntries.size(), true); + + for (size_t nEntryIndex = 0; nEntryIndex < m_ChunkEntries.size(); nEntryIndex++) { + nfUint32 nEntryID = m_ChunkEntries[nEntryIndex].m_EntryID; + auto iChunkIter = ChunkMap->find(nEntryID); + if (iChunkIter != ChunkMap->end()) + throw CNMRException(NMR_ERROR_DUPLICATECHUNKENTRY); + + pReader->m_ChunkMap.insert(std::make_pair (nEntryID, std::make_pair (m_nChunkIndex, (nfUint32) nEntryIndex))); + } + } + + } + + void CChunkedBinaryStreamReaderChunk::loadData() + { + if (m_bHasCachedData) + return; + + m_Data.resize(m_Chunk.m_UncompressedDataSize); + + if (m_Chunk.m_UncompressedDataSize > 0) { + + std::vector PropsData; + std::vector CompressedData; + + if (m_Chunk.m_CompressedPropsSize == 0) + throw CNMRException(NMR_ERROR_INVALIDCHUNKCOMPRESSEDDATA); + if (m_Chunk.m_CompressedDataSize == 0) + throw CNMRException(NMR_ERROR_INVALIDCHUNKCOMPRESSEDDATA); + + PropsData.resize(m_Chunk.m_CompressedPropsSize); + CompressedData.resize(m_Chunk.m_CompressedDataSize); + + CImportStream * pImportStream = m_pReader->m_pImportStream.get(); + pImportStream->seekPosition(m_Chunk.m_CompressedDataStart, true); + + if (m_Chunk.m_CompressedDataSize > 0) + pImportStream->readIntoBuffer(CompressedData.data(), m_Chunk.m_CompressedDataSize, true); + if (m_Chunk.m_CompressedPropsSize > 0) + pImportStream->readIntoBuffer(PropsData.data(), m_Chunk.m_CompressedPropsSize, true); + + size_t destLen = m_Data.size(); + size_t srcLen = CompressedData.size(); + size_t propsLen = PropsData.size(); + + //int error; + //error = LzmaUncompress(m_Data.data(), &destLen, CompressedData.data(), &srcLen, PropsData.data(), propsLen); + //if (error != SZ_OK) + throw CNMRException(NMR_ERROR_COULDNOTUNCOMPRESSDATA); + } + + m_bHasCachedData = true; + m_nCurrentReadPosition = 0; + m_nCurrentEndPosition = 0; + } + + void CChunkedBinaryStreamReaderChunk::unloadData() + { + if (!m_bHasCachedData) + return; + + m_Data.resize(0); + m_bHasCachedData = false; + m_nCurrentReadPosition = 0; + m_nCurrentEndPosition = 0; + } + + + void CChunkedBinaryStreamReaderChunk::getInformation(nfUint32 nEntryIndex, eChunkedBinaryDataType & dataType, nfUint32 & nCount) + { + if (nEntryIndex >= m_ChunkEntries.size()) + throw CNMRException(NMR_ERROR_INVALIDENTRYINDEX); + + auto pChunkEntry = &m_ChunkEntries[nEntryIndex]; + + switch (pChunkEntry->m_EntryType) { + case BINARYCHUNKFILEENTRYTYPE_INT32ARRAY_NOPREDICTION: + case BINARYCHUNKFILEENTRYTYPE_INT32ARRAY_DELTAPREDICTION: + dataType = edtInt32Array; + if ((pChunkEntry->m_SizeInBytes % 4) != 0) + throw CNMRException(NMR_ERROR_INVALIDCHUNKDATA); + + nCount = (pChunkEntry->m_SizeInBytes / 4); + break; + + case BINARYCHUNKFILEENTRYTYPE_FLOAT32ARRAY_NOPREDICTION: + case BINARYCHUNKFILEENTRYTYPE_FLOAT32ARRAY_DELTAPREDICTION: + dataType = edtFloatArray; + if (pChunkEntry->m_SizeInBytes < 4) + throw CNMRException(NMR_ERROR_INVALIDCHUNKDATA); + if ((pChunkEntry->m_SizeInBytes % 4) != 0) + throw CNMRException(NMR_ERROR_INVALIDCHUNKDATA); + + nCount = ((pChunkEntry->m_SizeInBytes - 4) / 4); + break; + + default: + dataType = edtUnknown; + nCount = 0; + } + } + + void CChunkedBinaryStreamReaderChunk::seekToEntry(nfUint32 nEntryIndex, nfUint32 & nEntryType, nfUint32 & nEntrySize) + { + if (nEntryIndex >= m_ChunkEntries.size()) + throw CNMRException(NMR_ERROR_INVALIDENTRYINDEX); + + auto pEntry = &m_ChunkEntries[nEntryIndex]; + if (pEntry->m_PositionInChunk > m_Data.size()) + throw CNMRException(NMR_ERROR_INVALIDCHUNKENTRYPOSITION); + + nfUint32 nReadEndPosition; + nfUint32 nReadStartPosition = pEntry->m_PositionInChunk; + if ((nEntryIndex + 1) < m_ChunkEntries.size()) { + nReadEndPosition = m_ChunkEntries[nEntryIndex + 1].m_PositionInChunk; + } + else { + nReadEndPosition = (nfUint32) m_Data.size(); + } + + if (nReadEndPosition < nReadStartPosition) + throw CNMRException(NMR_ERROR_INVALIDCHUNKENTRYENDPOSITION); + nEntrySize = nReadEndPosition - nReadStartPosition; + + if (nEntrySize != pEntry->m_SizeInBytes) + throw CNMRException(NMR_ERROR_INVALIDCHUNKENTRYSIZE); + + m_nCurrentReadPosition = nReadStartPosition; + m_nCurrentEndPosition = nReadEndPosition; + + nEntryType = pEntry->m_EntryType; + } + + nfInt32 CChunkedBinaryStreamReaderChunk::readInt32() + { + if (m_nCurrentReadPosition > m_Data.size()) + throw CNMRException(NMR_ERROR_INVALIDCHUNKENTRYPOSITION); + if (m_nCurrentEndPosition > m_Data.size ()) + throw CNMRException(NMR_ERROR_INVALIDCHUNKENTRYENDPOSITION); + if ((m_nCurrentReadPosition + 4) > m_nCurrentEndPosition) + throw CNMRException(NMR_ERROR_NOTENOUGHDATATOREADFROMCHUNK); + + nfInt32 * pIntValue = (nfInt32*) &m_Data[m_nCurrentReadPosition]; + m_nCurrentReadPosition += 4; + + return *pIntValue; + } + + nfFloat CChunkedBinaryStreamReaderChunk::readFloat() + { + if (m_nCurrentReadPosition > m_Data.size()) + throw CNMRException(NMR_ERROR_INVALIDCHUNKENTRYPOSITION); + if (m_nCurrentEndPosition > m_Data.size()) + throw CNMRException(NMR_ERROR_INVALIDCHUNKENTRYENDPOSITION); + if ((m_nCurrentReadPosition + 4) > m_nCurrentEndPosition) + throw CNMRException(NMR_ERROR_NOTENOUGHDATATOREADFROMCHUNK); + + nfFloat * pFloatValue = (nfFloat*)&m_Data[m_nCurrentReadPosition]; + m_nCurrentReadPosition += 4; + + return *pFloatValue; + } + + + + CChunkedBinaryStreamReader::CChunkedBinaryStreamReader(PImportStream pImportStream) + : m_pImportStream(pImportStream) + { + if (pImportStream.get() == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + readHeader(); + } + + void CChunkedBinaryStreamReader::readHeader() + { + nfUint64 streamSize = m_pImportStream->retrieveSize(); + if (streamSize < sizeof(BINARYCHUNKFILEHEADER)) + throw CNMRException(NMR_ERROR_INVALIDCHUNKSTREAM); + + BINARYCHUNKFILEHEADER Header; + m_pImportStream->seekPosition(0, true); + m_pImportStream->readIntoBuffer((nfByte *)&Header, sizeof(BINARYCHUNKFILEHEADER), true); + + if (Header.m_Sign != BINARYCHUNKFILEHEADERSIGN) + throw CNMRException(NMR_ERROR_INVALIDCHUNKSTREAMSIGN); + if (Header.m_Version != BINARYCHUNKFILEHEADERVERSION) + throw CNMRException(NMR_ERROR_INVALIDCHUNKSTREAMVERSION); + + if (Header.m_ChunkCount > BINARYCHUNKFILEMAXCHUNKCOUNT) + throw CNMRException(NMR_ERROR_TOOMANYBINARYCHUNKS); + + if (Header.m_ChunkCount > 0) { + m_Chunks.resize(Header.m_ChunkCount); + + std::vector ChunkArray; + ChunkArray.resize(Header.m_ChunkCount); + + m_pImportStream->seekPosition(Header.m_ChunkTableStart, true); + m_pImportStream->readIntoBuffer((nfByte *)ChunkArray.data(), sizeof(BINARYCHUNKFILECHUNK) * ChunkArray.size(), true); + + for (size_t nIndex = 0; nIndex < ChunkArray.size(); nIndex++) { + m_Chunks[nIndex] = std::make_shared (this, ChunkArray[nIndex], (nfUint32) nIndex); + } + } + + } + + CChunkedBinaryStreamReaderChunk * CChunkedBinaryStreamReader::findChunkByEntry(_In_ nfUint32 nEntryID, _Out_ nfUint32 & nEntryIndex) + { + + auto iEntryIter = m_ChunkMap.find(nEntryID); + if (iEntryIter == m_ChunkMap.end()) + throw CNMRException(NMR_ERROR_BINARYCHUNKENTRYNOTFOUND); + + nfUint32 nChunkIndex = iEntryIter->second.first; + nEntryIndex = iEntryIter->second.second; + + return m_Chunks[nChunkIndex].get(); + } + + void CChunkedBinaryStreamReader::findChunkInformation(nfUint32 nEntryID, eChunkedBinaryDataType & dataType, nfUint32 & nCount) + { + nfUint32 nEntryIndex; + auto pChunk = findChunkByEntry(nEntryID, nEntryIndex); + pChunk->getInformation(nEntryIndex, dataType, nCount); + } + + nfUint32 CChunkedBinaryStreamReader::getTypedChunkEntryCount(nfUint32 nEntryID, eChunkedBinaryDataType dataType) + { + nfUint32 nCount; + eChunkedBinaryDataType existingDataType; + + findChunkInformation(nEntryID, existingDataType, nCount); + if (existingDataType != dataType) + throw CNMRException(NMR_ERROR_UNEXPECTEDCHUNKDATATYPE); + + return nCount; + } + + void CChunkedBinaryStreamReader::readIntArray(nfUint32 nEntryID, nfInt32 * pData, nfUint32 nDataCount) + { + nfUint32 nEntryIndex, nEntryType, nEntrySize; + nfUint32 nIndex; + nfInt32 nLastValue; + + auto pChunk = findChunkByEntry(nEntryID, nEntryIndex); + pChunk->loadData(); + pChunk->seekToEntry(nEntryIndex, nEntryType, nEntrySize); + + if ((nEntrySize % 4) != 0) + throw CNMRException(NMR_ERROR_INVALIDCHUNKDATA); + nfUint32 nExistingCount = (nEntrySize / 4); + if (nDataCount != nExistingCount) + throw CNMRException(NMR_ERROR_INVALIDBUFFERSIZE); + + if (nDataCount > 0) { + + switch (nEntryType) { + case BINARYCHUNKFILEENTRYTYPE_INT32ARRAY_NOPREDICTION: + for (nIndex = 0; nIndex < nDataCount; nIndex++) + pData[nIndex] = pChunk->readInt32(); + + break; + case BINARYCHUNKFILEENTRYTYPE_INT32ARRAY_DELTAPREDICTION: + nLastValue = 0; + for (nIndex = 0; nIndex < nDataCount; nIndex++) { + pData[nIndex] = pChunk->readInt32() + nLastValue; + nLastValue = pData[nIndex]; + } + break; + + default: + throw CNMRException(NMR_ERROR_INVALIDCHUNKENTRYTYPE); + } + } + + } + + void CChunkedBinaryStreamReader::readFloatArray(nfUint32 nEntryID, nfFloat * pData, nfUint32 nDataCount) + { + nfUint32 nEntryIndex, nEntryType, nEntrySize; + nfUint32 nIndex; + nfInt32 nValue, nLastValue; + + auto pChunk = findChunkByEntry(nEntryID, nEntryIndex); + pChunk->loadData(); + pChunk->seekToEntry(nEntryIndex, nEntryType, nEntrySize); + + if ((nEntrySize % 4) != 0) + throw CNMRException(NMR_ERROR_INVALIDCHUNKDATA); + if (nEntrySize < 4) + throw CNMRException(NMR_ERROR_INVALIDCHUNKDATA); + nfUint32 nExistingCount = ((nEntrySize - 4) / 4); + if (nDataCount != nExistingCount) + throw CNMRException(NMR_ERROR_INVALIDBUFFERSIZE); + + nfFloat fUnits = pChunk->readFloat(); + + if (nDataCount > 0) { + + switch (nEntryType) { + case BINARYCHUNKFILEENTRYTYPE_FLOAT32ARRAY_NOPREDICTION: + for (nIndex = 0; nIndex < nDataCount; nIndex++) + pData[nIndex] = pChunk->readInt32() * fUnits; + + break; + case BINARYCHUNKFILEENTRYTYPE_FLOAT32ARRAY_DELTAPREDICTION: + nLastValue = 0; + for (nIndex = 0; nIndex < nDataCount; nIndex++) { + nValue = pChunk->readInt32() + nLastValue; + pData[nIndex] = nValue * fUnits; + nLastValue = nValue; + } + break; + default: + throw CNMRException(NMR_ERROR_INVALIDCHUNKENTRYTYPE); + + } + } + + } + + + void CChunkedBinaryStreamReader::clearCache() + { + for (auto iChunk : m_Chunks) + iChunk->unloadData(); + } + +} + diff --git a/Source/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamWriter.cpp b/Source/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamWriter.cpp new file mode 100644 index 000000000..cd67dd483 --- /dev/null +++ b/Source/Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamWriter.cpp @@ -0,0 +1,511 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--*/ + +#include "Common/ChunkedBinaryStream/NMR_ChunkedBinaryStreamWriter.h" +#include "Common/Platform/NMR_ImportStream_Shared_Memory.h" +#include "Common/NMR_Exception.h" + +#include "Common/Platform/NMR_XmlWriter_Native.h" +#include "Model/Classes/NMR_ModelConstants.h" +#include +#include + + +namespace NMR { + + + CChunkedBinaryStreamWriter::CChunkedBinaryStreamWriter(const std::string& sIndexPath, const std::string& sBinaryPath, PExportStreamMemory pBinaryExportStream) + : m_pBinaryExportStream (pBinaryExportStream), + m_elementIDCounter(1), + m_CurrentChunk(nullptr), + m_ChunkTableStart(0), + m_bIsFinished(false), + m_bIsEmpty(true), + m_bQuantizeFloats(false), + m_dQuantizationUnits(0.001), + m_PredictionType (eptNoPredicition), + m_nLZMALevel (5), + m_bEnableLZMA (false), + m_sBinaryPath (sBinaryPath), + m_sIndexPath (sIndexPath) + { + if (pBinaryExportStream.get() == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + writeHeader(); + } + + void CChunkedBinaryStreamWriter::beginChunk() + { + if (m_bIsFinished) + throw CNMRException(NMR_ERROR_STREAMWRITERALREADYFINISHED); + + if (m_CurrentChunk != nullptr) + finishChunk (); + + BINARYCHUNKFILECHUNK Chunk; + Chunk.m_EntryCount = 0; + Chunk.m_EntryTableStart = 0; + Chunk.m_CompressedDataSize = 0; + Chunk.m_UncompressedDataSize = 0; + Chunk.m_CompressedDataStart = 0; + for (int j = 0; j < BINARYCHUNKFILECHUNKRESERVED; j++) + Chunk.m_Reserved[j] = 0; + for (int j = 0; j < 16; j++) + Chunk.m_MD5Checksum[j] = 0; + m_Chunks.push_back(Chunk); + + m_CurrentChunk = &(*m_Chunks.rbegin()); + m_CurrentChunk->m_ChunkID = (uint32_t) m_Chunks.size(); + m_CurrentChunkEntries = std::make_shared>(); + m_CurrentChunkData.clear(); + + } + + void CChunkedBinaryStreamWriter::finishChunk() + { + if (m_CurrentChunk == nullptr) + throw CNMRException(NMR_ERROR_NOSTREAMCHUNKOPEN); + + __NMRASSERT(m_CurrentChunk->m_UncompressedDataSize == (m_CurrentChunkData.size() * 4)); + + if (m_CurrentChunkEntries.get() != nullptr) { + + if (m_CurrentChunkEntries->size() > 0) { + m_CurrentChunk->m_EntryCount = (nfUint32)m_CurrentChunkEntries->size(); + m_CurrentChunk->m_EntryTableStart = m_pBinaryExportStream->getPosition(); + m_pBinaryExportStream->writeBuffer(m_CurrentChunkEntries->data(), m_CurrentChunkEntries->size() * sizeof(BINARYCHUNKFILEENTRY)); + + m_ChunkEntries.insert(std::make_pair(m_CurrentChunk->m_ChunkID, m_CurrentChunkEntries)); + } + } + + if (m_CurrentChunkData.size() > 0) { + std::vector outBuffer; + outBuffer.resize(m_CurrentChunk->m_UncompressedDataSize * 2); + + std::vector outProps; + outProps.resize(m_CurrentChunk->m_UncompressedDataSize * 2); + + nfByte * pInputBuffer = (nfByte*) m_CurrentChunkData.data(); + + size_t inputSize = m_CurrentChunkData.size() * 4; + size_t outBufferSize = outBuffer.size (); + size_t outPropsSize = outProps.size (); + + if (m_bEnableLZMA) { + + // TODO + throw CNMRException(NMR_ERROR_COULDNOTCOMPRESSDATA); + + } + else { + + // Uncompressed for LibZ Compression of 3MF Package + outBufferSize = inputSize; + for (size_t nIndex = 0; nIndex < inputSize; nIndex++) + outBuffer[nIndex] = pInputBuffer[nIndex]; + outPropsSize = 0; + + } + + m_CurrentChunk->m_CompressedDataSize = (nfUint32) outBufferSize; + m_CurrentChunk->m_CompressedPropsSize = (nfUint32) outPropsSize; + + m_CurrentChunk->m_CompressedDataStart = m_pBinaryExportStream->getPosition(); + m_pBinaryExportStream->writeBuffer (outBuffer.data(), outBufferSize); + m_pBinaryExportStream->writeBuffer (outProps.data(), outPropsSize); + } + + m_CurrentChunk = nullptr; + } + + void CChunkedBinaryStreamWriter::setEnableLZMA(bool bEnableLZMA) + { + m_bEnableLZMA = bEnableLZMA; + } + + void CChunkedBinaryStreamWriter::setLZMALevel(uint32_t nLZMALevel) + { + m_nLZMALevel = nLZMALevel; + } + + void CChunkedBinaryStreamWriter::finishWriting() + { + if (m_bIsFinished) + return; + + if (m_CurrentChunk != nullptr) + finishChunk(); + + writeChunkTable(); + writeHeader(); + + m_bIsFinished = true; + } + + + nfUint32 CChunkedBinaryStreamWriter::addIntArray(const nfInt32 * pData, nfUint32 nLength, eChunkedBinaryPredictionType predictionType) + { + nfUint32 nIndex; + + if (m_bIsFinished) + throw CNMRException(NMR_ERROR_STREAMWRITERALREADYFINISHED); + + if (pData == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + if (nLength == 0) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + if (m_CurrentChunk == nullptr) + beginChunk (); + + unsigned int nElementID = m_elementIDCounter; + m_elementIDCounter++; + + m_bIsEmpty = false; + + BINARYCHUNKFILEENTRY Entry; + Entry.m_EntryID = nElementID; + Entry.m_SizeInBytes = (nLength * 4); + Entry.m_PositionInChunk = m_CurrentChunk->m_UncompressedDataSize; + + switch (predictionType) { + case eptNoPredicition: + Entry.m_EntryType = BINARYCHUNKFILEENTRYTYPE_INT32ARRAY_NOPREDICTION; + for (nIndex = 0; nIndex < nLength; nIndex++) + m_CurrentChunkData.push_back (pData[nIndex]); + + break; + case eptDeltaPredicition: + Entry.m_EntryType = BINARYCHUNKFILEENTRYTYPE_INT32ARRAY_DELTAPREDICTION; + m_CurrentChunkData.push_back(pData[0]); + for (nIndex = 1; nIndex < nLength; nIndex++) + m_CurrentChunkData.push_back(pData[nIndex] - pData[nIndex - 1]); + + break; + default: + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + }; + + + if (m_CurrentChunkEntries.get () != nullptr) + m_CurrentChunkEntries->push_back(Entry); + + m_CurrentChunk->m_EntryCount++; + m_CurrentChunk->m_UncompressedDataSize += Entry.m_SizeInBytes; + + return nElementID; + + } + + + nfUint32 CChunkedBinaryStreamWriter::addRawFloatArray(const nfFloat* pData, nfUint32 nLength) + { + nfUint32 nIndex; + + if (m_bIsFinished) + throw CNMRException(NMR_ERROR_STREAMWRITERALREADYFINISHED); + + if (pData == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + if (nLength == 0) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + if (m_CurrentChunk == nullptr) + beginChunk(); + + unsigned int nElementID = m_elementIDCounter; + m_elementIDCounter++; + + m_bIsEmpty = false; + + BINARYCHUNKFILEENTRY Entry; + Entry.m_EntryID = nElementID; + Entry.m_SizeInBytes = (nLength * 4) + 4; + Entry.m_PositionInChunk = m_CurrentChunk->m_UncompressedDataSize; + + Entry.m_EntryType = BINARYCHUNKFILEENTRYTYPE_FLOAT32ARRAY_RAWDATA; + + for (nIndex = 0; nIndex < nLength; nIndex++) { + float fValue = pData[nIndex]; + nfInt32* pValue = (nfInt32*)&fValue; + + m_CurrentChunkData.push_back(*pValue); + } + + if (m_CurrentChunkEntries.get() != nullptr) + m_CurrentChunkEntries->push_back(Entry); + + m_CurrentChunk->m_EntryCount++; + m_CurrentChunk->m_UncompressedDataSize += Entry.m_SizeInBytes; + + return nElementID; + + + } + + nfUint32 CChunkedBinaryStreamWriter::addFloatArray(const nfFloat * pData, nfUint32 nLength, eChunkedBinaryPredictionType predictionType, nfFloat fDiscretizationUnits) + { + nfUint32 nIndex; + nfInt64 nValue; + nfInt64 nOldValue; + + if (fDiscretizationUnits <= 0.0f) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + if (m_bIsFinished) + throw CNMRException(NMR_ERROR_STREAMWRITERALREADYFINISHED); + + if (pData == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + if (nLength == 0) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + if (m_CurrentChunk == nullptr) + beginChunk(); + + unsigned int nElementID = m_elementIDCounter; + m_elementIDCounter++; + + m_bIsEmpty = false; + + BINARYCHUNKFILEENTRY Entry; + Entry.m_EntryID = nElementID; + Entry.m_SizeInBytes = (nLength * 4) + 4; + Entry.m_PositionInChunk = m_CurrentChunk->m_UncompressedDataSize; + + // Add Discretization units + m_CurrentChunkData.push_back(*((nfInt32 *)&fDiscretizationUnits)); + + switch (predictionType) { + case eptNoPredicition: + Entry.m_EntryType = BINARYCHUNKFILEENTRYTYPE_FLOAT32ARRAY_NOPREDICTION; + + for (nIndex = 0; nIndex < nLength; nIndex++) { + nfInt64 nValue = (nfInt64) (pData[nIndex] / fDiscretizationUnits); + if (abs (nValue) > BINARYCHUNKFILE_MAXFLOATUNITS) + throw CNMRException(NMR_ERROR_BINARYCHUNK_DISCRETIZATIONVALUEOUTOFRANGE); + + m_CurrentChunkData.push_back((nfInt32)nValue); + } + + break; + case eptDeltaPredicition: + Entry.m_EntryType = BINARYCHUNKFILEENTRYTYPE_FLOAT32ARRAY_DELTAPREDICTION; + + nValue = (nfInt64)(pData[0]); + if (abs(nValue) > BINARYCHUNKFILE_MAXFLOATUNITS) + throw CNMRException(NMR_ERROR_BINARYCHUNK_DISCRETIZATIONVALUEOUTOFRANGE); + nOldValue = nValue; + + m_CurrentChunkData.push_back((nfInt32) nValue); + for (nIndex = 1; nIndex < nLength; nIndex++) { + nValue = (nfInt64)(pData[nIndex] / fDiscretizationUnits); + if (abs(nValue) > BINARYCHUNKFILE_MAXFLOATUNITS) + throw CNMRException(NMR_ERROR_BINARYCHUNK_DISCRETIZATIONVALUEOUTOFRANGE); + m_CurrentChunkData.push_back(((nfInt32) nValue) - ((nfInt32) nOldValue)); + + nOldValue = nValue; + } + + break; + default: + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + }; + + + if (m_CurrentChunkEntries.get() != nullptr) + m_CurrentChunkEntries->push_back(Entry); + + m_CurrentChunk->m_EntryCount++; + m_CurrentChunk->m_UncompressedDataSize += Entry.m_SizeInBytes; + + return nElementID; + + } + + void CChunkedBinaryStreamWriter::writeHeader() + { + if (m_bIsFinished) + throw CNMRException(NMR_ERROR_STREAMWRITERALREADYFINISHED); + + if (m_CurrentChunk != nullptr) + throw CNMRException(NMR_ERROR_STREAMCHUNKALREADYOPEN); + + BINARYCHUNKFILEHEADER Header; + + Header.m_Sign = BINARYCHUNKFILEHEADERSIGN; + Header.m_Version = BINARYCHUNKFILEHEADERVERSION; + Header.m_ChunkCount = getChunkCount (); + Header.m_ChunkTableStart = m_ChunkTableStart; + for (int j = 0; j < BINARYCHUNKFILEHEADERRESERVED; j++) + Header.m_Reserved[j] = 0; + + m_pBinaryExportStream->seekPosition(0, true); + m_pBinaryExportStream->writeBuffer(&Header, sizeof(Header)); + m_pBinaryExportStream->seekFromEnd(0, true); + } + + nfUint32 CChunkedBinaryStreamWriter::getChunkCount() + { + return (nfUint32) m_Chunks.size (); + } + + void CChunkedBinaryStreamWriter::copyBinaryToStream(PExportStream pStream) + { + if (!m_bIsFinished) + throw CNMRException(NMR_ERROR_STREAMWRITERNOTFINISHED); + + if (pStream.get() == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + const nfByte * pData = m_pBinaryExportStream->getData(); + nfUint64 nDataSize = m_pBinaryExportStream->getDataSize(); + + pStream->writeBuffer(pData, nDataSize); + + } + + void CChunkedBinaryStreamWriter::writeIndexXML(PExportStream pStream) + { + if (pStream.get () == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + PXmlWriter_Native pXMLWriter = std::make_shared(pStream); + + pXMLWriter->WriteStartElement (nullptr, "binaryindex", XML_3MF_NAMESPACE_BINARYSPEC); + + pXMLWriter->WriteStartElement(nullptr, "chunks", nullptr); + pXMLWriter->WriteAttributeString(nullptr, "data", "", m_sBinaryPath.c_str()); + + for (auto& chunk : m_Chunks) { + std::string sChunkID = std::to_string(chunk.m_ChunkID); + std::string sChunkCompressedSize = std::to_string(chunk.m_CompressedDataSize); + std::string sChunkUncompressedSize = std::to_string(chunk.m_UncompressedDataSize); + std::string sChunkDataOffset = std::to_string(chunk.m_CompressedDataStart); + pXMLWriter->WriteStartElement(nullptr, "chunk", nullptr); + pXMLWriter->WriteAttributeString(nullptr, "id", "", sChunkID.c_str()); + pXMLWriter->WriteAttributeString(nullptr, "fileoffset", "", sChunkDataOffset.c_str()); + pXMLWriter->WriteAttributeString(nullptr, "compressedsize", "", sChunkCompressedSize.c_str()); + pXMLWriter->WriteAttributeString(nullptr, "uncompressedsize", "", sChunkUncompressedSize.c_str()); + + auto iIter = m_ChunkEntries.find(chunk.m_ChunkID); + if (iIter != m_ChunkEntries.end()) { + for (auto & entry : *iIter->second) { + pXMLWriter->WriteStartElement(nullptr, "entry", nullptr); + std::string sEntryID = std::to_string (entry.m_EntryID); + std::string sEntrySize = std::to_string(entry.m_SizeInBytes); + std::string sEntryPosition = std::to_string(entry.m_PositionInChunk); + std::string sEntryType; + switch (entry.m_EntryType) { + case BINARYCHUNKFILEENTRYTYPE_INT32ARRAY_NOPREDICTION: sEntryType = "int32_noprediction"; break; + case BINARYCHUNKFILEENTRYTYPE_INT32ARRAY_DELTAPREDICTION: sEntryType = "int32_deltaprediction"; break; + case BINARYCHUNKFILEENTRYTYPE_FLOAT32ARRAY_NOPREDICTION: sEntryType = "float32_noprediction"; break; + case BINARYCHUNKFILEENTRYTYPE_FLOAT32ARRAY_DELTAPREDICTION: sEntryType = "float32_deltaprediction"; break; + case BINARYCHUNKFILEENTRYTYPE_FLOAT32ARRAY_RAWDATA: sEntryType = "float32_rawdata"; break; + default: + sEntryType = "unknown"; + + } + + pXMLWriter->WriteAttributeString(nullptr, "id", nullptr, sEntryID.c_str()); + pXMLWriter->WriteAttributeString(nullptr, "size", nullptr, sEntrySize.c_str()); + pXMLWriter->WriteAttributeString(nullptr, "positioninchunk", nullptr, sEntryPosition.c_str()); + pXMLWriter->WriteAttributeString(nullptr, "type", nullptr, sEntryType.c_str()); + pXMLWriter->WriteEndElement(); + } + } + + pXMLWriter->WriteFullEndElement(); + + } + + pXMLWriter->WriteFullEndElement(); + + pXMLWriter->WriteFullEndElement(); + + pXMLWriter->WriteEndDocument(); + + } + + + void CChunkedBinaryStreamWriter::writeChunkTable() + { + if (m_bIsFinished) + throw CNMRException(NMR_ERROR_STREAMWRITERALREADYFINISHED); + + if (m_CurrentChunk != nullptr) + throw CNMRException(NMR_ERROR_STREAMCHUNKALREADYOPEN); + + m_ChunkTableStart = m_pBinaryExportStream->getPosition(); + if (m_Chunks.size() > 0) { + m_pBinaryExportStream->writeBuffer (m_Chunks.data(), sizeof (BINARYCHUNKFILECHUNK) * m_Chunks.size()); + } + } + + nfBool CChunkedBinaryStreamWriter::isEmpty() + { + return m_bIsEmpty; + } + + void CChunkedBinaryStreamWriter::setDefaultCompressionMode(bool bQuantizeFloat, double dQuantizationUnits, eChunkedBinaryPredictionType predictionType) + { + m_bQuantizeFloats = bQuantizeFloat; + m_dQuantizationUnits = dQuantizationUnits; + m_PredictionType = predictionType; + } + + bool CChunkedBinaryStreamWriter::getFloatQuantization() + { + return m_bQuantizeFloats; + } + + double CChunkedBinaryStreamWriter::getFloatQuantizationUnits() + { + return m_dQuantizationUnits; + } + + eChunkedBinaryPredictionType CChunkedBinaryStreamWriter::getPredictionType() + { + return m_PredictionType; + } + + std::string CChunkedBinaryStreamWriter::getBinaryPath() + { + return m_sBinaryPath; + } + + std::string CChunkedBinaryStreamWriter::getIndexPath() + { + return m_sIndexPath; + } + +} diff --git a/Source/Common/NMR_Exception.cpp b/Source/Common/NMR_Exception.cpp index 6f5187159..c80a01d56 100644 --- a/Source/Common/NMR_Exception.cpp +++ b/Source/Common/NMR_Exception.cpp @@ -132,6 +132,56 @@ namespace NMR { case NMR_ERROR_COULDNOTINFLATE: return "Failed to decompress part"; case NMR_ERROR_COULDNOTINITDEFLATE: return "Failed to initialize a zlib buffer"; case NMR_ERROR_TOOMANYSLICES: return "Too many slices"; + case NMR_ERROR_DUPLICATEVALUE: return "Duplicate value"; + case NMR_ERROR_ROOTNODECANNOTBEDELETED: return "Root node can not be deleted"; + case NMR_ERROR_TRIEDTOACCESSINVALIDATEDNODE: return "Tried to access invalidated node"; + case NMR_ERROR_XMLCHILDNODEISNOTUNIQUE: return "XML child node is not unique"; + case NMR_ERROR_XMLCHILDNODENOTFOUND: return "XML child node not found"; + case NMR_ERROR_XMLATTRIBUTENOTFOUND: return "XML attribute not found"; + case NMR_ERROR_DUPLICATEXMLATTRIBUTE: return "Duplicate XML attribute"; + case NMR_ERROR_TOOMANYCUSTOMXMLDATAENTRIES: return "Too many custom XML Data Entries"; + case NMR_ERROR_STREAMCHUNKALREADYOPEN: return "Stream Chunk already open"; + case NMR_ERROR_NOSTREAMCHUNKOPEN: return "No Stream Chunk open"; + case NMR_ERROR_STREAMWRITERALREADYFINISHED: return "Stream writer already finished"; + case NMR_ERROR_STREAMWRITERNOTFINISHED: return "Stream writer not finished"; + case NMR_ERROR_DUPLICATEBINARYSTREAM: return "Duplicate Binary Stream"; + case NMR_ERROR_DUPLICATEBINARYSTREAMPATH: return "Duplicate Binary Stream Path"; + case NMR_ERROR_COULDNOTCOMPRESSDATA: return "Could not compress data"; + case NMR_ERROR_BINARYCHUNK_DISCRETIZATIONVALUEOUTOFRANGE: return "Discretization Value out of range"; + case NMR_ERROR_DUPLICATEBINARYSTREAMUUID: return "Duplicate Binary Stream UUID"; + case NMR_ERROR_BINARYSTREAMNOTFOUND: return "Binary stream not found"; + case NMR_ERROR_BINARYSTREAMSNOTALLOWED: return "Binary streams not allowed"; + case NMR_ERROR_INVALIDCHUNKSTREAM: return "Invalid binary chunk stream"; + case NMR_ERROR_INVALIDCHUNKSTREAMSIGN: return "Invalid binary chunk stream sign"; + case NMR_ERROR_INVALIDCHUNKSTREAMVERSION: return "Invalid binary chunk stream version"; + case NMR_ERROR_TOOMANYBINARYCHUNKS: return "Too many binary chunks"; + case NMR_ERROR_TOOMANYBINARYCHUNKENTRIES: return "Too many binary chunk entries"; + case NMR_ERROR_DUPLICATECHUNKENTRY: return "Duplicate chunk entry in binary stream"; + case NMR_ERROR_INVALIDFILECHUNKDATASIZE: return "Invalid file chunk data size"; + case NMR_ERROR_INVALIDCHUNKCOMPRESSEDDATA: return "Invalid chunk compressed data"; + case NMR_ERROR_COULDNOTUNCOMPRESSDATA: return "Could not uncompressed data"; + case NMR_ERROR_BINARYCHUNKENTRYNOTFOUND: return "Binary chunk entry not found"; + case NMR_ERROR_INVALIDCHUNKDATA: return "Invalid chunk data"; + case NMR_ERROR_INVALIDCHUNKENTRYPOSITION: return "Invalid chunk entry position"; + case NMR_ERROR_INVALIDCHUNKENTRYENDPOSITION: return "Invalid chunk entry end position"; + case NMR_ERROR_INVALIDCHUNKENTRYSIZE: return "Invalid chunk entry size"; + case NMR_ERROR_NOTENOUGHDATATOREADFROMCHUNK: return "Not enough data to read from chunk"; + case NMR_ERROR_INVALIDCHUNKENTRYTYPE: return "Invalid chunk entry type"; + case NMR_ERROR_UNEXPECTEDCHUNKDATATYPE: return "Unexpected chunk data type"; + case NMR_ERROR_INVALIDFLOATVALUE: return "Invalid float value"; + case NMR_ERROR_SEGMENTATTRIBUTEDEFINEDAFTERREADING: return "Segment attribute defined after reading"; + case NMR_ERROR_INVALIDSEGMENTATTRIBUTETYPE: return "Invalid segment attribute type"; + case NMR_ERROR_INVALIDSEGMENTATTRIBUTENAMESPACE: return "Invalid segment attribute namespace"; + case NMR_ERROR_INVALIDSEGMENTATTRIBUTENAME: return "Invalid segment attribute name"; + case NMR_ERROR_INVALIDSEGMENTATTRIBUTEID: return "Invalid segment attribute id"; + case NMR_ERROR_INVALIDSEGMENTATTRIBUTEDATASIZE: return "Invalid segment attribute data size"; + case NMR_ERROR_SEGMENTATTRIBUTEISNOTUINT32: return "Segment attribute is not uint32"; + case NMR_ERROR_SEGMENTATTRIBUTEISNOTDOUBLE: return "Segment attribute is not double"; + case NMR_ERROR_SEGMENTATTRIBUTENOTFOUND: return "Segment attribute not found"; + case NMR_ERROR_NAMESPACEPREFIXALREADYDEFINED: return "Namespace prefix already defined"; + case NMR_ERROR_WRITERDOESNOTSUPPORTNAMESPACES: return "Writer does not support namespaces"; + case NMR_ERROR_NAMESPACEPREFIXISRESERVED: return "Namespace prefix is reserved"; + case NMR_ERROR_NAMESPACENOTFOUND: return "Namespace not found"; // Unhandled exception case NMR_ERROR_GENERICEXCEPTION: return NMR_GENERICEXCEPTIONSTRING; @@ -437,7 +487,26 @@ namespace NMR { case NMR_ERROR_KEYSTOREOPCCOULDNOTGETSTREAM: return "Could not get KeyStore stream"; case NMR_ERROR_KEYSTOREUNSUPPORTEDALGORITHM: return "The algorithm attribute is unsupported"; case NMR_ERROR_KEYSTORETOOMANYELEMENTS: return "Too many elements added to a keystore tree"; - + case NMR_ERROR_INVALIDMESHBINARYPATH: return "Invalid Mesh Binary Path"; + case NMR_ERROR_DUPLICATEMESHBINARYPATH: return "Duplicate Mesh Binary Path"; + case NMR_ERROR_INVALIDBINARYELEMENTID: return "Invalid XML attribute in namespace"; + case NMR_ERROR_NOBINARYSTREAMAVAILABLE: return "No Binary stream available"; + case NMR_ERROR_INCONSISTENTBINARYSTREAMCOUNT: return "Inconsistent binary stream count"; + case NMR_ERROR_MISSINGUNITFACTOR: return "Missing Unit Factor"; + case NMR_ERROR_MISSINGNAME: return "Missing Name"; + case NMR_ERROR_MISSINGLASERPOWER: return "Missing Laser Power"; + case NMR_ERROR_MISSINGLASERSPEED: return "Missing Laser Speed"; + case NMR_ERROR_MISSINGLASERFOCUS: return "Missing Laser Focus"; + case NMR_ERROR_MISSINGPATH: return "Missing Path"; + case NMR_ERROR_MISSINGZTOP: return "Missing ZTop"; + case NMR_ERROR_DUPLICATEID: return "Duplicate ID"; + case NMR_ERROR_MISSINGID: return "Missing ID"; + case NMR_ERROR_DUPLICATETYPEATTRIBUTE: return "Duplicate Type Attribute"; + case NMR_ERROR_INVALIDTYPEATTRIBUTE: return "Invalid Type Attribute"; + case NMR_ERROR_MISSINGTYPEATTRIBUTE: return "Missing Type Attribute"; + case NMR_ERROR_MISSINGCOORDINATE: return "Missing Coordinate"; + case NMR_ERROR_DATASOURCEISINVALIDATED: return "Data source is invalidated"; + // XML Parser Error Constants(0x9XXX) case NMR_ERROR_XMLPARSER_INVALIDATTRIBVALUE: return "Invalid XML attribute value"; case NMR_ERROR_XMLPARSER_INVALIDPARSERESULT: return "Invalid XML parse result"; @@ -476,6 +545,17 @@ namespace NMR { case NMR_ERROR_DEKDESCRIPTORNOTFOUND: return "Required data encryption client was not registered"; case NMR_ERROR_RNGCALLBACKNOTCRYPTOSTRONG: return "Using cryptographically weak random number generator"; + // Toolpath errors (0xBXXX) + case NMR_ERROR_TOOLPATH_NOTWRITINGHEADER: return "Not in toolpath header writing mode"; + case NMR_ERROR_TOOLPATH_NOTWRITINGDATA: return "Not in toolpath data writing mode"; + case NMR_ERROR_TOOLPATH_DATAHASBEENWRITTEN: return "Toolpath has already been written out"; + case NMR_ERROR_TOOLPATH_INVALIDPOINTCOUNT: return "Toolpath has an invalid number of points"; + case NMR_ERROR_LAYERSEGMENTNOTOPEN: return "Layer segment is not open"; + case NMR_ERROR_LAYERSEGMENTALREADYOPEN: return "Layer segment is already open"; + case NMR_ERROR_PROFILEVALUENOTFOUND: return "Profile valuenot found"; + case NMR_ERROR_TOOMANYPROFILEVALUES: return "Too many profile values"; + case NMR_ERROR_INVALIDPARAMETERINDEX: return "Invalid parameter index"; + default: return "unknown error"; } diff --git a/Source/Common/NMR_StringUtils.cpp b/Source/Common/NMR_StringUtils.cpp index 81dad377b..680711097 100644 --- a/Source/Common/NMR_StringUtils.cpp +++ b/Source/Common/NMR_StringUtils.cpp @@ -39,8 +39,26 @@ correctly and Exception-safe #include #include +#include +#include +#include + namespace NMR { + // trim from start (in place) + static inline void ltrim(std::string& s) { + s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](unsigned char ch) { + return !std::isspace(ch); + })); + } + + // trim from end (in place) + static inline void rtrim(std::string& s) { + s.erase(std::find_if(s.rbegin(), s.rend(), [](unsigned char ch) { + return !std::isspace(ch); + }).base(), s.end()); + } + // Lookup table to convert UTF8 bytes to sequence length const nfByte UTF8DecodeTable[256] = { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, @@ -829,6 +847,21 @@ namespace NMR { } } + std::string fnTrimString(_In_ std::string sString) + { + ltrim(sString); + rtrim(sString); + return sString; + } + + std::string fnStringToLower(_In_ std::string sString) + { + std::transform(sString.begin(), sString.end(), sString.begin(), + [](unsigned char c) { return std::tolower(c); }); + return sString; + } + + void decomposeKeyIntoNamespaceAndName(const std::string &sKey, std::string &sNameSpace, std::string &sName) { size_t cInd = sKey.find(":"); if (cInd != std::string::npos) { @@ -849,4 +882,24 @@ namespace NMR { return sNameSpace + ":" + sName; } + bool fnStringIsValidAlphanumericNameString(const std::string& sString) + { + if (sString.empty()) + return false; + + if (sString.at(0) == '_') + return false; + + for (const char& cChar : sString) { + if (!(((cChar >= '0') && (cChar <= '9')) + || ((cChar >= 'a') && (cChar <= 'z')) + || ((cChar >= 'A') && (cChar <= 'Z')) + || (cChar == '_') + )) + return false; + } + + return true; + } + } diff --git a/Source/Common/OPC/NMR_OpcPackageReader.cpp b/Source/Common/OPC/NMR_OpcPackageReader.cpp index d65c49ae2..58b5a632d 100644 --- a/Source/Common/OPC/NMR_OpcPackageReader.cpp +++ b/Source/Common/OPC/NMR_OpcPackageReader.cpp @@ -317,6 +317,17 @@ namespace NMR { return Stat.size; } + PImportStream COpcPackageReader::readPartStreamIntoMemory(_In_ std::string sPath) + { + std::string sRealPath = fnRemoveLeadingPathDelimiter(sPath); + PImportStream pStream = openZIPEntry(sRealPath); + if (pStream.get() == nullptr) + throw CNMRException(NMR_ERROR_COULDNOTCREATEOPCPART); + + return pStream->copyToMemory(); + } + + POpcPackagePart COpcPackageReader::createPart(_In_ std::string sPath) { std::string sRealPath = fnRemoveLeadingPathDelimiter (sPath); diff --git a/Source/Common/Platform/NMR_ExportStream_Memory.cpp b/Source/Common/Platform/NMR_ExportStream_Memory.cpp index 9de19e071..d456bc19b 100644 --- a/Source/Common/Platform/NMR_ExportStream_Memory.cpp +++ b/Source/Common/Platform/NMR_ExportStream_Memory.cpp @@ -40,7 +40,7 @@ namespace NMR { } nfBool CExportStreamMemory::seekPosition(_In_ nfUint64 position, _In_ nfBool bHasToSucceed) { - if (position >= m_Buffer.size() && bHasToSucceed) { + if (position > m_Buffer.size() && bHasToSucceed) { throw CNMRException(NMR_ERROR_COULDNOTSEEKSTREAM); } m_Position = position; @@ -48,7 +48,7 @@ namespace NMR { } nfBool CExportStreamMemory::seekForward(_In_ nfUint64 bytes, _In_ nfBool bHasToSucceed) { - if (bytes + m_Position >= m_Buffer.size() && bHasToSucceed) { + if (bytes + m_Position > m_Buffer.size() && bHasToSucceed) { throw CNMRException(NMR_ERROR_COULDNOTSEEKSTREAM); } m_Position = bytes + m_Position; @@ -56,7 +56,7 @@ namespace NMR { } nfBool CExportStreamMemory::seekFromEnd(_In_ nfUint64 bytes, _In_ nfBool bHasToSucceed) { - if (bytes >= m_Buffer.size() && bHasToSucceed) { + if (bytes > m_Buffer.size() && bHasToSucceed) { throw CNMRException(NMR_ERROR_COULDNOTSEEKSTREAM); } m_Position = m_Buffer.size() - bytes; diff --git a/Source/Common/Platform/NMR_XmlWriter_Native.cpp b/Source/Common/Platform/NMR_XmlWriter_Native.cpp index e0d55d6ac..cf0b4b897 100644 --- a/Source/Common/Platform/NMR_XmlWriter_Native.cpp +++ b/Source/Common/Platform/NMR_XmlWriter_Native.cpp @@ -344,13 +344,17 @@ namespace NMR { } } - void CXmlWriter_Native::RegisterCustomNameSpace(const std::string &sNameSpace, const std::string &sNameSpacePrefix) + void CXmlWriter_Native::RegisterCustomNameSpace(const std::string &sNameSpace, const std::string &sNameSpacePrefix, bool bFailIfExisting) { std::string sDummy; if (GetNamespacePrefix(sNameSpace, sDummy)) { - throw CNMRException(NMR_ERROR_XMLNAMESPACEALREADYREGISTERED); + if (bFailIfExisting) + throw CNMRException(NMR_ERROR_XMLNAMESPACEALREADYREGISTERED); + + return; } + for (auto it = m_sNameSpaces.begin(); it != m_sNameSpaces.end(); ++it) if (it->second == sNameSpacePrefix) throw CNMRException(NMR_ERROR_XMLPREFIXALREADYREGISTERED); diff --git a/Source/Libraries/lzma/Alloc.c b/Source/Libraries/lzma/Alloc.c new file mode 100644 index 000000000..bcede4b85 --- /dev/null +++ b/Source/Libraries/lzma/Alloc.c @@ -0,0 +1,455 @@ +/* Alloc.c -- Memory allocation functions +2018-04-27 : Igor Pavlov : Public domain */ + +#include "Precomp.h" + +#include + +#ifdef _WIN32 +#include +#endif +#include + +#include "Alloc.h" + +/* #define _SZ_ALLOC_DEBUG */ + +/* use _SZ_ALLOC_DEBUG to debug alloc/free operations */ +#ifdef _SZ_ALLOC_DEBUG + +#include +int g_allocCount = 0; +int g_allocCountMid = 0; +int g_allocCountBig = 0; + + +#define CONVERT_INT_TO_STR(charType, tempSize) \ + unsigned char temp[tempSize]; unsigned i = 0; \ + while (val >= 10) { temp[i++] = (unsigned char)('0' + (unsigned)(val % 10)); val /= 10; } \ + *s++ = (charType)('0' + (unsigned)val); \ + while (i != 0) { i--; *s++ = temp[i]; } \ + *s = 0; + +static void ConvertUInt64ToString(UInt64 val, char *s) +{ + CONVERT_INT_TO_STR(char, 24); +} + +#define GET_HEX_CHAR(t) ((char)(((t < 10) ? ('0' + t) : ('A' + (t - 10))))) + +static void ConvertUInt64ToHex(UInt64 val, char *s) +{ + UInt64 v = val; + unsigned i; + for (i = 1;; i++) + { + v >>= 4; + if (v == 0) + break; + } + s[i] = 0; + do + { + unsigned t = (unsigned)(val & 0xF); + val >>= 4; + s[--i] = GET_HEX_CHAR(t); + } + while (i); +} + +#define DEBUG_OUT_STREAM stderr + +static void Print(const char *s) +{ + fputs(s, DEBUG_OUT_STREAM); +} + +static void PrintAligned(const char *s, size_t align) +{ + size_t len = strlen(s); + for(;;) + { + fputc(' ', DEBUG_OUT_STREAM); + if (len >= align) + break; + ++len; + } + Print(s); +} + +static void PrintLn() +{ + Print("\n"); +} + +static void PrintHex(UInt64 v, size_t align) +{ + char s[32]; + ConvertUInt64ToHex(v, s); + PrintAligned(s, align); +} + +static void PrintDec(UInt64 v, size_t align) +{ + char s[32]; + ConvertUInt64ToString(v, s); + PrintAligned(s, align); +} + +static void PrintAddr(void *p) +{ + PrintHex((UInt64)(size_t)(ptrdiff_t)p, 12); +} + + +#define PRINT_ALLOC(name, cnt, size, ptr) \ + Print(name " "); \ + PrintDec(cnt++, 10); \ + PrintHex(size, 10); \ + PrintAddr(ptr); \ + PrintLn(); + +#define PRINT_FREE(name, cnt, ptr) if (ptr) { \ + Print(name " "); \ + PrintDec(--cnt, 10); \ + PrintAddr(ptr); \ + PrintLn(); } + +#else + +#define PRINT_ALLOC(name, cnt, size, ptr) +#define PRINT_FREE(name, cnt, ptr) +#define Print(s) +#define PrintLn() +#define PrintHex(v, align) +#define PrintDec(v, align) +#define PrintAddr(p) + +#endif + + + +void *MyAlloc(size_t size) +{ + if (size == 0) + return NULL; + #ifdef _SZ_ALLOC_DEBUG + { + void *p = malloc(size); + PRINT_ALLOC("Alloc ", g_allocCount, size, p); + return p; + } + #else + return malloc(size); + #endif +} + +void MyFree(void *address) +{ + PRINT_FREE("Free ", g_allocCount, address); + + free(address); +} + +#ifdef _WIN32 + +void *MidAlloc(size_t size) +{ + if (size == 0) + return NULL; + + PRINT_ALLOC("Alloc-Mid", g_allocCountMid, size, NULL); + + return VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE); +} + +void MidFree(void *address) +{ + PRINT_FREE("Free-Mid", g_allocCountMid, address); + + if (!address) + return; + VirtualFree(address, 0, MEM_RELEASE); +} + +#ifndef MEM_LARGE_PAGES +#undef _7ZIP_LARGE_PAGES +#endif + +#ifdef _7ZIP_LARGE_PAGES +SIZE_T g_LargePageSize = 0; +typedef SIZE_T (WINAPI *GetLargePageMinimumP)(); +#endif + +void SetLargePageSize() +{ + #ifdef _7ZIP_LARGE_PAGES + SIZE_T size; + GetLargePageMinimumP largePageMinimum = (GetLargePageMinimumP) + GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetLargePageMinimum"); + if (!largePageMinimum) + return; + size = largePageMinimum(); + if (size == 0 || (size & (size - 1)) != 0) + return; + g_LargePageSize = size; + #endif +} + + +void *BigAlloc(size_t size) +{ + if (size == 0) + return NULL; + + PRINT_ALLOC("Alloc-Big", g_allocCountBig, size, NULL); + + #ifdef _7ZIP_LARGE_PAGES + { + SIZE_T ps = g_LargePageSize; + if (ps != 0 && ps <= (1 << 30) && size > (ps / 2)) + { + size_t size2; + ps--; + size2 = (size + ps) & ~ps; + if (size2 >= size) + { + void *res = VirtualAlloc(NULL, size2, MEM_COMMIT | MEM_LARGE_PAGES, PAGE_READWRITE); + if (res) + return res; + } + } + } + #endif + + return VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE); +} + +void BigFree(void *address) +{ + PRINT_FREE("Free-Big", g_allocCountBig, address); + + if (!address) + return; + VirtualFree(address, 0, MEM_RELEASE); +} + +#endif + + +static void *SzAlloc(ISzAllocPtr p, size_t size) { UNUSED_VAR(p); return MyAlloc(size); } +static void SzFree(ISzAllocPtr p, void *address) { UNUSED_VAR(p); MyFree(address); } +const ISzAlloc g_Alloc = { SzAlloc, SzFree }; + +static void *SzMidAlloc(ISzAllocPtr p, size_t size) { UNUSED_VAR(p); return MidAlloc(size); } +static void SzMidFree(ISzAllocPtr p, void *address) { UNUSED_VAR(p); MidFree(address); } +const ISzAlloc g_MidAlloc = { SzMidAlloc, SzMidFree }; + +static void *SzBigAlloc(ISzAllocPtr p, size_t size) { UNUSED_VAR(p); return BigAlloc(size); } +static void SzBigFree(ISzAllocPtr p, void *address) { UNUSED_VAR(p); BigFree(address); } +const ISzAlloc g_BigAlloc = { SzBigAlloc, SzBigFree }; + + +/* + uintptr_t : C99 (optional) + : unsupported in VS6 +*/ + +#ifdef _WIN32 + typedef UINT_PTR UIntPtr; +#else + /* + typedef uintptr_t UIntPtr; + */ + typedef ptrdiff_t UIntPtr; +#endif + + +#define ADJUST_ALLOC_SIZE 0 +/* +#define ADJUST_ALLOC_SIZE (sizeof(void *) - 1) +*/ +/* + Use (ADJUST_ALLOC_SIZE = (sizeof(void *) - 1)), if + MyAlloc() can return address that is NOT multiple of sizeof(void *). +*/ + + +/* +#define MY_ALIGN_PTR_DOWN(p, align) ((void *)((char *)(p) - ((size_t)(UIntPtr)(p) & ((align) - 1)))) +*/ +#define MY_ALIGN_PTR_DOWN(p, align) ((void *)((((UIntPtr)(p)) & ~((UIntPtr)(align) - 1)))) + +#define MY_ALIGN_PTR_UP_PLUS(p, align) MY_ALIGN_PTR_DOWN(((char *)(p) + (align) + ADJUST_ALLOC_SIZE), align) + + +#if (_POSIX_C_SOURCE >= 200112L) && !defined(_WIN32) + #define USE_posix_memalign +#endif + +/* + This posix_memalign() is for test purposes only. + We also need special Free() function instead of free(), + if this posix_memalign() is used. +*/ + +/* +static int posix_memalign(void **ptr, size_t align, size_t size) +{ + size_t newSize = size + align; + void *p; + void *pAligned; + *ptr = NULL; + if (newSize < size) + return 12; // ENOMEM + p = MyAlloc(newSize); + if (!p) + return 12; // ENOMEM + pAligned = MY_ALIGN_PTR_UP_PLUS(p, align); + ((void **)pAligned)[-1] = p; + *ptr = pAligned; + return 0; +} +*/ + +/* + ALLOC_ALIGN_SIZE >= sizeof(void *) + ALLOC_ALIGN_SIZE >= cache_line_size +*/ + +#define ALLOC_ALIGN_SIZE ((size_t)1 << 7) + +static void *SzAlignedAlloc(ISzAllocPtr pp, size_t size) +{ + #ifndef USE_posix_memalign + + void *p; + void *pAligned; + size_t newSize; + UNUSED_VAR(pp); + + /* also we can allocate additional dummy ALLOC_ALIGN_SIZE bytes after aligned + block to prevent cache line sharing with another allocated blocks */ + + newSize = size + ALLOC_ALIGN_SIZE * 1 + ADJUST_ALLOC_SIZE; + if (newSize < size) + return NULL; + + p = MyAlloc(newSize); + + if (!p) + return NULL; + pAligned = MY_ALIGN_PTR_UP_PLUS(p, ALLOC_ALIGN_SIZE); + + Print(" size="); PrintHex(size, 8); + Print(" a_size="); PrintHex(newSize, 8); + Print(" ptr="); PrintAddr(p); + Print(" a_ptr="); PrintAddr(pAligned); + PrintLn(); + + ((void **)pAligned)[-1] = p; + + return pAligned; + + #else + + void *p; + UNUSED_VAR(pp); + if (posix_memalign(&p, ALLOC_ALIGN_SIZE, size)) + return NULL; + + Print(" posix_memalign="); PrintAddr(p); + PrintLn(); + + return p; + + #endif +} + + +static void SzAlignedFree(ISzAllocPtr pp, void *address) +{ + UNUSED_VAR(pp); + #ifndef USE_posix_memalign + if (address) + MyFree(((void **)address)[-1]); + #else + free(address); + #endif +} + + +const ISzAlloc g_AlignedAlloc = { SzAlignedAlloc, SzAlignedFree }; + + + +#define MY_ALIGN_PTR_DOWN_1(p) MY_ALIGN_PTR_DOWN(p, sizeof(void *)) + +/* we align ptr to support cases where CAlignOffsetAlloc::offset is not multiply of sizeof(void *) */ +#define REAL_BLOCK_PTR_VAR(p) ((void **)MY_ALIGN_PTR_DOWN_1(p))[-1] +/* +#define REAL_BLOCK_PTR_VAR(p) ((void **)(p))[-1] +*/ + +static void *AlignOffsetAlloc_Alloc(ISzAllocPtr pp, size_t size) +{ + CAlignOffsetAlloc *p = CONTAINER_FROM_VTBL(pp, CAlignOffsetAlloc, vt); + void *adr; + void *pAligned; + size_t newSize; + size_t extra; + size_t alignSize = (size_t)1 << p->numAlignBits; + + if (alignSize < sizeof(void *)) + alignSize = sizeof(void *); + + if (p->offset >= alignSize) + return NULL; + + /* also we can allocate additional dummy ALLOC_ALIGN_SIZE bytes after aligned + block to prevent cache line sharing with another allocated blocks */ + extra = p->offset & (sizeof(void *) - 1); + newSize = size + alignSize + extra + ADJUST_ALLOC_SIZE; + if (newSize < size) + return NULL; + + adr = ISzAlloc_Alloc(p->baseAlloc, newSize); + + if (!adr) + return NULL; + + pAligned = (char *)MY_ALIGN_PTR_DOWN((char *)adr + + alignSize - p->offset + extra + ADJUST_ALLOC_SIZE, alignSize) + p->offset; + + PrintLn(); + Print("- Aligned: "); + Print(" size="); PrintHex(size, 8); + Print(" a_size="); PrintHex(newSize, 8); + Print(" ptr="); PrintAddr(adr); + Print(" a_ptr="); PrintAddr(pAligned); + PrintLn(); + + REAL_BLOCK_PTR_VAR(pAligned) = adr; + + return pAligned; +} + + +static void AlignOffsetAlloc_Free(ISzAllocPtr pp, void *address) +{ + if (address) + { + CAlignOffsetAlloc *p = CONTAINER_FROM_VTBL(pp, CAlignOffsetAlloc, vt); + PrintLn(); + Print("- Aligned Free: "); + PrintLn(); + ISzAlloc_Free(p->baseAlloc, REAL_BLOCK_PTR_VAR(address)); + } +} + + +void AlignOffsetAlloc_CreateVTable(CAlignOffsetAlloc *p) +{ + p->vt.Alloc = AlignOffsetAlloc_Alloc; + p->vt.Free = AlignOffsetAlloc_Free; +} diff --git a/Source/Libraries/lzma/LzFind.c b/Source/Libraries/lzma/LzFind.c new file mode 100644 index 000000000..df55e86c1 --- /dev/null +++ b/Source/Libraries/lzma/LzFind.c @@ -0,0 +1,1127 @@ +/* LzFind.c -- Match finder for LZ algorithms +2018-07-08 : Igor Pavlov : Public domain */ + +#include "Precomp.h" + +#include + +#include "LzFind.h" +#include "LzHash.h" + +#define kEmptyHashValue 0 +#define kMaxValForNormalize ((UInt32)0xFFFFFFFF) +#define kNormalizeStepMin (1 << 10) /* it must be power of 2 */ +#define kNormalizeMask (~(UInt32)(kNormalizeStepMin - 1)) +#define kMaxHistorySize ((UInt32)7 << 29) + +#define kStartMaxLen 3 + +static void LzInWindow_Free(CMatchFinder *p, ISzAllocPtr alloc) +{ + if (!p->directInput) + { + ISzAlloc_Free(alloc, p->bufferBase); + p->bufferBase = NULL; + } +} + +/* keepSizeBefore + keepSizeAfter + keepSizeReserv must be < 4G) */ + +static int LzInWindow_Create(CMatchFinder *p, UInt32 keepSizeReserv, ISzAllocPtr alloc) +{ + UInt32 blockSize = p->keepSizeBefore + p->keepSizeAfter + keepSizeReserv; + if (p->directInput) + { + p->blockSize = blockSize; + return 1; + } + if (!p->bufferBase || p->blockSize != blockSize) + { + LzInWindow_Free(p, alloc); + p->blockSize = blockSize; + p->bufferBase = (Byte *)ISzAlloc_Alloc(alloc, (size_t)blockSize); + } + return (p->bufferBase != NULL); +} + +Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; } + +UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; } + +void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue) +{ + p->posLimit -= subValue; + p->pos -= subValue; + p->streamPos -= subValue; +} + +static void MatchFinder_ReadBlock(CMatchFinder *p) +{ + if (p->streamEndWasReached || p->result != SZ_OK) + return; + + /* We use (p->streamPos - p->pos) value. (p->streamPos < p->pos) is allowed. */ + + if (p->directInput) + { + UInt32 curSize = 0xFFFFFFFF - (p->streamPos - p->pos); + if (curSize > p->directInputRem) + curSize = (UInt32)p->directInputRem; + p->directInputRem -= curSize; + p->streamPos += curSize; + if (p->directInputRem == 0) + p->streamEndWasReached = 1; + return; + } + + for (;;) + { + Byte *dest = p->buffer + (p->streamPos - p->pos); + size_t size = (p->bufferBase + p->blockSize - dest); + if (size == 0) + return; + + p->result = ISeqInStream_Read(p->stream, dest, &size); + if (p->result != SZ_OK) + return; + if (size == 0) + { + p->streamEndWasReached = 1; + return; + } + p->streamPos += (UInt32)size; + if (p->streamPos - p->pos > p->keepSizeAfter) + return; + } +} + +void MatchFinder_MoveBlock(CMatchFinder *p) +{ + memmove(p->bufferBase, + p->buffer - p->keepSizeBefore, + (size_t)(p->streamPos - p->pos) + p->keepSizeBefore); + p->buffer = p->bufferBase + p->keepSizeBefore; +} + +int MatchFinder_NeedMove(CMatchFinder *p) +{ + if (p->directInput) + return 0; + /* if (p->streamEndWasReached) return 0; */ + return ((size_t)(p->bufferBase + p->blockSize - p->buffer) <= p->keepSizeAfter); +} + +void MatchFinder_ReadIfRequired(CMatchFinder *p) +{ + if (p->streamEndWasReached) + return; + if (p->keepSizeAfter >= p->streamPos - p->pos) + MatchFinder_ReadBlock(p); +} + +static void MatchFinder_CheckAndMoveAndRead(CMatchFinder *p) +{ + if (MatchFinder_NeedMove(p)) + MatchFinder_MoveBlock(p); + MatchFinder_ReadBlock(p); +} + +static void MatchFinder_SetDefaultSettings(CMatchFinder *p) +{ + p->cutValue = 32; + p->btMode = 1; + p->numHashBytes = 4; + p->bigHash = 0; +} + +#define kCrcPoly 0xEDB88320 + +void MatchFinder_Construct(CMatchFinder *p) +{ + unsigned i; + p->bufferBase = NULL; + p->directInput = 0; + p->hash = NULL; + p->expectedDataSize = (UInt64)(Int64)-1; + MatchFinder_SetDefaultSettings(p); + + for (i = 0; i < 256; i++) + { + UInt32 r = (UInt32)i; + unsigned j; + for (j = 0; j < 8; j++) + r = (r >> 1) ^ (kCrcPoly & ((UInt32)0 - (r & 1))); + p->crc[i] = r; + } +} + +static void MatchFinder_FreeThisClassMemory(CMatchFinder *p, ISzAllocPtr alloc) +{ + ISzAlloc_Free(alloc, p->hash); + p->hash = NULL; +} + +void MatchFinder_Free(CMatchFinder *p, ISzAllocPtr alloc) +{ + MatchFinder_FreeThisClassMemory(p, alloc); + LzInWindow_Free(p, alloc); +} + +static CLzRef* AllocRefs(size_t num, ISzAllocPtr alloc) +{ + size_t sizeInBytes = (size_t)num * sizeof(CLzRef); + if (sizeInBytes / sizeof(CLzRef) != num) + return NULL; + return (CLzRef *)ISzAlloc_Alloc(alloc, sizeInBytes); +} + +int MatchFinder_Create(CMatchFinder *p, UInt32 historySize, + UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter, + ISzAllocPtr alloc) +{ + UInt32 sizeReserv; + + if (historySize > kMaxHistorySize) + { + MatchFinder_Free(p, alloc); + return 0; + } + + sizeReserv = historySize >> 1; + if (historySize >= ((UInt32)3 << 30)) sizeReserv = historySize >> 3; + else if (historySize >= ((UInt32)2 << 30)) sizeReserv = historySize >> 2; + + sizeReserv += (keepAddBufferBefore + matchMaxLen + keepAddBufferAfter) / 2 + (1 << 19); + + p->keepSizeBefore = historySize + keepAddBufferBefore + 1; + p->keepSizeAfter = matchMaxLen + keepAddBufferAfter; + + /* we need one additional byte, since we use MoveBlock after pos++ and before dictionary using */ + + if (LzInWindow_Create(p, sizeReserv, alloc)) + { + UInt32 newCyclicBufferSize = historySize + 1; + UInt32 hs; + p->matchMaxLen = matchMaxLen; + { + p->fixedHashSize = 0; + if (p->numHashBytes == 2) + hs = (1 << 16) - 1; + else + { + hs = historySize; + if (hs > p->expectedDataSize) + hs = (UInt32)p->expectedDataSize; + if (hs != 0) + hs--; + hs |= (hs >> 1); + hs |= (hs >> 2); + hs |= (hs >> 4); + hs |= (hs >> 8); + hs >>= 1; + hs |= 0xFFFF; /* don't change it! It's required for Deflate */ + if (hs > (1 << 24)) + { + if (p->numHashBytes == 3) + hs = (1 << 24) - 1; + else + hs >>= 1; + /* if (bigHash) mode, GetHeads4b() in LzFindMt.c needs (hs >= ((1 << 24) - 1))) */ + } + } + p->hashMask = hs; + hs++; + if (p->numHashBytes > 2) p->fixedHashSize += kHash2Size; + if (p->numHashBytes > 3) p->fixedHashSize += kHash3Size; + if (p->numHashBytes > 4) p->fixedHashSize += kHash4Size; + hs += p->fixedHashSize; + } + + { + size_t newSize; + size_t numSons; + p->historySize = historySize; + p->hashSizeSum = hs; + p->cyclicBufferSize = newCyclicBufferSize; + + numSons = newCyclicBufferSize; + if (p->btMode) + numSons <<= 1; + newSize = hs + numSons; + + if (p->hash && p->numRefs == newSize) + return 1; + + MatchFinder_FreeThisClassMemory(p, alloc); + p->numRefs = newSize; + p->hash = AllocRefs(newSize, alloc); + + if (p->hash) + { + p->son = p->hash + p->hashSizeSum; + return 1; + } + } + } + + MatchFinder_Free(p, alloc); + return 0; +} + +static void MatchFinder_SetLimits(CMatchFinder *p) +{ + UInt32 limit = kMaxValForNormalize - p->pos; + UInt32 limit2 = p->cyclicBufferSize - p->cyclicBufferPos; + + if (limit2 < limit) + limit = limit2; + limit2 = p->streamPos - p->pos; + + if (limit2 <= p->keepSizeAfter) + { + if (limit2 > 0) + limit2 = 1; + } + else + limit2 -= p->keepSizeAfter; + + if (limit2 < limit) + limit = limit2; + + { + UInt32 lenLimit = p->streamPos - p->pos; + if (lenLimit > p->matchMaxLen) + lenLimit = p->matchMaxLen; + p->lenLimit = lenLimit; + } + p->posLimit = p->pos + limit; +} + + +void MatchFinder_Init_LowHash(CMatchFinder *p) +{ + size_t i; + CLzRef *items = p->hash; + size_t numItems = p->fixedHashSize; + for (i = 0; i < numItems; i++) + items[i] = kEmptyHashValue; +} + + +void MatchFinder_Init_HighHash(CMatchFinder *p) +{ + size_t i; + CLzRef *items = p->hash + p->fixedHashSize; + size_t numItems = (size_t)p->hashMask + 1; + for (i = 0; i < numItems; i++) + items[i] = kEmptyHashValue; +} + + +void MatchFinder_Init_3(CMatchFinder *p, int readData) +{ + p->cyclicBufferPos = 0; + p->buffer = p->bufferBase; + p->pos = + p->streamPos = p->cyclicBufferSize; + p->result = SZ_OK; + p->streamEndWasReached = 0; + + if (readData) + MatchFinder_ReadBlock(p); + + MatchFinder_SetLimits(p); +} + + +void MatchFinder_Init(CMatchFinder *p) +{ + MatchFinder_Init_HighHash(p); + MatchFinder_Init_LowHash(p); + MatchFinder_Init_3(p, True); +} + + +static UInt32 MatchFinder_GetSubValue(CMatchFinder *p) +{ + return (p->pos - p->historySize - 1) & kNormalizeMask; +} + +void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, size_t numItems) +{ + size_t i; + for (i = 0; i < numItems; i++) + { + UInt32 value = items[i]; + if (value <= subValue) + value = kEmptyHashValue; + else + value -= subValue; + items[i] = value; + } +} + +static void MatchFinder_Normalize(CMatchFinder *p) +{ + UInt32 subValue = MatchFinder_GetSubValue(p); + MatchFinder_Normalize3(subValue, p->hash, p->numRefs); + MatchFinder_ReduceOffsets(p, subValue); +} + + +MY_NO_INLINE +static void MatchFinder_CheckLimits(CMatchFinder *p) +{ + if (p->pos == kMaxValForNormalize) + MatchFinder_Normalize(p); + if (!p->streamEndWasReached && p->keepSizeAfter == p->streamPos - p->pos) + MatchFinder_CheckAndMoveAndRead(p); + if (p->cyclicBufferPos == p->cyclicBufferSize) + p->cyclicBufferPos = 0; + MatchFinder_SetLimits(p); +} + + +/* + (lenLimit > maxLen) +*/ +MY_FORCE_INLINE +static UInt32 * Hc_GetMatchesSpec(unsigned lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, + UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue, + UInt32 *distances, unsigned maxLen) +{ + /* + son[_cyclicBufferPos] = curMatch; + for (;;) + { + UInt32 delta = pos - curMatch; + if (cutValue-- == 0 || delta >= _cyclicBufferSize) + return distances; + { + const Byte *pb = cur - delta; + curMatch = son[_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)]; + if (pb[maxLen] == cur[maxLen] && *pb == *cur) + { + UInt32 len = 0; + while (++len != lenLimit) + if (pb[len] != cur[len]) + break; + if (maxLen < len) + { + maxLen = len; + *distances++ = len; + *distances++ = delta - 1; + if (len == lenLimit) + return distances; + } + } + } + } + */ + + const Byte *lim = cur + lenLimit; + son[_cyclicBufferPos] = curMatch; + do + { + UInt32 delta = pos - curMatch; + if (delta >= _cyclicBufferSize) + break; + { + ptrdiff_t diff; + curMatch = son[_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)]; + diff = (ptrdiff_t)0 - delta; + if (cur[maxLen] == cur[maxLen + diff]) + { + const Byte *c = cur; + while (*c == c[diff]) + { + if (++c == lim) + { + distances[0] = (UInt32)(lim - cur); + distances[1] = delta - 1; + return distances + 2; + } + } + { + unsigned len = (unsigned)(c - cur); + if (maxLen < len) + { + maxLen = len; + distances[0] = (UInt32)len; + distances[1] = delta - 1; + distances += 2; + } + } + } + } + } + while (--cutValue); + + return distances; +} + + +MY_FORCE_INLINE +UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, + UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue, + UInt32 *distances, UInt32 maxLen) +{ + CLzRef *ptr0 = son + ((size_t)_cyclicBufferPos << 1) + 1; + CLzRef *ptr1 = son + ((size_t)_cyclicBufferPos << 1); + unsigned len0 = 0, len1 = 0; + for (;;) + { + UInt32 delta = pos - curMatch; + if (cutValue-- == 0 || delta >= _cyclicBufferSize) + { + *ptr0 = *ptr1 = kEmptyHashValue; + return distances; + } + { + CLzRef *pair = son + ((size_t)(_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1); + const Byte *pb = cur - delta; + unsigned len = (len0 < len1 ? len0 : len1); + UInt32 pair0 = pair[0]; + if (pb[len] == cur[len]) + { + if (++len != lenLimit && pb[len] == cur[len]) + while (++len != lenLimit) + if (pb[len] != cur[len]) + break; + if (maxLen < len) + { + maxLen = (UInt32)len; + *distances++ = (UInt32)len; + *distances++ = delta - 1; + if (len == lenLimit) + { + *ptr1 = pair0; + *ptr0 = pair[1]; + return distances; + } + } + } + if (pb[len] < cur[len]) + { + *ptr1 = curMatch; + ptr1 = pair + 1; + curMatch = *ptr1; + len1 = len; + } + else + { + *ptr0 = curMatch; + ptr0 = pair; + curMatch = *ptr0; + len0 = len; + } + } + } +} + +static void SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, + UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue) +{ + CLzRef *ptr0 = son + ((size_t)_cyclicBufferPos << 1) + 1; + CLzRef *ptr1 = son + ((size_t)_cyclicBufferPos << 1); + unsigned len0 = 0, len1 = 0; + for (;;) + { + UInt32 delta = pos - curMatch; + if (cutValue-- == 0 || delta >= _cyclicBufferSize) + { + *ptr0 = *ptr1 = kEmptyHashValue; + return; + } + { + CLzRef *pair = son + ((size_t)(_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1); + const Byte *pb = cur - delta; + unsigned len = (len0 < len1 ? len0 : len1); + if (pb[len] == cur[len]) + { + while (++len != lenLimit) + if (pb[len] != cur[len]) + break; + { + if (len == lenLimit) + { + *ptr1 = pair[0]; + *ptr0 = pair[1]; + return; + } + } + } + if (pb[len] < cur[len]) + { + *ptr1 = curMatch; + ptr1 = pair + 1; + curMatch = *ptr1; + len1 = len; + } + else + { + *ptr0 = curMatch; + ptr0 = pair; + curMatch = *ptr0; + len0 = len; + } + } + } +} + +#define MOVE_POS \ + ++p->cyclicBufferPos; \ + p->buffer++; \ + if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p); + +#define MOVE_POS_RET MOVE_POS return (UInt32)offset; + +static void MatchFinder_MovePos(CMatchFinder *p) { MOVE_POS; } + +#define GET_MATCHES_HEADER2(minLen, ret_op) \ + unsigned lenLimit; UInt32 hv; const Byte *cur; UInt32 curMatch; \ + lenLimit = (unsigned)p->lenLimit; { if (lenLimit < minLen) { MatchFinder_MovePos(p); ret_op; }} \ + cur = p->buffer; + +#define GET_MATCHES_HEADER(minLen) GET_MATCHES_HEADER2(minLen, return 0) +#define SKIP_HEADER(minLen) GET_MATCHES_HEADER2(minLen, continue) + +#define MF_PARAMS(p) p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue + +#define GET_MATCHES_FOOTER(offset, maxLen) \ + offset = (unsigned)(GetMatchesSpec1((UInt32)lenLimit, curMatch, MF_PARAMS(p), \ + distances + offset, (UInt32)maxLen) - distances); MOVE_POS_RET; + +#define SKIP_FOOTER \ + SkipMatchesSpec((UInt32)lenLimit, curMatch, MF_PARAMS(p)); MOVE_POS; + +#define UPDATE_maxLen { \ + ptrdiff_t diff = (ptrdiff_t)0 - d2; \ + const Byte *c = cur + maxLen; \ + const Byte *lim = cur + lenLimit; \ + for (; c != lim; c++) if (*(c + diff) != *c) break; \ + maxLen = (unsigned)(c - cur); } + +static UInt32 Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + unsigned offset; + GET_MATCHES_HEADER(2) + HASH2_CALC; + curMatch = p->hash[hv]; + p->hash[hv] = p->pos; + offset = 0; + GET_MATCHES_FOOTER(offset, 1) +} + +UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + unsigned offset; + GET_MATCHES_HEADER(3) + HASH_ZIP_CALC; + curMatch = p->hash[hv]; + p->hash[hv] = p->pos; + offset = 0; + GET_MATCHES_FOOTER(offset, 2) +} + +static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + UInt32 h2, d2, pos; + unsigned maxLen, offset; + UInt32 *hash; + GET_MATCHES_HEADER(3) + + HASH3_CALC; + + hash = p->hash; + pos = p->pos; + + d2 = pos - hash[h2]; + + curMatch = (hash + kFix3HashSize)[hv]; + + hash[h2] = pos; + (hash + kFix3HashSize)[hv] = pos; + + maxLen = 2; + offset = 0; + + if (d2 < p->cyclicBufferSize && *(cur - d2) == *cur) + { + UPDATE_maxLen + distances[0] = (UInt32)maxLen; + distances[1] = d2 - 1; + offset = 2; + if (maxLen == lenLimit) + { + SkipMatchesSpec((UInt32)lenLimit, curMatch, MF_PARAMS(p)); + MOVE_POS_RET; + } + } + + GET_MATCHES_FOOTER(offset, maxLen) +} + +static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + UInt32 h2, h3, d2, d3, pos; + unsigned maxLen, offset; + UInt32 *hash; + GET_MATCHES_HEADER(4) + + HASH4_CALC; + + hash = p->hash; + pos = p->pos; + + d2 = pos - hash [h2]; + d3 = pos - (hash + kFix3HashSize)[h3]; + + curMatch = (hash + kFix4HashSize)[hv]; + + hash [h2] = pos; + (hash + kFix3HashSize)[h3] = pos; + (hash + kFix4HashSize)[hv] = pos; + + maxLen = 0; + offset = 0; + + if (d2 < p->cyclicBufferSize && *(cur - d2) == *cur) + { + maxLen = 2; + distances[0] = 2; + distances[1] = d2 - 1; + offset = 2; + } + + if (d2 != d3 && d3 < p->cyclicBufferSize && *(cur - d3) == *cur) + { + maxLen = 3; + distances[(size_t)offset + 1] = d3 - 1; + offset += 2; + d2 = d3; + } + + if (offset != 0) + { + UPDATE_maxLen + distances[(size_t)offset - 2] = (UInt32)maxLen; + if (maxLen == lenLimit) + { + SkipMatchesSpec((UInt32)lenLimit, curMatch, MF_PARAMS(p)); + MOVE_POS_RET; + } + } + + if (maxLen < 3) + maxLen = 3; + + GET_MATCHES_FOOTER(offset, maxLen) +} + +/* +static UInt32 Bt5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + UInt32 h2, h3, h4, d2, d3, d4, maxLen, offset, pos; + UInt32 *hash; + GET_MATCHES_HEADER(5) + + HASH5_CALC; + + hash = p->hash; + pos = p->pos; + + d2 = pos - hash [h2]; + d3 = pos - (hash + kFix3HashSize)[h3]; + d4 = pos - (hash + kFix4HashSize)[h4]; + + curMatch = (hash + kFix5HashSize)[hv]; + + hash [h2] = pos; + (hash + kFix3HashSize)[h3] = pos; + (hash + kFix4HashSize)[h4] = pos; + (hash + kFix5HashSize)[hv] = pos; + + maxLen = 0; + offset = 0; + + if (d2 < p->cyclicBufferSize && *(cur - d2) == *cur) + { + distances[0] = maxLen = 2; + distances[1] = d2 - 1; + offset = 2; + if (*(cur - d2 + 2) == cur[2]) + distances[0] = maxLen = 3; + else if (d3 < p->cyclicBufferSize && *(cur - d3) == *cur) + { + distances[2] = maxLen = 3; + distances[3] = d3 - 1; + offset = 4; + d2 = d3; + } + } + else if (d3 < p->cyclicBufferSize && *(cur - d3) == *cur) + { + distances[0] = maxLen = 3; + distances[1] = d3 - 1; + offset = 2; + d2 = d3; + } + + if (d2 != d4 && d4 < p->cyclicBufferSize + && *(cur - d4) == *cur + && *(cur - d4 + 3) == *(cur + 3)) + { + maxLen = 4; + distances[(size_t)offset + 1] = d4 - 1; + offset += 2; + d2 = d4; + } + + if (offset != 0) + { + UPDATE_maxLen + distances[(size_t)offset - 2] = maxLen; + if (maxLen == lenLimit) + { + SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); + MOVE_POS_RET; + } + } + + if (maxLen < 4) + maxLen = 4; + + GET_MATCHES_FOOTER(offset, maxLen) +} +*/ + +static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + UInt32 h2, h3, d2, d3, pos; + unsigned maxLen, offset; + UInt32 *hash; + GET_MATCHES_HEADER(4) + + HASH4_CALC; + + hash = p->hash; + pos = p->pos; + + d2 = pos - hash [h2]; + d3 = pos - (hash + kFix3HashSize)[h3]; + curMatch = (hash + kFix4HashSize)[hv]; + + hash [h2] = pos; + (hash + kFix3HashSize)[h3] = pos; + (hash + kFix4HashSize)[hv] = pos; + + maxLen = 0; + offset = 0; + + if (d2 < p->cyclicBufferSize && *(cur - d2) == *cur) + { + maxLen = 2; + distances[0] = 2; + distances[1] = d2 - 1; + offset = 2; + } + + if (d2 != d3 && d3 < p->cyclicBufferSize && *(cur - d3) == *cur) + { + maxLen = 3; + distances[(size_t)offset + 1] = d3 - 1; + offset += 2; + d2 = d3; + } + + if (offset != 0) + { + UPDATE_maxLen + distances[(size_t)offset - 2] = (UInt32)maxLen; + if (maxLen == lenLimit) + { + p->son[p->cyclicBufferPos] = curMatch; + MOVE_POS_RET; + } + } + + if (maxLen < 3) + maxLen = 3; + + offset = (unsigned)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p), + distances + offset, maxLen) - (distances)); + MOVE_POS_RET +} + +/* +static UInt32 Hc5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + UInt32 h2, h3, h4, d2, d3, d4, maxLen, offset, pos + UInt32 *hash; + GET_MATCHES_HEADER(5) + + HASH5_CALC; + + hash = p->hash; + pos = p->pos; + + d2 = pos - hash [h2]; + d3 = pos - (hash + kFix3HashSize)[h3]; + d4 = pos - (hash + kFix4HashSize)[h4]; + + curMatch = (hash + kFix5HashSize)[hv]; + + hash [h2] = pos; + (hash + kFix3HashSize)[h3] = pos; + (hash + kFix4HashSize)[h4] = pos; + (hash + kFix5HashSize)[hv] = pos; + + maxLen = 0; + offset = 0; + + if (d2 < p->cyclicBufferSize && *(cur - d2) == *cur) + { + distances[0] = maxLen = 2; + distances[1] = d2 - 1; + offset = 2; + if (*(cur - d2 + 2) == cur[2]) + distances[0] = maxLen = 3; + else if (d3 < p->cyclicBufferSize && *(cur - d3) == *cur) + { + distances[2] = maxLen = 3; + distances[3] = d3 - 1; + offset = 4; + d2 = d3; + } + } + else if (d3 < p->cyclicBufferSize && *(cur - d3) == *cur) + { + distances[0] = maxLen = 3; + distances[1] = d3 - 1; + offset = 2; + d2 = d3; + } + + if (d2 != d4 && d4 < p->cyclicBufferSize + && *(cur - d4) == *cur + && *(cur - d4 + 3) == *(cur + 3)) + { + maxLen = 4; + distances[(size_t)offset + 1] = d4 - 1; + offset += 2; + d2 = d4; + } + + if (offset != 0) + { + UPDATE_maxLen + distances[(size_t)offset - 2] = maxLen; + if (maxLen == lenLimit) + { + p->son[p->cyclicBufferPos] = curMatch; + MOVE_POS_RET; + } + } + + if (maxLen < 4) + maxLen = 4; + + offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p), + distances + offset, maxLen) - (distances)); + MOVE_POS_RET +} +*/ + +UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + unsigned offset; + GET_MATCHES_HEADER(3) + HASH_ZIP_CALC; + curMatch = p->hash[hv]; + p->hash[hv] = p->pos; + offset = (unsigned)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p), + distances, 2) - (distances)); + MOVE_POS_RET +} + +static void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + SKIP_HEADER(2) + HASH2_CALC; + curMatch = p->hash[hv]; + p->hash[hv] = p->pos; + SKIP_FOOTER + } + while (--num != 0); +} + +void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + SKIP_HEADER(3) + HASH_ZIP_CALC; + curMatch = p->hash[hv]; + p->hash[hv] = p->pos; + SKIP_FOOTER + } + while (--num != 0); +} + +static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + UInt32 h2; + UInt32 *hash; + SKIP_HEADER(3) + HASH3_CALC; + hash = p->hash; + curMatch = (hash + kFix3HashSize)[hv]; + hash[h2] = + (hash + kFix3HashSize)[hv] = p->pos; + SKIP_FOOTER + } + while (--num != 0); +} + +static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + UInt32 h2, h3; + UInt32 *hash; + SKIP_HEADER(4) + HASH4_CALC; + hash = p->hash; + curMatch = (hash + kFix4HashSize)[hv]; + hash [h2] = + (hash + kFix3HashSize)[h3] = + (hash + kFix4HashSize)[hv] = p->pos; + SKIP_FOOTER + } + while (--num != 0); +} + +/* +static void Bt5_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + UInt32 h2, h3, h4; + UInt32 *hash; + SKIP_HEADER(5) + HASH5_CALC; + hash = p->hash; + curMatch = (hash + kFix5HashSize)[hv]; + hash [h2] = + (hash + kFix3HashSize)[h3] = + (hash + kFix4HashSize)[h4] = + (hash + kFix5HashSize)[hv] = p->pos; + SKIP_FOOTER + } + while (--num != 0); +} +*/ + +static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + UInt32 h2, h3; + UInt32 *hash; + SKIP_HEADER(4) + HASH4_CALC; + hash = p->hash; + curMatch = (hash + kFix4HashSize)[hv]; + hash [h2] = + (hash + kFix3HashSize)[h3] = + (hash + kFix4HashSize)[hv] = p->pos; + p->son[p->cyclicBufferPos] = curMatch; + MOVE_POS + } + while (--num != 0); +} + +/* +static void Hc5_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + UInt32 h2, h3, h4; + UInt32 *hash; + SKIP_HEADER(5) + HASH5_CALC; + hash = p->hash; + curMatch = hash + kFix5HashSize)[hv]; + hash [h2] = + (hash + kFix3HashSize)[h3] = + (hash + kFix4HashSize)[h4] = + (hash + kFix5HashSize)[hv] = p->pos; + p->son[p->cyclicBufferPos] = curMatch; + MOVE_POS + } + while (--num != 0); +} +*/ + +void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + SKIP_HEADER(3) + HASH_ZIP_CALC; + curMatch = p->hash[hv]; + p->hash[hv] = p->pos; + p->son[p->cyclicBufferPos] = curMatch; + MOVE_POS + } + while (--num != 0); +} + +void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable) +{ + vTable->Init = (Mf_Init_Func)MatchFinder_Init; + vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinder_GetNumAvailableBytes; + vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinder_GetPointerToCurrentPos; + if (!p->btMode) + { + /* if (p->numHashBytes <= 4) */ + { + vTable->GetMatches = (Mf_GetMatches_Func)Hc4_MatchFinder_GetMatches; + vTable->Skip = (Mf_Skip_Func)Hc4_MatchFinder_Skip; + } + /* + else + { + vTable->GetMatches = (Mf_GetMatches_Func)Hc5_MatchFinder_GetMatches; + vTable->Skip = (Mf_Skip_Func)Hc5_MatchFinder_Skip; + } + */ + } + else if (p->numHashBytes == 2) + { + vTable->GetMatches = (Mf_GetMatches_Func)Bt2_MatchFinder_GetMatches; + vTable->Skip = (Mf_Skip_Func)Bt2_MatchFinder_Skip; + } + else if (p->numHashBytes == 3) + { + vTable->GetMatches = (Mf_GetMatches_Func)Bt3_MatchFinder_GetMatches; + vTable->Skip = (Mf_Skip_Func)Bt3_MatchFinder_Skip; + } + else /* if (p->numHashBytes == 4) */ + { + vTable->GetMatches = (Mf_GetMatches_Func)Bt4_MatchFinder_GetMatches; + vTable->Skip = (Mf_Skip_Func)Bt4_MatchFinder_Skip; + } + /* + else + { + vTable->GetMatches = (Mf_GetMatches_Func)Bt5_MatchFinder_GetMatches; + vTable->Skip = (Mf_Skip_Func)Bt5_MatchFinder_Skip; + } + */ +} diff --git a/Source/Libraries/lzma/LzFindMt.c b/Source/Libraries/lzma/LzFindMt.c new file mode 100644 index 000000000..bb0f42c30 --- /dev/null +++ b/Source/Libraries/lzma/LzFindMt.c @@ -0,0 +1,853 @@ +/* LzFindMt.c -- multithreaded Match finder for LZ algorithms +2018-12-29 : Igor Pavlov : Public domain */ + +#include "Precomp.h" + +#include "LzHash.h" + +#include "LzFindMt.h" + +static void MtSync_Construct(CMtSync *p) +{ + p->wasCreated = False; + p->csWasInitialized = False; + p->csWasEntered = False; + Thread_Construct(&p->thread); + Event_Construct(&p->canStart); + Event_Construct(&p->wasStarted); + Event_Construct(&p->wasStopped); + Semaphore_Construct(&p->freeSemaphore); + Semaphore_Construct(&p->filledSemaphore); +} + +static void MtSync_GetNextBlock(CMtSync *p) +{ + if (p->needStart) + { + p->numProcessedBlocks = 1; + p->needStart = False; + p->stopWriting = False; + p->exit = False; + Event_Reset(&p->wasStarted); + Event_Reset(&p->wasStopped); + + Event_Set(&p->canStart); + Event_Wait(&p->wasStarted); + + // if (mt) MatchFinder_Init_LowHash(mt->MatchFinder); + } + else + { + CriticalSection_Leave(&p->cs); + p->csWasEntered = False; + p->numProcessedBlocks++; + Semaphore_Release1(&p->freeSemaphore); + } + Semaphore_Wait(&p->filledSemaphore); + CriticalSection_Enter(&p->cs); + p->csWasEntered = True; +} + +/* MtSync_StopWriting must be called if Writing was started */ + +static void MtSync_StopWriting(CMtSync *p) +{ + UInt32 myNumBlocks = p->numProcessedBlocks; + if (!Thread_WasCreated(&p->thread) || p->needStart) + return; + p->stopWriting = True; + if (p->csWasEntered) + { + CriticalSection_Leave(&p->cs); + p->csWasEntered = False; + } + Semaphore_Release1(&p->freeSemaphore); + + Event_Wait(&p->wasStopped); + + while (myNumBlocks++ != p->numProcessedBlocks) + { + Semaphore_Wait(&p->filledSemaphore); + Semaphore_Release1(&p->freeSemaphore); + } + p->needStart = True; +} + +static void MtSync_Destruct(CMtSync *p) +{ + if (Thread_WasCreated(&p->thread)) + { + MtSync_StopWriting(p); + p->exit = True; + if (p->needStart) + Event_Set(&p->canStart); + Thread_Wait(&p->thread); + Thread_Close(&p->thread); + } + if (p->csWasInitialized) + { + CriticalSection_Delete(&p->cs); + p->csWasInitialized = False; + } + + Event_Close(&p->canStart); + Event_Close(&p->wasStarted); + Event_Close(&p->wasStopped); + Semaphore_Close(&p->freeSemaphore); + Semaphore_Close(&p->filledSemaphore); + + p->wasCreated = False; +} + +#define RINOK_THREAD(x) { if ((x) != 0) return SZ_ERROR_THREAD; } + +static SRes MtSync_Create2(CMtSync *p, THREAD_FUNC_TYPE startAddress, void *obj, UInt32 numBlocks) +{ + if (p->wasCreated) + return SZ_OK; + + RINOK_THREAD(CriticalSection_Init(&p->cs)); + p->csWasInitialized = True; + + RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->canStart)); + RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->wasStarted)); + RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->wasStopped)); + + RINOK_THREAD(Semaphore_Create(&p->freeSemaphore, numBlocks, numBlocks)); + RINOK_THREAD(Semaphore_Create(&p->filledSemaphore, 0, numBlocks)); + + p->needStart = True; + + RINOK_THREAD(Thread_Create(&p->thread, startAddress, obj)); + p->wasCreated = True; + return SZ_OK; +} + +static SRes MtSync_Create(CMtSync *p, THREAD_FUNC_TYPE startAddress, void *obj, UInt32 numBlocks) +{ + SRes res = MtSync_Create2(p, startAddress, obj, numBlocks); + if (res != SZ_OK) + MtSync_Destruct(p); + return res; +} + +void MtSync_Init(CMtSync *p) { p->needStart = True; } + +#define kMtMaxValForNormalize 0xFFFFFFFF + +#define DEF_GetHeads2(name, v, action) \ + static void GetHeads ## name(const Byte *p, UInt32 pos, \ + UInt32 *hash, UInt32 hashMask, UInt32 *heads, UInt32 numHeads, const UInt32 *crc) \ + { action; for (; numHeads != 0; numHeads--) { \ + const UInt32 value = (v); p++; *heads++ = pos - hash[value]; hash[value] = pos++; } } + +#define DEF_GetHeads(name, v) DEF_GetHeads2(name, v, ;) + +DEF_GetHeads2(2, (p[0] | ((UInt32)p[1] << 8)), UNUSED_VAR(hashMask); UNUSED_VAR(crc); ) +DEF_GetHeads(3, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8)) & hashMask) +DEF_GetHeads(4, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8) ^ (crc[p[3]] << 5)) & hashMask) +DEF_GetHeads(4b, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8) ^ ((UInt32)p[3] << 16)) & hashMask) +/* DEF_GetHeads(5, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8) ^ (crc[p[3]] << 5) ^ (crc[p[4]] << 3)) & hashMask) */ + +static void HashThreadFunc(CMatchFinderMt *mt) +{ + CMtSync *p = &mt->hashSync; + for (;;) + { + UInt32 numProcessedBlocks = 0; + Event_Wait(&p->canStart); + Event_Set(&p->wasStarted); + + MatchFinder_Init_HighHash(mt->MatchFinder); + + for (;;) + { + if (p->exit) + return; + if (p->stopWriting) + { + p->numProcessedBlocks = numProcessedBlocks; + Event_Set(&p->wasStopped); + break; + } + + { + CMatchFinder *mf = mt->MatchFinder; + if (MatchFinder_NeedMove(mf)) + { + CriticalSection_Enter(&mt->btSync.cs); + CriticalSection_Enter(&mt->hashSync.cs); + { + const Byte *beforePtr = Inline_MatchFinder_GetPointerToCurrentPos(mf); + ptrdiff_t offset; + MatchFinder_MoveBlock(mf); + offset = beforePtr - Inline_MatchFinder_GetPointerToCurrentPos(mf); + mt->pointerToCurPos -= offset; + mt->buffer -= offset; + } + CriticalSection_Leave(&mt->btSync.cs); + CriticalSection_Leave(&mt->hashSync.cs); + continue; + } + + Semaphore_Wait(&p->freeSemaphore); + + MatchFinder_ReadIfRequired(mf); + if (mf->pos > (kMtMaxValForNormalize - kMtHashBlockSize)) + { + UInt32 subValue = (mf->pos - mf->historySize - 1); + MatchFinder_ReduceOffsets(mf, subValue); + MatchFinder_Normalize3(subValue, mf->hash + mf->fixedHashSize, (size_t)mf->hashMask + 1); + } + { + UInt32 *heads = mt->hashBuf + ((numProcessedBlocks++) & kMtHashNumBlocksMask) * kMtHashBlockSize; + UInt32 num = mf->streamPos - mf->pos; + heads[0] = 2; + heads[1] = num; + if (num >= mf->numHashBytes) + { + num = num - mf->numHashBytes + 1; + if (num > kMtHashBlockSize - 2) + num = kMtHashBlockSize - 2; + mt->GetHeadsFunc(mf->buffer, mf->pos, mf->hash + mf->fixedHashSize, mf->hashMask, heads + 2, num, mf->crc); + heads[0] = 2 + num; + } + mf->pos += num; + mf->buffer += num; + } + } + + Semaphore_Release1(&p->filledSemaphore); + } + } +} + +static void MatchFinderMt_GetNextBlock_Hash(CMatchFinderMt *p) +{ + MtSync_GetNextBlock(&p->hashSync); + p->hashBufPosLimit = p->hashBufPos = ((p->hashSync.numProcessedBlocks - 1) & kMtHashNumBlocksMask) * kMtHashBlockSize; + p->hashBufPosLimit += p->hashBuf[p->hashBufPos++]; + p->hashNumAvail = p->hashBuf[p->hashBufPos++]; +} + +#define kEmptyHashValue 0 + +#define MFMT_GM_INLINE + +#ifdef MFMT_GM_INLINE + +/* + we use size_t for _cyclicBufferPos instead of UInt32 + to eliminate "movsx" BUG in old MSVC x64 compiler. +*/ + +MY_NO_INLINE +static UInt32 *GetMatchesSpecN(UInt32 lenLimit, UInt32 pos, const Byte *cur, CLzRef *son, + size_t _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue, + UInt32 *distances, UInt32 _maxLen, const UInt32 *hash, const UInt32 *limit, UInt32 size, UInt32 *posRes) +{ + do + { + UInt32 *_distances = ++distances; + UInt32 delta = *hash++; + + CLzRef *ptr0 = son + ((size_t)_cyclicBufferPos << 1) + 1; + CLzRef *ptr1 = son + ((size_t)_cyclicBufferPos << 1); + unsigned len0 = 0, len1 = 0; + UInt32 cutValue = _cutValue; + unsigned maxLen = (unsigned)_maxLen; + + /* + if (size > 1) + { + UInt32 delta = *hash; + if (delta < _cyclicBufferSize) + { + UInt32 cyc1 = _cyclicBufferPos + 1; + CLzRef *pair = son + ((size_t)(cyc1 - delta + ((delta > cyc1) ? _cyclicBufferSize : 0)) << 1); + Byte b = *(cur + 1 - delta); + _distances[0] = pair[0]; + _distances[1] = b; + } + } + */ + if (cutValue == 0 || delta >= _cyclicBufferSize) + { + *ptr0 = *ptr1 = kEmptyHashValue; + } + else + for(;;) + { + { + CLzRef *pair = son + ((size_t)(_cyclicBufferPos - delta + ((_cyclicBufferPos < delta) ? _cyclicBufferSize : 0)) << 1); + const Byte *pb = cur - delta; + unsigned len = (len0 < len1 ? len0 : len1); + UInt32 pair0 = *pair; + if (pb[len] == cur[len]) + { + if (++len != lenLimit && pb[len] == cur[len]) + while (++len != lenLimit) + if (pb[len] != cur[len]) + break; + if (maxLen < len) + { + maxLen = len; + *distances++ = (UInt32)len; + *distances++ = delta - 1; + if (len == lenLimit) + { + UInt32 pair1 = pair[1]; + *ptr1 = pair0; + *ptr0 = pair1; + break; + } + } + } + { + UInt32 curMatch = pos - delta; + // delta = pos - *pair; + // delta = pos - pair[((UInt32)pb[len] - (UInt32)cur[len]) >> 31]; + if (pb[len] < cur[len]) + { + delta = pos - pair[1]; + *ptr1 = curMatch; + ptr1 = pair + 1; + len1 = len; + } + else + { + delta = pos - *pair; + *ptr0 = curMatch; + ptr0 = pair; + len0 = len; + } + } + } + if (--cutValue == 0 || delta >= _cyclicBufferSize) + { + *ptr0 = *ptr1 = kEmptyHashValue; + break; + } + } + pos++; + _cyclicBufferPos++; + cur++; + { + UInt32 num = (UInt32)(distances - _distances); + _distances[-1] = num; + } + } + while (distances < limit && --size != 0); + *posRes = pos; + return distances; +} + +#endif + + + +static void BtGetMatches(CMatchFinderMt *p, UInt32 *distances) +{ + UInt32 numProcessed = 0; + UInt32 curPos = 2; + UInt32 limit = kMtBtBlockSize - (p->matchMaxLen * 2); // * 2 + + distances[1] = p->hashNumAvail; + + while (curPos < limit) + { + if (p->hashBufPos == p->hashBufPosLimit) + { + MatchFinderMt_GetNextBlock_Hash(p); + distances[1] = numProcessed + p->hashNumAvail; + if (p->hashNumAvail >= p->numHashBytes) + continue; + distances[0] = curPos + p->hashNumAvail; + distances += curPos; + for (; p->hashNumAvail != 0; p->hashNumAvail--) + *distances++ = 0; + return; + } + { + UInt32 size = p->hashBufPosLimit - p->hashBufPos; + UInt32 lenLimit = p->matchMaxLen; + UInt32 pos = p->pos; + UInt32 cyclicBufferPos = p->cyclicBufferPos; + if (lenLimit >= p->hashNumAvail) + lenLimit = p->hashNumAvail; + { + UInt32 size2 = p->hashNumAvail - lenLimit + 1; + if (size2 < size) + size = size2; + size2 = p->cyclicBufferSize - cyclicBufferPos; + if (size2 < size) + size = size2; + } + + #ifndef MFMT_GM_INLINE + while (curPos < limit && size-- != 0) + { + UInt32 *startDistances = distances + curPos; + UInt32 num = (UInt32)(GetMatchesSpec1(lenLimit, pos - p->hashBuf[p->hashBufPos++], + pos, p->buffer, p->son, cyclicBufferPos, p->cyclicBufferSize, p->cutValue, + startDistances + 1, p->numHashBytes - 1) - startDistances); + *startDistances = num - 1; + curPos += num; + cyclicBufferPos++; + pos++; + p->buffer++; + } + #else + { + UInt32 posRes; + curPos = (UInt32)(GetMatchesSpecN(lenLimit, pos, p->buffer, p->son, cyclicBufferPos, p->cyclicBufferSize, p->cutValue, + distances + curPos, p->numHashBytes - 1, p->hashBuf + p->hashBufPos, + distances + limit, + size, &posRes) - distances); + p->hashBufPos += posRes - pos; + cyclicBufferPos += posRes - pos; + p->buffer += posRes - pos; + pos = posRes; + } + #endif + + numProcessed += pos - p->pos; + p->hashNumAvail -= pos - p->pos; + p->pos = pos; + if (cyclicBufferPos == p->cyclicBufferSize) + cyclicBufferPos = 0; + p->cyclicBufferPos = cyclicBufferPos; + } + } + + distances[0] = curPos; +} + +static void BtFillBlock(CMatchFinderMt *p, UInt32 globalBlockIndex) +{ + CMtSync *sync = &p->hashSync; + if (!sync->needStart) + { + CriticalSection_Enter(&sync->cs); + sync->csWasEntered = True; + } + + BtGetMatches(p, p->btBuf + (globalBlockIndex & kMtBtNumBlocksMask) * kMtBtBlockSize); + + if (p->pos > kMtMaxValForNormalize - kMtBtBlockSize) + { + UInt32 subValue = p->pos - p->cyclicBufferSize; + MatchFinder_Normalize3(subValue, p->son, (size_t)p->cyclicBufferSize * 2); + p->pos -= subValue; + } + + if (!sync->needStart) + { + CriticalSection_Leave(&sync->cs); + sync->csWasEntered = False; + } +} + +void BtThreadFunc(CMatchFinderMt *mt) +{ + CMtSync *p = &mt->btSync; + for (;;) + { + UInt32 blockIndex = 0; + Event_Wait(&p->canStart); + Event_Set(&p->wasStarted); + for (;;) + { + if (p->exit) + return; + if (p->stopWriting) + { + p->numProcessedBlocks = blockIndex; + MtSync_StopWriting(&mt->hashSync); + Event_Set(&p->wasStopped); + break; + } + Semaphore_Wait(&p->freeSemaphore); + BtFillBlock(mt, blockIndex++); + Semaphore_Release1(&p->filledSemaphore); + } + } +} + +void MatchFinderMt_Construct(CMatchFinderMt *p) +{ + p->hashBuf = NULL; + MtSync_Construct(&p->hashSync); + MtSync_Construct(&p->btSync); +} + +static void MatchFinderMt_FreeMem(CMatchFinderMt *p, ISzAllocPtr alloc) +{ + ISzAlloc_Free(alloc, p->hashBuf); + p->hashBuf = NULL; +} + +void MatchFinderMt_Destruct(CMatchFinderMt *p, ISzAllocPtr alloc) +{ + MtSync_Destruct(&p->hashSync); + MtSync_Destruct(&p->btSync); + MatchFinderMt_FreeMem(p, alloc); +} + +#define kHashBufferSize (kMtHashBlockSize * kMtHashNumBlocks) +#define kBtBufferSize (kMtBtBlockSize * kMtBtNumBlocks) + +static THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE HashThreadFunc2(void *p) { HashThreadFunc((CMatchFinderMt *)p); return 0; } +static THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE BtThreadFunc2(void *p) +{ + Byte allocaDummy[0x180]; + unsigned i = 0; + for (i = 0; i < 16; i++) + allocaDummy[i] = (Byte)0; + if (allocaDummy[0] == 0) + BtThreadFunc((CMatchFinderMt *)p); + return 0; +} + +SRes MatchFinderMt_Create(CMatchFinderMt *p, UInt32 historySize, UInt32 keepAddBufferBefore, + UInt32 matchMaxLen, UInt32 keepAddBufferAfter, ISzAllocPtr alloc) +{ + CMatchFinder *mf = p->MatchFinder; + p->historySize = historySize; + if (kMtBtBlockSize <= matchMaxLen * 4) + return SZ_ERROR_PARAM; + if (!p->hashBuf) + { + p->hashBuf = (UInt32 *)ISzAlloc_Alloc(alloc, (kHashBufferSize + kBtBufferSize) * sizeof(UInt32)); + if (!p->hashBuf) + return SZ_ERROR_MEM; + p->btBuf = p->hashBuf + kHashBufferSize; + } + keepAddBufferBefore += (kHashBufferSize + kBtBufferSize); + keepAddBufferAfter += kMtHashBlockSize; + if (!MatchFinder_Create(mf, historySize, keepAddBufferBefore, matchMaxLen, keepAddBufferAfter, alloc)) + return SZ_ERROR_MEM; + + RINOK(MtSync_Create(&p->hashSync, HashThreadFunc2, p, kMtHashNumBlocks)); + RINOK(MtSync_Create(&p->btSync, BtThreadFunc2, p, kMtBtNumBlocks)); + return SZ_OK; +} + +/* Call it after ReleaseStream / SetStream */ +static void MatchFinderMt_Init(CMatchFinderMt *p) +{ + CMatchFinder *mf = p->MatchFinder; + + p->btBufPos = + p->btBufPosLimit = 0; + p->hashBufPos = + p->hashBufPosLimit = 0; + + /* Init without data reading. We don't want to read data in this thread */ + MatchFinder_Init_3(mf, False); + MatchFinder_Init_LowHash(mf); + + p->pointerToCurPos = Inline_MatchFinder_GetPointerToCurrentPos(mf); + p->btNumAvailBytes = 0; + p->lzPos = p->historySize + 1; + + p->hash = mf->hash; + p->fixedHashSize = mf->fixedHashSize; + p->crc = mf->crc; + + p->son = mf->son; + p->matchMaxLen = mf->matchMaxLen; + p->numHashBytes = mf->numHashBytes; + p->pos = mf->pos; + p->buffer = mf->buffer; + p->cyclicBufferPos = mf->cyclicBufferPos; + p->cyclicBufferSize = mf->cyclicBufferSize; + p->cutValue = mf->cutValue; +} + +/* ReleaseStream is required to finish multithreading */ +void MatchFinderMt_ReleaseStream(CMatchFinderMt *p) +{ + MtSync_StopWriting(&p->btSync); + /* p->MatchFinder->ReleaseStream(); */ +} + +static void MatchFinderMt_Normalize(CMatchFinderMt *p) +{ + MatchFinder_Normalize3(p->lzPos - p->historySize - 1, p->hash, p->fixedHashSize); + p->lzPos = p->historySize + 1; +} + +static void MatchFinderMt_GetNextBlock_Bt(CMatchFinderMt *p) +{ + UInt32 blockIndex; + MtSync_GetNextBlock(&p->btSync); + blockIndex = ((p->btSync.numProcessedBlocks - 1) & kMtBtNumBlocksMask); + p->btBufPosLimit = p->btBufPos = blockIndex * kMtBtBlockSize; + p->btBufPosLimit += p->btBuf[p->btBufPos++]; + p->btNumAvailBytes = p->btBuf[p->btBufPos++]; + if (p->lzPos >= kMtMaxValForNormalize - kMtBtBlockSize) + MatchFinderMt_Normalize(p); +} + +static const Byte * MatchFinderMt_GetPointerToCurrentPos(CMatchFinderMt *p) +{ + return p->pointerToCurPos; +} + +#define GET_NEXT_BLOCK_IF_REQUIRED if (p->btBufPos == p->btBufPosLimit) MatchFinderMt_GetNextBlock_Bt(p); + +static UInt32 MatchFinderMt_GetNumAvailableBytes(CMatchFinderMt *p) +{ + GET_NEXT_BLOCK_IF_REQUIRED; + return p->btNumAvailBytes; +} + +static UInt32 * MixMatches2(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *distances) +{ + UInt32 h2, curMatch2; + UInt32 *hash = p->hash; + const Byte *cur = p->pointerToCurPos; + UInt32 lzPos = p->lzPos; + MT_HASH2_CALC + + curMatch2 = hash[h2]; + hash[h2] = lzPos; + + if (curMatch2 >= matchMinPos) + if (cur[(ptrdiff_t)curMatch2 - lzPos] == cur[0]) + { + *distances++ = 2; + *distances++ = lzPos - curMatch2 - 1; + } + + return distances; +} + +static UInt32 * MixMatches3(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *distances) +{ + UInt32 h2, h3, curMatch2, curMatch3; + UInt32 *hash = p->hash; + const Byte *cur = p->pointerToCurPos; + UInt32 lzPos = p->lzPos; + MT_HASH3_CALC + + curMatch2 = hash[ h2]; + curMatch3 = (hash + kFix3HashSize)[h3]; + + hash[ h2] = lzPos; + (hash + kFix3HashSize)[h3] = lzPos; + + if (curMatch2 >= matchMinPos && cur[(ptrdiff_t)curMatch2 - lzPos] == cur[0]) + { + distances[1] = lzPos - curMatch2 - 1; + if (cur[(ptrdiff_t)curMatch2 - lzPos + 2] == cur[2]) + { + distances[0] = 3; + return distances + 2; + } + distances[0] = 2; + distances += 2; + } + + if (curMatch3 >= matchMinPos && cur[(ptrdiff_t)curMatch3 - lzPos] == cur[0]) + { + *distances++ = 3; + *distances++ = lzPos - curMatch3 - 1; + } + + return distances; +} + +/* +static UInt32 *MixMatches4(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *distances) +{ + UInt32 h2, h3, h4, curMatch2, curMatch3, curMatch4; + UInt32 *hash = p->hash; + const Byte *cur = p->pointerToCurPos; + UInt32 lzPos = p->lzPos; + MT_HASH4_CALC + + curMatch2 = hash[ h2]; + curMatch3 = (hash + kFix3HashSize)[h3]; + curMatch4 = (hash + kFix4HashSize)[h4]; + + hash[ h2] = lzPos; + (hash + kFix3HashSize)[h3] = lzPos; + (hash + kFix4HashSize)[h4] = lzPos; + + if (curMatch2 >= matchMinPos && cur[(ptrdiff_t)curMatch2 - lzPos] == cur[0]) + { + distances[1] = lzPos - curMatch2 - 1; + if (cur[(ptrdiff_t)curMatch2 - lzPos + 2] == cur[2]) + { + distances[0] = (cur[(ptrdiff_t)curMatch2 - lzPos + 3] == cur[3]) ? 4 : 3; + return distances + 2; + } + distances[0] = 2; + distances += 2; + } + + if (curMatch3 >= matchMinPos && cur[(ptrdiff_t)curMatch3 - lzPos] == cur[0]) + { + distances[1] = lzPos - curMatch3 - 1; + if (cur[(ptrdiff_t)curMatch3 - lzPos + 3] == cur[3]) + { + distances[0] = 4; + return distances + 2; + } + distances[0] = 3; + distances += 2; + } + + if (curMatch4 >= matchMinPos) + if ( + cur[(ptrdiff_t)curMatch4 - lzPos] == cur[0] && + cur[(ptrdiff_t)curMatch4 - lzPos + 3] == cur[3] + ) + { + *distances++ = 4; + *distances++ = lzPos - curMatch4 - 1; + } + + return distances; +} +*/ + +#define INCREASE_LZ_POS p->lzPos++; p->pointerToCurPos++; + +static UInt32 MatchFinderMt2_GetMatches(CMatchFinderMt *p, UInt32 *distances) +{ + const UInt32 *btBuf = p->btBuf + p->btBufPos; + UInt32 len = *btBuf++; + p->btBufPos += 1 + len; + p->btNumAvailBytes--; + { + UInt32 i; + for (i = 0; i < len; i += 2) + { + UInt32 v0 = btBuf[0]; + UInt32 v1 = btBuf[1]; + btBuf += 2; + distances[0] = v0; + distances[1] = v1; + distances += 2; + } + } + INCREASE_LZ_POS + return len; +} + +static UInt32 MatchFinderMt_GetMatches(CMatchFinderMt *p, UInt32 *distances) +{ + const UInt32 *btBuf = p->btBuf + p->btBufPos; + UInt32 len = *btBuf++; + p->btBufPos += 1 + len; + + if (len == 0) + { + /* change for bt5 ! */ + if (p->btNumAvailBytes-- >= 4) + len = (UInt32)(p->MixMatchesFunc(p, p->lzPos - p->historySize, distances) - (distances)); + } + else + { + /* Condition: there are matches in btBuf with length < p->numHashBytes */ + UInt32 *distances2; + p->btNumAvailBytes--; + distances2 = p->MixMatchesFunc(p, p->lzPos - btBuf[1], distances); + do + { + UInt32 v0 = btBuf[0]; + UInt32 v1 = btBuf[1]; + btBuf += 2; + distances2[0] = v0; + distances2[1] = v1; + distances2 += 2; + } + while ((len -= 2) != 0); + len = (UInt32)(distances2 - (distances)); + } + INCREASE_LZ_POS + return len; +} + +#define SKIP_HEADER2_MT do { GET_NEXT_BLOCK_IF_REQUIRED +#define SKIP_HEADER_MT(n) SKIP_HEADER2_MT if (p->btNumAvailBytes-- >= (n)) { const Byte *cur = p->pointerToCurPos; UInt32 *hash = p->hash; +#define SKIP_FOOTER_MT } INCREASE_LZ_POS p->btBufPos += p->btBuf[p->btBufPos] + 1; } while (--num != 0); + +static void MatchFinderMt0_Skip(CMatchFinderMt *p, UInt32 num) +{ + SKIP_HEADER2_MT { p->btNumAvailBytes--; + SKIP_FOOTER_MT +} + +static void MatchFinderMt2_Skip(CMatchFinderMt *p, UInt32 num) +{ + SKIP_HEADER_MT(2) + UInt32 h2; + MT_HASH2_CALC + hash[h2] = p->lzPos; + SKIP_FOOTER_MT +} + +static void MatchFinderMt3_Skip(CMatchFinderMt *p, UInt32 num) +{ + SKIP_HEADER_MT(3) + UInt32 h2, h3; + MT_HASH3_CALC + (hash + kFix3HashSize)[h3] = + hash[ h2] = + p->lzPos; + SKIP_FOOTER_MT +} + +/* +static void MatchFinderMt4_Skip(CMatchFinderMt *p, UInt32 num) +{ + SKIP_HEADER_MT(4) + UInt32 h2, h3, h4; + MT_HASH4_CALC + (hash + kFix4HashSize)[h4] = + (hash + kFix3HashSize)[h3] = + hash[ h2] = + p->lzPos; + SKIP_FOOTER_MT +} +*/ + +void MatchFinderMt_CreateVTable(CMatchFinderMt *p, IMatchFinder *vTable) +{ + vTable->Init = (Mf_Init_Func)MatchFinderMt_Init; + vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinderMt_GetNumAvailableBytes; + vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinderMt_GetPointerToCurrentPos; + vTable->GetMatches = (Mf_GetMatches_Func)MatchFinderMt_GetMatches; + + switch (p->MatchFinder->numHashBytes) + { + case 2: + p->GetHeadsFunc = GetHeads2; + p->MixMatchesFunc = (Mf_Mix_Matches)NULL; + vTable->Skip = (Mf_Skip_Func)MatchFinderMt0_Skip; + vTable->GetMatches = (Mf_GetMatches_Func)MatchFinderMt2_GetMatches; + break; + case 3: + p->GetHeadsFunc = GetHeads3; + p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches2; + vTable->Skip = (Mf_Skip_Func)MatchFinderMt2_Skip; + break; + default: + /* case 4: */ + p->GetHeadsFunc = p->MatchFinder->bigHash ? GetHeads4b : GetHeads4; + p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches3; + vTable->Skip = (Mf_Skip_Func)MatchFinderMt3_Skip; + break; + /* + default: + p->GetHeadsFunc = GetHeads5; + p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches4; + vTable->Skip = (Mf_Skip_Func)MatchFinderMt4_Skip; + break; + */ + } +} diff --git a/Source/Libraries/lzma/LzmaDec.c b/Source/Libraries/lzma/LzmaDec.c new file mode 100644 index 000000000..ba3e1dd50 --- /dev/null +++ b/Source/Libraries/lzma/LzmaDec.c @@ -0,0 +1,1185 @@ +/* LzmaDec.c -- LZMA Decoder +2018-07-04 : Igor Pavlov : Public domain */ + +#include "Precomp.h" + +#include + +/* #include "CpuArch.h" */ +#include "LzmaDec.h" + +#define kNumTopBits 24 +#define kTopValue ((UInt32)1 << kNumTopBits) + +#define kNumBitModelTotalBits 11 +#define kBitModelTotal (1 << kNumBitModelTotalBits) +#define kNumMoveBits 5 + +#define RC_INIT_SIZE 5 + +#define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); } + +#define IF_BIT_0(p) ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * (UInt32)ttt; if (code < bound) +#define UPDATE_0(p) range = bound; *(p) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); +#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits)); +#define GET_BIT2(p, i, A0, A1) IF_BIT_0(p) \ + { UPDATE_0(p); i = (i + i); A0; } else \ + { UPDATE_1(p); i = (i + i) + 1; A1; } + +#define TREE_GET_BIT(probs, i) { GET_BIT2(probs + i, i, ;, ;); } + +#define REV_BIT(p, i, A0, A1) IF_BIT_0(p + i) \ + { UPDATE_0(p + i); A0; } else \ + { UPDATE_1(p + i); A1; } +#define REV_BIT_VAR( p, i, m) REV_BIT(p, i, i += m; m += m, m += m; i += m; ) +#define REV_BIT_CONST(p, i, m) REV_BIT(p, i, i += m; , i += m * 2; ) +#define REV_BIT_LAST( p, i, m) REV_BIT(p, i, i -= m , ; ) + +#define TREE_DECODE(probs, limit, i) \ + { i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; } + +/* #define _LZMA_SIZE_OPT */ + +#ifdef _LZMA_SIZE_OPT +#define TREE_6_DECODE(probs, i) TREE_DECODE(probs, (1 << 6), i) +#else +#define TREE_6_DECODE(probs, i) \ + { i = 1; \ + TREE_GET_BIT(probs, i); \ + TREE_GET_BIT(probs, i); \ + TREE_GET_BIT(probs, i); \ + TREE_GET_BIT(probs, i); \ + TREE_GET_BIT(probs, i); \ + TREE_GET_BIT(probs, i); \ + i -= 0x40; } +#endif + +#define NORMAL_LITER_DEC TREE_GET_BIT(prob, symbol) +#define MATCHED_LITER_DEC \ + matchByte += matchByte; \ + bit = offs; \ + offs &= matchByte; \ + probLit = prob + (offs + bit + symbol); \ + GET_BIT2(probLit, symbol, offs ^= bit; , ;) + + + +#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); } + +#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * (UInt32)ttt; if (code < bound) +#define UPDATE_0_CHECK range = bound; +#define UPDATE_1_CHECK range -= bound; code -= bound; +#define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \ + { UPDATE_0_CHECK; i = (i + i); A0; } else \ + { UPDATE_1_CHECK; i = (i + i) + 1; A1; } +#define GET_BIT_CHECK(p, i) GET_BIT2_CHECK(p, i, ; , ;) +#define TREE_DECODE_CHECK(probs, limit, i) \ + { i = 1; do { GET_BIT_CHECK(probs + i, i) } while (i < limit); i -= limit; } + + +#define REV_BIT_CHECK(p, i, m) IF_BIT_0_CHECK(p + i) \ + { UPDATE_0_CHECK; i += m; m += m; } else \ + { UPDATE_1_CHECK; m += m; i += m; } + + +#define kNumPosBitsMax 4 +#define kNumPosStatesMax (1 << kNumPosBitsMax) + +#define kLenNumLowBits 3 +#define kLenNumLowSymbols (1 << kLenNumLowBits) +#define kLenNumHighBits 8 +#define kLenNumHighSymbols (1 << kLenNumHighBits) + +#define LenLow 0 +#define LenHigh (LenLow + 2 * (kNumPosStatesMax << kLenNumLowBits)) +#define kNumLenProbs (LenHigh + kLenNumHighSymbols) + +#define LenChoice LenLow +#define LenChoice2 (LenLow + (1 << kLenNumLowBits)) + +#define kNumStates 12 +#define kNumStates2 16 +#define kNumLitStates 7 + +#define kStartPosModelIndex 4 +#define kEndPosModelIndex 14 +#define kNumFullDistances (1 << (kEndPosModelIndex >> 1)) + +#define kNumPosSlotBits 6 +#define kNumLenToPosStates 4 + +#define kNumAlignBits 4 +#define kAlignTableSize (1 << kNumAlignBits) + +#define kMatchMinLen 2 +#define kMatchSpecLenStart (kMatchMinLen + kLenNumLowSymbols * 2 + kLenNumHighSymbols) + +/* External ASM code needs same CLzmaProb array layout. So don't change it. */ + +/* (probs_1664) is faster and better for code size at some platforms */ +/* +#ifdef MY_CPU_X86_OR_AMD64 +*/ +#define kStartOffset 1664 +#define GET_PROBS p->probs_1664 +/* +#define GET_PROBS p->probs + kStartOffset +#else +#define kStartOffset 0 +#define GET_PROBS p->probs +#endif +*/ + +#define SpecPos (-kStartOffset) +#define IsRep0Long (SpecPos + kNumFullDistances) +#define RepLenCoder (IsRep0Long + (kNumStates2 << kNumPosBitsMax)) +#define LenCoder (RepLenCoder + kNumLenProbs) +#define IsMatch (LenCoder + kNumLenProbs) +#define Align (IsMatch + (kNumStates2 << kNumPosBitsMax)) +#define IsRep (Align + kAlignTableSize) +#define IsRepG0 (IsRep + kNumStates) +#define IsRepG1 (IsRepG0 + kNumStates) +#define IsRepG2 (IsRepG1 + kNumStates) +#define PosSlot (IsRepG2 + kNumStates) +#define Literal (PosSlot + (kNumLenToPosStates << kNumPosSlotBits)) +#define NUM_BASE_PROBS (Literal + kStartOffset) + +#if Align != 0 && kStartOffset != 0 + #error Stop_Compiling_Bad_LZMA_kAlign +#endif + +#if NUM_BASE_PROBS != 1984 + #error Stop_Compiling_Bad_LZMA_PROBS +#endif + + +#define LZMA_LIT_SIZE 0x300 + +#define LzmaProps_GetNumProbs(p) (NUM_BASE_PROBS + ((UInt32)LZMA_LIT_SIZE << ((p)->lc + (p)->lp))) + + +#define CALC_POS_STATE(processedPos, pbMask) (((processedPos) & (pbMask)) << 4) +#define COMBINED_PS_STATE (posState + state) +#define GET_LEN_STATE (posState) + +#define LZMA_DIC_MIN (1 << 12) + +/* +p->remainLen : shows status of LZMA decoder: + < kMatchSpecLenStart : normal remain + = kMatchSpecLenStart : finished + = kMatchSpecLenStart + 1 : need init range coder + = kMatchSpecLenStart + 2 : need init range coder and state +*/ + +/* ---------- LZMA_DECODE_REAL ---------- */ +/* +LzmaDec_DecodeReal_3() can be implemented in external ASM file. +3 - is the code compatibility version of that function for check at link time. +*/ + +#define LZMA_DECODE_REAL LzmaDec_DecodeReal_3 + +/* +LZMA_DECODE_REAL() +In: + RangeCoder is normalized + if (p->dicPos == limit) + { + LzmaDec_TryDummy() was called before to exclude LITERAL and MATCH-REP cases. + So first symbol can be only MATCH-NON-REP. And if that MATCH-NON-REP symbol + is not END_OF_PAYALOAD_MARKER, then function returns error code. + } + +Processing: + first LZMA symbol will be decoded in any case + All checks for limits are at the end of main loop, + It will decode new LZMA-symbols while (p->buf < bufLimit && dicPos < limit), + RangeCoder is still without last normalization when (p->buf < bufLimit) is being checked. + +Out: + RangeCoder is normalized + Result: + SZ_OK - OK + SZ_ERROR_DATA - Error + p->remainLen: + < kMatchSpecLenStart : normal remain + = kMatchSpecLenStart : finished +*/ + + +#ifdef _LZMA_DEC_OPT + +int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit); + +#else + +static +int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit) +{ + CLzmaProb *probs = GET_PROBS; + unsigned state = (unsigned)p->state; + UInt32 rep0 = p->reps[0], rep1 = p->reps[1], rep2 = p->reps[2], rep3 = p->reps[3]; + unsigned pbMask = ((unsigned)1 << (p->prop.pb)) - 1; + unsigned lc = p->prop.lc; + unsigned lpMask = ((unsigned)0x100 << p->prop.lp) - ((unsigned)0x100 >> lc); + + Byte *dic = p->dic; + SizeT dicBufSize = p->dicBufSize; + SizeT dicPos = p->dicPos; + + UInt32 processedPos = p->processedPos; + UInt32 checkDicSize = p->checkDicSize; + unsigned len = 0; + + const Byte *buf = p->buf; + UInt32 range = p->range; + UInt32 code = p->code; + + do + { + CLzmaProb *prob; + UInt32 bound; + unsigned ttt; + unsigned posState = CALC_POS_STATE(processedPos, pbMask); + + prob = probs + IsMatch + COMBINED_PS_STATE; + IF_BIT_0(prob) + { + unsigned symbol; + UPDATE_0(prob); + prob = probs + Literal; + if (processedPos != 0 || checkDicSize != 0) + prob += (UInt32)3 * ((((processedPos << 8) + dic[(dicPos == 0 ? dicBufSize : dicPos) - 1]) & lpMask) << lc); + processedPos++; + + if (state < kNumLitStates) + { + state -= (state < 4) ? state : 3; + symbol = 1; + #ifdef _LZMA_SIZE_OPT + do { NORMAL_LITER_DEC } while (symbol < 0x100); + #else + NORMAL_LITER_DEC + NORMAL_LITER_DEC + NORMAL_LITER_DEC + NORMAL_LITER_DEC + NORMAL_LITER_DEC + NORMAL_LITER_DEC + NORMAL_LITER_DEC + NORMAL_LITER_DEC + #endif + } + else + { + unsigned matchByte = dic[dicPos - rep0 + (dicPos < rep0 ? dicBufSize : 0)]; + unsigned offs = 0x100; + state -= (state < 10) ? 3 : 6; + symbol = 1; + #ifdef _LZMA_SIZE_OPT + do + { + unsigned bit; + CLzmaProb *probLit; + MATCHED_LITER_DEC + } + while (symbol < 0x100); + #else + { + unsigned bit; + CLzmaProb *probLit; + MATCHED_LITER_DEC + MATCHED_LITER_DEC + MATCHED_LITER_DEC + MATCHED_LITER_DEC + MATCHED_LITER_DEC + MATCHED_LITER_DEC + MATCHED_LITER_DEC + MATCHED_LITER_DEC + } + #endif + } + + dic[dicPos++] = (Byte)symbol; + continue; + } + + { + UPDATE_1(prob); + prob = probs + IsRep + state; + IF_BIT_0(prob) + { + UPDATE_0(prob); + state += kNumStates; + prob = probs + LenCoder; + } + else + { + UPDATE_1(prob); + /* + // that case was checked before with kBadRepCode + if (checkDicSize == 0 && processedPos == 0) + return SZ_ERROR_DATA; + */ + prob = probs + IsRepG0 + state; + IF_BIT_0(prob) + { + UPDATE_0(prob); + prob = probs + IsRep0Long + COMBINED_PS_STATE; + IF_BIT_0(prob) + { + UPDATE_0(prob); + dic[dicPos] = dic[dicPos - rep0 + (dicPos < rep0 ? dicBufSize : 0)]; + dicPos++; + processedPos++; + state = state < kNumLitStates ? 9 : 11; + continue; + } + UPDATE_1(prob); + } + else + { + UInt32 distance; + UPDATE_1(prob); + prob = probs + IsRepG1 + state; + IF_BIT_0(prob) + { + UPDATE_0(prob); + distance = rep1; + } + else + { + UPDATE_1(prob); + prob = probs + IsRepG2 + state; + IF_BIT_0(prob) + { + UPDATE_0(prob); + distance = rep2; + } + else + { + UPDATE_1(prob); + distance = rep3; + rep3 = rep2; + } + rep2 = rep1; + } + rep1 = rep0; + rep0 = distance; + } + state = state < kNumLitStates ? 8 : 11; + prob = probs + RepLenCoder; + } + + #ifdef _LZMA_SIZE_OPT + { + unsigned lim, offset; + CLzmaProb *probLen = prob + LenChoice; + IF_BIT_0(probLen) + { + UPDATE_0(probLen); + probLen = prob + LenLow + GET_LEN_STATE; + offset = 0; + lim = (1 << kLenNumLowBits); + } + else + { + UPDATE_1(probLen); + probLen = prob + LenChoice2; + IF_BIT_0(probLen) + { + UPDATE_0(probLen); + probLen = prob + LenLow + GET_LEN_STATE + (1 << kLenNumLowBits); + offset = kLenNumLowSymbols; + lim = (1 << kLenNumLowBits); + } + else + { + UPDATE_1(probLen); + probLen = prob + LenHigh; + offset = kLenNumLowSymbols * 2; + lim = (1 << kLenNumHighBits); + } + } + TREE_DECODE(probLen, lim, len); + len += offset; + } + #else + { + CLzmaProb *probLen = prob + LenChoice; + IF_BIT_0(probLen) + { + UPDATE_0(probLen); + probLen = prob + LenLow + GET_LEN_STATE; + len = 1; + TREE_GET_BIT(probLen, len); + TREE_GET_BIT(probLen, len); + TREE_GET_BIT(probLen, len); + len -= 8; + } + else + { + UPDATE_1(probLen); + probLen = prob + LenChoice2; + IF_BIT_0(probLen) + { + UPDATE_0(probLen); + probLen = prob + LenLow + GET_LEN_STATE + (1 << kLenNumLowBits); + len = 1; + TREE_GET_BIT(probLen, len); + TREE_GET_BIT(probLen, len); + TREE_GET_BIT(probLen, len); + } + else + { + UPDATE_1(probLen); + probLen = prob + LenHigh; + TREE_DECODE(probLen, (1 << kLenNumHighBits), len); + len += kLenNumLowSymbols * 2; + } + } + } + #endif + + if (state >= kNumStates) + { + UInt32 distance; + prob = probs + PosSlot + + ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << kNumPosSlotBits); + TREE_6_DECODE(prob, distance); + if (distance >= kStartPosModelIndex) + { + unsigned posSlot = (unsigned)distance; + unsigned numDirectBits = (unsigned)(((distance >> 1) - 1)); + distance = (2 | (distance & 1)); + if (posSlot < kEndPosModelIndex) + { + distance <<= numDirectBits; + prob = probs + SpecPos; + { + UInt32 m = 1; + distance++; + do + { + REV_BIT_VAR(prob, distance, m); + } + while (--numDirectBits); + distance -= m; + } + } + else + { + numDirectBits -= kNumAlignBits; + do + { + NORMALIZE + range >>= 1; + + { + UInt32 t; + code -= range; + t = (0 - ((UInt32)code >> 31)); /* (UInt32)((Int32)code >> 31) */ + distance = (distance << 1) + (t + 1); + code += range & t; + } + /* + distance <<= 1; + if (code >= range) + { + code -= range; + distance |= 1; + } + */ + } + while (--numDirectBits); + prob = probs + Align; + distance <<= kNumAlignBits; + { + unsigned i = 1; + REV_BIT_CONST(prob, i, 1); + REV_BIT_CONST(prob, i, 2); + REV_BIT_CONST(prob, i, 4); + REV_BIT_LAST (prob, i, 8); + distance |= i; + } + if (distance == (UInt32)0xFFFFFFFF) + { + len = kMatchSpecLenStart; + state -= kNumStates; + break; + } + } + } + + rep3 = rep2; + rep2 = rep1; + rep1 = rep0; + rep0 = distance + 1; + state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3; + if (distance >= (checkDicSize == 0 ? processedPos: checkDicSize)) + { + p->dicPos = dicPos; + return SZ_ERROR_DATA; + } + } + + len += kMatchMinLen; + + { + SizeT rem; + unsigned curLen; + SizeT pos; + + if ((rem = limit - dicPos) == 0) + { + p->dicPos = dicPos; + return SZ_ERROR_DATA; + } + + curLen = ((rem < len) ? (unsigned)rem : len); + pos = dicPos - rep0 + (dicPos < rep0 ? dicBufSize : 0); + + processedPos += (UInt32)curLen; + + len -= curLen; + if (curLen <= dicBufSize - pos) + { + Byte *dest = dic + dicPos; + ptrdiff_t src = (ptrdiff_t)pos - (ptrdiff_t)dicPos; + const Byte *lim = dest + curLen; + dicPos += (SizeT)curLen; + do + *(dest) = (Byte)*(dest + src); + while (++dest != lim); + } + else + { + do + { + dic[dicPos++] = dic[pos]; + if (++pos == dicBufSize) + pos = 0; + } + while (--curLen != 0); + } + } + } + } + while (dicPos < limit && buf < bufLimit); + + NORMALIZE; + + p->buf = buf; + p->range = range; + p->code = code; + p->remainLen = (UInt32)len; + p->dicPos = dicPos; + p->processedPos = processedPos; + p->reps[0] = rep0; + p->reps[1] = rep1; + p->reps[2] = rep2; + p->reps[3] = rep3; + p->state = (UInt32)state; + + return SZ_OK; +} +#endif + +static void MY_FAST_CALL LzmaDec_WriteRem(CLzmaDec *p, SizeT limit) +{ + if (p->remainLen != 0 && p->remainLen < kMatchSpecLenStart) + { + Byte *dic = p->dic; + SizeT dicPos = p->dicPos; + SizeT dicBufSize = p->dicBufSize; + unsigned len = (unsigned)p->remainLen; + SizeT rep0 = p->reps[0]; /* we use SizeT to avoid the BUG of VC14 for AMD64 */ + SizeT rem = limit - dicPos; + if (rem < len) + len = (unsigned)(rem); + + if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= len) + p->checkDicSize = p->prop.dicSize; + + p->processedPos += (UInt32)len; + p->remainLen -= (UInt32)len; + while (len != 0) + { + len--; + dic[dicPos] = dic[dicPos - rep0 + (dicPos < rep0 ? dicBufSize : 0)]; + dicPos++; + } + p->dicPos = dicPos; + } +} + + +#define kRange0 0xFFFFFFFF +#define kBound0 ((kRange0 >> kNumBitModelTotalBits) << (kNumBitModelTotalBits - 1)) +#define kBadRepCode (kBound0 + (((kRange0 - kBound0) >> kNumBitModelTotalBits) << (kNumBitModelTotalBits - 1))) +#if kBadRepCode != (0xC0000000 - 0x400) + #error Stop_Compiling_Bad_LZMA_Check +#endif + +static int MY_FAST_CALL LzmaDec_DecodeReal2(CLzmaDec *p, SizeT limit, const Byte *bufLimit) +{ + do + { + SizeT limit2 = limit; + if (p->checkDicSize == 0) + { + UInt32 rem = p->prop.dicSize - p->processedPos; + if (limit - p->dicPos > rem) + limit2 = p->dicPos + rem; + + if (p->processedPos == 0) + if (p->code >= kBadRepCode) + return SZ_ERROR_DATA; + } + + RINOK(LZMA_DECODE_REAL(p, limit2, bufLimit)); + + if (p->checkDicSize == 0 && p->processedPos >= p->prop.dicSize) + p->checkDicSize = p->prop.dicSize; + + LzmaDec_WriteRem(p, limit); + } + while (p->dicPos < limit && p->buf < bufLimit && p->remainLen < kMatchSpecLenStart); + + return 0; +} + +typedef enum +{ + DUMMY_ERROR, /* unexpected end of input stream */ + DUMMY_LIT, + DUMMY_MATCH, + DUMMY_REP +} ELzmaDummy; + +static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inSize) +{ + UInt32 range = p->range; + UInt32 code = p->code; + const Byte *bufLimit = buf + inSize; + const CLzmaProb *probs = GET_PROBS; + unsigned state = (unsigned)p->state; + ELzmaDummy res; + + { + const CLzmaProb *prob; + UInt32 bound; + unsigned ttt; + unsigned posState = CALC_POS_STATE(p->processedPos, (1 << p->prop.pb) - 1); + + prob = probs + IsMatch + COMBINED_PS_STATE; + IF_BIT_0_CHECK(prob) + { + UPDATE_0_CHECK + + /* if (bufLimit - buf >= 7) return DUMMY_LIT; */ + + prob = probs + Literal; + if (p->checkDicSize != 0 || p->processedPos != 0) + prob += ((UInt32)LZMA_LIT_SIZE * + ((((p->processedPos) & ((1 << (p->prop.lp)) - 1)) << p->prop.lc) + + (p->dic[(p->dicPos == 0 ? p->dicBufSize : p->dicPos) - 1] >> (8 - p->prop.lc)))); + + if (state < kNumLitStates) + { + unsigned symbol = 1; + do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100); + } + else + { + unsigned matchByte = p->dic[p->dicPos - p->reps[0] + + (p->dicPos < p->reps[0] ? p->dicBufSize : 0)]; + unsigned offs = 0x100; + unsigned symbol = 1; + do + { + unsigned bit; + const CLzmaProb *probLit; + matchByte += matchByte; + bit = offs; + offs &= matchByte; + probLit = prob + (offs + bit + symbol); + GET_BIT2_CHECK(probLit, symbol, offs ^= bit; , ; ) + } + while (symbol < 0x100); + } + res = DUMMY_LIT; + } + else + { + unsigned len; + UPDATE_1_CHECK; + + prob = probs + IsRep + state; + IF_BIT_0_CHECK(prob) + { + UPDATE_0_CHECK; + state = 0; + prob = probs + LenCoder; + res = DUMMY_MATCH; + } + else + { + UPDATE_1_CHECK; + res = DUMMY_REP; + prob = probs + IsRepG0 + state; + IF_BIT_0_CHECK(prob) + { + UPDATE_0_CHECK; + prob = probs + IsRep0Long + COMBINED_PS_STATE; + IF_BIT_0_CHECK(prob) + { + UPDATE_0_CHECK; + NORMALIZE_CHECK; + return DUMMY_REP; + } + else + { + UPDATE_1_CHECK; + } + } + else + { + UPDATE_1_CHECK; + prob = probs + IsRepG1 + state; + IF_BIT_0_CHECK(prob) + { + UPDATE_0_CHECK; + } + else + { + UPDATE_1_CHECK; + prob = probs + IsRepG2 + state; + IF_BIT_0_CHECK(prob) + { + UPDATE_0_CHECK; + } + else + { + UPDATE_1_CHECK; + } + } + } + state = kNumStates; + prob = probs + RepLenCoder; + } + { + unsigned limit, offset; + const CLzmaProb *probLen = prob + LenChoice; + IF_BIT_0_CHECK(probLen) + { + UPDATE_0_CHECK; + probLen = prob + LenLow + GET_LEN_STATE; + offset = 0; + limit = 1 << kLenNumLowBits; + } + else + { + UPDATE_1_CHECK; + probLen = prob + LenChoice2; + IF_BIT_0_CHECK(probLen) + { + UPDATE_0_CHECK; + probLen = prob + LenLow + GET_LEN_STATE + (1 << kLenNumLowBits); + offset = kLenNumLowSymbols; + limit = 1 << kLenNumLowBits; + } + else + { + UPDATE_1_CHECK; + probLen = prob + LenHigh; + offset = kLenNumLowSymbols * 2; + limit = 1 << kLenNumHighBits; + } + } + TREE_DECODE_CHECK(probLen, limit, len); + len += offset; + } + + if (state < 4) + { + unsigned posSlot; + prob = probs + PosSlot + + ((len < kNumLenToPosStates - 1 ? len : kNumLenToPosStates - 1) << + kNumPosSlotBits); + TREE_DECODE_CHECK(prob, 1 << kNumPosSlotBits, posSlot); + if (posSlot >= kStartPosModelIndex) + { + unsigned numDirectBits = ((posSlot >> 1) - 1); + + /* if (bufLimit - buf >= 8) return DUMMY_MATCH; */ + + if (posSlot < kEndPosModelIndex) + { + prob = probs + SpecPos + ((2 | (posSlot & 1)) << numDirectBits); + } + else + { + numDirectBits -= kNumAlignBits; + do + { + NORMALIZE_CHECK + range >>= 1; + code -= range & (((code - range) >> 31) - 1); + /* if (code >= range) code -= range; */ + } + while (--numDirectBits); + prob = probs + Align; + numDirectBits = kNumAlignBits; + } + { + unsigned i = 1; + unsigned m = 1; + do + { + REV_BIT_CHECK(prob, i, m); + } + while (--numDirectBits); + } + } + } + } + } + NORMALIZE_CHECK; + return res; +} + + +void LzmaDec_InitDicAndState(CLzmaDec *p, BoolInt initDic, BoolInt initState) +{ + p->remainLen = kMatchSpecLenStart + 1; + p->tempBufSize = 0; + + if (initDic) + { + p->processedPos = 0; + p->checkDicSize = 0; + p->remainLen = kMatchSpecLenStart + 2; + } + if (initState) + p->remainLen = kMatchSpecLenStart + 2; +} + +void LzmaDec_Init(CLzmaDec *p) +{ + p->dicPos = 0; + LzmaDec_InitDicAndState(p, True, True); +} + + +SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen, + ELzmaFinishMode finishMode, ELzmaStatus *status) +{ + SizeT inSize = *srcLen; + (*srcLen) = 0; + + *status = LZMA_STATUS_NOT_SPECIFIED; + + if (p->remainLen > kMatchSpecLenStart) + { + for (; inSize > 0 && p->tempBufSize < RC_INIT_SIZE; (*srcLen)++, inSize--) + p->tempBuf[p->tempBufSize++] = *src++; + if (p->tempBufSize != 0 && p->tempBuf[0] != 0) + return SZ_ERROR_DATA; + if (p->tempBufSize < RC_INIT_SIZE) + { + *status = LZMA_STATUS_NEEDS_MORE_INPUT; + return SZ_OK; + } + p->code = + ((UInt32)p->tempBuf[1] << 24) + | ((UInt32)p->tempBuf[2] << 16) + | ((UInt32)p->tempBuf[3] << 8) + | ((UInt32)p->tempBuf[4]); + p->range = 0xFFFFFFFF; + p->tempBufSize = 0; + + if (p->remainLen > kMatchSpecLenStart + 1) + { + SizeT numProbs = LzmaProps_GetNumProbs(&p->prop); + SizeT i; + CLzmaProb *probs = p->probs; + for (i = 0; i < numProbs; i++) + probs[i] = kBitModelTotal >> 1; + p->reps[0] = p->reps[1] = p->reps[2] = p->reps[3] = 1; + p->state = 0; + } + + p->remainLen = 0; + } + + LzmaDec_WriteRem(p, dicLimit); + + while (p->remainLen != kMatchSpecLenStart) + { + int checkEndMarkNow = 0; + + if (p->dicPos >= dicLimit) + { + if (p->remainLen == 0 && p->code == 0) + { + *status = LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK; + return SZ_OK; + } + if (finishMode == LZMA_FINISH_ANY) + { + *status = LZMA_STATUS_NOT_FINISHED; + return SZ_OK; + } + if (p->remainLen != 0) + { + *status = LZMA_STATUS_NOT_FINISHED; + return SZ_ERROR_DATA; + } + checkEndMarkNow = 1; + } + + if (p->tempBufSize == 0) + { + SizeT processed; + const Byte *bufLimit; + if (inSize < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) + { + int dummyRes = LzmaDec_TryDummy(p, src, inSize); + if (dummyRes == DUMMY_ERROR) + { + memcpy(p->tempBuf, src, inSize); + p->tempBufSize = (unsigned)inSize; + (*srcLen) += inSize; + *status = LZMA_STATUS_NEEDS_MORE_INPUT; + return SZ_OK; + } + if (checkEndMarkNow && dummyRes != DUMMY_MATCH) + { + *status = LZMA_STATUS_NOT_FINISHED; + return SZ_ERROR_DATA; + } + bufLimit = src; + } + else + bufLimit = src + inSize - LZMA_REQUIRED_INPUT_MAX; + p->buf = src; + if (LzmaDec_DecodeReal2(p, dicLimit, bufLimit) != 0) + return SZ_ERROR_DATA; + processed = (SizeT)(p->buf - src); + (*srcLen) += processed; + src += processed; + inSize -= processed; + } + else + { + unsigned rem = p->tempBufSize, lookAhead = 0; + while (rem < LZMA_REQUIRED_INPUT_MAX && lookAhead < inSize) + p->tempBuf[rem++] = src[lookAhead++]; + p->tempBufSize = rem; + if (rem < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) + { + int dummyRes = LzmaDec_TryDummy(p, p->tempBuf, (SizeT)rem); + if (dummyRes == DUMMY_ERROR) + { + (*srcLen) += (SizeT)lookAhead; + *status = LZMA_STATUS_NEEDS_MORE_INPUT; + return SZ_OK; + } + if (checkEndMarkNow && dummyRes != DUMMY_MATCH) + { + *status = LZMA_STATUS_NOT_FINISHED; + return SZ_ERROR_DATA; + } + } + p->buf = p->tempBuf; + if (LzmaDec_DecodeReal2(p, dicLimit, p->buf) != 0) + return SZ_ERROR_DATA; + + { + unsigned kkk = (unsigned)(p->buf - p->tempBuf); + if (rem < kkk) + return SZ_ERROR_FAIL; /* some internal error */ + rem -= kkk; + if (lookAhead < rem) + return SZ_ERROR_FAIL; /* some internal error */ + lookAhead -= rem; + } + (*srcLen) += (SizeT)lookAhead; + src += lookAhead; + inSize -= (SizeT)lookAhead; + p->tempBufSize = 0; + } + } + + if (p->code != 0) + return SZ_ERROR_DATA; + *status = LZMA_STATUS_FINISHED_WITH_MARK; + return SZ_OK; +} + + +SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status) +{ + SizeT outSize = *destLen; + SizeT inSize = *srcLen; + *srcLen = *destLen = 0; + for (;;) + { + SizeT inSizeCur = inSize, outSizeCur, dicPos; + ELzmaFinishMode curFinishMode; + SRes res; + if (p->dicPos == p->dicBufSize) + p->dicPos = 0; + dicPos = p->dicPos; + if (outSize > p->dicBufSize - dicPos) + { + outSizeCur = p->dicBufSize; + curFinishMode = LZMA_FINISH_ANY; + } + else + { + outSizeCur = dicPos + outSize; + curFinishMode = finishMode; + } + + res = LzmaDec_DecodeToDic(p, outSizeCur, src, &inSizeCur, curFinishMode, status); + src += inSizeCur; + inSize -= inSizeCur; + *srcLen += inSizeCur; + outSizeCur = p->dicPos - dicPos; + memcpy(dest, p->dic + dicPos, outSizeCur); + dest += outSizeCur; + outSize -= outSizeCur; + *destLen += outSizeCur; + if (res != 0) + return res; + if (outSizeCur == 0 || outSize == 0) + return SZ_OK; + } +} + +void LzmaDec_FreeProbs(CLzmaDec *p, ISzAllocPtr alloc) +{ + ISzAlloc_Free(alloc, p->probs); + p->probs = NULL; +} + +static void LzmaDec_FreeDict(CLzmaDec *p, ISzAllocPtr alloc) +{ + ISzAlloc_Free(alloc, p->dic); + p->dic = NULL; +} + +void LzmaDec_Free(CLzmaDec *p, ISzAllocPtr alloc) +{ + LzmaDec_FreeProbs(p, alloc); + LzmaDec_FreeDict(p, alloc); +} + +SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size) +{ + UInt32 dicSize; + Byte d; + + if (size < LZMA_PROPS_SIZE) + return SZ_ERROR_UNSUPPORTED; + else + dicSize = data[1] | ((UInt32)data[2] << 8) | ((UInt32)data[3] << 16) | ((UInt32)data[4] << 24); + + if (dicSize < LZMA_DIC_MIN) + dicSize = LZMA_DIC_MIN; + p->dicSize = dicSize; + + d = data[0]; + if (d >= (9 * 5 * 5)) + return SZ_ERROR_UNSUPPORTED; + + p->lc = (Byte)(d % 9); + d /= 9; + p->pb = (Byte)(d / 5); + p->lp = (Byte)(d % 5); + + return SZ_OK; +} + +static SRes LzmaDec_AllocateProbs2(CLzmaDec *p, const CLzmaProps *propNew, ISzAllocPtr alloc) +{ + UInt32 numProbs = LzmaProps_GetNumProbs(propNew); + if (!p->probs || numProbs != p->numProbs) + { + LzmaDec_FreeProbs(p, alloc); + p->probs = (CLzmaProb *)ISzAlloc_Alloc(alloc, numProbs * sizeof(CLzmaProb)); + if (!p->probs) + return SZ_ERROR_MEM; + p->probs_1664 = p->probs + 1664; + p->numProbs = numProbs; + } + return SZ_OK; +} + +SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAllocPtr alloc) +{ + CLzmaProps propNew; + RINOK(LzmaProps_Decode(&propNew, props, propsSize)); + RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc)); + p->prop = propNew; + return SZ_OK; +} + +SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAllocPtr alloc) +{ + CLzmaProps propNew; + SizeT dicBufSize; + RINOK(LzmaProps_Decode(&propNew, props, propsSize)); + RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc)); + + { + UInt32 dictSize = propNew.dicSize; + SizeT mask = ((UInt32)1 << 12) - 1; + if (dictSize >= ((UInt32)1 << 30)) mask = ((UInt32)1 << 22) - 1; + else if (dictSize >= ((UInt32)1 << 22)) mask = ((UInt32)1 << 20) - 1;; + dicBufSize = ((SizeT)dictSize + mask) & ~mask; + if (dicBufSize < dictSize) + dicBufSize = dictSize; + } + + if (!p->dic || dicBufSize != p->dicBufSize) + { + LzmaDec_FreeDict(p, alloc); + p->dic = (Byte *)ISzAlloc_Alloc(alloc, dicBufSize); + if (!p->dic) + { + LzmaDec_FreeProbs(p, alloc); + return SZ_ERROR_MEM; + } + } + p->dicBufSize = dicBufSize; + p->prop = propNew; + return SZ_OK; +} + +SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, + const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, + ELzmaStatus *status, ISzAllocPtr alloc) +{ + CLzmaDec p; + SRes res; + SizeT outSize = *destLen, inSize = *srcLen; + *destLen = *srcLen = 0; + *status = LZMA_STATUS_NOT_SPECIFIED; + if (inSize < RC_INIT_SIZE) + return SZ_ERROR_INPUT_EOF; + LzmaDec_Construct(&p); + RINOK(LzmaDec_AllocateProbs(&p, propData, propSize, alloc)); + p.dic = dest; + p.dicBufSize = outSize; + LzmaDec_Init(&p); + *srcLen = inSize; + res = LzmaDec_DecodeToDic(&p, outSize, src, srcLen, finishMode, status); + *destLen = p.dicPos; + if (res == SZ_OK && *status == LZMA_STATUS_NEEDS_MORE_INPUT) + res = SZ_ERROR_INPUT_EOF; + LzmaDec_FreeProbs(&p, alloc); + return res; +} diff --git a/Source/Libraries/lzma/LzmaEnc.c b/Source/Libraries/lzma/LzmaEnc.c new file mode 100644 index 000000000..46a0db000 --- /dev/null +++ b/Source/Libraries/lzma/LzmaEnc.c @@ -0,0 +1,2976 @@ +/* LzmaEnc.c -- LZMA Encoder +2019-01-10: Igor Pavlov : Public domain */ + +#include "Precomp.h" + +#include + +/* #define SHOW_STAT */ +/* #define SHOW_STAT2 */ + +#if defined(SHOW_STAT) || defined(SHOW_STAT2) +#include +#endif + +#include "LzmaEnc.h" + +#include "LzFind.h" +#ifndef _7ZIP_ST +#include "LzFindMt.h" +#endif + +#ifdef SHOW_STAT +static unsigned g_STAT_OFFSET = 0; +#endif + +#define kLzmaMaxHistorySize ((UInt32)3 << 29) +/* #define kLzmaMaxHistorySize ((UInt32)7 << 29) */ + +#define kNumTopBits 24 +#define kTopValue ((UInt32)1 << kNumTopBits) + +#define kNumBitModelTotalBits 11 +#define kBitModelTotal (1 << kNumBitModelTotalBits) +#define kNumMoveBits 5 +#define kProbInitValue (kBitModelTotal >> 1) + +#define kNumMoveReducingBits 4 +#define kNumBitPriceShiftBits 4 +#define kBitPrice (1 << kNumBitPriceShiftBits) + +#define REP_LEN_COUNT 64 + +void LzmaEncProps_Init(CLzmaEncProps *p) +{ + p->level = 5; + p->dictSize = p->mc = 0; + p->reduceSize = (UInt64)(Int64)-1; + p->lc = p->lp = p->pb = p->algo = p->fb = p->btMode = p->numHashBytes = p->numThreads = -1; + p->writeEndMark = 0; +} + +void LzmaEncProps_Normalize(CLzmaEncProps *p) +{ + int level = p->level; + if (level < 0) level = 5; + p->level = level; + + if (p->dictSize == 0) p->dictSize = (level <= 5 ? (1 << (level * 2 + 14)) : (level <= 7 ? (1 << 25) : (1 << 26))); + if (p->dictSize > p->reduceSize) + { + unsigned i; + UInt32 reduceSize = (UInt32)p->reduceSize; + for (i = 11; i <= 30; i++) + { + if (reduceSize <= ((UInt32)2 << i)) { p->dictSize = ((UInt32)2 << i); break; } + if (reduceSize <= ((UInt32)3 << i)) { p->dictSize = ((UInt32)3 << i); break; } + } + } + + if (p->lc < 0) p->lc = 3; + if (p->lp < 0) p->lp = 0; + if (p->pb < 0) p->pb = 2; + + if (p->algo < 0) p->algo = (level < 5 ? 0 : 1); + if (p->fb < 0) p->fb = (level < 7 ? 32 : 64); + if (p->btMode < 0) p->btMode = (p->algo == 0 ? 0 : 1); + if (p->numHashBytes < 0) p->numHashBytes = 4; + if (p->mc == 0) p->mc = (16 + (p->fb >> 1)) >> (p->btMode ? 0 : 1); + + if (p->numThreads < 0) + p->numThreads = + #ifndef _7ZIP_ST + ((p->btMode && p->algo) ? 2 : 1); + #else + 1; + #endif +} + +UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2) +{ + CLzmaEncProps props = *props2; + LzmaEncProps_Normalize(&props); + return props.dictSize; +} + +#if (_MSC_VER >= 1400) +/* BSR code is fast for some new CPUs */ +/* #define LZMA_LOG_BSR */ +#endif + +#ifdef LZMA_LOG_BSR + +#define kDicLogSizeMaxCompress 32 + +#define BSR2_RET(pos, res) { unsigned long zz; _BitScanReverse(&zz, (pos)); res = (zz + zz) + ((pos >> (zz - 1)) & 1); } + +static unsigned GetPosSlot1(UInt32 pos) +{ + unsigned res; + BSR2_RET(pos, res); + return res; +} +#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); } +#define GetPosSlot(pos, res) { if (pos < 2) res = pos; else BSR2_RET(pos, res); } + +#else + +#define kNumLogBits (9 + sizeof(size_t) / 2) +/* #define kNumLogBits (11 + sizeof(size_t) / 8 * 3) */ + +#define kDicLogSizeMaxCompress ((kNumLogBits - 1) * 2 + 7) + +static void LzmaEnc_FastPosInit(Byte *g_FastPos) +{ + unsigned slot; + g_FastPos[0] = 0; + g_FastPos[1] = 1; + g_FastPos += 2; + + for (slot = 2; slot < kNumLogBits * 2; slot++) + { + size_t k = ((size_t)1 << ((slot >> 1) - 1)); + size_t j; + for (j = 0; j < k; j++) + g_FastPos[j] = (Byte)slot; + g_FastPos += k; + } +} + +/* we can use ((limit - pos) >> 31) only if (pos < ((UInt32)1 << 31)) */ +/* +#define BSR2_RET(pos, res) { unsigned zz = 6 + ((kNumLogBits - 1) & \ + (0 - (((((UInt32)1 << (kNumLogBits + 6)) - 1) - pos) >> 31))); \ + res = p->g_FastPos[pos >> zz] + (zz * 2); } +*/ + +/* +#define BSR2_RET(pos, res) { unsigned zz = 6 + ((kNumLogBits - 1) & \ + (0 - (((((UInt32)1 << (kNumLogBits)) - 1) - (pos >> 6)) >> 31))); \ + res = p->g_FastPos[pos >> zz] + (zz * 2); } +*/ + +#define BSR2_RET(pos, res) { unsigned zz = (pos < (1 << (kNumLogBits + 6))) ? 6 : 6 + kNumLogBits - 1; \ + res = p->g_FastPos[pos >> zz] + (zz * 2); } + +/* +#define BSR2_RET(pos, res) { res = (pos < (1 << (kNumLogBits + 6))) ? \ + p->g_FastPos[pos >> 6] + 12 : \ + p->g_FastPos[pos >> (6 + kNumLogBits - 1)] + (6 + (kNumLogBits - 1)) * 2; } +*/ + +#define GetPosSlot1(pos) p->g_FastPos[pos] +#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); } +#define GetPosSlot(pos, res) { if (pos < kNumFullDistances) res = p->g_FastPos[pos & (kNumFullDistances - 1)]; else BSR2_RET(pos, res); } + +#endif + + +#define LZMA_NUM_REPS 4 + +typedef UInt16 CState; +typedef UInt16 CExtra; + +typedef struct +{ + UInt32 price; + CState state; + CExtra extra; + // 0 : normal + // 1 : LIT : MATCH + // > 1 : MATCH (extra-1) : LIT : REP0 (len) + UInt32 len; + UInt32 dist; + UInt32 reps[LZMA_NUM_REPS]; +} COptimal; + + +// 18.06 +#define kNumOpts (1 << 11) +#define kPackReserve (kNumOpts * 8) +// #define kNumOpts (1 << 12) +// #define kPackReserve (1 + kNumOpts * 2) + +#define kNumLenToPosStates 4 +#define kNumPosSlotBits 6 +#define kDicLogSizeMin 0 +#define kDicLogSizeMax 32 +#define kDistTableSizeMax (kDicLogSizeMax * 2) + +#define kNumAlignBits 4 +#define kAlignTableSize (1 << kNumAlignBits) +#define kAlignMask (kAlignTableSize - 1) + +#define kStartPosModelIndex 4 +#define kEndPosModelIndex 14 +#define kNumFullDistances (1 << (kEndPosModelIndex >> 1)) + +typedef +#ifdef _LZMA_PROB32 + UInt32 +#else + UInt16 +#endif + CLzmaProb; + +#define LZMA_PB_MAX 4 +#define LZMA_LC_MAX 8 +#define LZMA_LP_MAX 4 + +#define LZMA_NUM_PB_STATES_MAX (1 << LZMA_PB_MAX) + +#define kLenNumLowBits 3 +#define kLenNumLowSymbols (1 << kLenNumLowBits) +#define kLenNumHighBits 8 +#define kLenNumHighSymbols (1 << kLenNumHighBits) +#define kLenNumSymbolsTotal (kLenNumLowSymbols * 2 + kLenNumHighSymbols) + +#define LZMA_MATCH_LEN_MIN 2 +#define LZMA_MATCH_LEN_MAX (LZMA_MATCH_LEN_MIN + kLenNumSymbolsTotal - 1) + +#define kNumStates 12 + + +typedef struct +{ + CLzmaProb low[LZMA_NUM_PB_STATES_MAX << (kLenNumLowBits + 1)]; + CLzmaProb high[kLenNumHighSymbols]; +} CLenEnc; + + +typedef struct +{ + unsigned tableSize; + UInt32 prices[LZMA_NUM_PB_STATES_MAX][kLenNumSymbolsTotal]; + // UInt32 prices1[LZMA_NUM_PB_STATES_MAX][kLenNumLowSymbols * 2]; + // UInt32 prices2[kLenNumSymbolsTotal]; +} CLenPriceEnc; + +#define GET_PRICE_LEN(p, posState, len) \ + ((p)->prices[posState][(size_t)(len) - LZMA_MATCH_LEN_MIN]) + +/* +#define GET_PRICE_LEN(p, posState, len) \ + ((p)->prices2[(size_t)(len) - 2] + ((p)->prices1[posState][((len) - 2) & (kLenNumLowSymbols * 2 - 1)] & (((len) - 2 - kLenNumLowSymbols * 2) >> 9))) +*/ + +typedef struct +{ + UInt32 range; + unsigned cache; + UInt64 low; + UInt64 cacheSize; + Byte *buf; + Byte *bufLim; + Byte *bufBase; + ISeqOutStream *outStream; + UInt64 processed; + SRes res; +} CRangeEnc; + + +typedef struct +{ + CLzmaProb *litProbs; + + unsigned state; + UInt32 reps[LZMA_NUM_REPS]; + + CLzmaProb posAlignEncoder[1 << kNumAlignBits]; + CLzmaProb isRep[kNumStates]; + CLzmaProb isRepG0[kNumStates]; + CLzmaProb isRepG1[kNumStates]; + CLzmaProb isRepG2[kNumStates]; + CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX]; + CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX]; + + CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits]; + CLzmaProb posEncoders[kNumFullDistances]; + + CLenEnc lenProbs; + CLenEnc repLenProbs; + +} CSaveState; + + +typedef UInt32 CProbPrice; + + +typedef struct +{ + void *matchFinderObj; + IMatchFinder matchFinder; + + unsigned optCur; + unsigned optEnd; + + unsigned longestMatchLen; + unsigned numPairs; + UInt32 numAvail; + + unsigned state; + unsigned numFastBytes; + unsigned additionalOffset; + UInt32 reps[LZMA_NUM_REPS]; + unsigned lpMask, pbMask; + CLzmaProb *litProbs; + CRangeEnc rc; + + UInt32 backRes; + + unsigned lc, lp, pb; + unsigned lclp; + + BoolInt fastMode; + BoolInt writeEndMark; + BoolInt finished; + BoolInt multiThread; + BoolInt needInit; + // BoolInt _maxMode; + + UInt64 nowPos64; + + unsigned matchPriceCount; + // unsigned alignPriceCount; + int repLenEncCounter; + + unsigned distTableSize; + + UInt32 dictSize; + SRes result; + + #ifndef _7ZIP_ST + BoolInt mtMode; + // begin of CMatchFinderMt is used in LZ thread + CMatchFinderMt matchFinderMt; + // end of CMatchFinderMt is used in BT and HASH threads + #endif + + CMatchFinder matchFinderBase; + + #ifndef _7ZIP_ST + Byte pad[128]; + #endif + + // LZ thread + CProbPrice ProbPrices[kBitModelTotal >> kNumMoveReducingBits]; + + UInt32 matches[LZMA_MATCH_LEN_MAX * 2 + 2 + 1]; + + UInt32 alignPrices[kAlignTableSize]; + UInt32 posSlotPrices[kNumLenToPosStates][kDistTableSizeMax]; + UInt32 distancesPrices[kNumLenToPosStates][kNumFullDistances]; + + CLzmaProb posAlignEncoder[1 << kNumAlignBits]; + CLzmaProb isRep[kNumStates]; + CLzmaProb isRepG0[kNumStates]; + CLzmaProb isRepG1[kNumStates]; + CLzmaProb isRepG2[kNumStates]; + CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX]; + CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX]; + CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits]; + CLzmaProb posEncoders[kNumFullDistances]; + + CLenEnc lenProbs; + CLenEnc repLenProbs; + + #ifndef LZMA_LOG_BSR + Byte g_FastPos[1 << kNumLogBits]; + #endif + + CLenPriceEnc lenEnc; + CLenPriceEnc repLenEnc; + + COptimal opt[kNumOpts]; + + CSaveState saveState; + + #ifndef _7ZIP_ST + Byte pad2[128]; + #endif +} CLzmaEnc; + + + +#define COPY_ARR(dest, src, arr) memcpy(dest->arr, src->arr, sizeof(src->arr)); + +void LzmaEnc_SaveState(CLzmaEncHandle pp) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + CSaveState *dest = &p->saveState; + + dest->state = p->state; + + dest->lenProbs = p->lenProbs; + dest->repLenProbs = p->repLenProbs; + + COPY_ARR(dest, p, reps); + + COPY_ARR(dest, p, posAlignEncoder); + COPY_ARR(dest, p, isRep); + COPY_ARR(dest, p, isRepG0); + COPY_ARR(dest, p, isRepG1); + COPY_ARR(dest, p, isRepG2); + COPY_ARR(dest, p, isMatch); + COPY_ARR(dest, p, isRep0Long); + COPY_ARR(dest, p, posSlotEncoder); + COPY_ARR(dest, p, posEncoders); + + memcpy(dest->litProbs, p->litProbs, ((UInt32)0x300 << p->lclp) * sizeof(CLzmaProb)); +} + + +void LzmaEnc_RestoreState(CLzmaEncHandle pp) +{ + CLzmaEnc *dest = (CLzmaEnc *)pp; + const CSaveState *p = &dest->saveState; + + dest->state = p->state; + + dest->lenProbs = p->lenProbs; + dest->repLenProbs = p->repLenProbs; + + COPY_ARR(dest, p, reps); + + COPY_ARR(dest, p, posAlignEncoder); + COPY_ARR(dest, p, isRep); + COPY_ARR(dest, p, isRepG0); + COPY_ARR(dest, p, isRepG1); + COPY_ARR(dest, p, isRepG2); + COPY_ARR(dest, p, isMatch); + COPY_ARR(dest, p, isRep0Long); + COPY_ARR(dest, p, posSlotEncoder); + COPY_ARR(dest, p, posEncoders); + + memcpy(dest->litProbs, p->litProbs, ((UInt32)0x300 << dest->lclp) * sizeof(CLzmaProb)); +} + + + +SRes LzmaEnc_SetProps(CLzmaEncHandle pp, const CLzmaEncProps *props2) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + CLzmaEncProps props = *props2; + LzmaEncProps_Normalize(&props); + + if (props.lc > LZMA_LC_MAX + || props.lp > LZMA_LP_MAX + || props.pb > LZMA_PB_MAX + || props.dictSize > ((UInt64)1 << kDicLogSizeMaxCompress) + || props.dictSize > kLzmaMaxHistorySize) + return SZ_ERROR_PARAM; + + p->dictSize = props.dictSize; + { + unsigned fb = props.fb; + if (fb < 5) + fb = 5; + if (fb > LZMA_MATCH_LEN_MAX) + fb = LZMA_MATCH_LEN_MAX; + p->numFastBytes = fb; + } + p->lc = props.lc; + p->lp = props.lp; + p->pb = props.pb; + p->fastMode = (props.algo == 0); + // p->_maxMode = True; + p->matchFinderBase.btMode = (Byte)(props.btMode ? 1 : 0); + { + unsigned numHashBytes = 4; + if (props.btMode) + { + if (props.numHashBytes < 2) + numHashBytes = 2; + else if (props.numHashBytes < 4) + numHashBytes = props.numHashBytes; + } + p->matchFinderBase.numHashBytes = numHashBytes; + } + + p->matchFinderBase.cutValue = props.mc; + + p->writeEndMark = props.writeEndMark; + + #ifndef _7ZIP_ST + /* + if (newMultiThread != _multiThread) + { + ReleaseMatchFinder(); + _multiThread = newMultiThread; + } + */ + p->multiThread = (props.numThreads > 1); + #endif + + return SZ_OK; +} + + +void LzmaEnc_SetDataSize(CLzmaEncHandle pp, UInt64 expectedDataSiize) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + p->matchFinderBase.expectedDataSize = expectedDataSiize; +} + + +#define kState_Start 0 +#define kState_LitAfterMatch 4 +#define kState_LitAfterRep 5 +#define kState_MatchAfterLit 7 +#define kState_RepAfterLit 8 + +static const Byte kLiteralNextStates[kNumStates] = {0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5}; +static const Byte kMatchNextStates[kNumStates] = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10}; +static const Byte kRepNextStates[kNumStates] = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11}; +static const Byte kShortRepNextStates[kNumStates]= {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11}; + +#define IsLitState(s) ((s) < 7) +#define GetLenToPosState2(len) (((len) < kNumLenToPosStates - 1) ? (len) : kNumLenToPosStates - 1) +#define GetLenToPosState(len) (((len) < kNumLenToPosStates + 1) ? (len) - 2 : kNumLenToPosStates - 1) + +#define kInfinityPrice (1 << 30) + +static void RangeEnc_Construct(CRangeEnc *p) +{ + p->outStream = NULL; + p->bufBase = NULL; +} + +#define RangeEnc_GetProcessed(p) ((p)->processed + ((p)->buf - (p)->bufBase) + (p)->cacheSize) +#define RangeEnc_GetProcessed_sizet(p) ((size_t)(p)->processed + ((p)->buf - (p)->bufBase) + (size_t)(p)->cacheSize) + +#define RC_BUF_SIZE (1 << 16) + +static int RangeEnc_Alloc(CRangeEnc *p, ISzAllocPtr alloc) +{ + if (!p->bufBase) + { + p->bufBase = (Byte *)ISzAlloc_Alloc(alloc, RC_BUF_SIZE); + if (!p->bufBase) + return 0; + p->bufLim = p->bufBase + RC_BUF_SIZE; + } + return 1; +} + +static void RangeEnc_Free(CRangeEnc *p, ISzAllocPtr alloc) +{ + ISzAlloc_Free(alloc, p->bufBase); + p->bufBase = 0; +} + +static void RangeEnc_Init(CRangeEnc *p) +{ + /* Stream.Init(); */ + p->range = 0xFFFFFFFF; + p->cache = 0; + p->low = 0; + p->cacheSize = 0; + + p->buf = p->bufBase; + + p->processed = 0; + p->res = SZ_OK; +} + +MY_NO_INLINE static void RangeEnc_FlushStream(CRangeEnc *p) +{ + size_t num; + if (p->res != SZ_OK) + return; + num = p->buf - p->bufBase; + if (num != ISeqOutStream_Write(p->outStream, p->bufBase, num)) + p->res = SZ_ERROR_WRITE; + p->processed += num; + p->buf = p->bufBase; +} + +MY_NO_INLINE static void MY_FAST_CALL RangeEnc_ShiftLow(CRangeEnc *p) +{ + UInt32 low = (UInt32)p->low; + unsigned high = (unsigned)(p->low >> 32); + p->low = (UInt32)(low << 8); + if (low < (UInt32)0xFF000000 || high != 0) + { + { + Byte *buf = p->buf; + *buf++ = (Byte)(p->cache + high); + p->cache = (unsigned)(low >> 24); + p->buf = buf; + if (buf == p->bufLim) + RangeEnc_FlushStream(p); + if (p->cacheSize == 0) + return; + } + high += 0xFF; + for (;;) + { + Byte *buf = p->buf; + *buf++ = (Byte)(high); + p->buf = buf; + if (buf == p->bufLim) + RangeEnc_FlushStream(p); + if (--p->cacheSize == 0) + return; + } + } + p->cacheSize++; +} + +static void RangeEnc_FlushData(CRangeEnc *p) +{ + int i; + for (i = 0; i < 5; i++) + RangeEnc_ShiftLow(p); +} + +#define RC_NORM(p) if (range < kTopValue) { range <<= 8; RangeEnc_ShiftLow(p); } + +#define RC_BIT_PRE(p, prob) \ + ttt = *(prob); \ + newBound = (range >> kNumBitModelTotalBits) * ttt; + +// #define _LZMA_ENC_USE_BRANCH + +#ifdef _LZMA_ENC_USE_BRANCH + +#define RC_BIT(p, prob, bit) { \ + RC_BIT_PRE(p, prob) \ + if (bit == 0) { range = newBound; ttt += (kBitModelTotal - ttt) >> kNumMoveBits; } \ + else { (p)->low += newBound; range -= newBound; ttt -= ttt >> kNumMoveBits; } \ + *(prob) = (CLzmaProb)ttt; \ + RC_NORM(p) \ + } + +#else + +#define RC_BIT(p, prob, bit) { \ + UInt32 mask; \ + RC_BIT_PRE(p, prob) \ + mask = 0 - (UInt32)bit; \ + range &= mask; \ + mask &= newBound; \ + range -= mask; \ + (p)->low += mask; \ + mask = (UInt32)bit - 1; \ + range += newBound & mask; \ + mask &= (kBitModelTotal - ((1 << kNumMoveBits) - 1)); \ + mask += ((1 << kNumMoveBits) - 1); \ + ttt += (Int32)(mask - ttt) >> kNumMoveBits; \ + *(prob) = (CLzmaProb)ttt; \ + RC_NORM(p) \ + } + +#endif + + + + +#define RC_BIT_0_BASE(p, prob) \ + range = newBound; *(prob) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); + +#define RC_BIT_1_BASE(p, prob) \ + range -= newBound; (p)->low += newBound; *(prob) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits)); \ + +#define RC_BIT_0(p, prob) \ + RC_BIT_0_BASE(p, prob) \ + RC_NORM(p) + +#define RC_BIT_1(p, prob) \ + RC_BIT_1_BASE(p, prob) \ + RC_NORM(p) + +static void RangeEnc_EncodeBit_0(CRangeEnc *p, CLzmaProb *prob) +{ + UInt32 range, ttt, newBound; + range = p->range; + RC_BIT_PRE(p, prob) + RC_BIT_0(p, prob) + p->range = range; +} + +static void LitEnc_Encode(CRangeEnc *p, CLzmaProb *probs, UInt32 sym) +{ + UInt32 range = p->range; + sym |= 0x100; + do + { + UInt32 ttt, newBound; + // RangeEnc_EncodeBit(p, probs + (sym >> 8), (sym >> 7) & 1); + CLzmaProb *prob = probs + (sym >> 8); + UInt32 bit = (sym >> 7) & 1; + sym <<= 1; + RC_BIT(p, prob, bit); + } + while (sym < 0x10000); + p->range = range; +} + +static void LitEnc_EncodeMatched(CRangeEnc *p, CLzmaProb *probs, UInt32 sym, UInt32 matchByte) +{ + UInt32 range = p->range; + UInt32 offs = 0x100; + sym |= 0x100; + do + { + UInt32 ttt, newBound; + CLzmaProb *prob; + UInt32 bit; + matchByte <<= 1; + // RangeEnc_EncodeBit(p, probs + (offs + (matchByte & offs) + (sym >> 8)), (sym >> 7) & 1); + prob = probs + (offs + (matchByte & offs) + (sym >> 8)); + bit = (sym >> 7) & 1; + sym <<= 1; + offs &= ~(matchByte ^ sym); + RC_BIT(p, prob, bit); + } + while (sym < 0x10000); + p->range = range; +} + + + +static void LzmaEnc_InitPriceTables(CProbPrice *ProbPrices) +{ + UInt32 i; + for (i = 0; i < (kBitModelTotal >> kNumMoveReducingBits); i++) + { + const unsigned kCyclesBits = kNumBitPriceShiftBits; + UInt32 w = (i << kNumMoveReducingBits) + (1 << (kNumMoveReducingBits - 1)); + unsigned bitCount = 0; + unsigned j; + for (j = 0; j < kCyclesBits; j++) + { + w = w * w; + bitCount <<= 1; + while (w >= ((UInt32)1 << 16)) + { + w >>= 1; + bitCount++; + } + } + ProbPrices[i] = (CProbPrice)((kNumBitModelTotalBits << kCyclesBits) - 15 - bitCount); + // printf("\n%3d: %5d", i, ProbPrices[i]); + } +} + + +#define GET_PRICE(prob, bit) \ + p->ProbPrices[((prob) ^ (unsigned)(((-(int)(bit))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits]; + +#define GET_PRICEa(prob, bit) \ + ProbPrices[((prob) ^ (unsigned)((-((int)(bit))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits]; + +#define GET_PRICE_0(prob) p->ProbPrices[(prob) >> kNumMoveReducingBits] +#define GET_PRICE_1(prob) p->ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits] + +#define GET_PRICEa_0(prob) ProbPrices[(prob) >> kNumMoveReducingBits] +#define GET_PRICEa_1(prob) ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits] + + +static UInt32 LitEnc_GetPrice(const CLzmaProb *probs, UInt32 sym, const CProbPrice *ProbPrices) +{ + UInt32 price = 0; + sym |= 0x100; + do + { + unsigned bit = sym & 1; + sym >>= 1; + price += GET_PRICEa(probs[sym], bit); + } + while (sym >= 2); + return price; +} + + +static UInt32 LitEnc_Matched_GetPrice(const CLzmaProb *probs, UInt32 sym, UInt32 matchByte, const CProbPrice *ProbPrices) +{ + UInt32 price = 0; + UInt32 offs = 0x100; + sym |= 0x100; + do + { + matchByte <<= 1; + price += GET_PRICEa(probs[offs + (matchByte & offs) + (sym >> 8)], (sym >> 7) & 1); + sym <<= 1; + offs &= ~(matchByte ^ sym); + } + while (sym < 0x10000); + return price; +} + + +static void RcTree_ReverseEncode(CRangeEnc *rc, CLzmaProb *probs, unsigned numBits, unsigned sym) +{ + UInt32 range = rc->range; + unsigned m = 1; + do + { + UInt32 ttt, newBound; + unsigned bit = sym & 1; + // RangeEnc_EncodeBit(rc, probs + m, bit); + sym >>= 1; + RC_BIT(rc, probs + m, bit); + m = (m << 1) | bit; + } + while (--numBits); + rc->range = range; +} + + + +static void LenEnc_Init(CLenEnc *p) +{ + unsigned i; + for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << (kLenNumLowBits + 1)); i++) + p->low[i] = kProbInitValue; + for (i = 0; i < kLenNumHighSymbols; i++) + p->high[i] = kProbInitValue; +} + +static void LenEnc_Encode(CLenEnc *p, CRangeEnc *rc, unsigned sym, unsigned posState) +{ + UInt32 range, ttt, newBound; + CLzmaProb *probs = p->low; + range = rc->range; + RC_BIT_PRE(rc, probs); + if (sym >= kLenNumLowSymbols) + { + RC_BIT_1(rc, probs); + probs += kLenNumLowSymbols; + RC_BIT_PRE(rc, probs); + if (sym >= kLenNumLowSymbols * 2) + { + RC_BIT_1(rc, probs); + rc->range = range; + // RcTree_Encode(rc, p->high, kLenNumHighBits, sym - kLenNumLowSymbols * 2); + LitEnc_Encode(rc, p->high, sym - kLenNumLowSymbols * 2); + return; + } + sym -= kLenNumLowSymbols; + } + + // RcTree_Encode(rc, probs + (posState << kLenNumLowBits), kLenNumLowBits, sym); + { + unsigned m; + unsigned bit; + RC_BIT_0(rc, probs); + probs += (posState << (1 + kLenNumLowBits)); + bit = (sym >> 2) ; RC_BIT(rc, probs + 1, bit); m = (1 << 1) + bit; + bit = (sym >> 1) & 1; RC_BIT(rc, probs + m, bit); m = (m << 1) + bit; + bit = sym & 1; RC_BIT(rc, probs + m, bit); + rc->range = range; + } +} + +static void SetPrices_3(const CLzmaProb *probs, UInt32 startPrice, UInt32 *prices, const CProbPrice *ProbPrices) +{ + unsigned i; + for (i = 0; i < 8; i += 2) + { + UInt32 price = startPrice; + UInt32 prob; + price += GET_PRICEa(probs[1 ], (i >> 2)); + price += GET_PRICEa(probs[2 + (i >> 2)], (i >> 1) & 1); + prob = probs[4 + (i >> 1)]; + prices[i ] = price + GET_PRICEa_0(prob); + prices[i + 1] = price + GET_PRICEa_1(prob); + } +} + + +MY_NO_INLINE static void MY_FAST_CALL LenPriceEnc_UpdateTables( + CLenPriceEnc *p, + unsigned numPosStates, + const CLenEnc *enc, + const CProbPrice *ProbPrices) +{ + UInt32 b; + + { + unsigned prob = enc->low[0]; + UInt32 a, c; + unsigned posState; + b = GET_PRICEa_1(prob); + a = GET_PRICEa_0(prob); + c = b + GET_PRICEa_0(enc->low[kLenNumLowSymbols]); + for (posState = 0; posState < numPosStates; posState++) + { + UInt32 *prices = p->prices[posState]; + const CLzmaProb *probs = enc->low + (posState << (1 + kLenNumLowBits)); + SetPrices_3(probs, a, prices, ProbPrices); + SetPrices_3(probs + kLenNumLowSymbols, c, prices + kLenNumLowSymbols, ProbPrices); + } + } + + /* + { + unsigned i; + UInt32 b; + a = GET_PRICEa_0(enc->low[0]); + for (i = 0; i < kLenNumLowSymbols; i++) + p->prices2[i] = a; + a = GET_PRICEa_1(enc->low[0]); + b = a + GET_PRICEa_0(enc->low[kLenNumLowSymbols]); + for (i = kLenNumLowSymbols; i < kLenNumLowSymbols * 2; i++) + p->prices2[i] = b; + a += GET_PRICEa_1(enc->low[kLenNumLowSymbols]); + } + */ + + // p->counter = numSymbols; + // p->counter = 64; + + { + unsigned i = p->tableSize; + + if (i > kLenNumLowSymbols * 2) + { + const CLzmaProb *probs = enc->high; + UInt32 *prices = p->prices[0] + kLenNumLowSymbols * 2; + i -= kLenNumLowSymbols * 2 - 1; + i >>= 1; + b += GET_PRICEa_1(enc->low[kLenNumLowSymbols]); + do + { + /* + p->prices2[i] = a + + // RcTree_GetPrice(enc->high, kLenNumHighBits, i - kLenNumLowSymbols * 2, ProbPrices); + LitEnc_GetPrice(probs, i - kLenNumLowSymbols * 2, ProbPrices); + */ + // UInt32 price = a + RcTree_GetPrice(probs, kLenNumHighBits - 1, sym, ProbPrices); + unsigned sym = --i + (1 << (kLenNumHighBits - 1)); + UInt32 price = b; + do + { + unsigned bit = sym & 1; + sym >>= 1; + price += GET_PRICEa(probs[sym], bit); + } + while (sym >= 2); + + { + unsigned prob = probs[(size_t)i + (1 << (kLenNumHighBits - 1))]; + prices[(size_t)i * 2 ] = price + GET_PRICEa_0(prob); + prices[(size_t)i * 2 + 1] = price + GET_PRICEa_1(prob); + } + } + while (i); + + { + unsigned posState; + size_t num = (p->tableSize - kLenNumLowSymbols * 2) * sizeof(p->prices[0][0]); + for (posState = 1; posState < numPosStates; posState++) + memcpy(p->prices[posState] + kLenNumLowSymbols * 2, p->prices[0] + kLenNumLowSymbols * 2, num); + } + } + } +} + +/* + #ifdef SHOW_STAT + g_STAT_OFFSET += num; + printf("\n MovePos %u", num); + #endif +*/ + +#define MOVE_POS(p, num) { \ + p->additionalOffset += (num); \ + p->matchFinder.Skip(p->matchFinderObj, (UInt32)(num)); } + + +static unsigned ReadMatchDistances(CLzmaEnc *p, unsigned *numPairsRes) +{ + unsigned numPairs; + + p->additionalOffset++; + p->numAvail = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); + numPairs = p->matchFinder.GetMatches(p->matchFinderObj, p->matches); + *numPairsRes = numPairs; + + #ifdef SHOW_STAT + printf("\n i = %u numPairs = %u ", g_STAT_OFFSET, numPairs / 2); + g_STAT_OFFSET++; + { + unsigned i; + for (i = 0; i < numPairs; i += 2) + printf("%2u %6u | ", p->matches[i], p->matches[i + 1]); + } + #endif + + if (numPairs == 0) + return 0; + { + unsigned len = p->matches[(size_t)numPairs - 2]; + if (len != p->numFastBytes) + return len; + { + UInt32 numAvail = p->numAvail; + if (numAvail > LZMA_MATCH_LEN_MAX) + numAvail = LZMA_MATCH_LEN_MAX; + { + const Byte *p1 = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; + const Byte *p2 = p1 + len; + ptrdiff_t dif = (ptrdiff_t)-1 - p->matches[(size_t)numPairs - 1]; + const Byte *lim = p1 + numAvail; + for (; p2 != lim && *p2 == p2[dif]; p2++) + {} + return (unsigned)(p2 - p1); + } + } + } +} + +#define MARK_LIT ((UInt32)(Int32)-1) + +#define MakeAs_Lit(p) { (p)->dist = MARK_LIT; (p)->extra = 0; } +#define MakeAs_ShortRep(p) { (p)->dist = 0; (p)->extra = 0; } +#define IsShortRep(p) ((p)->dist == 0) + + +#define GetPrice_ShortRep(p, state, posState) \ + ( GET_PRICE_0(p->isRepG0[state]) + GET_PRICE_0(p->isRep0Long[state][posState])) + +#define GetPrice_Rep_0(p, state, posState) ( \ + GET_PRICE_1(p->isMatch[state][posState]) \ + + GET_PRICE_1(p->isRep0Long[state][posState])) \ + + GET_PRICE_1(p->isRep[state]) \ + + GET_PRICE_0(p->isRepG0[state]) + +MY_FORCE_INLINE +static UInt32 GetPrice_PureRep(const CLzmaEnc *p, unsigned repIndex, size_t state, size_t posState) +{ + UInt32 price; + UInt32 prob = p->isRepG0[state]; + if (repIndex == 0) + { + price = GET_PRICE_0(prob); + price += GET_PRICE_1(p->isRep0Long[state][posState]); + } + else + { + price = GET_PRICE_1(prob); + prob = p->isRepG1[state]; + if (repIndex == 1) + price += GET_PRICE_0(prob); + else + { + price += GET_PRICE_1(prob); + price += GET_PRICE(p->isRepG2[state], repIndex - 2); + } + } + return price; +} + + +static unsigned Backward(CLzmaEnc *p, unsigned cur) +{ + unsigned wr = cur + 1; + p->optEnd = wr; + + for (;;) + { + UInt32 dist = p->opt[cur].dist; + unsigned len = (unsigned)p->opt[cur].len; + unsigned extra = (unsigned)p->opt[cur].extra; + cur -= len; + + if (extra) + { + wr--; + p->opt[wr].len = (UInt32)len; + cur -= extra; + len = extra; + if (extra == 1) + { + p->opt[wr].dist = dist; + dist = MARK_LIT; + } + else + { + p->opt[wr].dist = 0; + len--; + wr--; + p->opt[wr].dist = MARK_LIT; + p->opt[wr].len = 1; + } + } + + if (cur == 0) + { + p->backRes = dist; + p->optCur = wr; + return len; + } + + wr--; + p->opt[wr].dist = dist; + p->opt[wr].len = (UInt32)len; + } +} + + + +#define LIT_PROBS(pos, prevByte) \ + (p->litProbs + (UInt32)3 * (((((pos) << 8) + (prevByte)) & p->lpMask) << p->lc)) + + +static unsigned GetOptimum(CLzmaEnc *p, UInt32 position) +{ + unsigned last, cur; + UInt32 reps[LZMA_NUM_REPS]; + unsigned repLens[LZMA_NUM_REPS]; + UInt32 *matches; + + { + UInt32 numAvail; + unsigned numPairs, mainLen, repMaxIndex, i, posState; + UInt32 matchPrice, repMatchPrice; + const Byte *data; + Byte curByte, matchByte; + + p->optCur = p->optEnd = 0; + + if (p->additionalOffset == 0) + mainLen = ReadMatchDistances(p, &numPairs); + else + { + mainLen = p->longestMatchLen; + numPairs = p->numPairs; + } + + numAvail = p->numAvail; + if (numAvail < 2) + { + p->backRes = MARK_LIT; + return 1; + } + if (numAvail > LZMA_MATCH_LEN_MAX) + numAvail = LZMA_MATCH_LEN_MAX; + + data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; + repMaxIndex = 0; + + for (i = 0; i < LZMA_NUM_REPS; i++) + { + unsigned len; + const Byte *data2; + reps[i] = p->reps[i]; + data2 = data - reps[i]; + if (data[0] != data2[0] || data[1] != data2[1]) + { + repLens[i] = 0; + continue; + } + for (len = 2; len < numAvail && data[len] == data2[len]; len++) + {} + repLens[i] = len; + if (len > repLens[repMaxIndex]) + repMaxIndex = i; + } + + if (repLens[repMaxIndex] >= p->numFastBytes) + { + unsigned len; + p->backRes = (UInt32)repMaxIndex; + len = repLens[repMaxIndex]; + MOVE_POS(p, len - 1) + return len; + } + + matches = p->matches; + + if (mainLen >= p->numFastBytes) + { + p->backRes = matches[(size_t)numPairs - 1] + LZMA_NUM_REPS; + MOVE_POS(p, mainLen - 1) + return mainLen; + } + + curByte = *data; + matchByte = *(data - reps[0]); + + last = repLens[repMaxIndex]; + if (last <= mainLen) + last = mainLen; + + if (last < 2 && curByte != matchByte) + { + p->backRes = MARK_LIT; + return 1; + } + + p->opt[0].state = (CState)p->state; + + posState = (position & p->pbMask); + + { + const CLzmaProb *probs = LIT_PROBS(position, *(data - 1)); + p->opt[1].price = GET_PRICE_0(p->isMatch[p->state][posState]) + + (!IsLitState(p->state) ? + LitEnc_Matched_GetPrice(probs, curByte, matchByte, p->ProbPrices) : + LitEnc_GetPrice(probs, curByte, p->ProbPrices)); + } + + MakeAs_Lit(&p->opt[1]); + + matchPrice = GET_PRICE_1(p->isMatch[p->state][posState]); + repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[p->state]); + + // 18.06 + if (matchByte == curByte && repLens[0] == 0) + { + UInt32 shortRepPrice = repMatchPrice + GetPrice_ShortRep(p, p->state, posState); + if (shortRepPrice < p->opt[1].price) + { + p->opt[1].price = shortRepPrice; + MakeAs_ShortRep(&p->opt[1]); + } + if (last < 2) + { + p->backRes = p->opt[1].dist; + return 1; + } + } + + p->opt[1].len = 1; + + p->opt[0].reps[0] = reps[0]; + p->opt[0].reps[1] = reps[1]; + p->opt[0].reps[2] = reps[2]; + p->opt[0].reps[3] = reps[3]; + + // ---------- REP ---------- + + for (i = 0; i < LZMA_NUM_REPS; i++) + { + unsigned repLen = repLens[i]; + UInt32 price; + if (repLen < 2) + continue; + price = repMatchPrice + GetPrice_PureRep(p, i, p->state, posState); + do + { + UInt32 price2 = price + GET_PRICE_LEN(&p->repLenEnc, posState, repLen); + COptimal *opt = &p->opt[repLen]; + if (price2 < opt->price) + { + opt->price = price2; + opt->len = (UInt32)repLen; + opt->dist = (UInt32)i; + opt->extra = 0; + } + } + while (--repLen >= 2); + } + + + // ---------- MATCH ---------- + { + unsigned len = repLens[0] + 1; + if (len <= mainLen) + { + unsigned offs = 0; + UInt32 normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[p->state]); + + if (len < 2) + len = 2; + else + while (len > matches[offs]) + offs += 2; + + for (; ; len++) + { + COptimal *opt; + UInt32 dist = matches[(size_t)offs + 1]; + UInt32 price = normalMatchPrice + GET_PRICE_LEN(&p->lenEnc, posState, len); + unsigned lenToPosState = GetLenToPosState(len); + + if (dist < kNumFullDistances) + price += p->distancesPrices[lenToPosState][dist & (kNumFullDistances - 1)]; + else + { + unsigned slot; + GetPosSlot2(dist, slot); + price += p->alignPrices[dist & kAlignMask]; + price += p->posSlotPrices[lenToPosState][slot]; + } + + opt = &p->opt[len]; + + if (price < opt->price) + { + opt->price = price; + opt->len = (UInt32)len; + opt->dist = dist + LZMA_NUM_REPS; + opt->extra = 0; + } + + if (len == matches[offs]) + { + offs += 2; + if (offs == numPairs) + break; + } + } + } + } + + + cur = 0; + + #ifdef SHOW_STAT2 + /* if (position >= 0) */ + { + unsigned i; + printf("\n pos = %4X", position); + for (i = cur; i <= last; i++) + printf("\nprice[%4X] = %u", position - cur + i, p->opt[i].price); + } + #endif + } + + + + // ---------- Optimal Parsing ---------- + + for (;;) + { + unsigned numAvail; + UInt32 numAvailFull; + unsigned newLen, numPairs, prev, state, posState, startLen; + UInt32 litPrice, matchPrice, repMatchPrice; + BoolInt nextIsLit; + Byte curByte, matchByte; + const Byte *data; + COptimal *curOpt, *nextOpt; + + if (++cur == last) + break; + + // 18.06 + if (cur >= kNumOpts - 64) + { + unsigned j, best; + UInt32 price = p->opt[cur].price; + best = cur; + for (j = cur + 1; j <= last; j++) + { + UInt32 price2 = p->opt[j].price; + if (price >= price2) + { + price = price2; + best = j; + } + } + { + unsigned delta = best - cur; + if (delta != 0) + { + MOVE_POS(p, delta); + } + } + cur = best; + break; + } + + newLen = ReadMatchDistances(p, &numPairs); + + if (newLen >= p->numFastBytes) + { + p->numPairs = numPairs; + p->longestMatchLen = newLen; + break; + } + + curOpt = &p->opt[cur]; + + position++; + + // we need that check here, if skip_items in p->opt are possible + /* + if (curOpt->price >= kInfinityPrice) + continue; + */ + + prev = cur - curOpt->len; + + if (curOpt->len == 1) + { + state = (unsigned)p->opt[prev].state; + if (IsShortRep(curOpt)) + state = kShortRepNextStates[state]; + else + state = kLiteralNextStates[state]; + } + else + { + const COptimal *prevOpt; + UInt32 b0; + UInt32 dist = curOpt->dist; + + if (curOpt->extra) + { + prev -= (unsigned)curOpt->extra; + state = kState_RepAfterLit; + if (curOpt->extra == 1) + state = (dist < LZMA_NUM_REPS ? kState_RepAfterLit : kState_MatchAfterLit); + } + else + { + state = (unsigned)p->opt[prev].state; + if (dist < LZMA_NUM_REPS) + state = kRepNextStates[state]; + else + state = kMatchNextStates[state]; + } + + prevOpt = &p->opt[prev]; + b0 = prevOpt->reps[0]; + + if (dist < LZMA_NUM_REPS) + { + if (dist == 0) + { + reps[0] = b0; + reps[1] = prevOpt->reps[1]; + reps[2] = prevOpt->reps[2]; + reps[3] = prevOpt->reps[3]; + } + else + { + reps[1] = b0; + b0 = prevOpt->reps[1]; + if (dist == 1) + { + reps[0] = b0; + reps[2] = prevOpt->reps[2]; + reps[3] = prevOpt->reps[3]; + } + else + { + reps[2] = b0; + reps[0] = prevOpt->reps[dist]; + reps[3] = prevOpt->reps[dist ^ 1]; + } + } + } + else + { + reps[0] = (dist - LZMA_NUM_REPS + 1); + reps[1] = b0; + reps[2] = prevOpt->reps[1]; + reps[3] = prevOpt->reps[2]; + } + } + + curOpt->state = (CState)state; + curOpt->reps[0] = reps[0]; + curOpt->reps[1] = reps[1]; + curOpt->reps[2] = reps[2]; + curOpt->reps[3] = reps[3]; + + data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; + curByte = *data; + matchByte = *(data - reps[0]); + + posState = (position & p->pbMask); + + /* + The order of Price checks: + < LIT + <= SHORT_REP + < LIT : REP_0 + < REP [ : LIT : REP_0 ] + < MATCH [ : LIT : REP_0 ] + */ + + { + UInt32 curPrice = curOpt->price; + unsigned prob = p->isMatch[state][posState]; + matchPrice = curPrice + GET_PRICE_1(prob); + litPrice = curPrice + GET_PRICE_0(prob); + } + + nextOpt = &p->opt[(size_t)cur + 1]; + nextIsLit = False; + + // here we can allow skip_items in p->opt, if we don't check (nextOpt->price < kInfinityPrice) + // 18.new.06 + if ((nextOpt->price < kInfinityPrice + // && !IsLitState(state) + && matchByte == curByte) + || litPrice > nextOpt->price + ) + litPrice = 0; + else + { + const CLzmaProb *probs = LIT_PROBS(position, *(data - 1)); + litPrice += (!IsLitState(state) ? + LitEnc_Matched_GetPrice(probs, curByte, matchByte, p->ProbPrices) : + LitEnc_GetPrice(probs, curByte, p->ProbPrices)); + + if (litPrice < nextOpt->price) + { + nextOpt->price = litPrice; + nextOpt->len = 1; + MakeAs_Lit(nextOpt); + nextIsLit = True; + } + } + + repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[state]); + + numAvailFull = p->numAvail; + { + unsigned temp = kNumOpts - 1 - cur; + if (numAvailFull > temp) + numAvailFull = (UInt32)temp; + } + + // 18.06 + // ---------- SHORT_REP ---------- + if (IsLitState(state)) // 18.new + if (matchByte == curByte) + if (repMatchPrice < nextOpt->price) // 18.new + // if (numAvailFull < 2 || data[1] != *(data - reps[0] + 1)) + if ( + // nextOpt->price >= kInfinityPrice || + nextOpt->len < 2 // we can check nextOpt->len, if skip items are not allowed in p->opt + || (nextOpt->dist != 0 + // && nextOpt->extra <= 1 // 17.old + ) + ) + { + UInt32 shortRepPrice = repMatchPrice + GetPrice_ShortRep(p, state, posState); + // if (shortRepPrice <= nextOpt->price) // 17.old + if (shortRepPrice < nextOpt->price) // 18.new + { + nextOpt->price = shortRepPrice; + nextOpt->len = 1; + MakeAs_ShortRep(nextOpt); + nextIsLit = False; + } + } + + if (numAvailFull < 2) + continue; + numAvail = (numAvailFull <= p->numFastBytes ? numAvailFull : p->numFastBytes); + + // numAvail <= p->numFastBytes + + // ---------- LIT : REP_0 ---------- + + if (!nextIsLit + && litPrice != 0 // 18.new + && matchByte != curByte + && numAvailFull > 2) + { + const Byte *data2 = data - reps[0]; + if (data[1] == data2[1] && data[2] == data2[2]) + { + unsigned len; + unsigned limit = p->numFastBytes + 1; + if (limit > numAvailFull) + limit = numAvailFull; + for (len = 3; len < limit && data[len] == data2[len]; len++) + {} + + { + unsigned state2 = kLiteralNextStates[state]; + unsigned posState2 = (position + 1) & p->pbMask; + UInt32 price = litPrice + GetPrice_Rep_0(p, state2, posState2); + { + unsigned offset = cur + len; + + if (last < offset) + last = offset; + + // do + { + UInt32 price2; + COptimal *opt; + len--; + // price2 = price + GetPrice_Len_Rep_0(p, len, state2, posState2); + price2 = price + GET_PRICE_LEN(&p->repLenEnc, posState2, len); + + opt = &p->opt[offset]; + // offset--; + if (price2 < opt->price) + { + opt->price = price2; + opt->len = (UInt32)len; + opt->dist = 0; + opt->extra = 1; + } + } + // while (len >= 3); + } + } + } + } + + startLen = 2; /* speed optimization */ + + { + // ---------- REP ---------- + unsigned repIndex = 0; // 17.old + // unsigned repIndex = IsLitState(state) ? 0 : 1; // 18.notused + for (; repIndex < LZMA_NUM_REPS; repIndex++) + { + unsigned len; + UInt32 price; + const Byte *data2 = data - reps[repIndex]; + if (data[0] != data2[0] || data[1] != data2[1]) + continue; + + for (len = 2; len < numAvail && data[len] == data2[len]; len++) + {} + + // if (len < startLen) continue; // 18.new: speed optimization + + { + unsigned offset = cur + len; + if (last < offset) + last = offset; + } + { + unsigned len2 = len; + price = repMatchPrice + GetPrice_PureRep(p, repIndex, state, posState); + do + { + UInt32 price2 = price + GET_PRICE_LEN(&p->repLenEnc, posState, len2); + COptimal *opt = &p->opt[cur + len2]; + if (price2 < opt->price) + { + opt->price = price2; + opt->len = (UInt32)len2; + opt->dist = (UInt32)repIndex; + opt->extra = 0; + } + } + while (--len2 >= 2); + } + + if (repIndex == 0) startLen = len + 1; // 17.old + // startLen = len + 1; // 18.new + + /* if (_maxMode) */ + { + // ---------- REP : LIT : REP_0 ---------- + // numFastBytes + 1 + numFastBytes + + unsigned len2 = len + 1; + unsigned limit = len2 + p->numFastBytes; + if (limit > numAvailFull) + limit = numAvailFull; + + len2 += 2; + if (len2 <= limit) + if (data[len2 - 2] == data2[len2 - 2]) + if (data[len2 - 1] == data2[len2 - 1]) + { + unsigned state2 = kRepNextStates[state]; + unsigned posState2 = (position + len) & p->pbMask; + price += GET_PRICE_LEN(&p->repLenEnc, posState, len) + + GET_PRICE_0(p->isMatch[state2][posState2]) + + LitEnc_Matched_GetPrice(LIT_PROBS(position + len, data[(size_t)len - 1]), + data[len], data2[len], p->ProbPrices); + + // state2 = kLiteralNextStates[state2]; + state2 = kState_LitAfterRep; + posState2 = (posState2 + 1) & p->pbMask; + + + price += GetPrice_Rep_0(p, state2, posState2); + + for (; len2 < limit && data[len2] == data2[len2]; len2++) + {} + + len2 -= len; + // if (len2 >= 3) + { + { + unsigned offset = cur + len + len2; + + if (last < offset) + last = offset; + // do + { + UInt32 price2; + COptimal *opt; + len2--; + // price2 = price + GetPrice_Len_Rep_0(p, len2, state2, posState2); + price2 = price + GET_PRICE_LEN(&p->repLenEnc, posState2, len2); + + opt = &p->opt[offset]; + // offset--; + if (price2 < opt->price) + { + opt->price = price2; + opt->len = (UInt32)len2; + opt->extra = (CExtra)(len + 1); + opt->dist = (UInt32)repIndex; + } + } + // while (len2 >= 3); + } + } + } + } + } + } + + + // ---------- MATCH ---------- + /* for (unsigned len = 2; len <= newLen; len++) */ + if (newLen > numAvail) + { + newLen = numAvail; + for (numPairs = 0; newLen > matches[numPairs]; numPairs += 2); + matches[numPairs] = (UInt32)newLen; + numPairs += 2; + } + + // startLen = 2; /* speed optimization */ + + if (newLen >= startLen) + { + UInt32 normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[state]); + UInt32 dist; + unsigned offs, posSlot, len; + + { + unsigned offset = cur + newLen; + if (last < offset) + last = offset; + } + + offs = 0; + while (startLen > matches[offs]) + offs += 2; + dist = matches[(size_t)offs + 1]; + + // if (dist >= kNumFullDistances) + GetPosSlot2(dist, posSlot); + + for (len = /*2*/ startLen; ; len++) + { + UInt32 price = normalMatchPrice + GET_PRICE_LEN(&p->lenEnc, posState, len); + { + COptimal *opt; + unsigned lenNorm = len - 2; + lenNorm = GetLenToPosState2(lenNorm); + if (dist < kNumFullDistances) + price += p->distancesPrices[lenNorm][dist & (kNumFullDistances - 1)]; + else + price += p->posSlotPrices[lenNorm][posSlot] + p->alignPrices[dist & kAlignMask]; + + opt = &p->opt[cur + len]; + if (price < opt->price) + { + opt->price = price; + opt->len = (UInt32)len; + opt->dist = dist + LZMA_NUM_REPS; + opt->extra = 0; + } + } + + if (len == matches[offs]) + { + // if (p->_maxMode) { + // MATCH : LIT : REP_0 + + const Byte *data2 = data - dist - 1; + unsigned len2 = len + 1; + unsigned limit = len2 + p->numFastBytes; + if (limit > numAvailFull) + limit = numAvailFull; + + len2 += 2; + if (len2 <= limit) + if (data[len2 - 2] == data2[len2 - 2]) + if (data[len2 - 1] == data2[len2 - 1]) + { + for (; len2 < limit && data[len2] == data2[len2]; len2++) + {} + + len2 -= len; + + // if (len2 >= 3) + { + unsigned state2 = kMatchNextStates[state]; + unsigned posState2 = (position + len) & p->pbMask; + unsigned offset; + price += GET_PRICE_0(p->isMatch[state2][posState2]); + price += LitEnc_Matched_GetPrice(LIT_PROBS(position + len, data[(size_t)len - 1]), + data[len], data2[len], p->ProbPrices); + + // state2 = kLiteralNextStates[state2]; + state2 = kState_LitAfterMatch; + + posState2 = (posState2 + 1) & p->pbMask; + price += GetPrice_Rep_0(p, state2, posState2); + + offset = cur + len + len2; + + if (last < offset) + last = offset; + // do + { + UInt32 price2; + COptimal *opt; + len2--; + // price2 = price + GetPrice_Len_Rep_0(p, len2, state2, posState2); + price2 = price + GET_PRICE_LEN(&p->repLenEnc, posState2, len2); + opt = &p->opt[offset]; + // offset--; + if (price2 < opt->price) + { + opt->price = price2; + opt->len = (UInt32)len2; + opt->extra = (CExtra)(len + 1); + opt->dist = dist + LZMA_NUM_REPS; + } + } + // while (len2 >= 3); + } + + } + + offs += 2; + if (offs == numPairs) + break; + dist = matches[(size_t)offs + 1]; + // if (dist >= kNumFullDistances) + GetPosSlot2(dist, posSlot); + } + } + } + } + + do + p->opt[last].price = kInfinityPrice; + while (--last); + + return Backward(p, cur); +} + + + +#define ChangePair(smallDist, bigDist) (((bigDist) >> 7) > (smallDist)) + + + +static unsigned GetOptimumFast(CLzmaEnc *p) +{ + UInt32 numAvail, mainDist; + unsigned mainLen, numPairs, repIndex, repLen, i; + const Byte *data; + + if (p->additionalOffset == 0) + mainLen = ReadMatchDistances(p, &numPairs); + else + { + mainLen = p->longestMatchLen; + numPairs = p->numPairs; + } + + numAvail = p->numAvail; + p->backRes = MARK_LIT; + if (numAvail < 2) + return 1; + // if (mainLen < 2 && p->state == 0) return 1; // 18.06.notused + if (numAvail > LZMA_MATCH_LEN_MAX) + numAvail = LZMA_MATCH_LEN_MAX; + data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; + repLen = repIndex = 0; + + for (i = 0; i < LZMA_NUM_REPS; i++) + { + unsigned len; + const Byte *data2 = data - p->reps[i]; + if (data[0] != data2[0] || data[1] != data2[1]) + continue; + for (len = 2; len < numAvail && data[len] == data2[len]; len++) + {} + if (len >= p->numFastBytes) + { + p->backRes = (UInt32)i; + MOVE_POS(p, len - 1) + return len; + } + if (len > repLen) + { + repIndex = i; + repLen = len; + } + } + + if (mainLen >= p->numFastBytes) + { + p->backRes = p->matches[(size_t)numPairs - 1] + LZMA_NUM_REPS; + MOVE_POS(p, mainLen - 1) + return mainLen; + } + + mainDist = 0; /* for GCC */ + + if (mainLen >= 2) + { + mainDist = p->matches[(size_t)numPairs - 1]; + while (numPairs > 2) + { + UInt32 dist2; + if (mainLen != p->matches[(size_t)numPairs - 4] + 1) + break; + dist2 = p->matches[(size_t)numPairs - 3]; + if (!ChangePair(dist2, mainDist)) + break; + numPairs -= 2; + mainLen--; + mainDist = dist2; + } + if (mainLen == 2 && mainDist >= 0x80) + mainLen = 1; + } + + if (repLen >= 2) + if ( repLen + 1 >= mainLen + || (repLen + 2 >= mainLen && mainDist >= (1 << 9)) + || (repLen + 3 >= mainLen && mainDist >= (1 << 15))) + { + p->backRes = (UInt32)repIndex; + MOVE_POS(p, repLen - 1) + return repLen; + } + + if (mainLen < 2 || numAvail <= 2) + return 1; + + { + unsigned len1 = ReadMatchDistances(p, &p->numPairs); + p->longestMatchLen = len1; + + if (len1 >= 2) + { + UInt32 newDist = p->matches[(size_t)p->numPairs - 1]; + if ( (len1 >= mainLen && newDist < mainDist) + || (len1 == mainLen + 1 && !ChangePair(mainDist, newDist)) + || (len1 > mainLen + 1) + || (len1 + 1 >= mainLen && mainLen >= 3 && ChangePair(newDist, mainDist))) + return 1; + } + } + + data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; + + for (i = 0; i < LZMA_NUM_REPS; i++) + { + unsigned len, limit; + const Byte *data2 = data - p->reps[i]; + if (data[0] != data2[0] || data[1] != data2[1]) + continue; + limit = mainLen - 1; + for (len = 2;; len++) + { + if (len >= limit) + return 1; + if (data[len] != data2[len]) + break; + } + } + + p->backRes = mainDist + LZMA_NUM_REPS; + if (mainLen != 2) + { + MOVE_POS(p, mainLen - 2) + } + return mainLen; +} + + + + +static void WriteEndMarker(CLzmaEnc *p, unsigned posState) +{ + UInt32 range; + range = p->rc.range; + { + UInt32 ttt, newBound; + CLzmaProb *prob = &p->isMatch[p->state][posState]; + RC_BIT_PRE(&p->rc, prob) + RC_BIT_1(&p->rc, prob) + prob = &p->isRep[p->state]; + RC_BIT_PRE(&p->rc, prob) + RC_BIT_0(&p->rc, prob) + } + p->state = kMatchNextStates[p->state]; + + p->rc.range = range; + LenEnc_Encode(&p->lenProbs, &p->rc, 0, posState); + range = p->rc.range; + + { + // RcTree_Encode_PosSlot(&p->rc, p->posSlotEncoder[0], (1 << kNumPosSlotBits) - 1); + CLzmaProb *probs = p->posSlotEncoder[0]; + unsigned m = 1; + do + { + UInt32 ttt, newBound; + RC_BIT_PRE(p, probs + m) + RC_BIT_1(&p->rc, probs + m); + m = (m << 1) + 1; + } + while (m < (1 << kNumPosSlotBits)); + } + { + // RangeEnc_EncodeDirectBits(&p->rc, ((UInt32)1 << (30 - kNumAlignBits)) - 1, 30 - kNumAlignBits); UInt32 range = p->range; + unsigned numBits = 30 - kNumAlignBits; + do + { + range >>= 1; + p->rc.low += range; + RC_NORM(&p->rc) + } + while (--numBits); + } + + { + // RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, kAlignMask); + CLzmaProb *probs = p->posAlignEncoder; + unsigned m = 1; + do + { + UInt32 ttt, newBound; + RC_BIT_PRE(p, probs + m) + RC_BIT_1(&p->rc, probs + m); + m = (m << 1) + 1; + } + while (m < kAlignTableSize); + } + p->rc.range = range; +} + + +static SRes CheckErrors(CLzmaEnc *p) +{ + if (p->result != SZ_OK) + return p->result; + if (p->rc.res != SZ_OK) + p->result = SZ_ERROR_WRITE; + if (p->matchFinderBase.result != SZ_OK) + p->result = SZ_ERROR_READ; + if (p->result != SZ_OK) + p->finished = True; + return p->result; +} + + +MY_NO_INLINE static SRes Flush(CLzmaEnc *p, UInt32 nowPos) +{ + /* ReleaseMFStream(); */ + p->finished = True; + if (p->writeEndMark) + WriteEndMarker(p, nowPos & p->pbMask); + RangeEnc_FlushData(&p->rc); + RangeEnc_FlushStream(&p->rc); + return CheckErrors(p); +} + + +MY_NO_INLINE static void FillAlignPrices(CLzmaEnc *p) +{ + unsigned i; + const CProbPrice *ProbPrices = p->ProbPrices; + const CLzmaProb *probs = p->posAlignEncoder; + // p->alignPriceCount = 0; + for (i = 0; i < kAlignTableSize / 2; i++) + { + UInt32 price = 0; + unsigned sym = i; + unsigned m = 1; + unsigned bit; + UInt32 prob; + bit = sym & 1; sym >>= 1; price += GET_PRICEa(probs[m], bit); m = (m << 1) + bit; + bit = sym & 1; sym >>= 1; price += GET_PRICEa(probs[m], bit); m = (m << 1) + bit; + bit = sym & 1; sym >>= 1; price += GET_PRICEa(probs[m], bit); m = (m << 1) + bit; + prob = probs[m]; + p->alignPrices[i ] = price + GET_PRICEa_0(prob); + p->alignPrices[i + 8] = price + GET_PRICEa_1(prob); + // p->alignPrices[i] = RcTree_ReverseGetPrice(p->posAlignEncoder, kNumAlignBits, i, p->ProbPrices); + } +} + + +MY_NO_INLINE static void FillDistancesPrices(CLzmaEnc *p) +{ + // int y; for (y = 0; y < 100; y++) { + + UInt32 tempPrices[kNumFullDistances]; + unsigned i, lps; + + const CProbPrice *ProbPrices = p->ProbPrices; + p->matchPriceCount = 0; + + for (i = kStartPosModelIndex / 2; i < kNumFullDistances / 2; i++) + { + unsigned posSlot = GetPosSlot1(i); + unsigned footerBits = (posSlot >> 1) - 1; + unsigned base = ((2 | (posSlot & 1)) << footerBits); + const CLzmaProb *probs = p->posEncoders + (size_t)base * 2; + // tempPrices[i] = RcTree_ReverseGetPrice(p->posEncoders + base, footerBits, i - base, p->ProbPrices); + UInt32 price = 0; + unsigned m = 1; + unsigned sym = i; + unsigned offset = (unsigned)1 << footerBits; + base += i; + + if (footerBits) + do + { + unsigned bit = sym & 1; + sym >>= 1; + price += GET_PRICEa(probs[m], bit); + m = (m << 1) + bit; + } + while (--footerBits); + + { + unsigned prob = probs[m]; + tempPrices[base ] = price + GET_PRICEa_0(prob); + tempPrices[base + offset] = price + GET_PRICEa_1(prob); + } + } + + for (lps = 0; lps < kNumLenToPosStates; lps++) + { + unsigned slot; + unsigned distTableSize2 = (p->distTableSize + 1) >> 1; + UInt32 *posSlotPrices = p->posSlotPrices[lps]; + const CLzmaProb *probs = p->posSlotEncoder[lps]; + + for (slot = 0; slot < distTableSize2; slot++) + { + // posSlotPrices[slot] = RcTree_GetPrice(encoder, kNumPosSlotBits, slot, p->ProbPrices); + UInt32 price; + unsigned bit; + unsigned sym = slot + (1 << (kNumPosSlotBits - 1)); + unsigned prob; + bit = sym & 1; sym >>= 1; price = GET_PRICEa(probs[sym], bit); + bit = sym & 1; sym >>= 1; price += GET_PRICEa(probs[sym], bit); + bit = sym & 1; sym >>= 1; price += GET_PRICEa(probs[sym], bit); + bit = sym & 1; sym >>= 1; price += GET_PRICEa(probs[sym], bit); + bit = sym & 1; sym >>= 1; price += GET_PRICEa(probs[sym], bit); + prob = probs[(size_t)slot + (1 << (kNumPosSlotBits - 1))]; + posSlotPrices[(size_t)slot * 2 ] = price + GET_PRICEa_0(prob); + posSlotPrices[(size_t)slot * 2 + 1] = price + GET_PRICEa_1(prob); + } + + { + UInt32 delta = ((UInt32)((kEndPosModelIndex / 2 - 1) - kNumAlignBits) << kNumBitPriceShiftBits); + for (slot = kEndPosModelIndex / 2; slot < distTableSize2; slot++) + { + posSlotPrices[(size_t)slot * 2 ] += delta; + posSlotPrices[(size_t)slot * 2 + 1] += delta; + delta += ((UInt32)1 << kNumBitPriceShiftBits); + } + } + + { + UInt32 *dp = p->distancesPrices[lps]; + + dp[0] = posSlotPrices[0]; + dp[1] = posSlotPrices[1]; + dp[2] = posSlotPrices[2]; + dp[3] = posSlotPrices[3]; + + for (i = 4; i < kNumFullDistances; i += 2) + { + UInt32 slotPrice = posSlotPrices[GetPosSlot1(i)]; + dp[i ] = slotPrice + tempPrices[i]; + dp[i + 1] = slotPrice + tempPrices[i + 1]; + } + } + } + // } +} + + + +void LzmaEnc_Construct(CLzmaEnc *p) +{ + RangeEnc_Construct(&p->rc); + MatchFinder_Construct(&p->matchFinderBase); + + #ifndef _7ZIP_ST + MatchFinderMt_Construct(&p->matchFinderMt); + p->matchFinderMt.MatchFinder = &p->matchFinderBase; + #endif + + { + CLzmaEncProps props; + LzmaEncProps_Init(&props); + LzmaEnc_SetProps(p, &props); + } + + #ifndef LZMA_LOG_BSR + LzmaEnc_FastPosInit(p->g_FastPos); + #endif + + LzmaEnc_InitPriceTables(p->ProbPrices); + p->litProbs = NULL; + p->saveState.litProbs = NULL; + +} + +CLzmaEncHandle LzmaEnc_Create(ISzAllocPtr alloc) +{ + void *p; + p = ISzAlloc_Alloc(alloc, sizeof(CLzmaEnc)); + if (p) + LzmaEnc_Construct((CLzmaEnc *)p); + return p; +} + +void LzmaEnc_FreeLits(CLzmaEnc *p, ISzAllocPtr alloc) +{ + ISzAlloc_Free(alloc, p->litProbs); + ISzAlloc_Free(alloc, p->saveState.litProbs); + p->litProbs = NULL; + p->saveState.litProbs = NULL; +} + +void LzmaEnc_Destruct(CLzmaEnc *p, ISzAllocPtr alloc, ISzAllocPtr allocBig) +{ + #ifndef _7ZIP_ST + MatchFinderMt_Destruct(&p->matchFinderMt, allocBig); + #endif + + MatchFinder_Free(&p->matchFinderBase, allocBig); + LzmaEnc_FreeLits(p, alloc); + RangeEnc_Free(&p->rc, alloc); +} + +void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAllocPtr alloc, ISzAllocPtr allocBig) +{ + LzmaEnc_Destruct((CLzmaEnc *)p, alloc, allocBig); + ISzAlloc_Free(alloc, p); +} + + +static SRes LzmaEnc_CodeOneBlock(CLzmaEnc *p, UInt32 maxPackSize, UInt32 maxUnpackSize) +{ + UInt32 nowPos32, startPos32; + if (p->needInit) + { + p->matchFinder.Init(p->matchFinderObj); + p->needInit = 0; + } + + if (p->finished) + return p->result; + RINOK(CheckErrors(p)); + + nowPos32 = (UInt32)p->nowPos64; + startPos32 = nowPos32; + + if (p->nowPos64 == 0) + { + unsigned numPairs; + Byte curByte; + if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0) + return Flush(p, nowPos32); + ReadMatchDistances(p, &numPairs); + RangeEnc_EncodeBit_0(&p->rc, &p->isMatch[kState_Start][0]); + // p->state = kLiteralNextStates[p->state]; + curByte = *(p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset); + LitEnc_Encode(&p->rc, p->litProbs, curByte); + p->additionalOffset--; + nowPos32++; + } + + if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) != 0) + + for (;;) + { + UInt32 dist; + unsigned len, posState; + UInt32 range, ttt, newBound; + CLzmaProb *probs; + + if (p->fastMode) + len = GetOptimumFast(p); + else + { + unsigned oci = p->optCur; + if (p->optEnd == oci) + len = GetOptimum(p, nowPos32); + else + { + const COptimal *opt = &p->opt[oci]; + len = opt->len; + p->backRes = opt->dist; + p->optCur = oci + 1; + } + } + + posState = (unsigned)nowPos32 & p->pbMask; + range = p->rc.range; + probs = &p->isMatch[p->state][posState]; + + RC_BIT_PRE(&p->rc, probs) + + dist = p->backRes; + + #ifdef SHOW_STAT2 + printf("\n pos = %6X, len = %3u pos = %6u", nowPos32, len, dist); + #endif + + if (dist == MARK_LIT) + { + Byte curByte; + const Byte *data; + unsigned state; + + RC_BIT_0(&p->rc, probs); + p->rc.range = range; + data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset; + probs = LIT_PROBS(nowPos32, *(data - 1)); + curByte = *data; + state = p->state; + p->state = kLiteralNextStates[state]; + if (IsLitState(state)) + LitEnc_Encode(&p->rc, probs, curByte); + else + LitEnc_EncodeMatched(&p->rc, probs, curByte, *(data - p->reps[0])); + } + else + { + RC_BIT_1(&p->rc, probs); + probs = &p->isRep[p->state]; + RC_BIT_PRE(&p->rc, probs) + + if (dist < LZMA_NUM_REPS) + { + RC_BIT_1(&p->rc, probs); + probs = &p->isRepG0[p->state]; + RC_BIT_PRE(&p->rc, probs) + if (dist == 0) + { + RC_BIT_0(&p->rc, probs); + probs = &p->isRep0Long[p->state][posState]; + RC_BIT_PRE(&p->rc, probs) + if (len != 1) + { + RC_BIT_1_BASE(&p->rc, probs); + } + else + { + RC_BIT_0_BASE(&p->rc, probs); + p->state = kShortRepNextStates[p->state]; + } + } + else + { + RC_BIT_1(&p->rc, probs); + probs = &p->isRepG1[p->state]; + RC_BIT_PRE(&p->rc, probs) + if (dist == 1) + { + RC_BIT_0_BASE(&p->rc, probs); + dist = p->reps[1]; + } + else + { + RC_BIT_1(&p->rc, probs); + probs = &p->isRepG2[p->state]; + RC_BIT_PRE(&p->rc, probs) + if (dist == 2) + { + RC_BIT_0_BASE(&p->rc, probs); + dist = p->reps[2]; + } + else + { + RC_BIT_1_BASE(&p->rc, probs); + dist = p->reps[3]; + p->reps[3] = p->reps[2]; + } + p->reps[2] = p->reps[1]; + } + p->reps[1] = p->reps[0]; + p->reps[0] = dist; + } + + RC_NORM(&p->rc) + + p->rc.range = range; + + if (len != 1) + { + LenEnc_Encode(&p->repLenProbs, &p->rc, len - LZMA_MATCH_LEN_MIN, posState); + --p->repLenEncCounter; + p->state = kRepNextStates[p->state]; + } + } + else + { + unsigned posSlot; + RC_BIT_0(&p->rc, probs); + p->rc.range = range; + p->state = kMatchNextStates[p->state]; + + LenEnc_Encode(&p->lenProbs, &p->rc, len - LZMA_MATCH_LEN_MIN, posState); + // --p->lenEnc.counter; + + dist -= LZMA_NUM_REPS; + p->reps[3] = p->reps[2]; + p->reps[2] = p->reps[1]; + p->reps[1] = p->reps[0]; + p->reps[0] = dist + 1; + + p->matchPriceCount++; + GetPosSlot(dist, posSlot); + // RcTree_Encode_PosSlot(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], posSlot); + { + UInt32 sym = (UInt32)posSlot + (1 << kNumPosSlotBits); + range = p->rc.range; + probs = p->posSlotEncoder[GetLenToPosState(len)]; + do + { + CLzmaProb *prob = probs + (sym >> kNumPosSlotBits); + UInt32 bit = (sym >> (kNumPosSlotBits - 1)) & 1; + sym <<= 1; + RC_BIT(&p->rc, prob, bit); + } + while (sym < (1 << kNumPosSlotBits * 2)); + p->rc.range = range; + } + + if (dist >= kStartPosModelIndex) + { + unsigned footerBits = ((posSlot >> 1) - 1); + + if (dist < kNumFullDistances) + { + unsigned base = ((2 | (posSlot & 1)) << footerBits); + RcTree_ReverseEncode(&p->rc, p->posEncoders + base, footerBits, (unsigned)(dist /* - base */)); + } + else + { + UInt32 pos2 = (dist | 0xF) << (32 - footerBits); + range = p->rc.range; + // RangeEnc_EncodeDirectBits(&p->rc, posReduced >> kNumAlignBits, footerBits - kNumAlignBits); + /* + do + { + range >>= 1; + p->rc.low += range & (0 - ((dist >> --footerBits) & 1)); + RC_NORM(&p->rc) + } + while (footerBits > kNumAlignBits); + */ + do + { + range >>= 1; + p->rc.low += range & (0 - (pos2 >> 31)); + pos2 += pos2; + RC_NORM(&p->rc) + } + while (pos2 != 0xF0000000); + + + // RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, posReduced & kAlignMask); + + { + unsigned m = 1; + unsigned bit; + bit = dist & 1; dist >>= 1; RC_BIT(&p->rc, p->posAlignEncoder + m, bit); m = (m << 1) + bit; + bit = dist & 1; dist >>= 1; RC_BIT(&p->rc, p->posAlignEncoder + m, bit); m = (m << 1) + bit; + bit = dist & 1; dist >>= 1; RC_BIT(&p->rc, p->posAlignEncoder + m, bit); m = (m << 1) + bit; + bit = dist & 1; RC_BIT(&p->rc, p->posAlignEncoder + m, bit); + p->rc.range = range; + // p->alignPriceCount++; + } + } + } + } + } + + nowPos32 += (UInt32)len; + p->additionalOffset -= len; + + if (p->additionalOffset == 0) + { + UInt32 processed; + + if (!p->fastMode) + { + /* + if (p->alignPriceCount >= 16) // kAlignTableSize + FillAlignPrices(p); + if (p->matchPriceCount >= 128) + FillDistancesPrices(p); + if (p->lenEnc.counter <= 0) + LenPriceEnc_UpdateTables(&p->lenEnc, 1 << p->pb, &p->lenProbs, p->ProbPrices); + */ + if (p->matchPriceCount >= 64) + { + FillAlignPrices(p); + // { int y; for (y = 0; y < 100; y++) { + FillDistancesPrices(p); + // }} + LenPriceEnc_UpdateTables(&p->lenEnc, 1 << p->pb, &p->lenProbs, p->ProbPrices); + } + if (p->repLenEncCounter <= 0) + { + p->repLenEncCounter = REP_LEN_COUNT; + LenPriceEnc_UpdateTables(&p->repLenEnc, 1 << p->pb, &p->repLenProbs, p->ProbPrices); + } + } + + if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0) + break; + processed = nowPos32 - startPos32; + + if (maxPackSize) + { + if (processed + kNumOpts + 300 >= maxUnpackSize + || RangeEnc_GetProcessed_sizet(&p->rc) + kPackReserve >= maxPackSize) + break; + } + else if (processed >= (1 << 17)) + { + p->nowPos64 += nowPos32 - startPos32; + return CheckErrors(p); + } + } + } + + p->nowPos64 += nowPos32 - startPos32; + return Flush(p, nowPos32); +} + + + +#define kBigHashDicLimit ((UInt32)1 << 24) + +static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAllocPtr alloc, ISzAllocPtr allocBig) +{ + UInt32 beforeSize = kNumOpts; + if (!RangeEnc_Alloc(&p->rc, alloc)) + return SZ_ERROR_MEM; + + #ifndef _7ZIP_ST + p->mtMode = (p->multiThread && !p->fastMode && (p->matchFinderBase.btMode != 0)); + #endif + + { + unsigned lclp = p->lc + p->lp; + if (!p->litProbs || !p->saveState.litProbs || p->lclp != lclp) + { + LzmaEnc_FreeLits(p, alloc); + p->litProbs = (CLzmaProb *)ISzAlloc_Alloc(alloc, ((UInt32)0x300 << lclp) * sizeof(CLzmaProb)); + p->saveState.litProbs = (CLzmaProb *)ISzAlloc_Alloc(alloc, ((UInt32)0x300 << lclp) * sizeof(CLzmaProb)); + if (!p->litProbs || !p->saveState.litProbs) + { + LzmaEnc_FreeLits(p, alloc); + return SZ_ERROR_MEM; + } + p->lclp = lclp; + } + } + + p->matchFinderBase.bigHash = (Byte)(p->dictSize > kBigHashDicLimit ? 1 : 0); + + if (beforeSize + p->dictSize < keepWindowSize) + beforeSize = keepWindowSize - p->dictSize; + + #ifndef _7ZIP_ST + if (p->mtMode) + { + RINOK(MatchFinderMt_Create(&p->matchFinderMt, p->dictSize, beforeSize, p->numFastBytes, + LZMA_MATCH_LEN_MAX + + 1 /* 18.04 */ + , allocBig)); + p->matchFinderObj = &p->matchFinderMt; + p->matchFinderBase.bigHash = (Byte)( + (p->dictSize > kBigHashDicLimit && p->matchFinderBase.hashMask >= 0xFFFFFF) ? 1 : 0); + MatchFinderMt_CreateVTable(&p->matchFinderMt, &p->matchFinder); + } + else + #endif + { + if (!MatchFinder_Create(&p->matchFinderBase, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig)) + return SZ_ERROR_MEM; + p->matchFinderObj = &p->matchFinderBase; + MatchFinder_CreateVTable(&p->matchFinderBase, &p->matchFinder); + } + + return SZ_OK; +} + +void LzmaEnc_Init(CLzmaEnc *p) +{ + unsigned i; + p->state = 0; + p->reps[0] = + p->reps[1] = + p->reps[2] = + p->reps[3] = 1; + + RangeEnc_Init(&p->rc); + + for (i = 0; i < (1 << kNumAlignBits); i++) + p->posAlignEncoder[i] = kProbInitValue; + + for (i = 0; i < kNumStates; i++) + { + unsigned j; + for (j = 0; j < LZMA_NUM_PB_STATES_MAX; j++) + { + p->isMatch[i][j] = kProbInitValue; + p->isRep0Long[i][j] = kProbInitValue; + } + p->isRep[i] = kProbInitValue; + p->isRepG0[i] = kProbInitValue; + p->isRepG1[i] = kProbInitValue; + p->isRepG2[i] = kProbInitValue; + } + + { + for (i = 0; i < kNumLenToPosStates; i++) + { + CLzmaProb *probs = p->posSlotEncoder[i]; + unsigned j; + for (j = 0; j < (1 << kNumPosSlotBits); j++) + probs[j] = kProbInitValue; + } + } + { + for (i = 0; i < kNumFullDistances; i++) + p->posEncoders[i] = kProbInitValue; + } + + { + UInt32 num = (UInt32)0x300 << (p->lp + p->lc); + UInt32 k; + CLzmaProb *probs = p->litProbs; + for (k = 0; k < num; k++) + probs[k] = kProbInitValue; + } + + + LenEnc_Init(&p->lenProbs); + LenEnc_Init(&p->repLenProbs); + + p->optEnd = 0; + p->optCur = 0; + + { + for (i = 0; i < kNumOpts; i++) + p->opt[i].price = kInfinityPrice; + } + + p->additionalOffset = 0; + + p->pbMask = (1 << p->pb) - 1; + p->lpMask = ((UInt32)0x100 << p->lp) - ((unsigned)0x100 >> p->lc); +} + + +void LzmaEnc_InitPrices(CLzmaEnc *p) +{ + if (!p->fastMode) + { + FillDistancesPrices(p); + FillAlignPrices(p); + } + + p->lenEnc.tableSize = + p->repLenEnc.tableSize = + p->numFastBytes + 1 - LZMA_MATCH_LEN_MIN; + + p->repLenEncCounter = REP_LEN_COUNT; + + LenPriceEnc_UpdateTables(&p->lenEnc, 1 << p->pb, &p->lenProbs, p->ProbPrices); + LenPriceEnc_UpdateTables(&p->repLenEnc, 1 << p->pb, &p->repLenProbs, p->ProbPrices); +} + +static SRes LzmaEnc_AllocAndInit(CLzmaEnc *p, UInt32 keepWindowSize, ISzAllocPtr alloc, ISzAllocPtr allocBig) +{ + unsigned i; + for (i = kEndPosModelIndex / 2; i < kDicLogSizeMax; i++) + if (p->dictSize <= ((UInt32)1 << i)) + break; + p->distTableSize = i * 2; + + p->finished = False; + p->result = SZ_OK; + RINOK(LzmaEnc_Alloc(p, keepWindowSize, alloc, allocBig)); + LzmaEnc_Init(p); + LzmaEnc_InitPrices(p); + p->nowPos64 = 0; + return SZ_OK; +} + +static SRes LzmaEnc_Prepare(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, + ISzAllocPtr alloc, ISzAllocPtr allocBig) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + p->matchFinderBase.stream = inStream; + p->needInit = 1; + p->rc.outStream = outStream; + return LzmaEnc_AllocAndInit(p, 0, alloc, allocBig); +} + +SRes LzmaEnc_PrepareForLzma2(CLzmaEncHandle pp, + ISeqInStream *inStream, UInt32 keepWindowSize, + ISzAllocPtr alloc, ISzAllocPtr allocBig) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + p->matchFinderBase.stream = inStream; + p->needInit = 1; + return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig); +} + +static void LzmaEnc_SetInputBuf(CLzmaEnc *p, const Byte *src, SizeT srcLen) +{ + p->matchFinderBase.directInput = 1; + p->matchFinderBase.bufferBase = (Byte *)src; + p->matchFinderBase.directInputRem = srcLen; +} + +SRes LzmaEnc_MemPrepare(CLzmaEncHandle pp, const Byte *src, SizeT srcLen, + UInt32 keepWindowSize, ISzAllocPtr alloc, ISzAllocPtr allocBig) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + LzmaEnc_SetInputBuf(p, src, srcLen); + p->needInit = 1; + + LzmaEnc_SetDataSize(pp, srcLen); + return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig); +} + +void LzmaEnc_Finish(CLzmaEncHandle pp) +{ + #ifndef _7ZIP_ST + CLzmaEnc *p = (CLzmaEnc *)pp; + if (p->mtMode) + MatchFinderMt_ReleaseStream(&p->matchFinderMt); + #else + UNUSED_VAR(pp); + #endif +} + + +typedef struct +{ + ISeqOutStream vt; + Byte *data; + SizeT rem; + BoolInt overflow; +} CLzmaEnc_SeqOutStreamBuf; + +static size_t SeqOutStreamBuf_Write(const ISeqOutStream *pp, const void *data, size_t size) +{ + CLzmaEnc_SeqOutStreamBuf *p = CONTAINER_FROM_VTBL(pp, CLzmaEnc_SeqOutStreamBuf, vt); + if (p->rem < size) + { + size = p->rem; + p->overflow = True; + } + memcpy(p->data, data, size); + p->rem -= size; + p->data += size; + return size; +} + + +UInt32 LzmaEnc_GetNumAvailableBytes(CLzmaEncHandle pp) +{ + const CLzmaEnc *p = (CLzmaEnc *)pp; + return p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); +} + + +const Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle pp) +{ + const CLzmaEnc *p = (CLzmaEnc *)pp; + return p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset; +} + + +SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, BoolInt reInit, + Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + UInt64 nowPos64; + SRes res; + CLzmaEnc_SeqOutStreamBuf outStream; + + outStream.vt.Write = SeqOutStreamBuf_Write; + outStream.data = dest; + outStream.rem = *destLen; + outStream.overflow = False; + + p->writeEndMark = False; + p->finished = False; + p->result = SZ_OK; + + if (reInit) + LzmaEnc_Init(p); + LzmaEnc_InitPrices(p); + + nowPos64 = p->nowPos64; + RangeEnc_Init(&p->rc); + p->rc.outStream = &outStream.vt; + + if (desiredPackSize == 0) + return SZ_ERROR_OUTPUT_EOF; + + res = LzmaEnc_CodeOneBlock(p, desiredPackSize, *unpackSize); + + *unpackSize = (UInt32)(p->nowPos64 - nowPos64); + *destLen -= outStream.rem; + if (outStream.overflow) + return SZ_ERROR_OUTPUT_EOF; + + return res; +} + + +static SRes LzmaEnc_Encode2(CLzmaEnc *p, ICompressProgress *progress) +{ + SRes res = SZ_OK; + + #ifndef _7ZIP_ST + Byte allocaDummy[0x300]; + allocaDummy[0] = 0; + allocaDummy[1] = allocaDummy[0]; + #endif + + for (;;) + { + res = LzmaEnc_CodeOneBlock(p, 0, 0); + if (res != SZ_OK || p->finished) + break; + if (progress) + { + res = ICompressProgress_Progress(progress, p->nowPos64, RangeEnc_GetProcessed(&p->rc)); + if (res != SZ_OK) + { + res = SZ_ERROR_PROGRESS; + break; + } + } + } + + LzmaEnc_Finish(p); + + /* + if (res == SZ_OK && !Inline_MatchFinder_IsFinishedOK(&p->matchFinderBase)) + res = SZ_ERROR_FAIL; + } + */ + + return res; +} + + +SRes LzmaEnc_Encode(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress, + ISzAllocPtr alloc, ISzAllocPtr allocBig) +{ + RINOK(LzmaEnc_Prepare(pp, outStream, inStream, alloc, allocBig)); + return LzmaEnc_Encode2((CLzmaEnc *)pp, progress); +} + + +SRes LzmaEnc_WriteProperties(CLzmaEncHandle pp, Byte *props, SizeT *size) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + unsigned i; + UInt32 dictSize = p->dictSize; + if (*size < LZMA_PROPS_SIZE) + return SZ_ERROR_PARAM; + *size = LZMA_PROPS_SIZE; + props[0] = (Byte)((p->pb * 5 + p->lp) * 9 + p->lc); + + if (dictSize >= ((UInt32)1 << 22)) + { + UInt32 kDictMask = ((UInt32)1 << 20) - 1; + if (dictSize < (UInt32)0xFFFFFFFF - kDictMask) + dictSize = (dictSize + kDictMask) & ~kDictMask; + } + else for (i = 11; i <= 30; i++) + { + if (dictSize <= ((UInt32)2 << i)) { dictSize = (2 << i); break; } + if (dictSize <= ((UInt32)3 << i)) { dictSize = (3 << i); break; } + } + + for (i = 0; i < 4; i++) + props[1 + i] = (Byte)(dictSize >> (8 * i)); + return SZ_OK; +} + + +unsigned LzmaEnc_IsWriteEndMark(CLzmaEncHandle pp) +{ + return ((CLzmaEnc *)pp)->writeEndMark; +} + + +SRes LzmaEnc_MemEncode(CLzmaEncHandle pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, + int writeEndMark, ICompressProgress *progress, ISzAllocPtr alloc, ISzAllocPtr allocBig) +{ + SRes res; + CLzmaEnc *p = (CLzmaEnc *)pp; + + CLzmaEnc_SeqOutStreamBuf outStream; + + outStream.vt.Write = SeqOutStreamBuf_Write; + outStream.data = dest; + outStream.rem = *destLen; + outStream.overflow = False; + + p->writeEndMark = writeEndMark; + p->rc.outStream = &outStream.vt; + + res = LzmaEnc_MemPrepare(pp, src, srcLen, 0, alloc, allocBig); + + if (res == SZ_OK) + { + res = LzmaEnc_Encode2(p, progress); + if (res == SZ_OK && p->nowPos64 != srcLen) + res = SZ_ERROR_FAIL; + } + + *destLen -= outStream.rem; + if (outStream.overflow) + return SZ_ERROR_OUTPUT_EOF; + return res; +} + + +SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, + const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, + ICompressProgress *progress, ISzAllocPtr alloc, ISzAllocPtr allocBig) +{ + CLzmaEnc *p = (CLzmaEnc *)LzmaEnc_Create(alloc); + SRes res; + if (!p) + return SZ_ERROR_MEM; + + res = LzmaEnc_SetProps(p, props); + if (res == SZ_OK) + { + res = LzmaEnc_WriteProperties(p, propsEncoded, propsSize); + if (res == SZ_OK) + res = LzmaEnc_MemEncode(p, dest, destLen, src, srcLen, + writeEndMark, progress, alloc, allocBig); + } + + LzmaEnc_Destroy(p, alloc, allocBig); + return res; +} diff --git a/Source/Libraries/lzma/LzmaLib.c b/Source/Libraries/lzma/LzmaLib.c new file mode 100644 index 000000000..706e9e58c --- /dev/null +++ b/Source/Libraries/lzma/LzmaLib.c @@ -0,0 +1,40 @@ +/* LzmaLib.c -- LZMA library wrapper +2015-06-13 : Igor Pavlov : Public domain */ + +#include "Alloc.h" +#include "LzmaDec.h" +#include "LzmaEnc.h" +#include "LzmaLib.h" + +MY_STDAPI LzmaCompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t srcLen, + unsigned char *outProps, size_t *outPropsSize, + int level, /* 0 <= level <= 9, default = 5 */ + unsigned dictSize, /* use (1 << N) or (3 << N). 4 KB < dictSize <= 128 MB */ + int lc, /* 0 <= lc <= 8, default = 3 */ + int lp, /* 0 <= lp <= 4, default = 0 */ + int pb, /* 0 <= pb <= 4, default = 2 */ + int fb, /* 5 <= fb <= 273, default = 32 */ + int numThreads /* 1 or 2, default = 2 */ +) +{ + CLzmaEncProps props; + LzmaEncProps_Init(&props); + props.level = level; + props.dictSize = dictSize; + props.lc = lc; + props.lp = lp; + props.pb = pb; + props.fb = fb; + props.numThreads = numThreads; + + return LzmaEncode(dest, destLen, src, srcLen, &props, outProps, outPropsSize, 0, + NULL, &g_Alloc, &g_Alloc); +} + + +MY_STDAPI LzmaUncompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t *srcLen, + const unsigned char *props, size_t propsSize) +{ + ELzmaStatus status; + return LzmaDecode(dest, destLen, src, srcLen, props, (unsigned)propsSize, LZMA_FINISH_ANY, &status, &g_Alloc); +} diff --git a/Source/Libraries/lzma/Threads.c b/Source/Libraries/lzma/Threads.c new file mode 100644 index 000000000..930ad271b --- /dev/null +++ b/Source/Libraries/lzma/Threads.c @@ -0,0 +1,95 @@ +/* Threads.c -- multithreading library +2017-06-26 : Igor Pavlov : Public domain */ + +#include "Precomp.h" + +#ifndef UNDER_CE +#include +#endif + +#include "Threads.h" + +static WRes GetError() +{ + DWORD res = GetLastError(); + return res ? (WRes)res : 1; +} + +static WRes HandleToWRes(HANDLE h) { return (h != NULL) ? 0 : GetError(); } +static WRes BOOLToWRes(BOOL v) { return v ? 0 : GetError(); } + +WRes HandlePtr_Close(HANDLE *p) +{ + if (*p != NULL) + { + if (!CloseHandle(*p)) + return GetError(); + *p = NULL; + } + return 0; +} + +WRes Handle_WaitObject(HANDLE h) { return (WRes)WaitForSingleObject(h, INFINITE); } + +WRes Thread_Create(CThread *p, THREAD_FUNC_TYPE func, LPVOID param) +{ + /* Windows Me/98/95: threadId parameter may not be NULL in _beginthreadex/CreateThread functions */ + + #ifdef UNDER_CE + + DWORD threadId; + *p = CreateThread(0, 0, func, param, 0, &threadId); + + #else + + unsigned threadId; + *p = (HANDLE)_beginthreadex(NULL, 0, func, param, 0, &threadId); + + #endif + + /* maybe we must use errno here, but probably GetLastError() is also OK. */ + return HandleToWRes(*p); +} + +static WRes Event_Create(CEvent *p, BOOL manualReset, int signaled) +{ + *p = CreateEvent(NULL, manualReset, (signaled ? TRUE : FALSE), NULL); + return HandleToWRes(*p); +} + +WRes Event_Set(CEvent *p) { return BOOLToWRes(SetEvent(*p)); } +WRes Event_Reset(CEvent *p) { return BOOLToWRes(ResetEvent(*p)); } + +WRes ManualResetEvent_Create(CManualResetEvent *p, int signaled) { return Event_Create(p, TRUE, signaled); } +WRes AutoResetEvent_Create(CAutoResetEvent *p, int signaled) { return Event_Create(p, FALSE, signaled); } +WRes ManualResetEvent_CreateNotSignaled(CManualResetEvent *p) { return ManualResetEvent_Create(p, 0); } +WRes AutoResetEvent_CreateNotSignaled(CAutoResetEvent *p) { return AutoResetEvent_Create(p, 0); } + + +WRes Semaphore_Create(CSemaphore *p, UInt32 initCount, UInt32 maxCount) +{ + *p = CreateSemaphore(NULL, (LONG)initCount, (LONG)maxCount, NULL); + return HandleToWRes(*p); +} + +static WRes Semaphore_Release(CSemaphore *p, LONG releaseCount, LONG *previousCount) + { return BOOLToWRes(ReleaseSemaphore(*p, releaseCount, previousCount)); } +WRes Semaphore_ReleaseN(CSemaphore *p, UInt32 num) + { return Semaphore_Release(p, (LONG)num, NULL); } +WRes Semaphore_Release1(CSemaphore *p) { return Semaphore_ReleaseN(p, 1); } + +WRes CriticalSection_Init(CCriticalSection *p) +{ + /* InitializeCriticalSection can raise only STATUS_NO_MEMORY exception */ + #ifdef _MSC_VER + __try + #endif + { + InitializeCriticalSection(p); + /* InitializeCriticalSectionAndSpinCount(p, 0); */ + } + #ifdef _MSC_VER + __except (EXCEPTION_EXECUTE_HANDLER) { return 1; } + #endif + return 0; +} diff --git a/Source/Model/Classes/NMR_CustomXMLAttribute.cpp b/Source/Model/Classes/NMR_CustomXMLAttribute.cpp new file mode 100644 index 000000000..c57957ba6 --- /dev/null +++ b/Source/Model/Classes/NMR_CustomXMLAttribute.cpp @@ -0,0 +1,63 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--*/ + +#include "Model/Classes/NMR_CustomXMLAttribute.h" +#include "Model/Classes/NMR_ModelConstants.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_StringUtils.h" + +namespace NMR { + + CCustomXMLAttribute::CCustomXMLAttribute(const std::string& sName, const std::string& sValue) + : m_sName (sName), m_sValue (sValue) + { + + } + + CCustomXMLAttribute::~CCustomXMLAttribute() + { + + } + + std::string CCustomXMLAttribute::getName() + { + return m_sName; + } + + std::string CCustomXMLAttribute::getValue() + { + return m_sValue; + } + + void CCustomXMLAttribute::setValue(const std::string& sValue) + { + m_sValue = sValue; + } + +} + diff --git a/Source/Model/Classes/NMR_CustomXMLNode.cpp b/Source/Model/Classes/NMR_CustomXMLNode.cpp new file mode 100644 index 000000000..dd0df9557 --- /dev/null +++ b/Source/Model/Classes/NMR_CustomXMLNode.cpp @@ -0,0 +1,343 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +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/NMR_StringUtils.h" + +#include + +namespace NMR { + + CCustomXMLNode::CCustomXMLNode(CCustomXMLNode * pParentNode, const std::string& sName) + : m_sName (sName), m_bHasBeenInvalidated (false), m_pParentNode (pParentNode) + { + + } + + CCustomXMLNode::~CCustomXMLNode() + { + invalidateNodeAndAllChildren(); + } + + std::string CCustomXMLNode::getName() + { + checkInvalidation(); + + return m_sName; + } + + CCustomXMLNode* CCustomXMLNode::getParentNode() + { + checkInvalidation(); + + return m_pParentNode; + } + + + std::vector CCustomXMLNode::getChildren() + { + checkInvalidation(); + + return m_Children; + } + + PCustomXMLNode CCustomXMLNode::getChildByIndex(const size_t nIndex) + { + checkInvalidation(); + + if (nIndex >= m_Children.size()) + throw CNMRException(NMR_ERROR_INVALIDINDEX); + + return m_Children.at(nIndex); + } + + size_t CCustomXMLNode::getChildCount() + { + checkInvalidation(); + + return m_Children.size(); + } + + bool CCustomXMLNode::hasChild(const std::string& sName) + { + checkInvalidation(); + + auto iIter = m_ChildMap.find(sName); + return iIter != m_ChildMap.end(); + } + + bool CCustomXMLNode::hasUniqueChild(const std::string& sName) + { + checkInvalidation(); + + auto iIter = m_ChildMap.find(sName); + if (iIter != m_ChildMap.end()) { + return (iIter->second.size () == 1); + } + + return false; + + } + + PCustomXMLNode CCustomXMLNode::addChild(const std::string& sName) + { + checkInvalidation(); + + auto pChildNode = std::make_shared(this, sName); + + m_Children.push_back(pChildNode); + + auto iIter = m_ChildMap.find(sName); + if (iIter != m_ChildMap.end()) { + iIter->second.insert(std::make_pair (pChildNode.get (), pChildNode)); + } + else { + std::map childSet; + childSet.insert(std::make_pair(pChildNode.get(), pChildNode)); + m_ChildMap.insert(std::make_pair(sName, childSet)); + } + + return pChildNode; + } + + + PCustomXMLNode CCustomXMLNode::findUniqueChild(const std::string& sName, bool bMustExist) + { + checkInvalidation(); + + PCustomXMLNode pChild = nullptr; + + auto iIter = m_ChildMap.find(sName); + if (iIter != m_ChildMap.end()) { + if (iIter->second.size() == 1) { + pChild = iIter->second.begin()->second; + } + else { + throw CNMRException(NMR_ERROR_XMLCHILDNODEISNOTUNIQUE); + } + } + + if (bMustExist) + throw CNMRException(NMR_ERROR_XMLCHILDNODENOTFOUND); + + return nullptr; + + } + + size_t CCustomXMLNode::removeChildrenWithName(const std::string& sName) + { + checkInvalidation(); + + size_t nRemoved = 0; + auto iNameIter = m_ChildMap.find(sName); + if (iNameIter != m_ChildMap.end()) { + for (auto iChild : iNameIter->second) { + iChild.second->invalidateNodeAndAllChildren(); + } + } + m_ChildMap.erase(sName); + + m_Children.erase(std::remove_if(m_Children.begin(), m_Children.end(), [sName, &nRemoved](const PCustomXMLNode& pChild) + { + if (pChild->getName() == sName) { + nRemoved++; + return true; + } + + return false; + })); + + return nRemoved; + } + + void CCustomXMLNode::removeChild(CCustomXMLNode* pXMLNode) + { + checkInvalidation(); + + if (pXMLNode == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + pXMLNode->invalidateNodeAndAllChildren(); + + auto iNameIter = m_ChildMap.find(pXMLNode->getName()); + if (iNameIter != m_ChildMap.end()) { + iNameIter->second.erase(pXMLNode); + } + + m_Children.erase(std::remove_if(m_Children.begin(), m_Children.end(), [pXMLNode](const PCustomXMLNode& pChild) + { + return (pChild.get() == pXMLNode); + })); + + } + + void CCustomXMLNode::remove() + { + checkInvalidation(); + + if (m_pParentNode == nullptr) + throw CNMRException(NMR_ERROR_ROOTNODECANNOTBEDELETED); + + m_pParentNode->removeChild(this); + } + + + void CCustomXMLNode::checkInvalidation() + { + if (m_bHasBeenInvalidated) + throw CNMRException(NMR_ERROR_TRIEDTOACCESSINVALIDATEDNODE); + } + + void CCustomXMLNode::invalidateNodeAndAllChildren() + { + if (!m_bHasBeenInvalidated) { + m_bHasBeenInvalidated = true; + for (auto pChild : m_Children) + pChild->invalidateNodeAndAllChildren(); + } + } + + std::vector CCustomXMLNode::findChildrenWithName(const std::string& sName) + { + std::vector childList; + auto iNameIter = m_ChildMap.find(sName); + if (iNameIter != m_ChildMap.end()) { + for (auto iChild : iNameIter->second) + childList.push_back(iChild.second); + + } + + return childList; + } + + size_t CCustomXMLNode::getAttributeCount() + { + return m_Attributes.size (); + } + + PCustomXMLAttribute CCustomXMLNode::getAttributeByIndex(size_t nIndex) + { + if (nIndex >= m_Attributes.size()) + throw CNMRException(NMR_ERROR_INVALIDINDEX); + + return m_Attributes.at(nIndex); + } + + + bool CCustomXMLNode::hasAttribute(const std::string& sName) + { + auto iIter = m_AttributeMap.find(sName); + return iIter != m_AttributeMap.end(); + } + + PCustomXMLAttribute CCustomXMLNode::findAttribute(const std::string& sName, bool bMustExist) + { + auto iIter = m_AttributeMap.find(sName); + if (iIter != m_AttributeMap.end()) { + return iIter->second; + } + else { + if (bMustExist) + throw CNMRException(NMR_ERROR_XMLATTRIBUTENOTFOUND); + + return nullptr; + } + + } + + PCustomXMLAttribute CCustomXMLNode::addAttribute(const std::string& sName, const std::string& sValue) + { + if (hasAttribute (sName)) + throw CNMRException(NMR_ERROR_DUPLICATEXMLATTRIBUTE); + + auto pAttribute = std::make_shared(sName, sValue); + m_Attributes.push_back(pAttribute); + m_AttributeMap.insert(std::make_pair (sName, pAttribute)); + + return pAttribute; + } + + bool CCustomXMLNode::removeAttribute(const std::string& sName) + { + auto iIter = m_AttributeMap.find(sName); + if (iIter != m_AttributeMap.end()) { + m_AttributeMap.erase(iIter); + m_Attributes.erase(std::remove_if(m_Attributes.begin(), m_Attributes.end(), [sName](const PCustomXMLAttribute& pAttribute) + { + return (pAttribute->getName () == sName); + })); + + return true; + } + else { + return false; + } + + } + + + bool CCustomXMLNode::removeAttributeByIndex(const uint64_t nIndex) + { + if (nIndex >= m_Attributes.size()) + return false; + + auto iIter = m_Attributes.begin(); + iIter += nIndex; + + std::string sName = (*iIter)->getName(); + + m_Attributes.erase(iIter); + m_AttributeMap.erase(sName); + + return true; + } + + void CCustomXMLNode::writeContentToXML(CXmlWriter* pXMLWriter) + { + __NMRASSERT(pXMLWriter); + + for (auto pAttribute : m_Attributes) { + std::string sName = pAttribute->getName(); + std::string sValue = pAttribute->getValue(); + pXMLWriter->WriteAttributeString(nullptr, sName.c_str(), nullptr, sValue.c_str()); + } + + for (auto pChild : m_Children) { + pXMLWriter->WriteStartElement(nullptr, pChild->getName ().c_str(), nullptr); + pChild->writeContentToXML(pXMLWriter); + pXMLWriter->WriteEndElement(); + } + + + } + + +} + diff --git a/Source/Model/Classes/NMR_CustomXMLTree.cpp b/Source/Model/Classes/NMR_CustomXMLTree.cpp new file mode 100644 index 000000000..589b8e912 --- /dev/null +++ b/Source/Model/Classes/NMR_CustomXMLTree.cpp @@ -0,0 +1,83 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--*/ + +#include "Model/Classes/NMR_CustomXMLTree.h" +#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_ExportStream_Memory.h" + +namespace NMR { + + CCustomXMLTree::CCustomXMLTree(const std::string& sNameSpace, const std::string& sRootName) + : m_sNameSpace (sNameSpace) + { + m_pRootNode = std::make_shared(nullptr, sRootName); + + } + + CCustomXMLTree::~CCustomXMLTree() + { + + } + + std::string CCustomXMLTree::getNameSpace() + { + return m_sNameSpace; + } + + std::string CCustomXMLTree::getRootName() + { + return m_pRootNode->getName(); + } + + PCustomXMLNode CCustomXMLTree::getRootNode() + { + return m_pRootNode; + } + + std::string CCustomXMLTree::saveToString() + { + auto pExportStream = std::make_shared(); + auto pXMLWriter = std::make_shared(pExportStream); + pXMLWriter->WriteStartDocument(); + pXMLWriter->WriteStartElement (nullptr, m_pRootNode->getName ().c_str (), m_sNameSpace.c_str ()); + + m_pRootNode->writeContentToXML(pXMLWriter.get()); + + pXMLWriter->WriteFullEndElement(); + + pXMLWriter->WriteEndDocument(); + pXMLWriter->Flush(); + + pExportStream->seekPosition(0, true); + return std::string ((char*)pExportStream->getData(), pExportStream->getDataSize()); + } + +} diff --git a/Source/Model/Classes/NMR_Model.cpp b/Source/Model/Classes/NMR_Model.cpp index 3a92be985..a0a14160b 100644 --- a/Source/Model/Classes/NMR_Model.cpp +++ b/Source/Model/Classes/NMR_Model.cpp @@ -53,6 +53,7 @@ A model is an in memory representation of the 3MF file. #include "Common/MeshInformation/NMR_MeshInformation.h" #include "Common/MeshInformation/NMR_MeshInformation_Properties.h" #include "Common/NMR_Exception.h" +#include "Common/OPC/NMR_OpcPackagePart.h" #include #include #include @@ -1315,4 +1316,33 @@ namespace NMR { return size; } + PImportStream CModel::readPathFromPersistentDataSource(_In_ std::string sPath) + { + if (m_pPersistentDataSource.get() != nullptr) { + auto pOpcPackageReader = m_pPersistentDataSource->getOpcPackageReader(); + return pOpcPackageReader->readPartStreamIntoMemory (sPath); + } + else { + return nullptr; + } + + } + + void CModel::setPersistentDataSource(PModelPersistentDataSource pPersistentDataSource) + { + releasePersistentDataSource(); + + m_pPersistentDataSource = pPersistentDataSource; + } + + void CModel::releasePersistentDataSource() + { + if (m_pPersistentDataSource.get() != nullptr) + m_pPersistentDataSource->invalidateSource(); + + + } + } + + diff --git a/Source/Model/Classes/NMR_ModelContext.cpp b/Source/Model/Classes/NMR_ModelContext.cpp index 15baa14ab..702fa0089 100644 --- a/Source/Model/Classes/NMR_ModelContext.cpp +++ b/Source/Model/Classes/NMR_ModelContext.cpp @@ -54,6 +54,15 @@ namespace NMR { m_pWarnings = std::make_shared(); } + CModelContext::~CModelContext() + { + m_pWarnings = nullptr; + m_pSecureContext = nullptr; + m_pProgressMonitor = nullptr; + m_pKeystore = nullptr; + m_pModel = nullptr; + } + nfBool CModelContext::isComplete() const { return (nullptr != m_pModel && nullptr != m_pProgressMonitor && nullptr != m_pSecureContext); } diff --git a/Source/Model/Classes/NMR_ModelToolpath.cpp b/Source/Model/Classes/NMR_ModelToolpath.cpp new file mode 100644 index 000000000..8a997c122 --- /dev/null +++ b/Source/Model/Classes/NMR_ModelToolpath.cpp @@ -0,0 +1,176 @@ +/*++ + +Copyright (C) 2018 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +NMR_ModelToolpath.cpp implements the Model Toolpath Class. + +--*/ + +#include "Model/Classes/NMR_ModelConstants.h" +#include "Model/Classes/NMR_ModelToolpath.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_StringUtils.h" +#include "Common/NMR_UUID.h" + +#include +#include + +namespace NMR { + + + CModelToolpath::CModelToolpath(_In_ const ModelResourceID sID, _In_ CModel * pModel, double dUnitFactor) + : CModelResource(sID, pModel), m_dUnitFactor (dUnitFactor) + { + } + + PModelToolpath CModelToolpath::make(_In_ const ModelResourceID sID, _In_ CModel * pModel, double dUnitFactor) + { + return std::make_shared (sID, pModel, dUnitFactor); + } + + PModelToolpathLayer CModelToolpath::addLayer(const std::string & sPath, nfUint32 nMaxZ) + { + auto pLayer = std::make_shared(sPath, nMaxZ); + m_Layers.push_back(pLayer); + return pLayer; + } + + nfUint32 CModelToolpath::getLayerCount() + { + return (nfUint32)m_Layers.size(); + } + + PModelToolpathLayer CModelToolpath::getLayer(nfUint32 nIndex) + { + if (nIndex >= m_Layers.size()) + throw CNMRException(NMR_ERROR_INVALIDINDEX); + return m_Layers[nIndex]; + } + + double CModelToolpath::getUnitFactor() + { + return m_dUnitFactor; + } + + PModelToolpathProfile CModelToolpath::addProfile(const std::string & sName) + { + CUUID newUUID; + std::string sUUID = newUUID.toString(); + + auto pProfile = std::make_shared(sUUID, sName); + m_Profiles.push_back(pProfile); + + m_ProfileMap.insert(std::make_pair (sUUID, pProfile)); + + return pProfile; + + } + + + PModelToolpathProfile CModelToolpath::addExistingProfile(const std::string & sUUID, const std::string & sName) + { + CUUID checkUUID (sUUID.c_str()); + + auto pProfile = std::make_shared(checkUUID.toString (), sName); + m_Profiles.push_back(pProfile); + + m_ProfileMap.insert(std::make_pair(sUUID, pProfile)); + + return pProfile; + + } + + + nfUint32 CModelToolpath::getProfileCount() + { + return (nfUint32)m_Profiles.size(); + } + + PModelToolpathProfile CModelToolpath::getProfile(nfUint32 nIndex) + { + if (nIndex >= m_Profiles.size()) + throw CNMRException(NMR_ERROR_INVALIDINDEX); + return m_Profiles[nIndex]; + } + + PModelToolpathProfile CModelToolpath::getProfileByUUID(std::string sUUID) + { + auto iIterator = m_ProfileMap.find(sUUID); + if (iIterator != m_ProfileMap.end()) { + return iIterator->second; + } + + return nullptr; + } + + uint32_t CModelToolpath::getCustomXMLDataCount() + { + return (uint32_t)m_CustomXMLData.size(); + } + + PCustomXMLTree CModelToolpath::getCustomXMLData(uint32_t nIndex) + { + if (nIndex >= m_CustomXMLData.size()) + throw CNMRException(NMR_ERROR_INVALIDINDEX); + + return m_CustomXMLData.at(nIndex); + + } + + void CModelToolpath::addCustomXMLData(PCustomXMLTree pCustomXMLTree) + { + if (pCustomXMLTree.get () == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + if (m_CustomXMLData.size () >= XML_3MF_MAXRESOURCECOUNT) + throw CNMRException(NMR_ERROR_TOOMANYCUSTOMXMLDATAENTRIES); + + m_CustomXMLData.push_back(pCustomXMLTree); + } + + uint32_t CModelToolpath::clearCustomXMLData() + { + uint32_t nCount = (uint32_t)m_CustomXMLData.size(); + m_CustomXMLData.clear(); + + return nCount; + } + + bool CModelToolpath::deleteCustomXMLData(CCustomXMLTree* pCustomXMLTree) + { + for (auto iIter = m_CustomXMLData.begin(); iIter != m_CustomXMLData.end(); iIter++) { + if ((*iIter).get() == pCustomXMLTree) { + m_CustomXMLData.erase(iIter); + return true; + } + } + return false; + + } + +} + diff --git a/Source/Model/Classes/NMR_ModelToolpathLayer.cpp b/Source/Model/Classes/NMR_ModelToolpathLayer.cpp new file mode 100644 index 000000000..9053ef1dc --- /dev/null +++ b/Source/Model/Classes/NMR_ModelToolpathLayer.cpp @@ -0,0 +1,60 @@ +/*++ + +Copyright (C) 2018 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +NMR_ModelToolpathLayer.cpp defines the Model Toolpath Layer. + +--*/ + +#include "Model/Classes/NMR_ModelToolpathLayer.h" + +#include "Common/NMR_Exception.h" +#include "Common/NMR_StringUtils.h" +#include +#include + +namespace NMR { + + + + CModelToolpathLayer::CModelToolpathLayer(std::string sLayerDataPath, nfUint32 nMaxZ) + : m_sLayerDataPath(sLayerDataPath), m_nMaxZ (nMaxZ) + { + } + + nfUint32 CModelToolpathLayer::getMaxZ() + { + return m_nMaxZ; + } + + std::string CModelToolpathLayer::getLayerDataPath() + { + return m_sLayerDataPath; + } + +} + diff --git a/Source/Model/Classes/NMR_ModelToolpathLayerReadData.cpp b/Source/Model/Classes/NMR_ModelToolpathLayerReadData.cpp new file mode 100644 index 000000000..c557b8698 --- /dev/null +++ b/Source/Model/Classes/NMR_ModelToolpathLayerReadData.cpp @@ -0,0 +1,317 @@ +/*++ + +Copyright (C) 2018 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +NMR_ModelToolpathLayerReadData.cpp defines the Model Toolpath Layer Read Data. + +--*/ + +#include "Model/Classes/NMR_ModelToolpathLayerReadData.h" +#include "Model/Classes/NMR_ModelConstants.h" +#include "Model/Classes/NMR_ModelObject.h" + +#include "Common/NMR_Exception.h" +#include "Common/NMR_StringUtils.h" + +#include "Common/NMR_UUID.h" + +#include +#include + +namespace NMR { + + CModelToolpathLayerReadData::CModelToolpathLayerReadData(_In_ PModelToolpath pModelToolpath) + : m_pModelToolpath (pModelToolpath), m_pCurrentSegment(nullptr), + m_pCurrentAttributePage (nullptr), m_nCurrentPositionOnPage (TOOLPATHSEGMENTATTRIBUTEPAGESIZE) + { + if (pModelToolpath.get() == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + } + + CModelToolpathLayerReadData::~CModelToolpathLayerReadData() + { + + } + + std::string CModelToolpathLayerReadData::getUUID() + { + return m_sUUID; + } + + void CModelToolpathLayerReadData::beginSegment(eModelToolpathSegmentType eType, nfUint32 nProfileID, nfUint32 nPartID) + { + if (m_pCurrentSegment != nullptr) + throw CNMRException(NMR_ERROR_LAYERSEGMENTALREADYOPEN); + + m_pCurrentSegment = m_Segments.allocData(); + m_pCurrentSegment->m_eType = eType; + m_pCurrentSegment->m_nPartID = nPartID; + m_pCurrentSegment->m_nProfileID = nProfileID; + m_pCurrentSegment->m_nStartPoint = m_Points.getCount (); + m_pCurrentSegment->m_nPointCount = 0; + + size_t nNumberOfAttributes = m_SegmentAttributeDefinitions.size(); + + 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); + + } + + void CModelToolpathLayerReadData::endSegment() + { + if (m_pCurrentSegment == nullptr) + throw CNMRException(NMR_ERROR_LAYERSEGMENTNOTOPEN); + + nfUint32 nCount = m_Points.getCount(); + + __NMRASSERT(m_pCurrentSegment->m_nStartPoint <= nCount); + + m_pCurrentSegment->m_nPointCount = nCount - m_pCurrentSegment->m_nStartPoint; + + m_pCurrentSegment = nullptr; + } + + void CModelToolpathLayerReadData::addPoint(nfFloat fX, nfFloat fY) + { + if (m_pCurrentSegment == nullptr) + throw CNMRException(NMR_ERROR_LAYERSEGMENTNOTOPEN); + + NVEC2 * pVec = m_Points.allocData(); + pVec->m_values.x = fX; + pVec->m_values.y = fY; + } + + nfUint32 CModelToolpathLayerReadData::getSegmentCount() + { + return m_Segments.getCount(); + } + + void CModelToolpathLayerReadData::getSegmentInfo(nfUint32 nSegmentIndex, eModelToolpathSegmentType & eType, nfUint32 & nProfileID, nfUint32 & nPartID, nfUint32 & nPointCount) + { + TOOLPATHREADSEGMENT * pSegment = m_Segments.getData(nSegmentIndex); + __NMRASSERT(pSegment != nullptr); + eType = pSegment->m_eType; + nPartID = pSegment->m_nPartID; + nProfileID = pSegment->m_nProfileID; + nPointCount = pSegment->m_nPointCount; + } + + NVEC2 CModelToolpathLayerReadData::getSegmentPoint(nfUint32 nSegmentIndex, nfUint32 nPointIndex) + { + TOOLPATHREADSEGMENT * pSegment = m_Segments.getData(nSegmentIndex); + __NMRASSERT(pSegment != nullptr); + if (nPointIndex >= pSegment->m_nPointCount) + throw CNMRException(NMR_ERROR_INVALIDINDEX); + + return m_Points.getDataRef(pSegment->m_nStartPoint + nPointIndex); + + } + + void CModelToolpathLayerReadData::registerUUID(nfUint32 nID, std::string sUUID) + { + auto iIter = m_UUIDMap.find(nID); + if (iIter != m_UUIDMap.end()) + throw CNMRException(NMR_ERROR_DUPLICATEID); + + m_UUIDMap.insert(std::make_pair (nID, sUUID)); + } + + std::string CModelToolpathLayerReadData::mapIDtoUUID(nfUint32 nID) + { + auto iIter = m_UUIDMap.find(nID); + if (iIter == m_UUIDMap.end()) + throw CNMRException(NMR_ERROR_MISSINGID); + + return iIter->second; + } + + uint32_t CModelToolpathLayerReadData::getCustomXMLDataCount() + { + return (uint32_t) m_CustomXMLData.size(); + } + + PCustomXMLTree CModelToolpathLayerReadData::getCustomXMLData(uint32_t nIndex) + { + if (nIndex >= m_CustomXMLData.size ()) + throw CNMRException(NMR_ERROR_INVALIDINDEX); + + return m_CustomXMLData.at(nIndex); + } + + void CModelToolpathLayerReadData::addCustomXMLData(PCustomXMLTree pCustomXMLTree) + { + if (pCustomXMLTree.get () == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + m_CustomXMLData.push_back(pCustomXMLTree); + } + + uint32_t CModelToolpathLayerReadData::registerCustomSegmentAttribute(const std::string& sNameSpace, const std::string& sAttributeName, eModelToolpathSegmentAttributeType eSegmentType) + { + if (m_Segments.getCount() > 0) + throw CNMRException(NMR_ERROR_SEGMENTATTRIBUTEDEFINEDAFTERREADING); + if (sNameSpace.empty ()) + throw CNMRException(NMR_ERROR_INVALIDSEGMENTATTRIBUTENAMESPACE); + if (sAttributeName.empty()) + throw CNMRException(NMR_ERROR_INVALIDSEGMENTATTRIBUTENAME); + + uint32_t nNewAttributeID; + + auto iIter = m_SegmentAttributeMap.find(std::make_pair(sNameSpace, sAttributeName)); + if (iIter != m_SegmentAttributeMap.end()) { + if (iIter->second.second != eSegmentType) + throw CNMRException(NMR_ERROR_INVALIDSEGMENTATTRIBUTETYPE); + + return iIter->second.first; + + } + + + switch (eSegmentType) { + case eModelToolpathSegmentAttributeType::SegmentAttributeInt64: + case eModelToolpathSegmentAttributeType::SegmentAttributeDouble: + m_AttributesOfNextSegment.push_back (0); + m_SegmentAttributeDefinitions.push_back(std::make_pair(eSegmentType, std::make_pair(sNameSpace, sAttributeName))); + nNewAttributeID = (uint32_t)m_SegmentAttributeDefinitions.size(); + m_SegmentAttributeMap.insert(std::make_pair (std::make_pair (sNameSpace, sAttributeName), std::make_pair (nNewAttributeID, eSegmentType))); + return nNewAttributeID; + + default: + throw CNMRException(NMR_ERROR_INVALIDSEGMENTATTRIBUTETYPE); + } + + } + + void CModelToolpathLayerReadData::clearSegmentAttributes() + { + for (auto& attribute : m_AttributesOfNextSegment) + attribute = 0; + } + + void CModelToolpathLayerReadData::storeSegmentAttribute(const std::string& sNameSpace, const std::string& sAttributeName, const std::string& sAttributeValue) + { + + auto iIter = m_SegmentAttributeMap.find(std::make_pair (sNameSpace, sAttributeName)); + + if (iIter != m_SegmentAttributeMap.end()) { + auto nAttributeID = iIter->second.first; + switch (iIter->second.second) { + case eModelToolpathSegmentAttributeType::SegmentAttributeInt64: + if ((nAttributeID < 1) && (nAttributeID > m_AttributesOfNextSegment.size ())) + throw CNMRException(NMR_ERROR_INVALIDSEGMENTATTRIBUTEID); + + if (m_SegmentAttributeDefinitions.at(nAttributeID - 1).first != eModelToolpathSegmentAttributeType::SegmentAttributeInt64) + throw CNMRException(NMR_ERROR_INVALIDSEGMENTATTRIBUTETYPE); + + m_AttributesOfNextSegment.at (nAttributeID - 1) = fnStringToUint32(sAttributeValue.c_str ()); + + break; + case eModelToolpathSegmentAttributeType::SegmentAttributeDouble: + if ((nAttributeID < 1) && (nAttributeID > m_AttributesOfNextSegment.size ())) + throw CNMRException(NMR_ERROR_INVALIDSEGMENTATTRIBUTEID); + + if (m_SegmentAttributeDefinitions.at(nAttributeID - 1).first != eModelToolpathSegmentAttributeType::SegmentAttributeDouble) + throw CNMRException(NMR_ERROR_INVALIDSEGMENTATTRIBUTETYPE); + + double* pNextAttribute = (double*)&m_AttributesOfNextSegment.at(nAttributeID - 1); + *pNextAttribute = fnStringToDouble(sAttributeValue.c_str()); + break; + } + + } + } + + int64_t CModelToolpathLayerReadData::getSegmentIntegerAttribute(nfUint32 nSegmentIndex, uint32_t nAttributeID) + { + TOOLPATHREADSEGMENT* pSegment = m_Segments.getData(nSegmentIndex); + __NMRASSERT(pSegment != nullptr); + + if ((nAttributeID < 1) && (nAttributeID > m_SegmentAttributeDefinitions.size ())) + throw CNMRException(NMR_ERROR_INVALIDSEGMENTATTRIBUTEID); + __NMRASSERT(pSegment->m_pAttributeData != nullptr); + + return pSegment->m_pAttributeData[nAttributeID - 1]; + + } + + double CModelToolpathLayerReadData::getSegmentDoubleAttribute(nfUint32 nSegmentIndex, uint32_t nAttributeID) + { + TOOLPATHREADSEGMENT* pSegment = m_Segments.getData(nSegmentIndex); + __NMRASSERT(pSegment != nullptr); + + if ((nAttributeID < 1) && (nAttributeID > m_SegmentAttributeDefinitions.size ())) + throw CNMRException(NMR_ERROR_INVALIDSEGMENTATTRIBUTEID); + __NMRASSERT(pSegment->m_pDoubleAttributes != nullptr); + + double* pEntry = (double*)&pSegment->m_pAttributeData[nAttributeID - 1]; + return *pEntry; + + } + + + int64_t* CModelToolpathLayerReadData::allocAttributeBuffer(uint32_t nSize) + { + if (nSize == 0) + return nullptr; + + if (nSize >= TOOLPATHSEGMENTATTRIBUTEPAGESIZE) + throw CNMRException(NMR_ERROR_INVALIDSEGMENTATTRIBUTEDATASIZE); + + if (m_nCurrentPositionOnPage + nSize > TOOLPATHSEGMENTATTRIBUTEPAGESIZE) { + m_AttributeBuffer.push_back (CToolpathLayerAttributePage ()); + m_pCurrentAttributePage = &(*m_AttributeBuffer.rbegin()); + m_pCurrentAttributePage->resize(TOOLPATHSEGMENTATTRIBUTEPAGESIZE); + m_nCurrentPositionOnPage = 0; + } + + __NMRASSERT(m_pCurrentAttributePage != nullptr); + + int64_t* pData = &m_pCurrentAttributePage->at(m_nCurrentPositionOnPage); + m_nCurrentPositionOnPage += nSize; + + return pData; + + } + + std::pair CModelToolpathLayerReadData::findAttribute(const std::string& sNameSpace, const std::string& sAttributeName, bool bMustExist) + { + auto iIter = m_SegmentAttributeMap.find(std::make_pair(sNameSpace, sAttributeName)); + + if (iIter != m_SegmentAttributeMap.end()) { + return std::make_pair (iIter->second.first, iIter->second.second); + } + + if (bMustExist) + throw CNMRException(NMR_ERROR_SEGMENTATTRIBUTENOTFOUND); + + return std::make_pair (0, eModelToolpathSegmentAttributeType::Unknown); + } + + +} diff --git a/Source/Model/Classes/NMR_ModelToolpathLayerWriteData.cpp b/Source/Model/Classes/NMR_ModelToolpathLayerWriteData.cpp new file mode 100644 index 000000000..ff185e59a --- /dev/null +++ b/Source/Model/Classes/NMR_ModelToolpathLayerWriteData.cpp @@ -0,0 +1,501 @@ +/*++ + +Copyright (C) 2018 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +NMR_ModelToolpathLayer.cpp defines the Model Toolpath Layer. + +--*/ + +#include "Model/Classes/NMR_ModelToolpathLayerWriteData.h" +#include "Model/Classes/NMR_ModelConstants.h" +#include "Model/Classes/NMR_ModelObject.h" +#include "Model/Classes/NMR_ModelBuildItem.h" + +#include "Common/NMR_Exception.h" +#include "Common/NMR_StringUtils.h" +#include "Common/Platform/NMR_XmlWriter_Native.h" +#include "Common/Platform/NMR_ImportStream_Shared_Memory.h" + +#include "Common/NMR_UUID.h" + +#include +#include + +namespace NMR { + + CModelToolpathLayerWriteData::CModelToolpathLayerWriteData(CModelToolpath * pModelToolpath, NMR::PModelWriter_3MF pModelWriter, const std::string & sPackagePath, std::map PrefixToNameSpaceMap) + : m_pModelToolpath (pModelToolpath), m_pModelWriter (pModelWriter), m_sPackagePath (sPackagePath), m_PrefixToNameSpaceMap (PrefixToNameSpaceMap) + { + if (pModelToolpath == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + if (pModelWriter.get() == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + CUUID uuid; + m_sUUID = uuid.toString(); + + m_pExportStream = std::make_shared(); + + m_pXmlWriter = std::make_shared(m_pExportStream); + m_pXmlWriter->WriteStartDocument(); + m_pXmlWriter->WriteStartElement(nullptr, XML_3MF_TOOLPATHELEMENT_LAYER, XML_3MF_NAMESPACE_TOOLPATHSPEC); + m_pXmlWriter->WriteAttributeString(XML_3MF_ATTRIBUTE_XMLNS, XML_3MF_NAMESPACEPREFIX_BINARY, nullptr, XML_3MF_NAMESPACE_BINARYSPEC); + + if (m_PrefixToNameSpaceMap.find(XML_3MF_NAMESPACEPREFIX_BINARY) != m_PrefixToNameSpaceMap.end()) + throw CNMRException(NMR_ERROR_NAMESPACEPREFIXISRESERVED); + + for (auto iIter : m_PrefixToNameSpaceMap) { + m_pXmlWriter->WriteAttributeString(XML_3MF_ATTRIBUTE_XMLNS, iIter.first.c_str (), nullptr, iIter.second.c_str ()); + m_NameSpaceToPrefixMap.insert(std::make_pair (iIter.second, iIter.first)); + } + + m_bWritingHeader = true; + m_bWritingData = false; + m_bWritingFinished = false; + + m_nIDCounter = 1; + + } + + CModelToolpathLayerWriteData::~CModelToolpathLayerWriteData() + { + if (!m_bWritingFinished) + finishWriting (); + } + + void CModelToolpathLayerWriteData::addCustomXMLData(PCustomXMLTree pXMLTree) + { + if (!m_bWritingHeader) + throw CNMRException(NMR_ERROR_TOOLPATH_NOTWRITINGHEADER); + + if (pXMLTree.get () == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + m_CustomXMLData.push_back(pXMLTree); + + } + + + nfUint32 CModelToolpathLayerWriteData::RegisterProfile(PModelToolpathProfile pProfile) + { + if (!m_bWritingHeader) + throw CNMRException(NMR_ERROR_TOOLPATH_NOTWRITINGHEADER); + + unsigned int nNewID = m_nIDCounter; + m_nIDCounter++; + + m_Profiles.insert(std::make_pair(nNewID, pProfile)); + + return nNewID; + } + + nfUint32 CModelToolpathLayerWriteData::RegisterPart(PModelBuildItem pBuildItem) + { + if (!m_bWritingHeader) + throw CNMRException(NMR_ERROR_TOOLPATH_NOTWRITINGHEADER); + + unsigned int nNewID = m_nIDCounter; + m_nIDCounter++; + + m_Parts.insert(std::make_pair(nNewID, pBuildItem)); + + return nNewID; + } + + void CModelToolpathLayerWriteData::WriteHatchData(const nfUint32 nProfileID, const nfUint32 nPartID, const nfUint32 nHatchCount, const nfInt32 * pX1Buffer, const nfInt32 * pY1Buffer, const nfInt32 * pX2Buffer, const nfInt32 * pY2Buffer) + { + std::string sPath; + NMR::CChunkedBinaryStreamWriter * pStreamWriter = getStreamWriter(sPath); + + if (pX1Buffer == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + if (pY1Buffer == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + if (pX2Buffer == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + if (pY2Buffer == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + if (m_bWritingHeader) + finishHeader(); + if (!m_bWritingData) + throw CNMRException(NMR_ERROR_TOOLPATH_NOTWRITINGDATA); + + std::string sPartID = std::to_string(nPartID); + std::string sProfileID = std::to_string(nProfileID); + + m_pXmlWriter->WriteStartElement(nullptr, XML_3MF_TOOLPATHELEMENT_SEGMENT, nullptr); + m_pXmlWriter->WriteAttributeString(nullptr, XML_3MF_TOOLPATHATTRIBUTE_TYPE, nullptr, XML_3MF_TOOLPATHTYPE_HATCH); + m_pXmlWriter->WriteAttributeString(nullptr, XML_3MF_TOOLPATHATTRIBUTE_PROFILEID, nullptr, sProfileID.c_str()); + m_pXmlWriter->WriteAttributeString(nullptr, XML_3MF_TOOLPATHATTRIBUTE_PARTID, nullptr, sPartID.c_str()); + for (auto& customAttribute : m_CustomSegmentAttributes) { + std::string sNameSpace = customAttribute.first.first; + std::string sAttributeName = customAttribute.first.second; + std::string sAttributeValue = customAttribute.second; + std::string sAttributePrefix = findNameSpacePrefix (sNameSpace); + m_pXmlWriter->WriteAttributeString(sAttributePrefix.c_str (), sAttributeName.c_str (), nullptr, sAttributeValue.c_str ()); + } + + if (pStreamWriter != nullptr) { + unsigned int binaryKeyX1 = pStreamWriter->addIntArray(pX1Buffer, nHatchCount, eptDeltaPredicition); + unsigned int binaryKeyY1 = pStreamWriter->addIntArray(pY1Buffer, nHatchCount, eptDeltaPredicition); + unsigned int binaryKeyX2 = pStreamWriter->addIntArray(pX2Buffer, nHatchCount, eptDeltaPredicition); + unsigned int binaryKeyY2 = pStreamWriter->addIntArray(pY2Buffer, nHatchCount, eptDeltaPredicition); + + std::string sKeyX1 = std::to_string(binaryKeyX1); + std::string sKeyY1 = std::to_string(binaryKeyY1); + std::string sKeyX2 = std::to_string(binaryKeyX2); + std::string sKeyY2 = std::to_string(binaryKeyY2); + + m_pXmlWriter->WriteStartElement(XML_3MF_NAMESPACEPREFIX_BINARY, XML_3MF_TOOLPATHELEMENT_HATCH, nullptr); + m_pXmlWriter->WriteAttributeString(XML_3MF_NAMESPACEPREFIX_BINARY, XML_3MF_TOOLPATHATTRIBUTE_X1, nullptr, sKeyX1.c_str()); + m_pXmlWriter->WriteAttributeString(XML_3MF_NAMESPACEPREFIX_BINARY, XML_3MF_TOOLPATHATTRIBUTE_Y1, nullptr, sKeyY1.c_str()); + m_pXmlWriter->WriteAttributeString(XML_3MF_NAMESPACEPREFIX_BINARY, XML_3MF_TOOLPATHATTRIBUTE_X2, nullptr, sKeyX2.c_str()); + m_pXmlWriter->WriteAttributeString(XML_3MF_NAMESPACEPREFIX_BINARY, XML_3MF_TOOLPATHATTRIBUTE_Y2, nullptr, sKeyY2.c_str()); + m_pXmlWriter->WriteEndElement(); + + + } + else { + + // TODO: make fast! + uint32_t nIndex; + for (nIndex = 0; nIndex < nHatchCount; nIndex++) { + std::string sX1 = std::to_string(pX1Buffer[nIndex]); + std::string sY1 = std::to_string(pY1Buffer[nIndex]); + std::string sX2 = std::to_string(pX2Buffer[nIndex]); + std::string sY2 = std::to_string(pY2Buffer[nIndex]); + + m_pXmlWriter->WriteStartElement(nullptr, XML_3MF_TOOLPATHELEMENT_HATCH, nullptr); + m_pXmlWriter->WriteAttributeString(nullptr, XML_3MF_TOOLPATHATTRIBUTE_X1, nullptr, sX1.c_str()); + m_pXmlWriter->WriteAttributeString(nullptr, XML_3MF_TOOLPATHATTRIBUTE_Y1, nullptr, sY1.c_str()); + m_pXmlWriter->WriteAttributeString(nullptr, XML_3MF_TOOLPATHATTRIBUTE_X2, nullptr, sX2.c_str()); + m_pXmlWriter->WriteAttributeString(nullptr, XML_3MF_TOOLPATHATTRIBUTE_Y2, nullptr, sY2.c_str()); + m_pXmlWriter->WriteEndElement(); + + } + + } + + m_pXmlWriter->WriteFullEndElement(); + + } + + void CModelToolpathLayerWriteData::WriteLoop(const nfUint32 nProfileID, const nfUint32 nPartID, const nfUint32 nPointCount, const nfInt32 * pXBuffer, const nfInt32 * pYBuffer) + { + if (pXBuffer == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + if (pYBuffer == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + std::string sPath; + NMR::CChunkedBinaryStreamWriter * pStreamWriter = getStreamWriter(sPath); + + if (m_bWritingHeader) + finishHeader(); + if (!m_bWritingData) + throw CNMRException(NMR_ERROR_TOOLPATH_NOTWRITINGDATA); + + std::string sPartID = std::to_string(nPartID); + std::string sProfileID = std::to_string(nProfileID); + + m_pXmlWriter->WriteStartElement(nullptr, XML_3MF_TOOLPATHELEMENT_SEGMENT, nullptr); + m_pXmlWriter->WriteAttributeString(nullptr, XML_3MF_TOOLPATHATTRIBUTE_TYPE, nullptr, XML_3MF_TOOLPATHTYPE_LOOP); + m_pXmlWriter->WriteAttributeString(nullptr, XML_3MF_TOOLPATHATTRIBUTE_PROFILEID, nullptr, sProfileID.c_str()); + m_pXmlWriter->WriteAttributeString(nullptr, XML_3MF_TOOLPATHATTRIBUTE_PARTID, nullptr, sPartID.c_str()); + for (auto& customAttribute : m_CustomSegmentAttributes) { + std::string sNameSpace = customAttribute.first.first; + std::string sAttributeName = customAttribute.first.second; + std::string sAttributeValue = customAttribute.second; + std::string sAttributePrefix = findNameSpacePrefix(sNameSpace); + m_pXmlWriter->WriteAttributeString(sAttributePrefix.c_str(), sAttributeName.c_str(), nullptr, sAttributeValue.c_str()); + } + + if (pStreamWriter != nullptr) { + unsigned int binaryKeyX = pStreamWriter->addIntArray(pXBuffer, nPointCount, eptDeltaPredicition); + unsigned int binaryKeyY = pStreamWriter->addIntArray(pYBuffer, nPointCount, eptDeltaPredicition); + + std::string sKeyX = std::to_string(binaryKeyX); + std::string sKeyY = std::to_string(binaryKeyY); + + m_pXmlWriter->WriteStartElement(XML_3MF_NAMESPACEPREFIX_BINARY, XML_3MF_TOOLPATHELEMENT_POINT, nullptr); + m_pXmlWriter->WriteAttributeString(XML_3MF_NAMESPACEPREFIX_BINARY, XML_3MF_TOOLPATHATTRIBUTE_X1, nullptr, sKeyX.c_str()); + m_pXmlWriter->WriteAttributeString(XML_3MF_NAMESPACEPREFIX_BINARY, XML_3MF_TOOLPATHATTRIBUTE_Y1, nullptr, sKeyY.c_str()); + m_pXmlWriter->WriteEndElement(); + + } + else { + + + uint32_t nIndex; + for (nIndex = 0; nIndex < nPointCount; nIndex++) { + std::string sX = std::to_string(pXBuffer[nIndex]); + std::string sY = std::to_string(pYBuffer[nIndex]); + + m_pXmlWriter->WriteStartElement(nullptr, XML_3MF_TOOLPATHELEMENT_POINT, nullptr); + m_pXmlWriter->WriteAttributeString(nullptr, XML_3MF_TOOLPATHATTRIBUTE_X, nullptr, sX.c_str()); + m_pXmlWriter->WriteAttributeString(nullptr, XML_3MF_TOOLPATHATTRIBUTE_Y, nullptr, sY.c_str()); + m_pXmlWriter->WriteEndElement(); + } + + } + + m_pXmlWriter->WriteFullEndElement(); + + } + + void CModelToolpathLayerWriteData::WritePolyline(const nfUint32 nProfileID, const nfUint32 nPartID, const nfUint32 nPointCount, const nfInt32 * pXBuffer, const nfInt32 * pYBuffer) + { + std::string sPath; + + if (pXBuffer == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + if (pYBuffer == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + NMR::CChunkedBinaryStreamWriter * pStreamWriter = getStreamWriter(sPath); + if (m_bWritingHeader) + finishHeader(); + if (!m_bWritingData) + throw CNMRException(NMR_ERROR_TOOLPATH_NOTWRITINGDATA); + + std::string sPartID = std::to_string(nPartID); + std::string sProfileID = std::to_string(nProfileID); + + m_pXmlWriter->WriteStartElement(nullptr, XML_3MF_TOOLPATHELEMENT_SEGMENT, nullptr); + m_pXmlWriter->WriteAttributeString(nullptr, XML_3MF_TOOLPATHATTRIBUTE_TYPE, nullptr, XML_3MF_TOOLPATHTYPE_POLYLINE); + m_pXmlWriter->WriteAttributeString(nullptr, XML_3MF_TOOLPATHATTRIBUTE_PROFILEID, nullptr, sProfileID.c_str()); + m_pXmlWriter->WriteAttributeString(nullptr, XML_3MF_TOOLPATHATTRIBUTE_PARTID, nullptr, sPartID.c_str()); + for (auto& customAttribute : m_CustomSegmentAttributes) { + std::string sNameSpace = customAttribute.first.first; + std::string sAttributeName = customAttribute.first.second; + std::string sAttributeValue = customAttribute.second; + std::string sAttributePrefix = findNameSpacePrefix(sNameSpace); + m_pXmlWriter->WriteAttributeString(sAttributePrefix.c_str(), sAttributeName.c_str(), nullptr, sAttributeValue.c_str()); + } + + if (pStreamWriter != nullptr) { + + unsigned int binaryKeyX = pStreamWriter->addIntArray(pXBuffer, nPointCount, eptDeltaPredicition); + unsigned int binaryKeyY = pStreamWriter->addIntArray(pYBuffer, nPointCount, eptDeltaPredicition); + + std::string sKeyX = std::to_string(binaryKeyX); + std::string sKeyY = std::to_string(binaryKeyY); + + m_pXmlWriter->WriteStartElement(XML_3MF_NAMESPACEPREFIX_BINARY, XML_3MF_TOOLPATHELEMENT_POINT, nullptr); + m_pXmlWriter->WriteAttributeString(XML_3MF_NAMESPACEPREFIX_BINARY, XML_3MF_TOOLPATHATTRIBUTE_X1, nullptr, sKeyX.c_str()); + m_pXmlWriter->WriteAttributeString(XML_3MF_NAMESPACEPREFIX_BINARY, XML_3MF_TOOLPATHATTRIBUTE_Y1, nullptr, sKeyY.c_str()); + + m_pXmlWriter->WriteEndElement(); + + } + else { + + uint32_t nIndex; + for (nIndex = 0; nIndex < nPointCount; nIndex++) { + std::string sX = std::to_string(pXBuffer[nIndex]); + std::string sY = std::to_string(pYBuffer[nIndex]); + + m_pXmlWriter->WriteStartElement(nullptr, XML_3MF_TOOLPATHELEMENT_POINT, nullptr); + m_pXmlWriter->WriteAttributeString(nullptr, XML_3MF_TOOLPATHATTRIBUTE_X, nullptr, sX.c_str()); + m_pXmlWriter->WriteAttributeString(nullptr, XML_3MF_TOOLPATHATTRIBUTE_Y, nullptr, sY.c_str()); + m_pXmlWriter->WriteEndElement(); + } + + } + + m_pXmlWriter->WriteFullEndElement(); + + } + + void CModelToolpathLayerWriteData::writeCustomXMLDataNode(PCustomXMLNode pXMLNode, const std::string& sNameSpace) + { + if (pXMLNode.get () == nullptr) + throw CNMRException(NMR_ERROR_NOTIMPLEMENTED); + + std::string sPrefix = findNameSpacePrefix(sNameSpace); + std::string sNodeName = pXMLNode->getName (); + m_pXmlWriter->WriteStartElement(sPrefix.c_str (), sNodeName.c_str (), nullptr); + + size_t nAttributeCount = pXMLNode->getAttributeCount(); + for (size_t nAttributeIndex = 0; nAttributeIndex < nAttributeCount; nAttributeIndex++) { + auto pAttribute = pXMLNode->getAttributeByIndex(nAttributeIndex); + std::string sName = pAttribute->getName(); + std::string sValue = pAttribute->getValue(); + m_pXmlWriter->WriteAttributeString(nullptr, sName.c_str(), nullptr, sValue.c_str()); + } + + auto children = pXMLNode->getChildren(); + + for (auto child: children) { + writeCustomXMLDataNode(child, sNameSpace); + } + + m_pXmlWriter->WriteEndElement(); + } + + void CModelToolpathLayerWriteData::finishHeader() + { + std::string sPath; + + NMR::CChunkedBinaryStreamWriter * pStreamWriter = getStreamWriter(sPath); + + if (!m_bWritingHeader) + throw CNMRException(NMR_ERROR_TOOLPATH_NOTWRITINGHEADER); + + m_bWritingHeader = false; + + m_pXmlWriter->WriteStartElement(nullptr, XML_3MF_TOOLPATHELEMENT_PARTS, nullptr); + for (auto iPart : m_Parts) { + bool bHasUUID = false; + + m_pXmlWriter->WriteStartElement(nullptr, XML_3MF_TOOLPATHELEMENT_PART, nullptr); + std::string sID = std::to_string(iPart.first); + std::string sUUID = iPart.second->uuid()->toString(); + + m_pXmlWriter->WriteAttributeString(nullptr, XML_3MF_TOOLPATHATTRIBUTE_ID, nullptr, sID.c_str()); + m_pXmlWriter->WriteAttributeString(nullptr, XML_3MF_TOOLPATHATTRIBUTE_UUID, nullptr, sUUID.c_str()); + m_pXmlWriter->WriteEndElement(); + } + + m_pXmlWriter->WriteFullEndElement(); + + m_pXmlWriter->WriteStartElement(nullptr, XML_3MF_TOOLPATHELEMENT_PROFILES, nullptr); + for (auto iProfile : m_Profiles) { + m_pXmlWriter->WriteStartElement(nullptr, XML_3MF_TOOLPATHELEMENT_PROFILE, nullptr); + std::string sID = std::to_string(iProfile.first); + std::string sUUID = iProfile.second->getUUID(); + + m_pXmlWriter->WriteAttributeString(nullptr, XML_3MF_TOOLPATHATTRIBUTE_ID, nullptr, sID.c_str()); + m_pXmlWriter->WriteAttributeString(nullptr, XML_3MF_TOOLPATHATTRIBUTE_UUID, nullptr, sUUID.c_str()); + m_pXmlWriter->WriteEndElement(); + } + + m_pXmlWriter->WriteFullEndElement(); + + + m_pXmlWriter->WriteStartElement(nullptr, XML_3MF_TOOLPATHELEMENT_DATA, nullptr); + for (auto customXMLData : m_CustomXMLData) { + + writeCustomXMLDataNode (customXMLData->getRootNode(), customXMLData->getNameSpace ()); + + } + + m_pXmlWriter->WriteFullEndElement(); + + + m_pXmlWriter->WriteStartElement(nullptr, XML_3MF_TOOLPATHELEMENT_SEGMENTS, nullptr); + + if (pStreamWriter != nullptr) + m_pXmlWriter->WriteAttributeString(XML_3MF_NAMESPACEPREFIX_BINARY, XML_3MF_TOOLPATHATTRIBUTE_BINARY, nullptr, sPath.c_str()); + + m_bWritingData = true; + + + } + + + NMR::PImportStream CModelToolpathLayerWriteData::createStream() + { + if (m_bWritingHeader) + finishHeader(); + if (!m_bWritingData) + throw CNMRException(NMR_ERROR_TOOLPATH_NOTWRITINGDATA); + + m_bWritingData = false; + if (m_bWritingFinished) + throw CNMRException(NMR_ERROR_TOOLPATH_DATAHASBEENWRITTEN); + + m_bWritingFinished = true; + + m_pXmlWriter->WriteFullEndElement(); // segments + + m_pXmlWriter->WriteFullEndElement(); // layer + m_pXmlWriter->WriteEndDocument(); + m_pXmlWriter->Flush(); + + // TODO: Do not copy but use Pipe-based importexportstream! + NMR::CImportStream_Shared_Memory pImportStream(m_pExportStream->getData(), m_pExportStream->getDataSize()); + return pImportStream.copyToMemory(); + + } + + NMR::CChunkedBinaryStreamWriter * CModelToolpathLayerWriteData::getStreamWriter(std::string & sPath) + { + + return m_pModelWriter->findBinaryStream (m_sUUID, sPath); + + } + + double CModelToolpathLayerWriteData::getUnits() + { + return m_pModelToolpath->getUnitFactor(); + } + + std::string CModelToolpathLayerWriteData::getUUID() + { + return m_sUUID; + } + + void CModelToolpathLayerWriteData::finishWriting() + { + if (!m_bWritingFinished) { + PImportStream pImportStream = createStream(); + m_pModelWriter->addAdditionalAttachment (m_sPackagePath, pImportStream, PACKAGE_TOOLPATH_RELATIONSHIP_TYPE); + + } + } + + void CModelToolpathLayerWriteData::setCustomSegmentAttribute(const std::string& sNameSpace, const std::string& sAttributeName, const std::string& sValue) + { + auto key = std::make_pair(sNameSpace, sAttributeName); + + auto iIter = m_CustomSegmentAttributes.find(key); + if (iIter != m_CustomSegmentAttributes.end()) { + iIter->second = sValue; + } + else { + m_CustomSegmentAttributes.insert(std::make_pair(key, sValue)); + } + } + + void CModelToolpathLayerWriteData::clearCustomSegmentAttributes() + { + m_CustomSegmentAttributes.clear(); + } + + std::string CModelToolpathLayerWriteData::findNameSpacePrefix(const std::string& sNameSpace) + { + auto iIter = m_NameSpaceToPrefixMap.find(sNameSpace); + if (iIter == m_NameSpaceToPrefixMap.end()) + throw CNMRException(NMR_ERROR_NAMESPACENOTFOUND); + + return iIter->second; + } + +} + diff --git a/Source/Model/Classes/NMR_ModelToolpathProfile.cpp b/Source/Model/Classes/NMR_ModelToolpathProfile.cpp new file mode 100644 index 000000000..97733ad06 --- /dev/null +++ b/Source/Model/Classes/NMR_ModelToolpathProfile.cpp @@ -0,0 +1,118 @@ +/*++ + +Copyright (C) 2018 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +NMR_ModelToolpathProfile.cpp defines the Model Toolpath Profile. + +--*/ + +#include "Model/Classes/NMR_ModelToolpathProfile.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_StringUtils.h" +#include +#include + +namespace NMR { + + CModelToolpathProfile::CModelToolpathProfile(std::string sUUID, std::string sName) + : m_sUUID (sUUID), m_sName (sName) + { + + } + + std::string CModelToolpathProfile::getUUID() + { + return m_sUUID; + } + + std::string CModelToolpathProfile::getName() + { + return m_sName; + } + + void CModelToolpathProfile::setName(const std::string & sName) + { + m_sName = sName; + } + + uint32_t CModelToolpathProfile::getParameterCount() + { + return (uint32_t)m_Parameters.size(); + } + + std::string CModelToolpathProfile::getParameterName(const uint32_t nIndex) + { + if (nIndex >= m_Parameters.size()) + throw CNMRException(NMR_ERROR_INVALIDPARAMETERINDEX); + + return m_Parameters.at(nIndex).second; + } + + std::string CModelToolpathProfile::getParameterNameSpace(const uint32_t nIndex) + { + if (nIndex >= m_Parameters.size()) + throw CNMRException(NMR_ERROR_INVALIDPARAMETERINDEX); + + return m_Parameters.at(nIndex).first; + } + + bool CModelToolpathProfile::hasValue(const std::string& sNameSpace, const std::string& sValueName) + { + auto iter = m_Values.find(std::make_pair (sNameSpace, sValueName)); + return iter != m_Values.end(); + } + + std::string CModelToolpathProfile::getValue(const std::string& sNameSpace, const std::string& sValueName) + { + auto iter = m_Values.find(std::make_pair(sNameSpace, sValueName)); + if (iter == m_Values.end()) + throw CNMRException(NMR_ERROR_PROFILEVALUENOTFOUND); + + return iter->second; + } + + void CModelToolpathProfile::addValue(const std::string& sNameSpace, const std::string& sValueName, const std::string& sValue) + { + if (m_Values.size () >= MODELTOOLPATH_MAXCOUNT) + throw CNMRException(NMR_ERROR_TOOMANYPROFILEVALUES); + m_Values.insert(std::make_pair (std::make_pair (sNameSpace, sValueName), sValue)); + m_Parameters.push_back(std::make_pair(sNameSpace, sValueName)); + } + + std::list CModelToolpathProfile::listValues() + { + std::list profileValueList; + for (auto profileValue : m_Values) { + profileValueList.push_back(sModelToolpathProfileValue { profileValue.first.first, profileValue.first.second, profileValue.second }); + } + + return profileValueList; + + } + + +} diff --git a/Source/Model/Reader/NMR_KeyStoreOpcPackageReader.cpp b/Source/Model/Reader/NMR_KeyStoreOpcPackageReader.cpp index 7963cd20c..bce343729 100644 --- a/Source/Model/Reader/NMR_KeyStoreOpcPackageReader.cpp +++ b/Source/Model/Reader/NMR_KeyStoreOpcPackageReader.cpp @@ -53,7 +53,7 @@ NMR_KeyStoreOpcPackageReader.cpp defines an OPC Package reader in a portable way #include namespace NMR { - CKeyStoreOpcPackageReader::CKeyStoreOpcPackageReader(PImportStream pImportStream, CModelContext const & context) + CKeyStoreOpcPackageReader::CKeyStoreOpcPackageReader (PImportStream pImportStream, CModelContext const & context) :m_pContext(context) { if (!context.isComplete()) @@ -187,17 +187,27 @@ namespace NMR { } } void CKeyStoreOpcPackageReader::checkAuthenticatedTags() { - auto secureContext = m_pContext.secureContext(); - auto keyStore = m_pContext.keyStore(); - if (secureContext->hasDekCtx()) { - for (nfUint64 i = 0; i < m_pContext.keyStore()->getResourceDataCount(); ++i) { - NMR::PKeyStoreResourceData rd = keyStore->getResourceData(i); - NMR::PKeyStoreResourceDataGroup rdg = keyStore->findResourceDataGroupByResourceDataPath(rd->packagePath()); - PKeyStoreContentEncryptionParams params = CKeyStoreFactory::makeContentEncryptionParams(rd, rdg); - ContentEncryptionDescriptor descriptor = secureContext->getDekCtx(); - descriptor.m_sDekDecryptData.m_sParams= params; - descriptor.m_fnCrypt(0, nullptr, nullptr, descriptor.m_sDekDecryptData); + + if (m_pContext.isComplete()) { + + auto secureContext = m_pContext.secureContext(); + auto keyStore = m_pContext.keyStore(); + if (secureContext->hasDekCtx()) { + for (nfUint64 i = 0; i < m_pContext.keyStore()->getResourceDataCount(); ++i) { + NMR::PKeyStoreResourceData rd = keyStore->getResourceData(i); + NMR::PKeyStoreResourceDataGroup rdg = keyStore->findResourceDataGroupByResourceDataPath(rd->packagePath()); + PKeyStoreContentEncryptionParams params = CKeyStoreFactory::makeContentEncryptionParams(rd, rdg); + ContentEncryptionDescriptor descriptor = secureContext->getDekCtx(); + descriptor.m_sDekDecryptData.m_sParams = params; + descriptor.m_fnCrypt(0, nullptr, nullptr, descriptor.m_sDekDecryptData); + } } } } + + PImportStream CKeyStoreOpcPackageReader::readPartStreamIntoMemory(_In_ std::string sPath) + { + throw CNMRException(NMR_ERROR_NOTIMPLEMENTED); + } + } diff --git a/Source/Model/Reader/NMR_ModelPersistentDataSource.cpp b/Source/Model/Reader/NMR_ModelPersistentDataSource.cpp new file mode 100644 index 000000000..6c35e7148 --- /dev/null +++ b/Source/Model/Reader/NMR_ModelPersistentDataSource.cpp @@ -0,0 +1,95 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--*/ + +#include "Model/Reader/NMR_ModelPersistentDataSource.h" + +#include "Common/NMR_Exception.h" +#include "Common/NMR_Exception_Windows.h" + +namespace NMR { + + CModelPersistentDataSource::CModelPersistentDataSource(PImportStream pImportStream) + : m_pImportStream (pImportStream) + { + + if (pImportStream.get() == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + } + + + CModelPersistentDataSource::~CModelPersistentDataSource() + { + invalidateSource(); + } + + + PImportStream CModelPersistentDataSource::getImportStream() + { + if (m_pImportStream.get() == nullptr) + throw CNMRException(NMR_ERROR_DATASOURCEISINVALIDATED); + + return m_pImportStream; + } + + PIOpcPackageReader CModelPersistentDataSource::getOpcPackageReader() + { + if (m_pPackageReader.get() == nullptr) + throw CNMRException(NMR_ERROR_DATASOURCEISINVALIDATED); + + return m_pPackageReader; + + } + + void CModelPersistentDataSource::setOPCPackageReader(PIOpcPackageReader pPackageReader) + { + releaseOPCPackageReader(); + + m_pPackageReader = pPackageReader; + } + + void CModelPersistentDataSource::releaseOPCPackageReader() + { + if (m_pPackageReader.get() != nullptr) + m_pPackageReader->close(); + + m_pPackageReader = nullptr; + } + + + bool CModelPersistentDataSource::isValid() + { + return (m_pImportStream.get() != nullptr); + } + + void CModelPersistentDataSource::invalidateSource() + { + releaseOPCPackageReader(); + m_pImportStream = nullptr; + } + +} diff --git a/Source/Model/Reader/NMR_ModelReader_3MF.cpp b/Source/Model/Reader/NMR_ModelReader_3MF.cpp index c7010ec5d..9a6b3f69a 100644 --- a/Source/Model/Reader/NMR_ModelReader_3MF.cpp +++ b/Source/Model/Reader/NMR_ModelReader_3MF.cpp @@ -115,10 +115,10 @@ namespace NMR { } } - - void CModelReader_3MF::readStream(_In_ PImportStream pStream) + void CModelReader_3MF::readFromSource(_In_ PModelPersistentDataSource pDataSource) { - __NMRASSERT(pStream != nullptr); + if (pDataSource.get() == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); nfBool bHasModel = false; @@ -127,7 +127,7 @@ namespace NMR { monitor()->SetProgressIdentifier(ProgressIdentifier::PROGRESS_EXTRACTOPCPACKAGE); // Extract Stream from Package - PImportStream pModelStream = extract3MFOPCPackage(pStream); + PImportStream pModelStream = extract3MFOPCPackage(pDataSource); // before reading the root model, read the other models in the file readProductionAttachmentModels(model(), warnings(), monitor()); diff --git a/Source/Model/Reader/NMR_ModelReader_3MF_Native.cpp b/Source/Model/Reader/NMR_ModelReader_3MF_Native.cpp index b531a5d2b..c560f2c29 100644 --- a/Source/Model/Reader/NMR_ModelReader_3MF_Native.cpp +++ b/Source/Model/Reader/NMR_ModelReader_3MF_Native.cpp @@ -37,6 +37,7 @@ It uses libzip and irrxml to parse the OPC package. #include "Model/Classes/NMR_ModelConstants.h" #include "Model/Classes/NMR_ModelAttachment.h" #include "Model/Classes/NMR_KeyStore.h" +#include "Common/OPC/NMR_OpcPackageReader.h" #include "Common/NMR_SecureContext.h" #include "Common/NMR_Exception.h" #include "Common/NMR_Exception_Windows.h" @@ -54,16 +55,24 @@ namespace NMR { - PImportStream CModelReader_3MF_Native::extract3MFOPCPackage(_In_ PImportStream pPackageStream) + PImportStream CModelReader_3MF_Native::extract3MFOPCPackage(PModelPersistentDataSource pDataSource) { - m_pPackageReader = std::make_shared(pPackageStream, *this); + if (pDataSource.get () == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + m_pDataSource = pDataSource; + + model()->setPersistentDataSource(pDataSource); + pDataSource->setOPCPackageReader(std::make_shared(pDataSource->getImportStream (), warnings(), monitor())); + + auto pPackageReader = pDataSource->getOpcPackageReader(); - COpcPackageRelationship * pModelRelation = m_pPackageReader->findRootRelation(PACKAGE_START_PART_RELATIONSHIP_TYPE, true); + COpcPackageRelationship * pModelRelation = pPackageReader->findRootRelation(PACKAGE_START_PART_RELATIONSHIP_TYPE, true); if (pModelRelation == nullptr) throw CNMRException(NMR_ERROR_OPCRELATIONSHIPSETREADFAILED); std::string sTargetPartURI = pModelRelation->getTargetPartURI(); - POpcPackagePart pModelPart = m_pPackageReader->createPart(sTargetPartURI); + POpcPackagePart pModelPart = pPackageReader->createPart(sTargetPartURI); if (pModelPart == nullptr) throw CNMRException(NMR_ERROR_OPCCOULDNOTGETMODELSTREAM); @@ -81,15 +90,15 @@ namespace NMR { { PModelAttachment pProdAttachment = model()->getProductionModelAttachment(i); std::string pathURI = pProdAttachment->getPathURI(); - POpcPackagePart pSubModelPart = m_pPackageReader->createPart(pathURI); + POpcPackagePart pSubModelPart = pPackageReader->createPart(pathURI); extractModelDataFromRelationships(sTargetPartURIDir, pSubModelPart.get()); extractTexturesFromRelationships(sTargetPartURIDir, pSubModelPart.get()); } - COpcPackageRelationship * pThumbnailRelation = m_pPackageReader->findRootRelation(PACKAGE_THUMBNAIL_RELATIONSHIP_TYPE, true); + COpcPackageRelationship * pThumbnailRelation = pPackageReader->findRootRelation(PACKAGE_THUMBNAIL_RELATIONSHIP_TYPE, true); if (pThumbnailRelation != nullptr) { std::string sTargetPartURI = pThumbnailRelation->getTargetPartURI(); - POpcPackagePart pThumbnailPart = m_pPackageReader->createPart(sTargetPartURI); + POpcPackagePart pThumbnailPart = pPackageReader->createPart(sTargetPartURI); if (pThumbnailPart == nullptr) throw CNMRException(NMR_ERROR_OPCCOULDNOTGETTHUMBNAILSTREAM); PImportStream pThumbnailStream = pThumbnailPart->getImportStream()->copyToMemory(); @@ -103,9 +112,7 @@ namespace NMR { void CModelReader_3MF_Native::release3MFOPCPackage() { - //foreach part, finalize encryption contexts - m_pPackageReader->close(); - m_pPackageReader = nullptr; + } void CModelReader_3MF_Native::extractTexturesFromRelationships(_In_ std::string& sTargetPartURIDir, _In_ COpcPackagePart * pModelPart) @@ -113,6 +120,8 @@ namespace NMR { if (pModelPart == nullptr) throw CNMRException(NMR_ERROR_INVALIDPARAM); + auto pPackageReader = m_pDataSource->getOpcPackageReader(); + monitor()->SetProgressIdentifier(PROGRESS_READTEXTURETACHMENTS); std::multimap& RelationShips = pModelPart->getRelationShips(); @@ -134,7 +143,7 @@ namespace NMR { PModelAttachment pModelAttachment = model()->findModelAttachment(sURI); if (!pModelAttachment) { - POpcPackagePart pTexturePart = m_pPackageReader->createPart(sURI); + POpcPackagePart pTexturePart = pPackageReader->createPart(sURI); PImportStream pTextureAttachmentStream = pTexturePart->getImportStream(); PImportStream pMemoryStream = pTextureAttachmentStream->copyToMemory(); @@ -157,6 +166,8 @@ namespace NMR { if (pModelPart == nullptr) throw CNMRException(NMR_ERROR_INVALIDPARAM); + auto pPackageReader = m_pDataSource->getOpcPackageReader(); + monitor()->SetProgressIdentifier(PROGRESS_READCUSTOMATTACHMENTS); std::multimap& RelationShips = pModelPart->getRelationShips(); @@ -172,7 +183,7 @@ namespace NMR { auto iRelationIterator = m_RelationsToRead.find(sRelationShipType); if (iRelationIterator != m_RelationsToRead.end()) { - POpcPackagePart pPart = m_pPackageReader->createPart(sURI); + POpcPackagePart pPart = pPackageReader->createPart(sURI); PImportStream pAttachmentStream = pPart->getImportStream(); try { PImportStream pMemoryStream = pAttachmentStream->copyToMemory(); @@ -198,7 +209,7 @@ namespace NMR { && (sRelationShipType != PACKAGE_TEXTURE_RELATIONSHIP_TYPE) && (sRelationShipType != PACKAGE_THUMBNAIL_RELATIONSHIP_TYPE) ) { - monitor()->DecreaseMaxProgress((double)m_pPackageReader->getPartSize(sURI)); + monitor()->DecreaseMaxProgress((double)pPackageReader->getPartSize(sURI)); monitor()->ReportProgressAndQueryCancelled(true); } } @@ -210,6 +221,8 @@ namespace NMR { if (pModelPart == nullptr) throw CNMRException(NMR_ERROR_INVALIDPARAM); + auto pPackageReader = m_pDataSource->getOpcPackageReader(); + std::multimap& RelationShips = pModelPart->getRelationShips(); for (auto iIterator = RelationShips.begin(); iIterator != RelationShips.end(); iIterator++) { @@ -222,7 +235,7 @@ namespace NMR { if (!fnStartsWithPathDelimiter(sURI)) sURI = sTargetPartURIDir + sURI; - POpcPackagePart pPart = m_pPackageReader->createPart(sURI); + POpcPackagePart pPart = pPackageReader->createPart(sURI); // first, check if this attachment already is in model PModelAttachment pModelAttachment = model()->findProductionModelAttachment(sURI); diff --git a/Source/Model/Reader/NMR_ModelReader_STL.cpp b/Source/Model/Reader/NMR_ModelReader_STL.cpp index 31478dac6..3f895bdd0 100644 --- a/Source/Model/Reader/NMR_ModelReader_STL.cpp +++ b/Source/Model/Reader/NMR_ModelReader_STL.cpp @@ -45,11 +45,13 @@ namespace NMR { // empty on purpose } - void CModelReader_STL::readStream(_In_ PImportStream pStream) + void CModelReader_STL::readFromSource(_In_ PModelPersistentDataSource pDataSource) { - if (pStream.get() == nullptr) + if (pDataSource.get() == nullptr) throw CNMRException(NMR_ERROR_INVALIDPARAM); + auto pStream = pDataSource->getImportStream(); + // Create STL Importer PMeshImporter pImporter = std::make_shared(pStream); diff --git a/Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathData.cpp b/Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathData.cpp new file mode 100644 index 000000000..31b9c659f --- /dev/null +++ b/Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathData.cpp @@ -0,0 +1,94 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +NMR_ModelReaderNode_Toolpath1905_ToolpathProfiles.h covers the official 3MF Toolpath extension. + + +--*/ + +#include "Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathData.h" +#include "Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathDataNode.h" + +#include "Model/Classes/NMR_ModelConstants.h" +#include "Model/Classes/NMR_CustomXMLTree.h" + +#include "Common/NMR_Exception.h" +#include "Common/NMR_Exception_Windows.h" +#include "Common/NMR_StringUtils.h" +#include +#include + +namespace NMR { + + CModelReaderNode_Toolpath1905_ToolpathData::CModelReaderNode_Toolpath1905_ToolpathData(_In_ CModel * pModel, _In_ CModelToolpath * pToolpath, _In_ PModelWarnings pWarnings) + : CModelReaderNode(pWarnings), m_pToolpath (pToolpath), m_pModel(pModel) + { + if (pToolpath == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + } + + void CModelReaderNode_Toolpath1905_ToolpathData::parseXML(_In_ CXmlReader * pXMLReader) + { + // Parse name + parseName(pXMLReader); + + // Parse attribute + parseAttributes(pXMLReader); + + // Parse Content + parseContent(pXMLReader); + + } + + + void CModelReaderNode_Toolpath1905_ToolpathData::OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue) + { + } + + void CModelReaderNode_Toolpath1905_ToolpathData::OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace) + { + } + + void CModelReaderNode_Toolpath1905_ToolpathData::OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader) + { + + std::string sNameSpace = pNameSpace; + PCustomXMLTree pCustomXMLTree = std::make_shared(sNameSpace, pChildName); + + PModelReaderNode_Toolpath1905_ToolpathDataNode pXMLReaderNode = std::make_shared(m_pModel, m_pToolpath, m_pWarnings, sNameSpace, pCustomXMLTree->getRootNode()); + pXMLReaderNode->parseXML(pXMLReader); + + m_pToolpath->addCustomXMLData(pCustomXMLTree); + + } + + + + +} + diff --git a/Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathDataNode.cpp b/Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathDataNode.cpp new file mode 100644 index 000000000..08cd7b6ed --- /dev/null +++ b/Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathDataNode.cpp @@ -0,0 +1,102 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +NMR_ModelReaderNode_Toolpath1905_ToolpathProfiles.h covers the official 3MF Toolpath extension. + + +--*/ + +#include "Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathData.h" +#include "Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathDataNode.h" + +#include "Model/Classes/NMR_ModelConstants.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_Exception_Windows.h" +#include "Common/NMR_StringUtils.h" +#include +#include + +namespace NMR { + + CModelReaderNode_Toolpath1905_ToolpathDataNode::CModelReaderNode_Toolpath1905_ToolpathDataNode(_In_ CModel * pModel, _In_ CModelToolpath * pToolpath, _In_ PModelWarnings pWarnings, const std::string& sNameSpace, PCustomXMLNode pXMLNode) + : CModelReaderNode(pWarnings), m_pToolpath (pToolpath), m_pModel(pModel), m_sNameSpace(sNameSpace), m_pXMLNode(pXMLNode) + { + if (pToolpath == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + if (pXMLNode == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + } + + void CModelReaderNode_Toolpath1905_ToolpathDataNode::parseXML(_In_ CXmlReader * pXMLReader) + { + // Parse name + parseName(pXMLReader); + + // Parse attribute + parseAttributes(pXMLReader); + + // Parse Content + parseContent(pXMLReader); + + } + + + void CModelReaderNode_Toolpath1905_ToolpathDataNode::OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue) + { + __NMRASSERT(pAttributeName); + __NMRASSERT(pAttributeValue); + + m_pXMLNode->addAttribute(pAttributeName, pAttributeValue); + } + + void CModelReaderNode_Toolpath1905_ToolpathDataNode::OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace) + { + std::string sAttributeNameSpace = pNameSpace; + if (m_sNameSpace == sAttributeNameSpace) + m_pXMLNode->addAttribute(pAttributeName, pAttributeValue); + } + + void CModelReaderNode_Toolpath1905_ToolpathDataNode::OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader) + { + std::string sChildNameSpace = pNameSpace; + if (m_sNameSpace == sChildNameSpace) { + + auto pSubNode = m_pXMLNode->addChild(pChildName); + PModelReaderNode_Toolpath1905_ToolpathDataNode pXMLReaderNode = std::make_shared(m_pModel, m_pToolpath, m_pWarnings, m_sNameSpace, pSubNode); + pXMLReaderNode->parseXML(pXMLReader); + + } + + + } + + + + +} + diff --git a/Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathLayer.cpp b/Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathLayer.cpp new file mode 100644 index 000000000..eee1f3e3e --- /dev/null +++ b/Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathLayer.cpp @@ -0,0 +1,117 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +NMR_ModelReaderNode_Toolpath1905_ToolpathLayer.h covers the official 3MF Toolpath extension. + + +--*/ + +#include "Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathLayer.h" + +#include "Model/Classes/NMR_ModelConstants.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_Exception_Windows.h" +#include "Common/NMR_StringUtils.h" +#include +#include + +namespace NMR { + + CModelReaderNode_Toolpath1905_ToolpathLayer::CModelReaderNode_Toolpath1905_ToolpathLayer (_In_ CModel * pModel, _In_ PModelWarnings pWarnings) + : CModelReaderNode(pWarnings), + m_bHasPath (false), + m_bHasZTop (false), + m_nZTop (0), + m_pModel(pModel) + + { + } + + void CModelReaderNode_Toolpath1905_ToolpathLayer::parseXML(_In_ CXmlReader * pXMLReader) + { + // Parse name + parseName(pXMLReader); + + // Parse attribute + parseAttributes(pXMLReader); + + // Parse Content + parseContent(pXMLReader); + + } + + + void CModelReaderNode_Toolpath1905_ToolpathLayer::OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue) + { + if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_TOOLPATHLAYER_PATH) == 0) { + if (m_bHasPath) + throw CNMRException(NMR_ERROR_DUPLICATEVALUE); + + // Convert to integer and make a input and range check! + m_sPath = pAttributeValue; + m_bHasPath = true; + } + + if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_TOOLPATHLAYER_ZTOP) == 0) { + if (m_bHasZTop) + throw CNMRException(NMR_ERROR_DUPLICATEVALUE); + + // Convert to integer and make a input and range check! + m_nZTop = fnStringToUint32(pAttributeValue); + m_bHasZTop = true; + } + + } + + void CModelReaderNode_Toolpath1905_ToolpathLayer::OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace) + { + + + } + + void CModelReaderNode_Toolpath1905_ToolpathLayer::OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader) + { + + } + + void CModelReaderNode_Toolpath1905_ToolpathLayer::createLayer(CModelToolpath * pToolpath) + { + __NMRASSERT(pToolpath); + + if (!m_bHasPath) + throw CNMRException(NMR_ERROR_MISSINGPATH); + if (!m_bHasZTop) + throw CNMRException(NMR_ERROR_MISSINGZTOP); + + + pToolpath->addLayer(m_sPath, m_nZTop); + } + + +} + diff --git a/Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathLayers.cpp b/Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathLayers.cpp new file mode 100644 index 000000000..a239e9925 --- /dev/null +++ b/Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathLayers.cpp @@ -0,0 +1,95 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +NMR_ModelReaderNode_Toolpath1905_ToolpathLayers.h covers the official 3MF Toolpath extension. + + +--*/ + +#include "Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathLayers.h" +#include "Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathLayer.h" + +#include "Model/Classes/NMR_ModelConstants.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_Exception_Windows.h" +#include "Common/NMR_StringUtils.h" +#include +#include + +namespace NMR { + + CModelReaderNode_Toolpath1905_ToolpathLayers::CModelReaderNode_Toolpath1905_ToolpathLayers (_In_ CModel * pModel, _In_ CModelToolpath * pToolpath, _In_ PModelWarnings pWarnings) + : CModelReaderNode(pWarnings), m_pToolpath (pToolpath), m_pModel(pModel) + { + if (pToolpath == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + } + + void CModelReaderNode_Toolpath1905_ToolpathLayers::parseXML(_In_ CXmlReader * pXMLReader) + { + // Parse name + parseName(pXMLReader); + + // Parse attribute + parseAttributes(pXMLReader); + + // Parse Content + parseContent(pXMLReader); + + } + + + void CModelReaderNode_Toolpath1905_ToolpathLayers::OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue) + { + } + + void CModelReaderNode_Toolpath1905_ToolpathLayers::OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace) + { + } + + void CModelReaderNode_Toolpath1905_ToolpathLayers::OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader) + { + + if (strcmp(pNameSpace, XML_3MF_NAMESPACE_TOOLPATHSPEC) == 0) { + if (strcmp(pChildName, XML_3MF_ELEMENT_TOOLPATHLAYER) == 0) { + + PModelReaderNode_Toolpath1905_ToolpathLayer pXMLNode = std::make_shared( + m_pModel, m_pWarnings); + pXMLNode->parseXML(pXMLReader); + + pXMLNode->createLayer(m_pToolpath); + } + else + m_pWarnings->addException(CNMRException(NMR_ERROR_NAMESPACE_INVALID_ELEMENT), mrwInvalidOptionalValue); + } + + } + + +} + diff --git a/Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathProfile.cpp b/Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathProfile.cpp new file mode 100644 index 000000000..968769656 --- /dev/null +++ b/Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathProfile.cpp @@ -0,0 +1,128 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +NMR_ModelReaderNode_Toolpath1905_ToolpathProfile.h covers the official 3MF Toolpath extension. + + +--*/ + +#include "Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathProfile.h" + +#include "Model/Classes/NMR_ModelConstants.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_Exception_Windows.h" +#include "Common/NMR_StringUtils.h" +#include +#include + +namespace NMR { + + CModelReaderNode_Toolpath1905_ToolpathProfile::CModelReaderNode_Toolpath1905_ToolpathProfile (_In_ CModel * pModel, _In_ PModelWarnings pWarnings) + : CModelReaderNode(pWarnings), + m_bHasUUID (false), + m_bHasName (false), + m_pModel(pModel) + + { + } + + void CModelReaderNode_Toolpath1905_ToolpathProfile::parseXML(_In_ CXmlReader * pXMLReader) + { + // Parse name + parseName(pXMLReader); + + // Parse attribute + parseAttributes(pXMLReader); + + // Parse Content + parseContent(pXMLReader); + + } + + + void CModelReaderNode_Toolpath1905_ToolpathProfile::OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue) + { + + __NMRASSERT(pAttributeName); + __NMRASSERT(pAttributeValue); + + + if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_TOOLPATHPROFILE_UUID) == 0) { + if (m_bHasUUID) + throw CNMRException(NMR_ERROR_DUPLICATEUUID); + + // Convert to integer and make a input and range check! + m_sUUID = pAttributeValue; + m_bHasUUID = true; + } + + if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_TOOLPATHPROFILE_NAME) == 0) { + if (m_bHasName) + throw CNMRException(NMR_ERROR_DUPLICATEVALUE); + + // Convert to integer and make a input and range check! + m_sName = pAttributeValue; + m_bHasName = true; + } + else { + m_Parameters.insert(std::make_pair (std::make_pair ("", pAttributeName), pAttributeValue)); + } + + } + + void CModelReaderNode_Toolpath1905_ToolpathProfile::OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace) + { + __NMRASSERT(pNameSpace); + __NMRASSERT(pAttributeName); + __NMRASSERT(pAttributeValue); + m_Parameters.insert(std::make_pair(std::make_pair(pNameSpace, pAttributeName), pAttributeValue)); + } + + void CModelReaderNode_Toolpath1905_ToolpathProfile::OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader) + { + } + + void CModelReaderNode_Toolpath1905_ToolpathProfile::createProfile(CModelToolpath * pToolpath) + { + __NMRASSERT(pToolpath); + + if (!m_bHasUUID) + throw CNMRException(NMR_ERROR_MISSINGUUID); + if (!m_bHasName) + throw CNMRException(NMR_ERROR_MISSINGNAME); + + auto pProfile = pToolpath->addExistingProfile(m_sUUID, m_sName); + + for (auto iter : m_Parameters) { + pProfile->addValue(iter.first.first, iter.first.second, iter.second); + } + + } + +} + diff --git a/Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathProfiles.cpp b/Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathProfiles.cpp new file mode 100644 index 000000000..1197575ad --- /dev/null +++ b/Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathProfiles.cpp @@ -0,0 +1,97 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +NMR_ModelReaderNode_Toolpath1905_ToolpathProfiles.h covers the official 3MF Toolpath extension. + + +--*/ + +#include "Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathProfiles.h" +#include "Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathProfile.h" + +#include "Model/Classes/NMR_ModelConstants.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_Exception_Windows.h" +#include "Common/NMR_StringUtils.h" +#include +#include + +namespace NMR { + + CModelReaderNode_Toolpath1905_ToolpathProfiles::CModelReaderNode_Toolpath1905_ToolpathProfiles(_In_ CModel * pModel, _In_ CModelToolpath * pToolpath, _In_ PModelWarnings pWarnings) + : CModelReaderNode(pWarnings), m_pToolpath (pToolpath), m_pModel(pModel) + { + if (pToolpath == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + } + + void CModelReaderNode_Toolpath1905_ToolpathProfiles::parseXML(_In_ CXmlReader * pXMLReader) + { + // Parse name + parseName(pXMLReader); + + // Parse attribute + parseAttributes(pXMLReader); + + // Parse Content + parseContent(pXMLReader); + + } + + + void CModelReaderNode_Toolpath1905_ToolpathProfiles::OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue) + { + } + + void CModelReaderNode_Toolpath1905_ToolpathProfiles::OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace) + { + } + + void CModelReaderNode_Toolpath1905_ToolpathProfiles::OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader) + { + + if (strcmp(pNameSpace, XML_3MF_NAMESPACE_TOOLPATHSPEC) == 0) { + if (strcmp(pChildName, XML_3MF_ELEMENT_TOOLPATHPROFILE) == 0) { + + PModelReaderNode_Toolpath1905_ToolpathProfile pXMLNode = std::make_shared( + m_pModel, m_pWarnings); + pXMLNode->parseXML(pXMLReader); + + pXMLNode->createProfile(m_pToolpath); + } + else + m_pWarnings->addException(CNMRException(NMR_ERROR_NAMESPACE_INVALID_ELEMENT), mrwInvalidOptionalValue); + } + + } + + + + +} + diff --git a/Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathResource.cpp b/Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathResource.cpp new file mode 100644 index 000000000..51e47d870 --- /dev/null +++ b/Source/Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathResource.cpp @@ -0,0 +1,139 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +NMR_ModelReaderNode_Toolpath1905_ToolpathResource.h covers the official 3MF Toolpath extension. + + +--*/ + +#include "Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathResource.h" +#include "Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathProfiles.h" +#include "Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathLayers.h" +#include "Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathData.h" + +#include "Model/Classes/NMR_ModelConstants.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_Exception_Windows.h" +#include "Common/NMR_StringUtils.h" +#include +#include + +namespace NMR { + + CModelReaderNode_Toolpath1905_ToolpathResource::CModelReaderNode_Toolpath1905_ToolpathResource (_In_ CModel * pModel, _In_ PModelWarnings pWarnings) + : CModelReaderNode(pWarnings), m_nID (0), m_bHasID (false), m_dUnitFactor(1.0), m_bHasUnitFactor (false), m_pModel (pModel) + { + } + + void CModelReaderNode_Toolpath1905_ToolpathResource::parseXML(_In_ CXmlReader * pXMLReader) + { + // Parse name + parseName(pXMLReader); + + // Parse attribute + parseAttributes(pXMLReader); + + if (!m_bHasID) + throw CNMRException(NMR_ERROR_MISSINGMODELRESOURCEID); + if (!m_bHasUnitFactor) + throw CNMRException(NMR_ERROR_MISSINGUNITFACTOR); + + m_pToolpath = std::make_shared (m_nID, m_pModel, m_dUnitFactor); + m_pModel->addResource(m_pToolpath); + + // Parse Content + parseContent(pXMLReader); + + + } + + + void CModelReaderNode_Toolpath1905_ToolpathResource::OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue) + { + + __NMRASSERT(pAttributeName); + __NMRASSERT(pAttributeValue); + + + if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_TOOLPATH_ID) == 0) { + if (m_bHasID) + throw CNMRException(NMR_ERROR_DUPLICATERESOURCEID); + + // Convert to integer and make a input and range check! + m_nID = fnStringToUint32(pAttributeValue); + m_bHasID = true; + } + + if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_TOOLPATH_UNITFACTOR) == 0) { + if (m_bHasUnitFactor) + throw CNMRException(NMR_ERROR_DUPLICATEVALUE); + + m_dUnitFactor = strtod(pAttributeValue, nullptr); + if (std::isnan(m_dUnitFactor)) + throw CNMRException(NMR_ERROR_INVALIDMODELCOORDINATES); + if (fabs(m_dUnitFactor) > XML_3MF_MAXIMUMCOORDINATEVALUE) + throw CNMRException(NMR_ERROR_INVALIDUNITS); + m_bHasUnitFactor = true; + } + + } + + + void CModelReaderNode_Toolpath1905_ToolpathResource::OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader) + { + + if (strcmp(pNameSpace, XML_3MF_NAMESPACE_TOOLPATHSPEC) == 0) { + if (strcmp(pChildName, XML_3MF_ELEMENT_TOOLPATHPROFILES) == 0) { + + PModelReaderNode_Toolpath1905_ToolpathProfiles pXMLNode = std::make_shared( + m_pModel, m_pToolpath.get(), m_pWarnings); + pXMLNode->parseXML(pXMLReader); + + + } + else if (strcmp(pChildName, XML_3MF_ELEMENT_TOOLPATHLAYERS) == 0) { + + PModelReaderNode pXMLNode = std::make_shared( + m_pModel, m_pToolpath.get(), m_pWarnings); + pXMLNode->parseXML(pXMLReader); + } + else if (strcmp(pChildName, XML_3MF_ELEMENT_TOOLPATHDATA) == 0) { + + PModelReaderNode pXMLNode = std::make_shared( + m_pModel, m_pToolpath.get(), m_pWarnings); + pXMLNode->parseXML(pXMLReader); + } + else + m_pWarnings->addException(CNMRException(NMR_ERROR_NAMESPACE_INVALID_ELEMENT), mrwInvalidOptionalValue); + } + + } + + +} + diff --git a/Source/Model/Reader/v100/NMR_ModelReaderNode100_Resources.cpp b/Source/Model/Reader/v100/NMR_ModelReaderNode100_Resources.cpp index fa23352de..7425b2e9a 100644 --- a/Source/Model/Reader/v100/NMR_ModelReaderNode100_Resources.cpp +++ b/Source/Model/Reader/v100/NMR_ModelReaderNode100_Resources.cpp @@ -40,6 +40,7 @@ XML Model Stream. #include "Model/Reader/v100/NMR_ModelReaderNode100_CompositeMaterials.h" #include "Model/Reader/v100/NMR_ModelReaderNode100_MultiProperties.h" #include "Model/Reader/Slice1507/NMR_ModelReader_Slice1507_SliceStack.h" +#include "Model/Reader/Toolpath1905/NMR_ModelReader_Toolpath1905_ToolpathResource.h" #include "Model/Classes/NMR_ModelConstants.h" #include "Common/NMR_StringUtils.h" @@ -142,6 +143,21 @@ namespace NMR { } + if (strcmp(pNameSpace, XML_3MF_NAMESPACE_TOOLPATHSPEC) == 0) { + if (strcmp(pChildName, XML_3MF_ELEMENT_TOOLPATHRESOURCE) == 0) { + + m_pProgressMonitor->SetProgressIdentifier(ProgressIdentifier::PROGRESS_READRESOURCES); + m_pProgressMonitor->ReportProgressAndQueryCancelled(true); + + + PModelReaderNode pXMLNode = std::make_shared( + m_pModel, m_pWarnings); + pXMLNode->parseXML(pXMLReader); + } + else + m_pWarnings->addException(CNMRException(NMR_ERROR_NAMESPACE_INVALID_ELEMENT), mrwInvalidOptionalValue); + } + } diff --git a/Source/Model/ToolpathReader/NMR_ToolpathReader.cpp b/Source/Model/ToolpathReader/NMR_ToolpathReader.cpp new file mode 100644 index 000000000..af26863f4 --- /dev/null +++ b/Source/Model/ToolpathReader/NMR_ToolpathReader.cpp @@ -0,0 +1,121 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Abstract: + +NMR_ToolpathReader.cpp implements the Toolpath Reader Class. + +--*/ + +#include "Model/ToolpathReader/NMR_ToolpathReader.h" +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_Layer.h" + +#include "Common/NMR_StringUtils.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_Exception_Windows.h" +#include "Common/MeshImport/NMR_MeshImporter_STL.h" +#include "Common/Platform/NMR_Platform.h" +#include "Model/Classes/NMR_ModelAttachment.h" +#include "Model/Reader/NMR_ModelReader_InstructionElement.h" +#include "Model/Classes/NMR_ModelConstants.h" + + +#include "Common/3MF_ProgressMonitor.h" + +namespace NMR { + + CToolpathReader::CToolpathReader(PModelToolpath pModelToolpath, _In_ nfBool bAllowBinaryStreams) + : m_bAllowBinaryStreams (bAllowBinaryStreams) + { + if (!pModelToolpath.get()) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + m_pProgressMonitor = std::make_shared(); + m_pWarnings = std::make_shared(); + + m_pReadData = std::make_shared (pModelToolpath); + } + + + void CToolpathReader::readStream(_In_ PImportStream pStream) + { + __NMRASSERT(pStream != nullptr); + + nfBool bHasModel = false; + + pStream->seekPosition(0, true); + + // Create XML Reader + PXmlReader pXMLReader = fnCreateXMLReaderInstance(pStream, m_pProgressMonitor); + + eXmlReaderNodeType NodeType; + // Read all XML Root Nodes + while (!pXMLReader->IsEOF()) { + if (!pXMLReader->Read(NodeType)) + break; + + // Get Node Name + LPCSTR pszLocalName = nullptr; + pXMLReader->GetLocalName(&pszLocalName, nullptr); + if (!pszLocalName) + throw CNMRException(NMR_ERROR_COULDNOTGETLOCALXMLNAME); + + if (strcmp(pszLocalName, XML_3MF_ATTRIBUTE_PREFIX_XML) == 0) { + PModelReader_InstructionElement pXMLNode = std::make_shared(m_pWarnings); + pXMLNode->parseXML(pXMLReader.get()); + } + + // Compare with Model Node Name + if (strcmp(pszLocalName, XML_3MF_ELEMENT_LAYER) == 0) { + if (bHasModel) + throw CNMRException(NMR_ERROR_DUPLICATEMODELNODE); + bHasModel = true; + + PToolpathReaderNode_Layer pXMLNode = std::make_shared(m_pWarnings, m_pProgressMonitor, m_pReadData.get ()); + //pXMLNode->setBinaryStreamCollection(m_pBinaryStreamCollection); + + pXMLNode->parseXML(pXMLReader.get()); + + //if (!pXMLNode->getHasResources()) + //throw CNMRException(NMR_ERROR_NORESOURCES); + //if (!pXMLNode->getHasBuild()) + //throw CNMRException(NMR_ERROR_NOBUILD); + } + + } + + //if (!bHasModel) + //throw CNMRException(NMR_ERROR_NOMODELNODE); + + } + + PModelToolpathLayerReadData CToolpathReader::getReadData() + { + return m_pReadData; + } + + +} diff --git a/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Data.cpp b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Data.cpp new file mode 100644 index 000000000..4382c6537 --- /dev/null +++ b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Data.cpp @@ -0,0 +1,93 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_Data.h" +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_DataNode.h" + +#include "Model/Classes/NMR_ModelConstants.h" +#include "Common/3MF_ProgressMonitor.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_StringUtils.h" + +#include +#include +#include +#include + +namespace NMR { + + CToolpathReaderNode_Data::CToolpathReaderNode_Data(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, CModelToolpathLayerReadData * pReadData) + : CModelReaderNode(pWarnings, pProgressMonitor), m_pReadData(pReadData) + { + if (pReadData == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + } + + + void CToolpathReaderNode_Data::parseXML(_In_ CXmlReader * pXMLReader) + { + // Parse name + parseName(pXMLReader); + + // Parse attribute + parseAttributes(pXMLReader); + + // Parse Content + parseContent(pXMLReader); + + } + + void CToolpathReaderNode_Data::OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue) + { + __NMRASSERT(pAttributeName); + __NMRASSERT(pAttributeValue); + + } + + void CToolpathReaderNode_Data::OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace) + { + + } + + void CToolpathReaderNode_Data::OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader) + { + + std::string sNameSpace = pNameSpace; + PCustomXMLTree pCustomXMLTree = std::make_shared (sNameSpace, pChildName); + + PToolpathReaderNode_DataNode pXMLReaderNode = std::make_shared(m_pWarnings, m_pProgressMonitor, m_pReadData, sNameSpace, pCustomXMLTree->getRootNode ()); + pXMLReaderNode->parseXML(pXMLReader); + + m_pReadData->addCustomXMLData (pCustomXMLTree); + + } + + +} diff --git a/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_DataNode.cpp b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_DataNode.cpp new file mode 100644 index 000000000..6e48a9abc --- /dev/null +++ b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_DataNode.cpp @@ -0,0 +1,98 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_DataNode.h" + +#include "Model/Classes/NMR_ModelConstants.h" +#include "Common/3MF_ProgressMonitor.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_StringUtils.h" + +#include +#include +#include +#include + +namespace NMR { + + CToolpathReaderNode_DataNode::CToolpathReaderNode_DataNode(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, CModelToolpathLayerReadData * pReadData, const std::string& sNameSpace, PCustomXMLNode pXMLNode) + : CModelReaderNode(pWarnings, pProgressMonitor), m_pReadData(pReadData), m_sNameSpace (sNameSpace), m_pXMLNode (pXMLNode) + { + if (pReadData == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + if (pXMLNode == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + } + + + void CToolpathReaderNode_DataNode::parseXML(_In_ CXmlReader * pXMLReader) + { + // Parse name + parseName(pXMLReader); + + // Parse attribute + parseAttributes(pXMLReader); + + // Parse Content + parseContent(pXMLReader); + + } + + void CToolpathReaderNode_DataNode::OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue) + { + __NMRASSERT(pAttributeName); + __NMRASSERT(pAttributeValue); + + m_pXMLNode->addAttribute(pAttributeName, pAttributeValue); + } + + void CToolpathReaderNode_DataNode::OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace) + { + std::string sAttributeNameSpace = pNameSpace; + if (m_sNameSpace == sAttributeNameSpace) + m_pXMLNode->addAttribute(pAttributeName, pAttributeValue); + + } + + void CToolpathReaderNode_DataNode::OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader) + { + std::string sChildNameSpace = pNameSpace; + if (m_sNameSpace == sChildNameSpace) { + + auto pSubNode = m_pXMLNode->addChild(pChildName); + PToolpathReaderNode_DataNode pXMLReaderNode = std::make_shared(m_pWarnings, m_pProgressMonitor, m_pReadData, m_sNameSpace, pSubNode); + pXMLReaderNode->parseXML(pXMLReader); + + } + + } + + +} diff --git a/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Hatch.cpp b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Hatch.cpp new file mode 100644 index 000000000..7a3d4f01e --- /dev/null +++ b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Hatch.cpp @@ -0,0 +1,164 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_Hatch.h" + +#include "Model/Classes/NMR_ModelConstants.h" +#include "Common/3MF_ProgressMonitor.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_StringUtils.h" + +#include +#include +#include +#include + +namespace NMR { + + CToolpathReaderNode_Hatch::CToolpathReaderNode_Hatch(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, CModelToolpathLayerReadData * pReadData) + : CModelReaderNode(pWarnings, pProgressMonitor), + m_pReadData (pReadData), + m_dX1 (0.0), + m_dY1(0.0), + m_dX2(0.0), + m_dY2(0.0), + m_bHasX1 (false), + m_bHasY1 (false), + m_bHasX2 (false), + m_bHasY2 (false) + + + { + if (pReadData == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + } + + + void CToolpathReaderNode_Hatch::parseXML(_In_ CXmlReader * pXMLReader) + { + // Parse name + parseName(pXMLReader); + + // Parse attribute + parseAttributes(pXMLReader); + + // Parse Content + parseContent(pXMLReader); + + } + + void CToolpathReaderNode_Hatch::OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue) + { + __NMRASSERT(pAttributeName); + __NMRASSERT(pAttributeValue); + + if (strcmp(pAttributeName, XML_3MF_TOOLPATHATTRIBUTE_X1) == 0) { + if (m_bHasX1) + throw CNMRException(NMR_ERROR_INVALIDMODELCOORDINATES); + m_dX1 = strtod(pAttributeValue, nullptr); + if (std::isnan(m_dX1)) + throw CNMRException(NMR_ERROR_INVALIDMODELCOORDINATES); + if (fabs(m_dX1) > XML_3MF_MAXIMUMCOORDINATEVALUE) + throw CNMRException(NMR_ERROR_INVALIDMODELCOORDINATES); + m_bHasX1 = true; + } + else if (strcmp(pAttributeName, XML_3MF_TOOLPATHATTRIBUTE_Y1) == 0) { + if (m_bHasY1) + throw CNMRException(NMR_ERROR_INVALIDMODELCOORDINATES); + m_dY1 = strtod(pAttributeValue, nullptr); + if (std::isnan(m_dY1)) + throw CNMRException(NMR_ERROR_INVALIDMODELCOORDINATES); + if (fabs(m_dY1) > XML_3MF_MAXIMUMCOORDINATEVALUE) + throw CNMRException(NMR_ERROR_INVALIDMODELCOORDINATES); + m_bHasY1 = true; + } + else if (strcmp(pAttributeName, XML_3MF_TOOLPATHATTRIBUTE_X2) == 0) { + if (m_bHasX2) + throw CNMRException(NMR_ERROR_INVALIDMODELCOORDINATES); + m_dX2 = strtod(pAttributeValue, nullptr); + if (std::isnan(m_dX2)) + throw CNMRException(NMR_ERROR_INVALIDMODELCOORDINATES); + if (fabs(m_dX2) > XML_3MF_MAXIMUMCOORDINATEVALUE) + throw CNMRException(NMR_ERROR_INVALIDMODELCOORDINATES); + m_bHasX2 = true; + } + else if (strcmp(pAttributeName, XML_3MF_TOOLPATHATTRIBUTE_Y2) == 0) { + if (m_bHasY2) + throw CNMRException(NMR_ERROR_INVALIDMODELCOORDINATES); + m_dY2 = strtod(pAttributeValue, nullptr); + if (std::isnan(m_dY2)) + throw CNMRException(NMR_ERROR_INVALIDMODELCOORDINATES); + if (fabs(m_dY2) > XML_3MF_MAXIMUMCOORDINATEVALUE) + throw CNMRException(NMR_ERROR_INVALIDMODELCOORDINATES); + m_bHasY2 = true; + } + else + m_pWarnings->addException(CNMRException(NMR_ERROR_NAMESPACE_INVALID_ATTRIBUTE), mrwInvalidOptionalValue); + + } + + void CToolpathReaderNode_Hatch::OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace) + { + + } + + void CToolpathReaderNode_Hatch::OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader) + { + } + + nfDouble CToolpathReaderNode_Hatch::getX1() + { + if (!m_bHasX1) + throw CNMRException(NMR_ERROR_MISSINGCOORDINATE); + return m_dX1; + } + + nfDouble CToolpathReaderNode_Hatch::getY1() + { + if (!m_bHasY1) + throw CNMRException(NMR_ERROR_MISSINGCOORDINATE); + return m_dY1; + } + + nfDouble CToolpathReaderNode_Hatch::getX2() + { + if (!m_bHasX2) + throw CNMRException(NMR_ERROR_MISSINGCOORDINATE); + return m_dX2; + } + + nfDouble CToolpathReaderNode_Hatch::getY2() + { + if (!m_bHasY2) + throw CNMRException(NMR_ERROR_MISSINGCOORDINATE); + return m_dY2; + } + + +} diff --git a/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Layer.cpp b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Layer.cpp new file mode 100644 index 000000000..231a57732 --- /dev/null +++ b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Layer.cpp @@ -0,0 +1,106 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_Layer.h" +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_Data.h" +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_Parts.h" +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_Profiles.h" +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_Segments.h" + +#include "Model/Classes/NMR_ModelConstants.h" +#include "Common/3MF_ProgressMonitor.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_StringUtils.h" + +#include +#include +#include +#include + +namespace NMR { + + CToolpathReaderNode_Layer::CToolpathReaderNode_Layer(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, CModelToolpathLayerReadData * pReadData) + : CModelReaderNode(pWarnings, pProgressMonitor), m_pReadData(pReadData) + { + if (pReadData == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + } + + + void CToolpathReaderNode_Layer::parseXML(_In_ CXmlReader * pXMLReader) + { + // Parse name + parseName(pXMLReader); + + // Parse attribute + parseAttributes(pXMLReader); + + // Parse Content + parseContent(pXMLReader); + + } + + void CToolpathReaderNode_Layer::OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue) + { + __NMRASSERT(pAttributeName); + __NMRASSERT(pAttributeValue); + + } + + void CToolpathReaderNode_Layer::OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace) + { + } + + void CToolpathReaderNode_Layer::OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader) + { + if (strcmp(pNameSpace, XML_3MF_NAMESPACE_TOOLPATHSPEC) == 0) { + if (strcmp(pChildName, XML_3MF_TOOLPATHELEMENT_PARTS) == 0) { + PToolpathReaderNode_Parts pXMLNode = std::make_shared (m_pWarnings, m_pProgressMonitor, m_pReadData); + pXMLNode->parseXML(pXMLReader); + } + else if (strcmp(pChildName, XML_3MF_TOOLPATHELEMENT_PROFILES) == 0) { + PToolpathReaderNode_Profiles pXMLNode = std::make_shared(m_pWarnings, m_pProgressMonitor, m_pReadData); + pXMLNode->parseXML(pXMLReader); + } + else if (strcmp(pChildName, XML_3MF_TOOLPATHELEMENT_SEGMENTS) == 0) { + PToolpathReaderNode_Segments pXMLNode = std::make_shared(m_pWarnings, m_pProgressMonitor, m_pReadData); + pXMLNode->parseXML(pXMLReader); + } + else if (strcmp(pChildName, XML_3MF_TOOLPATHELEMENT_DATA) == 0) { + PToolpathReaderNode_Data pXMLNode = std::make_shared(m_pWarnings, m_pProgressMonitor, m_pReadData); + pXMLNode->parseXML(pXMLReader); + } + else + m_pWarnings->addException(CNMRException(NMR_ERROR_NAMESPACE_INVALID_ELEMENT), mrwInvalidOptionalValue); + } + } + + +} diff --git a/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Part.cpp b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Part.cpp new file mode 100644 index 000000000..2ebec3988 --- /dev/null +++ b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Part.cpp @@ -0,0 +1,118 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_Part.h" + +#include "Model/Classes/NMR_ModelConstants.h" +#include "Common/3MF_ProgressMonitor.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_StringUtils.h" + +#include +#include +#include +#include + +namespace NMR { + + CToolpathReaderNode_Part::CToolpathReaderNode_Part(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, CModelToolpathLayerReadData * pReadData) + : CModelReaderNode(pWarnings, pProgressMonitor), m_pReadData(pReadData), m_nPartID (0) + { + if (pReadData == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + } + + + void CToolpathReaderNode_Part::parseXML(_In_ CXmlReader * pXMLReader) + { + // Parse name + parseName(pXMLReader); + + // Parse attribute + parseAttributes(pXMLReader); + + // Parse Content + parseContent(pXMLReader); + + } + + void CToolpathReaderNode_Part::OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue) + { + __NMRASSERT(pAttributeName); + __NMRASSERT(pAttributeValue); + + if (strcmp(pAttributeName, XML_3MF_TOOLPATHATTRIBUTE_ID) == 0) { + if (hasPartID()) + throw CNMRException(NMR_ERROR_DUPLICATEID); + + nfInt32 nValue = fnStringToInt32(pAttributeValue); + if ((nValue > 0) && (nValue < XML_3MF_MAXRESOURCEINDEX)) + m_nPartID = nValue; + } + + if (strcmp(pAttributeName, XML_3MF_TOOLPATHATTRIBUTE_UUID) == 0) { + if (hasUUID()) + throw CNMRException(NMR_ERROR_DUPLICATEUUID); + m_sUUID = pAttributeValue; + } + + } + + void CToolpathReaderNode_Part::OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace) + { + + } + + void CToolpathReaderNode_Part::OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader) + { + } + + + nfUint32 CToolpathReaderNode_Part::getPartID() + { + return m_nPartID; + } + + bool CToolpathReaderNode_Part::hasPartID() + { + return m_nPartID != 0; + } + + std::string CToolpathReaderNode_Part::getUUID() + { + return m_sUUID; + } + + bool CToolpathReaderNode_Part::hasUUID() + { + return (m_sUUID.length() > 0); + } + +} diff --git a/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Parts.cpp b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Parts.cpp new file mode 100644 index 000000000..2603f086a --- /dev/null +++ b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Parts.cpp @@ -0,0 +1,98 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_Parts.h" +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_Part.h" + +#include "Model/Classes/NMR_ModelConstants.h" +#include "Common/3MF_ProgressMonitor.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_StringUtils.h" + +#include +#include +#include +#include + +namespace NMR { + + CToolpathReaderNode_Parts::CToolpathReaderNode_Parts(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, CModelToolpathLayerReadData * pReadData) + : CModelReaderNode(pWarnings, pProgressMonitor), m_pReadData(pReadData) + { + if (pReadData == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + } + + + void CToolpathReaderNode_Parts::parseXML(_In_ CXmlReader * pXMLReader) + { + // Parse name + parseName(pXMLReader); + + // Parse attribute + parseAttributes(pXMLReader); + + // Parse Content + parseContent(pXMLReader); + + } + + void CToolpathReaderNode_Parts::OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue) + { + __NMRASSERT(pAttributeName); + __NMRASSERT(pAttributeValue); + + } + + void CToolpathReaderNode_Parts::OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace) + { + + } + + void CToolpathReaderNode_Parts::OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader) + { + if (strcmp(pNameSpace, XML_3MF_NAMESPACE_TOOLPATHSPEC) == 0) { + if (strcmp(pChildName, XML_3MF_TOOLPATHELEMENT_PART) == 0) { + PToolpathReaderNode_Part pXMLNode = std::make_shared(m_pWarnings, m_pProgressMonitor, m_pReadData); + pXMLNode->parseXML(pXMLReader); + + if (!pXMLNode->hasPartID()) + throw CNMRException(NMR_ERROR_MISSINGID); + if (!pXMLNode->hasUUID()) + throw CNMRException(NMR_ERROR_MISSINGUUID); + + m_pReadData->registerUUID (pXMLNode->getPartID (), pXMLNode->getUUID ()); + } + else + m_pWarnings->addException(CNMRException(NMR_ERROR_NAMESPACE_INVALID_ELEMENT), mrwInvalidOptionalValue); + } + } + + +} diff --git a/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Point.cpp b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Point.cpp new file mode 100644 index 000000000..2af8302b4 --- /dev/null +++ b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Point.cpp @@ -0,0 +1,127 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_Point.h" + +#include "Model/Classes/NMR_ModelConstants.h" +#include "Common/3MF_ProgressMonitor.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_StringUtils.h" + +#include +#include +#include +#include + +namespace NMR { + + CToolpathReaderNode_Point::CToolpathReaderNode_Point(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, CModelToolpathLayerReadData * pReadData) + : CModelReaderNode(pWarnings, pProgressMonitor), + m_pReadData(pReadData), + m_bHasX (false), + m_bHasY (false), + m_dX (0.0), + m_dY (0.0) + { + if (pReadData == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + } + + + void CToolpathReaderNode_Point::parseXML(_In_ CXmlReader * pXMLReader) + { + // Parse name + parseName(pXMLReader); + + // Parse attribute + parseAttributes(pXMLReader); + + // Parse Content + parseContent(pXMLReader); + + } + + void CToolpathReaderNode_Point::OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue) + { + __NMRASSERT(pAttributeName); + __NMRASSERT(pAttributeValue); + + __NMRASSERT(pAttributeName); + __NMRASSERT(pAttributeValue); + + if (strcmp(pAttributeName, XML_3MF_TOOLPATHATTRIBUTE_X) == 0) { + if (m_bHasX) + throw CNMRException(NMR_ERROR_INVALIDMODELCOORDINATES); + m_dX = strtod(pAttributeValue, nullptr); + if (std::isnan(m_dX)) + throw CNMRException(NMR_ERROR_INVALIDMODELCOORDINATES); + if (fabs(m_dX) > XML_3MF_MAXIMUMCOORDINATEVALUE) + throw CNMRException(NMR_ERROR_INVALIDMODELCOORDINATES); + m_bHasX = true; + } + else if (strcmp(pAttributeName, XML_3MF_TOOLPATHATTRIBUTE_Y) == 0) { + if (m_bHasY) + throw CNMRException(NMR_ERROR_INVALIDMODELCOORDINATES); + m_dY = strtod(pAttributeValue, nullptr); + if (std::isnan(m_dY)) + throw CNMRException(NMR_ERROR_INVALIDMODELCOORDINATES); + if (fabs(m_dY) > XML_3MF_MAXIMUMCOORDINATEVALUE) + throw CNMRException(NMR_ERROR_INVALIDMODELCOORDINATES); + m_bHasY = true; + } + else + m_pWarnings->addException(CNMRException(NMR_ERROR_NAMESPACE_INVALID_ATTRIBUTE), mrwInvalidOptionalValue); + + } + + void CToolpathReaderNode_Point::OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace) + { + + } + + void CToolpathReaderNode_Point::OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader) + { + } + + nfDouble CToolpathReaderNode_Point::getX() + { + if (!m_bHasX) + throw CNMRException(NMR_ERROR_MISSINGCOORDINATE); + return m_dX; + } + + nfDouble CToolpathReaderNode_Point::getY() + { + if (!m_bHasY) + throw CNMRException(NMR_ERROR_MISSINGCOORDINATE); + return m_dY; + } + +} diff --git a/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Profile.cpp b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Profile.cpp new file mode 100644 index 000000000..7a4aa62be --- /dev/null +++ b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Profile.cpp @@ -0,0 +1,118 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_Profile.h" + +#include "Model/Classes/NMR_ModelConstants.h" +#include "Common/3MF_ProgressMonitor.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_StringUtils.h" + +#include +#include +#include +#include + +namespace NMR { + + CToolpathReaderNode_Profile::CToolpathReaderNode_Profile(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, CModelToolpathLayerReadData * pReadData) + : CModelReaderNode(pWarnings, pProgressMonitor), m_pReadData(pReadData), m_nProfileID(0) + { + if (pReadData == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + } + + + void CToolpathReaderNode_Profile::parseXML(_In_ CXmlReader * pXMLReader) + { + // Parse name + parseName(pXMLReader); + + // Parse attribute + parseAttributes(pXMLReader); + + // Parse Content + parseContent(pXMLReader); + + } + + void CToolpathReaderNode_Profile::OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue) + { + __NMRASSERT(pAttributeName); + __NMRASSERT(pAttributeValue); + + if (strcmp(pAttributeName, XML_3MF_TOOLPATHATTRIBUTE_ID) == 0) { + if (hasProfileID()) + throw CNMRException(NMR_ERROR_DUPLICATEID); + + nfInt32 nValue = fnStringToInt32(pAttributeValue); + if ((nValue > 0) && (nValue < XML_3MF_MAXRESOURCEINDEX)) + m_nProfileID = nValue; + } + + if (strcmp(pAttributeName, XML_3MF_TOOLPATHATTRIBUTE_UUID) == 0) { + if (hasUUID()) + throw CNMRException(NMR_ERROR_DUPLICATEUUID); + m_sUUID = pAttributeValue; + } + + } + + void CToolpathReaderNode_Profile::OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace) + { + + } + + void CToolpathReaderNode_Profile::OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader) + { + } + + nfUint32 CToolpathReaderNode_Profile::getProfileID() + { + return m_nProfileID; + } + + bool CToolpathReaderNode_Profile::hasProfileID() + { + return (m_nProfileID != 0); + } + + std::string CToolpathReaderNode_Profile::getUUID() + { + return m_sUUID; + } + + bool CToolpathReaderNode_Profile::hasUUID() + { + return (m_sUUID.length() > 0); + } + + +} diff --git a/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Profiles.cpp b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Profiles.cpp new file mode 100644 index 000000000..4129256e5 --- /dev/null +++ b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Profiles.cpp @@ -0,0 +1,100 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_Profiles.h" +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_Profile.h" + +#include "Model/Classes/NMR_ModelConstants.h" +#include "Common/3MF_ProgressMonitor.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_StringUtils.h" + +#include +#include +#include +#include + +namespace NMR { + + CToolpathReaderNode_Profiles::CToolpathReaderNode_Profiles(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, CModelToolpathLayerReadData * pReadData) + : CModelReaderNode(pWarnings, pProgressMonitor), m_pReadData(pReadData) + { + if (pReadData == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + } + + + void CToolpathReaderNode_Profiles::parseXML(_In_ CXmlReader * pXMLReader) + { + // Parse name + parseName(pXMLReader); + + // Parse attribute + parseAttributes(pXMLReader); + + // Parse Content + parseContent(pXMLReader); + + } + + void CToolpathReaderNode_Profiles::OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue) + { + __NMRASSERT(pAttributeName); + __NMRASSERT(pAttributeValue); + + } + + void CToolpathReaderNode_Profiles::OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace) + { + + } + + void CToolpathReaderNode_Profiles::OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader) + { + if (strcmp(pNameSpace, XML_3MF_NAMESPACE_TOOLPATHSPEC) == 0) { + if (strcmp(pChildName, XML_3MF_TOOLPATHELEMENT_PROFILE) == 0) { + PToolpathReaderNode_Profile pXMLNode = std::make_shared(m_pWarnings, m_pProgressMonitor, m_pReadData); + pXMLNode->parseXML(pXMLReader); + + if (!pXMLNode->hasProfileID()) + throw CNMRException(NMR_ERROR_MISSINGID); + if (!pXMLNode->hasUUID()) + throw CNMRException(NMR_ERROR_MISSINGUUID); + + m_pReadData->registerUUID(pXMLNode->getProfileID(), pXMLNode->getUUID()); + + } + else + m_pWarnings->addException(CNMRException(NMR_ERROR_NAMESPACE_INVALID_ELEMENT), mrwInvalidOptionalValue); + } + } + + +} diff --git a/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Segment.cpp b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Segment.cpp new file mode 100644 index 000000000..743b7c166 --- /dev/null +++ b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Segment.cpp @@ -0,0 +1,311 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_Segment.h" +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_Hatch.h" +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_Point.h" +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_ZHatch.h" +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_ZPoint.h" + +#include "Model/Classes/NMR_ModelConstants.h" +#include "Common/3MF_ProgressMonitor.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_StringUtils.h" + +#include +#include +#include +#include + +namespace NMR { + + CToolpathReaderNode_Segment::CToolpathReaderNode_Segment(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, CModelToolpathLayerReadData * pReadData, _In_ std::string sBinaryStreamPath) + : CModelReaderNode(pWarnings, pProgressMonitor), + m_pReadData(pReadData), + m_nPartID (0), + m_nProfileID (0), + m_bHasSegmentType (false), + m_eSegmentType (eModelToolpathSegmentType::HatchSegment), + m_sBinaryStreamPath (sBinaryStreamPath) + { + if (pReadData == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + } + + + void CToolpathReaderNode_Segment::parseXML(_In_ CXmlReader * pXMLReader) + { + // Parse name + parseName(pXMLReader); + + // Set custom attributes to default value (0.0) + m_pReadData->clearSegmentAttributes(); + + // Parse attribute + parseAttributes(pXMLReader); + + if (!m_bHasSegmentType) + throw CNMRException(NMR_ERROR_MISSINGTYPEATTRIBUTE); + if (!hasPartID ()) + throw CNMRException(NMR_ERROR_MISSINGID); + if (!hasProfileID()) + throw CNMRException(NMR_ERROR_MISSINGID); + + m_pReadData->beginSegment(m_eSegmentType, getProfileID(), getPartID()); + + // Parse Content + parseContent(pXMLReader); + + m_pReadData->endSegment(); + + } + + void CToolpathReaderNode_Segment::OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue) + { + __NMRASSERT(pAttributeName); + __NMRASSERT(pAttributeValue); + + if (strcmp(pAttributeName, XML_3MF_TOOLPATHATTRIBUTE_PROFILEID) == 0) { + if (hasProfileID()) + throw CNMRException(NMR_ERROR_DUPLICATEID); + + nfInt32 nValue = fnStringToInt32(pAttributeValue); + if ((nValue > 0) && (nValue < XML_3MF_MAXRESOURCEINDEX)) + m_nProfileID = nValue; + } + + if (strcmp(pAttributeName, XML_3MF_TOOLPATHATTRIBUTE_PARTID) == 0) { + if (hasPartID()) + throw CNMRException(NMR_ERROR_DUPLICATEID); + + nfInt32 nValue = fnStringToInt32(pAttributeValue); + if ((nValue > 0) && (nValue < XML_3MF_MAXRESOURCEINDEX)) + m_nPartID = nValue; + } + + if (strcmp(pAttributeName, XML_3MF_TOOLPATHATTRIBUTE_TYPE) == 0) { + if (m_bHasSegmentType) + throw CNMRException(NMR_ERROR_DUPLICATETYPEATTRIBUTE); + + if (strcmp(pAttributeValue, XML_3MF_TOOLPATHTYPE_HATCH) == 0) { + m_bHasSegmentType = true; + m_eSegmentType = eModelToolpathSegmentType::HatchSegment; + } + + if (strcmp(pAttributeValue, XML_3MF_TOOLPATHTYPE_LOOP) == 0) { + m_bHasSegmentType = true; + m_eSegmentType = eModelToolpathSegmentType::LoopSegment; + } + + if (strcmp(pAttributeValue, XML_3MF_TOOLPATHTYPE_POLYLINE) == 0) { + m_bHasSegmentType = true; + m_eSegmentType = eModelToolpathSegmentType::PolylineSegment; + } + + if (!m_bHasSegmentType) + throw CNMRException(NMR_ERROR_INVALIDTYPEATTRIBUTE); + + } + + } + + void CToolpathReaderNode_Segment::OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace) + { + __NMRASSERT(pAttributeName); + __NMRASSERT(pAttributeValue); + __NMRASSERT(pNameSpace); + + m_pReadData->storeSegmentAttribute(pNameSpace, pAttributeName, pAttributeValue); + + } + + void CToolpathReaderNode_Segment::OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader) + { + + if (strcmp(pNameSpace, XML_3MF_NAMESPACE_TOOLPATHSPEC) == 0) { + if (strcmp(pChildName, XML_3MF_TOOLPATHELEMENT_HATCH) == 0) { + + if (m_eSegmentType != eModelToolpathSegmentType::HatchSegment) + throw CNMRException(NMR_ERROR_INVALIDTYPEATTRIBUTE); + + PToolpathReaderNode_Hatch pXMLNode = std::make_shared(m_pWarnings, m_pProgressMonitor, m_pReadData); + pXMLNode->parseXML(pXMLReader); + + m_pReadData->addPoint((nfFloat)pXMLNode->getX1(), (nfFloat)pXMLNode->getY1()); + m_pReadData->addPoint((nfFloat)pXMLNode->getX2(), (nfFloat)pXMLNode->getY2()); + + } + else if (strcmp(pChildName, XML_3MF_TOOLPATHELEMENT_POINT) == 0) { + + if ((m_eSegmentType != eModelToolpathSegmentType::LoopSegment) && (m_eSegmentType != eModelToolpathSegmentType::PolylineSegment)) + throw CNMRException(NMR_ERROR_INVALIDTYPEATTRIBUTE); + + PToolpathReaderNode_Point pXMLNode = std::make_shared(m_pWarnings, m_pProgressMonitor, m_pReadData); + pXMLNode->parseXML(pXMLReader); + + m_pReadData->addPoint((nfFloat)pXMLNode->getX(), (nfFloat)pXMLNode->getY()); + + } + else + m_pWarnings->addException(CNMRException(NMR_ERROR_NAMESPACE_INVALID_ELEMENT), mrwInvalidOptionalValue); + } + + /*if (strcmp(pNameSpace, XML_3MF_NAMESPACE_ZCOMPRESSION) == 0) { + if (strcmp(pChildName, XML_3MF_TOOLPATHELEMENT_HATCH) == 0) { + if (m_eSegmentType != eModelToolpathSegmentType::HatchSegment) + throw CNMRException(NMR_ERROR_INVALIDTYPEATTRIBUTE); + + PToolpathReaderNode_ZHatch pXMLNode = std::make_shared(m_pWarnings, m_pProgressMonitor, m_pReadData); + pXMLNode->parseXML(pXMLReader); + + nfInt32 nX1ID, nY1ID, nX2ID, nY2ID; + pXMLNode->getBinaryIDs(nX1ID, nY1ID, nX2ID, nY2ID); + + if ((m_pBinaryStreamCollection.get() == nullptr) || (m_sBinaryStreamPath.empty())) + throw CNMRException(NMR_ERROR_NOBINARYSTREAMAVAILABLE); + + auto pReader = m_pBinaryStreamCollection->findReader(m_sBinaryStreamPath); + if (pReader == nullptr) + throw CNMRException(NMR_ERROR_BINARYSTREAMNOTFOUND); + + nfUint32 nX1Count = pReader->getTypedChunkEntryCount(nX1ID, edtFloatArray); + nfUint32 nY1Count = pReader->getTypedChunkEntryCount(nY1ID, edtFloatArray); + nfUint32 nX2Count = pReader->getTypedChunkEntryCount(nX2ID, edtFloatArray); + nfUint32 nY2Count = pReader->getTypedChunkEntryCount(nY2ID, edtFloatArray); + + if ((nX1Count != nY1Count) || (nX1Count != nX2Count) || (nX1Count != nY1Count) || (nX1Count != nY2Count)) + throw CNMRException(NMR_ERROR_INCONSISTENTBINARYSTREAMCOUNT); + nfUint32 nCount = nX1Count; + + if (nCount > 0) { + + std::vector X1Values; + std::vector Y1Values; + std::vector X2Values; + std::vector Y2Values; + + X1Values.resize(nCount); + Y1Values.resize(nCount); + X2Values.resize(nCount); + Y2Values.resize(nCount); + + nfFloat * pX1 = X1Values.data(); + nfFloat * pY1 = Y1Values.data(); + nfFloat * pX2 = X2Values.data(); + nfFloat * pY2 = Y2Values.data(); + + pReader->readFloatArray(nX1ID, pX1, nCount); + pReader->readFloatArray(nY1ID, pY1, nCount); + pReader->readFloatArray(nX2ID, pX2, nCount); + pReader->readFloatArray(nY2ID, pY2, nCount); + + for (nfUint32 nIndex = 0; nIndex < nCount; nIndex++) { + m_pReadData->addPoint(*pX1, *pY1); + m_pReadData->addPoint(*pX2, *pY2); + + pX1++; pY1++; pX2++; pY2++; + } + } + + } + + if (strcmp(pChildName, XML_3MF_TOOLPATHELEMENT_POINT) == 0) { + if ((m_eSegmentType != eModelToolpathSegmentType::LoopSegment) && (m_eSegmentType != eModelToolpathSegmentType::PolylineSegment)) + throw CNMRException(NMR_ERROR_INVALIDTYPEATTRIBUTE); + + PToolpathReaderNode_ZPoint pXMLNode = std::make_shared(m_pWarnings, m_pProgressMonitor, m_pReadData); + pXMLNode->parseXML(pXMLReader); + + nfInt32 nXID, nYID; + pXMLNode->getBinaryIDs(nXID, nYID); + + if ((m_pBinaryStreamCollection.get() == nullptr) || (m_sBinaryStreamPath.empty())) + throw CNMRException(NMR_ERROR_NOBINARYSTREAMAVAILABLE); + + auto pReader = m_pBinaryStreamCollection->findReader(m_sBinaryStreamPath); + if (pReader == nullptr) + throw CNMRException(NMR_ERROR_BINARYSTREAMNOTFOUND); + + nfUint32 nXCount = pReader->getTypedChunkEntryCount(nXID, edtFloatArray); + nfUint32 nYCount = pReader->getTypedChunkEntryCount(nYID, edtFloatArray); + + if (nXCount != nYCount) + throw CNMRException(NMR_ERROR_INCONSISTENTBINARYSTREAMCOUNT); + nfUint32 nCount = nXCount; + + if (nCount > 0) { + + std::vector XValues; + std::vector YValues; + + XValues.resize(nCount); + YValues.resize(nCount); + + nfFloat * pX = XValues.data(); + nfFloat * pY = YValues.data(); + + pReader->readFloatArray(nXID, pX, nCount); + pReader->readFloatArray(nYID, pY, nCount); + + for (nfUint32 nIndex = 0; nIndex < nCount; nIndex++) { + m_pReadData->addPoint(*pX, *pY); + + pX++; pY++; + } + } + + } + + } */ + + } + + nfUint32 CToolpathReaderNode_Segment::getProfileID() + { + return m_nProfileID; + } + + bool CToolpathReaderNode_Segment::hasProfileID() + { + return (m_nProfileID != 0); + } + + nfUint32 CToolpathReaderNode_Segment::getPartID() + { + return m_nPartID; + } + + bool CToolpathReaderNode_Segment::hasPartID() + { + return (m_nPartID != 0); + } + + +} diff --git a/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Segments.cpp b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Segments.cpp new file mode 100644 index 000000000..8f5112abe --- /dev/null +++ b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_Segments.cpp @@ -0,0 +1,100 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_Segments.h" +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_Segment.h" + +#include "Model/Classes/NMR_ModelConstants.h" +#include "Common/3MF_ProgressMonitor.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_StringUtils.h" + +#include +#include +#include +#include + +namespace NMR { + + CToolpathReaderNode_Segments::CToolpathReaderNode_Segments(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, CModelToolpathLayerReadData * pReadData) + : CModelReaderNode(pWarnings, pProgressMonitor), m_pReadData(pReadData) + { + if (pReadData == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + } + + + void CToolpathReaderNode_Segments::parseXML(_In_ CXmlReader * pXMLReader) + { + // Parse name + parseName(pXMLReader); + + // Parse attribute + parseAttributes(pXMLReader); + + // Parse Content + parseContent(pXMLReader); + + } + + void CToolpathReaderNode_Segments::OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue) + { + __NMRASSERT(pAttributeName); + __NMRASSERT(pAttributeValue); + + } + + void CToolpathReaderNode_Segments::OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace) + { + __NMRASSERT(pNameSpace); + __NMRASSERT(pAttributeName); + + /*if (strcmp(pNameSpace, XML_3MF_NAMESPACE_ZCOMPRESSION) == 0) { + if (strcmp(pAttributeName, XML_3MF_TOOLPATHATTRIBUTE_BINARY) == 0) { + m_sBinaryStreamPath = pAttributeValue; + } + } */ + + } + + void CToolpathReaderNode_Segments::OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader) + { + if (strcmp(pNameSpace, XML_3MF_NAMESPACE_TOOLPATHSPEC) == 0) { + if (strcmp(pChildName, XML_3MF_TOOLPATHELEMENT_SEGMENT) == 0) { + PToolpathReaderNode_Segment pXMLNode = std::make_shared(m_pWarnings, m_pProgressMonitor, m_pReadData, m_sBinaryStreamPath); + pXMLNode->parseXML(pXMLReader); + } + else + m_pWarnings->addException(CNMRException(NMR_ERROR_NAMESPACE_INVALID_ELEMENT), mrwInvalidOptionalValue); + } + } + + +} diff --git a/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_ZHatch.cpp b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_ZHatch.cpp new file mode 100644 index 000000000..999dc0fa6 --- /dev/null +++ b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_ZHatch.cpp @@ -0,0 +1,150 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_ZHatch.h" + +#include "Model/Classes/NMR_ModelConstants.h" +#include "Common/3MF_ProgressMonitor.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_StringUtils.h" + +#include +#include +#include +#include + +namespace NMR { + + CToolpathReaderNode_ZHatch::CToolpathReaderNode_ZHatch(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, CModelToolpathLayerReadData * pReadData) + : CModelReaderNode(pWarnings, pProgressMonitor), + m_pReadData (pReadData), + m_nX1Id (0), + m_nY1Id (0), + m_nX2Id (0), + m_nY2Id (0), + m_bHasX1 (false), + m_bHasY1 (false), + m_bHasX2 (false), + m_bHasY2 (false) + + + { + if (pReadData == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + } + + + void CToolpathReaderNode_ZHatch::parseXML(_In_ CXmlReader * pXMLReader) + { + // Parse name + parseName(pXMLReader); + + // Parse attribute + parseAttributes(pXMLReader); + + // Parse Content + parseContent(pXMLReader); + + } + + void CToolpathReaderNode_ZHatch::OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue) + { + __NMRASSERT(pAttributeName); + __NMRASSERT(pAttributeValue); + + if (strcmp(pAttributeName, XML_3MF_TOOLPATHATTRIBUTE_X1) == 0) { + if (m_bHasX1) + throw CNMRException(NMR_ERROR_INVALIDBINARYELEMENTID); + nfInt32 nValue = fnStringToInt32(pAttributeValue); + if ((nValue < 0) || (nValue > XML_3MF_MAXRESOURCEINDEX)) + throw CNMRException(NMR_ERROR_INVALIDBINARYELEMENTID); + m_nX1Id = nValue; + m_bHasX1 = true; + } + else if (strcmp(pAttributeName, XML_3MF_TOOLPATHATTRIBUTE_Y1) == 0) { + if (m_bHasY1) + throw CNMRException(NMR_ERROR_INVALIDBINARYELEMENTID); + nfInt32 nValue = fnStringToInt32(pAttributeValue); + if ((nValue < 0) || (nValue > XML_3MF_MAXRESOURCEINDEX)) + throw CNMRException(NMR_ERROR_INVALIDBINARYELEMENTID); + m_nY1Id = nValue; + m_bHasY1 = true; + } + else if (strcmp(pAttributeName, XML_3MF_TOOLPATHATTRIBUTE_X2) == 0) { + if (m_bHasX2) + throw CNMRException(NMR_ERROR_INVALIDBINARYELEMENTID); + nfInt32 nValue = fnStringToInt32(pAttributeValue); + if ((nValue < 0) || (nValue > XML_3MF_MAXRESOURCEINDEX)) + throw CNMRException(NMR_ERROR_INVALIDBINARYELEMENTID); + m_nX2Id = nValue; + m_bHasX2 = true; + } + else if (strcmp(pAttributeName, XML_3MF_TOOLPATHATTRIBUTE_Y2) == 0) { + if (m_bHasY2) + throw CNMRException(NMR_ERROR_INVALIDBINARYELEMENTID); + nfInt32 nValue = fnStringToInt32(pAttributeValue); + if ((nValue < 0) || (nValue > XML_3MF_MAXRESOURCEINDEX)) + throw CNMRException(NMR_ERROR_INVALIDBINARYELEMENTID); + m_nY2Id = nValue; + m_bHasY2 = true; + } + else + m_pWarnings->addException(CNMRException(NMR_ERROR_NAMESPACE_INVALID_ATTRIBUTE), mrwInvalidOptionalValue); + + } + + void CToolpathReaderNode_ZHatch::OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace) + { + + } + + void CToolpathReaderNode_ZHatch::OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader) + { + } + + void CToolpathReaderNode_ZHatch::getBinaryIDs(nfInt32 & nX1Id, nfInt32 & nY1Id, nfInt32 & nX2Id, nfInt32 & nY2Id) + { + if (!m_bHasX1) + throw CNMRException(NMR_ERROR_MISSINGID); + if (!m_bHasY1) + throw CNMRException(NMR_ERROR_MISSINGID); + if (!m_bHasX2) + throw CNMRException(NMR_ERROR_MISSINGID); + if (!m_bHasY2) + throw CNMRException(NMR_ERROR_MISSINGID); + + nX1Id = m_nX1Id; + nY1Id = m_nY1Id; + nX2Id = m_nX2Id; + nY2Id = m_nY2Id; + } + + + +} diff --git a/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_ZPoint.cpp b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_ZPoint.cpp new file mode 100644 index 000000000..5aaab137f --- /dev/null +++ b/Source/Model/ToolpathReader/NMR_ToolpathReaderNode_ZPoint.cpp @@ -0,0 +1,122 @@ +/*++ + +Copyright (C) 2019 3MF Consortium + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +--*/ + +#include "Model/ToolpathReader/NMR_ToolpathReaderNode_ZPoint.h" + +#include "Model/Classes/NMR_ModelConstants.h" +#include "Common/3MF_ProgressMonitor.h" +#include "Common/NMR_Exception.h" +#include "Common/NMR_StringUtils.h" + +#include +#include +#include +#include + +namespace NMR { + + CToolpathReaderNode_ZPoint::CToolpathReaderNode_ZPoint(_In_ PModelWarnings pWarnings, _In_ PProgressMonitor pProgressMonitor, CModelToolpathLayerReadData * pReadData) + : CModelReaderNode(pWarnings, pProgressMonitor), + m_pReadData(pReadData), + m_bHasX (false), + m_bHasY (false), + m_nXId (0), + m_nYId (0) + { + if (pReadData == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + } + + + void CToolpathReaderNode_ZPoint::parseXML(_In_ CXmlReader * pXMLReader) + { + // Parse name + parseName(pXMLReader); + + // Parse attribute + parseAttributes(pXMLReader); + + // Parse Content + parseContent(pXMLReader); + + } + + void CToolpathReaderNode_ZPoint::OnAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue) + { + __NMRASSERT(pAttributeName); + __NMRASSERT(pAttributeValue); + + __NMRASSERT(pAttributeName); + __NMRASSERT(pAttributeValue); + + if (strcmp(pAttributeName, XML_3MF_TOOLPATHATTRIBUTE_X) == 0) { + if (m_bHasX) + throw CNMRException(NMR_ERROR_INVALIDBINARYELEMENTID); + nfInt32 nValue = fnStringToInt32(pAttributeValue); + if ((nValue < 0) || (nValue > XML_3MF_MAXRESOURCEINDEX)) + throw CNMRException(NMR_ERROR_INVALIDBINARYELEMENTID); + m_nXId = nValue; + m_bHasX = true; + } + else if (strcmp(pAttributeName, XML_3MF_TOOLPATHATTRIBUTE_Y) == 0) { + if (m_bHasY) + throw CNMRException(NMR_ERROR_INVALIDBINARYELEMENTID); + nfInt32 nValue = fnStringToInt32(pAttributeValue); + if ((nValue < 0) || (nValue > XML_3MF_MAXRESOURCEINDEX)) + throw CNMRException(NMR_ERROR_INVALIDBINARYELEMENTID); + m_nYId = nValue; + m_bHasY = true; + } + else + m_pWarnings->addException(CNMRException(NMR_ERROR_NAMESPACE_INVALID_ATTRIBUTE), mrwInvalidOptionalValue); + + } + + void CToolpathReaderNode_ZPoint::OnNSAttribute(_In_z_ const nfChar * pAttributeName, _In_z_ const nfChar * pAttributeValue, _In_z_ const nfChar * pNameSpace) + { + + } + + void CToolpathReaderNode_ZPoint::OnNSChildElement(_In_z_ const nfChar * pChildName, _In_z_ const nfChar * pNameSpace, _In_ CXmlReader * pXMLReader) + { + } + + void CToolpathReaderNode_ZPoint::getBinaryIDs(nfInt32 & nXId, nfInt32 & nYId) + { + if (!m_bHasX) + throw CNMRException(NMR_ERROR_MISSINGID); + if (!m_bHasY) + throw CNMRException(NMR_ERROR_MISSINGID); + + nXId = m_nXId; + nYId = m_nYId; + } + +} diff --git a/Source/Model/Writer/NMR_ModelWriter.cpp b/Source/Model/Writer/NMR_ModelWriter.cpp index 1a55eace3..35018c501 100644 --- a/Source/Model/Writer/NMR_ModelWriter.cpp +++ b/Source/Model/Writer/NMR_ModelWriter.cpp @@ -48,11 +48,19 @@ namespace NMR { const int MAX_DECIMAL_PRECISION = 16; CModelWriter::CModelWriter(_In_ PModel pModel): - CModelContext(pModel), + CModelContext(pModel), + m_bAllowBinaryStreams (false), m_nDecimalPrecision(6) { } + CModelWriter::~CModelWriter() + { + unregisterBinaryStreams(); + } + + + void CModelWriter::SetDecimalPrecision(nfUint32 nDecimalPrecision) { if ((nDecimalPrecision < MIN_DECIMAL_PRECISION) || (nDecimalPrecision > MAX_DECIMAL_PRECISION)) @@ -65,4 +73,71 @@ namespace NMR { return m_nDecimalPrecision; } + + void CModelWriter::registerBinaryStream(const std::string& sPath, const std::string& sUUID, PChunkedBinaryStreamWriter pStreamWriter) + { + if (!m_bAllowBinaryStreams) + throw CNMRException(NMR_ERROR_BINARYSTREAMSNOTALLOWED); + + auto iPathIter = m_BinaryWriterPathMap.find(sPath); + if (iPathIter != m_BinaryWriterPathMap.end()) + throw CNMRException(NMR_ERROR_DUPLICATEBINARYSTREAMPATH); + + auto iUUIDIter = m_BinaryWriterUUIDMap.find(sUUID); + if (iUUIDIter != m_BinaryWriterUUIDMap.end()) + throw CNMRException(NMR_ERROR_DUPLICATEBINARYSTREAMUUID); + + m_BinaryWriterUUIDMap.insert(std::make_pair(sUUID, std::make_pair(sPath, pStreamWriter))); + m_BinaryWriterPathMap.insert(std::make_pair(sPath, sUUID)); + } + + void CModelWriter::unregisterBinaryStreams() + { + m_BinaryWriterPathMap.clear(); + m_BinaryWriterUUIDMap.clear(); + m_BinaryWriterAssignmentMap.clear(); + } + + void CModelWriter::assignBinaryStream(const std::string& InstanceUUID, const std::string& sBinaryStreamUUID) + { + auto iUUIDIter = m_BinaryWriterUUIDMap.find(sBinaryStreamUUID); + if (iUUIDIter == m_BinaryWriterUUIDMap.end()) + throw CNMRException(NMR_ERROR_BINARYSTREAMNOTFOUND); + + + if ((sBinaryStreamUUID.length()) > 0) { + m_BinaryWriterAssignmentMap.insert(std::make_pair(InstanceUUID, sBinaryStreamUUID)); + } + else { + m_BinaryWriterAssignmentMap.erase(InstanceUUID); + } + + } + + CChunkedBinaryStreamWriter* CModelWriter::findBinaryStream(const std::string& InstanceUUID, std::string& Path) + { + auto iAssignIter = m_BinaryWriterAssignmentMap.find(InstanceUUID); + if (iAssignIter != m_BinaryWriterAssignmentMap.end()) { + auto iWriterIter = m_BinaryWriterUUIDMap.find(iAssignIter->second); + if (iWriterIter != m_BinaryWriterUUIDMap.end()) { + Path = iWriterIter->second.first; + return iWriterIter->second.second.get(); + } + } + + return nullptr; + } + + void CModelWriter::allowBinaryStreams() + { + m_bAllowBinaryStreams = true; + } + + void CModelWriter::registerCustomNameSpace(const std::string& sPrefix, const std::string& sNameSpace, bool bFailIfExisting) + { + throw CNMRException(NMR_ERROR_WRITERDOESNOTSUPPORTNAMESPACES); + } + + + } diff --git a/Source/Model/Writer/NMR_ModelWriter_3MF.cpp b/Source/Model/Writer/NMR_ModelWriter_3MF.cpp index 89572ee51..fb8cbd24d 100644 --- a/Source/Model/Writer/NMR_ModelWriter_3MF.cpp +++ b/Source/Model/Writer/NMR_ModelWriter_3MF.cpp @@ -92,7 +92,7 @@ namespace NMR { pXMLWriter->Flush(); } - void CModelWriter_3MF::writeModelStream(_In_ CXmlWriter * pXMLWriter, _In_ CModel * pModel) + void CModelWriter_3MF::writeModelStream(_In_ CXmlWriter* pXMLWriter, _In_ CModel* pModel) { __NMRASSERT(pModel != nullptr); if (pXMLWriter == nullptr) @@ -103,10 +103,57 @@ namespace NMR { pXMLWriter->WriteStartDocument(); CModelWriterNode100_Model ModelNode(pModel, pXMLWriter, monitor(), GetDecimalPrecision(), true); + ModelNode.setWriteBinaryExtension(m_bAllowBinaryStreams); + + for (auto iIter : m_CustomNameSpaces) { + std::string sPrefix = iIter.first; + std::string sNameSpace = iIter.second; + ModelNode.registerCustomNamespace(sPrefix, sNameSpace, false); + } + + for (auto iAssignmentIter : m_BinaryWriterAssignmentMap) { + auto iBinaryIter = m_BinaryWriterUUIDMap.find(iAssignmentIter.second); + if (iBinaryIter != m_BinaryWriterUUIDMap.end()) { + ModelNode.registerStreamWriter(iAssignmentIter.first, iBinaryIter->second.first, iBinaryIter->second.second.get()); + } + } + ModelNode.writeToXML(); pXMLWriter->WriteEndDocument(); pXMLWriter->Flush(); } + + void CModelWriter_3MF::addAdditionalAttachment(_In_ std::string sPath, _In_ PImportStream pStream, _In_ std::string sRelationShipType) + { + if (pStream.get() == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + m_AdditionalAttachments.insert(std::make_pair(sPath, std::make_pair(pStream, sRelationShipType))); + } + + void CModelWriter_3MF::registerCustomNameSpace(const std::string& sPrefix, const std::string& sNameSpace, bool bFailIfExisting) + { + if (sPrefix.empty ()) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + if (sNameSpace.empty()) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + + auto iIter = m_CustomNameSpaces.find(sPrefix); + if (iIter != m_CustomNameSpaces.end()) { + if (iIter->second != sNameSpace) + throw CNMRException(NMR_ERROR_NAMESPACEPREFIXALREADYDEFINED); + + } + else { + m_CustomNameSpaces.insert(std::make_pair (sPrefix, sNameSpace)); + + } + } + + std::map CModelWriter_3MF::getCustomNamespaceMap() + { + return m_CustomNameSpaces; + } + } diff --git a/Source/Model/Writer/NMR_ModelWriter_3MF_Native.cpp b/Source/Model/Writer/NMR_ModelWriter_3MF_Native.cpp index 7aea896d3..34c09dbb5 100644 --- a/Source/Model/Writer/NMR_ModelWriter_3MF_Native.cpp +++ b/Source/Model/Writer/NMR_ModelWriter_3MF_Native.cpp @@ -180,7 +180,6 @@ namespace NMR { { __NMRASSERT(pModel != nullptr); __NMRASSERT(pModelPart.get() != nullptr); - __NMRASSERT(pPackageWriter.get() != nullptr); nfUint32 nCount = pModel->getAttachmentCount(); nfUint32 nIndex; @@ -216,5 +215,43 @@ namespace NMR { monitor()->IncrementProgress(1); } } + + + // Write Binary Streams + for (auto iBinaryIter : m_BinaryWriterUUIDMap) { + + auto pBinaryWriter = iBinaryIter.second.second; + + if (!pBinaryWriter->isEmpty()) { + pBinaryWriter->finishWriting(); + POpcPackagePart pBinaryPart = m_pPackageWriter->addPart(pBinaryWriter->getBinaryPath ()); + pModelPart->addRelationship("binary" + iBinaryIter.first, PACKAGE_BINARY_RELATIONSHIP_TYPE, pBinaryPart->getURI()); + pBinaryWriter->copyBinaryToStream(pBinaryPart->getExportStream()); + + POpcPackagePart pIndexPart = m_pPackageWriter->addPart(pBinaryWriter->getIndexPath ()); + pModelPart->addRelationship("binaryindex" + iBinaryIter.first, PACKAGE_BINARYINDEX_RELATIONSHIP_TYPE, pIndexPart->getURI()); + + pIndexPart->addRelationship("binary" + iBinaryIter.first, PACKAGE_BINARY_RELATIONSHIP_TYPE, pBinaryPart->getURI()); + pBinaryWriter->writeIndexXML(pIndexPart->getExportStream()); + + + } + + } + + + // Write Additional Attachments that are not part of the model + for (auto iAttachmentIter : m_AdditionalAttachments) { + CUUID uuid; + POpcPackagePart pAttachmentPart = m_pPackageWriter->addPart(iAttachmentIter.first); + pModelPart->addRelationship("attachment" + uuid.toString(), iAttachmentIter.second.second, pAttachmentPart->getURI()); + + PImportStream pAttachmentStream = iAttachmentIter.second.first; + pAttachmentStream->seekPosition(0, true); + pAttachmentPart->getExportStream()->copyFrom(pAttachmentStream.get(), pAttachmentStream->retrieveSize(), MODELWRITER_NATIVE_BUFFERSIZE); + } + } + + } diff --git a/Source/Model/Writer/v100/NMR_ModelWriterNode100_Mesh.cpp b/Source/Model/Writer/v100/NMR_ModelWriterNode100_Mesh.cpp index 1889288d9..ef530a5ac 100644 --- a/Source/Model/Writer/v100/NMR_ModelWriterNode100_Mesh.cpp +++ b/Source/Model/Writer/v100/NMR_ModelWriterNode100_Mesh.cpp @@ -51,8 +51,10 @@ This is the class for exporting the 3mf mesh node. namespace NMR { CModelWriterNode100_Mesh::CModelWriterNode100_Mesh(_In_ CModelMeshObject * pModelMeshObject, _In_ CXmlWriter * pXMLWriter, _In_ PProgressMonitor pProgressMonitor, - _In_ PMeshInformation_PropertyIndexMapping pPropertyIndexMapping, _In_ int nPosAfterDecPoint, _In_ nfBool bWriteMaterialExtension, _In_ nfBool bWriteBeamLatticeExtension) - :CModelWriterNode_ModelBase(pModelMeshObject->getModel(), pXMLWriter, pProgressMonitor), m_nPosAfterDecPoint(nPosAfterDecPoint), m_nPutDoubleFactor((nfInt64)(pow(10, CModelWriterNode100_Mesh::m_nPosAfterDecPoint))) + _In_ PMeshInformation_PropertyIndexMapping pPropertyIndexMapping, _In_ int nPosAfterDecPoint, _In_ nfBool bWriteMaterialExtension, _In_ nfBool bWriteBeamLatticeExtension, + CChunkedBinaryStreamWriter* pBinaryStreamWriter) + :CModelWriterNode_ModelBase(pModelMeshObject->getModel(), pXMLWriter, pProgressMonitor), m_nPosAfterDecPoint(nPosAfterDecPoint), m_nPutDoubleFactor((nfInt64)(pow(10, CModelWriterNode100_Mesh::m_nPosAfterDecPoint))), + m_pBinaryStreamWriter (pBinaryStreamWriter) { __NMRASSERT(pModelMeshObject != nullptr); if (!pPropertyIndexMapping.get()) @@ -77,6 +79,7 @@ namespace NMR { putBallString(MODELWRITERMESH100_BEAMLATTICE_BALLLINESTART); putBeamRefString(MODELWRITERMESH100_BEAMLATTICE_REFLINESTART); putBallRefString(MODELWRITERMESH100_BEAMLATTICE_BALLREFLINESTART); + } bool stringRepresentationsDiffer(double a, double b, nfInt64 putFactor) { @@ -129,25 +132,82 @@ namespace NMR { // Write Mesh Element writeStartElement(XML_3MF_ELEMENT_MESH); + if (m_pBinaryStreamWriter != nullptr) { + writePrefixedStringAttribute(XML_3MF_NAMESPACEPREFIX_BINARY, XML_3MF_ATTRIBUTE_MESH_BINARY, m_pBinaryStreamWriter->getIndexPath().c_str()); + } + m_pProgressMonitor->SetProgressIdentifier(ProgressIdentifier::PROGRESS_WRITENODES); // Write Vertices writeStartElement(XML_3MF_ELEMENT_VERTICES); - for (nNodeIndex = 0; nNodeIndex < nNodeCount; nNodeIndex++) { - // Get Mesh Node - MESHNODE * pMeshNode = pMesh->getNode(nNodeIndex); - writeVertexData(pMeshNode); - - /* The following works, but would be a major output speed bottleneck! - - // Write Vertex - writeStartElement(XML_3MF_ELEMENT_VERTEX); - writeFloatAttribute(XML_3MF_ATTRIBUTE_VERTEX_X, pMeshNode->m_position.m_values.x); - writeFloatAttribute(XML_3MF_ATTRIBUTE_VERTEX_Y, pMeshNode->m_position.m_values.y); - writeFloatAttribute(XML_3MF_ATTRIBUTE_VERTEX_Z, pMeshNode->m_position.m_values.z); - writeEndElement(); */ - - if (nNodeIndex % PROGRESS_NODEUPDATE == PROGRESS_NODEUPDATE-1) { - m_pProgressMonitor->ReportProgressAndQueryCancelled(true); + if (m_pBinaryStreamWriter != nullptr) { + + if (nNodeCount > 0) { + + MESHNODE* pMeshNode = pMesh->getNode(0); + + std::vector XValues; + std::vector YValues; + std::vector ZValues; + XValues.resize(nNodeCount); + YValues.resize(nNodeCount); + ZValues.resize(nNodeCount); + + for (nNodeIndex = 0; nNodeIndex < nNodeCount; nNodeIndex++) { + // Get Mesh Node + MESHNODE* pMeshNode = pMesh->getNode(nNodeIndex); + XValues[nNodeIndex] = pMeshNode->m_position.m_fields[0]; + YValues[nNodeIndex] = pMeshNode->m_position.m_fields[1]; + ZValues[nNodeIndex] = pMeshNode->m_position.m_fields[2]; + } + + unsigned int binaryKeyX; + unsigned int binaryKeyY; + unsigned int binaryKeyZ; + + if (m_pBinaryStreamWriter->getFloatQuantization()) { + + float fUnits = (float) m_pBinaryStreamWriter->getFloatQuantizationUnits(); + auto predictionType = m_pBinaryStreamWriter->getPredictionType(); + + binaryKeyX = m_pBinaryStreamWriter->addFloatArray(XValues.data(), nNodeCount, predictionType, fUnits); + binaryKeyY = m_pBinaryStreamWriter->addFloatArray(YValues.data(), nNodeCount, predictionType, fUnits); + binaryKeyZ = m_pBinaryStreamWriter->addFloatArray(ZValues.data(), nNodeCount, predictionType, fUnits); + } + else { + binaryKeyX = m_pBinaryStreamWriter->addRawFloatArray(XValues.data(), nNodeCount); + binaryKeyY = m_pBinaryStreamWriter->addRawFloatArray(YValues.data(), nNodeCount); + binaryKeyZ = m_pBinaryStreamWriter->addRawFloatArray(ZValues.data(), nNodeCount); + } + + writeStartElementWithPrefix(XML_3MF_ELEMENT_VERTEX, XML_3MF_NAMESPACEPREFIX_BINARY); + writeIntAttribute(XML_3MF_ATTRIBUTE_VERTEX_X, binaryKeyX); + writeIntAttribute(XML_3MF_ATTRIBUTE_VERTEX_Y, binaryKeyY); + writeIntAttribute(XML_3MF_ATTRIBUTE_VERTEX_Z, binaryKeyZ); + writeEndElement(); + + } + + } + else { + + + for (nNodeIndex = 0; nNodeIndex < nNodeCount; nNodeIndex++) { + // Get Mesh Node + MESHNODE* pMeshNode = pMesh->getNode(nNodeIndex); + writeVertexData(pMeshNode); + + /* The following works, but would be a major output speed bottleneck! + + // Write Vertex + writeStartElement(XML_3MF_ELEMENT_VERTEX); + writeFloatAttribute(XML_3MF_ATTRIBUTE_VERTEX_X, pMeshNode->m_position.m_values.x); + writeFloatAttribute(XML_3MF_ATTRIBUTE_VERTEX_Y, pMeshNode->m_position.m_values.y); + writeFloatAttribute(XML_3MF_ATTRIBUTE_VERTEX_Z, pMeshNode->m_position.m_values.z); + writeEndElement(); */ + + if (nNodeIndex % PROGRESS_NODEUPDATE == PROGRESS_NODEUPDATE - 1) { + m_pProgressMonitor->ReportProgressAndQueryCancelled(true); + } } } writeFullEndElement(); @@ -178,73 +238,103 @@ namespace NMR { m_pProgressMonitor->SetProgressIdentifier(ProgressIdentifier::PROGRESS_WRITETRIANGLES); // Write Triangles writeStartElement(XML_3MF_ELEMENT_TRIANGLES); - for (nFaceIndex = 0; nFaceIndex < nFaceCount; nFaceIndex++) { - if (nFaceIndex % PROGRESS_TRIANGLEUPDATE == PROGRESS_TRIANGLEUPDATE - 1) { - m_pProgressMonitor->ReportProgressAndQueryCancelled(true); - } + if (m_pBinaryStreamWriter != nullptr) { + std::vector Node1Indices; + std::vector Node2Indices; + std::vector Node3Indices; + Node1Indices.resize(nFaceCount); + Node2Indices.resize(nFaceCount); + Node3Indices.resize(nFaceCount); + + for (nFaceIndex = 0; nFaceIndex < nFaceCount; nFaceIndex++) { + MESHFACE* pMeshFace = pMesh->getFace(nFaceIndex); + Node1Indices[nFaceIndex] = (nfInt32)pMeshFace->m_nodeindices[0]; + Node2Indices[nFaceIndex] = (nfInt32)pMeshFace->m_nodeindices[1]; + Node3Indices[nFaceIndex] = (nfInt32)pMeshFace->m_nodeindices[2]; + } + + unsigned int binaryKeyV1 = m_pBinaryStreamWriter->addIntArray(Node1Indices.data(), nFaceCount, eptNoPredicition); + unsigned int binaryKeyV2 = m_pBinaryStreamWriter->addIntArray(Node2Indices.data(), nFaceCount, eptNoPredicition); + unsigned int binaryKeyV3 = m_pBinaryStreamWriter->addIntArray(Node3Indices.data(), nFaceCount, eptNoPredicition); + + writeStartElementWithPrefix(XML_3MF_ELEMENT_TRIANGLE, XML_3MF_NAMESPACEPREFIX_BINARY); + writeIntAttribute(XML_3MF_ATTRIBUTE_TRIANGLE_V1, binaryKeyV1); + writeIntAttribute(XML_3MF_ATTRIBUTE_TRIANGLE_V2, binaryKeyV2); + writeIntAttribute(XML_3MF_ATTRIBUTE_TRIANGLE_V3, binaryKeyV3); + writeEndElement(); + + } + else { - // Get Mesh Face - MESHFACE * pMeshFace = pMesh->getFace(nFaceIndex); - - UniqueResourceID nPropertyID = 0; - ModelResourceIndex nPropertyIndex1 = 0; - ModelResourceIndex nPropertyIndex2 = 0; - ModelResourceIndex nPropertyIndex3 = 0; - - nfChar * pAdditionalString = nullptr; - // Retrieve Property Indices - if (pProperties != nullptr) { - MESHINFORMATION_PROPERTIES* pFaceData = (MESHINFORMATION_PROPERTIES*)pProperties->getFaceData(nFaceIndex); - if (pFaceData != nullptr) { - if (pFaceData->m_nUniqueResourceID) { - nPropertyID = pFaceData->m_nUniqueResourceID; - nPropertyIndex1 = m_pPropertyIndexMapping->mapPropertyIDToIndex(nPropertyID, pFaceData->m_nPropertyIDs[0]); - nPropertyIndex2 = m_pPropertyIndexMapping->mapPropertyIDToIndex(nPropertyID, pFaceData->m_nPropertyIDs[1]); - nPropertyIndex3 = m_pPropertyIndexMapping->mapPropertyIDToIndex(nPropertyID, pFaceData->m_nPropertyIDs[2]); + for (nFaceIndex = 0; nFaceIndex < nFaceCount; nFaceIndex++) { + if (nFaceIndex % PROGRESS_TRIANGLEUPDATE == PROGRESS_TRIANGLEUPDATE - 1) { + m_pProgressMonitor->ReportProgressAndQueryCancelled(true); + } + + // Get Mesh Face + MESHFACE* pMeshFace = pMesh->getFace(nFaceIndex); + + UniqueResourceID nPropertyID = 0; + ModelResourceIndex nPropertyIndex1 = 0; + ModelResourceIndex nPropertyIndex2 = 0; + ModelResourceIndex nPropertyIndex3 = 0; + + nfChar* pAdditionalString = nullptr; + // Retrieve Property Indices + if (pProperties != nullptr) { + MESHINFORMATION_PROPERTIES* pFaceData = (MESHINFORMATION_PROPERTIES*)pProperties->getFaceData(nFaceIndex); + if (pFaceData != nullptr) { + if (pFaceData->m_nUniqueResourceID) { + nPropertyID = pFaceData->m_nUniqueResourceID; + nPropertyIndex1 = m_pPropertyIndexMapping->mapPropertyIDToIndex(nPropertyID, pFaceData->m_nPropertyIDs[0]); + nPropertyIndex2 = m_pPropertyIndexMapping->mapPropertyIDToIndex(nPropertyID, pFaceData->m_nPropertyIDs[1]); + nPropertyIndex3 = m_pPropertyIndexMapping->mapPropertyIDToIndex(nPropertyID, pFaceData->m_nPropertyIDs[2]); + } } } - } - if (nPropertyID != 0) { - bMeshHasAProperty = true; - // TODO: this is slow - ModelResourceID nPropertyModelResourceID = m_pModel->findPackageResourceID(nPropertyID)->getModelResourceID(); - if ((nPropertyIndex1 != nPropertyIndex2) || (nPropertyIndex1 != nPropertyIndex3)) { - writeFaceData_ThreeProperties(pMeshFace, nPropertyModelResourceID, nPropertyIndex1, nPropertyIndex2, nPropertyIndex3, pAdditionalString); - } - else { - if ((nPropertyID == nObjectLevelPropertyID) && (nPropertyIndex1 == nObjectLevelPropertyIndex)){ - writeFaceData_Plain(pMeshFace, pAdditionalString); - } else { - writeFaceData_OneProperty(pMeshFace, nPropertyModelResourceID, nPropertyIndex1, pAdditionalString); + if (nPropertyID != 0) { + bMeshHasAProperty = true; + // TODO: this is slow + ModelResourceID nPropertyModelResourceID = m_pModel->findPackageResourceID(nPropertyID)->getModelResourceID(); + if ((nPropertyIndex1 != nPropertyIndex2) || (nPropertyIndex1 != nPropertyIndex3)) { + writeFaceData_ThreeProperties(pMeshFace, nPropertyModelResourceID, nPropertyIndex1, nPropertyIndex2, nPropertyIndex3, pAdditionalString); + } + else { + if ((nPropertyID == nObjectLevelPropertyID) && (nPropertyIndex1 == nObjectLevelPropertyIndex)) { + writeFaceData_Plain(pMeshFace, pAdditionalString); + } + else { + writeFaceData_OneProperty(pMeshFace, nPropertyModelResourceID, nPropertyIndex1, pAdditionalString); + } } } - } - else - { - writeFaceData_Plain(pMeshFace, pAdditionalString); - } + else + { + writeFaceData_Plain(pMeshFace, pAdditionalString); + } - /* The following works, but would be a major output speed bottleneck! - - // Write Triangle - writeStartElement(XML_3MF_ELEMENT_TRIANGLE); - writeIntAttribute(XML_3MF_ATTRIBUTE_TRIANGLE_V1, pMeshFace->m_nodeindices[0]); - writeIntAttribute(XML_3MF_ATTRIBUTE_TRIANGLE_V2, pMeshFace->m_nodeindices[1]); - writeIntAttribute(XML_3MF_ATTRIBUTE_TRIANGLE_V3, pMeshFace->m_nodeindices[2]); - - // Write Property Indices - if (nPropertyID != 0) { - writeIntAttribute(XML_3MF_ATTRIBUTE_TRIANGLE_PID, nPropertyID); - writeIntAttribute(XML_3MF_ATTRIBUTE_TRIANGLE_P1, nPropertyIndex1); - if ((nPropertyIndex1 != nPropertyIndex2) || (nPropertyIndex1 != nPropertyIndex3)) { - writeIntAttribute(XML_3MF_ATTRIBUTE_TRIANGLE_P2, nPropertyIndex2); - writeIntAttribute(XML_3MF_ATTRIBUTE_TRIANGLE_P3, nPropertyIndex3); + /* The following works, but would be a major output speed bottleneck! + + // Write Triangle + writeStartElement(XML_3MF_ELEMENT_TRIANGLE); + writeIntAttribute(XML_3MF_ATTRIBUTE_TRIANGLE_V1, pMeshFace->m_nodeindices[0]); + writeIntAttribute(XML_3MF_ATTRIBUTE_TRIANGLE_V2, pMeshFace->m_nodeindices[1]); + writeIntAttribute(XML_3MF_ATTRIBUTE_TRIANGLE_V3, pMeshFace->m_nodeindices[2]); + + // Write Property Indices + if (nPropertyID != 0) { + writeIntAttribute(XML_3MF_ATTRIBUTE_TRIANGLE_PID, nPropertyID); + writeIntAttribute(XML_3MF_ATTRIBUTE_TRIANGLE_P1, nPropertyIndex1); + if ((nPropertyIndex1 != nPropertyIndex2) || (nPropertyIndex1 != nPropertyIndex3)) { + writeIntAttribute(XML_3MF_ATTRIBUTE_TRIANGLE_P2, nPropertyIndex2); + writeIntAttribute(XML_3MF_ATTRIBUTE_TRIANGLE_P3, nPropertyIndex3); + } } - } - writeEndElement(); */ + writeEndElement(); */ + } } writeFullEndElement(); diff --git a/Source/Model/Writer/v100/NMR_ModelWriterNode100_Model.cpp b/Source/Model/Writer/v100/NMR_ModelWriterNode100_Model.cpp index fdf97fa43..36064b939 100644 --- a/Source/Model/Writer/v100/NMR_ModelWriterNode100_Model.cpp +++ b/Source/Model/Writer/v100/NMR_ModelWriterNode100_Model.cpp @@ -45,6 +45,7 @@ This is the class for exporting the 3mf model stream root node. #include "Model/Classes/NMR_ModelMultiPropertyGroup.h" #include "Model/Classes/NMR_ModelMeshObject.h" #include "Model/Classes/NMR_ModelComponentsObject.h" +#include "Model/Classes/NMR_ModelToolpath.h" #include "Model/Classes/NMR_Model.h" #include "Common/NMR_Exception.h" #include "Common/NMR_Exception_Windows.h" @@ -58,7 +59,8 @@ This is the class for exporting the 3mf model stream root node. namespace NMR { CModelWriterNode100_Model::CModelWriterNode100_Model(_In_ CModel * pModel, _In_ CXmlWriter * pXMLWriter, _In_ PProgressMonitor pProgressMonitor, - _In_ nfUint32 nDecimalPrecision, nfBool bWritesRootModel) : CModelWriterNode_ModelBase(pModel, pXMLWriter, pProgressMonitor), m_nDecimalPrecision(nDecimalPrecision) + _In_ nfUint32 nDecimalPrecision, nfBool bWritesRootModel) : CModelWriterNode_ModelBase(pModel, pXMLWriter, pProgressMonitor), m_nDecimalPrecision(nDecimalPrecision), + m_bWriteBinaryExtension (false) { m_pPropertyIndexMapping = std::make_shared(); m_bIsRootModel = bWritesRootModel; @@ -69,6 +71,7 @@ namespace NMR { m_bWriteSliceExtension = true; m_bWriteSecureContentExtension = true; m_bWriteBaseMaterials = true; + m_bWriteToolpaths = true; m_bWriteObjects = true; m_bWriteCustomNamespaces = true; @@ -86,7 +89,7 @@ namespace NMR { std::string prefix = "customXMLNS" + std::to_string(m_pXMLWriter->GetNamespaceCount()); std::string sDummy; if (!m_pXMLWriter->GetNamespacePrefix(md->getNameSpace(), sDummy)) { - m_pXMLWriter->RegisterCustomNameSpace(md->getNameSpace(), prefix); + m_pXMLWriter->RegisterCustomNameSpace(md->getNameSpace(), prefix, false); } } } @@ -152,6 +155,15 @@ namespace NMR { } } + if (m_bWriteToolpaths) { + writeConstPrefixedStringAttribute(XML_3MF_ATTRIBUTE_XMLNS, XML_3MF_NAMESPACEPREFIX_TOOLPATH, XML_3MF_NAMESPACE_TOOLPATHSPEC); + if (m_pModel->RequireExtension(XML_3MF_NAMESPACE_TOOLPATHSPEC)) { + if (sRequiredExtensions.size() > 0) + sRequiredExtensions = sRequiredExtensions + " "; + sRequiredExtensions = sRequiredExtensions + XML_3MF_NAMESPACEPREFIX_TOOLPATH; + } + } + if (m_bWriteSecureContentExtension) { writeConstPrefixedStringAttribute(XML_3MF_ATTRIBUTE_XMLNS, XML_3MF_NAMESPACEPREFIX_SECURECONTENT, XML_3MF_NAMESPACE_SECURECONTENTSPEC); if (m_pModel->RequireExtension(XML_3MF_NAMESPACE_SECURECONTENTSPEC)) { @@ -161,6 +173,10 @@ namespace NMR { } } + if (m_bWriteBinaryExtension) { + writeConstPrefixedStringAttribute(XML_3MF_ATTRIBUTE_XMLNS, XML_3MF_NAMESPACEPREFIX_BINARY, XML_3MF_NAMESPACE_BINARYSPEC); + } + if (m_bWriteCustomNamespaces) { nfUint32 nNSCount = m_pXMLWriter->GetNamespaceCount(); for (nfUint32 iNSCount = 0; iNSCount < nNSCount; iNSCount++) { @@ -471,8 +487,18 @@ namespace NMR { writeMetaDataGroup(pObject->metaDataGroup()); if (pMeshObject) { + + CChunkedBinaryStreamWriter* pMeshBinaryWriter = nullptr; + std::string sMeshBinaryPath; + + auto iBinaryIter = m_BinaryStreamWriters.find(pMeshObject->uuid()->toString()); + if (iBinaryIter != m_BinaryStreamWriters.end()) { + sMeshBinaryPath = iBinaryIter->second.first; + pMeshBinaryWriter = iBinaryIter->second.second; + } + CModelWriterNode100_Mesh ModelWriter_Mesh(pMeshObject, m_pXMLWriter, m_pProgressMonitor, - m_pPropertyIndexMapping, m_nDecimalPrecision, m_bWriteMaterialExtension, m_bWriteBeamLatticeExtension); + m_pPropertyIndexMapping, m_nDecimalPrecision, m_bWriteMaterialExtension, m_bWriteBeamLatticeExtension, pMeshBinaryWriter); ModelWriter_Mesh.writeToXML(); } @@ -775,6 +801,8 @@ namespace NMR { if (m_bWriteSliceExtension) { writeSliceStacks(); } + if (m_bWriteToolpaths) + writeToolpaths(); if (m_bWriteObjects) writeObjects(); } @@ -884,4 +912,130 @@ namespace NMR { writeFullEndElement(); } + void CModelWriterNode100_Model::registerStreamWriter(const std::string& sInstanceUUID, const std::string& sPath, CChunkedBinaryStreamWriter* pBinaryStreamWriter) + { + if (pBinaryStreamWriter == nullptr) + throw CNMRException(NMR_ERROR_INVALIDPARAM); + m_BinaryStreamWriters.insert(std::make_pair(sInstanceUUID, std::make_pair(sPath, pBinaryStreamWriter))); + } + + void CModelWriterNode100_Model::setWriteBinaryExtension(bool bWriteBinaryExtension) + { + m_bWriteBinaryExtension = bWriteBinaryExtension; + } + + void CModelWriterNode100_Model::registerCustomNamespace(const std::string& sPrefix, const std::string& sNamespace, bool bFailIfExisting) + { + m_pXMLWriter->RegisterCustomNameSpace(sNamespace, sPrefix, bFailIfExisting); + } + + void CModelWriterNode100_Model::writeCustomToolpathXMLNode(PCustomXMLNode pXMLNode, const std::string& sPrefix) + { + __NMRASSERT(pXMLNode.get() != nullptr); + + std::string sNodeName = pXMLNode->getName(); + + writeStartElementWithPrefix(sNodeName.c_str (), sPrefix.c_str ()); + + size_t nAttributeCount = pXMLNode->getAttributeCount(); + for (size_t nAttributeIndex = 0; nAttributeIndex < nAttributeCount; nAttributeIndex++) { + auto pAttribute = pXMLNode->getAttributeByIndex(nAttributeIndex); + std::string sAttributeName = pAttribute->getName(); + std::string sAttributeValue = pAttribute->getValue(); + writeStringAttribute(sAttributeName.c_str(), sAttributeValue); + } + + size_t nChildCount = pXMLNode->getChildCount(); + for (size_t nChildIndex = 0; nChildIndex < nChildCount; nChildIndex++) { + writeCustomToolpathXMLNode(pXMLNode->getChildByIndex(nChildIndex), sPrefix); + } + + writeEndElement(); + + } + + void CModelWriterNode100_Model::writeToolpaths() + { + nfUint32 nCount = m_pModel->getResourceCount(); + + for (nfUint32 nIndex = 0; nIndex < nCount; nIndex++) { + + auto pResource = m_pModel->getResource(nIndex); + auto pToolpathResource = dynamic_cast (pResource.get()); + + if (pToolpathResource != nullptr) { + + writeStartElementWithPrefix(XML_3MF_ELEMENT_TOOLPATHRESOURCE, XML_3MF_NAMESPACEPREFIX_TOOLPATH); + writeIntAttribute(XML_3MF_ATTRIBUTE_TOOLPATH_ID, pToolpathResource->getPackageResourceID()->getUniqueID()); + writeFloatAttribute(XML_3MF_ATTRIBUTE_TOOLPATH_UNITFACTOR, (nfFloat)pToolpathResource->getUnitFactor()); + + uint32_t nXMLDataCount = pToolpathResource->getCustomXMLDataCount(); + if (nXMLDataCount > 0) { + writeStartElementWithPrefix(XML_3MF_ELEMENT_TOOLPATHDATA, XML_3MF_NAMESPACEPREFIX_TOOLPATH); + + for (uint32_t nXMLDataIndex = 0; nXMLDataIndex < nXMLDataCount; nXMLDataIndex++) { + auto pXMLData = pToolpathResource->getCustomXMLData(nXMLDataIndex); + + std::string sNameSpacePrefix; + if (m_pXMLWriter->GetNamespacePrefix(pXMLData->getNameSpace(), sNameSpacePrefix)) { + writeCustomToolpathXMLNode (pXMLData->getRootNode (), sNameSpacePrefix); + } + + } + + writeFullEndElement(); + } + + writeStartElementWithPrefix(XML_3MF_ELEMENT_TOOLPATHPROFILES, XML_3MF_NAMESPACEPREFIX_TOOLPATH); + nfUint32 nProfileCount = pToolpathResource->getProfileCount(); + for (nfUint32 nProfileIndex = 0; nProfileIndex < nProfileCount; nProfileIndex++) { + auto pProfile = pToolpathResource->getProfile(nProfileIndex); + + writeStartElementWithPrefix(XML_3MF_ELEMENT_TOOLPATHPROFILE, XML_3MF_NAMESPACEPREFIX_TOOLPATH); + writeStringAttribute(XML_3MF_ATTRIBUTE_TOOLPATHPROFILE_UUID, pProfile->getUUID()); + writeStringAttribute(XML_3MF_ATTRIBUTE_TOOLPATHPROFILE_NAME, pProfile->getName()); + + auto profileValues = pProfile->listValues(); + for (auto profileValue : profileValues) { + if (profileValue.m_sNameSpace.empty()) { + writeStringAttribute(profileValue.m_sValueName.c_str(), profileValue.m_sValue); + } + else { + std::string sPrefix; + if (m_pXMLWriter->GetNamespacePrefix(profileValue.m_sNameSpace, sPrefix)) { + writePrefixedStringAttribute(sPrefix.c_str(), profileValue.m_sValueName.c_str(), profileValue.m_sValue); + } + } + } + + writeEndElement(); + + } + + writeFullEndElement(); + + + writeStartElementWithPrefix(XML_3MF_ELEMENT_TOOLPATHLAYERS, XML_3MF_NAMESPACEPREFIX_TOOLPATH); + nfUint32 nLayerCount = pToolpathResource->getLayerCount(); + for (nfUint32 nLayerIndex = 0; nLayerIndex < nLayerCount; nLayerIndex++) { + auto pLayer = pToolpathResource->getLayer(nLayerIndex); + + writeStartElementWithPrefix(XML_3MF_ELEMENT_TOOLPATHLAYER, XML_3MF_NAMESPACEPREFIX_TOOLPATH); + writeIntAttribute(XML_3MF_ATTRIBUTE_TOOLPATHLAYER_ZTOP, pLayer->getMaxZ()); + writeStringAttribute(XML_3MF_ATTRIBUTE_TOOLPATHLAYER_PATH, pLayer->getLayerDataPath()); + writeEndElement(); + + } + + + writeFullEndElement(); + + writeFullEndElement(); + + + } + + } + } + }